Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-15281 added confirmation popup for create/update contact type #270

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
isPrimaryLangRTL:boolean = false;
searchResult:any;
appConfig:any;
confirmationPopupMessage:any;

constructor(
private location: Location,
Expand Down Expand Up @@ -142,6 +143,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
.subscribe(response => {
this.popupMessages = response;
this.serverError = response.serverError;
this.confirmationPopupMessage = response.masterData.centerType;
});
let supportedLanguages = this.appConfigService.getConfig()['supportedLanguages'].split(',');
let self = this;
Expand Down Expand Up @@ -779,7 +781,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
this.showErrorPopup(mandatoryFieldLabel[i]+this.popupMessages.genericerror.fieldNameValidation);
break;
}else if(len === (i+1)){
self.executeAPI();
this.isCreateForm ? this.showConfirmationMsg("create") : this.showConfirmationMsg("update")
}
}
}
Expand Down Expand Up @@ -1132,6 +1134,26 @@ export class MaterDataCommonBodyComponent implements OnInit {
return dialogRef;
}

showConfirmationMsg(type:any){
let data = {};
data = {
case: 'CONFIRMATION',
title: this.confirmationPopupMessage[type].title,
message: this.confirmationPopupMessage[type].message,
yesBtnTxt: this.confirmationPopupMessage[type].yesBtnText,
noBtnTxt: this.confirmationPopupMessage[type].noBtnText
};
const dialogRef = this.dialog.open(DialogComponent, {
width: '650px',
data
});
dialogRef.afterClosed().subscribe(response => {
if (response) {
this.executeAPI();
} else if (!response) {}
});
}

