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
f6479483
Commit
f6479483
authored
Apr 30, 2020
by
Lyza Danger Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `directLinkedGroupFetchFailed` selector
Avoid accessing state via `getState()`
parent
0193c0ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
direct-linked.js
src/sidebar/store/modules/direct-linked.js
+5
-0
direct-linked-test.js
src/sidebar/store/modules/test/direct-linked-test.js
+7
-0
No files found.
src/sidebar/store/modules/direct-linked.js
View file @
f6479483
...
...
@@ -136,6 +136,10 @@ function directLinkedGroupId(state) {
return
state
.
directLinked
.
directLinkedGroupId
;
}
function
directLinkedGroupFetchFailed
(
state
)
{
return
state
.
directLinked
.
directLinkedGroupFetchFailed
;
}
export
default
{
init
,
namespace
:
'directLinked'
,
...
...
@@ -149,6 +153,7 @@ export default {
},
selectors
:
{
directLinkedAnnotationId
,
directLinkedGroupFetchFailed
,
directLinkedGroupId
,
},
};
src/sidebar/store/modules/test/direct-linked-test.js
View file @
f6479483
...
...
@@ -88,6 +88,13 @@ describe('sidebar/store/modules/direct-linked', () => {
});
});
describe
(
'#directLinkedGroupFetchFailed'
,
()
=>
{
it
(
'should return the group fetch failed status'
,
()
=>
{
store
.
setDirectLinkedGroupFetchFailed
(
true
);
assert
.
isTrue
(
store
.
directLinkedGroupFetchFailed
());
});
});
describe
(
'#directLinkedGroupId'
,
()
=>
{
it
(
'should return the current direct-linked group ID'
,
()
=>
{
store
.
setDirectLinkedGroupId
(
'group-id'
);
...
...
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