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
4f8e5530
Commit
4f8e5530
authored
Jul 09, 2020
by
Ezekiel Kigbo
Committed by
Kushal Pandya
Jul 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix filter bar member request for subgroups
For subgroups, we should fetch the group members of the parent group.
parent
0f68786a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
5 deletions
+44
-5
ee/app/assets/javascripts/analytics/cycle_analytics/store/getters.js
...ts/javascripts/analytics/cycle_analytics/store/getters.js
+3
-0
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/filters/actions.js
...nalytics/cycle_analytics/store/modules/filters/actions.js
+4
-4
ee/spec/frontend/analytics/cycle_analytics/store/getters_spec.js
.../frontend/analytics/cycle_analytics/store/getters_spec.js
+37
-1
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/store/getters.js
View file @
4f8e5530
...
...
@@ -9,6 +9,9 @@ export const hasNoAccessError = state => state.errorCode === httpStatus.FORBIDDE
export
const
currentGroupPath
=
({
selectedGroup
})
=>
selectedGroup
&&
selectedGroup
.
fullPath
?
selectedGroup
.
fullPath
:
null
;
export
const
currentGroupParentPath
=
({
selectedGroup
},
getters
)
=>
selectedGroup
?.
parentId
||
getters
.
currentGroupPath
;
export
const
selectedProjectIds
=
({
selectedProjects
})
=>
selectedProjects
.
length
?
selectedProjects
.
map
(({
id
})
=>
id
)
:
[];
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/filters/actions.js
View file @
4f8e5530
...
...
@@ -55,22 +55,22 @@ const fetchUser = ({ commit, endpoint, query, action, errorMessage }) => {
};
export
const
fetchAuthors
=
({
commit
,
rootGetters
},
query
=
''
)
=>
{
const
{
currentGroupPath
}
=
rootGetters
;
const
{
currentGroupPa
rentPa
th
}
=
rootGetters
;
return
fetchUser
({
commit
,
query
,
endpoint
:
currentGroupPath
,
endpoint
:
currentGroupPa
rentPa
th
,
action
:
'
AUTHORS
'
,
errorMessage
:
__
(
'
Failed to load authors. Please try again.
'
),
});
};
export
const
fetchAssignees
=
({
commit
,
rootGetters
},
query
=
''
)
=>
{
const
{
currentGroupPath
}
=
rootGetters
;
const
{
currentGroupPa
rentPa
th
}
=
rootGetters
;
return
fetchUser
({
commit
,
query
,
endpoint
:
currentGroupPath
,
endpoint
:
currentGroupPa
rentPa
th
,
action
:
'
ASSIGNEES
'
,
errorMessage
:
__
(
'
Failed to load assignees. Please try again.
'
),
});
...
...
ee/spec/frontend/analytics/cycle_analytics/store/getters_spec.js
View file @
4f8e5530
...
...
@@ -63,13 +63,49 @@ describe('Cycle analytics getters', () => {
});
describe
(
'
without a selectedGroup set
'
,
()
=>
{
it
.
each
([[
''
],
[{}],
[
null
]])(
'
given
%s
will return null
'
,
value
=>
{
it
.
each
([[
''
],
[{}],
[
null
]])(
'
given
"%s"
will return null
'
,
value
=>
{
state
=
{
selectedGroup
:
value
};
expect
(
getters
.
currentGroupPath
(
state
)).
toEqual
(
null
);
});
});
});
describe
(
'
currentGroupParentPath
'
,
()
=>
{
const
fullPath
=
'
cool-beans
'
;
const
parentId
=
'
subgroup/parent/id
'
;
describe
(
'
with a subgroup
'
,
()
=>
{
it
(
'
returns the parentId value of the sub group
'
,
()
=>
{
state
=
{
selectedGroup
:
{
fullPath
,
parentId
,
},
};
expect
(
getters
.
currentGroupParentPath
(
state
)).
toEqual
(
parentId
);
});
});
describe
(
'
with a parent group
'
,
()
=>
{
it
(
'
returns the fullPath value of the group
'
,
()
=>
{
const
res
=
getters
.
currentGroupParentPath
(
{
selectedGroup
:
{
fullPath
,
},
},
{
...
getters
,
currentGroupPath
:
fullPath
,
},
);
expect
(
res
).
toEqual
(
fullPath
);
});
});
});
describe
(
'
cycleAnalyticsRequestParams
'
,
()
=>
{
const
selectedAuthor
=
'
Gohan
'
;
const
selectedMilestone
=
'
SSJ4
'
;
...
...
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