Commit 7d82d3b9 authored by Scott Hampton's avatar Scott Hampton

Merge branch 'ek-disable-editing-default-value-streams' into 'master'

Disable editing default value streams

See merge request gitlab-org/gitlab!54649
parents 1c57eedb 8d87e22c
......@@ -37,6 +37,9 @@ export const i18n = {
ISSUE_STAGE_END: s__('CreateValueStreamForm|Issue stage end'),
PLAN_STAGE_START: s__('CreateValueStreamForm|Plan stage start'),
CODE_STAGE_START: s__('CreateValueStreamForm|Code stage start'),
DEFAULT_STAGE_FEATURES: s__(
'CreateValueStreamForm|Default stages can only be hidden or re-ordered',
),
};
export const ERRORS = {
......
......@@ -66,14 +66,15 @@ export default {
:state="isValid('name')"
:invalid-feedback="renderError('name')"
:data-testid="`default-stage-name-${index}`"
:description="$options.i18n.DEFAULT_STAGE_FEATURES"
>
<!-- eslint-disable vue/no-mutating-props -->
<gl-form-input
v-model.trim="stage.name"
:name="`create-value-stream-stage-${index}`"
:placeholder="$options.i18n.FORM_FIELD_STAGE_NAME_PLACEHOLDER"
disabled="disabled"
required
@input="$emit('input', $event)"
/>
<!-- eslint-enable vue/no-mutating-props -->
</gl-form-group>
......@@ -84,7 +85,10 @@ export default {
@hide="$emit('hide', $event)"
/>
</div>
<div class="gl-display-flex gl-align-items-center" :data-testid="`stage-start-event-${index}`">
<div
class="gl-display-flex gl-align-items-center gl-mt-2"
:data-testid="`stage-start-event-${index}`"
>
<span class="gl-m-0 gl-vertical-align-middle gl-mr-2 gl-font-weight-bold">{{
$options.i18n.DEFAULT_FIELD_START_EVENT_LABEL
}}</span>
......
......@@ -56,6 +56,10 @@ describe('DefaultStageFields', () => {
expect(findStageFieldName().html()).toContain(defaultStage.name);
});
it('disables input for the stage field name', () => {
expect(findStageFieldName().attributes('disabled')).toBe('disabled');
});
it('renders the field start event', () => {
expect(findStartEvent().exists()).toBe(true);
expect(findStartEvent().html()).toContain(ISSUE_CREATED.name);
......@@ -72,12 +76,12 @@ describe('DefaultStageFields', () => {
expect(content).toContain(defaultStage.endEventLabel);
});
it('on field input emits an input event', () => {
it('does not emits any input', () => {
expect(wrapper.emitted('input')).toBeUndefined();
const newInput = 'coooool';
findStageFieldName().vm.$emit('input', newInput);
expect(wrapper.emitted('input')[0]).toEqual([newInput]);
expect(wrapper.emitted('input')).toBeUndefined();
});
describe('StageFieldActions', () => {
......
......@@ -8666,6 +8666,9 @@ msgstr ""
msgid "CreateValueStreamForm|Default stages"
msgstr ""
msgid "CreateValueStreamForm|Default stages can only be hidden or re-ordered"
msgstr ""
msgid "CreateValueStreamForm|Edit Value Stream"
msgstr ""
......
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