Commit 1d1b3b21 authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla Committed by Michael Kozono

Remove multiple dashboards feature flag

Displaying multiple dashboard dropdown is behind
environment_metrics_show_multiple_dashboards feature flag.
Removing it in this MR along with specs
parent 350c4bad
...@@ -175,7 +175,6 @@ export default { ...@@ -175,7 +175,6 @@ export default {
'metricsWithData', 'metricsWithData',
'useDashboardEndpoint', 'useDashboardEndpoint',
'allDashboards', 'allDashboards',
'multipleDashboardsEnabled',
'additionalPanelTypesEnabled', 'additionalPanelTypesEnabled',
]), ]),
firstDashboard() { firstDashboard() {
...@@ -318,7 +317,6 @@ export default { ...@@ -318,7 +317,6 @@ export default {
<div class="row"> <div class="row">
<template v-if="environmentsEndpoint"> <template v-if="environmentsEndpoint">
<gl-form-group <gl-form-group
v-if="multipleDashboardsEnabled"
:label="__('Dashboard')" :label="__('Dashboard')"
label-size="sm" label-size="sm"
label-for="monitor-dashboards-dropdown" label-for="monitor-dashboards-dropdown"
......
...@@ -14,7 +14,6 @@ export default (props = {}) => { ...@@ -14,7 +14,6 @@ export default (props = {}) => {
if (gon.features) { if (gon.features) {
store.dispatch('monitoringDashboard/setFeatureFlags', { store.dispatch('monitoringDashboard/setFeatureFlags', {
prometheusEndpointEnabled: gon.features.environmentMetricsUsePrometheusEndpoint, prometheusEndpointEnabled: gon.features.environmentMetricsUsePrometheusEndpoint,
multipleDashboardsEnabled: gon.features.environmentMetricsShowMultipleDashboards,
additionalPanelTypesEnabled: gon.features.environmentMetricsAdditionalPanelTypes, additionalPanelTypesEnabled: gon.features.environmentMetricsAdditionalPanelTypes,
}); });
} }
......
...@@ -37,10 +37,9 @@ export const setEndpoints = ({ commit }, endpoints) => { ...@@ -37,10 +37,9 @@ export const setEndpoints = ({ commit }, endpoints) => {
export const setFeatureFlags = ( export const setFeatureFlags = (
{ commit }, { commit },
{ prometheusEndpointEnabled, multipleDashboardsEnabled, additionalPanelTypesEnabled }, { prometheusEndpointEnabled, additionalPanelTypesEnabled },
) => { ) => {
commit(types.SET_DASHBOARD_ENABLED, prometheusEndpointEnabled); commit(types.SET_DASHBOARD_ENABLED, prometheusEndpointEnabled);
commit(types.SET_MULTIPLE_DASHBOARDS_ENABLED, multipleDashboardsEnabled);
commit(types.SET_ADDITIONAL_PANEL_TYPES_ENABLED, additionalPanelTypesEnabled); commit(types.SET_ADDITIONAL_PANEL_TYPES_ENABLED, additionalPanelTypesEnabled);
}; };
...@@ -51,13 +50,8 @@ export const setShowErrorBanner = ({ commit }, enabled) => { ...@@ -51,13 +50,8 @@ export const setShowErrorBanner = ({ commit }, enabled) => {
export const requestMetricsDashboard = ({ commit }) => { export const requestMetricsDashboard = ({ commit }) => {
commit(types.REQUEST_METRICS_DATA); commit(types.REQUEST_METRICS_DATA);
}; };
export const receiveMetricsDashboardSuccess = ( export const receiveMetricsDashboardSuccess = ({ commit, dispatch }, { response, params }) => {
{ state, commit, dispatch },
{ response, params },
) => {
if (state.multipleDashboardsEnabled) {
commit(types.SET_ALL_DASHBOARDS, response.all_dashboards); commit(types.SET_ALL_DASHBOARDS, response.all_dashboards);
}
commit(types.RECEIVE_METRICS_DATA_SUCCESS, response.dashboard.panel_groups); commit(types.RECEIVE_METRICS_DATA_SUCCESS, response.dashboard.panel_groups);
dispatch('fetchPrometheusMetrics', params); dispatch('fetchPrometheusMetrics', params);
}; };
......
...@@ -10,7 +10,6 @@ export const RECEIVE_ENVIRONMENTS_DATA_FAILURE = 'RECEIVE_ENVIRONMENTS_DATA_FAIL ...@@ -10,7 +10,6 @@ export const RECEIVE_ENVIRONMENTS_DATA_FAILURE = 'RECEIVE_ENVIRONMENTS_DATA_FAIL
export const SET_QUERY_RESULT = 'SET_QUERY_RESULT'; export const SET_QUERY_RESULT = 'SET_QUERY_RESULT';
export const SET_TIME_WINDOW = 'SET_TIME_WINDOW'; export const SET_TIME_WINDOW = 'SET_TIME_WINDOW';
export const SET_DASHBOARD_ENABLED = 'SET_DASHBOARD_ENABLED'; export const SET_DASHBOARD_ENABLED = 'SET_DASHBOARD_ENABLED';
export const SET_MULTIPLE_DASHBOARDS_ENABLED = 'SET_MULTIPLE_DASHBOARDS_ENABLED';
export const SET_ADDITIONAL_PANEL_TYPES_ENABLED = 'SET_ADDITIONAL_PANEL_TYPES_ENABLED'; export const SET_ADDITIONAL_PANEL_TYPES_ENABLED = 'SET_ADDITIONAL_PANEL_TYPES_ENABLED';
export const SET_ALL_DASHBOARDS = 'SET_ALL_DASHBOARDS'; export const SET_ALL_DASHBOARDS = 'SET_ALL_DASHBOARDS';
export const SET_ENDPOINTS = 'SET_ENDPOINTS'; export const SET_ENDPOINTS = 'SET_ENDPOINTS';
......
...@@ -89,9 +89,6 @@ export default { ...@@ -89,9 +89,6 @@ export default {
[types.SET_DASHBOARD_ENABLED](state, enabled) { [types.SET_DASHBOARD_ENABLED](state, enabled) {
state.useDashboardEndpoint = enabled; state.useDashboardEndpoint = enabled;
}, },
[types.SET_MULTIPLE_DASHBOARDS_ENABLED](state, enabled) {
state.multipleDashboardsEnabled = enabled;
},
[types.SET_GETTING_STARTED_EMPTY_STATE](state) { [types.SET_GETTING_STARTED_EMPTY_STATE](state) {
state.emptyState = 'gettingStarted'; state.emptyState = 'gettingStarted';
}, },
......
...@@ -8,7 +8,6 @@ export default () => ({ ...@@ -8,7 +8,6 @@ export default () => ({
deploymentsEndpoint: null, deploymentsEndpoint: null,
dashboardEndpoint: invalidUrl, dashboardEndpoint: invalidUrl,
useDashboardEndpoint: false, useDashboardEndpoint: false,
multipleDashboardsEnabled: false,
additionalPanelTypesEnabled: false, additionalPanelTypesEnabled: false,
emptyState: 'gettingStarted', emptyState: 'gettingStarted',
showEmptyState: true, showEmptyState: true,
......
...@@ -12,7 +12,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -12,7 +12,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action :expire_etag_cache, only: [:index] before_action :expire_etag_cache, only: [:index]
before_action only: [:metrics, :additional_metrics, :metrics_dashboard] do before_action only: [:metrics, :additional_metrics, :metrics_dashboard] do
push_frontend_feature_flag(:environment_metrics_use_prometheus_endpoint, default_enabled: true) push_frontend_feature_flag(:environment_metrics_use_prometheus_endpoint, default_enabled: true)
push_frontend_feature_flag(:environment_metrics_show_multiple_dashboards)
push_frontend_feature_flag(:environment_metrics_additional_panel_types) push_frontend_feature_flag(:environment_metrics_additional_panel_types)
push_frontend_feature_flag(:prometheus_computed_alerts) push_frontend_feature_flag(:prometheus_computed_alerts)
end end
...@@ -168,7 +167,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -168,7 +167,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
dashboard_path: params[:dashboard], dashboard_path: params[:dashboard],
**dashboard_params.to_h.symbolize_keys **dashboard_params.to_h.symbolize_keys
) )
elsif Feature.enabled?(:environment_metrics_show_multiple_dashboards, project) else
result = dashboard_finder.find( result = dashboard_finder.find(
project, project,
current_user, current_user,
...@@ -177,8 +176,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -177,8 +176,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
) )
result[:all_dashboards] = dashboard_finder.find_all_paths(project) result[:all_dashboards] = dashboard_finder.find_all_paths(project)
else
result = dashboard_finder.find(project, current_user, environment: environment)
end end
respond_to do |format| respond_to do |format|
......
---
title: Remove environment_metrics_show_multiple_dashboards feature flag
merge_request: 16640
author:
type: changed
...@@ -483,10 +483,8 @@ describe Projects::EnvironmentsController do ...@@ -483,10 +483,8 @@ describe Projects::EnvironmentsController do
end end
shared_examples_for 'the default dashboard' do shared_examples_for 'the default dashboard' do
all_dashboards = Feature.enabled?(:environment_metrics_show_multiple_dashboards)
it_behaves_like '200 response' it_behaves_like '200 response'
it_behaves_like 'includes all dashboards' if all_dashboards it_behaves_like 'includes all dashboards'
it 'is the default dashboard' do it 'is the default dashboard' do
get :metrics_dashboard, params: environment_params(dashboard_params) get :metrics_dashboard, params: environment_params(dashboard_params)
...@@ -618,16 +616,6 @@ describe Projects::EnvironmentsController do ...@@ -618,16 +616,6 @@ describe Projects::EnvironmentsController do
it_behaves_like 'the default dashboard' it_behaves_like 'the default dashboard'
it_behaves_like 'dashboard can be specified' it_behaves_like 'dashboard can be specified'
it_behaves_like 'dashboard can be embedded' it_behaves_like 'dashboard can be embedded'
context 'when multiple dashboards is disabled' do
before do
stub_feature_flags(environment_metrics_show_multiple_dashboards: false)
end
it_behaves_like 'the default dashboard'
it_behaves_like 'dashboard cannot be specified'
it_behaves_like 'dashboard can be embedded'
end
end end
describe 'GET #search' do describe 'GET #search' do
......
...@@ -527,7 +527,6 @@ describe('Dashboard', () => { ...@@ -527,7 +527,6 @@ describe('Dashboard', () => {
component.$store.dispatch('monitoringDashboard/setFeatureFlags', { component.$store.dispatch('monitoringDashboard/setFeatureFlags', {
prometheusEndpoint: false, prometheusEndpoint: false,
multipleDashboardsEnabled: true,
}); });
component.$store.commit( component.$store.commit(
......
...@@ -240,8 +240,6 @@ describe('Monitoring store actions', () => { ...@@ -240,8 +240,6 @@ describe('Monitoring store actions', () => {
const response = metricsDashboardResponse; const response = metricsDashboardResponse;
response.all_dashboards = dashboardGitResponse; response.all_dashboards = dashboardGitResponse;
state.multipleDashboardsEnabled = true;
receiveMetricsDashboardSuccess({ state, commit, dispatch }, { response, params }); receiveMetricsDashboardSuccess({ state, commit, dispatch }, { response, params });
expect(commit).toHaveBeenCalledWith(types.SET_ALL_DASHBOARDS, dashboardGitResponse); expect(commit).toHaveBeenCalledWith(types.SET_ALL_DASHBOARDS, dashboardGitResponse);
......
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