@@ -4,13 +4,15 @@ import { __, s__, sprintf } from '~/locale';
4
4
import { visitUrlWithAlerts } from ' ~/lib/utils/url_utility' ;
5
5
import * as Sentry from ' ~/sentry/sentry_browser_wrapper' ;
6
6
import { semverRegex } from ' ~/lib/utils/regexp' ;
7
+ import PageHeading from ' ~/vue_shared/components/page_heading.vue' ;
7
8
import MarkdownEditor from ' ~/vue_shared/components/markdown/markdown_editor.vue' ;
8
9
import { helpPagePath } from ' ~/helpers/help_page_helper' ;
9
10
import createModelVersionMutation from ' ../graphql/mutations/create_model_version.mutation.graphql' ;
10
11
11
12
export default {
12
13
name: ' ModelVersionCreate' ,
13
14
components: {
15
+ PageHeading,
14
16
GlAlert,
15
17
GlButton,
16
18
GlForm,
@@ -109,6 +111,7 @@ export default {
109
111
},
110
112
async create () {
111
113
this .errorMessage = ' ' ;
114
+
112
115
try {
113
116
if (! this .versionData ) {
114
117
this .versionData = await this .createModelVersion ();
@@ -176,9 +179,22 @@ export default {
176
179
177
180
< template>
178
181
< div>
182
+ < gl- alert
183
+ v- if = " errorMessage"
184
+ class = " gl-mt-5"
185
+ data- testid= " create-alert"
186
+ variant= " danger"
187
+ @dismiss= " hideAlert"
188
+ > {{ errorMessage }}
189
+ < / gl- alert>
190
+
191
+ < page- heading : heading= " $options.i18n.title" >
192
+ < template #description>
193
+ {{ $options .i18n .description }}
194
+ < / template>
195
+ < / page- heading>
196
+
179
197
< gl- form>
180
- < h2 data- testid= " title" > {{ $options .i18n .title }}< / h2>
181
- < p data- testid= " description" class = " gl-text-default" > {{ $options .i18n .description }}< / p>
182
198
< gl- form- group
183
199
data- testid= " versionDescriptionId"
184
200
: label= " $options.i18n.versionLabelText"
@@ -193,6 +209,7 @@ export default {
193
209
v- model= " version"
194
210
data- testid= " versionId"
195
211
type= " text"
212
+ required
196
213
: placeholder= " $options.i18n.versionPlaceholder"
197
214
autocomplete= " off"
198
215
/ >
@@ -229,24 +246,24 @@ export default {
229
246
< import -artifact-zone
230
247
id= " versionImportArtifactZone"
231
248
ref= " importArtifactZoneRef"
232
- class = " gl-px-3 gl-py-0"
249
+ class = " gl-px-0 gl-py-0"
233
250
: submit- on- select= " false"
234
251
@error= " onImportError"
235
252
/ >
236
253
< / gl- form- group>
254
+
255
+ < div class = " gl-flex gl-gap-3" >
256
+ < gl- button
257
+ data- testid= " primary-button"
258
+ variant= " confirm"
259
+ : disabled= " submitButtonDisabled"
260
+ @click= " create"
261
+ > {{ $options .i18n .actionPrimaryText }}
262
+ < / gl- button>
263
+ < gl- button data- testid= " secondary-button" variant= " default" @click= " resetForm"
264
+ > {{ $options .i18n .actionSecondaryText }}
265
+ < / gl- button>
266
+ < / div>
237
267
< / gl- form>
238
- < gl- alert v- if = " errorMessage" variant= " danger" @dismiss= " hideAlert" > {{
239
- errorMessage
240
- }}< / gl- alert>
241
- < gl- button
242
- data- testid= " primary-button"
243
- variant= " confirm"
244
- : disabled= " submitButtonDisabled"
245
- @click= " create"
246
- > {{ $options .i18n .actionPrimaryText }}
247
- < / gl- button>
248
- < gl- button data- testid= " secondary-button" variant= " default" @click= " resetForm"
249
- > {{ $options .i18n .actionSecondaryText }}
250
- < / gl- button>
251
268
< / div>
252
269
< / template>
0 commit comments