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

FEAT #12026 TIME 1:30 format data sign pos

parent 081b3c93
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
<mat-menu #menu="matMenu" class="docToSignTemplateMenu">
<button mat-menu-item *ngFor="let resource of resourcesToSign" (click)="openSignaturePosition(resource)"
style="font-size:12px;">
<mat-icon style="height: auto;" class="fas fa-compress-arrows-alt"></mat-icon>
<mat-icon style="height: auto;" class="fas fa-compress-arrows-alt" [class.position]="hasPositions(resource)" [class.noPosition]="!hasPositions(resource)"></mat-icon>
<span>
<span color="primary">{{resource.chrono}}</span>&nbsp;- {{resource.title}}
</span>
......
@import '../../../../css/vars.scss';
.fieldsetdContainer {
position: relative;
......@@ -37,4 +39,12 @@
::ng-deep.docToSignTemplateMenu.mat-menu-panel {
max-width: 100% !important;
}
.noPosition {
opacity: 0.3;
}
.position {
color: $accent
}
\ No newline at end of file
......@@ -63,18 +63,25 @@ export class MaarchParaphComponent implements OnInit {
}
getDatas() {
const formatedData: any = { steps : []};
const workflow = this.appVisaWorkflow.getWorkflow();
workflow.forEach((element: any) => {
this.externalSignatoryBookDatas.steps.push(
{
'externalId': element.externalId.maarchParapheur,
'action': element.requested_signature ? 'sign' : 'visa',
}
);
this.resourcesToSign.forEach((resource: any) => {
workflow.forEach((element: any, index: number) => {
formatedData['steps'].push(
{
'resId': resource.resId,
'mainDocument': resource.mainDocument,
'externalId': element.externalId.maarchParapheur,
'sequence' : index,
'action': element.requested_signature ? 'sign' : 'visa',
'signaturePositions': resource.signaturePositions !== undefined ? resource.signaturePositions : [],
}
);
});
});
return this.externalSignatoryBookDatas;
return formatedData;
}
openSignaturePosition(resource: any) {
......@@ -101,4 +108,12 @@ export class MaarchParaphComponent implements OnInit {
})
).subscribe();
}
hasPositions(resource: any) {
if (this.resourcesToSign.filter((itemToSign: any) => itemToSign.resId === resource.resId && itemToSign.mainDocument === resource.mainDocument)[0]['signaturePositions'] === undefined) {
return false;
} else {
return this.resourcesToSign.filter((itemToSign: any) => itemToSign.resId === resource.resId && itemToSign.mainDocument === resource.mainDocument)[0]['signaturePositions'].length > 0;
}
}
}
......@@ -97,7 +97,7 @@
.signUserName {
position: absolute;
font-size: 10px;
bottom: -25px;
bottom: 5px;
font-weight: normal;
color: $primary;
color: white;
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ import { tap, finalize, catchError } from 'rxjs/operators';
import { of } from 'rxjs';
@Component({
templateUrl: "send-external-signatory-book-action.component.html",
templateUrl: 'send-external-signatory-book-action.component.html',
styleUrls: ['send-external-signatory-book-action.component.scss'],
})
export class SendExternalSignatoryBookActionComponent implements OnInit {
......@@ -81,22 +81,6 @@ export class SendExternalSignatoryBookActionComponent implements OnInit {
return new Promise((resolve, reject) => {
this.http.post(`../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/checkExternalSignatoryBook`, { resources: this.data.resIds }).pipe(
tap((data: any) => {
// FOR TEST
const test = [
{
resId: 103,
chrono: 'MAARCH/2020A/2',
subject: 'Réponse à signer',
},
{
resId: 104,
chrono: 'MAARCH/2020A/4',
subject: 'Réponse à signer 2',
}
];
test.forEach((res: any) => {
this.toggleDocToSign(true, res, false);
});
this.additionalsInfos = data.additionalsInfos;
if (this.additionalsInfos.attachments.length > 0) {
this.signatoryBookEnabled = data.signatureBookEnabled;
......@@ -105,6 +89,9 @@ export class SendExternalSignatoryBookActionComponent implements OnInit {
this.resourcesMailing.push(value);
}
});
data.availableResources.forEach((element: any) => {
this.toggleDocToSign(true, element, false);
});
}
this.errors = data.errors;
resolve(true);
......
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