CSIT Fix for SDC-2585
[sdc.git] / catalog-ui / src / app / view-models / forms / resource-instance-name-form / resource-instance-name-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
17 <ng1-modal modal="modalInstanceName" type="classic" class="w-sdc-modal-resource-instance-name modal-type-confirmation" buttons="footerButtons" header="Instance Name" show-close-button="true">
18
19     <form novalidate class="w-sdc-form" name="forms.editNameForm">
20         <div class="i-sdc-form-item" data-ng-class="{error:(editNameForm.componentInstanceName.$dirty && editNameForm.resourceInstanceName.$invalid)}">
21             <label class="i-sdc-form-label required">Instance Name</label>
22             <input class="w-sdc-modal-resource-instance-input i-sdc-form-input"
23                    name="componentInstanceName"
24                    data-ng-maxlength="50"
25                    data-ng-model="componentInstanceModel.name"
26                    type="text"
27                    data-required
28                    data-ng-pattern="validationPattern"
29                    maxlength="50"
30                    autofocus
31                    placeholder="Enter instance name..."
32                    data-tests-id="instanceName"
33                 />
34
35             <div class="input-error" data-ng-show="forms.editNameForm.componentInstanceName.$dirty && forms.editNameForm.componentInstanceName.$invalid">
36                 <span ng-show="forms.editNameForm.componentInstanceName.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Resource name' }"></span>
37                 <span ng-show="forms.editNameForm.componentInstanceName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
38                 <span ng-show="forms.editNameForm.componentInstanceName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
39             </div>
40
41         </div>
42     </form>
43
44 </ng1-modal>
45
46
47
48 <!--
49
50 <div class="w-sdc-modal w-sdc-modal-resource-instance-name">
51     <header>
52         <div class="w-sdc-modal-head">
53             Instance Name
54         </div>
55     </header>
56     <div>
57         <form novalidate class="w-sdc-modal-body w-sdc-form" name="editNameForm">
58             <div class="i-sdc-form-item" data-ng-class="{error:(editNameForm.componentInstanceName.$dirty && editNameForm.resourceInstanceName.$invalid)}">
59                 <label class="i-sdc-form-label required">Instance Name</label>
60                 <input class="w-sdc-modal-resource-instance-input i-sdc-form-input"
61                        name="componentInstanceName"
62                        data-ng-maxlength="50"
63                        data-ng-model="componentInstanceModel.name"
64                        type="text"
65                        data-required
66                        data-ng-pattern="validationPattern"
67                        maxlength="50"
68                        autofocus
69                        placeholder="Enter instance name..."
70                        data-tests-id="instanceName"
71                     />
72
73                 <div class="input-error" data-ng-show="editNameForm.componentInstanceName.$dirty && editNameForm.componentInstanceName.$invalid">
74                     <span ng-show="editNameForm.componentInstanceName.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Resource name' }"></span>
75                     <span ng-show="editNameForm.componentInstanceName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
76                     <span ng-show="editNameForm.componentInstanceName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
77                 </div>
78
79             </div>
80         </form>
81
82         <div class="w-sdc-modal-action">
83             <button class="w-sdc-btn-blue" data-ng-click="save()" type="button" data-ng-disabled="(!componentInstanceModel.name || componentInstanceModel.name === oldName) || isAlreadyPressed">Ok</button>
84             <button class="w-sdc-btn-dark-gray" data-ng-click="close()" type="button">Cancel</button>
85         </div>
86     </div>
87 </div>
88 -->