diff --git a/lang/fr.json b/lang/fr.json index b1ce5ed2c3ba2a16698f3f676d61d38dfab6e4f6..3d7c3c12a990b6ca279f5c3ccf1428ddf39a5de7 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -665,7 +665,7 @@ "cannotAcces": "Impossible d'accéder au document", "softDeleted": "Marqué comme supprimé", "hardDeleted":"Fichiers supprimés", - "inputCardReaderUpdateCerts": "Une entrée de carte détectée, veuillez mettre à jour vos certificats", - "outputCardReaderUpdateCerts": "Une sortie de carte détectée, veuillez mettre à jour vos certificats" + "inputCardReaderUpdateCerts": "Une entrée de carte détectée, actualisation des certificats...", + "outputCardReaderUpdateCerts": "Une sortie de carte détectée, actualisation des certificats..." } } diff --git a/src/frontend/app/document/document.component.ts b/src/frontend/app/document/document.component.ts index 99d0490b9dc56d5ddebadf88ee7f3833a3cea0de..823c33e785a6e27f7bd7c9f839929925a94ef470 100755 --- a/src/frontend/app/document/document.component.ts +++ b/src/frontend/app/document/document.component.ts @@ -635,18 +635,7 @@ export class DocumentComponent implements OnInit, OnDestroy { { text: this.getLabel(event), handler: async (data: any) => { - const currentUserWorkflow = this.mainDocument.workflow.filter((line: { current: boolean }) => line.current === true)[0]; - const idsToProcess = await this.actionsService.checkGroupMail(this.mainDocument, 'validate'); - const res = await this.signatureMethodService.checkAuthenticationAndLaunchAction(currentUserWorkflow, data.paragraph, idsToProcess); - - if (!this.functionsService.empty(res)) { - const config: MatBottomSheetConfig = { - disableClose: true, - direction: 'ltr' - }; - this.bottomSheet.open(SuccessInfoValidBottomSheetComponent, config); - this.localStorage.remove(this.mainDocument.id.toString()); - } + await this.processToSign(data); } } ] @@ -655,6 +644,24 @@ export class DocumentComponent implements OnInit, OnDestroy { await alert.present(); } + async processToSign(data: any) { + const currentUserWorkflow = this.mainDocument.workflow.filter((line: { current: boolean }) => line.current === true)[0]; + const idsToProcess = await this.actionsService.checkGroupMail(this.mainDocument, 'validate'); + const res = await this.signatureMethodService.checkAuthenticationAndLaunchAction(currentUserWorkflow, data.paragraph, idsToProcess); + if (!this.functionsService.empty(res)) { + if (res === 'refresh_certs') { + this.processToSign(data); + } else { + const config: MatBottomSheetConfig = { + disableClose: true, + direction: 'ltr' + }; + this.bottomSheet.open(SuccessInfoValidBottomSheetComponent, config); + this.localStorage.remove(this.mainDocument.id.toString()); + } + } + } + async removeTags() { this.signaturesService.currentAction = 0; diff --git a/src/frontend/app/service/signature-method/signature-method-modal.component.html b/src/frontend/app/service/signature-method/signature-method-modal.component.html index b779d18068b2702b4a54c3c44ff3c620d44c817b..4628f0e3c78ba26028d69652f45fd37ffe946f80 100644 --- a/src/frontend/app/service/signature-method/signature-method-modal.component.html +++ b/src/frontend/app/service/signature-method/signature-method-modal.component.html @@ -1,4 +1,4 @@ <ion-content> - <peculiar-fortify-certificates style="height: 100%;width: 100%;" language="fr" [filters]="filters" + <peculiar-fortify-certificates *ngIf="!loading" style="height: 100%;width: 100%;" language="fr" [filters]="filters" (selectionSuccess)="certificateChosen($event)" (selectionCancel)="cancelSign()" hide-footer></peculiar-fortify-certificates> </ion-content> diff --git a/src/frontend/app/service/signature-method/signature-method-modal.component.ts b/src/frontend/app/service/signature-method/signature-method-modal.component.ts index ae468670417e04feae71fe3eb8f9e8137cc0714e..b51e894b578d1f2b0a1320603cda9a6ff4ec8d2a 100644 --- a/src/frontend/app/service/signature-method/signature-method-modal.component.ts +++ b/src/frontend/app/service/signature-method/signature-method-modal.component.ts @@ -87,6 +87,7 @@ export class SignatureMethodModalComponent implements OnInit, OnDestroy { if (challenge) { await this.api.login(); } + this.updateProvider(null); this.api.server.cardReader .on('insert', (event: any) => this.updateProvider(event)) .on('remove', (event: any) => this.updateProvider(event)); @@ -142,15 +143,16 @@ export class SignatureMethodModalComponent implements OnInit, OnDestroy { async updateProvider(event: any) { const info = await this.api.server.info(); for (const provider of info.providers) { - console.log('Provider:' + provider.id + ', name=' + provider.name + ', atr=' + provider.atr); const crypto = await this.api.server.getCrypto(provider.id); await crypto.reset(); } - if (!this.functionsService.empty(event.action) && event.action.includes('insert')) { + if (!this.functionsService.empty(event?.action) && event?.action.includes('insert')) { this.notificationService.message('lang.inputCardReaderUpdateCerts'); - } else if (!this.functionsService.empty(event.action) && event.action.includes('remove')) { + this.modalController.dismiss('refresh_certs'); + } else if (!this.functionsService.empty(event?.action) && event?.action.includes('remove')) { this.notificationService.message('lang.outputCardReaderUpdateCerts'); + this.modalController.dismiss('refresh_certs'); } }