-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split DataGrid component into two components #698
Conversation
5755b7e
to
d114696
Compare
d114696
to
7632683
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #698 +/- ##
=======================================
Coverage 62.88% 62.88%
=======================================
Files 35 35
Lines 2250 2250
=======================================
Hits 1415 1415
Misses 835 835 ☔ View full report in Codecov by Sentry. |
@nabenabe0928 Could you review this PR? |
if (orderBy === null) { | ||
onOrderByChange("asc") | ||
} else { | ||
onOrderByChange(orderBy === "desc" ? "asc" : "desc") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be simpler with this:
if (orderBy === null) { | |
onOrderByChange("asc") | |
} else { | |
onOrderByChange(orderBy === "desc" ? "asc" : "desc") | |
} | |
onOrderByChange(orderBy === "asc" ? "desc" : "asc" |
<DataGridHeaderColumn<T> | ||
key={column.label} | ||
column={column} | ||
orderBy={orderBy === columnIdx ? order : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename the orderBy
in Line 54 to something like orderByColumnId
as the name orderBy
duplicates for two different roles?
@@ -239,6 +187,76 @@ function DataGrid<T>(props: { | |||
) | |||
} | |||
|
|||
function DataGridHeaderColumn<T>(props: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this name be better as this component is a header, but not column? (please correct me if I am wrong)
function DataGridHeaderColumn<T>(props: { | |
function DataGridColumnHeader<T>(props: { |
Contributor License Agreement
This repository (
optuna-dashboard
) and Goptuna share common code.This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.
Reference Issues/PRs
Follow-up #696
What does this implement/fix? Explain your changes.
This PR splits
DataGrid
component into two components, DataGrid and DataGridHeaderColumn, making it easier to introduce #696.