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
5e122026
Commit
5e122026
authored
Jul 29, 2020
by
Kyle Keating
Committed by
Kyle Keating
Jul 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve typecheck (focus-mode-header, store/selection)
parent
8655a056
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
selection.js
src/sidebar/store/modules/selection.js
+21
-4
tsconfig.json
src/tsconfig.json
+0
-1
No files found.
src/sidebar/store/modules/selection.js
View file @
5e122026
...
...
@@ -479,6 +479,9 @@ function focusModeUserPrettyName(state) {
return
state
.
focusMode
.
user
.
displayName
;
}
/**
* @type {(state: any) => string[]}
*/
const
forcedVisibleAnnotations
=
createSelector
(
state
=>
state
.
forcedVisible
,
forcedVisible
=>
trueKeys
(
forcedVisible
)
...
...
@@ -488,7 +491,7 @@ const forcedVisibleAnnotations = createSelector(
* Returns the annotation ID of the first annotation in the selection that is
* selected (`true`) or `null` if there are none.
*
* @
return {
string|null}
* @
type {(state: any) =>
string|null}
*/
const
getFirstSelectedAnnotationId
=
createSelector
(
state
=>
state
.
selected
,
...
...
@@ -501,13 +504,16 @@ const getFirstSelectedAnnotationId = createSelector(
/**
* Are any annotations currently selected?
*
* @
return {
boolean}
* @
type {(state: any) =>
boolean}
*/
const
hasSelectedAnnotations
=
createSelector
(
state
=>
state
.
selected
,
selection
=>
trueKeys
(
selection
).
length
>
0
);
/**
* @type {(state: any) => string[]}
*/
const
selectedAnnotations
=
createSelector
(
state
=>
state
.
selected
,
selection
=>
trueKeys
(
selection
)
...
...
@@ -518,7 +524,7 @@ const selectedAnnotations = createSelector(
* includes a search query, but also if annotations are selected or a user
* is focused.
*
* @
return {
boolean}
* @
type {(state: any) =>
boolean}
*/
const
hasAppliedFilter
=
createSelector
(
filterQuery
,
...
...
@@ -608,7 +614,18 @@ const threadState = createSelector(
* @prop {typeof toggleSelectedAnnotations} toggleSelectedAnnotations
*
* // Selectors
* // TODO: add the rest
* @prop {() => Object<string,boolean>} expandedMap
* @prop {() => string|null} filterQuery
* @prop {() => boolean} focusModeActive
* @prop {() => boolean} focusModeConfigured
* @prop {() => string|null} focusModeUserFilter
* @prop {() => string} focusModeUserPrettyName
* @prop {() => string[]} forcedVisibleAnnotations
* @prop {() => string|null} getFirstSelectedAnnotationId
* @prop {() => boolean} hasAppliedFilter
* @prop {() => boolean} hasSelectedAnnotations
* @prop {() => string[]} selectedAnnotations
* @prop {() => string[]} sortKeys
*/
export
default
{
...
...
src/tsconfig.json
View file @
5e122026
...
...
@@ -40,7 +40,6 @@
"sidebar/components/annotation-viewer-content.js"
,
"sidebar/components/annotation.js"
,
"sidebar/components/filter-status.js"
,
"sidebar/components/focused-mode-header.js"
,
"sidebar/components/group-list-item.js"
,
"sidebar/components/group-list-section.js"
,
"sidebar/components/group-list.js"
,
...
...
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