Skip to content
Snippets Groups Projects
Commit 216dc22e authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #23944 TIME 0:10 fix if condition

parent fd68d94b
No related branches found
No related tags found
No related merge requests found
...@@ -378,32 +378,33 @@ export class IndexationComponent implements OnInit { ...@@ -378,32 +378,33 @@ export class IndexationComponent implements OnInit {
} }
async signPos(index: number) { async signPos(index: number) {
const allUsers: any[] = this.appVisaWorkflow.getCurrentWorkflow(); if (this.appVisaWorkflow.getCurrentWorkflow().length > 0) {
const usersWithNoteRole: any[] = this.appVisaWorkflow.getCurrentWorkflow().filter((user: any) => user.role === 'note'); const allUsers: any[] = this.appVisaWorkflow.getCurrentWorkflow();
const usersWithNoteRole: any[] = this.appVisaWorkflow.getCurrentWorkflow().filter((user: any) => user.role === 'note');
if ((allUsers.length === 1 && this.appVisaWorkflow.getCurrentWorkflow()[0].role === 'note') || (allUsers.length === usersWithNoteRole.length)) { if ((allUsers.length === 1 && this.appVisaWorkflow.getCurrentWorkflow()[0].role === 'note') || (allUsers.length === usersWithNoteRole.length)) {
this.notificationService.error('lang.cannotSetSignature'); this.notificationService.error('lang.cannotSetSignature');
} else if (this.appVisaWorkflow.getCurrentWorkflow().length > 0) { } else {
this.appVisaWorkflow.getCurrentWorkflow().forEach((user: any, indexUser: number) => { this.appVisaWorkflow.getCurrentWorkflow().forEach((user: any, indexUser: number) => {
if (user.signaturePositions === undefined) { if (user.signaturePositions === undefined) {
this.appVisaWorkflow.visaWorkflow[indexUser].signaturePositions = []; this.appVisaWorkflow.visaWorkflow[indexUser].signaturePositions = [];
} }
}); });
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: SignaturePositionComponent, component: SignaturePositionComponent,
cssClass: 'custom-alert-fullscreen', cssClass: 'custom-alert-fullscreen',
componentProps: { componentProps: {
workflow: this.appVisaWorkflow.getCurrentWorkflow(), workflow: this.appVisaWorkflow.getCurrentWorkflow(),
resource: this.filesToUpload[index], resource: this.filesToUpload[index],
pdfContent: 'data:application/pdf;base64,' + this.filesToUpload[index].content, pdfContent: 'data:application/pdf;base64,' + this.filesToUpload[index].content,
docIndex: this.filesToUpload.indexOf(this.filesToUpload[index]) docIndex: this.filesToUpload.indexOf(this.filesToUpload[index])
}
});
await modal.present();
const { data } = await modal.onWillDismiss();
if (data !== undefined) {
this.filesToUpload[index].signPos = data;
this.appVisaWorkflow.setPositionsWorkfow(this.filesToUpload, index, data);
} }
});
await modal.present();
const { data } = await modal.onWillDismiss();
if (data !== undefined) {
this.filesToUpload[index].signPos = data;
this.appVisaWorkflow.setPositionsWorkfow(this.filesToUpload, index, data);
} }
} else { } else {
this.notificationService.error('lang.mustSetWorkflowBeforeSignPositions'); this.notificationService.error('lang.mustSetWorkflowBeforeSignPositions');
......
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