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
6191b3fe
Commit
6191b3fe
authored
Jan 19, 2024
by
Alejandro Celaya
Committed by
Alejandro Celaya
Jan 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include extra toast message info when exporting annotations fails
parent
33cb5da1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
ExportAnnotations.tsx
src/sidebar/components/ShareDialog/ExportAnnotations.tsx
+6
-2
ExportAnnotations-test.js
...bar/components/ShareDialog/test/ExportAnnotations-test.js
+7
-2
No files found.
src/sidebar/components/ShareDialog/ExportAnnotations.tsx
View file @
6191b3fe
...
@@ -216,7 +216,9 @@ function ExportAnnotations({
...
@@ -216,7 +216,9 @@ function ExportAnnotations({
downloadFile(exportData, mimeType, filename);
downloadFile(exportData, mimeType, filename);
} catch (e) {
} catch (e) {
toastMessenger.error('Exporting annotations failed');
toastMessenger.error(`
Exporting
annotations
failed
:
$
{
e
.
message
}
`, {
autoDismiss: false,
});
}
}
},
},
[
[
...
@@ -240,7 +242,9 @@ function ExportAnnotations({
...
@@ -240,7 +242,9 @@ function ExportAnnotations({
toastMessenger.success('Annotations copied');
toastMessenger.success('Annotations copied');
} catch (e) {
} catch (e) {
toastMessenger.error('Copying annotations failed');
toastMessenger.error(`
Copying
annotations
failed
:
$
{
e
.
message
}
`
,
{
autoDismiss
:
false
,
});
}
}
},
[
buildExportContent
,
exportFormat
.
value
,
toastMessenger
]);
},
[
buildExportContent
,
exportFormat
.
value
,
toastMessenger
]);
...
...
src/sidebar/components/ShareDialog/test/ExportAnnotations-test.js
View file @
6191b3fe
...
@@ -446,7 +446,8 @@ describe('ExportAnnotations', () => {
...
@@ -446,7 +446,8 @@ describe('ExportAnnotations', () => {
assert
.
calledOnce
(
fakeAnnotationsExporter
.
buildJSONExportContent
);
assert
.
calledOnce
(
fakeAnnotationsExporter
.
buildJSONExportContent
);
assert
.
calledWith
(
assert
.
calledWith
(
fakeToastMessenger
.
error
,
fakeToastMessenger
.
error
,
'Exporting annotations failed'
,
'Exporting annotations failed: Error exporting'
,
{
autoDismiss
:
false
},
);
);
});
});
});
});
...
@@ -512,7 +513,11 @@ describe('ExportAnnotations', () => {
...
@@ -512,7 +513,11 @@ describe('ExportAnnotations', () => {
copyButton
.
simulate
(
'click'
);
copyButton
.
simulate
(
'click'
);
});
});
assert
.
calledWith
(
fakeToastMessenger
.
error
,
'Copying annotations failed'
);
assert
.
calledWith
(
fakeToastMessenger
.
error
,
'Copying annotations failed: Something failed'
,
{
autoDismiss
:
false
},
);
});
});
});
});
...
...
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