diff --git a/lang/fr.json b/lang/fr.json index 6dcf8e479b871365436f500abb721c82ad732ab6..313bf5dbd832dde29883313d9ced89d6ed767171 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -671,6 +671,10 @@ "inputCardReaderUpdateCerts": "Une entrée de carte détectée, actualisation des certificats...", "outputCardReaderUpdateCerts": "Une sortie de carte détectée, actualisation des certificats...", "yousignOtp": "Yousign", - "fastOtp": "Fast" + "fastOtp": "Fast", + "subscriberId": "Identifiant de l'abonné", + "certPath": "Lien vers le certificat", + "certPass": "Mot de passe du certificat", + "certType": "Type de certificat" } } diff --git a/src/frontend/app/administration/otp/otp.component.html b/src/frontend/app/administration/otp/otp.component.html index 15d5d2425250d71d5aa2d4f3846580f59c71ce52..00968b770ad5878c9ff471eeba2f4188d514869d 100644 --- a/src/frontend/app/administration/otp/otp.component.html +++ b/src/frontend/app/administration/otp/otp.component.html @@ -30,15 +30,30 @@ </ion-item> </ion-radio-group> </ion-list> - <ng-container *ngIf="connector.type === 'yousign'"> + <ion-item> + <ion-label color="secondary" position="floating">{{'lang.apiUri' | translate}} *</ion-label> + <ion-input name="apiUri" [maxlength]="128" [(ngModel)]="connector.apiUri" required> + </ion-input> + </ion-item> + <ion-item> + <ion-label color="secondary" position="floating">{{(connector.type === 'yousing' ? 'lang.apiKey' : 'lang.subscriberId') | translate}} *</ion-label> + <ion-input name="apiKey" [maxlength]="128" [(ngModel)]="connector.apiKey" required> + </ion-input> + </ion-item> + <ng-container *ngIf="connector.type === 'fast'"> + <ion-item> + <ion-label color="secondary" position="floating">{{'lang.certPath' | translate}} *</ion-label> + <ion-input name="certPath" [maxlength]="128" [(ngModel)]="connector.certPath" required> + </ion-input> + </ion-item> <ion-item> - <ion-label color="secondary" position="floating">{{'lang.apiUri' | translate}} *</ion-label> - <ion-input name="apiUri" [maxlength]="128" [(ngModel)]="connector.apiUri" [required]="connector.type === 'yousign'"> + <ion-label color="secondary" position="floating">{{'lang.certPass' | translate}} *</ion-label> + <ion-input name="certPass" [maxlength]="128" [(ngModel)]="connector.certPass" required> </ion-input> </ion-item> <ion-item> - <ion-label color="secondary" position="floating">{{'lang.apiKey' | translate}} *</ion-label> - <ion-input name="apiKey" [maxlength]="128" [(ngModel)]="connector.apiKey" [required]="connector.type === 'yousign'"> + <ion-label color="secondary" position="floating">{{'lang.certType' | translate}} *</ion-label> + <ion-input name="certType" [maxlength]="128" [(ngModel)]="connector.certType" required> </ion-input> </ion-item> </ng-container> diff --git a/src/frontend/app/administration/otp/otp.component.ts b/src/frontend/app/administration/otp/otp.component.ts index bfac983cb1f3ed66e1525a3bd1b3587335d11854..e86c8203f388552e76f5f372f417165e79826b77 100644 --- a/src/frontend/app/administration/otp/otp.component.ts +++ b/src/frontend/app/administration/otp/otp.component.ts @@ -20,6 +20,9 @@ export interface Connector { label: string; apiUri: string; apiKey: string; + certPath?: string; + certPass?: string; + certType?: string; securityModes: string[]; message: any; } @@ -225,9 +228,10 @@ export class OtpComponent implements OnInit, OnDestroy { error = true; } if (!error) { - if (this.connector.type !== 'yousign') { - delete this.connector.apiKey; - delete this.connector.apiUri; + if (this.connector.type === 'yousign') { + delete this.connector.certPass; + delete this.connector.certPath; + delete this.connector.certType; } if (this.creationMode) { this.createconnector(); diff --git a/src/frontend/app/document/visa-workflow/otps/otp-create.component.scss b/src/frontend/app/document/visa-workflow/otps/otp-create.component.scss index d09854d7b8f482a87c512be2881098d2360fb98a..048c56d676ac4cda94d2d6a877b8387ca7e3cdcc 100644 --- a/src/frontend/app/document/visa-workflow/otps/otp-create.component.scss +++ b/src/frontend/app/document/visa-workflow/otps/otp-create.component.scss @@ -11,8 +11,9 @@ .chooseConnector { display: grid; grid-template-columns: repeat(2, auto); + justify-items: center; + justify-content: center; grid-gap: 5px; - margin: 15px; div { flex: 1; diff --git a/src/frontend/app/service/otp-connectors/otp-fast.service.ts b/src/frontend/app/service/otp-connectors/otp-fast.service.ts index 081da63fea0b71d5c95ac5c4f6709b52c377fb5f..c71b14736d556cb430bcba3ffae6c989ca22d145 100644 --- a/src/frontend/app/service/otp-connectors/otp-fast.service.ts +++ b/src/frontend/app/service/otp-connectors/otp-fast.service.ts @@ -1,17 +1,13 @@ import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { catchError, tap } from 'rxjs/operators'; -import { Observable, of, Subject } from 'rxjs'; -import { NotificationService } from '../notification.service'; -import { TranslateService } from '@ngx-translate/core'; @Injectable({ providedIn: 'root' }) + export class OtpFastService { - otpFields: any = { + otpFields: OtpFields = { type: 'fast', firstname: null, lastname: null, @@ -24,3 +20,16 @@ export class OtpFastService { modes: ['fast_otp'] }; } + +export interface OtpFields { + type: string; + firstname: string; + lastname: string; + email: string; + phone: string; + sourceId: number; + security: string; + securityModes: string[]; + role: string; + modes: string[]; +} diff --git a/src/frontend/app/service/otp-connectors/otp-yousign.service.ts b/src/frontend/app/service/otp-connectors/otp-yousign.service.ts index 17152f7ee1efb16822df5925700e8684e0e33ec3..4c9113700b7271459bc953f66b9717d38176ad98 100644 --- a/src/frontend/app/service/otp-connectors/otp-yousign.service.ts +++ b/src/frontend/app/service/otp-connectors/otp-yousign.service.ts @@ -1,9 +1,4 @@ import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { catchError, tap } from 'rxjs/operators'; -import { Observable, of, Subject } from 'rxjs'; -import { NotificationService } from '../notification.service'; -import { TranslateService } from '@ngx-translate/core'; @Injectable({ providedIn: 'root' @@ -11,7 +6,7 @@ import { TranslateService } from '@ngx-translate/core'; export class OtpYousignService { - otpFields: any = { + otpFields: OtpFields = { type: 'yousign', firstname: null, lastname: null, @@ -24,3 +19,16 @@ export class OtpYousignService { securityModes: [], }; } + +export interface OtpFields { + type: string; + firstname: string; + lastname: string; + email: string; + phone: string; + sourceId: number; + security: string; + securityModes: string[]; + role: string; + modes: string[]; +}