Commit a76a8d62 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Adds the filter bar feature flag

Adds the value_stream_analytics_filter_bar
feature flag and pushes it to the FE
parent 465d678f
...@@ -15,6 +15,7 @@ class Analytics::CycleAnalyticsController < Analytics::ApplicationController ...@@ -15,6 +15,7 @@ class Analytics::CycleAnalyticsController < Analytics::ApplicationController
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(:cycle_analytics_scatterplot_median_enabled, default_enabled: true) push_frontend_feature_flag(:cycle_analytics_scatterplot_median_enabled, default_enabled: true)
push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group) push_frontend_feature_flag(:value_stream_analytics_path_navigation, @group)
push_frontend_feature_flag(:value_stream_analytics_filter_bar, @group)
end end
private private
......
- page_title _("Value Stream Analytics") - page_title _("Value Stream Analytics")
- data_attributes = @request_params.valid? ? @request_params.to_data_attributes : {} - data_attributes = @request_params.valid? ? @request_params.to_data_attributes : {}
- api_paths = @group.present? ? { milestones_path: group_milestones_path(@group), labels_path: group_labels_path(@group) } : {}
- data_attributes.merge!({ empty_state_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_data_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_access_svg_path: image_path("illustrations/analytics/no-access.svg"), hide_group_drop_down: 'true' }) - image_paths = { empty_state_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_data_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_access_svg_path: image_path("illustrations/analytics/no-access.svg")}
- settings = { hide_group_drop_down: 'true' }
- data_attributes.merge!(api_paths, image_paths, settings)
#js-cycle-analytics-app{ data: data_attributes } #js-cycle-analytics-app{ data: data_attributes }
...@@ -21,6 +21,7 @@ RSpec.describe 'Group Value Stream Analytics', :js do ...@@ -21,6 +21,7 @@ RSpec.describe 'Group Value Stream Analytics', :js do
stage_nav_selector = '.stage-nav' stage_nav_selector = '.stage-nav'
path_nav_selector = '.js-path-navigation' path_nav_selector = '.js-path-navigation'
filter_bar_selector = '.js-filter-bar'
3.times do |i| 3.times do |i|
let_it_be("issue_#{i}".to_sym) { create(:issue, title: "New Issue #{i}", project: project, created_at: 2.days.ago) } let_it_be("issue_#{i}".to_sym) { create(:issue, title: "New Issue #{i}", project: project, created_at: 2.days.ago) }
...@@ -157,6 +158,10 @@ RSpec.describe 'Group Value Stream Analytics', :js do ...@@ -157,6 +158,10 @@ RSpec.describe 'Group Value Stream Analytics', :js do
expect(page).to have_selector(path_nav_selector, visible: false) expect(page).to have_selector(path_nav_selector, visible: false)
end end
it 'does not show the filter bar' do
expect(page).to have_selector(filter_bar_selector, visible: false)
end
context 'with path navigation feature flag enabled' do context 'with path navigation feature flag enabled' do
before do before do
stub_feature_flags(value_stream_analytics_path_navigation: true) stub_feature_flags(value_stream_analytics_path_navigation: true)
...@@ -167,6 +172,17 @@ RSpec.describe 'Group Value Stream Analytics', :js do ...@@ -167,6 +172,17 @@ RSpec.describe 'Group Value Stream Analytics', :js do
expect(page).to have_selector(path_nav_selector, visible: true) expect(page).to have_selector(path_nav_selector, visible: true)
end end
end end
context 'with filter bar feature flag enabled' do
before do
stub_feature_flags(value_stream_analytics_filter_bar: true)
select_group
end
it 'shows the filter bar' do
expect(page).to have_selector(filter_bar_selector, visible: true)
end
end
end end
def wait_for_stages_to_load def wait_for_stages_to_load
......
...@@ -20,7 +20,8 @@ RSpec.describe 'Group value stream analytics' do ...@@ -20,7 +20,8 @@ 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,
cycleAnalyticsScatterplotMedianEnabled: true, cycleAnalyticsScatterplotMedianEnabled: true,
valueStreamAnalyticsPathNavigation: true valueStreamAnalyticsPathNavigation: true,
valueStreamAnalyticsFilterBar: true
) )
end end
...@@ -35,4 +36,16 @@ RSpec.describe 'Group value stream analytics' do ...@@ -35,4 +36,16 @@ 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_filter_bar` is disabled for a group' do
before do
stub_feature_flags(value_stream_analytics_filter_bar: 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(valueStreamAnalyticsFilterBar: false)
end
end
end end
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