diff --git a/resident-ui/src/app/core/services/data-storage.service.ts b/resident-ui/src/app/core/services/data-storage.service.ts index 44e7a399..4be7cae8 100644 --- a/resident-ui/src/app/core/services/data-storage.service.ts +++ b/resident-ui/src/app/core/services/data-storage.service.ts @@ -293,7 +293,8 @@ export class DataStorageService { } getImmediateChildren(locationCode: string, langCode: string) { - return this.httpClient.get(this.BASE_URL + '/proxy/masterdata/locations/immediatechildren/' + locationCode + '/' + langCode); + // return this.httpClient.get(this.BASE_URL + '/proxy/masterdata/locations/immediatechildren/' + locationCode + '/' + langCode); + return this.httpClient.get(this.BASE_URL + '/auth-proxy/masterdata/locations/immediatechildren/' + locationCode + '?languageCodes=' + langCode) } diff --git a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html index 20ea4ef6..0ffbe878 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.html @@ -133,10 +133,10 @@

{{'updatedemographic.identityHeading' | translate}}

+ [disabled]="attributeUpdateCountRemainLimit[field.attributeName] === 0" + (selectionChange)="captureDropDownValue($event, field.attributeName, item.language)"> {{ data.value }} + [value]="data.code">{{ data.value }} {{'updatedemographic.identityHeading' | translate}} {{ data.name }} @@ -332,7 +332,7 @@

{{'updatedemographic.addressHeading' | translate}}

{{'updatedemographic.addressHeading' | translate}} - + - - + + - + (selectionChange)="loadLocationDataDynamically($event, field.locationHierarchyLevel,field.attributeName,typeOf(userInfo[field.attributeName]))"> + {{ data.name }} - -

+ +

{{langJson.EnterAllAddress}} {{fieldName}}

- + @@ -392,13 +393,13 @@

{{'updatedemographic.addressHeading' | translate}}

placeholder="{{langJson.select}} {{field.labelName[langCode][1]}}" [ngClass]="dynamicDropDown[field.name]?.length === 0 ? 'disable-dropdown' : 'enable-dropdown'" [(value)]="userInputValues[field.attributeName]" id="{{field.name}}" - (selectionChange)="loadLocationDataDynamically($event, field.locationHierarchyLevel,field.attributeName,'')"> - + (selectionChange)="loadLocationDataDynamically($event, field.locationHierarchyLevel,field.attributeName,typeOf(userInfo[field.attributeName]))"> + {{ data.name }} - -

+

{{langJson.EnterAllAddress}} {{fieldName}}

@@ -425,7 +426,7 @@

{{'updatedemographic.addressHeading' | translate}}

id="{{field.attributeName}}"> {{ data.name }} @@ -436,7 +437,7 @@

{{'updatedemographic.addressHeading' | translate}}

{{'updatedemographic.languageHeading' | translate}} {{ data.name }}
diff --git a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts index 09ac7445..9971c20f 100644 --- a/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts +++ b/resident-ui/src/app/feature/uinservices/updatedemographic/updatedemographic.component.ts @@ -110,9 +110,12 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { isSelectedAllAddress:boolean = true; fieldName:string; oldKeyBoradIndex:number; - getUserPerfLang = new Set([]); + getUserPerfLang = []; + getUserPerfLangString:string = ""; attributeUpdateCountMaxLimit:any; attributeUpdateCountRemainLimit:any = {}; + selectedOptionData:any; + oldSelectedIndex:any; private keyboardRef: MatKeyboardRef; @ViewChildren('keyboardRef', { read: ElementRef }) @@ -234,7 +237,7 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { if (response["response"]) { this.userInfo = response["response"]; this.userInfo['fullName'].forEach(item=>{ - this.getUserPerfLang.add(item.language) + this.getUserPerfLang.indexOf(item.language) === -1 ? this.getUserPerfLang.push(item.language) : '' }) UpdatedemographicComponent.actualData = response["response"]; if (this.schema && this.userInfo) { @@ -316,6 +319,10 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { } catch (ex) { console.log("Exception>>>" + ex.message); } + this.getUserPerfLang.forEach(item =>{ + this.getUserPerfLangString = this.getUserPerfLangString + item + "," + }) + this.getUserPerfLangString = this.getUserPerfLangString.replace(/,\s*$/, ""); } changedBuildData(finaluserInfoClone: any) { @@ -333,28 +340,27 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { } } - addingAddessData(event:any, formControlName:string, language:string) { - if(event !==''){ - if(formControlName !== 'postalCode'){ - if(this.userInputValues[formControlName][language] === ''){ - let newData = { "language": language, "value": event.value.name }; - if( this.userInfoAddressClone[formControlName]){ - this.userInfoAddressClone[formControlName].push(newData) - }else{ - this.userInfoAddressClone[formControlName] = [].concat(newData) + addingAddessData(event:any, formControlName:string, fieldType:string, fieldName:string) { + let locationCode = event.value + if(fieldType !== 'string'){ + this.userInfoAddressClone[formControlName] = [] + this.getUserPerfLang.forEach(langCode =>{ + let newData + this.dynamicDropDown[fieldName][langCode].forEach(eachLocation =>{ + if(eachLocation.code === locationCode){ + newData = { "language": langCode, "value": eachLocation.name } + this.userInputValues[formControlName][langCode] = eachLocation.code; } - }else{ - this.userInfoAddressClone[formControlName].forEach(item =>{ - if(item.language === language){ - item.value = event.value.name - } - }) + }) + this.userInfoAddressClone[formControlName].push(newData) + }) + }else{ + this.dynamicDropDown[fieldName]['eng'].forEach(eachLocation =>{ + if(eachLocation.code === locationCode){ + this.userInfoAddressClone[formControlName] = eachLocation.name; + this.userInfoAddressClone[formControlName] = eachLocation.code; } - this.userInputValues[formControlName][language] = event.value.name; - }else{ - // this.userInputValues[formControlName] = event.value.name; - this.userInfoAddressClone[formControlName] = event.value.name; - } + }) } } @@ -409,7 +415,7 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { }); } - loadLocationDataDynamically(event: any, index: any, schemaFieldName:string, language:string) { + loadLocationDataDynamically(event: any, index: any, schemaFieldName:string, fieldType:string) { let unSelectedItems = this.locationFieldNameList.slice(index, this.locationFieldNameList.length) let locationCode = ""; let fieldName = ""; @@ -419,19 +425,33 @@ export class UpdatedemographicComponent implements OnInit, OnDestroy { locationCode = this.initialLocationCode; } else { fieldName = this.locationFieldNameList[parseInt(index)]; - locationCode = event.value.code; + locationCode = event.value; this.isSelectedAllAddress = unSelectedItems.length ? false : true; - this.fieldName = fieldName; } - this.dataStorageService.getImmediateChildren(locationCode, this.langCode) + + this.fieldName = fieldName + if(fieldName){ + this.dataStorageService.getImmediateChildren(locationCode, this.getUserPerfLangString) .subscribe(response => { if (response['response']) self.dynamicDropDown[fieldName] = response['response']['locations']; }); + } + + if(event !==''){ + this.addingAddessData(event, schemaFieldName, fieldType, this.locationFieldNameList[parseInt(index) -1]); + } - this.addingAddessData(event, schemaFieldName, language); unSelectedItems.forEach(item =>{ this.dynamicDropDown[item] = []; + let filedNameForuserInput = (item.charAt(0).toLocaleLowerCase() + item.slice(1)).replace(" ","") + if(typeof this.userInputValues[filedNameForuserInput] !== 'string'){ + this.getUserPerfLang.forEach(lang =>{ + this.userInputValues[filedNameForuserInput][lang] = '' + }) + }else{ + this.userInputValues[filedNameForuserInput] = '' + } }); } @@ -593,27 +613,20 @@ captureValue(event: any, formControlName: string, language: string, currentValue this.userInputValues[formControlName] = formattedDate; } - captureDropDownValue(event: any, formControlName: string, language: string, code: string, currentValue: any) { + captureDropDownValue(event: any, formControlName: string, language: string, currentValue: any) { let genders =this.dropDownValues.gender let self = this; - if (event.source.selected && event.source.viewValue !== currentValue) { if (formControlName !== "proofOfIdentity") { this.userInfoClone[formControlName] = [] this.getUserPerfLang.forEach(item =>{ let newData - if(item === language){ - newData = { "language": language, "value": event.source.viewValue } - this.userInfoClone[formControlName].push(newData) - this.userInputValues[formControlName][language] = event.source.viewValue; - }else{ - genders[item].forEach(eachGender =>{ - if(eachGender.code === code){ - newData = { "language": item, "value": eachGender.value } - this.userInputValues[formControlName][item] = eachGender.value; - } - }) - this.userInfoClone[formControlName].push(newData) - } + genders[item].forEach(eachGender =>{ + if(eachGender.code === event.value){ + newData = { "language": item, "value": eachGender.value } + this.userInputValues[formControlName][item] = eachGender.code; + } + }) + this.userInfoClone[formControlName].push(newData) }) } else { if (formControlName === "proofOfIdentity") { @@ -623,11 +636,9 @@ captureValue(event: any, formControlName: string, language: string, currentValue } self[formControlName]["documenttype"] = event.source.value; } - } - } - captureAddressValue(event: any, formControlName: string, language: string, currentValue: any) { + captureAddressValue(event: any, formControlName: string, language: string) { let self = this; if (event.target.value.trim() === "") { if(this.userInfoClone[formControlName]){ @@ -657,7 +668,7 @@ captureValue(event: any, formControlName: string, language: string, currentValue } - captureAddressDropDownValue(event: any, formControlName: string, language: string, dataType: string, currentValue: any) { + captureAddressDropDownValue(event: any, formControlName: string) { let self = this; if (event.source.selected) { if (formControlName === "proofOfIdentity") { @@ -670,7 +681,7 @@ captureValue(event: any, formControlName: string, language: string, currentValue this.userInputValues[formControlName] = event.source.viewValue; } - captureContactValue(event: any, formControlName) { + captureContactValue(event: any, formControlName:any) { this.userId = event.target.value; this.contactTye = formControlName; @@ -706,7 +717,7 @@ captureValue(event: any, formControlName: string, language: string, currentValue } } - capturePerfLang(event: any, formControlName: string, language: string) { + capturePerfLang(event: any, formControlName: string) { this.userInputValues[formControlName] = event.source.viewValue; this.userPrefLang[formControlName] = event.source.viewValue; } diff --git a/resident-ui/src/assets/i18n/ara.json b/resident-ui/src/assets/i18n/ara.json index 371d4dc6..f0c92bb9 100644 --- a/resident-ui/src/assets/i18n/ara.json +++ b/resident-ui/src/assets/i18n/ara.json @@ -664,6 +664,7 @@ "RES-SER-514": "تم إدخال UIN/VID غير صالح. يرجى إدخال UIN/VID صالح والمحاولة مرة أخرى.", "IDA-MLC-019": "نوع مصادقة otp-email مقفل للـ UIN", "RES-SER-522": "تم إدخال UIN/VID غير صالح. يرجى إدخال UIN/VID صالح والمحاولة مرة أخرى.", - "RES_SER_509": "البطاقة غير جاهزة للتنزيل." + "RES_SER_509": "البطاقة غير جاهزة للتنزيل.", + "RES-SER-418": "تم إدخال UIN/ AID/ VID غير صالح. يرجى إدخال UIN/ AID/ VID صالح والمحاولة مرة أخرى." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/eng.json b/resident-ui/src/assets/i18n/eng.json index 5074e253..9a4550f2 100644 --- a/resident-ui/src/assets/i18n/eng.json +++ b/resident-ui/src/assets/i18n/eng.json @@ -672,6 +672,7 @@ "RES-SER-514": "Invalid UIN/VID entered. Please enter a valid UIN/VID and try again.", "IDA-MLC-019": "otp-email Auth Type is Locked for the UIN.", "RES-SER-522": "Invalid UIN/VID entered. Please enter a valid UIN/VID and try again.", - "RES_SER_509": "The card is not ready for download." + "RES_SER_509": "The card is not ready for download.", + "RES-SER-418": "Invalid UIN/ AID/ VID entered. Please enter a valid UIN/ AID/ VID and try again." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/fra.json b/resident-ui/src/assets/i18n/fra.json index f6fdd32b..85591459 100644 --- a/resident-ui/src/assets/i18n/fra.json +++ b/resident-ui/src/assets/i18n/fra.json @@ -665,6 +665,7 @@ "RES-SER-514": "UIN/VID invalide saisi. Veuillez saisir un UIN/VID valide et réessayer.", "IDA-MLC-019": "Le type d'authentification par OTP par e-mail est verrouillé pour le UIN.", "RES-SER-522": "UIN/VID invalide saisi. Veuillez saisir un UIN/VID valide et réessayer.", - "RES-SER-509": "La carte n'est pas prête à être téléchargée." + "RES-SER-509": "La carte n'est pas prête à être téléchargée.", + "RES-SER-418": "UIN/AID/VID invalide saisi. Veuillez saisir un UIN/AID/VID valide et réessayer." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/hin.json b/resident-ui/src/assets/i18n/hin.json index b8357f09..51a49913 100644 --- a/resident-ui/src/assets/i18n/hin.json +++ b/resident-ui/src/assets/i18n/hin.json @@ -665,6 +665,7 @@ "RES-SER-514": "अमान्य UIN/VID दर्ज किए गए हैं। कृपया एक वैध UIN/VID दर्ज करें और पुनः प्रयास करें।", "IDA-MLC-019": "OTP-ईमेल प्रमाणीकरण प्रकार UIN के लिए लॉक किया गया है", "RES-SER-522": "अमान्य UIN/VID दर्ज किए गए हैं। कृपया एक वैध UIN/VID दर्ज करें और पुनः प्रयास करें।", - "RES_SER_509": "कार्ड डाउनलोड के लिए तैयार नहीं है।" + "RES_SER_509": "कार्ड डाउनलोड के लिए तैयार नहीं है।", + "RES-SER-418": "अमान्य UIN/ AID/ VID दर्ज किए गए हैं। कृपया एक वैध UIN/ AID/ VID दर्ज करें और पुन: प्रयास करें।" } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/kan.json b/resident-ui/src/assets/i18n/kan.json index 0ff29c7c..5b84b2af 100644 --- a/resident-ui/src/assets/i18n/kan.json +++ b/resident-ui/src/assets/i18n/kan.json @@ -665,6 +665,7 @@ "RES-SER-514": "ಅಮಾನ್ಯ UIN/VID ನಮೂದಿಸಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಒಂದು ಮಾನ್ಯ UIN/VID ನಮೂದಿಸಿ ಮತ್ತೊಮ್ಮೆ ಪ್ರಯತ್ನಿಸಿ.", "IDA-MLC-019": "otp-ಇಮೇಲ್ ಪ್ರಮಾಣೀಕರಣ ಪ್ರಕಾರ UIN ಗೆ ಲಾಕ್ ಆಗಿದೆ.", "RES-SER-522": "ಅಮಾನ್ಯ UIN/VID ನಮೂದಿಸಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಒಂದು ಮಾನ್ಯ UIN/VID ನಮೂದಿಸಿ ಮತ್ತೊಮ್ಮೆ ಪ್ರಯತ್ನಿಸಿ.", - "RES_SER_509": "ಕಾರ್ಡ್ ಡೌನ್ಲೋಡ್ ಗೊಂಡಿಲ್ಲ." + "RES_SER_509": "ಕಾರ್ಡ್ ಡೌನ್ಲೋಡ್ ಗೊಂಡಿಲ್ಲ.", + "RES-SER-418": "ಅಮಾನ್ಯ UIN/AID/VID ನಮೂದಿಸಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಒಂದು ಮಾನ್ಯ UIN/AID/VID ನಮೂದಿಸಿ ಮತ್ತೊಮ್ಮೆ ಪ್ರಯತ್ನಿಸಿ." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/spa.json b/resident-ui/src/assets/i18n/spa.json index 3675fc12..8e4587c5 100644 --- a/resident-ui/src/assets/i18n/spa.json +++ b/resident-ui/src/assets/i18n/spa.json @@ -665,6 +665,7 @@ "RES-SER-514": "UIN/VID ingresado inválido. Por favor, ingresa un UIN/VID válido y vuelve a intentarlo.", "IDA-MLC-019": "El tipo de autenticación de OTP por correo electrónico está bloqueado para el UIN", "RES-SER-522": "UIN/VID ingresado inválido. Por favor, ingresa un UIN/VID válido y vuelve a intentarlo.", - "RES_SER_509": "La tarjeta no está lista para su descarga." + "RES_SER_509": "La tarjeta no está lista para su descarga.", + "RES-SER-418": "UIN/AID/VID ingresado inválido. Por favor, ingresa un UIN/AID/VID válido y vuelve a intentarlo." } } \ No newline at end of file diff --git a/resident-ui/src/assets/i18n/tam.json b/resident-ui/src/assets/i18n/tam.json index 082549c6..23376651 100644 --- a/resident-ui/src/assets/i18n/tam.json +++ b/resident-ui/src/assets/i18n/tam.json @@ -665,6 +665,7 @@ "RES-SER-514": "தவறான UIN/ VID உள்ளிடப்பட்டுள்ளது. சரியான UIN/ VID ஐ உள்ளிட்டு மீண்டும் முயற்சிக்கவும்.", "IDA-MLC-019": "otp-email ஆதார வகையை UIN க்கு முட்டுக்கட்டுக்கப்பட்டுள்ளது", "RES-SER-522": "தவறான UIN/ VID உள்ளிடப்பட்டுள்ளது. சரியான UIN/ VID ஐ உள்ளிட்டு மீண்டும் முயற்சிக்கவும்.", - "RES_SER_509": "அட்டை பதிவிறக்கு முடியாது." + "RES_SER_509": "அட்டை பதிவிறக்கு முடியாது.", + "RES-SER-418": "தவறான UIN/ AID/ VID உள்ளிடப்பட்டுள்ளது. சரியான UIN/ AID/ VID ஐ உள்ளிட்டு மீண்டும் முயற்சிக்கவும்." } } \ No newline at end of file