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
27a6ac35
Commit
27a6ac35
authored
Jan 08, 2024
by
Alejandro Celaya
Committed by
Alejandro Celaya
Jan 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add description to annotations export formats
parent
6bd2b21f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
ExportAnnotations.tsx
src/sidebar/components/ShareDialog/ExportAnnotations.tsx
+13
-1
ExportAnnotations-test.js
...bar/components/ShareDialog/test/ExportAnnotations-test.js
+14
-3
No files found.
src/sidebar/components/ShareDialog/ExportAnnotations.tsx
View file @
27a6ac35
...
...
@@ -34,26 +34,31 @@ type ExportFormat = {
/** Unique format identifier used also as file extension */
value
:
'json'
|
'csv'
|
'txt'
|
'html'
;
name
:
string
;
description
:
string
;
};
const
exportFormats
:
ExportFormat
[]
=
[
{
value
:
'json'
,
name
:
'JSON'
,
description
:
'For import into another Hypothesis group or document'
,
},
{
value
:
'txt'
,
name
:
'Text'
,
description
:
'For import into Word or text editors'
,
},
{
value
:
'csv'
,
name
:
'CSV'
,
description
:
'For import into a spreadsheet'
,
},
// TODO Enable these formats when implemented
// {
// value: 'html',
// name: 'HTML',
// description: '',
// },
];
...
...
@@ -228,7 +233,14 @@ function ExportAnnotations({
key={exportFormat.value}
value={exportFormat}
>
{exportFormat.name}
<div className="flex-col gap-y-2">
<div className="font-bold" data-testid="format-name">
{exportFormat.name}
</div>
<div data-testid="format-description">
{exportFormat.description}
</div>
</div>
</SelectNext.Option>
))}
</SelectNext>
...
...
src/sidebar/components/ShareDialog/test/ExportAnnotations-test.js
View file @
27a6ac35
...
...
@@ -241,11 +241,22 @@ describe('ExportAnnotations', () => {
'[data-testid="export-format-select"]'
,
);
const
options
=
select
.
find
(
SelectNext
.
Option
);
const
optionText
=
(
index
,
type
)
=>
options
.
at
(
index
).
find
(
`[data-testid="format-
${
type
}
"]`
).
text
();
assert
.
equal
(
options
.
length
,
3
);
assert
.
equal
(
options
.
at
(
0
).
text
(),
'JSON'
);
assert
.
equal
(
options
.
at
(
1
).
text
(),
'Text'
);
assert
.
equal
(
options
.
at
(
2
).
text
(),
'CSV'
);
assert
.
equal
(
optionText
(
0
,
'name'
),
'JSON'
);
assert
.
equal
(
optionText
(
0
,
'description'
),
'For import into another Hypothesis group or document'
,
);
assert
.
equal
(
optionText
(
1
,
'name'
),
'Text'
);
assert
.
equal
(
optionText
(
1
,
'description'
),
'For import into Word or text editors'
,
);
assert
.
equal
(
optionText
(
2
,
'name'
),
'CSV'
);
assert
.
equal
(
optionText
(
2
,
'description'
),
'For import into a spreadsheet'
);
});
describe
(
'export form submitted'
,
()
=>
{
...
...
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