aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-view.html
blob: ae96b66641678b63fd942759733d257a87e4e148 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!--
  ~ Copyright (C) 2018 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.
-->
<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">
    <loader data-display="isLoading" relative="false" size="medium"></loader>
    <div class="sdc-modal-top-bar" data-ng-if="!isNew">
        <div class="sdc-modal-top-bar-buttons">
            <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>
            <span class="delimiter"></span>
            <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>
            <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>
        </div>
    </div>

    <div class="sdc-edit-property-form-container" >
        <perfect-scrollbar scroll-y-margin-offset="0" include-padding="true" class="scrollbar-container">
            <form class="w-sdc-form two-columns" name="forms.editForm" >

                <div class="w-sdc-form-columns-wrapper">

                    <div class="w-sdc-form-column">

                        <!-- Name -->
                        <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.propertyName.$dirty && forms.editForm.propertyName.$invalid)}">
                            <label class="i-sdc-form-label" ng-class="{'required': !isService}">Name</label>
                            <input class="i-sdc-form-input"
                                   data-tests-id="propertyName"
                                   data-ng-maxlength="50"
                                   data-ng-disabled="isNameDisable"
                                   maxlength="50"
                                   data-ng-model="property.name"
                                   type="text"
                                   name="propertyName"
                                   data-ng-pattern="propertyNameValidationPattern"
                                   data-required
                                   data-ng-model-options="{ debounce: 200 }"
                                   autofocus />

                            <div class="input-error" data-ng-show="forms.editForm.propertyName.$dirty && forms.editForm.propertyName.$invalid">
                                <span ng-show="forms.editForm.propertyName.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Property name' }"></span>
                                <span ng-show="forms.editForm.propertyName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
                                <span ng-show="forms.editForm.propertyName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
                            </div>
                        </div>
                    </div>

                    <div class="w-sdc-form-column">
                        <div class="w-sdc-form-columns-wrapper">
                            <div class="w-sdc-form-column">
                                <!-- Type -->
                                <div class="i-sdc-form-item"  data-ng-class="{error:(forms.editForm.type.$dirty && forms.editForm.type.$invalid)}">
                                    <label class="i-sdc-form-label" ng-class="{'required': !isService}">Type</label>
                                    <select class="i-sdc-form-select"
                                            data-tests-id="propertyType"
                                            data-required
                                            data-ng-disabled="isTypeSelectorDisable"
                                            name="type"
                                            data-ng-change="onTypeChange()"
                                            data-ng-model="property.type">
                                        <option value="">Choose Type</option>
                                        <option data-ng-repeat="type in types"
                                                value="{{type}}">{{type}}</option>
                                        <option data-ng-repeat="type in nonPrimitiveTypes"
                                                value="{{type}}">{{type.replace("org.openecomp.datatypes.heat.","")}}</option>
                                    </select>

                                    <div class="input-error" data-ng-show="forms.editForm.type.$dirty && forms.editForm.type.$invalid">
                                        <span ng-show="forms.editForm.type.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Type' }"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="w-sdc-form-column" data-ng-if="showSchema()">
                                <!-- Entry Schema -->
                                <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.schemaType.$dirty && forms.editForm.schemaType.$invalid)}">
                                    <label class="i-sdc-form-label required">Entry Schema</label>
                                    <select class="i-sdc-form-select"
                                            data-required
                                            data-tests-id="schema-type"
                                            data-ng-disabled="isPropertyValueOwner() || property.readonly"
                                            name="schemaType"
                                            data-ng-change="onSchemaTypeChange()"
                                            data-ng-model="property.schema.property.type">
                                        <option value="">Choose Schema Type</option>
                                        <option data-ng-repeat="type in simpleTypes"
                                                value="{{type}}">{{type}}</option>
                                        <option data-ng-repeat="type in nonPrimitiveTypes"
                                                value="{{type}}">{{type.replace("org.openecomp.datatypes.heat.","")}}</option>
                                    </select>

                                    <div class="input-error" data-ng-show="forms.editForm.schemaType.$dirty && forms.editForm.schemaType.$invalid">
                                        <span ng-show="forms.editForm.schemaType.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Entry schema' }"></span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Constraints by type -->
                        <div class="i-sdc-form-item" data-ng-if="false">
                            <label class="i-sdc-form-label required">Constraints by type</label>
                            <div>
                                Should be constraints by type(TBD)
                            </div>
                        </div>

                    </div>

                </div>
                <!-- Description -->
                <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.description.$dirty && forms.editForm.description.$invalid)}">
                    <label class="i-sdc-form-label">Description</label>
                            <textarea  class="i-sdc-form-textarea"
                                       data-ng-maxlength="256"
                                       data-ng-disabled="isDescriptionDisable"
                                       maxlength="256"
                                       data-ng-pattern="commentValidationPattern"
                                       name="description"
                                       data-ng-model="property.description"
                                       data-ng-model-options="{ debounce: 200 }"
                                       data-tests-id="description"
                            ></textarea>

                    <div class="input-error" data-ng-show="forms.editForm.description.$dirty && forms.editForm.description.$invalid">
                        <span ng-show="forms.editForm.description.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '256' }"></span>
                        <span ng-show="forms.editForm.description.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
                        <span ng-show="forms.editForm.description.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Description' }"></span>
                    </div>
                </div>
                <!-- Default value - insert in dynamic template url -->
                <ng-include src="innerViewSrcUrl"></ng-include>
                <span  class="w-sdc-form-note"  data-ng-show="forms.editForm.$invalid && false" translate="LABEL_ALL_FIELDS_ARE_MANDATORY"></span>
            </form>
        </perfect-scrollbar>
    </div>

</ng1-modal>