Catalog alignment
[sdc.git] / catalog-ui / src / app / view-models / forms / property-forms / base-property-form / property-form-base-view.html
1 <!--
2   ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
3   ~
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
7   ~
8   ~      http://www.apache.org/licenses/LICENSE-2.0
9   ~
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.
15 -->
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>
24         </div>
25     </div>
26
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" >
30
31                 <div class="w-sdc-form-columns-wrapper">
32
33                     <div class="w-sdc-form-column">
34
35                         <!-- Name -->
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"
42                                    maxlength="50"
43                                    data-ng-model="property.name"
44                                    type="text"
45                                    name="propertyName"
46                                    data-ng-pattern="propertyNameValidationPattern"
47                                    data-required
48                                    data-ng-model-options="{ debounce: 200 }"
49                                    autofocus />
50
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>
55                             </div>
56                         </div>
57                     </div>
58
59                     <div class="w-sdc-form-column">
60                         <div class="w-sdc-form-columns-wrapper">
61                             <div class="w-sdc-form-column">
62                                 <!-- Type -->
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"
67                                             data-required
68                                             data-ng-disabled="isTypeSelectorDisable"
69                                             name="type"
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>
77                                     </select>
78
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>
81                                     </div>
82                                 </div>
83                             </div>
84                             <div class="w-sdc-form-column" data-ng-if="showSchema()">
85                                 <!-- Entry Schema -->
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"
89                                             data-required
90                                             data-tests-id="schema-type"
91                                             data-ng-disabled="isPropertyValueOwner() || property.readonly"
92                                             name="schemaType"
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>
100                                     </select>
101
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>
104                                     </div>
105                                 </div>
106                             </div>
107                         </div>
108
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>
112                             <div>
113                                 Should be constraints by type(TBD)
114                             </div>
115                         </div>
116
117                     </div>
118
119                 </div>
120                 <!-- Description -->
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"
126                                        maxlength="256"
127                                        data-ng-pattern="commentValidationPattern"
128                                        name="description"
129                                        data-ng-model="property.description"
130                                        data-ng-model-options="{ debounce: 200 }"
131                                        data-tests-id="description"
132                             ></textarea>
133
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>
138                     </div>
139                 </div>
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>
143             </form>
144         </perfect-scrollbar>
145     </div>
146
147 </ng1-modal>