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
b417a3c7
Commit
b417a3c7
authored
Apr 16, 2019
by
Hannah Stepanek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change selectedCounts to areAllAnnotationsVisible
parent
bdd195d6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
14 deletions
+15
-14
search-status-bar.js
src/sidebar/components/search-status-bar.js
+2
-1
sidebar-content.js
src/sidebar/components/sidebar-content.js
+4
-4
search-status-bar-test.js
src/sidebar/components/test/search-status-bar-test.js
+2
-2
sidebar-content-test.js
src/sidebar/components/test/sidebar-content-test.js
+4
-4
search-status-bar.html
src/sidebar/templates/search-status-bar.html
+1
-1
sidebar-content.html
src/sidebar/templates/sidebar-content.html
+2
-2
No files found.
src/sidebar/components/search-status-bar.js
View file @
b417a3c7
...
...
@@ -15,7 +15,8 @@ module.exports = {
onClearSelection
:
'&'
,
searchQuery
:
'<'
,
selectedTab
:
'<'
,
selectionCount
:
'<'
,
// Boolean indicating all annotations are visible (none are hidden).
areAllAnnotationsVisible
:
'<'
,
totalAnnotations
:
'<'
,
totalNotes
:
'<'
,
},
...
...
src/sidebar/components/sidebar-content.js
View file @
b417a3c7
...
...
@@ -299,15 +299,15 @@ function SidebarContentController(
this
.
focus
=
focusAnnotation
;
this
.
scrollTo
=
scrollToAnnotation
;
this
.
selectedAnnotationCount
=
function
()
{
this
.
areAllAnnotationsVisible
=
function
()
{
if
(
this
.
directLinkedGroupFetchFailed
)
{
return
1
;
return
true
;
}
const
selection
=
store
.
getState
().
selectedAnnotationMap
;
if
(
!
selection
)
{
return
0
;
return
false
;
}
return
Object
.
keys
(
selection
).
length
;
return
Object
.
keys
(
selection
).
length
>
0
;
};
this
.
selectedGroupUnavailable
=
function
()
{
...
...
src/sidebar/components/test/search-status-bar-test.js
View file @
b417a3c7
...
...
@@ -30,7 +30,7 @@ describe('searchStatusBar', function() {
const
msg
=
'Show all annotations'
;
const
msgCount
=
'(2)'
;
const
elem
=
util
.
createDirective
(
document
,
'searchStatusBar'
,
{
selectionCount
:
1
,
areAllAnnotationsVisible
:
true
,
totalAnnotations
:
2
,
selectedTab
:
'annotation'
,
});
...
...
@@ -43,7 +43,7 @@ describe('searchStatusBar', function() {
const
msg
=
'Show all notes'
;
const
msgCount
=
'(3)'
;
const
elem
=
util
.
createDirective
(
document
,
'searchStatusBar'
,
{
selectionCount
:
1
,
areAllAnnotationsVisible
:
true
,
totalNotes
:
3
,
selectedTab
:
'note'
,
});
...
...
src/sidebar/components/test/sidebar-content-test.js
View file @
b417a3c7
...
...
@@ -265,8 +265,8 @@ describe('sidebar.components.sidebar-content', function() {
$scope
.
$digest
();
});
it
(
'
selectedAnnotationCount is > 0
'
,
function
()
{
assert
.
equal
(
ctrl
.
selectedAnnotationCount
(),
1
);
it
(
'
areAllAnnotationsVisible is true
'
,
function
()
{
assert
.
isTrue
(
ctrl
.
areAllAnnotationsVisible
()
);
});
it
(
"switches to the selected annotation's group"
,
function
()
{
...
...
@@ -295,8 +295,8 @@ describe('sidebar.components.sidebar-content', function() {
$scope
.
$digest
();
});
it
(
'
selectedAnnotationCount is 0
'
,
function
()
{
assert
.
equal
(
ctrl
.
selectedAnnotationCount
(),
0
);
it
(
'
areAllAnnotationsVisible is false
'
,
function
()
{
assert
.
isFalse
(
ctrl
.
areAllAnnotationsVisible
()
);
});
it
(
'fetches annotations for the current group'
,
function
()
{
...
...
src/sidebar/templates/search-status-bar.html
View file @
b417a3c7
...
...
@@ -11,7 +11,7 @@
'one': '1 search result',
'other': '{} search results'}"
></span>
</div>
<div
class=
"search-status-bar"
ng-if=
"!vm.filterActive && vm.
selectionCount > 0
"
>
<div
class=
"search-status-bar"
ng-if=
"!vm.filterActive && vm.
areAllAnnotationsVisible
"
>
<button
class=
"primary-action-btn primary-action-btn--short"
ng-click=
"vm.onClearSelection()"
title=
"Clear the selection and show all annotations"
>
...
...
src/sidebar/templates/sidebar-content.html
View file @
b417a3c7
<selection-tabs
ng-if=
"!vm.search.query() && vm.
selectedAnnotationCount() === 0
"
ng-if=
"!vm.search.query() && vm.
annotationsAreSelected()
"
is-waiting-to-anchor-annotations=
"vm.waitingToAnchorAnnotations"
is-loading=
"vm.isLoading"
selected-tab=
"vm.selectedTab"
...
...
@@ -14,7 +14,7 @@
filter-match-count=
"vm.visibleCount()"
on-clear-selection=
"vm.clearSelection()"
search-query=
"vm.search.query()"
selection-count=
"vm.selectedAnnotationCount
()"
are-all-annotations-visible=
"vm.areAllAnnotationsVisible
()"
total-count=
"vm.topLevelThreadCount()"
selected-tab=
"vm.selectedTab"
total-annotations=
"vm.totalAnnotations"
...
...
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