Skip to content
Snippets Groups Projects
Commit ec14714a authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #8925 TIME 1:20 add avatar external profile

parent edaff4e8
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,9 @@
<mat-list-item *ngFor="let diffusion of visaWorkflow.items;let i=index" cdkDrag class="columns workflow"
[cdkDragDisabled]="!injectDatas.editable" [class.notDraggable]="!injectDatas.editable"
[class.notEditable]="!injectDatas.editable" [class.processed]="diffusion.process_date != null">
<mat-icon mat-list-icon class="fa fa-user fa-2x" color="primary"></mat-icon>
<mat-icon *ngIf="!injectDatas.editable" mat-list-icon class="fa fa-user fa-2x" color="primary"></mat-icon>
<mat-icon *ngIf="injectDatas.editable" class="avatar" mat-list-icon color="primary"
[style.background-image]="'url('+diffusion.picture+')'"></mat-icon>
<ng-container *ngIf="!injectDatas.editable">
<mat-icon mat-list-icon class="fa fa-hourglass fa-2x"
[ngClass]="{'fa-hourglass': diffusion.process_date == null,'fa-check': diffusion.process_date != null}"
......
......@@ -100,4 +100,13 @@
text-align: left;
font-size: 90%;
}
}
.avatar {
border: solid 3px #F99830;
height: 45px !important;
width: 45px !important;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
\ No newline at end of file
......@@ -17,8 +17,8 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
lang: any = LANG;
visaWorkflow: any = {
roles: ['sign','visa'],
items : []
roles: ['sign', 'visa'],
items: []
};
loading: boolean = false;
data: any;
......@@ -27,7 +27,7 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
constructor(public http: HttpClient, private notify: NotificationService) {
super(http, ['signatureBookUsers']);
}
}
ngOnInit(): void { }
......@@ -44,10 +44,17 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
this.http.get("../../rest/listTemplates/entities/" + entityId)
.subscribe((data: any) => {
data.listTemplate.forEach((element:any) => {
data.listTemplate.forEach((element: any, index : number) => {
if (element.object_type === 'VISA_CIRCUIT') {
element.requested_signature = (element.item_mode === 'visa' ? false : true);
this.visaWorkflow.items.push(element);
this.http.get("../../rest/maarchParapheur/user/" + element.externalId.maarchParapheur + "/picture")
.subscribe((data: any) => {
element.picture = data.picture
element.requested_signature = (element.item_mode === 'visa' ? false : true);
this.visaWorkflow.items.push(element);
}, (err: any) => {
this.notify.handleErrors(err);
});
}
});
this.loading = false;
......@@ -58,14 +65,14 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
this.loading = true;
this.visaWorkflow.items = [];
this.http.get("../../rest/res/" + resId + "/visaCircuit")
.subscribe((data: any) => {
data.forEach((element:any) => {
this.visaWorkflow.items.push(element);
.subscribe((data: any) => {
data.forEach((element: any) => {
this.visaWorkflow.items.push(element);
});
this.loading = false;
}, (err: any) => {
this.notify.handleErrors(err);
});
this.loading = false;
}, (err: any) => {
this.notify.handleErrors(err);
});
}
deleteItem(index: number) {
......@@ -94,15 +101,22 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
return usersMissing;
}
addItem(event: any) {
const user = {
'externalId': event.option.value.externalId,
'labelToDisplay' : event.option.value.idToDisplay,
'requested_signature' : false,
'labelToDisplay': event.option.value.idToDisplay,
'requested_signature': false,
'picture': ''
}
this.visaWorkflow.items.push(user);
$j('#availableUsers').blur();
this.userCtrl.setValue('');
this.http.get("../../rest/maarchParapheur/user/" + user.externalId.maarchParapheur + "/picture")
.subscribe((data: any) => {
this.visaWorkflow.items[this.visaWorkflow.items.length - 1].picture = data.picture;
}, (err: any) => {
this.notify.handleErrors(err);
});
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment