Commit 8d87e22c authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Disable editing default value streams

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