-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(dashboards): add a new table widget visualization component #93902
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
ref(dashboards): add a new table widget visualization component #93902
Conversation
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.
Very nice! I have many comments, but most are nits 👍🏻
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.stories.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/fixtures/sampleTableProps.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/defaultTableCellRenderers.tsx
Outdated
Show resolved
Hide resolved
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.
lgtm, I think some of the props are going to be filled in like columnSortBy
at a later point? If yes, that's fine and those kinds of TODOs don't block this PR 🙏
<Storybook.JSXProperty name="renderTableBodyCell" value="function" /> and{' '} | ||
<Storybook.JSXProperty name="renderTableHeadCell" value="function" /> which |
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.
I found this a little hard to understand because I thought it meant that we needed to pass the string literal "function"
as the value for these props. Can we reword it to just mention passing a function that returns a component?
columns: Array<TableColumn<string>>; | ||
loading: boolean; | ||
tableData: TableData; | ||
fitMaxContent?: boolean; |
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.
I think I might've seen a comment from Jonas about changing this from a flag to a string literal so it can be scoped to different kinds of fit types, did we decide not to do that?
}} | ||
stickyHeader={stickyHeader} | ||
scrollable={scrollable} | ||
height={'100%'} |
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.
small nit, usually if it's just a string we drop the braces
height={'100%'} | |
height="100%" |
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.
Looking good! Truly only nits left 🙏🏻 This'll be ready to merge real soon
static/app/views/dashboards/widgets/tableWidget/fixtures/tabularColumn.ts
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/fixtures/sampleTableData.ts
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/defaultTableCellRenderers.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/defaultTableCellRenderers.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.spec.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.spec.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
static/app/views/dashboards/widgets/tableWidget/tableWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
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.
Changes
Related to this PR: #93810. This is part 1 of the change, which is pulling out the new component and just adding it to the repo. Also includes some simplification of the logic in the base component.
Part 2 will be replacing tables in widgets.
Before/After
There is no UI change as the table is not being used yet. There is a new story page for the component.