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
5f736a40
Unverified
Commit
5f736a40
authored
Feb 21, 2018
by
Robert Knight
Committed by
GitHub
Feb 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #675 from hypothesis/hide-ap-link-for-third-party-users
Remove activity page links for third-party open groups
parents
f59d4277
53a61a3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
group-list.js
src/sidebar/components/group-list.js
+3
-0
group-list-test.js
src/sidebar/components/test/group-list-test.js
+27
-3
group-list.html
src/sidebar/templates/group-list.html
+1
-1
No files found.
src/sidebar/components/group-list.js
View file @
5f736a40
'use strict'
;
var
{
isThirdPartyUser
}
=
require
(
'../util/account-id'
);
var
isThirdPartyService
=
require
(
'../util/is-third-party-service'
);
var
serviceConfig
=
require
(
'../service-config'
);
// @ngInject
...
...
@@ -38,6 +39,8 @@ function GroupListController($window, analytics, groups, settings, serviceUrl) {
if
(
svc
&&
svc
.
icon
)
{
this
.
thirdPartyGroupIcon
=
svc
.
icon
;
}
this
.
isThirdPartyService
=
isThirdPartyService
(
settings
);
}
module
.
exports
=
{
...
...
src/sidebar/components/test/group-list-test.js
View file @
5f736a40
...
...
@@ -79,11 +79,11 @@ describe('groupList', function () {
};
}));
function
createGroupList
()
{
function
createGroupList
(
{
userid
}
=
{
userid
:
'acct:person@example.com'
}
)
{
return
util
.
createDirective
(
document
,
'groupList'
,
{
auth
:
{
status
:
'logged-in
'
,
userid
:
'acct:person@example.com'
,
status
:
userid
?
'logged-in'
:
'logged-out
'
,
userid
,
},
});
}
...
...
@@ -105,6 +105,30 @@ describe('groupList', function () {
assert
.
equal
(
link
[
1
].
href
,
GROUP_LINK
);
});
[{
// Logged-in third party user.
firstPartyAuthDomain
:
'example.com'
,
authDomain
:
'publisher.org'
,
userid
:
'acct:person@publisher.org'
,
},{
// Logged-out third party user.
firstPartyAuthDomain
:
'example.com'
,
authDomain
:
'publisher.org'
,
userid
:
null
,
}].
forEach
(({
firstPartyAuthDomain
,
authDomain
,
userid
})
=>
{
it
(
'should not render share links for third-party groups'
,
()
=>
{
fakeSettings
.
authDomain
=
firstPartyAuthDomain
;
fakeSettings
.
services
=
[{
authority
:
authDomain
,
}];
var
element
=
createGroupList
({
userid
});
var
shareLinks
=
element
.
find
(
'.share-link-container'
);
assert
.
equal
(
shareLinks
.
length
,
0
);
});
});
it
(
'should track metrics when a user attempts to view a groups activity'
,
function
()
{
var
element
=
createGroupList
();
var
link
=
element
.
find
(
'.share-link'
);
...
...
src/sidebar/templates/group-list.html
View file @
5f736a40
...
...
@@ -43,7 +43,7 @@
{{group.name}}
</a>
</div>
<div
class=
"share-link-container"
ng-click=
"$event.stopPropagation()"
>
<div
class=
"share-link-container"
ng-click=
"$event.stopPropagation()"
ng-if=
"!vm.isThirdPartyService"
>
<a
class=
"share-link"
href=
"{{group.url}}"
target=
"_blank"
...
...
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