Commit 58685520 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by Vitaly Slobodin

Remove the `value_stream_analytics_extended_form` feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

parent 2e43d7fc
---
name: value_stream_analytics_extended_form
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50229
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/294190
milestone: '13.7'
type: development
group: group::optimize
default_enabled: true
...@@ -317,17 +317,16 @@ To create a value stream: ...@@ -317,17 +317,16 @@ To create a value stream:
1. Navigate to your group's **Analytics > Value Stream**. 1. Navigate to your group's **Analytics > Value Stream**.
1. Click the Value stream dropdown and select **Create new Value Stream** 1. Click the Value stream dropdown and select **Create new Value Stream**
1. Fill in a name for the new Value Stream 1. Fill in a name for the new Value Stream
- You can [customize the stages](#creating-a-value-stream-with-stages) as the `value_stream_analytics_extended_form` feature flag is enabled. - You can [customize the stages](#creating-a-value-stream-with-stages)
1. Click the **Create Value Stream** button. 1. Click the **Create Value Stream** button.
![New value stream](img/new_value_stream_v13_3.png "Creating a new value stream") ![New value stream](img/new_value_stream_v13_3.png "Creating a new value stream")
#### Creating a value stream with stages #### Creating a value stream with stages
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55572) in GitLab 13.10. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50229) in GitLab 13.7.
> - It's [deployed behind a feature flag](../../feature_flags.md), enabled by default. > - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55572) in GitLab 13.10.
> - It's enabled on GitLab.com. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/294190) in GitLab 13.11.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](../../../administration/feature_flags.md). **(FREE SELF)**
WARNING: WARNING:
This feature might not be available to you. Check the **version history** note above for details. This feature might not be available to you. Check the **version history** note above for details.
...@@ -349,27 +348,6 @@ To create a value stream with stages: ...@@ -349,27 +348,6 @@ To create a value stream with stages:
![Extended create value stream form](img/extended_value_stream_form_v13_10.png "Extended create value stream form") ![Extended create value stream form](img/extended_value_stream_form_v13_10.png "Extended create value stream form")
#### Enable or disable value stream with stages
Value streams with stages is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
# For the instance
Feature.enable(:value_stream_analytics_extended_form)
```
To disable it:
```ruby
# For the instance
Feature.disable(:value_stream_analytics_extended_form)
```
### Deleting a value stream ### Deleting a value stream
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221205) in GitLab 13.4. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221205) in GitLab 13.4.
......
...@@ -202,7 +202,6 @@ export default { ...@@ -202,7 +202,6 @@ export default {
<value-stream-select <value-stream-select
v-if="shouldDisplayCreateMultipleValueStreams" v-if="shouldDisplayCreateMultipleValueStreams"
class="gl-align-self-start gl-sm-align-self-start gl-mt-0 gl-sm-mt-5" class="gl-align-self-start gl-sm-align-self-start gl-mt-0 gl-sm-mt-5"
:has-extended-form-fields="featureFlags.hasExtendedFormFields"
/> />
</div> </div>
<gl-empty-state <gl-empty-state
......
...@@ -57,11 +57,6 @@ export default { ...@@ -57,11 +57,6 @@ export default {
required: false, required: false,
default: () => ({}), default: () => ({}),
}, },
hasExtendedFormFields: {
type: Boolean,
required: false,
default: false,
},
defaultStageConfig: { defaultStageConfig: {
type: Array, type: Array,
required: true, required: true,
...@@ -75,22 +70,18 @@ export default { ...@@ -75,22 +70,18 @@ export default {
data() { data() {
const { const {
defaultStageConfig = [], defaultStageConfig = [],
hasExtendedFormFields,
initialData: { name: initialName, stages: initialStages }, initialData: { name: initialName, stages: initialStages },
initialFormErrors, initialFormErrors,
initialPreset, initialPreset,
} = this; } = this;
const { name: nameError = [], stages: stageErrors = [{}] } = initialFormErrors; const { name: nameError = [], stages: stageErrors = [{}] } = initialFormErrors;
const additionalFields = hasExtendedFormFields const additionalFields = {
? { stages: this.isEditing
stages: this.isEditing ? cloneDeep(initialStages)
? cloneDeep(initialStages) : initializeStages(defaultStageConfig, initialPreset),
: initializeStages(defaultStageConfig, initialPreset), stageErrors:
stageErrors: cloneDeep(stageErrors) || initializeStageErrors(defaultStageConfig, initialPreset),
cloneDeep(stageErrors) || initializeStageErrors(defaultStageConfig, initialPreset), };
}
: { stages: [], nameError };
return { return {
hiddenStages: [], hiddenStages: [],
selectedPreset: initialPreset, selectedPreset: initialPreset,
...@@ -129,11 +120,7 @@ export default { ...@@ -129,11 +120,7 @@ export default {
secondaryProps() { secondaryProps() {
return { return {
text: this.$options.i18n.BTN_ADD_ANOTHER_STAGE, text: this.$options.i18n.BTN_ADD_ANOTHER_STAGE,
attributes: [ attributes: [{ category: 'secondary' }, { variant: 'info' }, { class: '' }],
{ category: 'secondary' },
{ variant: 'info' },
{ class: this.hasExtendedFormFields ? '' : 'gl-display-none' },
],
}; };
}, },
hasFormErrors() { hasFormErrors() {
...@@ -346,7 +333,7 @@ export default { ...@@ -346,7 +333,7 @@ export default {
</div> </div>
</gl-form-group> </gl-form-group>
<gl-form-radio-group <gl-form-radio-group
v-if="hasExtendedFormFields && !isEditing" v-if="!isEditing"
v-model="selectedPreset" v-model="selectedPreset"
class="gl-mb-4" class="gl-mb-4"
data-testid="vsa-preset-selector" data-testid="vsa-preset-selector"
...@@ -354,7 +341,7 @@ export default { ...@@ -354,7 +341,7 @@ export default {
name="preset" name="preset"
@input="onSelectPreset" @input="onSelectPreset"
/> />
<div v-if="hasExtendedFormFields" data-testid="extended-form-fields"> <div data-testid="extended-form-fields">
<div <div
v-for="(stage, activeStageIndex) in stages" v-for="(stage, activeStageIndex) in stages"
ref="formStages" ref="formStages"
......
...@@ -40,13 +40,6 @@ export default { ...@@ -40,13 +40,6 @@ export default {
directives: { directives: {
GlModalDirective, GlModalDirective,
}, },
props: {
hasExtendedFormFields: {
type: Boolean,
required: false,
default: false,
},
},
data() { data() {
return { return {
showCreateModal: false, showCreateModal: false,
...@@ -176,7 +169,6 @@ export default { ...@@ -176,7 +169,6 @@ export default {
v-if="showCreateModal" v-if="showCreateModal"
:initial-data="initialData" :initial-data="initialData"
:initial-form-errors="initialFormErrors" :initial-form-errors="initialFormErrors"
:has-extended-form-fields="hasExtendedFormFields"
:default-stage-config="defaultStageConfig" :default-stage-config="defaultStageConfig"
:is-editing="isEditing" :is-editing="isEditing"
@hidden="showCreateModal = false" @hidden="showCreateModal = false"
......
...@@ -22,7 +22,6 @@ export default () => { ...@@ -22,7 +22,6 @@ export default () => {
const { const {
cycleAnalyticsScatterplotEnabled: hasDurationChart = false, cycleAnalyticsScatterplotEnabled: hasDurationChart = false,
valueStreamAnalyticsPathNavigation: hasPathNavigation = false, valueStreamAnalyticsPathNavigation: hasPathNavigation = false,
valueStreamAnalyticsExtendedForm: hasExtendedFormFields = false,
} = gon?.features; } = gon?.features;
const { const {
...@@ -41,7 +40,6 @@ export default () => { ...@@ -41,7 +40,6 @@ export default () => {
featureFlags: { featureFlags: {
hasDurationChart, hasDurationChart,
hasPathNavigation, hasPathNavigation,
hasExtendedFormFields,
}, },
}); });
......
...@@ -15,7 +15,6 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati ...@@ -15,7 +15,6 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati
before_action do before_action do
push_frontend_feature_flag(:cycle_analytics_scatterplot_enabled, default_enabled: true) push_frontend_feature_flag(:cycle_analytics_scatterplot_enabled, default_enabled: true)
push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group, default_enabled: :yaml) push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group, default_enabled: :yaml)
push_frontend_feature_flag(:value_stream_analytics_extended_form, @group, default_enabled: :yaml)
render_403 unless can?(current_user, :read_group_cycle_analytics, @group) render_403 unless can?(current_user, :read_group_cycle_analytics, @group)
end end
......
---
title: Remove feature flag value_stream_analytics_extended_form
merge_request: 58821
author:
type: changed
...@@ -19,8 +19,7 @@ RSpec.describe 'Group value stream analytics' do ...@@ -19,8 +19,7 @@ RSpec.describe 'Group value stream analytics' do
expect(page).to have_pushed_frontend_feature_flags( expect(page).to have_pushed_frontend_feature_flags(
cycleAnalyticsScatterplotEnabled: true, cycleAnalyticsScatterplotEnabled: true,
valueStreamAnalyticsPathNavigation: true, valueStreamAnalyticsPathNavigation: true
valueStreamAnalyticsExtendedForm: true
) )
end end
...@@ -35,16 +34,4 @@ RSpec.describe 'Group value stream analytics' do ...@@ -35,16 +34,4 @@ RSpec.describe 'Group value stream analytics' do
expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsPathNavigation: false) expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsPathNavigation: false)
end end
end end
context 'when `value_stream_analytics_extended_form` is disabled for a group' do
before do
stub_feature_flags(value_stream_analytics_extended_form: false, thing: group)
end
it 'pushes disabled feature flag to the frontend' do
visit group_analytics_cycle_analytics_path(group)
expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsExtendedForm: false)
end
end
end end
...@@ -135,30 +135,6 @@ RSpec.describe 'Multiple value streams', :js do ...@@ -135,30 +135,6 @@ RSpec.describe 'Multiple value streams', :js do
end end
end end
describe 'with the `value_stream_analytics_extended_form` feature flag disabled' do
before do
stub_licensed_features(cycle_analytics_for_groups: true, type_of_work_analytics: true)
stub_feature_flags(value_stream_analytics_extended_form: false)
sign_in(user)
select_group(group)
toggle_value_stream_dropdown
page.find_button(_('Create new Value Stream')).click
end
it 'does not include additional form fields' do
expect(page).not_to have_selector(extended_form_fields_selector)
end
it 'can create a value stream' do
create_value_stream
expect(page).to have_text(_("'%{name}' Value Stream created") % { name: custom_value_stream_name })
end
end
describe 'Delete value stream' do describe 'Delete value stream' do
before do before do
value_stream = create(:cycle_analytics_group_value_stream, name: custom_value_stream_name, group: group) value_stream = create(:cycle_analytics_group_value_stream, name: custom_value_stream_name, group: group)
......
...@@ -94,7 +94,6 @@ describe('ValueStreamForm', () => { ...@@ -94,7 +94,6 @@ describe('ValueStreamForm', () => {
const findExtendedFormFields = () => wrapper.findByTestId('extended-form-fields'); const findExtendedFormFields = () => wrapper.findByTestId('extended-form-fields');
const findPresetSelector = () => wrapper.findByTestId('vsa-preset-selector'); const findPresetSelector = () => wrapper.findByTestId('vsa-preset-selector');
const findBtn = (btn) => findModal().props(btn); const findBtn = (btn) => findModal().props(btn);
const findSubmitAttribute = (attribute) => findBtn('actionPrimary').attributes[1][attribute];
const expectFieldError = (testId, error = '') => const expectFieldError = (testId, error = '') =>
expect(wrapper.findByTestId(testId).attributes('invalid-feedback')).toBe(error); expect(wrapper.findByTestId(testId).attributes('invalid-feedback')).toBe(error);
...@@ -108,30 +107,6 @@ describe('ValueStreamForm', () => { ...@@ -108,30 +107,6 @@ describe('ValueStreamForm', () => {
wrapper = createComponent(); wrapper = createComponent();
}); });
it('submit button is enabled', () => {
expect(findSubmitAttribute('disabled')).toBeUndefined();
});
it('does not include extended fields', () => {
expect(findExtendedFormFields().exists()).toBe(false);
});
it('does not include add stage button', () => {
expect(findBtn('actionSecondary').attributes).toContainEqual({
class: 'gl-display-none',
});
});
it('does not include the preset selector', () => {
expect(findPresetSelector().exists()).toBe(false);
});
});
describe('with hasExtendedFormFields=true', () => {
beforeEach(() => {
wrapper = createComponent({ props: { hasExtendedFormFields: true } });
});
it('has the extended fields', () => { it('has the extended fields', () => {
expect(findExtendedFormFields().exists()).toBe(true); expect(findExtendedFormFields().exists()).toBe(true);
}); });
...@@ -149,7 +124,6 @@ describe('ValueStreamForm', () => { ...@@ -149,7 +124,6 @@ describe('ValueStreamForm', () => {
describe('Add stage button', () => { describe('Add stage button', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent({ wrapper = createComponent({
props: { hasExtendedFormFields: true },
stubs: { stubs: {
CustomStageFields, CustomStageFields,
}, },
...@@ -180,7 +154,6 @@ describe('ValueStreamForm', () => { ...@@ -180,7 +154,6 @@ describe('ValueStreamForm', () => {
describe('form errors', () => { describe('form errors', () => {
const commonExtendedData = { const commonExtendedData = {
props: { props: {
hasExtendedFormFields: true,
initialFormErrors: initialFormStageErrors, initialFormErrors: initialFormStageErrors,
}, },
}; };
...@@ -223,7 +196,6 @@ describe('ValueStreamForm', () => { ...@@ -223,7 +196,6 @@ describe('ValueStreamForm', () => {
initialPreset, initialPreset,
initialData, initialData,
isEditing: true, isEditing: true,
hasExtendedFormFields: true,
}, },
}); });
}); });
...@@ -243,7 +215,6 @@ describe('ValueStreamForm', () => { ...@@ -243,7 +215,6 @@ describe('ValueStreamForm', () => {
initialPreset, initialPreset,
initialData, initialData,
isEditing: true, isEditing: true,
hasExtendedFormFields: true,
}, },
stubs: { stubs: {
CustomStageFields, CustomStageFields,
...@@ -280,7 +251,6 @@ describe('ValueStreamForm', () => { ...@@ -280,7 +251,6 @@ describe('ValueStreamForm', () => {
initialPreset, initialPreset,
initialData, initialData,
isEditing: true, isEditing: true,
hasExtendedFormFields: true,
}, },
}); });
}); });
...@@ -362,7 +332,20 @@ describe('ValueStreamForm', () => { ...@@ -362,7 +332,20 @@ describe('ValueStreamForm', () => {
it('calls the "createValueStream" event when submitted', () => { it('calls the "createValueStream" event when submitted', () => {
expect(createValueStreamMock).toHaveBeenCalledWith(expect.any(Object), { expect(createValueStreamMock).toHaveBeenCalledWith(expect.any(Object), {
name: streamName, name: streamName,
stages: [], stages: [
{
custom: false,
name: 'issue',
},
{
custom: false,
name: 'plan',
},
{
custom: false,
name: 'code',
},
],
}); });
}); });
......
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