Commit 86047a24 authored by wortschi's avatar wortschi

Remove productivity_analytics_scatterplot flag

Changelog: removed
EE: true
parent 86da56a2
......@@ -118,19 +118,12 @@ export default {
};
},
},
mounted() {
this.setChartEnabled({
chartKey: chartKeys.scatterplot,
isEnabled: this.isScatterplotFeatureEnabled(),
});
},
methods: {
...mapActions('charts', [
'fetchChartData',
'setMetricType',
'updateSelectedItems',
'resetMainChartSelection',
'setChartEnabled',
]),
...mapActions('table', ['setSortField', 'setPage', 'toggleSortOrder', 'setColumnMetric']),
onMainChartItemClicked({ params }) {
......@@ -148,9 +141,6 @@ export default {
...this.getColumnChartDatazoomOption(chartKey),
};
},
isScatterplotFeatureEnabled() {
return this.glFeatures.productivityAnalyticsScatterplotEnabled;
},
},
};
</script>
......
......@@ -16,9 +16,6 @@ class Groups::Analytics::ProductivityAnalyticsController < Groups::Analytics::Ap
before_action -> {
authorize_view_by_action!(:view_productivity_analytics)
}
before_action -> {
push_frontend_feature_flag(:productivity_analytics_scatterplot_enabled, default_enabled: true)
}
before_action :validate_params, only: :show, if: -> { request.format.json? }
......
---
name: productivity_analytics_scatterplot_enabled
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17735
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/13412
milestone: '12.4'
type: development
group: group::optimize
default_enabled: true
......@@ -49,7 +49,7 @@ describe('ProductivityApp component', () => {
const mainChartData = { 1: 2, 2: 3 };
const createComponent = ({ props = {}, options = {}, scatterplotEnabled = true } = {}) => {
const createComponent = ({ props = {}, options = {} } = {}) => {
const {
modules: { charts, table, ...modules },
...storeConfig
......@@ -82,9 +82,6 @@ describe('ProductivityApp component', () => {
...propsData,
...props,
},
provide: {
glFeatures: { productivityAnalyticsScatterplotEnabled: scatterplotEnabled },
},
...options,
});
......@@ -330,75 +327,55 @@ describe('ProductivityApp component', () => {
});
describe('Scatterplot', () => {
describe('when the feature flag is enabled', () => {
it('isScatterplotFeatureEnabled returns true', () => {
expect(wrapper.vm.isScatterplotFeatureEnabled()).toBe(true);
});
it('renders a metric chart component', () => {
expect(findScatterplotMetricChart().exists()).toBe(true);
});
it('renders a metric chart component', () => {
expect(findScatterplotMetricChart().exists()).toBe(true);
});
describe('when chart finished loading', () => {
describe('and the chart has data', () => {
beforeEach(() => {
mockStore.dispatch('charts/receiveChartDataSuccess', {
chartKey: chartKeys.scatterplot,
data: {
1: { metric: 2, merged_at: '2019-09-01T07:06:23.193Z' },
2: { metric: 3, merged_at: '2019-09-05T08:27:42.411Z' },
},
transformedData: [
[{ metric: 2, merged_at: '2019-09-01T07:06:23.193Z' }],
[{ metric: 3, merged_at: '2019-09-05T08:27:42.411Z' }],
],
});
describe('when chart finished loading', () => {
describe('and the chart has data', () => {
beforeEach(() => {
mockStore.dispatch('charts/receiveChartDataSuccess', {
chartKey: chartKeys.scatterplot,
data: {
1: { metric: 2, merged_at: '2019-09-01T07:06:23.193Z' },
2: { metric: 3, merged_at: '2019-09-05T08:27:42.411Z' },
},
transformedData: [
[{ metric: 2, merged_at: '2019-09-01T07:06:23.193Z' }],
[{ metric: 3, merged_at: '2019-09-05T08:27:42.411Z' }],
],
});
});
it('sets isLoading=false on the metric chart', () => {
expect(findScatterplotMetricChart().props('isLoading')).toBe(false);
});
it('sets isLoading=false on the metric chart', () => {
expect(findScatterplotMetricChart().props('isLoading')).toBe(false);
});
it('passes non-empty chartData to the metric chart', () => {
expect(findScatterplotMetricChart().props('chartData')).not.toEqual([]);
});
it('passes non-empty chartData to the metric chart', () => {
expect(findScatterplotMetricChart().props('chartData')).not.toEqual([]);
});
describe('when the user changes the metric', () => {
beforeEach(() => {
jest.spyOn(mockStore, 'dispatch');
findScatterplotMetricChart().vm.$emit('metricTypeChange', 'loc_per_commit');
return wrapper.vm.$nextTick();
});
describe('when the user changes the metric', () => {
beforeEach(() => {
jest.spyOn(mockStore, 'dispatch');
findScatterplotMetricChart().vm.$emit('metricTypeChange', 'loc_per_commit');
return wrapper.vm.$nextTick();
});
it('should call setMetricType when `metricTypeChange` is emitted on the metric chart', () => {
expect(mockStore.dispatch).toHaveBeenCalledWith('charts/setMetricType', {
metricType: 'loc_per_commit',
chartKey: chartKeys.scatterplot,
});
it('should call setMetricType when `metricTypeChange` is emitted on the metric chart', () => {
expect(mockStore.dispatch).toHaveBeenCalledWith('charts/setMetricType', {
metricType: 'loc_per_commit',
chartKey: chartKeys.scatterplot,
});
});
it("should update the chart's y axis label", () => {
const scatterplot = findScatterplotMetricChart().find(Scatterplot);
expect(scatterplot.props('yAxisTitle')).toBe('Number of LOCs per commit');
});
it("should update the chart's y axis label", () => {
const scatterplot = findScatterplotMetricChart().find(Scatterplot);
expect(scatterplot.props('yAxisTitle')).toBe('Number of LOCs per commit');
});
});
});
});
describe('when the feature flag is disabled', () => {
beforeEach(() => {
createComponent({ scatterplotEnabled: false });
});
it('isScatterplotFeatureEnabled returns false', () => {
expect(wrapper.vm.isScatterplotFeatureEnabled()).toBe(false);
});
it("doesn't render a metric chart component", () => {
expect(findScatterplotMetricChart().exists()).toBe(false);
});
});
});
describe('MR table', () => {
......
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