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
72171edd
Commit
72171edd
authored
May 11, 2021
by
Rajat Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add recursive weight to epic tree
Adds recursive weight to the epic tree Changelog: added
parent
55c5be8a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
0 deletions
+73
-0
app/graphql/queries/epic/epic_children.query.graphql
app/graphql/queries/epic/epic_children.query.graphql
+4
-0
ee/app/assets/javascripts/related_items_tree/components/related_items_tree_header.vue
...lated_items_tree/components/related_items_tree_header.vue
+12
-0
ee/app/assets/javascripts/related_items_tree/store/actions.js
...pp/assets/javascripts/related_items_tree/store/actions.js
+3
-0
ee/app/assets/javascripts/related_items_tree/store/mutation_types.js
...ts/javascripts/related_items_tree/store/mutation_types.js
+1
-0
ee/app/assets/javascripts/related_items_tree/store/mutations.js
.../assets/javascripts/related_items_tree/store/mutations.js
+4
-0
ee/app/assets/javascripts/related_items_tree/store/state.js
ee/app/assets/javascripts/related_items_tree/store/state.js
+4
-0
ee/changelogs/unreleased/count-weight.yml
ee/changelogs/unreleased/count-weight.yml
+5
-0
ee/spec/frontend/related_items_tree/mock_data.js
ee/spec/frontend/related_items_tree/mock_data.js
+4
-0
ee/spec/frontend/related_items_tree/store/actions_spec.js
ee/spec/frontend/related_items_tree/store/actions_spec.js
+23
-0
ee/spec/frontend/related_items_tree/store/mutations_spec.js
ee/spec/frontend/related_items_tree/store/mutations_spec.js
+13
-0
No files found.
app/graphql/queries/epic/epic_children.query.graphql
View file @
72171edd
...
...
@@ -16,6 +16,10 @@ fragment RelatedTreeBaseEpic on Epic {
adminEpic
createEpic
}
descendantWeightSum
{
closedIssues
openedIssues
}
descendantCounts
{
__typename
openedEpics
...
...
ee/app/assets/javascripts/related_items_tree/components/related_items_tree_header.vue
View file @
72171edd
...
...
@@ -17,6 +17,7 @@ export default {
computed
:
{
...
mapState
([
'
parentItem
'
,
'
weightSum
'
,
'
descendantCounts
'
,
'
healthStatus
'
,
'
allowSubEpics
'
,
...
...
@@ -31,6 +32,9 @@ export default {
showHealthStatus
()
{
return
this
.
healthStatus
&&
this
.
allowIssuableHealthStatus
;
},
totalWeight
()
{
return
this
.
weightSum
.
openedIssues
+
this
.
weightSum
.
closedIssues
;
},
},
methods
:
{
...
mapActions
([
...
...
@@ -92,6 +96,10 @@ export default {
}}
<
/span
>
<
/p
>
<
p
class
=
"
font-weight-bold m-0
"
>
{{
__
(
'
Total weight
'
)
}}
&
#
8226
;
<
span
class
=
"
text-secondary-400 font-weight-normal
"
>
{{
totalWeight
}}
<
/span
>
<
/p
>
<
/gl-tooltip
>
<
div
ref
=
"
countBadge
"
...
...
@@ -105,6 +113,10 @@ export default {
<
gl
-
icon
name
=
"
issues
"
class
=
"
mr-1
"
/>
{{
totalIssuesCount
}}
<
/span
>
<
span
class
=
"
d-inline-flex align-items-center
"
:
class
=
"
{ 'ml-3': allowSubEpics
}
"
>
<
gl
-
icon
name
=
"
weight
"
class
=
"
mr-1
"
/>
{{
totalWeight
}}
<
/span
>
<
/div
>
<
epic
-
health
-
status
v
-
if
=
"
showHealthStatus
"
:
health
-
status
=
"
healthStatus
"
/>
<
/div
>
...
...
ee/app/assets/javascripts/related_items_tree/store/actions.js
View file @
72171edd
...
...
@@ -71,6 +71,7 @@ export const setItemChildrenFlags = ({ commit }, data) =>
export
const
setEpicPageInfo
=
({
commit
},
data
)
=>
commit
(
types
.
SET_EPIC_PAGE_INFO
,
data
);
export
const
setIssuePageInfo
=
({
commit
},
data
)
=>
commit
(
types
.
SET_ISSUE_PAGE_INFO
,
data
);
export
const
setWeightSum
=
({
commit
},
data
)
=>
commit
(
types
.
SET_WEIGHT_SUM
,
data
);
export
const
requestItems
=
({
commit
},
data
)
=>
commit
(
types
.
REQUEST_ITEMS
,
data
);
export
const
receiveItemsSuccess
=
({
commit
},
data
)
=>
commit
(
types
.
RECEIVE_ITEMS_SUCCESS
,
data
);
...
...
@@ -123,6 +124,8 @@ export const fetchItems = ({ dispatch }, { parentItem, isSubItem = false }) => {
pageInfo
:
data
.
group
.
epic
.
issues
.
pageInfo
,
});
dispatch
(
'
setWeightSum
'
,
data
.
group
.
epic
.
descendantWeightSum
);
if
(
!
isSubItem
)
{
dispatch
(
'
setChildrenCount
'
,
data
.
group
.
epic
.
descendantCounts
);
dispatch
(
'
setHealthStatus
'
,
data
.
group
.
epic
.
healthStatus
);
...
...
ee/app/assets/javascripts/related_items_tree/store/mutation_types.js
View file @
72171edd
...
...
@@ -8,6 +8,7 @@ export const SET_ITEM_CHILDREN_FLAGS = 'SET_ITEM_CHILDREN_FLAGS';
export
const
SET_EPIC_PAGE_INFO
=
'
SET_EPIC_PAGE_INFO
'
;
export
const
SET_ISSUE_PAGE_INFO
=
'
SET_ISSUE_PAGE_INFO
'
;
export
const
SET_HEALTH_STATUS
=
'
SET_HEALTH_STATUS
'
;
export
const
SET_WEIGHT_SUM
=
'
SET_WEIGHT_SUM
'
;
export
const
REQUEST_ITEMS
=
'
REQUEST_ITEMS
'
;
export
const
RECEIVE_ITEMS_SUCCESS
=
'
RECEIVE_ITEMS_SUCCESS
'
;
...
...
ee/app/assets/javascripts/related_items_tree/store/mutations.js
View file @
72171edd
...
...
@@ -73,6 +73,10 @@ export default {
parentFlags
.
hasMoreIssues
=
pageInfo
.
hasNextPage
;
},
[
types
.
SET_WEIGHT_SUM
](
state
,
data
)
{
state
.
weightSum
=
data
;
},
[
types
.
REQUEST_ITEMS
](
state
,
{
parentItem
,
isSubItem
})
{
if
(
isSubItem
)
{
state
.
childrenFlags
[
parentItem
.
reference
].
itemChildrenFetchInProgress
=
true
;
...
...
ee/app/assets/javascripts/related_items_tree/store/state.js
View file @
72171edd
...
...
@@ -10,6 +10,10 @@ export default () => ({
childrenFlags
:
{},
epicsCount
:
0
,
issuesCount
:
0
,
weightSum
:
{
openedIssues
:
0
,
closedIssues
:
0
,
},
descendantCounts
:
{
openedEpics
:
0
,
closedEpics
:
0
,
...
...
ee/changelogs/unreleased/count-weight.yml
0 → 100644
View file @
72171edd
---
title
:
Add recursive weight to epic tree
merge_request
:
60990
author
:
type
:
added
ee/spec/frontend/related_items_tree/mock_data.js
View file @
72171edd
...
...
@@ -284,6 +284,10 @@ export const mockQueryResponse = {
},
},
descendantCounts
:
mockParentItem
.
descendantCounts
,
descendantWeightSum
:
{
openedIssues
:
10
,
closedIssues
:
5
,
},
healthStatus
:
{
atRisk
:
0
,
needsAttention
:
1
,
...
...
ee/spec/frontend/related_items_tree/store/actions_spec.js
View file @
72171edd
...
...
@@ -280,6 +280,24 @@ describe('RelatedItemTree', () => {
});
});
describe
(
'
setWeightSum
'
,
()
=>
{
it
(
'
set weightSum
'
,
()
=>
{
const
descendantWeightSum
=
mockQueryResponse
.
data
.
group
.
epic
;
testAction
(
actions
.
setWeightSum
,
descendantWeightSum
,
{},
[
{
type
:
types
.
SET_WEIGHT_SUM
,
payload
:
descendantWeightSum
,
},
],
[],
);
});
});
describe
(
'
requestItems
'
,
()
=>
{
it
(
'
should set `state.itemsFetchInProgress` to true
'
,
()
=>
{
testAction
(
...
...
@@ -359,6 +377,7 @@ describe('RelatedItemTree', () => {
children
:
{
pageInfo
:
epicPageInfo
},
issues
:
{
pageInfo
:
issuesPageInfo
},
descendantCounts
:
epicDescendantCounts
,
descendantWeightSum
,
healthStatus
,
}
=
mockQueryResponse
.
data
.
group
.
epic
;
...
...
@@ -409,6 +428,10 @@ describe('RelatedItemTree', () => {
pageInfo
:
issuesPageInfo
,
},
},
{
type
:
'
setWeightSum
'
,
payload
:
descendantWeightSum
,
},
{
type
:
'
setChildrenCount
'
,
payload
:
{
...
...
ee/spec/frontend/related_items_tree/store/mutations_spec.js
View file @
72171edd
...
...
@@ -35,6 +35,10 @@ describe('RelatedItemsTree', () => {
issuesAtRisk
:
0
,
issuesOnTrack
:
0
,
});
expect
(
state
).
toHaveProperty
(
'
weightSum
'
,
{
openedIssues
:
0
,
closedIssues
:
0
,
});
});
});
...
...
@@ -700,6 +704,15 @@ describe('RelatedItemsTree', () => {
expect
(
state
.
projectsFetchInProgress
).
toBe
(
false
);
});
});
describe
(
types
.
SET_WEIGHT_SUM
,
()
=>
{
it
(
'
should set `weightSum` within state
'
,
()
=>
{
const
payload
=
{
openedIssues
:
10
,
closedIssues
:
5
};
mutations
[
types
.
SET_WEIGHT_SUM
](
state
,
payload
);
expect
(
state
.
weightSum
).
toBe
(
payload
);
});
});
});
});
});
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