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
76d03be3
Commit
76d03be3
authored
Mar 04, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Mar 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust styling on document metadata
Make sure document titles that are not linked don't look like links.
parent
bc58c21c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
25 deletions
+25
-25
AnnotationDocumentInfo.js
src/sidebar/components/Annotation/AnnotationDocumentInfo.js
+3
-7
AnnotationTimestamps.js
src/sidebar/components/Annotation/AnnotationTimestamps.js
+6
-3
AnnotationDocumentInfo-test.js
...components/Annotation/test/AnnotationDocumentInfo-test.js
+3
-5
AnnotationTimestamps-test.js
...r/components/Annotation/test/AnnotationTimestamps-test.js
+2
-2
AnnotationTimestamps.scss
src/styles/sidebar/components/AnnotationTimestamps.scss
+11
-8
No files found.
src/sidebar/components/Annotation/AnnotationDocumentInfo.js
View file @
76d03be3
...
@@ -17,17 +17,13 @@ import propTypes from 'prop-types';
...
@@ -17,17 +17,13 @@ import propTypes from 'prop-types';
*/
*/
export
default
function
AnnotationDocumentInfo
({
domain
,
link
,
title
})
{
export
default
function
AnnotationDocumentInfo
({
domain
,
link
,
title
})
{
return
(
return
(
<
div
className
=
"
AnnotationDocumentInfo
u-layout-row u-horizontal-rhythm"
>
<
div
className
=
"u-layout-row u-horizontal-rhythm"
>
<
div
className
=
"
AnnotationDocumentInfo__title
u-color-text--muted"
>
<
div
className
=
"u-color-text--muted"
>
on
&
quot
;
on
&
quot
;
{
link
?
<
a
href
=
{
link
}
>
{
title
}
<
/a> : <span>{title}</
span
>
}
{
link
?
<
a
href
=
{
link
}
>
{
title
}
<
/a> : <span>{title}</
span
>
}
&
quot
;
&
quot
;
<
/div
>
<
/div
>
{
domain
&&
(
{
domain
&&
<
span
className
=
"u-color-text--muted"
>
({
domain
})
<
/span>
}
<
div
className
=
"AnnotationDocumentInfo__domain u-color-text--muted"
>
({
domain
})
<
/div
>
)}
<
/div
>
<
/div
>
);
);
}
}
...
...
src/sidebar/components/Annotation/AnnotationTimestamps.js
View file @
76d03be3
...
@@ -80,13 +80,16 @@ export default function AnnotationTimestamps({
...
@@ -80,13 +80,16 @@ export default function AnnotationTimestamps({
return
(
return
(
<
div
className
=
"AnnotationTimestamps"
>
<
div
className
=
"AnnotationTimestamps"
>
{
withEditedTimestamp
&&
(
{
withEditedTimestamp
&&
(
<
span
className
=
"AnnotationTimestamps__edited"
title
=
{
updated
.
absolute
}
>
<
span
className
=
"AnnotationTimestamps__timestamp AnnotationTimestamps__edited"
title
=
{
updated
.
absolute
}
>
({
editedString
}){
' '
}
({
editedString
}){
' '
}
<
/span
>
<
/span
>
)}
)}
{
annotationUrl
?
(
{
annotationUrl
?
(
<
a
<
a
className
=
"AnnotationTimestamps__
creat
ed"
className
=
"AnnotationTimestamps__
timestamp AnnotationTimestamps__timestamp--link
ed"
target
=
"_blank"
target
=
"_blank"
rel
=
"noopener noreferrer"
rel
=
"noopener noreferrer"
title
=
{
created
.
absolute
}
title
=
{
created
.
absolute
}
...
@@ -96,7 +99,7 @@ export default function AnnotationTimestamps({
...
@@ -96,7 +99,7 @@ export default function AnnotationTimestamps({
<
/a
>
<
/a
>
)
:
(
)
:
(
<
span
<
span
className
=
"AnnotationTimestamps__created"
className
=
"AnnotationTimestamps__
timestamp AnnotationTimestamps__
created"
title
=
{
created
.
absolute
}
title
=
{
created
.
absolute
}
>
>
{
created
.
relative
}
{
created
.
relative
}
...
...
src/sidebar/components/Annotation/test/AnnotationDocumentInfo-test.js
View file @
76d03be3
...
@@ -18,23 +18,21 @@ describe('AnnotationDocumentInfo', () => {
...
@@ -18,23 +18,21 @@ describe('AnnotationDocumentInfo', () => {
it
(
'should render the document title'
,
()
=>
{
it
(
'should render the document title'
,
()
=>
{
const
wrapper
=
createAnnotationDocumentInfo
();
const
wrapper
=
createAnnotationDocumentInfo
();
const
info
=
wrapper
.
find
(
'.AnnotationDocumentInfo__title'
);
assert
.
equal
(
info
.
text
(),
'on
"Turtles"'
);
assert
.
include
(
wrapper
.
text
(),
'
"Turtles"'
);
});
});
it
(
'should render a link if available'
,
()
=>
{
it
(
'should render a link if available'
,
()
=>
{
const
wrapper
=
createAnnotationDocumentInfo
();
const
wrapper
=
createAnnotationDocumentInfo
();
const
link
=
wrapper
.
find
(
'
.AnnotationDocumentInfo__title
a'
);
const
link
=
wrapper
.
find
(
'a'
);
assert
.
equal
(
link
.
prop
(
'href'
),
'http://www.baz'
);
assert
.
equal
(
link
.
prop
(
'href'
),
'http://www.baz'
);
});
});
it
(
'should render domain if available'
,
()
=>
{
it
(
'should render domain if available'
,
()
=>
{
const
wrapper
=
createAnnotationDocumentInfo
();
const
wrapper
=
createAnnotationDocumentInfo
();
const
domain
=
wrapper
.
find
(
'.AnnotationDocumentInfo__domain'
);
assert
.
equal
(
domain
.
text
(),
'(www.foo.bar)'
);
assert
.
include
(
wrapper
.
text
(),
'(www.foo.bar)'
);
});
});
it
(
it
(
...
...
src/sidebar/components/Annotation/test/AnnotationTimestamps-test.js
View file @
76d03be3
...
@@ -46,7 +46,7 @@ describe('AnnotationTimestamps', () => {
...
@@ -46,7 +46,7 @@ describe('AnnotationTimestamps', () => {
it
(
'renders a linked created timestamp if annotation has a link'
,
()
=>
{
it
(
'renders a linked created timestamp if annotation has a link'
,
()
=>
{
const
wrapper
=
createComponent
();
const
wrapper
=
createComponent
();
const
link
=
wrapper
.
find
(
'a
.AnnotationTimestamps__created
'
);
const
link
=
wrapper
.
find
(
'a'
);
assert
.
equal
(
link
.
prop
(
'href'
),
'http://www.example.com'
);
assert
.
equal
(
link
.
prop
(
'href'
),
'http://www.example.com'
);
assert
.
equal
(
link
.
prop
(
'title'
),
'absolute date'
);
assert
.
equal
(
link
.
prop
(
'title'
),
'absolute date'
);
assert
.
equal
(
link
.
text
(),
'fuzzy string'
);
assert
.
equal
(
link
.
text
(),
'fuzzy string'
);
...
@@ -55,7 +55,7 @@ describe('AnnotationTimestamps', () => {
...
@@ -55,7 +55,7 @@ describe('AnnotationTimestamps', () => {
it
(
'renders an unlinked created timestamp if annotation does not have a link'
,
()
=>
{
it
(
'renders an unlinked created timestamp if annotation does not have a link'
,
()
=>
{
const
wrapper
=
createComponent
({
annotationUrl
:
''
});
const
wrapper
=
createComponent
({
annotationUrl
:
''
});
const
link
=
wrapper
.
find
(
'a
.AnnotationTimestamps__created
'
);
const
link
=
wrapper
.
find
(
'a'
);
const
span
=
wrapper
.
find
(
'span.AnnotationTimestamps__created'
);
const
span
=
wrapper
.
find
(
'span.AnnotationTimestamps__created'
);
assert
.
isFalse
(
link
.
exists
());
assert
.
isFalse
(
link
.
exists
());
assert
.
isTrue
(
span
.
exists
());
assert
.
isTrue
(
span
.
exists
());
...
...
src/styles/sidebar/components/AnnotationTimestamps.scss
View file @
76d03be3
...
@@ -2,16 +2,19 @@
...
@@ -2,16 +2,19 @@
@use
"../../mixins/utils"
;
@use
"../../mixins/utils"
;
.AnnotationTimestamps
{
.AnnotationTimestamps
{
&
__edited
{
&
__timestamp
{
@include
utils
.
font--small
;
font-style
:
italic
;
color
:
var
.
$color-text--light
;
color
:
var
.
$color-text--light
;
}
&
__created
{
&
--linked
{
color
:
var
.
$color-text--light
;
&
:hover
{
&
:hover
{
color
:
var
.
$color-text--light
;
text-decoration
:
underline
;
text-decoration
:
underline
;
}
}
}
}
}
&
__edited
{
@include
utils
.
font--small
;
font-style
:
italic
;
}
}
}
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