Commit ddb00507 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #16982 TIME 0:35 improve phone regex + take into account the connector +...

FIX #16982 TIME 0:35 improve phone regex + take into account the connector + display message info if visa
parent 4a89a1c3
......@@ -26,7 +26,7 @@
<app-otp-yousign #appOtpYousign *ngIf="currentSource && currentSource.type === 'yousign'" [connectorId]="connectorId" [otpYousign]="data"></app-otp-yousign>
<ion-card>
<ion-item color="primary">
<ion-label class="info" [innerHTML]="(appOtpYousign?.getData().role !== 'visa' ? 'lang.otpMsg' : 'lang.otpVisaUser') | translate : { security : appOtpYousign?.getSecurityMode()}"></ion-label>
<ion-label class="info" [innerHTML]="(appOtpYousign?.getData().role !== 'visa_yousign' ? 'lang.otpMsg' : 'lang.otpVisaUser') | translate : { security : appOtpYousign?.getSecurityMode()}"></ion-label>
</ion-item>
</ion-card>
</ion-content>
......
......@@ -42,7 +42,7 @@ export class OtpYousignComponent implements OnInit {
) {
this.otpService.catchEvent().subscribe(async (res) => {
if (res.id === 'connector') {
this.otp.sourceId = res.connectorId;
this.connectorId = res.connectorId;
await this.getConfig();
}
});
......@@ -95,10 +95,15 @@ export class OtpYousignComponent implements OnInit {
getRegexPhone() {
// map country calling code with national number length
const phonesMap = {
'32': [8, 10], // Belgium
'33': 9, // France
'1' : 10, // United States
'27': 9 // South Africa
'32': [8, 10], // Belgium
'41': [4, 12], // Swiss
'44': [7, 10], // United Kingdom
'352': [4, 11], // Luxembourg
'351': [9, 11], // Portugal
'33': 9, // France
'1' : 10, // USA
'39': 11, // Italy
'34': 9 // Spain
};
const regex = Object.keys(phonesMap).reduce((phoneFormats: any [], countryCode: any) => {
const numberLength = phonesMap[countryCode];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment