diff options
Diffstat (limited to 'catalog-ui/src/app/models')
5 files changed, 19 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/capability-types.ts b/catalog-ui/src/app/models/capability-types.ts index fc01f540a7..278d3d397c 100644 --- a/catalog-ui/src/app/models/capability-types.ts +++ b/catalog-ui/src/app/models/capability-types.ts @@ -15,6 +15,7 @@ */ import {ToscaPresentationData} from "./tosca-presentation"; +import {PropertyModel} from "./properties"; export class CapabilityTypesMap { capabilityTypesMap: CapabilityTypesMapData; @@ -30,12 +31,14 @@ export class CapabilityTypesMapData { export class CapabilityTypeModel { derivedFrom: string; + properties: Array<PropertyModel>; toscaPresentation: ToscaPresentationData; constructor(capabilityType?: CapabilityTypeModel) { if (capabilityType) { this.derivedFrom = capabilityType.derivedFrom; this.toscaPresentation = capabilityType.toscaPresentation; + this.properties = capabilityType.properties; } } }
\ No newline at end of file diff --git a/catalog-ui/src/app/models/capability.ts b/catalog-ui/src/app/models/capability.ts index caef2e87dd..4a4f821e0c 100644 --- a/catalog-ui/src/app/models/capability.ts +++ b/catalog-ui/src/app/models/capability.ts @@ -45,6 +45,13 @@ export class CapabilitiesGroup { }); return this[key]; } + + public static getFlattenedCapabilities(capabilitiesGroup: CapabilitiesGroup): Array<Capability> { + return _.reduce( + _.toArray(capabilitiesGroup), + (allCaps, capArr) => allCaps.concat(capArr), + []); + } } export class Capability implements RequirementCapabilityModel{ diff --git a/catalog-ui/src/app/models/properties-inputs/property-be-model.ts b/catalog-ui/src/app/models/properties-inputs/property-be-model.ts index 15b9534b99..5d25142e5a 100644 --- a/catalog-ui/src/app/models/properties-inputs/property-be-model.ts +++ b/catalog-ui/src/app/models/properties-inputs/property-be-model.ts @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -import { PropertyInputDetail, SchemaPropertyGroupModel, SchemaProperty } from "app/models"; +import {PropertyInputDetail, SchemaPropertyGroupModel, SchemaProperty, ToscaPresentationData} from "app/models"; import { PROPERTY_DATA, PROPERTY_TYPES } from 'app/utils'; export enum DerivedPropertyType { SIMPLE, @@ -47,6 +47,7 @@ export class PropertyBEModel { getInputValues: Array<PropertyInputDetail>; getPolicyValues: Array<PropertyPolicyDetail>; name: string; + origName: string; parentUniqueId: string; password: boolean; required: boolean; @@ -58,6 +59,7 @@ export class PropertyBEModel { parentPropertyType: string; subPropertyInputPath: string; inputPath: string; + toscaPresentation: ToscaPresentationData; constructor(property?: PropertyBEModel) { if (property) { @@ -66,6 +68,7 @@ export class PropertyBEModel { this.description = property.description; this.fromDerived = property.fromDerived; this.name = property.name; + this.origName = property.origName; this.parentUniqueId = property.parentUniqueId; this.password = property.password; this.required = property.required; @@ -78,6 +81,7 @@ export class PropertyBEModel { this.getInputValues = property.getInputValues; this.parentPropertyType = property.parentPropertyType; this.subPropertyInputPath = property.subPropertyInputPath; + this.toscaPresentation = property.toscaPresentation; this.getPolicyValues = property.getPolicyValues; this.inputPath = property.inputPath; } diff --git a/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts b/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts index c0af885d18..664d128313 100644 --- a/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts +++ b/catalog-ui/src/app/models/properties-inputs/property-fe-model.ts @@ -40,6 +40,7 @@ export class PropertyFEModel extends PropertyBEModel { valueObjOrig: any; //this is valueObj representation as saved in server valueObjIsChanged: boolean; derivedDataType: DerivedPropertyType; + origName: string; constructor(property: PropertyBEModel){ super(property); @@ -52,6 +53,7 @@ export class PropertyFEModel extends PropertyBEModel { this.valueObj = null; this.updateValueObjOrig(); this.resetValueObjValidation(); + this.origName = this.name; } diff --git a/catalog-ui/src/app/models/tosca-presentation.ts b/catalog-ui/src/app/models/tosca-presentation.ts index 3fdddde448..7cdc5c6be5 100644 --- a/catalog-ui/src/app/models/tosca-presentation.ts +++ b/catalog-ui/src/app/models/tosca-presentation.ts @@ -21,6 +21,7 @@ export class ToscaPresentationData { validTargetTypes: Array<string>; modificationTime: number; uniqueId: string; + ownerId: string; constructor(toscaPresentation?: ToscaPresentationData) { if (toscaPresentation) { @@ -30,6 +31,7 @@ export class ToscaPresentationData { this.validTargetTypes = toscaPresentation.validTargetTypes; this.modificationTime = toscaPresentation.modificationTime; this.uniqueId = toscaPresentation.uniqueId; + this.ownerId = toscaPresentation.ownerId; } } } |