From 41ee9cb182dd5f730c8eb21282004ce6ee4e2927 Mon Sep 17 00:00:00 2001 From: miriame Date: Mon, 4 Mar 2019 13:49:15 +0200 Subject: Add 'Req & Cap' screen for VF/PNF/Service - UI Issue-ID: SDC-2142 Change-Id: I23a2de18862e18389f801cbec3e452d7094df8e9 Signed-off-by: miriame --- catalog-ui/src/app/models/capability-types.ts | 41 ++++++++++++++++++++++ catalog-ui/src/app/models/capability.ts | 2 +- catalog-ui/src/app/models/component-metadata.ts | 2 ++ catalog-ui/src/app/models/node-types.ts | 45 +++++++++++++++++++++++++ catalog-ui/src/app/models/relationship-types.ts | 41 ++++++++++++++++++++++ catalog-ui/src/app/models/requirement.ts | 2 +- catalog-ui/src/app/models/tosca-presentation.ts | 35 +++++++++++++++++++ 7 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 catalog-ui/src/app/models/capability-types.ts create mode 100644 catalog-ui/src/app/models/node-types.ts create mode 100644 catalog-ui/src/app/models/relationship-types.ts create mode 100644 catalog-ui/src/app/models/tosca-presentation.ts (limited to 'catalog-ui/src/app/models') diff --git a/catalog-ui/src/app/models/capability-types.ts b/catalog-ui/src/app/models/capability-types.ts new file mode 100644 index 0000000000..fc01f540a7 --- /dev/null +++ b/catalog-ui/src/app/models/capability-types.ts @@ -0,0 +1,41 @@ +/*! + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +import {ToscaPresentationData} from "./tosca-presentation"; + +export class CapabilityTypesMap { + capabilityTypesMap: CapabilityTypesMapData; + + constructor(capabilityTypesMap: CapabilityTypesMapData) { + this.capabilityTypesMap = capabilityTypesMap; + } +} + +export class CapabilityTypesMapData { + [capabilityTypeId: string]: CapabilityTypeModel; +} + +export class CapabilityTypeModel { + derivedFrom: string; + toscaPresentation: ToscaPresentationData; + + constructor(capabilityType?: CapabilityTypeModel) { + if (capabilityType) { + this.derivedFrom = capabilityType.derivedFrom; + this.toscaPresentation = capabilityType.toscaPresentation; + } + } +} \ 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 74994b155b..caef2e87dd 100644 --- a/catalog-ui/src/app/models/capability.ts +++ b/catalog-ui/src/app/models/capability.ts @@ -57,7 +57,7 @@ export class Capability implements RequirementCapabilityModel{ uniqueId:string; capabilitySources:Array; leftOccurrences:string; - minOccurrences:string; + minOccurrences: number; maxOccurrences:string; description:string; validSourceTypes:Array; diff --git a/catalog-ui/src/app/models/component-metadata.ts b/catalog-ui/src/app/models/component-metadata.ts index 9f5e22cce4..0f0a30d529 100644 --- a/catalog-ui/src/app/models/component-metadata.ts +++ b/catalog-ui/src/app/models/component-metadata.ts @@ -49,6 +49,7 @@ export class ComponentMetadata { public systemName:string; public archived:boolean; public vspArchived: boolean; + public toscaResourceName: string; //Resource only public resourceType: string; @@ -118,6 +119,7 @@ export class ComponentMetadata { this.archived = response.archived; this.instantiationType = response.instantiationType; this.vspArchived = response.vspArchived; + this.toscaResourceName = response.toscaResourceName; return this; } diff --git a/catalog-ui/src/app/models/node-types.ts b/catalog-ui/src/app/models/node-types.ts new file mode 100644 index 0000000000..54d2ef567d --- /dev/null +++ b/catalog-ui/src/app/models/node-types.ts @@ -0,0 +1,45 @@ +/*! + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +import {ComponentMetadata} from "./component-metadata"; + +export class NodeTypesMap { + nodeTypesMap: NodeTypesMapData; + + constructor(nodeTypesMap: NodeTypesMapData) { + this.nodeTypesMap = nodeTypesMap; + } +} + +export class NodeTypesMapData { + [nodeTypeId: string]: NodeTypeModel; +} + +export class NodeTypeModel { + componentMetadataDefinition: ComponentMetadataDefModel; + + constructor(nodeType?: NodeTypeModel) { + this.componentMetadataDefinition = nodeType.componentMetadataDefinition; + } +} + +export class ComponentMetadataDefModel { + componentMetadataDataDefinition: ComponentMetadata; + + constructor(componentMetadataDef?: ComponentMetadataDefModel) { + this.componentMetadataDataDefinition = componentMetadataDef.componentMetadataDataDefinition; + } +} \ No newline at end of file diff --git a/catalog-ui/src/app/models/relationship-types.ts b/catalog-ui/src/app/models/relationship-types.ts new file mode 100644 index 0000000000..8ae827bff4 --- /dev/null +++ b/catalog-ui/src/app/models/relationship-types.ts @@ -0,0 +1,41 @@ +/*! + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +import {ToscaPresentationData} from "./tosca-presentation"; + +export class RelationshipTypesMap { + relationshipTypesMap: RelationshipTypesMapData; + + constructor(relationshipTypesMap: RelationshipTypesMapData) { + this.relationshipTypesMap = relationshipTypesMap; + } +} + +export class RelationshipTypesMapData { + [relationshipTypeId: string]: RelationshipTypeModel; +} + +export class RelationshipTypeModel { + derivedFrom: string; + toscaPresentation: ToscaPresentationData; + + constructor(relationshipType?: RelationshipTypeModel) { + if (relationshipType) { + this.derivedFrom = relationshipType.derivedFrom; + this.toscaPresentation = relationshipType.toscaPresentation; + } + } +} diff --git a/catalog-ui/src/app/models/requirement.ts b/catalog-ui/src/app/models/requirement.ts index 65428b398e..3cc0cf22e4 100644 --- a/catalog-ui/src/app/models/requirement.ts +++ b/catalog-ui/src/app/models/requirement.ts @@ -51,7 +51,7 @@ export class Requirement implements RequirementCapabilityModel{ uniqueId:string; relationship:string; leftOccurrences:string; - minOccurrences:string; + minOccurrences: number; maxOccurrences:string; //custom filterTerm:string; diff --git a/catalog-ui/src/app/models/tosca-presentation.ts b/catalog-ui/src/app/models/tosca-presentation.ts new file mode 100644 index 0000000000..3fdddde448 --- /dev/null +++ b/catalog-ui/src/app/models/tosca-presentation.ts @@ -0,0 +1,35 @@ +/*! + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +export class ToscaPresentationData { + creationTime: number; + description: string; + type: string; + validTargetTypes: Array; + modificationTime: number; + uniqueId: string; + + constructor(toscaPresentation?: ToscaPresentationData) { + if (toscaPresentation) { + this.creationTime = toscaPresentation.creationTime; + this.description = toscaPresentation.description; + this.type = toscaPresentation.type; + this.validTargetTypes = toscaPresentation.validTargetTypes; + this.modificationTime = toscaPresentation.modificationTime; + this.uniqueId = toscaPresentation.uniqueId; + } + } +} -- cgit 1.2.3-korg