Commit 34bc3fe0 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'afontaine/add-required-to-release' into 'master'

Add required label to tag name in release form

See merge request gitlab-org/gitlab!73759
parents e00a6996 9d268fe0
...@@ -95,6 +95,8 @@ export default { ...@@ -95,6 +95,8 @@ export default {
noRefSelected: __('No tag selected'), noRefSelected: __('No tag selected'),
dropdownHeader: __('Tag name'), dropdownHeader: __('Tag name'),
searchPlaceholder: __('Search or create tag'), searchPlaceholder: __('Search or create tag'),
label: __('Tag name'),
labelDescription: __('*Required'),
}, },
createFrom: { createFrom: {
noRefSelected: __('No source selected'), noRefSelected: __('No source selected'),
...@@ -108,11 +110,12 @@ export default { ...@@ -108,11 +110,12 @@ export default {
<template> <template>
<div> <div>
<gl-form-group <gl-form-group
:label="__('Tag name')"
:label-for="tagNameInputId"
data-testid="tag-name-field" data-testid="tag-name-field"
:state="!showTagNameValidationError" :state="!showTagNameValidationError"
:invalid-feedback="__('Tag name is required')" :invalid-feedback="__('Tag name is required')"
:label="$options.translations.tagName.label"
:label-for="tagNameInputId"
:label-description="$options.translations.tagName.labelDescription"
> >
<form-field-container> <form-field-container>
<ref-selector <ref-selector
......
...@@ -1139,6 +1139,9 @@ msgstr "" ...@@ -1139,6 +1139,9 @@ msgstr ""
msgid "* All times are in UTC unless specified" msgid "* All times are in UTC unless specified"
msgstr "" msgstr ""
msgid "*Required"
msgstr ""
msgid "+ %{amount} more" msgid "+ %{amount} more"
msgstr "" msgstr ""
......
import { GlDropdownItem } from '@gitlab/ui'; import { GlDropdownItem } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils'; import { mount, shallowMount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import { __ } from '~/locale';
import TagFieldNew from '~/releases/components/tag_field_new.vue'; import TagFieldNew from '~/releases/components/tag_field_new.vue';
import createStore from '~/releases/stores'; import createStore from '~/releases/stores';
import createEditNewModule from '~/releases/stores/modules/edit_new'; import createEditNewModule from '~/releases/stores/modules/edit_new';
...@@ -84,7 +85,8 @@ describe('releases/components/tag_field_new', () => { ...@@ -84,7 +85,8 @@ describe('releases/components/tag_field_new', () => {
beforeEach(() => createComponent()); beforeEach(() => createComponent());
it('renders a label', () => { it('renders a label', () => {
expect(findTagNameFormGroup().attributes().label).toBe('Tag name'); expect(findTagNameFormGroup().attributes().label).toBe(__('Tag name'));
expect(findTagNameFormGroup().props().labelDescription).toBe(__('*Required'));
}); });
describe('when the user selects a new tag name', () => { describe('when the user selects a new tag name', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment