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