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 {
...
@@ -78,7 +78,7 @@ export class AnnotationsExporter {
const
annotationsAsText
=
annotations
.
map
((
annotation
,
index
)
=>
{
const
annotationsAsText
=
annotations
.
map
((
annotation
,
index
)
=>
{
const
page
=
pageLabel
(
annotation
);
const
page
=
pageLabel
(
annotation
);
const
lines
=
[
const
lines
=
[
formatDateTime
(
new
Date
(
annotation
.
created
))
,
`Created at:
${
formatDateTime
(
new
Date
(
annotation
.
created
))}
`
,
`Comment:
${
annotation
.
text
}
`
,
`Comment:
${
annotation
.
text
}
`
,
extractUsername
(
annotation
),
extractUsername
(
annotation
),
`Quote: "
${
quote
(
annotation
)}
"`
,
`Quote: "
${
quote
(
annotation
)}
"`
,
...
@@ -135,7 +135,7 @@ export class AnnotationsExporter {
...
@@ -135,7 +135,7 @@ export class AnnotationsExporter {
.
join
(
','
);
.
join
(
','
);
const
headers
=
[
const
headers
=
[
'Creat
ion Date
'
,
'Creat
ed at
'
,
'URL'
,
'URL'
,
'Group'
,
'Group'
,
'Annotation/Reply Type'
,
'Annotation/Reply Type'
,
...
@@ -223,6 +223,7 @@ export class AnnotationsExporter {
...
@@ -223,6 +223,7 @@ export class AnnotationsExporter {
<
article
key=
{
annotation
.
id
}
>
<
article
key=
{
annotation
.
id
}
>
<
h2
>
Annotation
{
index
+
1
}
:
</
h2
>
<
h2
>
Annotation
{
index
+
1
}
:
</
h2
>
<
p
>
<
p
>
Created at:
<
time
dateTime=
{
annotation
.
created
}
>
<
time
dateTime=
{
annotation
.
created
}
>
{
formatDateTime
(
new
Date
(
annotation
.
created
))
}
{
formatDateTime
(
new
Date
(
annotation
.
created
))
}
</
time
>
</
time
>
...
...
src/sidebar/services/test/annotations-exporter-test.js
View file @
d93b8b3c
...
@@ -120,28 +120,28 @@ Total annotations: 5
...
@@ -120,28 +120,28 @@ Total annotations: 5
Total replies: 1
Total replies: 1
Annotation 1:
Annotation 1:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
Comment: Annotation text
bill
bill
Quote: "this is the quote"
Quote: "this is the quote"
Tags: tag_1, tag_2
Tags: tag_1, tag_2
Annotation 2:
Annotation 2:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
Comment: Annotation text
bill
bill
Quote: "null"
Quote: "null"
Tags: tag_1, tag_2
Tags: tag_1, tag_2
Annotation 3:
Annotation 3:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
Comment: Annotation text
jane
jane
Quote: "null"
Quote: "null"
Tags: foo, bar
Tags: foo, bar
Annotation 4:
Annotation 4:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
Comment: Annotation text
bill
bill
Quote: "null"
Quote: "null"
...
@@ -149,7 +149,7 @@ Tags: tag_1, tag_2
...
@@ -149,7 +149,7 @@ Tags: tag_1, tag_2
Page: 23
Page: 23
Annotation 5:
Annotation 5:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
Comment: Annotation text
bill
bill
Quote: "null"
Quote: "null"
...
@@ -183,7 +183,7 @@ Total annotations: 1
...
@@ -183,7 +183,7 @@ Total annotations: 1
Total replies: 0
Total replies: 0
Annotation 1:
Annotation 1:
${
formattedNow
}
Created at:
${
formattedNow
}
Comment: Annotation text
Comment: Annotation text
John Doe
John Doe
Quote: "null"
Quote: "null"
...
@@ -229,7 +229,7 @@ Tags: tag_1, tag_2`,
...
@@ -229,7 +229,7 @@ Tags: tag_1, tag_2`,
assert
.
equal
(
assert
.
equal
(
result
,
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,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,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`
,
${
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
...
@@ -252,7 +252,7 @@ ${formattedNow},http://example.com,My group,Annotation,,bill,Annotation text,,ii
assert
.
equal
(
assert
.
equal
(
result
,
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",`
,
${
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
...
@@ -356,6 +356,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
<article>
<article>
<h2>Annotation 1:</h2>
<h2>Annotation 1:</h2>
<p>
<p>
Created at:
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
</p>
</p>
<p>Comment: Annotation text</p>
<p>Comment: Annotation text</p>
...
@@ -369,6 +370,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
...
@@ -369,6 +370,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
<article>
<article>
<h2>Annotation 2:</h2>
<h2>Annotation 2:</h2>
<p>
<p>
Created at:
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
</p>
</p>
<p>Comment: Annotation text</p>
<p>Comment: Annotation text</p>
...
@@ -383,6 +385,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
...
@@ -383,6 +385,7 @@ ${formattedNow},http://example.com,My group,Annotation,,John Doe,Annotation text
<article>
<article>
<h2>Annotation 3:</h2>
<h2>Annotation 3:</h2>
<p>
<p>
Created at:
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
<time datetime="
${
isoDate
}
">
${
formattedNow
}
</time>
</p>
</p>
<p>Comment: Annotation text</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