Skip to content
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

Use TanStack Table instead of self-implemented DataGrid #846

Merged
merged 28 commits into from
May 8, 2024

Conversation

keisuke-umezawa
Copy link
Member

@keisuke-umezawa keisuke-umezawa commented Mar 21, 2024

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.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

NA

What does this implement/fix? Explain your changes.

Use TanStack Table instead of self-implemented DataGrid

@keisuke-umezawa keisuke-umezawa changed the title [Draft] Use TanStack Table instead of self-implemented GridTable [Draft] Use TanStack Table instead of self-implemented DataGrid Mar 21, 2024
@keisuke-umezawa keisuke-umezawa force-pushed the feature/tanstack-table branch 2 times, most recently from 6bec4f1 to 5bb1c08 Compare April 17, 2024 12:41
@keisuke-umezawa keisuke-umezawa marked this pull request as ready for review April 17, 2024 13:51
@keisuke-umezawa keisuke-umezawa changed the title [Draft] Use TanStack Table instead of self-implemented DataGrid Use TanStack Table instead of self-implemented DataGrid Apr 17, 2024
@keisuke-umezawa keisuke-umezawa force-pushed the feature/tanstack-table branch 2 times, most recently from 6db5048 to c3e2e3b Compare April 17, 2024 14:03
@keisuke-umezawa keisuke-umezawa changed the title Use TanStack Table instead of self-implemented DataGrid [Draft] Use TanStack Table instead of self-implemented DataGrid Apr 17, 2024
getFilteredRowModel: getFilteredRowModel(),
autoResetPageIndex: false,
//
// debugTable: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[todo] Need to delete.

@keisuke-umezawa keisuke-umezawa changed the title [Draft] Use TanStack Table instead of self-implemented DataGrid Use TanStack Table instead of self-implemented DataGrid Apr 18, 2024
@c-bata
Copy link
Member

c-bata commented Apr 19, 2024

@porink0424 Could you review this PR?

Copy link
Collaborator

@porink0424 porink0424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost great, but I left some nits!

Comment on lines 62 to 66
function FilterMenu<T>(props: {
header: Header<T, unknown>
filterChoices: string[]
}): React.ReactElement {
const { header, filterChoices } = props
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]: How about just receiving arguments with destructing assignment?

function FilterMenu<T>({
  header,
  filterChoices
}: {
  header: Header<T, unknown>
  filterChoices: string[]
}): React.ReactElement {

Comment on lines 117 to 121
function DataGrid<T>(props: {
data: T[]
columns: ColumnDef<T>[]
}): React.ReactElement {
const { data, columns } = props
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]: same as above

}
const TablePaginationActions = (props: TablePaginationActionsProps) => {
const theme = useTheme()
const { count, page, rowsPerPage, onPageChange } = props
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]: same as above

const columns: ColumnDef<Optuna.Attribute, any>[] = [
columnHelper.accessor("key", {
header: "Key",
footer: (info) => info.column.id,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]: Footer is not created in the table, is this prop really necessary or not?

@keisuke-umezawa
Copy link
Member Author

@porink0424
I followed your comments and rebased with main. Could you review it again?

Copy link
Collaborator

@porink0424 porink0424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍

@c-bata c-bata merged commit 5b7321a into optuna:main May 8, 2024
9 checks passed
@keisuke-umezawa keisuke-umezawa deleted the feature/tanstack-table branch May 8, 2024 12:08
@keisuke-umezawa keisuke-umezawa mentioned this pull request May 26, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants