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/ng2/services/responses | |
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/ng2/services/responses')
-rw-r--r-- | catalog-ui/src/app/ng2/services/responses/component-generic-response.ts | 5 | ||||
-rw-r--r-- | catalog-ui/src/app/ng2/services/responses/service-generic-response.ts | 22 |
2 files changed, 27 insertions, 0 deletions
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 index 9450e4bc04..e7c88a0ab8 100644 --- a/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts +++ b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts @@ -27,6 +27,7 @@ import { ArtifactGroupModel, PropertyModel, PropertiesGroup, AttributeModel, Att import {CommonUtils} from "app/utils"; import {Serializable} from "../utils/serializable"; import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model"; +import { PolicyInstance } from "app/models/graph/zones/policy-instance"; export class ComponentGenericResponse implements Serializable<ComponentGenericResponse> { @@ -43,6 +44,7 @@ export class ComponentGenericResponse implements Serializable<ComponentGenericR public requirements:RequirementsGroup; public properties:Array<PropertyModel>; public attributes:Array<AttributeModel>; + public policies:Array<PolicyInstance>; public groups:Array<Module>; public interfaces:any; public additionalInformation:any; @@ -92,6 +94,9 @@ export class ComponentGenericResponse implements Serializable<ComponentGenericR if(response.groups) { this.groups = CommonUtils.initModules(response.groups); } + if(response.policies) { + this.policies = CommonUtils.initPolicies(response.policies); + } return this; } } diff --git a/catalog-ui/src/app/ng2/services/responses/service-generic-response.ts b/catalog-ui/src/app/ng2/services/responses/service-generic-response.ts new file mode 100644 index 0000000000..d32ed26bb2 --- /dev/null +++ b/catalog-ui/src/app/ng2/services/responses/service-generic-response.ts @@ -0,0 +1,22 @@ +import * as _ from "lodash"; +import {Serializable} from "../utils/serializable"; +import {ComponentGenericResponse} from "./component-generic-response"; +import {ForwardingPath} from "../../../models/forwarding-path"; + +export class ServiceGenericResponse extends ComponentGenericResponse implements Serializable<ServiceGenericResponse> { + public forwardingPaths: { [key:string]:ForwardingPath } = {}; + + deserialize (response): ServiceGenericResponse { + super.deserialize(response); + if(response.forwardingPaths) { + _.forEach(response.forwardingPaths, (pathResponse, id) => { + let pathId = id; + let path:ForwardingPath = new ForwardingPath(); + path.deserialize(pathResponse); + path.uniqueId = pathId; + this.forwardingPaths[pathId] = path; + }); + } + return this; + } +}
\ No newline at end of file |