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
0101a09d
Commit
0101a09d
authored
Feb 02, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Feb 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alter `ThreadList` to take an Array of `Thread` objects
parent
060e48fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
11 deletions
+14
-11
AnnotationView.js
src/sidebar/components/AnnotationView.js
+1
-1
NotebookView.js
src/sidebar/components/NotebookView.js
+1
-1
SidebarView.js
src/sidebar/components/SidebarView.js
+1
-1
StreamView.js
src/sidebar/components/StreamView.js
+1
-1
ThreadList.js
src/sidebar/components/ThreadList.js
+4
-4
ThreadList-test.js
src/sidebar/components/test/ThreadList-test.js
+6
-3
No files found.
src/sidebar/components/AnnotationView.js
View file @
0101a09d
...
...
@@ -88,7 +88,7 @@ function AnnotationView({ loadAnnotationsService, onLogin }) {
// for this scenario as well.
<
SidebarContentError
errorType
=
"annotation"
onLoginRequest
=
{
onLogin
}
/
>
)}
<
ThreadList
thread
=
{
rootThread
}
/
>
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/
>
<
/
>
);
}
...
...
src/sidebar/components/NotebookView.js
View file @
0101a09d
...
...
@@ -51,7 +51,7 @@ function NotebookView({ loadAnnotationsService }) {
<
NotebookResultCount
/>
<
/div
>
<
div
className
=
"NotebookView__items"
>
<
ThreadList
thread
=
{
rootThread
}
/
>
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/
>
<
/div
>
<
/div
>
);
...
...
src/sidebar/components/SidebarView.js
View file @
0101a09d
...
...
@@ -152,7 +152,7 @@ function SidebarView({
<
SidebarContentError
errorType
=
"group"
onLoginRequest
=
{
onLogin
}
/
>
)}
{
showTabs
&&
<
SelectionTabs
isLoading
=
{
isLoading
}
/>
}
<
ThreadList
thread
=
{
rootThread
}
/
>
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/
>
{
showLoggedOutMessage
&&
<
LoggedOutMessage
onLogin
=
{
onLogin
}
/>
}
<
/div
>
);
...
...
src/sidebar/components/StreamView.js
View file @
0101a09d
...
...
@@ -64,7 +64,7 @@ function StreamView({ api, toastMessenger }) {
const
rootThread
=
useRootThread
();
return
<
ThreadList
thread
=
{
rootThread
}
/>
;
return
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/>
;
}
StreamView
.
propTypes
=
{
...
...
src/sidebar/components/ThreadList.js
View file @
0101a09d
...
...
@@ -33,7 +33,7 @@ function roundScrollPosition(pos) {
/**
* @typedef ThreadListProps
* @prop {Thread
} thread
* @prop {Thread
[]} threads
*/
/**
...
...
@@ -47,7 +47,7 @@ function roundScrollPosition(pos) {
*
* @param {ThreadListProps} props
*/
function
ThreadList
({
thread
})
{
function
ThreadList
({
thread
s
})
{
// Height of the visible area of the scroll container.
const
[
scrollContainerHeight
,
setScrollContainerHeight
]
=
useState
(
window
.
innerHeight
...
...
@@ -74,7 +74,7 @@ function ThreadList({ thread }) {
/** @type {string|null} */
(
null
)
);
const
topLevelThreads
=
thread
.
children
;
const
topLevelThreads
=
thread
s
;
const
{
offscreenLowerHeight
,
...
...
@@ -210,7 +210,7 @@ function ThreadList({ thread }) {
ThreadList
.
propTypes
=
{
/** Should annotations render extra document metadata? */
thread
:
propTypes
.
object
.
isRequired
,
thread
s
:
propTypes
.
array
.
isRequired
,
};
export
default
ThreadList
;
src/sidebar/components/test/ThreadList-test.js
View file @
0101a09d
...
...
@@ -17,9 +17,12 @@ describe('ThreadList', () => {
let
wrappers
;
function
createComponent
(
props
)
{
const
wrapper
=
mount
(
<
ThreadList
thread
=
{
fakeTopThread
}
{...
props
}
/>,
{
attachTo
:
fakeScrollContainer
,
});
const
wrapper
=
mount
(
<
ThreadList
threads
=
{
fakeTopThread
.
children
}
{...
props
}
/>
,
{
attachTo
:
fakeScrollContainer
,
}
);
wrappers
.
push
(
wrapper
);
return
wrapper
;
}
...
...
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