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
d93b8b3c
Commit
d93b8b3c
authored
Jan 12, 2024
by
Alejandro Celaya
Committed by
Alejandro Celaya
Jan 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Label annotation creation date with 'Created at:' in HTML and text formats
parent
345c5069
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
annotations-exporter.tsx
src/sidebar/services/annotations-exporter.tsx
+3
-2
annotations-exporter-test.js
src/sidebar/services/test/annotations-exporter-test.js
+11
-8
No files found.
src/sidebar/services/annotations-exporter.tsx
View file @
d93b8b3c
...
...
@@ -78,7 +78,7 @@ export class AnnotationsExporter {
const
annotationsAsText
=
annotations
.
map
((
annotation
,
index
)
=>
{
const
page
=
pageLabel
(
annotation
);
const
lines
=
[
formatDateTime
(
new
Date
(
annotation
.
created
))
,
`Created at:
${
formatDateTime
(
new
Date
(
annotation
.
created
))}
`
,
`Comment:
${
annotation
.
text
}
`
,
extractUsername
(
annotation
),
`Quote: "
${
quote
(
annotation
)}
"`
,
...
...
@@ -135,7 +135,7 @@ export class AnnotationsExporter {
.
join
(
','
);
const
headers
=
[
'Creat
ion Date
'
,
'Creat
ed at
'
,
'URL'
,
'Group'
,
'Annotation/Reply Type'
,
...
...
@@ -223,6 +223,7 @@ export class AnnotationsExporter {
<
article
key=
{
annotation
.
id
}
>
<
h2
>
Annotation
{
index
+
1
}
:
</
h2
>
<
p
>
Created at:
<
time
dateTime=
{
annotation
.
created
}
>
{
formatDateTime
(
new
Date
(
annotation
.
created
))
}
</
time
>
...
...
src/sidebar/services/test/annotations-exporter-test.js
View file @
d93b8b3c
...
...
@@ -120,28 +120,28 @@ Total annotations: 5
Total replies: 1
Annotation 1:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
bill
Quote: "this is the quote"
Tags: tag_1, tag_2
Annotation 2:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
bill
Quote: "null"
Tags: tag_1, tag_2
Annotation 3:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
jane
Quote: "null"
Tags: foo, bar
Annotation 4:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
bill
Quote: "null"
...
...
@@ -149,7 +149,7 @@ Tags: tag_1, tag_2
Page: 23
Annotation 5:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
bill
Quote: "null"
...
...
@@ -183,7 +183,7 @@ Total annotations: 1
Total replies: 0
Annotation 1:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
John Doe
Quote: "null"
...
...
@@ -229,7 +229,7 @@ Tags: tag_1, tag_2`,
assert
.
equal
(
result
,
`Creat
ion Date
,URL,Group,Annotation/Reply Type,Quote,User,Comment,Tags,Page
`Creat
ed at
,URL,Group,Annotation/Reply Type,Quote,User,Comment,Tags,Page
${
formattedNow
}
,http://example.com,My group,Annotation,,jane,Annotation text,"foo,bar",
${
formattedNow
}
,http://example.com,My group,Reply,"includes ""double quotes"", and commas",bill,Annotation text,"tag_1,tag_2",23
${
formattedNow
}
,http://example.com,My group,Annotation,,bill,Annotation text,,iii`
,
...
...
@@ -252,7 +252,7 @@ ${formattedNow},http://example.com,My group,Annotation,,bill,Annotation text,,ii
assert
.
equal
(
result
,
`Creat
ion Date
,URL,Group,Annotation/Reply Type,Quote,User,Comment,Tags,Page
`Creat
ed at
,URL,Group,Annotation/Reply Type,Quote,User,Comment,Tags,Page
${
formattedNow
}
,http://example.com,My group,Annotation,,John Doe,Annotation text,"tag_1,tag_2",`
,
);
});
...
...
@@ -356,6 +356,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
<article>
<h2>Annotation 1:</h2>
<p>
Created at:
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
</p>
<p>Comment: Annotation text</p>
...
...
@@ -369,6 +370,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
<article>
<h2>Annotation 2:</h2>
<p>
Created at:
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
</p>
<p>Comment: Annotation text</p>
...
...
@@ -383,6 +385,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
<article>
<h2>Annotation 3:</h2>
<p>
Created at:
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
</p>
<p>Comment: Annotation text</p>
...
...
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