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
8d1e11f4
Commit
8d1e11f4
authored
Apr 02, 2019
by
Hannah Stepanek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show error message when direct-link group error
parent
1940415e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
sidebar-content.js
src/sidebar/components/sidebar-content.js
+11
-0
sidebar-content.html
src/sidebar/templates/sidebar-content.html
+13
-0
No files found.
src/sidebar/components/sidebar-content.js
View file @
8d1e11f4
...
...
@@ -49,6 +49,8 @@ function SidebarContentController(
streamFilter
)
{
const
self
=
this
;
this
.
directLinkedGroupFetchFailed
=
!!
settings
.
group
&&
settings
.
group
!==
store
.
focusedGroup
().
id
;
function
thread
()
{
return
rootThread
.
thread
(
store
.
getState
());
...
...
@@ -298,6 +300,9 @@ function SidebarContentController(
this
.
scrollTo
=
scrollToAnnotation
;
this
.
selectedAnnotationCount
=
function
()
{
if
(
this
.
directLinkedGroupFetchFailed
)
{
return
1
;
}
const
selection
=
store
.
getState
().
selectedAnnotationMap
;
if
(
!
selection
)
{
return
0
;
...
...
@@ -305,6 +310,10 @@ function SidebarContentController(
return
Object
.
keys
(
selection
).
length
;
};
this
.
selectedGroupUnavailable
=
function
()
{
return
!
this
.
isLoading
()
&&
this
.
directLinkedGroupFetchFailed
;
};
this
.
selectedAnnotationUnavailable
=
function
()
{
const
selectedID
=
firstKey
(
store
.
getState
().
selectedAnnotationMap
);
return
(
...
...
@@ -367,6 +376,8 @@ function SidebarContentController(
store
.
clearSelectedAnnotations
();
store
.
selectTab
(
selectedTab
);
// Clear direct-linked group fetch failed state.
this
.
directLinkedGroupFetchFailed
=
false
;
};
}
...
...
src/sidebar/templates/sidebar-content.html
View file @
8d1e11f4
...
...
@@ -21,6 +21,7 @@
total-notes=
"vm.totalNotes"
>
</search-status-bar>
<!-- Display error message if direct-linked annotation fetch failed. -->
<sidebar-content-error
class=
"sidebar-content-error"
logged-out-error-message=
"'This annotation is not available.'"
...
...
@@ -31,6 +32,17 @@
>
</sidebar-content-error>
<!-- Display error message if direct-linked group fetch failed. -->
<sidebar-content-error
class=
"sidebar-content-error"
logged-out-error-message=
"'This group is not available.'"
logged-in-error-message=
"'You either do not have permission to view this group, the group does not exist, or the group is not visible at this URL.'"
on-login-request=
"vm.onLogin()"
is-logged-in=
"vm.auth.status === 'logged-in'"
ng-if=
"vm.selectedGroupUnavailable()"
>
</sidebar-content-error>
<thread-list
on-change-collapsed=
"vm.setCollapsed(id, collapsed)"
on-clear-selection=
"vm.clearSelection()"
...
...
@@ -38,6 +50,7 @@
on-force-visible=
"vm.forceVisible(thread)"
on-select=
"vm.scrollTo(annotation)"
show-document-info=
"false"
ng-if=
"!vm.selectedGroupUnavailable()"
thread=
"vm.rootThread"
>
</thread-list>
...
...
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