Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
94aa005c
Unverified
Commit
94aa005c
authored
Dec 04, 2018
by
Sean Hammond
Committed by
GitHub
Dec 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #824 from hypothesis/support-groupids-in-groups-setting
Support groupids in `groups` config setting
parents
0a771592
f359af83
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
groups.js
src/sidebar/services/groups.js
+3
-1
groups-test.js
src/sidebar/services/test/groups-test.js
+11
-3
No files found.
src/sidebar/services/groups.js
View file @
94aa005c
...
...
@@ -51,7 +51,9 @@ function groups($rootScope, store, api, isSidebar, localStorage, serviceUrl, ses
// If service groups are specified only return those.
// If a service group doesn't exist in the list of groups don't return it.
if
(
svc
&&
svc
.
groups
)
{
const
focusedGroups
=
groups
.
filter
(
g
=>
svc
.
groups
.
includes
(
g
.
id
));
const
focusedGroups
=
groups
.
filter
(
g
=>
svc
.
groups
.
includes
(
g
.
id
)
||
svc
.
groups
.
includes
(
g
.
groupid
)
);
return
Promise
.
resolve
(
focusedGroups
);
}
...
...
src/sidebar/services/test/groups-test.js
View file @
94aa005c
...
...
@@ -258,6 +258,10 @@ describe('groups', function() {
description
:
'shows service groups'
,
services
:
[{
groups
:
[
'abc123'
]}],
expected
:
[
'abc123'
],
},{
description
:
'also supports identifying service groups by groupid'
,
services
:
[{
groups
:
[
'group:42@example.com'
]}],
expected
:
[
'abc123'
],
},{
description
:
'only shows service groups that exist'
,
services
:
[{
groups
:
[
'abc123'
,
'no_exist'
]}],
...
...
@@ -269,18 +273,22 @@ describe('groups', function() {
},{
description
:
'shows all groups if service is null'
,
services
:
null
,
expected
:
[
'__world__'
,
'abc123'
],
expected
:
[
'__world__'
,
'abc123'
,
'def456'
],
},{
description
:
'shows all groups if service groups does not exist'
,
services
:
[{}],
expected
:
[
'__world__'
,
'abc123'
],
expected
:
[
'__world__'
,
'abc123'
,
'def456'
],
}].
forEach
(({
description
,
services
,
expected
})
=>
{
it
(
description
,
()
=>
{
fakeSettings
.
services
=
services
;
const
svc
=
service
();
// Create groups response from server.
const
groups
=
[{
name
:
'Public'
,
id
:
'__world__'
},
{
name
:
'ABC'
,
id
:
'abc123'
}];
const
groups
=
[
{
name
:
'Public'
,
id
:
'__world__'
},
{
name
:
'ABC'
,
id
:
'abc123'
,
groupid
:
'group:42@example.com'
},
{
name
:
'DEF'
,
id
:
'def456'
,
groupid
:
null
},
];
fakeApi
.
groups
.
list
.
returns
(
Promise
.
resolve
({
token
:
'1234'
,
...
...
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