From 407bbefe5b0b932f6c6bed65193815c78b4d41b5 Mon Sep 17 00:00:00 2001 From: Satoshi Fujii Date: Wed, 26 Feb 2020 15:39:38 +0900 Subject: Add 'required in runtime' for service inputs User may want to set required to true for some inputs so that make sure those input values are given at service instantiation time. By this change 'required in runtime' column is introduced into service inputs table in Properties Assignment screen and user can select required true/false for each input. Change-Id: I0d676d2d20e02c975d51c7f4d2bb63c699743d66 Issue-ID: SDC-2659 Signed-off-by: Satoshi Fujii --- catalog-ui/src/app/models/properties-inputs/input-fe-model.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'catalog-ui/src/app/models') diff --git a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts index c349f41ea2..85c514bcbc 100644 --- a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts +++ b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts @@ -34,6 +34,7 @@ export class InputFEModel extends InputBEModel { defaultValueObjOrig:any; defaultValueObjIsChanged:boolean; derivedDataType: DerivedPropertyType; + requiredOrig: boolean; constructor(input?: InputBEModel) { super(input); @@ -47,6 +48,8 @@ export class InputFEModel extends InputBEModel { this.derivedDataType = this.getDerivedPropertyType(); this.resetDefaultValueObjValidation(); this.updateDefaultValueObjOrig(); + + this.requiredOrig = this.required; } } @@ -77,4 +80,11 @@ export class InputFEModel extends InputBEModel { return !_.isEqual(this.defaultValueObj, this.defaultValueObjOrig); } + hasRequiredChanged(): boolean { + return this.required !== this.requiredOrig; + } + + hasChanged(): boolean { + return this.hasDefaultValueChanged() || this.hasRequiredChanged(); + } } \ No newline at end of file -- cgit 1.2.3-korg