diff options
author | Michael Lando <ml636r@att.com> | 2018-03-04 14:53:33 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-03-07 13:19:05 +0000 |
commit | a5445100050e49e83f73424198d73cd72d672a4d (patch) | |
tree | cacf4df817df31be23e4e790d1dda857bdae061e /catalog-ui/src/app/models/graph/zones | |
parent | 51157f92c21976cba4914c378aaa3cba49826931 (diff) |
Sync Integ to Master
Change-Id: I71e3acc26fa612127756ac04073a522b9cc6cd74
Issue-ID: SDC-977
Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/models/graph/zones')
-rw-r--r-- | catalog-ui/src/app/models/graph/zones/policy-instance.ts | 43 | ||||
-rw-r--r-- | catalog-ui/src/app/models/graph/zones/zone-child.ts | 48 |
2 files changed, 91 insertions, 0 deletions
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 |