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.
17 <ng1-modal modal="modalInstanceArtifact" type="classic" class="sdc-add-artifact" buttons="footerButtons" header="{{getFormTitle()}}" show-close-button="true" get-close-modal-response="close" data-tests-id="sdc-add-artifact">
19 <loader data-display="isLoading"></loader>
21 <div class="sdc-edit-artifact-form-container"
22 data-ng-class="{'mandatory-artifact': (editArtifactResourceModel.artifactResource.mandatory && artifactType !=='deployment') || artifactType === 'api'}">
23 <form novalidate class="w-sdc-form" name="forms.editForm">
25 <!--------------------- ARTIFACT FILE START-------------------->
26 <div class="i-sdc-form-item">
27 <label class="required">Upload File</label>
28 <file-upload id="fileUploadElement"
29 form-element="forms.editForm"
30 element-required="{{::fileUploadRequired()}}"
31 element-name="myArtifactFile"
32 file-model="editArtifactResourceModel.artifactFile"
33 extensions="{{fileExtensions()}}"
34 element-disabled="{{!editArtifactResourceModel.artifactResource.artifactType}}"
35 data-ng-class="{'error': forms.editForm.myArtifactFile.$dirty && forms.editForm.myArtifactFile.$invalid}"></file-upload>
37 <div class="input-error-file-upload" data-ng-show="forms.editForm.myArtifactFile.$dirty && forms.editForm.myArtifactFile.$invalid">
38 <span ng-show="forms.editForm.myArtifactFile.$error.required || forms.editForm.myArtifactFile.$error.emptyFile" translate="ADD_ARTIFACT_ERROR_FILE_REQUIRED"></span>
39 <span ng-show="forms.editForm.myArtifactFile.$error.maxsize" translate="VALIDATION_ERROR_MAX_FILE_SIZE"></span>
40 <span ng-if="artifactType === 'deployment'" ng-show="forms.editForm.myArtifactFile.$error.filetype" translate="ADD_ARTIFACT_ERROR_VALID_EXTENSIONS" translate-values="{'extensions': '{{fileExtensions()}}' }"></span>
41 <span ng-show="forms.editForm.myArtifactFile.$error.emptyFile" translate="VALIDATION_ERROR_EMPTY_FILE"></span>
44 <!--------------------- ARTIFACT FILE END -------------------->
46 <div class="w-sdc-form-columns-wrapper">
48 <div class="w-sdc-form-column" data-ng-if="artifactType === 'deployment' || (!editArtifactResourceModel.artifactResource.mandatory && artifactType !== 'api')">
50 <div class="i-sdc-form-item"
51 data-ng-class="{error:(forms.editForm.artifactLabel.$dirty && forms.editForm.artifactLabel.$invalid)}"
52 data-ng-if="!isDeploymentHeat()">
53 <label class="i-sdc-form-label required">Artifact Label</label>
54 <input class="i-sdc-form-input"
55 data-ng-maxlength="25"
56 data-ng-model="editArtifactResourceModel.artifactResource.artifactLabel"
60 data-ng-model-options="{ debounce: 200 }"
61 data-ng-pattern="labelValidationPattern"
63 data-ng-disabled="!isNew"
64 data-tests-id="artifactLabel"
67 <div class="input-error" data-ng-show="forms.editForm.artifactLabel.$dirty && forms.editForm.artifactLabel.$invalid">
68 <span ng-show="forms.editForm.artifactLabel.$error.required" translate="ADD_ARTIFACT_ERROR_LABEL_REQUIRED"></span>
69 <span ng-show="forms.editForm.artifactLabel.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '25' }"></span>
70 <span ng-show="forms.editForm.artifactLabel.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
75 <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.type.$dirty && forms.editForm.type.$invalid)}">
76 <label class="i-sdc-form-label required">Type</label>
77 <select class="i-sdc-form-select"
80 data-ng-disabled="!isNew"
81 data-ng-change="setDefaultTimeout()"
82 data-ng-model="editArtifactResourceModel.artifactResource.artifactType"
83 data-ng-options="type as type for type in editArtifactResourceModel.artifactTypes track by type | uppercase"
84 data-tests-id="artifacttype">
85 <option value="">Choose Type</option>
88 <div class="input-error" data-ng-show="forms.editForm.type.$dirty && forms.editForm.type.$invalid">
89 <span ng-show="forms.editForm.type.$error.required" translate="ADD_ARTIFACT_ERROR_TYPE_REQUIRED"></span>
94 <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.timeout.$dirty && forms.editForm.timeout.$invalid)}" data-ng-if="isDeploymentHeat()">
95 <label class="i-sdc-form-label">Deployment Timeout (minutes)</label>
96 <input class="i-sdc-form-input"
97 data-ng-maxlength="25"
98 data-ng-model="editArtifactResourceModel.artifactResource.timeout"
103 data-ng-disabled="'HEAT_ENV'==editArtifactResourceModel.artifactResource.artifactType"
104 data-ng-model-options="{ debounce: 200 }"
105 data-ng-pattern="integerValidationPattern"
106 data-ng-init="setDefaultTimeout()"
107 data-ng-change="setDefaultTimeout()"
109 data-tests-id="timeout" />
111 <div class="input-error" data-ng-show="forms.editForm.timeout.$dirty && forms.editForm.timeout.$invalid">
112 <span ng-show="forms.editForm.timeout.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '25' }"></span>
113 <span ng-show="forms.editForm.timeout.$error.pattern" translate="ADD_ARTIFACT_ERROR_TIMEOUT_PATTERN"></span>
114 <span ng-show="forms.editForm.timeout.$error.min" translate="ADD_ARTIFACT_ERROR_TIMEOUT_MIN"></span>
119 </div><!-- w-sdc-form-column -->
121 <div class="w-sdc-form-column i-sdc-form-url" data-ng-if="artifactType==='api'">
123 <div class="i-sdc-form-item"
124 data-ng-class="{error:(forms.editForm.apiUrl.$dirty && forms.editForm.apiUrl.$invalid)}">
125 <label class="i-sdc-form-label required">URL</label>
126 <input class="i-sdc-form-input"
127 data-ng-maxlength="100"
128 data-ng-model="editArtifactResourceModel.artifactResource.apiUrl"
129 data-ng-model-options="{ debounce: 200 }"
133 ng-pattern="urlValidationPattern"
136 invalid-characters=',#?&@$<>~^`\[]{}|")(*!+=;%' />
138 <div class="input-error" data-ng-show="forms.editForm.apiUrl.$dirty && forms.editForm.apiUrl.$invalid">
139 <span ng-show="forms.editForm.apiUrl.$error.required" translate="ADD_ARTIFACT_ERROR_APIURL_REQUIRED"></span>
140 <span ng-show="forms.editForm.apiUrl.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '100' }"></span>
141 <span ng-show="forms.editForm.apiUrl.$error.url || forms.editForm.apiUrl.$error.pattern || forms.editForm.apiUrl.$error.invalidCharacters" translate="ADD_ARTIFACT_ERROR_APIURL_URL"></span>
146 </div><!-- w-sdc-form-column -->
148 <div class="w-sdc-form-column">
150 <div class="i-sdc-form-item"
151 data-ng-class="{error:(forms.editForm.description.$dirty && forms.editForm.description.$invalid)}">
152 <label class="i-sdc-form-label required">Description</label>
153 <textarea class="i-sdc-form-textarea"
154 data-ng-maxlength="256"
158 data-ng-model="editArtifactResourceModel.artifactResource.description"
159 data-ng-model-options="{ debounce: 200 }"
160 data-ng-pattern="commentValidationPattern"
161 data-tests-id="description"></textarea>
163 <div class="input-error" data-ng-show="forms.editForm.description.$dirty && forms.editForm.description.$invalid">
164 <span ng-show="forms.editForm.description.$error.required" translate="ADD_ARTIFACT_ERROR_DESCRIPTION_REQUIRED"></span>
165 <span ng-show="forms.editForm.description.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '256' }"></span>
166 <span ng-show="forms.editForm.description.$error.pattern" translate="ADD_ARTIFACT_ERROR_DESCRIPTION_PATTERN"></span>
169 <div class="w-sdc-form-column artifact-info" data-ng-show="!isNew && editArtifactResourceModel.artifactResource.esId">
170 UUID <span data-ng-bind="editArtifactResourceModel.artifactResource.artifactUUID"></span>
172 Version <span data-ng-bind="editArtifactResourceModel.artifactResource.artifactVersion"></span>
176 </div><!-- w-sdc-form-column -->
178 </div><!-- w-sdc-form-columns-wrapper -->
180 <span class="w-sdc-form-note" data-ng-show="forms.editForm.$invalid && false" translate="LABEL_ALL_FIELDS_ARE_MANDATORY"></span>