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
9a3cd505
Commit
9a3cd505
authored
Mar 20, 2018
by
Lyza Danger Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `group.public` from component; use `group.type` instead
parent
d3a567fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
publish-annotation-btn.js
src/sidebar/components/publish-annotation-btn.js
+2
-2
publish-annotation-btn-test.js
src/sidebar/components/test/publish-annotation-btn-test.js
+25
-2
publish-annotation-btn.html
src/sidebar/templates/publish-annotation-btn.html
+1
-1
No files found.
src/sidebar/components/publish-annotation-btn.js
View file @
9a3cd505
...
...
@@ -14,8 +14,8 @@ module.exports = {
return
this
.
isShared
?
this
.
group
.
name
:
this
.
privateLabel
;
};
this
.
group
Type
=
function
()
{
return
this
.
group
.
public
?
'public'
:
'group
'
;
this
.
group
Category
=
function
()
{
return
this
.
group
.
type
===
'private'
?
'group'
:
'public
'
;
};
this
.
setPrivacy
=
function
(
level
)
{
...
...
src/sidebar/components/test/publish-annotation-btn-test.js
View file @
9a3cd505
...
...
@@ -34,7 +34,6 @@ describe('publishAnnotationBtn', function () {
element
=
util
.
createDirective
(
document
,
'publishAnnotationBtn'
,
{
group
:
{
name
:
'Public'
,
type
:
'public'
,
},
canPost
:
true
,
isShared
:
false
,
...
...
@@ -44,6 +43,31 @@ describe('publishAnnotationBtn', function () {
});
});
[
{
groupType
:
'open'
,
expectedIcon
:
'public'
,
},
{
groupType
:
'restricted'
,
expectedIcon
:
'public'
,
},
{
groupType
:
'private'
,
expectedIcon
:
'group'
,
},
].
forEach
(({
groupType
,
expectedIcon
})
=>
{
it
(
'should set the correct group-type icon class'
,
function
()
{
element
.
ctrl
.
group
=
{
name
:
'My Group'
,
type
:
groupType
,
};
element
.
scope
.
$digest
();
var
iconElement
=
element
.
find
(
'.group-icon-container > i'
);
assert
.
isTrue
(
iconElement
.
hasClass
(
`h-icon-
${
expectedIcon
}
`
));
});
});
it
(
'should display "Post to Only Me"'
,
function
()
{
var
buttons
=
element
.
find
(
'button'
);
assert
.
equal
(
buttons
.
length
,
3
);
...
...
@@ -53,7 +77,6 @@ describe('publishAnnotationBtn', function () {
it
(
'should display "Post to Research Lab"'
,
function
()
{
element
.
ctrl
.
group
=
{
name
:
'Research Lab'
,
type
:
'group'
,
};
element
.
ctrl
.
isShared
=
true
;
element
.
scope
.
$digest
();
...
...
src/sidebar/templates/publish-annotation-btn.html
View file @
9a3cd505
...
...
@@ -12,7 +12,7 @@
<li
class=
"dropdown-menu__row"
ng-click=
"vm.setPrivacy('shared')"
>
<div
class=
"group-item"
>
<div
class=
"group-icon-container"
>
<i
class=
"small"
ng-class=
"'h-icon-' + vm.group
Type
()"
></i>
<i
class=
"small"
ng-class=
"'h-icon-' + vm.group
Category
()"
></i>
</div>
<div
class=
"group-details"
>
<div
class=
"group-name-container"
>
...
...
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