Commit feb8ac37 authored by Clement Ho's avatar Clement Ho

Merge branch 'mw-productivity-analytics-author-id' into 'master'

Productivity Analytics: Rename author_username to author_id in API call

See merge request gitlab-org/gitlab!16787
parents 23333fef 98ab3a2a
......@@ -8,7 +8,7 @@ import { urlParamsToObject } from '~/lib/utils/common_utils';
* {
* group_id: 'gitlab-org',
* project_id: 'gitlab-org/gitlab-test',
* author_username: 'author',
* author_id: 'author',
* milestone_title: 'my milestone',
* label_name: ['my label', 'yet another label'],
* merged_at_after: '2019-05-09T16:20:18.393Z'
......@@ -22,7 +22,9 @@ export const getCommonFilterParams = (state, getters) => {
return {
group_id: groupNamespace,
project_id: projectPath,
author_username,
// The productivity analytics endpoint accepts an "author_id", however we get "author_username" from the filtered search
// As a result, we need to map the two values here.
author_id: author_username,
milestone_title,
label_name,
merged_at_after: getters.mergedOnAfterDate,
......
......@@ -18,7 +18,7 @@ describe('Productivity analytics filter getters', () => {
const mockGetters = { mergedOnAfterDate: '2019-07-16T00:00:00.00Z' };
const expected = {
author_username: 'root',
author_id: 'root',
group_id: 'gitlab-org',
label_name: ['labelxyz'],
merged_at_after: '2019-07-16T00:00:00.00Z',
......
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