Skip to content

Conversation

aaronlmathis
Copy link
Owner

Each resource page table had its own custom DataTable.tsx. This was overkill and led to style drift.

Standardized into using UniversalDataTable.tsx and removed drag and drop functionality.

@Copilot Copilot AI review requested due to automatic review settings September 7, 2025 02:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request standardizes data table implementations across the frontend by consolidating custom resource-specific DataTable components into a unified UniversalDataTable component. The change reduces code duplication, eliminates style drift between tables, and removes drag-and-drop functionality.

  • Removes numerous custom DataTable components and replaces them with UniversalDataTable
  • Eliminates drag-and-drop functionality from all data tables
  • Standardizes table styling and behavior across the application

Reviewed Changes

Copilot reviewed 40 out of 65 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/src/components/data_tables/DeploymentsDataTable.tsx Complete removal of custom deployments data table (759 lines deleted)
frontend/src/components/data_tables/DaemonSetsDataTable.tsx Complete removal of custom daemon sets data table (782 lines deleted)
frontend/src/components/data_tables/CronJobsDataTable.tsx Complete removal of custom cron jobs data table (740 lines deleted)
frontend/src/components/data_tables/ConfigMapsDataTable.tsx Complete removal of custom config maps data table (685 lines deleted)
frontend/src/components/data_tables/ClusterRolesDataTable.tsx Complete removal of custom cluster roles data table (615 lines deleted)
frontend/src/components/data_tables/ClusterRoleBindingsDataTable.tsx Complete removal of custom cluster role bindings data table (627 lines deleted)
frontend/src/components/data_tables/CSIDriversDataTable.tsx Complete removal of custom CSI drivers data table (694 lines deleted)
frontend/src/components/data_tables/CRDsDataTable.tsx Complete removal of custom CRDs data table (705 lines deleted)
frontend/src/components/data_tables/ApiResourcesDataTable.tsx Complete removal of custom API resources data table (651 lines deleted)
frontend/src/components/containers/VolumeSnapshotsPageContainer.tsx Migration to UniversalDataTable with new column definitions and filter implementation
frontend/src/components/containers/VolumeSnapshotClassesPageContainer.tsx Migration to UniversalDataTable with new column definitions and filter implementation
frontend/src/components/containers/VirtualServicesPageContainer.tsx Migration to UniversalDataTable with extensive new column definitions and action handlers
frontend/src/components/containers/StorageClassesContainer.tsx Migration to UniversalDataTable with new column definitions and bulk action handlers
frontend/src/components/containers/StatefulSetsPageContainer.tsx Migration to UniversalDataTable with new column definitions and confirmation dialogs
frontend/src/components/containers/ServicesPageContainer.tsx Migration to UniversalDataTable with new column definitions and service type filtering

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

</RouteGuard>
)
return (
<RouteGuard requiredCapabilities={["pods.list"]}>
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The RouteGuard is checking for 'pods.list' capability but this is a VirtualServices page. It should check for virtual service capabilities like 'virtualservices.list' instead.

Suggested change
<RouteGuard requiredCapabilities={["pods.list"]}>
<RouteGuard requiredCapabilities={["virtualservices.list"]}>

Copilot uses AI. Check for mistakes.

header: "Virtual Service Name",
cell: ({ row }: { row: Row<z.infer<typeof virtualServiceSchema>> }) => {
return (
<IfAllowed feature="pods.get" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The authorization check is using 'pods.get' feature but should be checking for 'virtualservices.get' to properly authorize virtual service access.

Suggested change
<IfAllowed feature="pods.get" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
<IfAllowed feature="virtualservices.get" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={

Copilot uses AI. Check for mistakes.

View Details
</DropdownMenuItem>
</IfAllowed>
<IfAllowed feature="pods.patch" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The authorization check is using 'pods.patch' feature but should be checking for 'virtualservices.patch' to properly authorize virtual service editing.

Copilot uses AI. Check for mistakes.

</ResourceYamlEditor>
</IfAllowed>
<DropdownMenuSeparator />
<IfAllowed feature="pods.patch" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The authorization check is using 'pods.patch' feature but should be checking for 'virtualservices.patch' for reload configuration functionality.

Suggested change
<IfAllowed feature="pods.patch" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
<IfAllowed feature="virtualservices.patch" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={

Copilot uses AI. Check for mistakes.

</DropdownMenuItem>
</IfAllowed>
<DropdownMenuSeparator />
<IfAllowed feature="pods.delete" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The authorization check is using 'pods.delete' feature but should be checking for 'virtualservices.delete' to properly authorize virtual service deletion.

Suggested change
<IfAllowed feature="pods.delete" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={
<IfAllowed feature="virtualservices.delete" cluster={clusterId} namespace={row.original.namespace} resourceName={row.original.name} fallback={

Copilot uses AI. Check for mistakes.

Comment on lines +70 to +72
'pods.get',
'pods.patch',
'pods.delete',
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The capabilities being fetched are for pods but this is a virtual services component. Should fetch 'virtualservices.get', 'virtualservices.patch', 'virtualservices.delete' instead.

Suggested change
'pods.get',
'pods.patch',
'pods.delete',
'virtualservices.get',
'virtualservices.patch',
'virtualservices.delete',

Copilot uses AI. Check for mistakes.

@aaronlmathis aaronlmathis merged commit 22fd87b into main Sep 7, 2025
4 checks passed
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.

1 participant