summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/pom.xml
blob: 92e50063dd68032d66e8a8c73105eccf0563f7eb (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.openecomp.sdc</groupId>
    <artifactId>openecomp-sdc-healing-api</artifactId>
    
    <parent>
        <groupId>org.openecomp.sdc</groupId>
        <artifactId>openecomp-healing-lib</artifactId>
        <version>1.1.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.openecomp.sdc.core</groupId>
            <artifactId>openecomp-facade-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openecomp.sdc.core</groupId>
            <artifactId>openecomp-facade-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openecomp.sdc</groupId>
            <artifactId>openecomp-sdc-validation-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openecomp.sdc</groupId>
            <artifactId>openecomp-sdc-versioning-api</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

</project>
/span>(properties, (property: PropertyFEModel): boolean => { return property.name === path.substring(0, path.indexOf('#')); }); return parent; } //undo disabling of parent and child props= public undoDisableRelatedProperties = (property: PropertyFEModel, childPath?: string): void => { property.isDisabled = false; if (!childPath) { property.isSelected = false; property.flattenedChildren && property.flattenedChildren.map(child => child.isDisabled = false); } else { //QND - unselect everything and then re-do the disabling of declared props. TODO: put a flag on propertyFEModel instead to indicate who's causing them to be disabled instead property.flattenedChildren.filter(child => child.isDisabled && !child.isDeclared).map(child => child.isDisabled = false); property.flattenedChildren.filter(child => child.isDeclared || child.isSelected).forEach((childProp) => { //handle brothers who are selected - redo their disabled relatives as well this.disableRelatedProperties(property, childProp.propertiesName); }); } } //disable parents and children of prop public disableRelatedProperties = (property: PropertyFEModel, childPath?: string): void => { if (!childPath) { //selecting the parent property property.isSelected = true; property.flattenedChildren && property.flattenedChildren.map(child => { child.isSelected = false; child.isDisabled = true; }); } else { property.isSelected = false; property.isDisabled = true; property.flattenedChildren.filter((childProp: DerivedFEProperty) => { return (childProp.propertiesName.indexOf(childPath + "#") === 0 //is child of prop to disable || childPath.indexOf(childProp.propertiesName + "#") === 0); //is parent of prop to disable }).map((child: DerivedFEProperty) => { child.isSelected = false; child.isDisabled = true; }); } } public getCheckedProperties = (properties: Array<PropertyFEModel>): Array<PropertyBEModel> => { let selectedProps: Array<PropertyDeclareAPIModel> = []; properties.forEach(prop => { if (prop.isSelected && !prop.isDeclared && !prop.isDisabled) { selectedProps.push(new PropertyDeclareAPIModel(prop)); } else if (prop.flattenedChildren) { prop.flattenedChildren.forEach((child) => { if (child.isSelected && !child.isDeclared && !child.isDisabled) { let childProp = new PropertyDeclareAPIModel(prop, child); //create it from the parent selectedProps.push(childProp); } }) } }); return selectedProps; } }