summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils.ts
blob: 368455cb241eb18718f3c4a3ad900eb06bcfb95e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {Module} from "app/models";
/**
 * Created by obarda on 12/21/2016.
 */

export class DeploymentGraphGeneralUtils {

    constructor() {

    }

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

DeploymentGraphGeneralUtils.$inject = [];