diff options
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.html | 5 | ||||
-rw-r--r-- | catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.ts | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.html b/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.html index 590217d0a5..d94fb546dc 100644 --- a/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.html +++ b/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.html @@ -36,7 +36,10 @@ <div class="attributeType"> <!-- ATTRIBUTE TYPE - MANDATORY --> - <sdc-dropdown #attributeType [disabled]="false" label="Type" [required]="true" + <sdc-dropdown #attributeType + [disabled]="isEdit" + label="Type" + [required]="true" [selectedOption]="toDropDownOption(this.attributeToEdit.type)" placeHolder="Choose Type" testId="attributeType" [options]="types" (changed)="onTypeSelected($event)"> diff --git a/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.ts b/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.ts index 426ed4063e..e851bafc1d 100644 --- a/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.ts +++ b/catalog-ui/src/app/ng2/pages/workspace/attributes/attribute-modal.component.ts @@ -32,6 +32,7 @@ export class AttributeModalComponent implements OnInit { // The current effective default value pattern public defaultValuePattern: string; public defaultValueErrorMessage: string; + public isEdit: boolean; // Attribute being Edited public attributeToEdit: AttributeModel; @@ -41,6 +42,11 @@ export class AttributeModalComponent implements OnInit { } ngOnInit() { + // Disable editing the name of existing attributes + if (this.attributeToEdit && this.attributeToEdit.name) { + this.isEdit = true; + } + this.revalidateDefaultValue(); } |