From ed64b5edff15e702493df21aa3230b81593e6133 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Fri, 9 Jun 2017 03:19:04 +0300 Subject: [SDC-29] catalog 1707 rebase commit. Change-Id: I43c3dc5cf44abf5da817649bc738938a3e8388c1 Signed-off-by: Michael Lando --- .../responses/component-generic-response.ts | 77 ++++++++++++++++++++++ .../ng2/services/responses/properties.response.ts | 7 ++ 2 files changed, 84 insertions(+) create mode 100644 catalog-ui/src/app/ng2/services/responses/component-generic-response.ts create mode 100644 catalog-ui/src/app/ng2/services/responses/properties.response.ts (limited to 'catalog-ui/src/app/ng2/services/responses') diff --git a/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts new file mode 100644 index 0000000000..7dcd95d712 --- /dev/null +++ b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts @@ -0,0 +1,77 @@ +/** + * Created by ob0695 on 4/18/2017. + */ + +import { ArtifactGroupModel, PropertyModel, PropertiesGroup, AttributeModel, AttributesGroup, ComponentInstance, + InputModel, Module, ComponentMetadata, RelationshipModel, RequirementsGroup, CapabilitiesGroup,InputFEModel} from "app/models"; +import {CommonUtils} from "app/utils"; +import {Serializable} from "../utils/serializable"; +import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model"; + +export class ComponentGenericResponse implements Serializable { + + public metadata: ComponentMetadata; + public deploymentArtifacts:ArtifactGroupModel; + public artifacts:ArtifactGroupModel; + public toscaArtifacts:ArtifactGroupModel; + public componentInstancesProperties:PropertiesGroup; + public componentInstancesAttributes:AttributesGroup; + public componentInstancesRelations:Array; + public componentInstances:Array; + public inputs:Array; + public capabilities:CapabilitiesGroup; + public requirements:RequirementsGroup; + public properties:Array; + public attributes:Array; + public groups:Array; + public interfaces:any; + public additionalInformation:any; + public derivedList:Array; + + deserialize (response): ComponentGenericResponse { + + if(response.componentInstancesProperties) { + this.componentInstancesProperties = new PropertiesGroup(response.componentInstancesProperties); + } + if(response.componentInstancesAttributes) { + this.componentInstancesAttributes = new AttributesGroup(response.componentInstancesAttributes); + } + if(response.componentInstances) { + this.componentInstances = CommonUtils.initComponentInstances(response.componentInstances); + } + if(response.componentInstancesRelations) { + this.componentInstancesRelations = CommonUtils.initComponentInstanceRelations(response.componentInstancesRelations); + } + if(response.deploymentArtifacts) { + this.deploymentArtifacts = new ArtifactGroupModel(response.deploymentArtifacts); + } + if(response.inputs) { + this.inputs = CommonUtils.initInputs(response.inputs); + } + if(response.attributes) { + this.attributes = CommonUtils.initAttributes(response.attributes); + } + if(response.artifacts) { + this.artifacts = new ArtifactGroupModel(response.artifacts); + } + if(response.properties) { + this.properties = CommonUtils.initProperties(response.properties); + } + if(response.capabilities) { + this.capabilities = new CapabilitiesGroup(response.capabilities); + } + if(response.requirements) { + this.requirements = new RequirementsGroup(response.requirements); + } + if(response.toscaArtifacts) { + this.toscaArtifacts = new ArtifactGroupModel(response.toscaArtifacts); + } + if(response.metadata) { + this.metadata = new ComponentMetadata().deserialize(response.metadata); + } + if(response.groups) { + this.groups = CommonUtils.initModules(response.groups); + } + return this; + } +} diff --git a/catalog-ui/src/app/ng2/services/responses/properties.response.ts b/catalog-ui/src/app/ng2/services/responses/properties.response.ts new file mode 100644 index 0000000000..a3d82500eb --- /dev/null +++ b/catalog-ui/src/app/ng2/services/responses/properties.response.ts @@ -0,0 +1,7 @@ +export class PropertiesResponse { + properties: Array; +} + +class Property { + name: string +} -- cgit 1.2.3-korg