blob: db975caf476e74043069903165cf5ed6bd12b90b (
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
<div include-padding="true" class="sdc-wizard-general-step">
<div ng-controller="Sdc.ViewModels.Wizard.GeneralStepViewModel">
<form novalidate class="w-sdc-form" name="editForm">
<div class="w-sdc-form-section-container">
<!--------------------- IMPORT TOSCA FILE -------------------->
<file-upload id="fileUploadElement"
ng-if="!isCreate"
element-name="fileElement"
element-disabled="{{!isNew}}"
form-element="editForm"
file-model="model.tosca"
extensions="{{toscaFileExtensions}}"
data-ng-class="{'error': !editForm.fileElement.$valid || !model.tosca.filename}"></file-upload>
<div class="input-error-file-upload" data-ng-show="!isCreate && (!editForm.fileElement.$valid || !model.tosca.filename)">
<!-- editForm.fileElement.$error.required <== Can not use this, because the browse is done from outside for the first time -->
<span ng-show="!model.tosca.filename && !editForm.fileElement.$error.emptyFile" translate="NEW_SERVICE_RESOURCE_ERROR_TOSCA_FILE_REQUIRED"></span><!-- Required -->
<span ng-show="editForm.fileElement.$error.emptyFile" translate="VALIDATION_ERROR_EMPTY_FILE"></span>
<span ng-show="editForm.fileElement.$error.filetype" translate="NEW_SERVICE_RESOURCE_ERROR_VALID_TOSCA_EXTENSIONS" translate-values="{'extensions': '{{toscaFileExtensions}}' }"></span>
</div>
<!--------------------- IMPORT TOSCA FILE -------------------->
<div class="w-sdc-form-columns-wrapper">
<div class="w-sdc-form-column">
<!--------------------- NAME -------------------->
<div class="i-sdc-form-item" data-ng-class="{'error': validateField(editForm.componentName)}">
<label class="i-sdc-form-label required">Name</label>
<input class="i-sdc-form-input"
name="componentName"
data-ng-init="isNew && validateName(true)"
data-ng-change="validateName()"
data-ng-maxlength="{{component.isProduct()?'25':'50'}}"
maxlength="{{component.isProduct()?'25':'50'}}"
data-ng-minlength="{{component.isProduct()?'4':'0'}}"
minlength="{{component.isProduct()?'4':'0'}}"
data-ng-model="model.name"
type="text"
data-required
data-ng-model-options="{ debounce: 500 }"
data-ng-pattern="validation.validationPattern"
data-ng-disabled="model.isAlreadyCertified"
data-tests-id="name"
autofocus
/>
<div class="input-error" data-ng-show="validateField(editForm.componentName)">
<span ng-show="editForm.componentName.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_RESOURCE_NAME_REQUIRED"></span>
<span ng-show="editForm.componentName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
<span ng-show="editForm.componentName.$error.minlength" translate="VALIDATION_ERROR_MIN_LENGTH" translate-values="{'min': '4' }"></span>
<span ng-show="editForm.componentName.$error.nameExist" translate="NEW_SERVICE_RESOURCE_ERROR_NAME_EXISTS"></span>
<span ng-show="editForm.componentName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
</div>
</div>
<!--------------------- NAME -------------------->
<!--------------------- FULL NAME -------------------->
<div ng-if="component.isProduct()" class="i-sdc-form-item" data-ng-class="{'error': validateField(editForm.fullName)}">
<label class="i-sdc-form-label required">Full Name</label>
<input class="i-sdc-form-input"
name="fullName"
data-ng-change="validateName()"
data-ng-maxlength="100"
maxlength="100"
data-ng-minlength="4"
minlength="4"
data-ng-model="model.fullName"
type="text"
data-required
data-ng-model-options="{ debounce: 500 }"
data-ng-pattern="validation.validationPattern"
data-tests-id="fullName"
autofocus
/>
<div class="input-error" data-ng-show="validateField(editForm.fullName)">
<span ng-show="editForm.fullName.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_RESOURCE_NAME_REQUIRED"></span>
<span ng-show="editForm.fullName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
<span ng-show="editForm.fullName.$error.minlength" translate="VALIDATION_ERROR_MIN_LENGTH" translate-values="{'min': '4' }"></span>
<span ng-show="editForm.fullName.$error.nameExist" translate="NEW_SERVICE_RESOURCE_ERROR_NAME_EXISTS"></span>
<span ng-show="editForm.fullName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
</div>
</div>
<!--------------------- NAME -------------------->
<!--------------------- DESCRIPTION -------------------->
<div class="i-sdc-form-item"
data-ng-class="{'error': validateField(editForm.description)}">
<label class="i-sdc-form-label required">Description</label>
<textarea class="i-sdc-form-textarea description"
name="description"
data-ng-maxlength="1024"
data-required
data-ng-model="model.description"
data-ng-model-options="{ debounce: 500 }"
data-ng-pattern="validation.commentValidationPattern"
maxlength="1024"
data-tests-id="description"></textarea>
<!-- placeholder="Description here..." -->
<div class="input-error" data-ng-show="validateField(editForm.description)">
<span ng-show="editForm.description.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_RESOURCE_DESCRIPTION_REQUIRED"></span>
<span ng-show="editForm.description.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '1024' }"></span>
<span ng-show="editForm.description.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
</div>
</div>
<!--------------------- DESCRIPTION -------------------->
<!--------------------- CATEGORIES -------------------->
<div class="i-sdc-form-item"
data-ng-class="{'error': validateField(editForm.category)}"
data-ng-if="categories && categories.length && !component.isProduct()">
<label class="i-sdc-form-label required">Category</label>
<select class="i-sdc-form-select"
data-required
name="category"
data-ng-change="setIconToDefault()"
data-ng-disabled="model.isAlreadyCertified"
data-ng-model="model.category"
data-tests-id="selectGeneralCategory"
>
<option value="">Select category</option>
<optgroup ng-if="component.isResource()" data-ng-repeat="mainCategory in categories | orderBy:['name']" label="{{mainCategory.name}}" data-tests-id="{{mainCategory.name}}">
<option data-ng-repeat="subCategory in mainCategory.subcategories track by $index"
data-ng-selected="model.category===calculateUnique(mainCategory.name,subCategory.name)"
data-tests-id="{{subCategory.name}}"
value="{{calculateUnique(mainCategory.name,subCategory.name)}}">{{subCategory.name}}
</option>
</optgroup>
<option ng-if="component.isService()" data-ng-repeat="mainCategory in categories | orderBy:['name']"
data-ng-selected="model.category===mainCategory.name"
value="{{mainCategory.name}}"
data-tests-id="{{mainCategory.name}}">{{mainCategory.name}}</option>
</select>
<div class="input-error" data-ng-show="validateField(editForm.category)">
<span ng-show="editForm.category.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_CATEGORY_REQUIRED"></span>
</div>
</div>
<!--------------------- CATEGORIES -------------------->
<!--------------------- VENDOR NAME -------------------->
<div ng-if="component.isResource()" class="i-sdc-form-item" data-ng-class="{'error': validateField(editForm.vendorName)}">
<label class="i-sdc-form-label required">Vendor</label>
<input class="i-sdc-form-input" type="text"
data-ng-model="model.vendorName"
data-ng-model-options="{ debounce: 500 }"
data-ng-maxlength="25"
data-required
ng-click="oldValue = model.vendorName"
name="vendorName"
data-ng-change="onVendorNameChange(oldValue)"
data-ng-pattern="validation.vendorValidationPattern"
maxlength="25"
data-ng-disabled="model.isAlreadyCertified"
data-tests-id="vendorName"
/>
<div class="input-error" data-ng-show="validateField(editForm.vendorName)">
<span ng-show="editForm.vendorName.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_VENDOR_NAME_REQUIRED"></span>
<span ng-show="editForm.vendorName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '25' }"></span>
<span ng-show="editForm.vendorName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
</div>
</div>
<!--------------------- VENDOR NAME -------------------->
<!--------------------- VENDOR RELEASE -------------------->
<div ng-if="component.isResource()"
class="i-sdc-form-item"
data-ng-class="{'error': validateField(editForm.vendorRelease)}">
<label class="i-sdc-form-label required">Vendor Release</label>
<input class="i-sdc-form-input" type="text"
data-ng-model="model.vendorRelease"
data-ng-model-options="{ debounce: 500 }"
data-ng-maxlength="25"
data-required
name="vendorRelease"
data-ng-pattern="validation.vendorValidationPattern"
maxlength="25"
data-tests-id="vendorRelease"
/>
<div class="input-error" data-ng-show="validateField(editForm.vendorRelease)">
<span ng-show="editForm.vendorRelease.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_VENDOR_RELEASE_REQUIRED"></span>
<span ng-show="editForm.vendorRelease.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '128' }"></span>
<span ng-show="editForm.vendorRelease.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
</div>
</div>
<!--------------------- VENDOR RELEASE -------------------->
</div><!-- Close w-sdc-form-column -->
<div class="w-sdc-form-column">
<!--------------------- RESOURCE TAGS -------------------->
<div class="i-sdc-form-item" data-ng-class="{'error': validateField(editForm.tags)}">
<label class="i-sdc-form-label">Tags</label>
<sdc-tags form-element="editForm" element-name="tags" max-tags="20" class="i-sdc-form-item-tags" tags="model.tags" pattern="validation.tagValidationPattern" special-tag="model.name"></sdc-tags>
<div class="input-error" data-ng-show="validateField(editForm.tags)">
<span ng-show="editForm.tags.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
</div>
</div>
<!--------------------- RESOURCE TAGS -------------------->
<!--------------------- CONTACT ID -------------------->
<div class="i-sdc-form-item" data-ng-class="{'error': validateField(editForm.contactId)}">
<label class="i-sdc-form-label required" translate="GENERAL_LABEL_CONTACT_ID"></label>
<input class="i-sdc-form-input disabled" type="text"
data-ng-model="model.userId"
data-required
name="contactId"
data-ng-pattern="validation.contactIdValidationPattern"
data-ng-model-options="{ debounce: 500 }"
data-tests-id="userId"
maxlength="50"
/>
<div class="input-error" data-ng-show="validateField(editForm.contactId)">
<span ng-show="editForm.contactId.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_CONTACT_REQUIRED"></span>
<span ng-show="editForm.contactId.$error.pattern" translate="NEW_SERVICE_RESOURCE_ERROR_CONTACT_NOT_VALID"></span>
</div>
</div>
<!--------------------- CONTACT ID -------------------->
<!--------------------- PROJECT CODE -------------------->
<div class="i-sdc-form-item" data-ng-if="!component.isResource()"
data-ng-class="{'error': validateField(editForm.projectCode)}">
<label class="i-sdc-form-label required" translate="GENERAL_LABEL_PROJECT_CODE"></label>
<input class="i-sdc-form-input" type="text"
data-ng-model="model.projectCode"
data-ng-model-options="{ debounce: 500 }"
data-ng-maxlength="128"
data-required
name="projectCode"
data-ng-pattern="validation.projectCodeValidationPattern"
maxlength="50"
data-tests-id="projectCode"
/>
<div class="input-error" data-ng-show="validateField(editForm.projectCode)">
<span ng-show="editForm.projectCode.$error.required" translate="NEW_SERVICE_RESOURCE_ERROR_PROJECT_CODE_REQUIRED"></span>
<span ng-show="editForm.projectCode.$error.pattern" translate="NEW_SERVICE_RESOURCE_ERROR_PROJECT_CODE_NOT_VALID"></span>
</div>
</div>
<!--------------------- VENDOR RELEASE -------------------->
</div><!-- Close w-sdc-form-column -->
</div><!-- Close w-sdc-form-column -->
<div class="w-sdc-form-messages-wrapper">
<span class="w-sdc-form-messages-msg" data-ng-show="isSaved"><span class="w-sdc-form-messages-msg-v"></span>Your resource has been saved</span>
</div>
</div><!-- Close w-sdc-form-section-container -->
</form>
</div>
</div>
|