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
2d195fd9
Commit
2d195fd9
authored
Nov 20, 2020
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Nov 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `AnnotationViewerContent` -> `AnnotationView`
parent
b62f95ea
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
17 deletions
+13
-17
annotation-view.js
src/sidebar/components/annotation-view.js
+6
-6
hypothesis-app.js
src/sidebar/components/hypothesis-app.js
+2
-4
annotation-view-test.js
src/sidebar/components/test/annotation-view-test.js
+3
-5
hypothesis-app-test.js
src/sidebar/components/test/hypothesis-app-test.js
+2
-2
No files found.
src/sidebar/components/annotation-view
er-content
.js
→
src/sidebar/components/annotation-view.js
View file @
2d195fd9
...
...
@@ -10,7 +10,7 @@ import ThreadList from './thread-list';
import
SidebarContentError
from
'./sidebar-content-error'
;
/**
* @typedef AnnotationView
erContent
Props
* @typedef AnnotationViewProps
* @prop {() => any} onLogin
* @prop {Object} [loadAnnotationsService] - Injected service
*/
...
...
@@ -18,9 +18,9 @@ import SidebarContentError from './sidebar-content-error';
/**
* The main content for the single annotation page (aka. https://hypothes.is/a/<annotation ID>)
*
* @param {AnnotationView
erContent
Props} props
* @param {AnnotationViewProps} props
*/
function
AnnotationView
erContent
({
loadAnnotationsService
,
onLogin
})
{
function
AnnotationView
({
loadAnnotationsService
,
onLogin
})
{
const
annotationId
=
useStore
(
store
=>
store
.
routeParams
().
id
);
const
clearAnnotations
=
useStore
(
store
=>
store
.
clearAnnotations
);
const
highlightAnnotations
=
useStore
(
store
=>
store
.
highlightAnnotations
);
...
...
@@ -98,11 +98,11 @@ function AnnotationViewerContent({ loadAnnotationsService, onLogin }) {
);
}
AnnotationView
erContent
.
propTypes
=
{
AnnotationView
.
propTypes
=
{
onLogin
:
propTypes
.
func
.
isRequired
,
loadAnnotationsService
:
propTypes
.
object
,
};
AnnotationView
erContent
.
injectedProps
=
[
'loadAnnotationsService'
];
AnnotationView
.
injectedProps
=
[
'loadAnnotationsService'
];
export
default
withServices
(
AnnotationView
erContent
);
export
default
withServices
(
AnnotationView
);
src/sidebar/components/hypothesis-app.js
View file @
2d195fd9
...
...
@@ -12,7 +12,7 @@ import { shouldAutoDisplayTutorial } from '../util/session';
import
{
applyTheme
}
from
'../util/theme'
;
import
{
withServices
}
from
'../util/service-context'
;
import
AnnotationView
erContent
from
'./annotation-viewer-content
'
;
import
AnnotationView
from
'./annotation-view
'
;
import
HelpPanel
from
'./help-panel'
;
import
ShareAnnotationsPanel
from
'./share-annotations-panel'
;
import
SidebarView
from
'./sidebar-view'
;
...
...
@@ -191,9 +191,7 @@ function HypothesisApp({
{
route
&&
(
<
main
>
{
route
===
'annotation'
&&
(
<
AnnotationViewerContent
onLogin
=
{
login
}
/
>
)}
{
route
===
'annotation'
&&
<
AnnotationView
onLogin
=
{
login
}
/>
}
{
route
===
'notebook'
&&
<
StreamContent
/>
}
{
route
===
'stream'
&&
<
StreamContent
/>
}
{
route
===
'sidebar'
&&
(
...
...
src/sidebar/components/test/annotation-view
er-content
-test.js
→
src/sidebar/components/test/annotation-view-test.js
View file @
2d195fd9
...
...
@@ -4,11 +4,9 @@ import { mount } from 'enzyme';
import
{
waitFor
}
from
'../../../test-util/wait'
;
import
mockImportedComponents
from
'../../../test-util/mock-imported-components'
;
import
AnnotationViewerContent
,
{
$imports
,
}
from
'../annotation-viewer-content'
;
import
AnnotationView
,
{
$imports
}
from
'../annotation-view'
;
describe
(
'AnnotationView
erContent
'
,
()
=>
{
describe
(
'AnnotationView'
,
()
=>
{
let
fakeStore
;
let
fakeOnLogin
;
let
fakeUseRootThread
;
...
...
@@ -45,7 +43,7 @@ describe('AnnotationViewerContent', () => {
function
createComponent
(
props
=
{})
{
return
mount
(
<
AnnotationView
erContent
<
AnnotationView
loadAnnotationsService
=
{
fakeLoadAnnotationsService
}
onLogin
=
{
fakeOnLogin
}
{...
props
}
...
...
src/sidebar/components/test/hypothesis-app-test.js
View file @
2d195fd9
...
...
@@ -96,7 +96,7 @@ describe('HypothesisApp', () => {
it
(
'does not render content if route is not yet determined'
,
()
=>
{
fakeStore
.
route
.
returns
(
null
);
const
wrapper
=
createComponent
();
[
'main'
,
'AnnotationView
erContent
'
,
'StreamContent'
,
'SidebarView'
].
forEach
(
[
'main'
,
'AnnotationView'
,
'StreamContent'
,
'SidebarView'
].
forEach
(
contentComponent
=>
{
assert
.
isFalse
(
wrapper
.
exists
(
contentComponent
));
}
...
...
@@ -106,7 +106,7 @@ describe('HypothesisApp', () => {
[
{
route
:
'annotation'
,
contentComponent
:
'AnnotationView
erContent
'
,
contentComponent
:
'AnnotationView'
,
},
{
route
:
'sidebar'
,
...
...
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