aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2
diff options
context:
space:
mode:
authorimamSidero <imam.hussain@est.tech>2022-07-07 21:40:03 +0530
committerMichael Morris <michael.morris@est.tech>2022-07-14 16:27:38 +0000
commit47b3a6177aae2261254b260a2d06358ec83c8d63 (patch)
tree7fbec6e74d93fa1ca0274a22697f16bd7d9821dc /catalog-ui/src/app/ng2
parent07aa2ba27b88816ffa87d769aee3ebc4f18db62f (diff)
Fix for list of map type on SELF property
Adding the multi value types to the schema type in property-creator component Issue-ID: SDC-4085 Change-Id: I9e6319caa85a99b6be90762698f66435f85811a3 Signed-off-by: Imam Hussain <imam.hussain@est.tech>
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html1
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts15
2 files changed, 13 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html
index df2136beec..52b8d99970 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html
@@ -19,6 +19,7 @@
<ui-element-dropdown [testId]="'property-type'"
class="cell link-selector"
[values]="typesProperties"
+ (change)="onTypeChange()"
[(value)]="propertyModel.type"></ui-element-dropdown>
</div>
<div class="i-sdc-form-item propertySchemaType" *ngIf="showSchema()">
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
index 57c9f97387..ba7533a977 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts
@@ -41,6 +41,17 @@ export class PropertyCreatorComponent {
return [PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP].indexOf(this.propertyModel.type) > -1;
}
+ onTypeChange(): void {
+ this.propertyModel.schema.property.type='';
+ const typeList = this.typesProperties;
+ if(this.propertyModel.type === PROPERTY_TYPES.MAP){
+ this.typesSchemaProperties = typeList.filter(dropdownObject => (dropdownObject.label != 'list' && dropdownObject.label != 'map'));
+ }
+ if(this.propertyModel.type === PROPERTY_TYPES.LIST){
+ this.typesSchemaProperties = typeList.filter(dropdownObject => dropdownObject.label != 'list');
+ }
+ }
+
onSchemaTypeChange(): void {
if (this.propertyModel.type === PROPERTY_TYPES.MAP) {
this.propertyModel.value = JSON.stringify({'': null});
@@ -63,9 +74,7 @@ export class PropertyCreatorComponent {
this.typesProperties = _.map(PROPERTY_DATA.TYPES,
(type: string) => new DropdownValue(type, type)
);
- const typesSimpleProperties = _.map(PROPERTY_DATA.SIMPLE_TYPES,
- (type: string) => new DropdownValue(type, type)
- );
+ const typesSimpleProperties = this.typesProperties.filter(dropdownObject => dropdownObject.label != 'list');
const nonPrimitiveTypesValues = _.map(nonPrimitiveTypes,
(type: string) => new DropdownValue(type,
type.replace('org.openecomp.datatypes.heat.', ''))