diff options
Diffstat (limited to 'catalog-ui/src/app/ng2')
5 files changed, 50 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.html b/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.html index 7c83c55ae6..1389c21bcd 100644 --- a/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.html +++ b/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.html @@ -44,7 +44,7 @@ <!-- Property Name --> <div class="table-cell col1"> <div class="inner-cell-div"> - <span class="property-name" tooltip="{{input.name}}">{{input.name}}</span> + <a class="property-name" (click)="updateProperty(input)" tooltip="{{input.name}}">{{input.name}}</a> </div> <span *ngIf="input.description" class="property-description-icon sprite-new show-desc" diff --git a/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts b/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts index 822d8c9cdd..ec18767183 100644 --- a/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts @@ -23,7 +23,8 @@ * Created by rc2122 on 5/4/2017. */ import { Component, Input, Output, EventEmitter, ViewChildren, QueryList } from "@angular/core"; -import { InputFEModel } from "app/models"; +import { InputFEModel, PropertyModel, PropertiesGroup, Component as ComponentData } from "app/models"; +import { ModalsHandler } from 'app/utils'; import { ModalService } from "../../../services/modal.service"; import { InstanceFeDetails } from "app/models/instance-fe-details"; import { InstanceFePropertiesMap } from "../../../../models/properties-inputs/property-fe-map"; @@ -48,6 +49,8 @@ export class InputsTableComponent { @Output() deleteInput: EventEmitter<any> = new EventEmitter<any>(); @Input() fePropertiesMap: InstanceFePropertiesMap; + @Input() componentInstancePropertyMap: PropertiesGroup; + @Input() parentComponent: ComponentData; @ViewChildren('metadataViewChildren') public metadataViewChildren: QueryList<DynamicElementComponent>; @@ -84,7 +87,7 @@ export class InputsTableComponent { }; - constructor(private modalService: ModalService, private dataTypeService: DataTypeService){ + constructor(private modalService: ModalService, private dataTypeService: DataTypeService, private modalsHandler: ModalsHandler){ var x = 5 } @@ -175,6 +178,43 @@ export class InputsTableComponent { return false; } + public updateProperty = (inputProperty: InputFEModel): void => { + let modelProperty : PropertyModel = this.createPropertyModel(inputProperty); + if (inputProperty.instanceUniqueId != null && this.componentInstancePropertyMap != null && modelProperty.constraints == null) { + this.componentInstancePropertyMap[inputProperty.instanceUniqueId].forEach(tempProperty => { + modelProperty.constraints = tempProperty.constraints; + }); + } + this.modalsHandler.newOpenEditPropertyModal(modelProperty, [],true, 'component', modelProperty.resourceInstanceUniqueId, this.parentComponent, inputProperty); + } + + private createPropertyModel(inputproperty: InputFEModel){ + let propertyModel = new PropertyModel(); + propertyModel.constraints = inputproperty.constraints; + propertyModel.defaultValue = inputproperty.defaultValue; + propertyModel.definition = inputproperty.definition; + propertyModel.description = inputproperty.description; + propertyModel.name = inputproperty.name; + propertyModel.parentUniqueId = inputproperty.parentUniqueId; + propertyModel.password = inputproperty.password; + propertyModel.required = inputproperty.required; + propertyModel.schema = inputproperty.schema; + propertyModel.schemaType = inputproperty.schemaType; + propertyModel.type = inputproperty.type; + propertyModel.uniqueId = inputproperty.uniqueId; + propertyModel.value = inputproperty.value; + propertyModel.getInputValues = inputproperty.getInputValues; + propertyModel.parentPropertyType = inputproperty.parentPropertyType; + propertyModel.subPropertyInputPath = inputproperty.subPropertyInputPath; + propertyModel.getPolicyValues = inputproperty.getPolicyValues; + propertyModel.inputPath = inputproperty.inputPath; + propertyModel.metadata = inputproperty.metadata; + propertyModel.subPropertyToscaFunctions = inputproperty.subPropertyToscaFunctions; + propertyModel.ownerId = inputproperty.ownerId; + propertyModel.propertyView = true; + return propertyModel; + } + } diff --git a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/properties-tab/properties-tab.component.ts b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/properties-tab/properties-tab.component.ts index 04bed37e37..d25daf2865 100644 --- a/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/properties-tab/properties-tab.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/panel/panel-tabs/properties-tab/properties-tab.component.ts @@ -230,7 +230,7 @@ export class PropertiesTabComponent implements OnInit { (this.isPropertyOwner() ? this.properties[property.parentUniqueId] : this.properties[property.resourceInstanceUniqueId]) || [], - this.isPropertyValueOwner(), 'component', property.resourceInstanceUniqueId).then((updatedProperty: PropertyModel) => { + this.isPropertyValueOwner(), 'component', property.resourceInstanceUniqueId, null, null).then((updatedProperty: PropertyModel) => { if (updatedProperty) { const oldProp = _.find(this.properties[updatedProperty.resourceInstanceUniqueId], (prop: PropertyModel) => prop.uniqueId === updatedProperty.uniqueId); diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html index 1be3495510..1eed6dfba1 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.html @@ -48,8 +48,10 @@ [showDelete]="!isReadOnly && isSelf()" [inputs]="inputs | searchFilter:'name':searchQuery" [instanceNamesMap]="componentInstanceNamesMap" + [componentInstancePropertyMap]="componentInstancePropertyMap" [isLoading]="loadingInputs" [componentType]="component.componentType" + [parentComponent]="component" (deleteInput)="deleteInput($event)" (inputChanged)="dataChanged($event)"> </inputs-table> diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts index a3477792cf..e66de41f09 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts @@ -39,7 +39,8 @@ import { PropertyFEModel, Service, SimpleFlatProperty, - PropertyDeclareAPIModel + PropertyDeclareAPIModel, + PropertiesGroup } from "app/models"; import {ResourceType} from "app/utils"; import {ComponentServiceNg2} from "../../services/component-services/component.service"; @@ -121,6 +122,7 @@ export class PropertiesAssignmentComponent { serviceBePropertiesMap: InstanceBePropertiesMap; serviceBeCapabilitiesPropertiesMap: InstanceBePropertiesMap; selectedInstance_FlattenCapabilitiesList: Capability[]; + componentInstancePropertyMap : PropertiesGroup; @ViewChild('hierarchyNavTabs') hierarchyNavTabs: Tabs; @ViewChild('propertyInputTabs') propertyInputTabs: Tabs; @@ -170,6 +172,7 @@ export class PropertiesAssignmentComponent { this.inputsUtils.resetInputDefaultValue(newInput, input.defaultValue); this.inputs.push(newInput); //only push items that were declared via SDC }); + this.componentInstancePropertyMap = response.componentInstancesProperties; this.loadingInputs = false; }, error => { |