Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3cbf3460
Commit
3cbf3460
authored
Sep 01, 2020
by
Brandon Labuschagne
Committed by
Phil Hughes
Sep 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comment count to Throughput table
This commit adds the comment count to the MR Analytics Throughput Chart
parent
77c218a4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
12 deletions
+55
-12
ee/app/assets/javascripts/analytics/merge_request_analytics/components/throughput_table.vue
...s/merge_request_analytics/components/throughput_table.vue
+10
-7
ee/app/assets/javascripts/analytics/merge_request_analytics/constants.js
...avascripts/analytics/merge_request_analytics/constants.js
+1
-0
ee/app/assets/javascripts/analytics/merge_request_analytics/graphql/queries/throughput_table.query.graphql
..._analytics/graphql/queries/throughput_table.query.graphql
+1
-0
ee/spec/frontend/analytics/merge_request_analytics/components/throughput_table_spec.js
...rge_request_analytics/components/throughput_table_spec.js
+42
-5
ee/spec/frontend/analytics/merge_request_analytics/mock_data.js
...c/frontend/analytics/merge_request_analytics/mock_data.js
+1
-0
No files found.
ee/app/assets/javascripts/analytics/merge_request_analytics/components/throughput_table.vue
View file @
3cbf3460
...
@@ -203,15 +203,18 @@ export default {
...
@@ -203,15 +203,18 @@ export default {
/>
/>
</li>
</li>
<li
<li
v-if=
"item.labels.nodes.length
"
class=
"gl-mr-3 gl-display-flex gl-align-items-center
"
class=
"gl-mr-3
"
:class=
"
{ 'gl-opacity-5': !item.labels.nodes.length }
"
:data-testid="$options.testIds.LABEL_DETAILS"
:data-testid="$options.testIds.LABEL_DETAILS"
>
>
<span
class=
"gl-display-flex gl-align-items-center"
<gl-icon
name=
"label"
class=
"gl-mr-1"
/><span>
{{
item
.
labels
.
nodes
.
length
}}
</span>
><gl-icon
name=
"label"
class=
"gl-mr-1"
/><span>
{{
</li>
item
.
labels
.
nodes
.
length
<li
}}
</span></span
class=
"gl-mr-3 gl-display-flex gl-align-items-center"
>
:class=
"
{ 'gl-opacity-5': !item.userNotesCount }"
:data-testid="$options.testIds.COMMENT_COUNT"
>
<gl-icon
name=
"comments"
class=
"gl-mr-2"
/><span>
{{
item
.
userNotesCount
}}
</span>
</li>
</li>
</ul>
</ul>
</div>
</div>
...
...
ee/app/assets/javascripts/analytics/merge_request_analytics/constants.js
View file @
3cbf3460
...
@@ -41,6 +41,7 @@ export const THROUGHPUT_TABLE_TEST_IDS = {
...
@@ -41,6 +41,7 @@ export const THROUGHPUT_TABLE_TEST_IDS = {
LINE_CHANGES
:
'
lineChangesCol
'
,
LINE_CHANGES
:
'
lineChangesCol
'
,
ASSIGNEES
:
'
assigneesCol
'
,
ASSIGNEES
:
'
assigneesCol
'
,
COMMITS
:
'
commitsCol
'
,
COMMITS
:
'
commitsCol
'
,
COMMENT_COUNT
:
'
commentCount
'
,
};
};
export
const
PIPELINE_STATUS_ICON_CLASSES
=
{
export
const
PIPELINE_STATUS_ICON_CLASSES
=
{
...
...
ee/app/assets/javascripts/analytics/merge_request_analytics/graphql/queries/throughput_table.query.graphql
View file @
3cbf3460
...
@@ -34,6 +34,7 @@ query($fullPath: ID!, $startDate: Time!, $endDate: Time!, $limit: Int!) {
...
@@ -34,6 +34,7 @@ query($fullPath: ID!, $startDate: Time!, $endDate: Time!, $limit: Int!) {
}
}
}
}
commitCount
commitCount
userNotesCount
}
}
}
}
}
}
...
...
ee/spec/frontend/analytics/merge_request_analytics/components/throughput_table_spec.js
View file @
3cbf3460
...
@@ -140,16 +140,33 @@ describe('ThroughputTable', () => {
...
@@ -140,16 +140,33 @@ describe('ThroughputTable', () => {
it
(
'
includes the correct title and IID
'
,
()
=>
{
it
(
'
includes the correct title and IID
'
,
()
=>
{
const
{
title
,
iid
}
=
throughputTableData
[
0
];
const
{
title
,
iid
}
=
throughputTableData
[
0
];
expect
(
findCol
(
TEST_IDS
.
MERGE_REQUEST_DETAILS
).
text
()).
to
Be
(
`
${
title
}
!
${
iid
}
`
);
expect
(
findCol
(
TEST_IDS
.
MERGE_REQUEST_DETAILS
).
text
()).
to
Contain
(
`
${
title
}
!
${
iid
}
`
);
});
});
it
(
'
does not include any icons by default
'
,
()
=>
{
it
(
'
includes an inactive label icon by default
'
,
()
=>
{
const
icon
=
findColSubComponent
(
TEST_IDS
.
MERGE_REQUEST_DETAILS
,
GlIcon
);
const
labels
=
findColSubItem
(
TEST_IDS
.
MERGE_REQUEST_DETAILS
,
TEST_IDS
.
LABEL_DETAILS
);
const
icon
=
labels
.
find
(
GlIcon
);
expect
(
labels
.
text
()).
toBe
(
'
0
'
);
expect
(
labels
.
classes
()).
toContain
(
'
gl-opacity-5
'
);
expect
(
icon
.
exists
()).
toBe
(
true
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
label
'
);
});
expect
(
icon
.
exists
()).
toBe
(
false
);
it
(
'
includes an inactive comment icon by default
'
,
()
=>
{
const
commentCount
=
findColSubItem
(
TEST_IDS
.
MERGE_REQUEST_DETAILS
,
TEST_IDS
.
COMMENT_COUNT
,
);
const
icon
=
commentCount
.
find
(
GlIcon
);
expect
(
commentCount
.
text
()).
toBe
(
'
0
'
);
expect
(
commentCount
.
classes
()).
toContain
(
'
gl-opacity-5
'
);
expect
(
icon
.
exists
()).
toBe
(
true
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
comments
'
);
});
});
it
(
'
includes a label icon and count when available
'
,
async
()
=>
{
it
(
'
includes a
n active
label icon and count when available
'
,
async
()
=>
{
additionalData
({
additionalData
({
labels
:
{
labels
:
{
nodes
:
[{
title
:
'
Brinix
'
}],
nodes
:
[{
title
:
'
Brinix
'
}],
...
@@ -165,10 +182,30 @@ describe('ThroughputTable', () => {
...
@@ -165,10 +182,30 @@ describe('ThroughputTable', () => {
const
icon
=
labelDetails
.
find
(
GlIcon
);
const
icon
=
labelDetails
.
find
(
GlIcon
);
expect
(
labelDetails
.
text
()).
toBe
(
'
1
'
);
expect
(
labelDetails
.
text
()).
toBe
(
'
1
'
);
expect
(
labelDetails
.
classes
()).
not
.
toContain
(
'
gl-opacity-5
'
);
expect
(
icon
.
exists
()).
toBe
(
true
);
expect
(
icon
.
exists
()).
toBe
(
true
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
label
'
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
label
'
);
});
});
it
(
'
includes an active comment icon and count when available
'
,
async
()
=>
{
additionalData
({
userNotesCount
:
2
,
});
await
wrapper
.
vm
.
$nextTick
();
const
commentCount
=
findColSubItem
(
TEST_IDS
.
MERGE_REQUEST_DETAILS
,
TEST_IDS
.
COMMENT_COUNT
,
);
const
icon
=
commentCount
.
find
(
GlIcon
);
expect
(
commentCount
.
text
()).
toBe
(
'
2
'
);
expect
(
commentCount
.
classes
()).
not
.
toContain
(
'
gl-opacity-5
'
);
expect
(
icon
.
exists
()).
toBe
(
true
);
expect
(
icon
.
props
(
'
name
'
)).
toBe
(
'
comments
'
);
});
it
(
'
includes a pipeline icon and when available
'
,
async
()
=>
{
it
(
'
includes a pipeline icon and when available
'
,
async
()
=>
{
const
iconName
=
'
status_canceled
'
;
const
iconName
=
'
status_canceled
'
;
...
...
ee/spec/frontend/analytics/merge_request_analytics/mock_data.js
View file @
3cbf3460
...
@@ -83,5 +83,6 @@ export const throughputTableData = [
...
@@ -83,5 +83,6 @@ export const throughputTableData = [
nodes
:
[],
nodes
:
[],
},
},
commitCount
:
1
,
commitCount
:
1
,
userNotesCount
:
0
,
},
},
];
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment