aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js
diff options
context:
space:
mode:
authorAvi Ziv <AVIZI@amdocs.com>2017-07-26 17:37:57 +0300
committerAvi Ziv <avi.ziv@amdocs.com>2017-07-26 18:27:22 +0300
commit61070c9c6b665fdea79b3ccdfeafc3a6b50d262e (patch)
treedfe9c169cfac91d6c72ac9ff23375f2aafac6405 /openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js
parentb824a997e19f6ee9627cb1b1e124c756bd8183fc (diff)
[SDC] Full OnBoard health-check and NFoD support
Change-Id: I606f8a52c7e6d2bd5558f824957d890e552c5423 Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js')
-rw-r--r--openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js b/openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js
index 9af142433c..c2548e4fb4 100644
--- a/openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js
+++ b/openecomp-ui/src/nfvo-components/panel/versionController/VersionControllerConstants.js
@@ -33,7 +33,7 @@ export const statusEnum = keyMirror({
export const statusBarTextMap = keyMirror({
'Locked': 'Checked Out',
- 'LockedByUser': '',
+ 'LockedByUser': 'Locked',
'Available': 'Checked In',
'Final': 'Submitted',
'READ ONLY': 'Locked'
l */ .highlight .n { color: #f8f8f2 } /* Name */ .highlight .o { color: #f92672 } /* Operator */ .highlight .p { color: #f8f8f2 } /* Punctuation */ .highlight .ch { color: #75715e } /* Comment.Hashbang */ .highlight .cm { color: #75715e } /* Comment.Multiline */ .highlight .cp { color: #75715e } /* Comment.Preproc */ .highlight .cpf { color: #75715e } /* Comment.PreprocFile */ .highlight .c1 { color: #75715e } /* Comment.Single */ .highlight .cs { color: #75715e } /* Comment.Special */ .highlight .gd { color: #f92672 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gi { color: #a6e22e } /* Generic.Inserted */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #75715e } /* Generic.Subheading */ .highlight .kc { color: #66d9ef } /* Keyword.Constant */ .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ .highlight .kn { color: #f92672 } /* Keyword.Namespace */ .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ .highlight .kt { color: #66d9ef } /* Keyword.Type */ .highlight .ld { color: #e6db74 } /* Literal.Date */ .highlight .m { color: #ae81ff } /* Literal.Number */ .highlight .s { color: #e6db74 } /* Literal.String */ .highlight .na { color: #a6e22e } /* Name.Attribute */ .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

import * as _ from "lodash";
import { SchemaPropertyGroupModel, SchemaProperty } from '../schema-property';
import { DerivedPropertyType, PropertyBEModel, PropertyFEModel } from '../../models';
import {SubPropertyToscaFunction} from "../sub-property-tosca-function";
import {ToscaFunction} from "../tosca-function";
import { PROPERTY_TYPES } from 'app/utils';
import { UUID } from "angular2-uuid";


export class DerivedFEProperty extends PropertyBEModel {
    valueObj: any;
    valueObjIsValid: boolean;
    valueObjOrig: any;
    valueObjIsChanged: boolean;
    value: any
    parentName: string;
    propertiesName: string; //"network_assignments#ipv4_subnet#use_ipv4 =  parentPath + name
    derivedDataType: DerivedPropertyType;
    toscaFunction: ToscaFunction;
    isDeclared: boolean;
    isSelected: boolean;
    isDisabled: boolean;
    hidden: boolean;
    isChildOfListOrMap: boolean;
    canBeDeclared: boolean;
    mapKey: string;
    mapKeyError: string;
    mapInlist: boolean
    inputName: string;
    parentMapKey: string;
    toscaPath: string[];

    constructor(property: PropertyBEModel, parentName?: string, createChildOfListOrMap?: boolean, key?:string, value?:any) {
        if (!createChildOfListOrMap) { //creating a standard derived prop
            super(property);
            this.toscaPath = [];
            this.parentName = parentName ? parentName : null;
            this.propertiesName = (parentName) ? parentName + '#' + property.name : property.name;
            this.canBeDeclared = true; //defaults to true
            if (property instanceof DerivedFEProperty) {
                this.toscaPath = property.toscaPath != null ? property.toscaPath : [];
            } else {
                this.toscaPath = property.parentToscaPath != null ? property.parentToscaPath : property.parentToscaPath;
            }
            if (this.toscaPath.length == 0 && parentName != null && parentName.indexOf('#') != -1) {
                let lastparent = parentName.split('#');
                this.toscaPath.push(lastparent[lastparent.length - 1]);
            }
            this.toscaPath.push(property.name);
        } else { //creating a direct child of list or map (ie. Item that can be deleted, with UUID instead of name)
            super(null);
            let toscaPathCopy = null;
            if (property instanceof DerivedFEProperty) {
                toscaPathCopy = property.toscaPath != null ? property.toscaPath .toString() : null;
            } else {
                toscaPathCopy = property.parentToscaPath != null ? property.parentToscaPath.toString() : null;
            }
            this.toscaPath = toscaPathCopy != null ? toscaPathCopy.split(",") : [];
            this.isChildOfListOrMap = true;
            this.canBeDeclared = false;
            this.name = UUID.UUID();
            this.parentName = parentName;
            this.propertiesName = parentName + '#' + this.name;
            
            if (property.type == PROPERTY_TYPES.LIST) {
                let parentKey : string = null;
                if (property instanceof DerivedFEProperty) {
                    if (property.valueObj != '') {
                        if (key != '') {
                            let listIndex = Number(key);
                            if (!isNaN(listIndex)) {
                                this.toscaPath.push(key);
                            } else {
                               let newIndex = Object.keys(property.valueObj).findIndex(valueKey => (valueKey == key));
                               this.toscaPath.push(newIndex.toString());
                            }
                        } else {
                            let toscaIndex = Object.keys(property.valueObj).sort().reverse()[0];
                            this.toscaPath.push((Number(toscaIndex) + 1).toString());
                        }
                    } else {
                        this.toscaPath.push((property.valueObj.length).toString());
                    }
                } else {
                    if (property instanceof PropertyFEModel && property.valueObj != '') {
                        if (key != '') {
                            parentKey = key;
                        }else{
                            let toscaIndex = Object.keys(property.valueObj).sort().reverse()[0];
                            parentKey = (Number(toscaIndex) + 1).toString();
                        }
                    } else {
                        parentKey = "0";
                        if (property instanceof PropertyFEModel) {
                            parentKey = (property.flattenedChildren.length).toString();
                        }
                    }
                    this.toscaPath.push(parentKey);
                }
                if (property.schemaType != PROPERTY_TYPES.MAP) {
                    this.mapKey = parentKey;
                }
                this.mapKeyError = null;
                this.type = property.schema.property.type;
                if (this.type == PROPERTY_TYPES.MAP){
                    this.mapInlist = true;
                    this.parentMapKey = parentKey;
                }
                this.schema = new SchemaPropertyGroupModel(new SchemaProperty(property.schema.property));
            } else { //map
                if (key) {
                    this.mapKey = key;
                    this.mapKeyError = null;
                } else {
                    this.mapKey = '';
                    this.mapKeyError = 'Key cannot be empty.';
                }
                this.type = property.type;
                if (property.schema.property.type == PROPERTY_TYPES.MAP){
                    const schProp = new SchemaProperty();
                    schProp.isSimpleType = true;
                    schProp.isDataType = false;
                    schProp.simpleType = PROPERTY_TYPES.STRING;
                    this.schema = new SchemaPropertyGroupModel(schProp);
                    this.schemaType = PROPERTY_TYPES.STRING;
                    if (property instanceof DerivedFEProperty) {
                        this.parentMapKey = property.parentMapKey;
                        if (value != null && typeof value == 'object') {
                            this.toscaFunction = property.toscaFunction;
                        }
                    }
                } else {
                    this.schema = new SchemaPropertyGroupModel(new SchemaProperty(property.schema.property));
                }
                if (this.toscaPath != null) {
                    let lastIndex = this.toscaPath[this.toscaPath.length - 1];
                    if(this.mapKey != lastIndex){
                        this.toscaPath.push(this.mapKey);
                    }
                } else {
                    this.toscaPath.push(this.mapKey);
                }
            }
            this.valueObj = (this.type == PROPERTY_TYPES.JSON && typeof value == 'object') ? JSON.stringify(value) : value;
            if (value != null) {
                this.value = typeof value == 'object' ? JSON.stringify(value) : value;
            }
            this.updateValueObjOrig();
        }
        this.parentToscaPath = this.toscaPath;
        if(property.subPropertyToscaFunctions != null){
            property.subPropertyToscaFunctions.forEach((item : SubPropertyToscaFunction) => {
                if(item.subPropertyPath.toString() === this.toscaPath.toString() && this.uniqueId == null){
                    this.toscaFunction = item.toscaFunction;
                }
            });
        }
        this.valueObjIsValid = true;
        this.derivedDataType = this.getDerivedPropertyType();
        this.inputName = property.inputName;
    }

    public getActualMapKey() {
        return (this.mapKeyError) ? this.name : this.mapKey;
    }

    public updateValueObj(valueObj:any, isValid:boolean) {
        this.valueObj = PropertyFEModel.cleanValueObj(valueObj);
        this.valueObjIsValid = isValid;
        this.valueObjIsChanged = this.hasValueObjChanged();
    }

    public updateValueObjOrig() {
        this.valueObjOrig = _.cloneDeep(this.valueObj);
        this.valueObjIsChanged = false;
    }

    public hasValueObjChanged() {
        return !_.isEqual(this.valueObj, this.valueObjOrig);
    }

}
export class DerivedFEPropertyMap {
    [parentPath: string]: Array<DerivedFEProperty>;
}