2 ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 <div *ngIf="!property.hidden" class="dynamic-property-row nested-level-{{nestedLevel}}" [@fadeIn]
18 [ngClass]="{'selected': selectedPropertyId && selectedPropertyId === property.propertiesName, 'readonly': property.isDisabled || property.isDeclared || property.isToscaFunction()}"
19 [class.with-top-border]="property.isChildOfListOrMap"
20 (click)="onClickPropertyRow(property, $event)">
22 <ng-container *ngIf="!isPropertyFEModel">
23 <div class="table-cell" *ngIf="canBeDeclared" [ngClass]="{'filtered':property.name === propertyNameSearchText}" [class.round-checkbox]="property.isDeclared"> <!-- simple children of complex type [@checkEffect]="property.isDeclared"-->
24 <checkbox *ngIf="hasDeclareOption" [(checked)]="property.isSelected" [disabled]="property.isDisabled || property.isDeclared || readonly " (checkedChange)="checkProperty.emit(property.propertiesName)" ></checkbox>
25 <div class="inner-cell-div" tooltip="{{property.name}}"><span>{{property.name}}</span></div>
27 <div class="table-cell" *ngIf="!canBeDeclared && !property.isChildOfListOrMap">
28 <checkbox *ngIf="nestedLevel != 1" [(checked)]="property.isSelected" [disabled]="property.isDisabled || readonly || property.mapKey == ''" (checkedChange)="toggleTosca.emit(property)" ></checkbox>
29 <div class="inner-cell-div" tooltip="{{property.name}}"><span>{{property.name}}</span></div>
30 </div> <!-- simple children of complex type within map or list -->
31 <div class="table-cell map-entry" *ngIf="property.isChildOfListOrMap && propType == derivedPropertyTypes.MAP && !property.mapInlist"><!-- map left cell -->
32 <dynamic-element #mapKeyInput
34 pattern="validationUtils.getValidationPattern(string)"
35 [value]="property.mapKey"
37 [name]="property.name"
38 (elementChanged)="mapKeyChanged.emit($event.value)"
40 [testId]="'prop-key-' + propertyTestsId"
44 <!-- RIGHT CELL OR FULL WIDTH CELL-->
45 <ng-container *ngIf="propType == derivedPropertyTypes.SIMPLE || property.isDeclared || (property.isToscaFunction() && !property.isChildOfListOrMap) || (property.isChildOfListOrMap && propType == derivedPropertyTypes.MAP && property.schema.property.isSimpleType)">
46 <div class="table-cell">
47 <checkbox class="{{propType == derivedPropertyTypes.MAP ? 'inline-checkBox' : 'inline-checkBox-List'}}" *ngIf="((nestedLevel == 1 || nestedLevel == 2) && property.isChildOfListOrMap && property.schema.property.isSimpleType)" [(checked)]="property.isSelected" [disabled]="property.isDisabled || readonly || property.mapKey == ''" (checkedChange)="toggleTosca.emit(property)" ></checkbox>
48 <dynamic-element class="value-input"
49 pattern="validationUtils.getValidationPattern(property.type)"
50 [value]="(property.isDeclared || property.isToscaFunction()) ? property.value : property.valueObj"
51 [type]="property.isDeclared || property.isToscaFunction() ? 'string' : property.type"
52 [name]="property.name"
53 [path]="property.propertiesName"
54 (elementChanged)="onElementChanged($event)"
55 [readonly]="readonly || property.isDeclared || property.isDisabled || property.isToscaFunction()"
56 [testId]="'prop-' + propertyTestsId"
57 [declared] = "property.isDeclared"
58 [constraints] = "constraints"
62 <ng-container *ngIf="!isPropertyFEModel && propType != derivedPropertyTypes.SIMPLE && !property.isDeclared && (!property.isToscaFunction() || (property.isToscaFunction() && property.isChildOfListOrMap && propType != derivedPropertyTypes.SIMPLE))"> <!-- right cell for complex elements, or list complex -->
63 <div class="table-cell" *ngIf="propType == derivedPropertyTypes.COMPLEX">{{property.type | contentAfterLastDot }}</div>
64 <div class="table-cell" *ngIf="propType == derivedPropertyTypes.MAP && !property.schema.property.isSimpleType">{{property.schema.property.type | contentAfterLastDot }}</div>
66 <ng-container *ngIf="isPropertyFEModel && (propType == derivedPropertyTypes.LIST || propType == derivedPropertyTypes.MAP) && !property.isDeclared && (!property.isToscaFunction() || (property.isToscaFunction() && property.isChildOfListOrMap && propType != derivedPropertyTypes.SIMPLE))"><!-- empty, full-width table cell - for PropertyFEModel of type list or map -->
67 <div class="table-cell empty"></div>
69 <!-- ICONS: add, delete, and expand -->
70 <ng-container *ngIf="(!property.isDeclared && !property.isToscaFunction()) || (property.isToscaFunction() && property.isChildOfListOrMap)">
71 <a *ngIf="(propType == derivedPropertyTypes.LIST) && (!property.isChildOfListOrMap || property.mapInlist)" class="property-icon add-item" (click)="createNewChildProperty();" [class.disabled]="property.isSelected" [ngClass]="{'disabled':readonly || preventInsertItem(property)}" [attr.data-tests-id]="'add-to-list-' + propertyTestsId">Add value to list</a>
72 <a *ngIf="(propType == derivedPropertyTypes.MAP) && (!property.isChildOfListOrMap || property.mapInlist)" class="property-icon add-item" (click)="createNewChildProperty();" [class.disabled]="property.isSelected" [ngClass]="{'disabled':readonly || preventInsertItem(property)}" [attr.data-tests-id]="'add-to-list-' + propertyTestsId">Add value to map</a>
73 <span *ngIf="property.isChildOfListOrMap" (click)="deleteItem.emit(property);" class="property-icon sprite-new delete-item-icon" [ngClass]="{'disabled':readonly}" [attr.data-tests-id]="'delete-from-list-' + propertyTestsId"></span>
74 <span *ngIf="!isPropertyFEModel && (propType == derivedPropertyTypes.COMPLEX || ((propType == derivedPropertyTypes.LIST || propType == derivedPropertyTypes.MAP) && hasChildren))" (click)="expandChildById(propPath)" class="property-icon sprite-new round-expand-icon" [class.open]="expandedChildId.indexOf(propPath) == 0" [attr.data-tests-id]="'expand-' + propertyTestsId" ></span>
78 <!-- FLAT CHILDREN -->
79 <div class="flat-children-container" *ngIf="isPropertyFEModel && !property.isDeclared && (!property.isToscaFunction() || (property.isToscaFunction() && property.isChildOfListOrMap && propType != derivedPropertyTypes.SIMPLE))">
80 <ng-container *ngFor="let prop of property.flattenedChildren | filterChildProperties: expandedChildId; trackBy:prop?.propertiesName">
82 [selectedPropertyId]="selectedPropertyId"
83 [hasDeclareOption]="hasDeclareOption"
84 [canBeDeclared]="hasDeclareOption && prop.canBeDeclared"
86 [rootProperty]="rootProperty || property"
87 [expandedChildId]="expandedChildId"
88 [propertyNameSearchText]="propertyNameSearchText"
90 [hasChildren]="getHasChildren(prop)"
91 (propertyChanged)="childValueChanged(prop)"
92 (mapKeyChanged)="updateChildKeyInParent(prop, $event)"
93 (expandChild)="expandChildById($event)"
94 (deleteItem)="deleteListOrMapItem($event)"
95 (clickOnPropertyRow)="onClickPropertyRow($event)"
96 (checkProperty)="checkedChange($event)"
97 (addChildPropsToParent)="addChildProps($event, prop.propertiesName)"
98 (toggleTosca)="toggleToscaFunction($event)"