showErrorPopup(message: string) {
this.dialog
.open(DialogComponent, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ <h3>{{ "center.location-details" | translate }}</h3>
</mat-form-field>
</div>
<mat-card-actions class="action-buttons">
<button id="createButton" mat-raised-button *ngIf="data.length != 0" (click)="submitPrimaryPanel()">
<button [disabled]="!primaryForm.dirty" id="createButton" mat-raised-button *ngIf="data.length != 0" (click)="submitPrimaryPanel()">
{{ "center.update" | translate }}
</button>
<button id="createButton" mat-raised-button *ngIf="data.length == 0" (click)="submitPrimaryPanel()">
<button [disabled]="!primaryForm.dirty" id="createButton" mat-raised-button *ngIf="data.length == 0" (click)="submitPrimaryPanel()">
{{ "center.create" | translate }}
</button>
<button mat-raised-button id="cancel" (click)="cancel()" *ngIf="secondaryLang">
Expand Down Expand Up @@ -257,11 +257,11 @@ <h3>{{ secondaryLanguageLabels["location-details"] }}</h3>
</mat-form-field>
</div>
<mat-card-actions class="action-buttons">
<button id="createButton" mat-raised-button *ngIf="showUpdateButton"
<button [disabled]="!secondaryForm.dirty" id="createButton" mat-raised-button *ngIf="showUpdateButton"
(click)="submitSecondaryPanel()">
{{ "center.update" | translate }}
</button>
<button id="createButton" mat-raised-button *ngIf="!showUpdateButton"
<button [disabled]="!secondaryForm.dirty" id="createButton" mat-raised-button *ngIf="!showUpdateButton"
(click)="submitSecondaryPanel()">
{{ "center.create" | translate }}
</button>
Expand Down Expand Up @@ -687,7 +687,7 @@ <h3>{{ "center.operational-details" | translate }}</h3>
<mat-divider [vertical]="true" [inset]="true"></mat-divider>
</mat-card-content>
<mat-card-actions class="action-buttons">
<button id="createButton" mat-raised-button (click)="submitCommonPanel()">
<button [disabled]="!commonForm.dirty" id="createButton" mat-raised-button (click)="submitCommonPanel()">
{{ "center.update" | translate }}
</button>
<button mat-raised-button id="cancel" (click)="cancel()">
Expand Down
16 changes: 15 additions & 1 deletion admin-ui/src/assets/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,21 @@
"unmapped-documents": "المستندات غير المعينة",
"masterDataTypes": "أنواع البيانات الرئيسية",
"dynamicField": "مجال ديناميكي",
"createDynamicField": "إنشاء حقل ديناميكي جديد"
"createDynamicField": "إنشاء حقل ديناميكي جديد",
"centerType":{
"create":{
"title": "تأكيد",
"message": "أنت على وشك إنشاء نوع المركز. \n الرجاء التأكد من صحة كافة المعلومات. سيتم إنشاء معرف المركز بمجرد التأكيد.",
"yesBtnText": "يتأكد",
"noBtnText": "يلغي"
},
"update":{
"title": "تأكيد",
"message": "أنت على وشك تحديث نوع المركز. \n الرجاء التأكد من صحة كافة المعلومات. سيتم تحديث تفاصيل المركز بمجرد التأكيد.",
"yesBtnText": "يتأكد",
"noBtnText": "يلغي"
}
}
},
"masterdataupload": {
"title": "تحميل البيانات الرئيسية"
Expand Down
16 changes: 15 additions & 1 deletion admin-ui/src/assets/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,21 @@
"unmapped-documents": "Unmapped Documents",
"masterDataTypes": "Masterdata Types",
"dynamicField": "Dynamic Field",
"createDynamicField": "Create New Dynamic Field"
"createDynamicField": "Create New Dynamic Field",
"centerType":{
"create":{
"title": "Confirmation",
"message": "You are about to create a Center Type. \n Please ensure that all the information is correct. Center ID will be generated once you Confirm.",
"yesBtnText": "Confirm",
"noBtnText": "Cancel"
},
"update":{
"title": "Confirmation",
"message": "You are about to update a Center Type. \n Please ensure that all the information is correct. Center details will be update once you Confirm.",
"yesBtnText": "Confirm",
"noBtnText": "Cancel"
}
}
},
"masterdataupload": {
"title": "Master Data Upload"
Expand Down
16 changes: 15 additions & 1 deletion admin-ui/src/assets/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,21 @@
"unmapped-documents": "Documents non mappés",
"masterDataTypes": "Types de données maîtres",
"dynamicField": "Champ dynamique",
"createDynamicField": "Créer un nouveau champ dynamique"
"createDynamicField": "Créer un nouveau champ dynamique",
"centerType":{
"create":{
"title": "Confirmation",
"message": "Vous êtes sur le point de créer un type de centre. \n Veuillez vous assurer que toutes les informations sont correctes. L'ID du centre sera généré une fois que vous aurez confirmé.",
"yesBtnText": "Confirmer",
"noBtnText": "Annuler"
},
"update":{
"title": "Confirmation",
"message": "Vous êtes sur le point de mettre à jour un type de centre. \n Veuillez vous assurer que toutes les informations sont correctes. Les détails du centre seront mis à jour une fois que vous aurez confirmé.",
"yesBtnText": "Confirmer",
"noBtnText": "Annuler"
}
}
},
"masterdataupload": {
"title": "Téléchargement des données de base"
Expand Down
16 changes: 15 additions & 1 deletion admin-ui/src/assets/i18n/hin.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,21 @@
"unmapped-documents": "अनमैप्ड डॉक्यूमेंट्स",
"masterDataTypes": "मास्टरडेटा प्रकार",
"dynamicField": "डायनेमिक फील्ड",
"createDynamicField": "नया गतिशील क्षेत्र बनाएँ"
"createDynamicField": "नया गतिशील क्षेत्र बनाएँ",
"centerType":{
"create":{
"title": "पुष्टीकरण",
"message": "आप एक केंद्र प्रकार बनाने वाले हैं. \nकृपया सुनिश्चित करें कि सभी जानकारी सही है। पुष्टि करते ही सेंटर आईडी जनरेट हो जाएगी।",
"yesBtnText": "पुष्टि करना",
"noBtnText": "रद्द करना"
},
"update":{
"title": "पुष्टीकरण",
"message": "आप एक केंद्र प्रकार अपडेट करने वाले हैं. \nकृपया सुनिश्चित करें कि सभी जानकारी सही है। आपके पुष्टि करते ही केंद्र का विवरण अपडेट कर दिया जाएगा।",
"yesBtnText": "पुष्टि करना",
"noBtnText": "रद्द करना"
}
}
},
"masterdataupload": {
"title": "मास्टर डेटा अपलोड"
Expand Down
16 changes: 15 additions & 1 deletion admin-ui/src/assets/i18n/kan.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,21 @@
"unmapped-documents": "ಅನ್‌ಮ್ಯಾಪ್ಡ್ ಡಾಕ್ಯುಮೆಂಟ್ಸ್",
"masterDataTypes": "ಮಾಸ್ಟರ್‌ಡೇಟಾ ಪ್ರಕಾರಗಳು",
"dynamicField": "ಡೈನಾಮಿಕ್ ಫೀಲ್ಡ್",
"createDynamicField": "ಹೊಸ ಡೈನಾಮಿಕ್ ಕ್ಷೇತ್ರವನ್ನು ರಚಿಸಿ"
"createDynamicField": "ಹೊಸ ಡೈನಾಮಿಕ್ ಕ್ಷೇತ್ರವನ್ನು ರಚಿಸಿ",
"centerType":{
"create":{
"title": "ದೃಢೀಕರಣ",
"message": "ನೀವು ಕೇಂದ್ರ ಪ್ರಕಾರವನ್ನು ರಚಿಸಲಿರುವಿರಿ. \n ದಯವಿಟ್ಟು ಎಲ್ಲಾ ಮಾಹಿತಿ ಸರಿಯಾಗಿದೆಯೇ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ. ನೀವು ದೃಢೀಕರಿಸಿದ ನಂತರ ಕೇಂದ್ರ ಐಡಿಯನ್ನು ರಚಿಸಲಾಗುತ್ತದೆ.",
"yesBtnText": "ದೃಢೀಕರಿಸಿ",
"noBtnText": "ರದ್ದುಮಾಡು"
},
"update":{
"title": "ದೃಢೀಕರಣ",
"message": "ನೀವು ಕೇಂದ್ರ ಪ್ರಕಾರವನ್ನು ನವೀಕರಿಸಲಿರುವಿರಿ. \n ದಯವಿಟ್ಟು ಎಲ್ಲಾ ಮಾಹಿತಿ ಸರಿಯಾಗಿದೆಯೇ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ. ನೀವು ದೃಢೀಕರಿಸಿದ ನಂತರ ಕೇಂದ್ರದ ವಿವರಗಳನ್ನು ನವೀಕರಿಸಲಾಗುತ್ತದೆ.",
"yesBtnText": "ದೃಢೀಕರಿಸಿ",
"noBtnText": "ರದ್ದುಮಾಡು"
}
}
},
"masterdataupload": {
"title": "ಮಾಸ್ಟರ್ ಡೇಟಾ ಅಪ್‌ಲೋಡ್"
Expand Down
16 changes: 15 additions & 1 deletion admin-ui/src/assets/i18n/tam.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,21 @@
"unmapped-documents": "மாற்றப்படாத ஆவணங்கள்",
"masterDataTypes": "மாஸ்டர்டேட்டா வகைகள்",
"dynamicField": "டைனமிக் புலம்",
"createDynamicField": "புதிய டைனமிக் புலம் உருவாக்கவும்"
"createDynamicField": "புதிய டைனமிக் புலம் உருவாக்கவும்",
"centerType":{
"create":{
"title": "உறுதிப்படுத்தல்",
"message": "நீங்கள் ஒரு மைய வகையை உருவாக்க உள்ளீர்கள். \n அனைத்து தகவல்களும் சரியானவை என்பதை உறுதிப்படுத்தவும். நீங்கள் உறுதிசெய்தவுடன் மைய ஐடி உருவாக்கப்படும்.",
"yesBtnText": "உறுதிப்படுத்தவும்",
"noBtnText": "ரத்து செய்"
},
"update":{
"title": "உறுதிப்படுத்தல்",
"message": "மைய வகையைப் புதுப்பிக்க உள்ளீர்கள். \n அனைத்து தகவல்களும் சரியானவை என்பதை உறுதிப்படுத்தவும். நீங்கள் உறுதிப்படுத்தியவுடன் மைய விவரங்கள் புதுப்பிக்கப்படும்.",
"yesBtnText": "உறுதிப்படுத்தவும்",
"noBtnText": "ரத்து செய்"
}
}
},
"masterdataupload": {
"title": "முதன்மை தரவு பதிவேற்றம்"
Expand Down
Loading