diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts index 4b84f0e66f..725847bc6d 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts @@ -348,7 +348,7 @@ export class PropertiesAssignmentComponent { if (this.isPropertiesTabSelected && item instanceof PropertyFEModel) { itemHasChanged = item.hasValueObjChanged(); } else if (this.isInputsTabSelected && item instanceof InputFEModel) { - itemHasChanged = item.hasDefaultValueChanged(); + itemHasChanged = item.hasChanged(); } else if (this.isPoliciesTabSelected && item instanceof InputFEModel) { itemHasChanged = item.hasDefaultValueChanged(); } @@ -574,16 +574,17 @@ export class PropertiesAssignmentComponent { let typelist: any = PROPERTY_TYPES.LIST; let uniID: any = insId; let boolfalse: any = false; + let required: any = content.propertyModel.required; let schem :any = { "empty": boolfalse, "property": { "type": content.propertyModel.simpleType, - "required": boolfalse + "required": required } } let schemaProp :any = { "type": content.propertyModel.simpleType, - "required": boolfalse + "required": required } reglistInput.description = content.propertyModel.description; @@ -592,7 +593,7 @@ export class PropertiesAssignmentComponent { reglistInput.schemaType = content.propertyModel.simpleType; reglistInput.instanceUniqueId = uniID; reglistInput.uniqueId = uniID; - reglistInput.required =boolfalse; + reglistInput.required = required; reglistInput.schema = schem; reglistInput.schemaProperty = schemaProp; @@ -789,6 +790,8 @@ export class PropertiesAssignmentComponent { response.forEach((resInput) => { const changedInput = <InputFEModel>this.changedData.shift(); this.inputsUtils.resetInputDefaultValue(changedInput, resInput.defaultValue); + changedInput.required = resInput.required; + changedInput.requiredOrig = resInput.required; }); console.log("updated the component inputs and got this response: ", response); } @@ -842,6 +845,7 @@ export class PropertiesAssignmentComponent { handleReverseItem = (changedItem) => { changedItem = <InputFEModel>changedItem; this.inputsUtils.resetInputDefaultValue(changedItem, changedItem.defaultValue); + changedItem.required = changedItem.requiredOrig; }; } @@ -906,8 +910,8 @@ export class PropertiesAssignmentComponent { {id: 'cancelButton', text: 'Cancel', type: SdcUiCommon.ButtonType.secondary, size: 'xsm', closeModal: true, callback: () => reject()}, {id: 'discardButton', text: 'Discard', type: SdcUiCommon.ButtonType.secondary, size: 'xsm', closeModal: true, callback: () => { this.reverseChangedData(); resolve()}}, {id: 'saveButton', text: 'Save', type: SdcUiCommon.ButtonType.primary, size: 'xsm', closeModal: true, disabled: !this.isValidChangedData, callback: () => this.doSaveChangedData(resolve, reject)} - ] as SdcUiCommon.IModalButtonComponent[] - } as SdcUiCommon.IModalConfig, UnsavedChangesComponent, {isValidChangedData: this.isValidChangedData}); + ] as SdcUiCommon.IModalButtonComponent[] + } as SdcUiCommon.IModalConfig, UnsavedChangesComponent, {isValidChangedData: this.isValidChangedData}); }); } |