summaryrefslogtreecommitdiffstats
path: root/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view.html
blob: 2643b99c20828daa8bf95b25a4e42e400ca4c5d5 (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
<sdc-modal modal="modalInstanceArtifact" type="classic" class="sdc-add-artifact" buttons="footerButtons" header="{{getFormTitle()}}" show-close-button="true">

    <loader data-display="isLoading"></loader>

    <form novalidate class="w-sdc-form two-columns" name="forms.editForm">

        <!--------------------- ARTIFACT FILE -------------------->
        <div class="i-sdc-form-item">
            <label class="required">Upload File</label>
            <file-upload id="fileUploadElement"
                         form-element="forms.editForm"
                         element-required="{{fileUploadRequired()}}"
                         element-name="myArtifactFile"
                         file-model="editArtifactResourceModel.artifactFile"
                         extensions="{{fileExtensions()}}"
                         data-ng-class="{'error': forms.editForm.myArtifactFile.$dirty && forms.editForm.myArtifactFile.$invalid}"></file-upload>

            <div class="input-error-file-upload" data-ng-show="forms.editForm.myArtifactFile.$dirty && forms.editForm.myArtifactFile.$invalid">
                <span ng-show="forms.editForm.myArtifactFile.$error.required && !forms.editForm.myArtifactFile.$error.emptyFile" translate="ADD_ARTIFACT_ERROR_FILE_REQUIRED"></span>
                <span ng-show="forms.editForm.myArtifactFile.$error.maxsize" translate="VALIDATION_ERROR_MAX_FILE_SIZE"></span>
                <span ng-if="'DEPLOYMENT' === artifactGroupType" ng-show="forms.editForm.myArtifactFile.$error.filetype" translate="ADD_ARTIFACT_ERROR_VALID_EXTENSIONS" translate-values="{'extensions': '{{fileExtensions()}}'}"></span>
                <span ng-show="forms.editForm.myArtifactFile.$error.emptyFile" translate="VALIDATION_ERROR_EMPTY_FILE"></span>
            </div>
        </div>
        <!--------------------- ARTIFACT FILE -------------------->

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

            <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.placeHolder.$dirty && forms.editForm.placeHolder.$invalid)}" data-ng-show="isPlaceHolderArtifact">
                <label class="i-sdc-form-label required">Artifact</label>
                <select class="i-sdc-form-select"
                        name="placeHolder"
                        data-ng-disabled="!isNew"
                        data-ng-model="selectedArtifact"
                        data-ng-change="changeArtifact(selectedArtifact)"
                        data-tests-id="selectArtifact">
                    <option disabled value="?">Select Artifact</option>
                    <option data-ng-repeat="(key,value) in editArtifactResourceModel.artifactsFormList">{{value.artifactDisplayName}}</option>
                    <option value="">Create New Artifact</option>

                </select>

                <div class="input-error" data-ng-show="forms.editForm.placeHolder.$dirty && forms.editForm.placeHolder.$invalid">
                    <span ng-show="forms.editForm.placeHolder.$error.required" translate="ADD_ARTIFACT_ERROR_TYPE_REQUIRED"></span>
                </div>
            </div>

            <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.artifactLabel.$dirty && forms.editForm.artifactLabel.$invalid)}" data-ng-show="!isPlaceHolderArtifact">
                <label class="i-sdc-form-label required">Artifact Label</label>
                <input class="i-sdc-form-input"
                       data-ng-maxlength="25"
                       data-ng-model="editArtifactResourceModel.artifactResource.artifactLabel"
                       type="text"
                       name="artifactLabel"
                       data-required
                       data-ng-model-options="{ debounce: 200 }"
                       data-ng-pattern="labelValidationPattern"
                       maxlength="25"
                       data-ng-disabled="!isNew || editArtifactResourceModel.artifactResource.mandatory"
                       data-tests-id="artifactLabel"
                       autofocus/>
                <span class="w-sdc-icon-cancel" data-ng-click="selectedArtifact='?'; removeInputLabel()"></span>

                <div class="input-error" data-ng-show="forms.editForm.artifactLabel.$dirty && forms.editForm.artifactLabel.$invalid">
                    <span ng-show="forms.editForm.artifactLabel.$error.required" translate="ADD_ARTIFACT_ERROR_LABEL_REQUIRED"></span>
                    <span ng-show="forms.editForm.artifactLabel.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '25' }"></span>
                    <span ng-show="forms.editForm.artifactLabel.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
                </div>
            </div>

            <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.timeout.$dirty && forms.editForm.timeout.$invalid)}"
                 data-ng-if="isDeploymentHeat()">
                <label class="i-sdc-form-label">Deployment Timeout (minutes)</label>
                <input class="i-sdc-form-input"
                       data-ng-maxlength="25"
                       data-ng-model="editArtifactResourceModel.artifactResource.timeout"
                       type="number"
                       name="timeout"
                       min="1"
                       max="2147483647"
                       data-ng-model-options="{ debounce: 200 }"
                       data-ng-pattern="integerValidationPattern"
                       data-ng-init="setDefaultTimeout()"
                       data-ng-change="setDefaultTimeout()"
                       maxlength="25"
                       data-tests-id="timeout"/>

                <div class="input-error" data-ng-show="forms.editForm.timeout.$dirty && forms.editForm.timeout.$invalid">
                    <span ng-show="forms.editForm.timeout.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '25' }"></span>
                    <span ng-show="forms.editForm.timeout.$error.pattern" translate="ADD_ARTIFACT_ERROR_TIMEOUT_PATTERN"></span>
                    <span ng-show="forms.editForm.timeout.$error.min" translate="ADD_ARTIFACT_ERROR_TIMEOUT_MIN"></span>
                </div>
            </div>
            <div class="i-sdc-form-item" data-ng-class="{error:(forms.editForm.type.$dirty && forms.editForm.type.$invalid)}">
                <label class="i-sdc-form-label required">Type</label>
                <select class="i-sdc-form-select"
                        data-required
                        name="type"
                        data-ng-disabled="!isNew || editArtifactResourceModel.artifactResource.mandatory || '?'==selectedArtifact"
                        data-ng-model="editArtifactResourceModel.artifactResource.artifactType"
                        data-ng-options="type as type for type in editArtifactResourceModel.artifactTypes track by type | uppercase"
                        data-tests-id="artifacttype">
                    <option value="">Choose Type</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="ADD_ARTIFACT_ERROR_TYPE_REQUIRED"></span>
                </div>

            </div>
        </div>

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

            <div class="i-sdc-form-item"
                 data-ng-class="{error:(forms.editForm.description.$dirty && forms.editForm.description.$invalid)}">
                <label class="i-sdc-form-label required">Description</label>
                  <textarea class="i-sdc-form-textarea"
                            data-ng-maxlength="256"
                            maxlength="256"
                            data-required
                            name="description"
                            data-ng-model="editArtifactResourceModel.artifactResource.description"
                            data-ng-model-options="{ debounce: 200 }"
                            data-ng-pattern="commentValidationPattern"
                            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.required" translate="ADD_ARTIFACT_ERROR_DESCRIPTION_REQUIRED"></span>
                    <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>
                </div>

            </div>
        </div>
        </div>

        <span class="w-sdc-form-note" data-ng-show="forms.editForm.$invalid && false" translate="LABEL_ALL_FIELDS_ARE_MANDATORY"></span>

    </form>

</sdc-modal>