Commit 7a870fb6 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '235856-display-more-columns-in-merge-request-analytics-data-table-fe' into 'master'

Add commit count to Merge Request Analytics data table [FE]

See merge request gitlab-org/gitlab!39950
parents 666187aa 676d9dfb
...@@ -69,6 +69,12 @@ export default { ...@@ -69,6 +69,12 @@ export default {
tdClass: 'merge-request-analytics-td', tdClass: 'merge-request-analytics-td',
thAttr: TH_TEST_ID, thAttr: TH_TEST_ID,
}, },
{
key: 'commits',
label: s__('Commits'),
tdClass: 'merge-request-analytics-td',
thAttr: TH_TEST_ID,
},
{ {
key: 'pipelines', key: 'pipelines',
label: s__('MergeRequestAnalytics|Pipelines'), label: s__('MergeRequestAnalytics|Pipelines'),
...@@ -228,6 +234,10 @@ export default { ...@@ -228,6 +234,10 @@ export default {
</div> </div>
</template> </template>
<template #cell(commits)="{ item }">
<div :data-testid="$options.testIds.COMMITS">{{ item.commitCount }}</div>
</template>
<template #cell(pipelines)="{ item }"> <template #cell(pipelines)="{ item }">
<div :data-testid="$options.testIds.PIPELINES">{{ item.pipelines.nodes.length }}</div> <div :data-testid="$options.testIds.PIPELINES">{{ item.pipelines.nodes.length }}</div>
</template> </template>
......
...@@ -36,6 +36,7 @@ export const THROUGHPUT_TABLE_TEST_IDS = { ...@@ -36,6 +36,7 @@ export const THROUGHPUT_TABLE_TEST_IDS = {
PIPELINES: 'pipelinesCol', PIPELINES: 'pipelinesCol',
LINE_CHANGES: 'lineChangesCol', LINE_CHANGES: 'lineChangesCol',
ASSIGNEES: 'assigneesCol', ASSIGNEES: 'assigneesCol',
COMMITS: 'commitsCol',
}; };
export const PIPELINE_STATUS_ICON_CLASSES = { export const PIPELINE_STATUS_ICON_CLASSES = {
......
...@@ -33,6 +33,7 @@ query($fullPath: ID!, $startDate: Time!, $endDate: Time!, $limit: Int!) { ...@@ -33,6 +33,7 @@ query($fullPath: ID!, $startDate: Time!, $endDate: Time!, $limit: Int!) {
} }
} }
} }
commitCount
} }
} }
} }
......
...@@ -215,6 +215,10 @@ describe('ThroughputTable', () => { ...@@ -215,6 +215,10 @@ describe('ThroughputTable', () => {
expect(findCol(TEST_IDS.MILESTONE).text()).toBe(title); expect(findCol(TEST_IDS.MILESTONE).text()).toBe(title);
}); });
it('displays the correct commit count', () => {
expect(findCol(TEST_IDS.COMMITS).text()).toBe('1');
});
it('displays the correct pipeline count', () => { it('displays the correct pipeline count', () => {
expect(findCol(TEST_IDS.PIPELINES).text()).toBe('0'); expect(findCol(TEST_IDS.PIPELINES).text()).toBe('0');
}); });
......
...@@ -51,6 +51,7 @@ export const throughputTableHeaders = [ ...@@ -51,6 +51,7 @@ export const throughputTableHeaders = [
'Date Merged', 'Date Merged',
'Time to merge', 'Time to merge',
'Milestone', 'Milestone',
'Commits',
'Pipelines', 'Pipelines',
'Line changes', 'Line changes',
'Assignees', 'Assignees',
...@@ -81,5 +82,6 @@ export const throughputTableData = [ ...@@ -81,5 +82,6 @@ export const throughputTableData = [
pipelines: { pipelines: {
nodes: [], nodes: [],
}, },
commitCount: 1,
}, },
]; ];
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