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 @@ ...@@ -16,7 +16,9 @@
<mat-list-item *ngFor="let diffusion of visaWorkflow.items;let i=index" cdkDrag class="columns workflow" <mat-list-item *ngFor="let diffusion of visaWorkflow.items;let i=index" cdkDrag class="columns workflow"
[cdkDragDisabled]="!injectDatas.editable" [class.notDraggable]="!injectDatas.editable" [cdkDragDisabled]="!injectDatas.editable" [class.notDraggable]="!injectDatas.editable"
[class.notEditable]="!injectDatas.editable" [class.processed]="diffusion.process_date != null"> [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"> <ng-container *ngIf="!injectDatas.editable">
<mat-icon mat-list-icon class="fa fa-hourglass fa-2x" <mat-icon mat-list-icon class="fa fa-hourglass fa-2x"
[ngClass]="{'fa-hourglass': diffusion.process_date == null,'fa-check': diffusion.process_date != null}" [ngClass]="{'fa-hourglass': diffusion.process_date == null,'fa-check': diffusion.process_date != null}"
......
...@@ -100,4 +100,13 @@ ...@@ -100,4 +100,13 @@
text-align: left; text-align: left;
font-size: 90%; 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 ...@@ -17,8 +17,8 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
lang: any = LANG; lang: any = LANG;
visaWorkflow: any = { visaWorkflow: any = {
roles: ['sign','visa'], roles: ['sign', 'visa'],
items : [] items: []
}; };
loading: boolean = false; loading: boolean = false;
data: any; data: any;
...@@ -27,7 +27,7 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit ...@@ -27,7 +27,7 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
constructor(public http: HttpClient, private notify: NotificationService) { constructor(public http: HttpClient, private notify: NotificationService) {
super(http, ['signatureBookUsers']); super(http, ['signatureBookUsers']);
} }
ngOnInit(): void { } ngOnInit(): void { }
...@@ -44,10 +44,17 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit ...@@ -44,10 +44,17 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
this.http.get("../../rest/listTemplates/entities/" + entityId) this.http.get("../../rest/listTemplates/entities/" + entityId)
.subscribe((data: any) => { .subscribe((data: any) => {
data.listTemplate.forEach((element:any) => { data.listTemplate.forEach((element: any, index : number) => {
if (element.object_type === 'VISA_CIRCUIT') { if (element.object_type === 'VISA_CIRCUIT') {
element.requested_signature = (element.item_mode === 'visa' ? false : true); this.http.get("../../rest/maarchParapheur/user/" + element.externalId.maarchParapheur + "/picture")
this.visaWorkflow.items.push(element); .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; this.loading = false;
...@@ -58,14 +65,14 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit ...@@ -58,14 +65,14 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
this.loading = true; this.loading = true;
this.visaWorkflow.items = []; this.visaWorkflow.items = [];
this.http.get("../../rest/res/" + resId + "/visaCircuit") this.http.get("../../rest/res/" + resId + "/visaCircuit")
.subscribe((data: any) => { .subscribe((data: any) => {
data.forEach((element:any) => { data.forEach((element: any) => {
this.visaWorkflow.items.push(element); 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) { deleteItem(index: number) {
...@@ -94,15 +101,22 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit ...@@ -94,15 +101,22 @@ export class VisaWorkflowComponent extends AutoCompletePlugin implements OnInit
return usersMissing; return usersMissing;
} }
addItem(event: any) { addItem(event: any) {
const user = { const user = {
'externalId': event.option.value.externalId, 'externalId': event.option.value.externalId,
'labelToDisplay' : event.option.value.idToDisplay, 'labelToDisplay': event.option.value.idToDisplay,
'requested_signature' : false, 'requested_signature': false,
'picture': ''
} }
this.visaWorkflow.items.push(user); this.visaWorkflow.items.push(user);
$j('#availableUsers').blur(); $j('#availableUsers').blur();
this.userCtrl.setValue(''); 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