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
b62f95ea
Commit
b62f95ea
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 `SidebarContent` -> `SidebarView`
This name better describes this component's role.
parent
dea9b141
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
25 deletions
+18
-25
hypothesis-app.js
src/sidebar/components/hypothesis-app.js
+2
-2
sidebar-view.js
src/sidebar/components/sidebar-view.js
+6
-10
hypothesis-app-test.js
src/sidebar/components/test/hypothesis-app-test.js
+6
-9
sidebar-view-test.js
src/sidebar/components/test/sidebar-view-test.js
+4
-4
No files found.
src/sidebar/components/hypothesis-app.js
View file @
b62f95ea
...
...
@@ -15,7 +15,7 @@ import { withServices } from '../util/service-context';
import
AnnotationViewerContent
from
'./annotation-viewer-content'
;
import
HelpPanel
from
'./help-panel'
;
import
ShareAnnotationsPanel
from
'./share-annotations-panel'
;
import
Sidebar
Content
from
'./sidebar-content
'
;
import
Sidebar
View
from
'./sidebar-view
'
;
import
StreamContent
from
'./stream-content'
;
import
ToastMessages
from
'./toast-messages'
;
import
TopBar
from
'./top-bar'
;
...
...
@@ -197,7 +197,7 @@ function HypothesisApp({
{
route
===
'notebook'
&&
<
StreamContent
/>
}
{
route
===
'stream'
&&
<
StreamContent
/>
}
{
route
===
'sidebar'
&&
(
<
Sidebar
Content
onLogin
=
{
login
}
onSignUp
=
{
signUp
}
/
>
<
Sidebar
View
onLogin
=
{
login
}
onSignUp
=
{
signUp
}
/
>
)}
<
/main
>
)}
...
...
src/sidebar/components/sidebar-
content
.js
→
src/sidebar/components/sidebar-
view
.js
View file @
b62f95ea
...
...
@@ -15,7 +15,7 @@ import SidebarContentError from './sidebar-content-error';
import
ThreadList
from
'./thread-list'
;
/**
* @typedef Sidebar
Content
Props
* @typedef Sidebar
View
Props
* @prop {() => any} onLogin
* @prop {() => any} onSignUp
* @prop {Object} [frameSync] - Injected service
...
...
@@ -26,9 +26,9 @@ import ThreadList from './thread-list';
/**
* Render the sidebar and its components
*
* @param {Sidebar
Content
Props} props
* @param {Sidebar
View
Props} props
*/
function
Sidebar
Content
({
function
Sidebar
View
({
frameSync
,
onLogin
,
onSignUp
,
...
...
@@ -151,7 +151,7 @@ function SidebarContent({
);
}
Sidebar
Content
.
propTypes
=
{
Sidebar
View
.
propTypes
=
{
onLogin
:
propTypes
.
func
.
isRequired
,
onSignUp
:
propTypes
.
func
.
isRequired
,
frameSync
:
propTypes
.
object
,
...
...
@@ -159,10 +159,6 @@ SidebarContent.propTypes = {
streamer
:
propTypes
.
object
,
};
SidebarContent
.
injectedProps
=
[
'frameSync'
,
'loadAnnotationsService'
,
'streamer'
,
];
SidebarView
.
injectedProps
=
[
'frameSync'
,
'loadAnnotationsService'
,
'streamer'
];
export
default
withServices
(
Sidebar
Content
);
export
default
withServices
(
Sidebar
View
);
src/sidebar/components/test/hypothesis-app-test.js
View file @
b62f95ea
...
...
@@ -96,14 +96,11 @@ describe('HypothesisApp', () => {
it
(
'does not render content if route is not yet determined'
,
()
=>
{
fakeStore
.
route
.
returns
(
null
);
const
wrapper
=
createComponent
();
[
'main'
,
'AnnotationViewerContent'
,
'StreamContent'
,
'SidebarContent'
,
].
forEach
(
contentComponent
=>
{
assert
.
isFalse
(
wrapper
.
exists
(
contentComponent
));
});
[
'main'
,
'AnnotationViewerContent'
,
'StreamContent'
,
'SidebarView'
].
forEach
(
contentComponent
=>
{
assert
.
isFalse
(
wrapper
.
exists
(
contentComponent
));
}
);
});
[
...
...
@@ -113,7 +110,7 @@ describe('HypothesisApp', () => {
},
{
route
:
'sidebar'
,
contentComponent
:
'Sidebar
Content
'
,
contentComponent
:
'Sidebar
View
'
,
},
{
route
:
'notebook'
,
...
...
src/sidebar/components/test/sidebar-
content
-test.js
→
src/sidebar/components/test/sidebar-
view
-test.js
View file @
b62f95ea
import
{
mount
}
from
'enzyme'
;
import
{
createElement
}
from
'preact'
;
import
Sidebar
Content
from
'../sidebar-content
'
;
import
{
$imports
}
from
'../sidebar-
content
'
;
import
Sidebar
View
from
'../sidebar-view
'
;
import
{
$imports
}
from
'../sidebar-
view
'
;
import
{
checkAccessibility
}
from
'../../../test-util/accessibility'
;
import
mockImportedComponents
from
'../../../test-util/mock-imported-components'
;
describe
(
'Sidebar
Content
'
,
()
=>
{
describe
(
'Sidebar
View
'
,
()
=>
{
let
fakeFrameSync
;
let
fakeLoadAnnotationsService
;
let
fakeUseRootThread
;
...
...
@@ -17,7 +17,7 @@ describe('SidebarContent', () => {
const
createComponent
=
props
=>
mount
(
<
Sidebar
Content
<
Sidebar
View
onLogin
=
{()
=>
null
}
onSignUp
=
{()
=>
null
}
frameSync
=
{
fakeFrameSync
}
...
...
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