DT-68: Implement frontend data loading for deployment tables#69
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements frontend data loading for deployment tables by integrating backend API calls for schema and table data retrieval. The changes enable dynamic loading of database schemas and table contents with filtering, sorting, and search capabilities.
Key Changes:
- Added API signal integration for fetching deployment schema and table data
- Implemented reactive effects to trigger data fetches based on URL parameter changes
- Enhanced UI components with improved styling, accessibility, and user feedback
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web/pages/DeploymentPage.tsx | Core implementation of schema/table data loading with API signals, filter/sort parsing, and UI enhancements for tables and left panel |
| web/components/Filtre.tsx | Exported parseFilters and parseSort functions for external use |
| api/routes.ts | Changed table data endpoint from GET to POST method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <button | ||
| type='button' | ||
| class='btn btn-ghost btn-xs' | ||
| disabled={schema.pending !== undefined} |
There was a problem hiding this comment.
The disabled condition schema.pending !== undefined is incorrect. A signal's pending property is typically a boolean, so this should be disabled={schema.pending} or disabled={!!schema.pending}.
| disabled={schema.pending !== undefined} | |
| disabled={!!schema.pending} |
| effect(() => { | ||
| const { dep, tab, table, tq } = url.params | ||
| if (dep && tab === 'tables') { | ||
| const tableName = table || schema.data?.tables?.[0]?.table |
There was a problem hiding this comment.
The fallback to the first table may cause unintended behavior if schema.data.tables changes while a different table is selected. This could trigger unnecessary fetches. Consider checking if tableName exists before proceeding with the fetch.
| const tableName = table || schema.data?.tables?.[0]?.table | |
| const tables = schema.data?.tables || [] | |
| let tableName: string | undefined | |
| if (table) { | |
| // Only use the table if it exists in the schema | |
| tableName = tables.find((t) => t.table === table)?.table | |
| } | |
| if (!tableName && tables.length > 0) { | |
| tableName = tables[0].table | |
| } |
3489c62 to
93e0e2b
Compare
51805fb to
3b86820
Compare
93e0e2b to
8da793c
Compare
3b86820 to
1dc16e2
Compare
63f91e0 to
e8ca19c
Compare
…ata retrieval feat(Filtre): export parseFilters and parseSort functions for external use feat(DeploymentPage): integrate filter and sort functionality for deployment table data
ee8515e to
b958ae2
Compare
3bfe3c3
into
66-implementation-of-table-data-fetching-and-filtering
* feat(routes): add new endpoint for retrieving deployment table data * docs(routes): add comment for deployments in route definitions * feat(routes): add new endpoint for retrieving deployment table data * docs(routes): add comment for deployments in route definitions * feat(routes): add POST endpoint for fetching deployment table data with filtering and sorting * feat(schema, sql): add columnsMap to DatabaseSchemaDef and update fetchTablesData to use it * DT-68: Implement frontend data loading for deployment tables (#69) * feat(routes): change endpoint from GET to POST for deployment table data retrieval feat(Filtre): export parseFilters and parseSort functions for external use feat(DeploymentPage): integrate filter and sort functionality for deployment table data * feat(DeploymentPage): refactor data fetching and improve table display logic * feat(DeploymentPage): refactor layout and improve component structure * fix(DeploymentPage): correct parameter name from tq to qt for search functionality
No description provided.