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 }) {
...
@@ -88,7 +88,7 @@ function AnnotationView({ loadAnnotationsService, onLogin }) {
// for this scenario as well.
// for this scenario as well.
<
SidebarContentError
errorType
=
"annotation"
onLoginRequest
=
{
onLogin
}
/
>
<
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 }) {
...
@@ -51,7 +51,7 @@ function NotebookView({ loadAnnotationsService }) {
<
NotebookResultCount
/>
<
NotebookResultCount
/>
<
/div
>
<
/div
>
<
div
className
=
"NotebookView__items"
>
<
div
className
=
"NotebookView__items"
>
<
ThreadList
thread
=
{
rootThread
}
/
>
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
...
...
src/sidebar/components/SidebarView.js
View file @
0101a09d
...
@@ -152,7 +152,7 @@ function SidebarView({
...
@@ -152,7 +152,7 @@ function SidebarView({
<
SidebarContentError
errorType
=
"group"
onLoginRequest
=
{
onLogin
}
/
>
<
SidebarContentError
errorType
=
"group"
onLoginRequest
=
{
onLogin
}
/
>
)}
)}
{
showTabs
&&
<
SelectionTabs
isLoading
=
{
isLoading
}
/>
}
{
showTabs
&&
<
SelectionTabs
isLoading
=
{
isLoading
}
/>
}
<
ThreadList
thread
=
{
rootThread
}
/
>
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/
>
{
showLoggedOutMessage
&&
<
LoggedOutMessage
onLogin
=
{
onLogin
}
/>
}
{
showLoggedOutMessage
&&
<
LoggedOutMessage
onLogin
=
{
onLogin
}
/>
}
<
/div
>
<
/div
>
);
);
...
...
src/sidebar/components/StreamView.js
View file @
0101a09d
...
@@ -64,7 +64,7 @@ function StreamView({ api, toastMessenger }) {
...
@@ -64,7 +64,7 @@ function StreamView({ api, toastMessenger }) {
const
rootThread
=
useRootThread
();
const
rootThread
=
useRootThread
();
return
<
ThreadList
thread
=
{
rootThread
}
/>
;
return
<
ThreadList
thread
s
=
{
rootThread
.
children
}
/>
;
}
}
StreamView
.
propTypes
=
{
StreamView
.
propTypes
=
{
...
...
src/sidebar/components/ThreadList.js
View file @
0101a09d
...
@@ -33,7 +33,7 @@ function roundScrollPosition(pos) {
...
@@ -33,7 +33,7 @@ function roundScrollPosition(pos) {
/**
/**
* @typedef ThreadListProps
* @typedef ThreadListProps
* @prop {Thread
} thread
* @prop {Thread
[]} threads
*/
*/
/**
/**
...
@@ -47,7 +47,7 @@ function roundScrollPosition(pos) {
...
@@ -47,7 +47,7 @@ function roundScrollPosition(pos) {
*
*
* @param {ThreadListProps} props
* @param {ThreadListProps} props
*/
*/
function
ThreadList
({
thread
})
{
function
ThreadList
({
thread
s
})
{
// Height of the visible area of the scroll container.
// Height of the visible area of the scroll container.
const
[
scrollContainerHeight
,
setScrollContainerHeight
]
=
useState
(
const
[
scrollContainerHeight
,
setScrollContainerHeight
]
=
useState
(
window
.
innerHeight
window
.
innerHeight
...
@@ -74,7 +74,7 @@ function ThreadList({ thread }) {
...
@@ -74,7 +74,7 @@ function ThreadList({ thread }) {
/** @type {string|null} */
(
null
)
/** @type {string|null} */
(
null
)
);
);
const
topLevelThreads
=
thread
.
children
;
const
topLevelThreads
=
thread
s
;
const
{
const
{
offscreenLowerHeight
,
offscreenLowerHeight
,
...
@@ -210,7 +210,7 @@ function ThreadList({ thread }) {
...
@@ -210,7 +210,7 @@ function ThreadList({ thread }) {
ThreadList
.
propTypes
=
{
ThreadList
.
propTypes
=
{
/** Should annotations render extra document metadata? */
/** Should annotations render extra document metadata? */
thread
:
propTypes
.
object
.
isRequired
,
thread
s
:
propTypes
.
array
.
isRequired
,
};
};
export
default
ThreadList
;
export
default
ThreadList
;
src/sidebar/components/test/ThreadList-test.js
View file @
0101a09d
...
@@ -17,9 +17,12 @@ describe('ThreadList', () => {
...
@@ -17,9 +17,12 @@ describe('ThreadList', () => {
let
wrappers
;
let
wrappers
;
function
createComponent
(
props
)
{
function
createComponent
(
props
)
{
const
wrapper
=
mount
(
<
ThreadList
thread
=
{
fakeTopThread
}
{...
props
}
/>,
{
const
wrapper
=
mount
(
attachTo
:
fakeScrollContainer
,
<
ThreadList
threads
=
{
fakeTopThread
.
children
}
{...
props
}
/>
,
});
{
attachTo
:
fakeScrollContainer
,
}
);
wrappers
.
push
(
wrapper
);
wrappers
.
push
(
wrapper
);
return
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