summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts
diff options
context:
space:
mode:
authorSatoshi Fujii <fujii-satoshi@jp.fujitsu.com>2020-02-26 15:39:38 +0900
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-03-31 05:19:29 +0000
commit407bbefe5b0b932f6c6bed65193815c78b4d41b5 (patch)
tree3b6661c29df42df59d72790b91cfaace4a0dd019 /catalog-ui/src/app/models/properties-inputs/input-fe-model.ts
parent4f02f33f309c3869d231926582f559aa04816063 (diff)
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 <fujii-satoshi@jp.fujitsu.com>
Diffstat (limited to 'catalog-ui/src/app/models/properties-inputs/input-fe-model.ts')
-rw-r--r--catalog-ui/src/app/models/properties-inputs/input-fe-model.ts10
1 files changed, 10 insertions, 0 deletions
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