Commit bda86133 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'ek-remove-value-stream-analytics-extended-form-ff' into 'master'

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

See merge request gitlab-org/gitlab!58821
parents 1ff1b8e9 58685520
---
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:
1. Navigate to your group's **Analytics > Value Stream**.
1. Click the Value stream dropdown and select **Create 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.
![New value stream](img/new_value_stream_v13_3.png "Creating a new value stream")
#### Creating a value stream with stages
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55572) in GitLab 13.10.
> - It's [deployed behind a feature flag](../../feature_flags.md), enabled by default.
> - It's enabled on GitLab.com.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](../../../administration/feature_flags.md). **(FREE SELF)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50229) in GitLab 13.7.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55572) in GitLab 13.10.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/294190) in GitLab 13.11.
WARNING:
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:
![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
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221205) in GitLab 13.4.
......
......@@ -202,7 +202,6 @@ export default {
<value-stream-select
v-if="shouldDisplayCreateMultipleValueStreams"
class="gl-align-self-start gl-sm-align-self-start gl-mt-0 gl-sm-mt-5"
:has-extended-form-fields="featureFlags.hasExtendedFormFields"
/>
</div>
<gl-empty-state
......
......@@ -57,11 +57,6 @@ export default {
required: false,
default: () => ({}),
},
hasExtendedFormFields: {
type: Boolean,
required: false,
default: false,
},
defaultStageConfig: {
type: Array,
required: true,
......@@ -75,22 +70,18 @@ export default {
data() {
const {
defaultStageConfig = [],
hasExtendedFormFields,
initialData: { name: initialName, stages: initialStages },
initialFormErrors,
initialPreset,
} = this;
const { name: nameError = [], stages: stageErrors = [{}] } = initialFormErrors;
const additionalFields = hasExtendedFormFields
? {
stages: this.isEditing
? cloneDeep(initialStages)
: initializeStages(defaultStageConfig, initialPreset),
stageErrors:
cloneDeep(stageErrors) || initializeStageErrors(defaultStageConfig, initialPreset),
}
: { stages: [], nameError };
const additionalFields = {
stages: this.isEditing
? cloneDeep(initialStages)
: initializeStages(defaultStageConfig, initialPreset),
stageErrors:
cloneDeep(stageErrors) || initializeStageErrors(defaultStageConfig, initialPreset),
};
return {
hiddenStages: [],
selectedPreset: initialPreset,
......@@ -129,11 +120,7 @@ export default {
secondaryProps() {
return {
text: this.$options.i18n.BTN_ADD_ANOTHER_STAGE,
attributes: [
{ category: 'secondary' },
{ variant: 'info' },
{ class: this.hasExtendedFormFields ? '' : 'gl-display-none' },
],
attributes: [{ category: 'secondary' }, { variant: 'info' }, { class: '' }],
};
},
hasFormErrors() {
......@@ -346,7 +333,7 @@ export default {
</div>
</gl-form-group>
<gl-form-radio-group
v-if="hasExtendedFormFields && !isEditing"
v-if="!isEditing"
v-model="selectedPreset"
class="gl-mb-4"
data-testid="vsa-preset-selector"
......@@ -354,7 +341,7 @@ export default {
name="preset"
@input="onSelectPreset"
/>
<div v-if="hasExtendedFormFields" data-testid="extended-form-fields">
<div data-testid="extended-form-fields">
<div
v-for="(stage, activeStageIndex) in stages"
ref="formStages"
......
......@@ -40,13 +40,6 @@ export default {
directives: {
GlModalDirective,
},
props: {
hasExtendedFormFields: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
showCreateModal: false,
......@@ -176,7 +169,6 @@ export default {
v-if="showCreateModal"
:initial-data="initialData"
:initial-form-errors="initialFormErrors"
:has-extended-form-fields="hasExtendedFormFields"
:default-stage-config="defaultStageConfig"
:is-editing="isEditing"
@hidden="showCreateModal = false"
......
......@@ -22,7 +22,6 @@ export default () => {
const {
cycleAnalyticsScatterplotEnabled: hasDurationChart = false,
valueStreamAnalyticsPathNavigation: hasPathNavigation = false,
valueStreamAnalyticsExtendedForm: hasExtendedFormFields = false,
} = gon?.features;
const {
......@@ -41,7 +40,6 @@ export default () => {
featureFlags: {
hasDurationChart,
hasPathNavigation,
hasExtendedFormFields,
},
});
......
......@@ -15,7 +15,6 @@ class Groups::Analytics::CycleAnalyticsController < Groups::Analytics::Applicati
before_action do
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_extended_form, @group, default_enabled: :yaml)
render_403 unless can?(current_user, :read_group_cycle_analytics, @group)
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
expect(page).to have_pushed_frontend_feature_flags(
cycleAnalyticsScatterplotEnabled: true,
valueStreamAnalyticsPathNavigation: true,
valueStreamAnalyticsExtendedForm: true
valueStreamAnalyticsPathNavigation: true
)
end
......@@ -35,16 +34,4 @@ RSpec.describe 'Group value stream analytics' do
expect(page).to have_pushed_frontend_feature_flags(valueStreamAnalyticsPathNavigation: false)
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
......@@ -135,30 +135,6 @@ RSpec.describe 'Multiple value streams', :js do
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
before do
value_stream = create(:cycle_analytics_group_value_stream, name: custom_value_stream_name, group: group)
......
......@@ -94,7 +94,6 @@ describe('ValueStreamForm', () => {
const findExtendedFormFields = () => wrapper.findByTestId('extended-form-fields');
const findPresetSelector = () => wrapper.findByTestId('vsa-preset-selector');
const findBtn = (btn) => findModal().props(btn);
const findSubmitAttribute = (attribute) => findBtn('actionPrimary').attributes[1][attribute];
const expectFieldError = (testId, error = '') =>
expect(wrapper.findByTestId(testId).attributes('invalid-feedback')).toBe(error);
......@@ -108,30 +107,6 @@ describe('ValueStreamForm', () => {
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', () => {
expect(findExtendedFormFields().exists()).toBe(true);
});
......@@ -149,7 +124,6 @@ describe('ValueStreamForm', () => {
describe('Add stage button', () => {
beforeEach(() => {
wrapper = createComponent({
props: { hasExtendedFormFields: true },
stubs: {
CustomStageFields,
},
......@@ -180,7 +154,6 @@ describe('ValueStreamForm', () => {
describe('form errors', () => {
const commonExtendedData = {
props: {
hasExtendedFormFields: true,
initialFormErrors: initialFormStageErrors,
},
};
......@@ -223,7 +196,6 @@ describe('ValueStreamForm', () => {
initialPreset,
initialData,
isEditing: true,
hasExtendedFormFields: true,
},
});
});
......@@ -243,7 +215,6 @@ describe('ValueStreamForm', () => {
initialPreset,
initialData,
isEditing: true,
hasExtendedFormFields: true,
},
stubs: {
CustomStageFields,
......@@ -280,7 +251,6 @@ describe('ValueStreamForm', () => {
initialPreset,
initialData,
isEditing: true,
hasExtendedFormFields: true,
},
});
});
......@@ -362,7 +332,20 @@ describe('ValueStreamForm', () => {
it('calls the "createValueStream" event when submitted', () => {
expect(createValueStreamMock).toHaveBeenCalledWith(expect.any(Object), {
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