summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2
diff options
context:
space:
mode:
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.', ''))