diff options
Diffstat (limited to 'catalog-ui/src/app/models/graph')
8 files changed, 141 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/graph/graph-links/composition-graph-links/composition-ci-service-path-link.ts b/catalog-ui/src/app/models/graph/graph-links/composition-graph-links/composition-ci-service-path-link.ts new file mode 100644 index 0000000000..7aa4650e4e --- /dev/null +++ b/catalog-ui/src/app/models/graph/graph-links/composition-graph-links/composition-ci-service-path-link.ts @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +import {CommonLinkBase} from "../common-base-link"; +import {ForwardingPathLink} from "app/models/forwarding-path-link"; + +export class CompositionCiServicePathLink extends CommonLinkBase { + static LINK_TYPE = 'service-path-link'; + forwardingPathLink:ForwardingPathLink; + pathId:string; + pathName:string; + + constructor(forwardingPathLink:ForwardingPathLink) { + super(); + this.type = CompositionCiServicePathLink.LINK_TYPE; + this.classes = 'service-path-link'; + this.pathId = ''; + this.pathName = ''; + this.forwardingPathLink = forwardingPathLink; + } + + +} diff --git a/catalog-ui/src/app/models/graph/graph-links/links-factory.ts b/catalog-ui/src/app/models/graph/graph-links/links-factory.ts index 88c5323330..cc037a7e22 100644 --- a/catalog-ui/src/app/models/graph/graph-links/links-factory.ts +++ b/catalog-ui/src/app/models/graph/graph-links/links-factory.ts @@ -21,6 +21,7 @@ * Created by obarda on 5/1/2016. */ 'use strict'; +import * as _ from "lodash"; import {RelationshipModel, Relationship, CompositionCiLinkBase, CompositionCiNodeBase, LinkUcpeHost, CompositionCiUcpeLink, CompositionCiVlUcpeLink, CompositionCiSimpleLink, ModuleCiLinkBase, ModuleCiVlLink, CompositionCiVLink} from "../../../models"; diff --git a/catalog-ui/src/app/models/graph/match-relation.ts b/catalog-ui/src/app/models/graph/match-relation.ts index 8d139d6405..2a1b2146b9 100644 --- a/catalog-ui/src/app/models/graph/match-relation.ts +++ b/catalog-ui/src/app/models/graph/match-relation.ts @@ -29,7 +29,6 @@ export class Match { isFromTo:boolean; fromNode:string; toNode:string; - capabilityProperties:Array<PropertyModel>; // use this to store the capability properties, since there are times the capability itself is not available (when fulfilled). private _relationship:Relationship; constructor(requirement:Requirement, capability:Capability, isFromTo:boolean, fromNode:string, toNode:string) { diff --git a/catalog-ui/src/app/models/graph/nodes-and-links-map.ts b/catalog-ui/src/app/models/graph/nodes-and-links-map.ts new file mode 100644 index 0000000000..8c8d6cc944 --- /dev/null +++ b/catalog-ui/src/app/models/graph/nodes-and-links-map.ts @@ -0,0 +1,7 @@ +export class ServicePathMapItem { + constructor(public data: MapItemData, public id: string) {} +} + +export class MapItemData { + constructor(public name:string, public id: string, public ownerId?: string, public options?: Array<ServicePathMapItem>) {} +} diff --git a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts index 29cd9256d9..eded75d5da 100644 --- a/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts +++ b/catalog-ui/src/app/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ +import * as _ from "lodash"; import {ComponentInstance} from "../../../componentsInstances/componentInstance"; import {ImageCreatorService} from "../../../../directives/graphs-v2/image-creator/image-creator.service"; import {CompositionCiNodeBase} from "./composition-ci-node-base"; diff --git a/catalog-ui/src/app/models/graph/relationship.ts b/catalog-ui/src/app/models/graph/relationship.ts index 57ff45ef00..8d56272fa0 100644 --- a/catalog-ui/src/app/models/graph/relationship.ts +++ b/catalog-ui/src/app/models/graph/relationship.ts @@ -18,6 +18,7 @@ * ============LICENSE_END========================================================= */ 'use strict'; +import * as _ from "lodash"; import {Capability} from "../capability"; import {Requirement} from "../requirement"; diff --git a/catalog-ui/src/app/models/graph/zones/policy-instance.ts b/catalog-ui/src/app/models/graph/zones/policy-instance.ts new file mode 100644 index 0000000000..63136e6e21 --- /dev/null +++ b/catalog-ui/src/app/models/graph/zones/policy-instance.ts @@ -0,0 +1,43 @@ +import { PropertyModel } from "app/models"; +import { CommonUtils } from "app/utils"; + + +export class PolicyInstance { + componentName:string; + description:string; + empty:boolean; + invariantName:string; + invariantUUID:string; + isFromCsar:boolean; + + name:string; + normalizedName:string; + policyTypeName:string; + policyTypeUid:string; + policyUUID:string; + properties:Array<PropertyModel>; + targets:Array<string>; + uniqueId:string; + version:string; + + constructor(policy?:PolicyInstance) { + this.componentName = policy.componentName; + this.description = policy.description; + this.empty = policy.empty; + this.invariantName = policy.invariantName; + this.invariantUUID = policy.invariantUUID; + this.isFromCsar = policy.isFromCsar; + + this.name = policy.name; + this.normalizedName =policy.normalizedName; + this.policyTypeName = policy.policyTypeName; + this.policyTypeUid = policy.policyTypeUid; + this.policyUUID = policy.policyUUID; + this.properties = CommonUtils.initProperties(policy.properties); + this.targets = policy.targets; + this.uniqueId = policy.uniqueId; + this.version = policy.version; + + } + +}
\ No newline at end of file diff --git a/catalog-ui/src/app/models/graph/zones/zone-child.ts b/catalog-ui/src/app/models/graph/zones/zone-child.ts new file mode 100644 index 0000000000..d6d7198222 --- /dev/null +++ b/catalog-ui/src/app/models/graph/zones/zone-child.ts @@ -0,0 +1,48 @@ +import { Type, Component } from "@angular/core"; +import { PolicyInstance } from "app/models/graph/zones/policy-instance"; + +export class ZoneConfig { + title:string; + defaultIconText:string; + type:string; 'policy|group'; + tagModeId:string; + instances:Array<ZoneInstanceConfig>; + showZone:boolean; + + + constructor (title:string, defaultText:string, type:string, showZone:boolean) { + this.title = title; + this.defaultIconText = defaultText; + this.type = type; + this.tagModeId = this.type + "-tagging"; + this.instances = []; + this.showZone = showZone; + } +} + +export class ZoneInstanceConfig { + + name:string; + assignments:Array<string>; //targets or members + instanceData:PolicyInstance; // | GroupInstance; + mode:ZoneInstanceMode; + + constructor(instance:PolicyInstance) { /* | GroupInstance */ + + this.name = instance.name; + this.instanceData = instance; + this.mode = ZoneInstanceMode.NONE; + + if(instance instanceof PolicyInstance) { + this.assignments = instance.targets; + } + } + +} + +export enum ZoneInstanceMode { + NONE, + HOVER, + SELECTED, + TAG +}
\ No newline at end of file |