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
8c279fb1
Commit
8c279fb1
authored
Mar 20, 2018
by
Lyza Danger Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `group.public` with `group.type` checking in `group-list`
parent
9a3cd505
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
group-list-test.js
src/sidebar/components/test/group-list-test.js
+27
-9
group-list.html
src/sidebar/templates/group-list.html
+1
-1
No files found.
src/sidebar/components/test/group-list-test.js
View file @
8c279fb1
...
@@ -8,8 +8,9 @@ var util = require('../../directive/test/util');
...
@@ -8,8 +8,9 @@ var util = require('../../directive/test/util');
describe
(
'groupList'
,
function
()
{
describe
(
'groupList'
,
function
()
{
var
$window
;
var
$window
;
var
GROUP_LINK
=
'https://hypothes.is/groups/hdevs'
;
var
PRIVATE_GROUP_LINK
=
'https://hypothes.is/groups/hdevs'
;
var
PUBLIC_GROUP_LINK
=
'https://hypothes.is/groups/pub'
;
var
OPEN_GROUP_LINK
=
'https://hypothes.is/groups/pub'
;
var
RESTRICTED_GROUP_LINK
=
'https://hypothes.is/groups/restricto'
;
var
groups
;
var
groups
;
var
fakeGroups
;
var
fakeGroups
;
...
@@ -53,14 +54,19 @@ describe('groupList', function () {
...
@@ -53,14 +54,19 @@ describe('groupList', function () {
groups
=
[{
groups
=
[{
id
:
'public'
,
id
:
'public'
,
public
:
true
,
name
:
'Public Group'
,
type
:
'open'
,
type
:
'open'
,
url
:
PUBLIC
_GROUP_LINK
,
url
:
OPEN
_GROUP_LINK
,
},{
},{
id
:
'h-devs'
,
id
:
'h-devs'
,
name
:
'Hypothesis Developers'
,
name
:
'Hypothesis Developers'
,
type
:
'private'
,
type
:
'private'
,
url
:
GROUP_LINK
,
url
:
PRIVATE_GROUP_LINK
,
},
{
id
:
'restricto'
,
name
:
'Hello Restricted'
,
type
:
'restricted'
,
url
:
RESTRICTED_GROUP_LINK
,
}];
}];
fakeGroups
=
{
fakeGroups
=
{
...
@@ -94,15 +100,27 @@ describe('groupList', function () {
...
@@ -94,15 +100,27 @@ describe('groupList', function () {
assert
.
equal
(
groupItems
.
length
,
groups
.
length
+
1
);
assert
.
equal
(
groupItems
.
length
,
groups
.
length
+
1
);
});
});
it
(
'should render appropriate group name link title per group type'
,
function
()
{
var
element
=
createGroupList
();
var
nameLinks
=
element
.
find
(
'.group-name-link'
);
assert
.
equal
(
nameLinks
.
length
,
groups
.
length
+
1
);
assert
.
include
(
nameLinks
[
0
].
title
,
'Show public annotations'
);
// Open
assert
.
include
(
nameLinks
[
1
].
title
,
'Show and create annotations in'
);
// Private
assert
.
include
(
nameLinks
[
2
].
title
,
'Show public annotations'
);
// Restricted
});
it
(
'should render share links'
,
function
()
{
it
(
'should render share links'
,
function
()
{
var
element
=
createGroupList
();
var
element
=
createGroupList
();
var
shareLinks
=
element
.
find
(
'.share-link-container'
);
var
shareLinks
=
element
.
find
(
'.share-link-container'
);
assert
.
equal
(
shareLinks
.
length
,
2
);
assert
.
equal
(
shareLinks
.
length
,
groups
.
length
);
var
link
=
element
.
find
(
'.share-link'
);
var
link
=
element
.
find
(
'.share-link'
);
assert
.
equal
(
link
.
length
,
2
);
assert
.
equal
(
link
.
length
,
groups
.
length
);
assert
.
equal
(
link
[
0
].
href
,
PUBLIC_GROUP_LINK
);
assert
.
equal
(
link
[
1
].
href
,
GROUP_LINK
);
assert
.
equal
(
link
[
0
].
href
,
OPEN_GROUP_LINK
);
assert
.
equal
(
link
[
1
].
href
,
PRIVATE_GROUP_LINK
);
assert
.
equal
(
link
[
2
].
href
,
RESTRICTED_GROUP_LINK
);
});
});
[{
[{
...
...
src/sidebar/templates/group-list.html
View file @
8c279fb1
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<div
class=
"group-name-container"
>
<div
class=
"group-name-container"
>
<a
class=
"group-name-link"
<a
class=
"group-name-link"
href=
""
href=
""
title=
"{{ group.
public ? 'Show public annotations' : 'Show and create annotations in ' + group.name
}}"
>
title=
"{{ group.
type === 'private' ? 'Show and create annotations in ' + group.name : 'Show public annotations'
}}"
>
{{group.name}}
{{group.name}}
</a>
</a>
</div>
</div>
...
...
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