diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields.vue b/ee/app/assets/javascripts/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields.vue index 9813516dc36a2d8a14ede6aa56bce4be88633ac3..72ba79b1732dd1495aaacb0db9023c1bb3f0f0cd 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields.vue +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields.vue @@ -89,6 +89,10 @@ export default { }, }, methods: { + onSelectLabel(field, event) { + const { id: value = null } = event; + this.$emit('input', { field, value }); + }, hasFieldErrors(key) { return !Object.keys(this.errors).length || this.errors[key]?.length < 1; }, @@ -158,7 +162,7 @@ export default { :selected-label-ids="/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ [ stage.startEventLabelId, ] /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */" - @update-label="$emit('input', { field: 'startEventLabelId', value: $event })" + @update-label="onSelectLabel('startEventLabelId', $event)" /> </div> <div class="gl-display-flex gl-justify-content-between"> @@ -184,7 +188,7 @@ export default { :selected-label-ids="/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ [ stage.endEventLabelId, ] /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */" - @update-label="$emit('input', { field: 'endEventLabelId', value: $event })" + @update-label="onSelectLabel('endEventLabelId', $event)" /> </div> </div> diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/components/labels_selector.vue b/ee/app/assets/javascripts/analytics/cycle_analytics/components/labels_selector.vue index 15e3ec3b176b72741380e3db54e1509a1ff329c7..9d13f9f9f9040b5f0569059ad93a27f5125a1a2a 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/components/labels_selector.vue +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/components/labels_selector.vue @@ -164,7 +164,7 @@ export default { 'cursor-not-allowed': disabled, }" :active="isSelectedLabel(label.id)" - @click.prevent="$emit('select-label', label.id)" + @click.prevent="$emit('select-label', label)" > <gl-icon v-if="multiselect && isSelectedLabel(label.id)" diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.js b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.js index e335884e43c4abe2a879f99e4b23d4e6f7112fd5..c6b3bcb84d9a2982a10fc39a07b474c1da50a067 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.js +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/actions.js @@ -60,7 +60,7 @@ export const receiveTasksByTypeDataError = ({ commit }, error) => { export const fetchTasksByTypeData = ({ dispatch, commit, state, rootGetters }) => { const { currentGroupPath, cycleAnalyticsRequestParams } = rootGetters; - const { subject, selectedLabelIds } = state; + const { subject, selectedLabelNames } = state; const { project_ids, @@ -75,7 +75,7 @@ export const fetchTasksByTypeData = ({ dispatch, commit, state, rootGetters }) = commit(types.REQUEST_TASKS_BY_TYPE_DATA); // dont request if we have no labels selected...for now - if (selectedLabelIds.length) { + if (selectedLabelNames.length) { return Api.cycleAnalyticsTasksByType(currentGroupPath, { project_ids, created_after, @@ -86,7 +86,7 @@ export const fetchTasksByTypeData = ({ dispatch, commit, state, rootGetters }) = subject, // NOTE: the type of work module will continute to manage its labels, ignoring the filter bar labels // until we resolve: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34524 - label_ids: selectedLabelIds, + label_names: selectedLabelNames, }) .then(checkForDataError) .then(({ data }) => commit(types.RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS, data)) diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/getters.js b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/getters.js index c24c0ae372bcfaaf1982a530a21ef697e5e69fb0..356f3542727dbc2858de5da8bbb0bf549f5b905b 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/getters.js +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/getters.js @@ -1,7 +1,7 @@ import { getTasksByTypeData } from '../../../utils'; export const selectedTasksByTypeFilters = (state = {}, _, rootState = {}, rootGetters = {}) => { - const { selectedLabelIds = [], subject } = state; + const { selectedLabelNames = [], selectedLabelIds = [], subject } = state; const { currentGroup, createdAfter = null, createdBefore = null } = rootState; const { selectedProjectIds = [] } = rootGetters; return { @@ -10,6 +10,7 @@ export const selectedTasksByTypeFilters = (state = {}, _, rootState = {}, rootGe createdAfter, createdBefore, selectedLabelIds, + selectedLabelNames, subject, }; }; diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/mutations.js b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/mutations.js index e1515fa090a37d708bceccc0f8a2e565e0899307..0a05fb1d388d43c00682479d219d0c43138929bf 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/mutations.js +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/mutations.js @@ -12,6 +12,7 @@ export default { state.isLoadingTasksByTypeChartTopLabels = true; state.topRankedLabels = []; state.selectedLabelIds = []; + state.selectedLabelNames = []; state.errorCode = null; state.errorMessage = ''; }, @@ -19,6 +20,7 @@ export default { state.isLoadingTasksByTypeChartTopLabels = false; state.topRankedLabels = data.map(convertObjectPropsToCamelCase); state.selectedLabelIds = data.map(({ id }) => id); + state.selectedLabelNames = data.map(({ title }) => title); state.errorCode = null; state.errorMessage = ''; }, @@ -27,6 +29,7 @@ export default { state.isLoadingTasksByTypeChart = false; state.topRankedLabels = []; state.selectedLabelIds = []; + state.selectedLabelNames = []; state.errorCode = errorCode; state.errorMessage = message; }, @@ -41,14 +44,24 @@ export default { state.data = transformRawTasksByTypeData(data); }, [types.SET_TASKS_BY_TYPE_FILTERS](state, { filter, value }) { - const { selectedLabelIds } = state; + const { selectedLabelIds, selectedLabelNames } = state; switch (filter) { - case TASKS_BY_TYPE_FILTERS.LABEL: - state.selectedLabelIds = toggleSelectedLabel({ selectedLabelIds, value }); + case TASKS_BY_TYPE_FILTERS.LABEL: { + const { id, title } = value; + state.selectedLabelIds = toggleSelectedLabel({ + selectedLabels: selectedLabelIds, + value: id, + }); + state.selectedLabelNames = toggleSelectedLabel({ + selectedLabels: selectedLabelNames, + value: title, + }); break; - case TASKS_BY_TYPE_FILTERS.SUBJECT: + } + case TASKS_BY_TYPE_FILTERS.SUBJECT: { state.subject = value; break; + } default: break; } diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/state.js b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/state.js index cd909d7e76182693a19d68b8b6f2cd4a5f686e91..0d25646bc7dd1216974d0c83e285ebbee04677e4 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/state.js +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/type_of_work/state.js @@ -5,7 +5,8 @@ export default () => ({ isLoadingTasksByTypeChartTopLabels: false, subject: TASKS_BY_TYPE_SUBJECT_ISSUE, - selectedLabelIds: [], + selectedLabelIds: [], // TODO: we can remove in https://gitlab.com/gitlab-org/gitlab/-/issues/370085 + selectedLabelNames: [], topRankedLabels: [], data: [], diff --git a/ee/app/assets/javascripts/analytics/cycle_analytics/utils.js b/ee/app/assets/javascripts/analytics/cycle_analytics/utils.js index cdc49e5ea7c461b2522315d0ff4b8325fdbdbf8a..1ddef4d3f3ccc24bf85788b6dc904993f429bc1f 100644 --- a/ee/app/assets/javascripts/analytics/cycle_analytics/utils.js +++ b/ee/app/assets/javascripts/analytics/cycle_analytics/utils.js @@ -12,11 +12,11 @@ import httpStatus from '~/lib/utils/http_status'; const EVENT_TYPE_LABEL = 'label'; -export const toggleSelectedLabel = ({ selectedLabelIds = [], value = null }) => { - if (!value) return selectedLabelIds; - return selectedLabelIds.includes(value) - ? selectedLabelIds.filter((v) => v !== value) - : [...selectedLabelIds, value]; +export const toggleSelectedLabel = ({ selectedLabels = [], value = null }) => { + if (!value) return selectedLabels; + return selectedLabels.includes(value) + ? selectedLabels.filter((v) => v !== value) + : [...selectedLabels, value]; }; export const isStartEvent = (ev) => diff --git a/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields_spec.js b/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields_spec.js index 68b2c3d502bf3e5e0c794ecd21bbb4b61c728683..21cce51455199c375531018588d9d27bf9d0bdf9 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_fields_spec.js @@ -141,7 +141,7 @@ describe('CustomStageFields', () => { it('will emit the `input` event when the start event label field when selected', () => { expect(wrapper.emitted('input')).toBeUndefined(); - findStartEventLabelField().vm.$emit('update-label', firstLabel.id); + findStartEventLabelField().vm.$emit('update-label', firstLabel); expect(wrapper.emitted('input')[0]).toEqual([ { field: 'startEventLabelId', value: firstLabel.id }, @@ -186,7 +186,7 @@ describe('CustomStageFields', () => { it('will emit the `input` event when the start event label field when selected', () => { expect(wrapper.emitted('input')).toBeUndefined(); - findEndEventLabelField().vm.$emit('update-label', firstLabel.id); + findEndEventLabelField().vm.$emit('update-label', firstLabel); expect(wrapper.emitted('input')[0]).toEqual([ { field: 'endEventLabelId', value: firstLabel.id }, diff --git a/ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js b/ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js index 5e79e1f02b98802d01020fe1b71836f4facfe704..391ae1931b9caa9180f75d6d66a4e8e7ef04be7a 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js @@ -111,7 +111,7 @@ describe('Value Stream Analytics LabelsSelector', () => { await nextTick(); expect(wrapper.emitted('select-label').length > 0).toBe(true); - expect(wrapper.emitted('select-label')[0]).toContain(groupLabels[1].id); + expect(wrapper.emitted('select-label')[0]).toContain(groupLabels[1]); }); }); }); diff --git a/ee/spec/frontend/analytics/cycle_analytics/mock_data.js b/ee/spec/frontend/analytics/cycle_analytics/mock_data.js index f3d710a685a78bac15a1c320db5d23c0e31a14ed..a6b79b4cece70aa8cbe2dead20094f5669192aaa 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/mock_data.js +++ b/ee/spec/frontend/analytics/cycle_analytics/mock_data.js @@ -62,6 +62,8 @@ export const valueStreams = [ ]; export const groupLabels = apiGroupLabels.map(convertObjectPropsToCamelCase); +export const groupLabelNames = groupLabels.map(({ title }) => title); +export const groupLabelIds = groupLabels.map(({ id }) => id); export const recentActivityData = valueStreamAnalyticsSummary; diff --git a/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/actions_spec.js b/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/actions_spec.js index d6165af125d86f8dbc78c9356663c15533ee7f1b..cdf734a581fffaf5820eb7fc346c7023d00f575a 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/actions_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/actions_spec.js @@ -12,7 +12,7 @@ import testAction from 'helpers/vuex_action_helper'; import { createdAfter, createdBefore } from 'jest/cycle_analytics/mock_data'; import createFlash from '~/flash'; import httpStatusCodes from '~/lib/utils/http_status'; -import { groupLabels, endpoints, rawTasksByTypeData } from '../../../mock_data'; +import { groupLabels, groupLabelNames, endpoints, rawTasksByTypeData } from '../../../mock_data'; jest.mock('~/flash'); @@ -26,7 +26,7 @@ describe('Type of work actions', () => { subject: TASKS_BY_TYPE_SUBJECT_ISSUE, topRankedLabels: [], - selectedLabelIds: groupLabels.map(({ id }) => id), + selectedLabelNames: groupLabelNames, data: [], }; diff --git a/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/getters_spec.js b/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/getters_spec.js index 173a153026ab2b21210084c6a4abb9b5c8284b6f..3c23a2d7906bd91df191caef44b7dbb423b0e86d 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/getters_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/getters_spec.js @@ -8,15 +8,17 @@ import { rawTasksByTypeData, transformedTasksByTypeData, groupLabels, + groupLabelIds, + groupLabelNames, currentGroup, } from '../../../mock_data'; const selectedProjectIds = [1, 2]; -const rootSelectedLabelIds = [1, 2, 3]; const state = { topRankedLabels: groupLabels, subject: TASKS_BY_TYPE_SUBJECT_ISSUE, - selectedLabelIds: rootSelectedLabelIds, + selectedLabelIds: groupLabelIds, + selectedLabelNames: groupLabelNames, }; const rootState = { topRankedLabels: groupLabels, @@ -24,7 +26,7 @@ const rootState = { createdBefore, currentGroup, }; -const rootGetters = { selectedProjectIds, selectedLabelIds: rootSelectedLabelIds }; +const rootGetters = { selectedProjectIds, selectedLabelIds: groupLabelIds }; describe('Type of work getters', () => { describe('tasksByTypeChartData', () => { @@ -53,6 +55,7 @@ describe('Type of work getters', () => { 'createdAfter', 'createdBefore', 'selectedLabelIds', + 'selectedLabelNames', 'subject', ].forEach((key) => { expect(keys).toContain(key); @@ -63,7 +66,8 @@ describe('Type of work getters', () => { const result = selectedTasksByTypeFilters(state, null, rootState, rootGetters); expect(result.currentGroup).toEqual(currentGroup); - expect(result.selectedLabelIds).toEqual(rootSelectedLabelIds); + expect(result.selectedLabelIds).toEqual(groupLabelIds); + expect(result.selectedLabelNames).toEqual(groupLabelNames); expect(result.selectedProjectIds).toEqual(selectedProjectIds); expect(result.subject).toEqual(TASKS_BY_TYPE_SUBJECT_ISSUE); expect(result.createdBefore).toEqual(createdBefore); diff --git a/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/mutations_spec.js b/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/mutations_spec.js index 711929f444cc2c6932da6bdefce071ccd03716e4..0a53e82985f04d8741217a91fd959438add75922 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/mutations_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/store/modules/type_of_work/mutations_spec.js @@ -2,7 +2,13 @@ import { TASKS_BY_TYPE_FILTERS } from 'ee/analytics/cycle_analytics/constants'; import * as types from 'ee/analytics/cycle_analytics/store/modules/type_of_work/mutation_types'; import mutations from 'ee/analytics/cycle_analytics/store/modules/type_of_work/mutations'; -import { apiTasksByTypeData, rawTasksByTypeData } from '../../../mock_data'; +import { + apiTasksByTypeData, + rawTasksByTypeData, + groupLabels, + groupLabelNames, + groupLabelIds, +} from '../../../mock_data'; let state = null; @@ -16,11 +22,17 @@ describe('Value Stream Analytics mutations', () => { }); it.each` - mutation | stateKey | value - ${types.REQUEST_TOP_RANKED_GROUP_LABELS} | ${'topRankedLabels'} | ${[]} - ${types.RECEIVE_TOP_RANKED_GROUP_LABELS_ERROR} | ${'topRankedLabels'} | ${[]} - ${types.REQUEST_TASKS_BY_TYPE_DATA} | ${'isLoadingTasksByTypeChart'} | ${true} - ${types.RECEIVE_TASKS_BY_TYPE_DATA_ERROR} | ${'isLoadingTasksByTypeChart'} | ${false} + mutation | stateKey | value + ${types.REQUEST_TOP_RANKED_GROUP_LABELS} | ${'topRankedLabels'} | ${[]} + ${types.RECEIVE_TOP_RANKED_GROUP_LABELS_ERROR} | ${'topRankedLabels'} | ${[]} + ${types.REQUEST_TOP_RANKED_GROUP_LABELS} | ${'selectedLabelNames'} | ${[]} + ${types.RECEIVE_TOP_RANKED_GROUP_LABELS_ERROR} | ${'selectedLabelNames'} | ${[]} + ${types.REQUEST_TOP_RANKED_GROUP_LABELS} | ${'errorCode'} | ${null} + ${types.RECEIVE_TOP_RANKED_GROUP_LABELS_SUCCESS} | ${'errorCode'} | ${null} + ${types.REQUEST_TOP_RANKED_GROUP_LABELS} | ${'errorMessage'} | ${''} + ${types.RECEIVE_TOP_RANKED_GROUP_LABELS_SUCCESS} | ${'errorMessage'} | ${''} + ${types.REQUEST_TASKS_BY_TYPE_DATA} | ${'isLoadingTasksByTypeChart'} | ${true} + ${types.RECEIVE_TASKS_BY_TYPE_DATA_ERROR} | ${'isLoadingTasksByTypeChart'} | ${false} `('$mutation will set $stateKey=$value', ({ mutation, stateKey, value }) => { mutations[mutation](state); @@ -40,7 +52,21 @@ describe('Value Stream Analytics mutations', () => { }, ); - describe(`${types.RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS}`, () => { + describe(`${types.RECEIVE_TOP_RANKED_GROUP_LABELS_SUCCESS}`, () => { + it('sets selectedLabelIds to an array of label ids', () => { + mutations[types.RECEIVE_TOP_RANKED_GROUP_LABELS_SUCCESS](state, groupLabels); + + expect(state.selectedLabelIds).toEqual(groupLabelIds); + }); + + it('sets selectedLabelNames to an array of label ids', () => { + mutations[types.RECEIVE_TOP_RANKED_GROUP_LABELS_SUCCESS](state, groupLabels); + + expect(state.selectedLabelNames).toEqual(groupLabelNames); + }); + }); + + describe(`${types.RECEIVE_TOP_RANKED_GROUP_LABELS_SUCCESS}`, () => { it('sets isLoadingTasksByTypeChart to false', () => { mutations[types.RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS](state, {}); @@ -68,7 +94,7 @@ describe('Value Stream Analytics mutations', () => { state = { selectedLabelIds: [10, 20, 30], }; - const labelFilter = { filter: TASKS_BY_TYPE_FILTERS.LABEL, value: 20 }; + const labelFilter = { filter: TASKS_BY_TYPE_FILTERS.LABEL, value: { id: 20 } }; mutations[types.SET_TASKS_BY_TYPE_FILTERS](state, labelFilter); expect(state.selectedLabelIds).toEqual([10, 30]); @@ -76,5 +102,18 @@ describe('Value Stream Analytics mutations', () => { mutations[types.SET_TASKS_BY_TYPE_FILTERS](state, labelFilter); expect(state.selectedLabelIds).toEqual([10, 30, 20]); }); + + it('will toggle the specified label title in the selectedLabelNames state key', () => { + state = { + selectedLabelNames: ['label 1', 'label 2', 'label 3'], + }; + const labelFilter = { filter: TASKS_BY_TYPE_FILTERS.LABEL, value: { title: 'label 2' } }; + mutations[types.SET_TASKS_BY_TYPE_FILTERS](state, labelFilter); + + expect(state.selectedLabelNames).toEqual(['label 1', 'label 3']); + + mutations[types.SET_TASKS_BY_TYPE_FILTERS](state, labelFilter); + expect(state.selectedLabelNames).toEqual(['label 1', 'label 3', 'label 2']); + }); }); }); diff --git a/ee/spec/frontend/analytics/cycle_analytics/utils_spec.js b/ee/spec/frontend/analytics/cycle_analytics/utils_spec.js index c0c62b57c45772e24baa6eaba2c82ac8cfad587a..3f84525e914ca90f24c83e36abcdeb545d18cc40 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/utils_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/utils_spec.js @@ -308,18 +308,26 @@ describe('Value Stream Analytics utils', () => { }); describe('toggleSelectedLabel', () => { - const selectedLabelIds = [1, 2, 3]; + const selectedLabels = [1, 2, 3]; + const selectedLabelNames = ['a', 'b', 'c']; it('will return the array if theres no value given', () => { - expect(toggleSelectedLabel({ selectedLabelIds })).toEqual([1, 2, 3]); + expect(toggleSelectedLabel({ selectedLabels })).toEqual([1, 2, 3]); }); it('will remove an id that exists', () => { - expect(toggleSelectedLabel({ selectedLabelIds, value: 2 })).toEqual([1, 3]); + expect(toggleSelectedLabel({ selectedLabels, value: 2 })).toEqual([1, 3]); }); it('will add an id that does not exist', () => { - expect(toggleSelectedLabel({ selectedLabelIds, value: 4 })).toEqual([1, 2, 3, 4]); + expect(toggleSelectedLabel({ selectedLabels, value: 4 })).toEqual([1, 2, 3, 4]); + }); + + it('can filter by name', () => { + expect(toggleSelectedLabel({ selectedLabels: selectedLabelNames, value: 'b' })).toEqual([ + 'a', + 'c', + ]); }); }); diff --git a/ee/spec/frontend/api_spec.js b/ee/spec/frontend/api_spec.js index 9a6bffb2c5efee09deb6ff9d2206c4fe09989600..a55b795f3783c23c4dce0de5a021271d0a09175b 100644 --- a/ee/spec/frontend/api_spec.js +++ b/ee/spec/frontend/api_spec.js @@ -226,12 +226,12 @@ describe('Api', () => { series: [['2019-11-03', 5]], }, ]; - const labelIds = [10, 9, 8, 7]; + const labelNames = ['Thursday', 'Friday', 'Saturday']; const params = { ...defaultParams, project_ids: null, subject: valueStreamAnalyticsConstants.TASKS_BY_TYPE_SUBJECT_ISSUE, - label_ids: labelIds, + label_names: labelNames, }; const expectedUrl = analyticsMockData.endpoints.tasksByTypeData; mock.onGet(expectedUrl).reply(httpStatus.OK, tasksByTypeResponse); @@ -248,12 +248,10 @@ describe('Api', () => { describe('cycleAnalyticsTopLabels', () => { it('fetches top group level labels', async () => { const response = []; - const labelIds = [10, 9, 8, 7]; const params = { ...defaultParams, project_ids: null, subject: valueStreamAnalyticsConstants.TASKS_BY_TYPE_SUBJECT_ISSUE, - label_ids: labelIds, }; const expectedUrl = analyticsMockData.endpoints.tasksByTypeTopLabelsData;