-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use type column from db for resource list table (#332)
### TL;DR Refactor the handling of resource types in the dashboard components to use the "type" field directly from the data source instead of deriving it from other fields. ### What changed? - Modified `ResourceTable`, `ResourceTableMenu`, and `TitleCell` components to use the `type` field directly. - Updated the `ResourceTableMenuProps` and `TitleCellProps` interfaces to align with the new data structure. - Adjusted the server-side `page.router` to include the `Resource.type` field in queries. - Removed the outdated `ResourceType` type and `getResourceType` function. - Updated mock data in `msw` handlers to include the `type` field. ### How to test? 1. Verify that the dashboard displays resources correctly, with the appropriate icons and menu items for each resource type. 2. Check the functionality of resource-specific actions, such as editing page settings. 3. Ensure API responses include the `type` field and components consume it properly. ### Why make this change? This refactor simplifies the code by reducing the need to derive the resource type from other fields and aligns the front-end representation directly with the back-end data model.
- Loading branch information
Showing
6 changed files
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters