Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -106,10 +106,12 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy {
oldSelectedIndex:any;
isSameData: any = {};
cancellable:boolean = false;
draftsDetails:any;
draftsDetails:any = [];
enteredOnlyNumbers:boolean = false;
disablePrefLangBtn:boolean = false;
firstInputLang:any = {};
draftInterval: any;
isDraftEmpty: boolean;


private keyboardRef: MatKeyboardRef<MatKeyboardComponent>;
Expand Down Expand Up @@ -196,25 +198,39 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy {
};

getPendingDrafts(){
this.dataStorageService.getPendingDrafts(this.langCode).subscribe((response) =>{
const popupElement = document.getElementById('draftCancelPopup');
this.dataStorageService.getPendingDrafts(this.langCode).subscribe((response) => {
if(!this.schema)
this.getUpdateMyDataSchema();
if(response['response']){
if(!response['response'].drafts.length){
this.cancellable = false;
this.isDraftEmpty = false;
clearTimeout(this.draftInterval);
if (this.dialog && popupElement) {
this.dialog.closeAll();
this.popupForInprogressData(true);
}
}else{
this.cancellable = true;
this.isDraftEmpty = true;
this.draftsDetails = response['response'].drafts;
if(this.dialog && popupElement && ((this.draftsDetails[0].cancellable && !this.cancellable) || (!this.draftsDetails[0].cancellable && this.cancellable))){
this.dialog.closeAll();
this.popupForInprogressData(false);
}
this.draftInterval = setTimeout(() => {
this.getPendingDrafts();
}, 2000);
this.cancellable = this.draftsDetails[0].cancellable;
}
}else{
this.showErrorPopup(response['errors']);
};
})
}

isUpdatedataInProgress(event, fieldType) {
if(this.cancellable){
this.popupForInprogressData();
if(this.isDraftEmpty){
this.popupForInprogressData(false);
if(fieldType === 'textField'){
document.getElementById(event.target.id).blur();
}else if(fieldType === 'datePickerField'){
Expand Down Expand Up @@ -253,7 +269,7 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy {
this.getUserInfo();
});
})

}


Expand Down Expand Up @@ -1191,37 +1207,42 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy {
});
}

popupForInprogressData() {
popupForInprogressData(dataUpdated) {
setTimeout(() => {
let statusMsg = "";
if(!dataUpdated){
statusMsg = this.draftsDetails[0].cancellable ? this.langJson.pendingDrafts.warnMsg : this.langJson.pendingDrafts.warnMsgTwo;
}else{
statusMsg = this.langJson.pendingDrafts.warnMsgThree
}
const dialogRef = this.dialog.open(DialogComponent, {
width: '750px',
data: {
case: 'updateMyDataInprogress',
message: this.langJson.pendingDrafts,
draftsDetails: this.draftsDetails,
confirmBtn: this.popupMessages.genericmessage.confirm,
cancelBtn: this.popupMessages.genericmessage.cancel
}
});

dialogRef.afterClosed().subscribe(res =>{
if(res){
width: '750px',
data: {
case: 'updateMyDataInprogress',
message: this.langJson.pendingDrafts,
statusMsg,
draftsDetails: this.draftsDetails,
confirmBtn: this.popupMessages.genericmessage.confirm,
cancelBtn: this.popupMessages.genericmessage.cancel
}
});

dialogRef.afterClosed().subscribe(res => {
if (res) {
this.dataStorageService.discardPendingDrafts(res)
.subscribe((response) =>{
if(response['response']){
this.message = this.langJson.draftCanceled
this.showMessage(this.message, this.draftsDetails);
this.cancellable = false;
}else{
this.showErrorPopup(response['errors'])
}
})
}else{
this.getPendingDrafts();
.subscribe((response) => {
if (response['response']) {
this.message = this.langJson.draftCanceled
this.showMessage(this.message, this.draftsDetails);
this.cancellable = false;
} else {
this.showErrorPopup(response['errors'])
}
})
}
})
return dialogRef;
},400)
}, 400)
}

onItemSelected(item: any) {
Expand Down
1 change: 1 addition & 0 deletions resident-ui/src/app/shared/dialog/dialog.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ td.mat-footer-cell:last-child {

.infro-card {
display: flex;
align-items: center;
}
p{
margin-top: 0px;
Expand Down
5 changes: 2 additions & 3 deletions resident-ui/src/app/shared/dialog/dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ <h4>{{ input.title }}</h4>

<!-- updateMyDataInprogress -->
<div [style.font-size]="fontSize.lableText" *ngIf="input.case === 'updateMyDataInprogress'"
class="data-inprogress-main-card" id="messagePopup">
class="data-inprogress-main-card" id="draftCancelPopup">
<div width="100%">
<h4 class="data-inprogress-heading" style="margin: 0;">{{input.message.heading}}</h4>
<p class="data-inprogress-description">{{input.message.descriptionDetails}}</p>
Expand All @@ -411,8 +411,7 @@ <h4 class="data-inprogress-heading" style="margin: 0;">{{input.message.heading}}
</p>
<div class="confirm-card">
<div class="Confirmation-card">
<p *ngIf="draft.cancellable">{{input.message.warnMsg}}</p>
<p *ngIf="!draft.cancellable">{{input.message.warnMsgTwo}}</p>
<p >{{input.statusMsg}}</p>
</div>
<button *ngIf="draft.cancellable" mat-button [mat-dialog-close]="draft.eid" class="data-inprogress-btns confirm-btn">{{input.confirmBtn}}</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resident-ui/src/assets/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "https://api-internal.dev1.mosip.net/resident/v1",
"baseUrl": "https://api-internal.qa-java21.mosip.net/resident/v1",
"version": "v1",
"validateToken": "admin/authorize/admin/validateToken",
"login": "/login/",
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"عرض المزيد",
"viewLess":"عرض أقل",
"warnMsg":"هل أنت متأكد من رغبتك في إلغاء الطلب الحالي لتحديث البيانات المختارة؟",
"warnMsgTwo":"لا يمكنك إلغاء هذا الطلب لأنه لا يزال في حالة انتظار. يرجى المحاولة بعد مرور بعض الوقت."
"warnMsgTwo":"لا يمكنك إلغاء هذا الطلب لأنه لا يزال في حالة انتظار. يرجى المحاولة بعد مرور بعض الوقت.",
"warnMsgThree":"لقد تمت معالجة طلبك لتحديث البيانات. يمكنك الآن المتابعة لتقديم طلب آخر لتحديث بياناتك."
},
"draftCanceled":"لقد تم إلغاء طلب تحديث البيانات الحالي الخاص بك بنجاح. يمكنك الآن المتابعة لرفع طلب آخر لتحديث البيانات."
},
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"View More",
"viewLess":"View Less",
"warnMsg":"Are you sure you want to cancel the existing request to update the chosen data?",
"warnMsgTwo":"You cannot cancel this request since it is still in Pending state. Please try after sometime."
"warnMsgTwo":"You can not cancel this request since it is still in Pending state. Please try after sometime.",
"warnMsgThree":"Your request to update data has been processed. You can now proceed to raise another request to update your data."
},
"draftCanceled":"Your existing Data Update Request has been successfully canceled. You can now proceed to raise another Data Update request."
},
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"Voir plus",
"viewLess":"Voir moins",
"warnMsg":"Êtes-vous sûr de vouloir annuler la demande existante de mise à jour des données choisies?",
"warnMsgTwo":"Vous ne pouvez pas annuler cette demande car elle est toujours à l'état En attente. S'il vous plaît, essayez après un certain temps."
"warnMsgTwo":"Vous ne pouvez pas annuler cette demande car elle est toujours à l'état En attente. S'il vous plaît, essayez après un certain temps.",
"warnMsgThree":"Votre demande de mise à jour des données a été traitée. Vous pouvez maintenant procéder à une autre demande de mise à jour de vos données."
},
"draftCanceled":"Votre demande de mise à jour de données existante a été annulée avec succès. Vous pouvez maintenant procéder à une autre demande de mise à jour des données."
},
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/hin.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"और देखें",
"viewLess":"कम देखें",
"warnMsg":"क्या आप वाकई चुने गए डेटा को अपडेट करने के मौजूदा अनुरोध को रद्द करना चाहते हैं?",
"warnMsgTwo":"आप इस अनुरोध को रद्द नहीं कर सकते क्योंकि यह अभी भी लंबित स्थिति में है। कृपया कुछ देर बाद प्रयास करें।"
"warnMsgTwo":"आप इस अनुरोध को रद्द नहीं कर सकते क्योंकि यह अभी भी लंबित स्थिति में है। कृपया कुछ देर बाद प्रयास करें।",
"warnMsgThree":"डेटा अपडेट करने का आपका अनुरोध संसाधित कर दिया गया है. अब आप अपने डेटा को अपडेट करने के लिए एक और अनुरोध करने के लिए आगे बढ़ सकते हैं।"
},
"draftCanceled":"आपका मौजूदा डेटा अपडेट अनुरोध सफलतापूर्वक रद्द कर दिया गया है। अब आप एक और डेटा अपडेट अनुरोध बढ़ाने के लिए आगे बढ़ सकते हैं।"
},
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/kan.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"ಇನ್ನಷ್ಟು ವೀಕ್ಷಿಸಿ",
"viewLess":"ಕಡಿಮೆ ವೀಕ್ಷಿಸಿ",
"warnMsg":"ಆಯ್ಕೆಮಾಡಿದ ಡೇಟಾವನ್ನು ನವೀಕರಿಸಲು ಅಸ್ತಿತ್ವದಲ್ಲಿರುವ ವಿನಂತಿಯನ್ನು ರದ್ದುಗೊಳಿಸಲು ನೀವು ಖಚಿತವಾಗಿ ಬಯಸುವಿರಾ?",
"warnMsgTwo":"ಈ ವಿನಂತಿಯು ಇನ್ನೂ ಬಾಕಿಯಿರುವ ಸ್ಥಿತಿಯಲ್ಲಿರುವುದರಿಂದ ನೀವು ಈ ವಿನಂತಿಯನ್ನು ರದ್ದುಗೊಳಿಸಲಾಗುವುದಿಲ್ಲ. ದಯವಿಟ್ಟು ಸ್ವಲ್ಪ ಸಮಯದ ನಂತರ ಪ್ರಯತ್ನಿಸಿ."
"warnMsgTwo":"ಈ ವಿನಂತಿಯು ಇನ್ನೂ ಬಾಕಿಯಿರುವ ಸ್ಥಿತಿಯಲ್ಲಿರುವುದರಿಂದ ನೀವು ಈ ವಿನಂತಿಯನ್ನು ರದ್ದುಗೊಳಿಸಲಾಗುವುದಿಲ್ಲ. ದಯವಿಟ್ಟು ಸ್ವಲ್ಪ ಸಮಯದ ನಂತರ ಪ್ರಯತ್ನಿಸಿ.",
"warnMsgThree":"ಡೇಟಾವನ್ನು ನವೀಕರಿಸಲು ನಿಮ್ಮ ವಿನಂತಿಯನ್ನು ಪ್ರಕ್ರಿಯೆಗೊಳಿಸಲಾಗಿದೆ. ನಿಮ್ಮ ಡೇಟಾವನ್ನು ನವೀಕರಿಸಲು ನೀವು ಈಗ ಇನ್ನೊಂದು ವಿನಂತಿಯನ್ನು ಸಂಗ್ರಹಿಸಲು ಮುಂದುವರಿಯಬಹುದು."
},
"draftCanceled":"ನಿಮ್ಮ ಅಸ್ತಿತ್ವದಲ್ಲಿರುವ ಡೇಟಾ ನವೀಕರಣ ವಿನಂತಿಯನ್ನು ಯಶಸ್ವಿಯಾಗಿ ರದ್ದುಗೊಳಿಸಲಾಗಿದೆ. ನೀವು ಈಗ ಮತ್ತೊಂದು ಡೇಟಾ ಅಪ್‌ಡೇಟ್ ವಿನಂತಿಯನ್ನು ಹೆಚ್ಚಿಸಲು ಮುಂದುವರಿಯಬಹುದು."
},
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/spa.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"Ver más",
"viewLess":"Ver menos",
"warnMsg":"¿Está seguro de que desea cancelar la solicitud existente para actualizar los datos elegidos?",
"warnMsgTwo":"No puede cancelar esta solicitud ya que todavía está en estado Pendiente. Inténtalo después de un tiempo."
"warnMsgTwo":"No puede cancelar esta solicitud ya que todavía está en estado Pendiente. Inténtalo después de un tiempo.",
"warnMsgThree":"Su solicitud de actualización de datos ha sido procesada. Ahora puedes proceder a plantear otra solicitud para actualizar tus datos."
},
"draftCanceled":"Su solicitud de actualización de datos existente se canceló exitosamente. Ahora puede proceder a generar otra solicitud de Actualización de datos."
},
Expand Down
3 changes: 2 additions & 1 deletion resident-ui/src/assets/i18n/tam.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@
"viewMore":"மேலும் பார்க்க",
"viewLess":"குறைவாக பார்க்கவும்",
"warnMsg":"தேர்ந்தெடுக்கப்பட்ட தரவைப் புதுப்பிக்க ஏற்கனவே உள்ள கோரிக்கையை நிச்சயமாக ரத்து செய்ய விரும்புகிறீர்களா?",
"warnMsgTwo":"இந்தக் கோரிக்கை இன்னும் நிலுவையில் உள்ளதால் அதை ரத்து செய்ய முடியாது. சிறிது நேரம் கழித்து முயற்சிக்கவும்."
"warnMsgTwo":"இந்தக் கோரிக்கை இன்னும் நிலுவையில் உள்ளதால் அதை ரத்து செய்ய முடியாது. சிறிது நேரம் கழித்து முயற்சிக்கவும்.",
"warnMsgThree":"தரவைப் புதுப்பிப்பதற்கான உங்கள் கோரிக்கை செயலாக்கப்பட்டது. உங்கள் தரவைப் புதுப்பிக்க நீங்கள் இப்போது மற்றொரு கோரிக்கையை எழுப்பலாம்."
},
"draftCanceled":"உங்கள் தற்போதைய தரவு புதுப்பிப்பு கோரிக்கை வெற்றிகரமாக ரத்துசெய்யப்பட்டது. நீங்கள் இப்போது மற்றொரு தரவு புதுப்பிப்பு கோரிக்கையை எழுப்ப தொடரலாம்."
},
Expand Down