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
ec5d1b01
Unverified
Commit
ec5d1b01
authored
Mar 04, 2020
by
Lyza Gardner
Committed by
GitHub
Mar 04, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1871 from hypothesis/annotation-omega-is-saving
AnnotationOmega: Add “Saving…” message
parents
d2501f0c
09938c10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
annotation-omega.js
src/sidebar/components/annotation-omega.js
+4
-1
annotation-omega-test.js
src/sidebar/components/test/annotation-omega-test.js
+19
-2
No files found.
src/sidebar/components/annotation-omega.js
View file @
ec5d1b01
...
...
@@ -68,7 +68,7 @@ function AnnotationOmega({
}
},
[
annotation
,
draft
,
createDraft
,
isSaving
]);
const
shouldShowActions
=
!
isEditing
&&
!
isNew
(
annotation
);
const
shouldShowActions
=
!
is
Saving
&&
!
is
Editing
&&
!
isNew
(
annotation
);
const
shouldShowLicense
=
isEditing
&&
!
isPrivate
&&
group
.
type
!==
'private'
;
const
shouldShowReplyToggle
=
replyCount
>
0
&&
!
isReply
(
annotation
);
...
...
@@ -159,6 +159,9 @@ function AnnotationOmega({
buttonText
=
{
toggleText
}
/
>
)}
{
isSaving
&&
(
<
div
className
=
"annotation-omega__actions"
>
Saving
...
<
/div
>
)}
{
shouldShowActions
&&
(
<
div
className
=
"annotation-omega__actions"
>
<
AnnotationActionBar
annotation
=
{
annotation
}
onReply
=
{
onReply
}
/
>
...
...
src/sidebar/components/test/annotation-omega-test.js
View file @
ec5d1b01
...
...
@@ -93,8 +93,6 @@ describe('AnnotationOmega', () => {
$imports
.
$restore
();
});
it
(
'should test `isSaving`'
);
describe
(
'annotation classnames'
,
()
=>
{
it
(
'should assign a reply class if the annotation is a reply'
,
()
=>
{
fakeMetadata
.
isReply
.
returns
(
true
);
...
...
@@ -238,6 +236,25 @@ describe('AnnotationOmega', () => {
);
});
it
(
'should show a "Saving" message when annotation is saving'
,
()
=>
{
setEditingMode
(
true
);
const
wrapper
=
createComponent
();
act
(()
=>
{
wrapper
.
find
(
'AnnotationPublishControl'
)
.
props
()
.
onSave
();
});
wrapper
.
update
();
assert
.
include
(
wrapper
.
find
(
'.annotation-omega__actions'
).
text
(),
'Saving...'
);
});
it
(
'should flash an error message on failure'
,
async
()
=>
{
setEditingMode
(
true
);
fakeAnnotationsService
.
save
.
rejects
();
...
...
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