diff --git a/admin-ui/src/app/features/masterdata/shared/mater-data-common-body/mater-data-common-body.component.html b/admin-ui/src/app/features/masterdata/shared/mater-data-common-body/mater-data-common-body.component.html index db26a841..9a5d9b4e 100644 --- a/admin-ui/src/app/features/masterdata/shared/mater-data-common-body/mater-data-common-body.component.html +++ b/admin-ui/src/app/features/masterdata/shared/mater-data-common-body/mater-data-common-body.component.html @@ -47,6 +47,7 @@ [value]="primaryData[field.name]" required={{field.ismandatory}} *ngIf="field.name !== 'fieldVal'" + [readonly]="!isEditable && id" /> @@ -63,6 +64,7 @@ [value]="primaryData[field.name]" required={{field.ismandatory}} *ngIf="field.name !== 'fieldVal'" + [readonly]="!isEditable && id" /> @@ -125,6 +127,7 @@ }}" [value]="primaryData[field.name]" required={{field.ismandatory}} + [readonly]="!isEditable && id" /> @@ -193,6 +196,7 @@ [value]="primaryData[field.name]" required={{field.ismandatory}} rows="3" cols="40" + [readonly]="!isEditable && id" > @@ -254,12 +258,13 @@ placeholder="{{field.label[primaryLang] | translate}}" [value]="primaryData[field.name]" required={{field.ismandatory}} + [readonly]="!isEditable && id" /> - +
@@ -268,7 +273,8 @@ id="{{field.name}}" [value]="primaryData[field.name]" placeholder="{{ field.label[primaryLang] }}" - required={{field.ismandatory}}> + required={{field.ismandatory}} + [disabled]="!isEditable && id"> @@ -485,6 +495,7 @@ }}" [value]="secondaryData[field.name]" *ngIf="field.name !== 'fieldVal'" + [readonly]="!isEditable && id" /> @@ -500,6 +511,7 @@ }}" [value]="secondaryData[field.name]" *ngIf="field.name !== 'fieldVal'" + [readonly]="!isEditable && id" /> @@ -515,6 +527,7 @@ field.label[secondaryLang] }}" [value]="secondaryData[field.name]" + [readonly]="!isEditable && id" /> @@ -592,6 +605,7 @@ }}" [value]="secondaryData[field.name]" rows="3" cols="40" + [readonly]="!isEditable && id" > @@ -605,10 +619,12 @@ placeholder="{{field.label[secondaryLang] | translate}}" [value]="secondaryData[field.name]" field.required + [readonly]="!isEditable && id" /> @@ -618,7 +634,8 @@ + placeholder="{{ field.label[secondaryLang] }}" + [disabled]="!isEditable && id"> @@ -668,6 +685,7 @@ id="{{field.name}}{{secondaryLang}}" [value]="secondaryData[field.name]" placeholder="{{ field.label[secondaryLang] }}" + [disabled]="!isEditable && id" > >>"+this.primaryLangCode); - console.log("config>>>"+defaultJson.languages["ara"].name); - /*if(url === "blocklisted-words"){ - this.primaryLang = this.primaryData.langCode; - if(this.primaryData.langCode === "ara"){ - this.isPrimaryLangRTL = true; - } - }*/ if(this.primaryLang === "ara"){ this.isPrimaryLangRTL = true; } @@ -132,6 +125,7 @@ export class MaterDataCommonBodyComponent implements OnInit { } }); this.queryParamLangCode = this.activatedRoute.snapshot.queryParamMap.get('langCode'); + this.isEditable = this.activatedRoute.snapshot.queryParamMap.get('editable') this.activatedRoute.params.subscribe(response => { this.id = response.id; this.masterdataType = response.type; @@ -239,7 +233,12 @@ export class MaterDataCommonBodyComponent implements OnInit { if(this.router.url.split('/')[4] !== "new"){ name = this.router.url.split('/')[4]; this.dataStorageService.getDynamicfieldDescriptionValue(name, this.primaryLang).subscribe(response => { - this.primaryData = {"name":name,"description":response.response.description,"dataType":"string","value":"", "code":"","langCode":this.primaryLang}; + if(response.response){ + this.primaryData = {"name":name,"description":response.response.description,"dataType":"string","value":"", "code":"","langCode":this.primaryLang}; + }else{ + this.primaryData = {"name":name,"description":"","dataType":"string","value":"", "code":"","langCode":this.primaryLang}; + } + }); }else{ this.primaryData = {"name":name,"description":"","dataType":"string","value":"", "code":"","langCode":this.primaryLang}; @@ -368,11 +367,11 @@ export class MaterDataCommonBodyComponent implements OnInit { this.secondaryData = response.response.data[0]; this.setSecondaryFrom(""); if(this.queryParamLangCode){ - document.getElementById("code").setAttribute("disabled", "true"); - document.getElementById("code"+this.queryParamLangCode).setAttribute("disabled", "true"); - if(!this.primaryData.code){ - this.primaryData.code = this.secondaryData.code; - } + Object.keys(this.primaryData).forEach(item =>{ + if(!this.primaryData[item]){ + this.primaryData[item] = this.secondaryData[item] + } + }) } }else{ this.secondaryData = null; diff --git a/admin-ui/src/app/features/resources/center/edit/edit.component.html b/admin-ui/src/app/features/resources/center/edit/edit.component.html index e3351ac4..51aa97a0 100644 --- a/admin-ui/src/app/features/resources/center/edit/edit.component.html +++ b/admin-ui/src/app/features/resources/center/edit/edit.component.html @@ -107,7 +107,7 @@

{{ "center.location-details" | translate }}

-
- @@ -392,7 +392,7 @@

{{ "center.location-details" | translate }}

{{ fieldName }} - {{ data.name }} @@ -520,7 +520,7 @@

{{ "center.operational-details" | translate }}

- + {{ "center.holidays" | translate }}

- - +