summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2022-03-07 12:44:23 +0000
committerAndr� Schmid <andre.schmid@est.tech>2022-03-08 10:35:28 +0000
commita8dc9814f491649e59bcfa17039615cd71477db1 (patch)
treec71d43b2f6ec53b7c9b52a116fb0162f89ad8a29 /catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts
parentb96fc12cbd4d383df128de7504c9e167a122ab1b (diff)
Support property of type List<Map<String,String>>
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-3898 Change-Id: Ifc9ea422e0eafcf84b5b7e47a9108f62925e2ea0
Diffstat (limited to 'catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts')
-rw-r--r--catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts b/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts
index ac05f19b7b..2d406e210b 100644
--- a/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts
+++ b/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts
@@ -41,6 +41,7 @@ export class DerivedFEProperty extends PropertyBEModel {
canBeDeclared: boolean;
mapKey: string;
mapKeyError: string;
+ mapInlist: boolean
constructor(property: PropertyBEModel, parentName?: string, createChildOfListOrMap?: boolean, key?:string, value?:any) {
if (!createChildOfListOrMap) { //creating a standard derived prop
@@ -60,6 +61,11 @@ export class DerivedFEProperty extends PropertyBEModel {
this.mapKey = property.schema.property.type.split('.').pop();
this.mapKeyError = null;
this.type = property.schema.property.type;
+ if (this.type == PROPERTY_TYPES.MAP){
+ this.mapInlist = true;
+ }
+
+ this.schema = new SchemaPropertyGroupModel(new SchemaProperty(property.schema.property));
} else { //map
if (key) {
this.mapKey = key;
@@ -69,9 +75,19 @@ export class DerivedFEProperty extends PropertyBEModel {
this.mapKeyError = 'Key cannot be empty.';
}
this.type = property.type;
+ if (property.schema.property.type == PROPERTY_TYPES.MAP){
+ const schProp = new SchemaProperty();
+ schProp.isSimpleType = true;
+ schProp.isDataType = false;
+ schProp.simpleType = PROPERTY_TYPES.STRING;
+ this.schema = new SchemaPropertyGroupModel(schProp);
+ this.schemaType = PROPERTY_TYPES.STRING;
+ } else {
+ this.schema = new SchemaPropertyGroupModel(new SchemaProperty(property.schema.property));
+ }
+
}
this.valueObj = (this.type == PROPERTY_TYPES.JSON && typeof value == 'object') ? JSON.stringify(value) : value;
- this.schema = new SchemaPropertyGroupModel(new SchemaProperty(property.schema.property));
this.updateValueObjOrig();
}
// this.constraints = property ? property.constraints : null;
@@ -97,6 +113,7 @@ export class DerivedFEProperty extends PropertyBEModel {
public hasValueObjChanged() {
return !_.isEqual(this.valueObj, this.valueObjOrig);
}
+
}
export class DerivedFEPropertyMap {
[parentPath: string]: Array<DerivedFEProperty>;