diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/composition')
2 files changed, 52 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html index fce8e7ea4f..1e0804eb04 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.html @@ -76,6 +76,19 @@ </li> </ul> </ng-container> + <ng-container *ngIf="isTypeRange(type.name)"> + <ul *ngIf="isExpanded"> + <ng-container *ngFor="let value1 of [0, 1]; index as i"> + <li class="input-value"> + <ng-container *ngIf="isViewOnly"> + {{valueObjRef[i]}} + </ng-container> + <input type="text" *ngIf="!isViewOnly" + [(ngModel)]="valueObjRef[i]" (ngModelChange)="onListValueChange()" /> + </li> + </ng-container> + </ul> + </ng-container> <ng-container *ngIf="isTypeComplex(type.name)" > <ul *ngIf="isExpanded"> <ng-container *ngFor="let property of this.type.properties"> diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts index 4612ca6d60..88ff8deec6 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/input-list/input-list-item/input-list-item.component.ts @@ -85,7 +85,7 @@ export class InputListItemComponent implements OnInit { if (this.valueObjRef[property.name] == undefined) { if (this.isTypeComplex(property.type) || this.isTypeMap(property.type)) { this.valueObjRef[property.name] = {}; - } else if (this.isTypeList(property.type)) { + } else if (this.isTypeList(property.type) || this.isTypeRange(property.type)) { this.valueObjRef[property.name] = []; } else { this.valueObjRef[property.name] = null; @@ -100,13 +100,49 @@ export class InputListItemComponent implements OnInit { return DerivedPropertyType.LIST; } else if (typeName === PROPERTY_TYPES.MAP) { return DerivedPropertyType.MAP; + } else if (typeName === PROPERTY_TYPES.RANGE) { + return DerivedPropertyType.RANGE; } else { return DerivedPropertyType.COMPLEX; } } + isTypeWithoutProperties(typeName: string): boolean { + if (this.dataTypeMap.get(typeName) === undefined) { + return true; + } + return this.dataTypeMap.get(typeName).properties === undefined || + this.dataTypeMap.get(typeName).properties.length == 0; + } + + isTypeDerivedFromSimple(typeName: string): boolean { + if (typeName === undefined) { + return false; + } + if (this.dataTypeMap.get(typeName) !== undefined) { + if (this.isTypeRange(typeName)) { + return false; + } + if (this.dataTypeMap.get(typeName).derivedFromName == PROPERTY_DATA.ROOT_DATA_TYPE) { + return false; + } else if (PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.dataTypeMap.get(typeName).derivedFromName) > -1) { + return true; + } else { + return this.isTypeDerivedFromSimple(this.dataTypeMap.get(typeName).derivedFromName); + } + } + return true; + } + isTypeSimple(typeName: string): boolean { - return this.getType(typeName) == DerivedPropertyType.SIMPLE; + if (this.getType(typeName) == DerivedPropertyType.SIMPLE) { + return true; + } + return this.isTypeDerivedFromSimple(typeName) && (this.isTypeWithoutProperties(typeName)); + } + + isTypeRange(typeName: string): boolean { + return this.getType(typeName) == DerivedPropertyType.RANGE; } isTypeList(typeName: string): boolean { @@ -118,7 +154,7 @@ export class InputListItemComponent implements OnInit { } isTypeComplex(typeName: string): boolean { - return !this.isTypeSimple(typeName) && !this.isTypeList(typeName) && !this.isTypeMap(typeName); + return !this.isTypeSimple(typeName) && !this.isTypeList(typeName) && !this.isTypeMap(typeName) && !this.isTypeRange(typeName); } expandAndCollapse() { |