summaryrefslogtreecommitdiffstats
path: root/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils.ts
blob: 3ad9da56befecd4d62461f5209674a34037020ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * Created by obarda on 12/21/2016.
 */
/// <reference path="../../../../references"/>
module Sdc.Graph.Utils {

    export class DeploymentGraphGeneralUtils {

        constructor() {

        }

        public findInstanceModule = (groupsArray:Array<Models.Module>, componentInstanceId:string):string => {
            let parentGroup:Sdc.Models.Module = _.find(groupsArray, (group:Sdc.Models.Module) => {
                return _.find(group.members, (member) => {
                    return member === componentInstanceId;
                });
            });
            return parentGroup ? parentGroup.uniqueId : "";
        };
    }

    DeploymentGraphGeneralUtils.$inject = [];
}