-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(dashboards): Create table for landing page table view #80945
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
Conversation
import {type DashboardListItem, DisplayType} from 'sentry/views/dashboards/types'; | ||
|
||
describe('Dashboards - DashboardList', function () { | ||
describe('Dashboards - DashboardTable', function () { |
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.
describe('Dashboards - DashboardTable', function () { | |
describe('Dashboards - DashboardGrid', function () { |
/> | ||
); | ||
|
||
expect(screen.getByTestId('empty-state')).toBeInTheDocument(); |
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 assert on the text so we can validate what the user behaviour?
isLoading?: boolean; | ||
}; | ||
|
||
enum Keys { |
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.
enum Keys { | |
enum ResponseKeys { |
small nit, but just thinking that Keys
is pretty generic, if we're going to make an enum we should make it clear what keys it's meant to be for
function handleDelete(dashboard: DashboardListItem) { | ||
deleteDashboard(api, organization.slug, dashboard.id) | ||
.then(() => { | ||
trackAnalytics('dashboards_manage.delete', { |
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.
Not important for now, but it may be interesting to add the view type (table, grid) to the event in case we see different behaviour on either page for actions like delete, duplicate, etc
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.
ooo ya good point. I'll make a ticket for that so I remember before we rollout 😄
return <span>{dataRow[column.key]}</span>; | ||
}; | ||
|
||
function renderDashboardTable() { |
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.
We can unnest this function's body and it'll render the dashboard table
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #80945 +/- ##
=======================================
Coverage 78.42% 78.43%
=======================================
Files 7211 7215 +4
Lines 319738 319731 -7
Branches 44008 44023 +15
=======================================
+ Hits 250749 250771 +22
+ Misses 62602 62573 -29
Partials 6387 6387 |
As part of creating table view for the dashboards landing page this PR creates the actual table with most of the fields that are present in the mockup (only column left to add is permissions/access column). Switching the toggle to list view will bring you to this page view. I've defaulted to 25 items per page (i'm not sure if there's a different amount we want to use). It's still under the feature flag `dashboards-table-view` which I only have access to atm. <img width="1512" alt="image" src="https://github.com/user-attachments/assets/89530817-cd94-4128-ad3a-fa1ea05851d6">
As part of creating table view for the dashboards landing page this PR creates the actual table with most of the fields that are present in the mockup (only column left to add is permissions/access column). Switching the toggle to list view will bring you to this page view. I've defaulted to 25 items per page (i'm not sure if there's a different amount we want to use). It's still under the feature flag `dashboards-table-view` which I only have access to atm. <img width="1512" alt="image" src="https://github.com/user-attachments/assets/89530817-cd94-4128-ad3a-fa1ea05851d6">
As part of creating table view for the dashboards landing page this PR creates the actual table with most of the fields that are present in the mockup (only column left to add is permissions/access column). Switching the toggle to list view will bring you to this page view. I've defaulted to 25 items per page (i'm not sure if there's a different amount we want to use). It's still under the feature flag `dashboards-table-view` which I only have access to atm. <img width="1512" alt="image" src="https://github.com/user-attachments/assets/89530817-cd94-4128-ad3a-fa1ea05851d6">
As part of creating table view for the dashboards landing page this PR creates the actual table with most of the fields that are present in the mockup (only column left to add is permissions/access column). Switching the toggle to list view will bring you to this page view. I've defaulted to 25 items per page (i'm not sure if there's a different amount we want to use). It's still under the feature flag
dashboards-table-view
which I only have access to atm.