Commit 68581e92 authored by Sarah Yasonik's avatar Sarah Yasonik Committed by Nick Thomas

Remove metrics_time_window FF from frontend

The metrics_time_window feature flag is rebranded as
showTimeWindowDropdown across vue files. To optimize
for the least complexity in the dashboard, this commit
removes the flag entirely, rather than setting the
value to true throughout.
parent 908a4c44
......@@ -106,10 +106,6 @@ export default {
type: String,
required: true,
},
showTimeWindowDropdown: {
type: Boolean,
required: true,
},
customMetricsAvailable: {
type: Boolean,
required: false,
......@@ -248,7 +244,7 @@ export default {
>
</gl-dropdown>
</div>
<div v-if="showTimeWindowDropdown" class="d-flex align-items-center prepend-left-8">
<div class="d-flex align-items-center prepend-left-8">
<strong>{{ s__('Metrics|Show last') }}</strong>
<gl-dropdown
class="prepend-left-10 js-time-window-dropdown"
......
......@@ -16,7 +16,6 @@ export default (props = {}) => {
props: {
...el.dataset,
hasMetrics: parseBoolean(el.dataset.hasMetrics),
showTimeWindowDropdown: gon.features.metricsTimeWindow,
...props,
},
});
......
......@@ -12,9 +12,6 @@ class Clusters::ClustersController < Clusters::BaseController
before_action :authorize_update_cluster!, only: [:update]
before_action :authorize_admin_cluster!, only: [:destroy]
before_action :update_applications_status, only: [:cluster_status]
before_action only: [:show] do
push_frontend_feature_flag(:metrics_time_window)
end
helper_method :token_in_session
......
......@@ -11,7 +11,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action :verify_api_request!, only: :terminal_websocket_authorize
before_action :expire_etag_cache, only: [:index]
before_action only: [:metrics, :additional_metrics, :metrics_dashboard] do
push_frontend_feature_flag(:metrics_time_window)
push_frontend_feature_flag(:environment_metrics_use_prometheus_endpoint)
push_frontend_feature_flag(:environment_metrics_show_multiple_dashboards)
push_frontend_feature_flag(:grafana_dashboard_link)
......@@ -221,8 +220,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def metrics_params
return unless Feature.enabled?(:metrics_time_window, project)
params.require([:start, :end])
end
......
---
title: Allow users to specify a time range on metrics dashboard
merge_request: 28670
author:
type: added
......@@ -46,7 +46,6 @@ describe('Dashboard', () => {
hasMetrics: true,
prometheusAlertsAvailable: true,
alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false,
},
store,
});
......@@ -68,7 +67,6 @@ describe('Dashboard', () => {
hasMetrics: true,
prometheusAlertsAvailable: false,
alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false,
},
store,
});
......@@ -94,7 +92,6 @@ describe('Dashboard', () => {
hasMetrics: true,
prometheusAlertsAvailable: true,
alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false,
},
store,
});
......@@ -118,7 +115,6 @@ describe('Dashboard', () => {
hasMetrics: true,
prometheusAlertsAvailable: true,
alertsEndpoint: '/endpoint',
showTimeWindowDropdown: false,
},
store,
});
......
......@@ -433,20 +433,6 @@ describe Projects::EnvironmentsController do
end
context 'when only one time param is provided' do
context 'when :metrics_time_window feature flag is disabled' do
before do
stub_feature_flags(metrics_time_window: false)
expect(environment).to receive(:additional_metrics).with(no_args).and_return(nil)
end
it 'returns a time-window agnostic response' do
additional_metrics(start: '1552647300.651094')
expect(response).to have_gitlab_http_status(204)
expect(json_response).to eq({})
end
end
it 'raises an error when start is missing' do
expect { additional_metrics(end: '1552647300.651094') }
.to raise_error(ActionController::ParameterMissing)
......
......@@ -68,7 +68,7 @@ describe('Dashboard', () => {
it('shows a getting started empty state when no metrics are present', () => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, showTimeWindowDropdown: false },
propsData: { ...propsData },
store,
});
......@@ -85,7 +85,7 @@ describe('Dashboard', () => {
it('shows up a loading state', done => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: false },
propsData: { ...propsData, hasMetrics: true },
store,
});
......@@ -102,7 +102,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showLegend: false,
showTimeWindowDropdown: false,
},
store,
});
......@@ -122,7 +121,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
......@@ -142,7 +140,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
......@@ -173,7 +170,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
......@@ -203,7 +199,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
......@@ -237,7 +232,6 @@ describe('Dashboard', () => {
hasMetrics: true,
showPanels: false,
environmentsEndpoint: '',
showTimeWindowDropdown: false,
},
store,
});
......@@ -250,27 +244,6 @@ describe('Dashboard', () => {
});
});
it('does not show the time window dropdown when the feature flag is not set', done => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
setTimeout(() => {
const timeWindowDropdown = component.$el.querySelector('.js-time-window-dropdown');
expect(timeWindowDropdown).toBeNull();
done();
});
});
it('renders the time window dropdown with a set of options', done => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
......@@ -278,7 +251,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: true,
},
store,
});
......@@ -304,7 +276,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: true,
},
store,
});
......@@ -338,7 +309,7 @@ describe('Dashboard', () => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true },
propsData: { ...propsData, hasMetrics: true },
store,
});
......@@ -359,7 +330,7 @@ describe('Dashboard', () => {
component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true },
propsData: { ...propsData, hasMetrics: true },
store,
});
......@@ -388,7 +359,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
},
store,
});
......@@ -424,7 +394,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
externalDashboardUrl: '/mockUrl',
},
store,
......@@ -450,7 +419,6 @@ describe('Dashboard', () => {
...propsData,
hasMetrics: true,
showPanels: false,
showTimeWindowDropdown: false,
externalDashboardUrl: '',
},
store,
......
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