2 ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
4 ~ Licensed under the Apache License, Version 2.0 (the "License");
5 ~ you may not use this file except in compliance with the License.
6 ~ You may obtain a copy of the License at
8 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~ Unless required by applicable law or agreed to in writing, software
11 ~ distributed under the License is distributed on an "AS IS" BASIS,
12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ~ See the License for the specific language governing permissions and
14 ~ limitations under the License.
16 <ng1-modal modal="modalPropertyFormBase" type="classic" class="sdc-edit-property-container" buttons="footerButtons" header="{{isNew ? 'Add' : 'Update' }} Property" show-close-button="true" data-tests-id="sdc-edit-property-container">
17 <loader data-display="isLoading" relative="false" size="medium"></loader>
18 <div class="sdc-modal-top-bar" data-ng-if="!isNew">
19 <div class="sdc-modal-top-bar-buttons">
20 <span ng-click="delete(property)" data-ng-class="{'disabled' : isDeleteDisable}" class="sprite-new delete-btn" data-tests-id="delete_property" sdc-smart-tooltip="">Delete</span>
21 <span class="delimiter"></span>
22 <span data-ng-click="getPrev()" data-ng-class="{'disabled' : !currentPropertyIndex || forms.editForm.$invalid || isArrowsDisabled}" class="sprite-new left-arrow" data-tests-id="get-prev" sdc-smart-tooltip="">Previous</span>
23 <span data-ng-click="getNext()" data-ng-class="{'disabled' : isLastProperty || forms.editForm.$invalid || isArrowsDisabled}" class="sprite-new right-arrow" data-tests-id="get-next" sdc-smart-tooltip="">Next</span>
27 <div class="sdc-edit-property-form-container" >
28 <perfect-scrollbar scroll-y-margin-offset="0" include-padding="true" class="scrollbar-container">
29 <form class="w-sdc-form two-columns" name="forms.editForm" >
31 <div class="w-sdc-form-columns-wrapper">
33 <div class="w-sdc-form-column">
36 <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.propertyName.$dirty && forms.editForm.propertyName.$invalid)}">
37 <label class="i-sdc-form-label" ng-class="{'required': !isService}">Name</label>
38 <input class="i-sdc-form-input"
39 data-tests-id="propertyName"
40 data-ng-maxlength="50"
41 data-ng-disabled="isNameDisable"
43 data-ng-model="property.name"
46 data-ng-pattern="propertyNameValidationPattern"
48 data-ng-model-options="{ debounce: 200 }"
51 <div class="input-error" data-ng-show="forms.editForm.propertyName.$dirty && forms.editForm.propertyName.$invalid">
52 <span ng-show="forms.editForm.propertyName.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Property name' }"></span>
53 <span ng-show="forms.editForm.propertyName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
54 <span ng-show="forms.editForm.propertyName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
59 <div class="w-sdc-form-column">
60 <div class="w-sdc-form-columns-wrapper">
61 <div class="w-sdc-form-column">
63 <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.type.$dirty && forms.editForm.type.$invalid)}">
64 <label class="i-sdc-form-label" ng-class="{'required': !isService}">Type</label>
65 <select class="i-sdc-form-select"
66 data-tests-id="propertyType"
68 data-ng-disabled="isTypeSelectorDisable"
70 data-ng-change="onTypeChange()"
71 data-ng-model="property.type">
72 <option value="">Choose Type</option>
73 <option data-ng-repeat="type in types"
74 value="{{type}}">{{type}}</option>
75 <option data-ng-repeat="type in nonPrimitiveTypes"
76 value="{{type}}">{{type.replace("org.openecomp.datatypes.heat.","")}}</option>
79 <div class="input-error" data-ng-show="forms.editForm.type.$dirty && forms.editForm.type.$invalid">
80 <span ng-show="forms.editForm.type.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Type' }"></span>
84 <div class="w-sdc-form-column" data-ng-if="showSchema()">
86 <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.schemaType.$dirty && forms.editForm.schemaType.$invalid)}">
87 <label class="i-sdc-form-label required">Entry Schema</label>
88 <select class="i-sdc-form-select"
90 data-tests-id="schema-type"
91 data-ng-disabled="isPropertyValueOwner() || property.readonly"
93 data-ng-change="onSchemaTypeChange()"
94 data-ng-model="property.schema.property.type">
95 <option value="">Choose Schema Type</option>
96 <option data-ng-repeat="type in simpleTypes"
97 value="{{type}}">{{type}}</option>
98 <option data-ng-repeat="type in nonPrimitiveTypes"
99 value="{{type}}">{{type.replace("org.openecomp.datatypes.heat.","")}}</option>
102 <div class="input-error" data-ng-show="forms.editForm.schemaType.$dirty && forms.editForm.schemaType.$invalid">
103 <span ng-show="forms.editForm.schemaType.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Entry schema' }"></span>
109 <!-- Constraints by type -->
110 <div class="i-sdc-form-item" data-ng-if="false">
111 <label class="i-sdc-form-label required">Constraints by type</label>
113 Should be constraints by type(TBD)
121 <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.description.$dirty && forms.editForm.description.$invalid)}">
122 <label class="i-sdc-form-label">Description</label>
123 <textarea class="i-sdc-form-textarea"
124 data-ng-maxlength="256"
125 data-ng-disabled="isDescriptionDisable"
127 data-ng-pattern="commentValidationPattern"
129 data-ng-model="property.description"
130 data-ng-model-options="{ debounce: 200 }"
131 data-tests-id="description"
134 <div class="input-error" data-ng-show="forms.editForm.description.$dirty && forms.editForm.description.$invalid">
135 <span ng-show="forms.editForm.description.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '256' }"></span>
136 <span ng-show="forms.editForm.description.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
137 <span ng-show="forms.editForm.description.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Description' }"></span>
140 <!-- Default value - insert in dynamic template url -->
141 <ng-include src="innerViewSrcUrl"></ng-include>
142 <span class="w-sdc-form-note" data-ng-show="forms.editForm.$invalid && false" translate="LABEL_ALL_FIELDS_ARE_MANDATORY"></span>