Skip to content

Migrate data planes settings table to GraphQL - #2034

Draft
GregorShear wants to merge 1 commit into
mainfrom
worktree-claude+data-planes-table-gql
Draft

Migrate data planes settings table to GraphQL#2034
GregorShear wants to merge 1 commit into
mainfrom
worktree-claude+data-planes-table-gql

Conversation

@GregorShear

Copy link
Copy Markdown
Contributor

Summary

Migrates the Data Planes admin settings table from PostgREST to the existing useDataPlanes() GraphQL hook, following the storage mappings migration (#2031). This removes the second of the two remaining PostgREST data-plane fetches (the workflow/details-form path is left for a follow-up).

  • Fetch via useDataPlanes() and filter by scope/tenant client-side, dropping the per-scope PostgREST prefetch (getDataPlanesForTable), TableHydrator, EntityTable, and the DATA_PLANE selectable-table store plumbing (invariableStores entry, SelectTableStoreNames.DATA_PLANE, TablePrefixes.dataPlanes).
  • Render a plain MUI Table. The public/private toggle is now a pure client-side filter, so ToggleDataPlaneScope no longer has to force the shared store into a loading state.
  • Consume DataPlaneNode directly in Rows and the details dialog — name via toPresentableName, region via the cloudProvider/region fields — instead of re-parsing the data-plane name string.
  • Inline the touched component strings and prune the now-dead react-intl keys.

Not in scope (follow-up)

The workflow/details-form path (getDataPlaneOptions + useEvaluateDataPlaneOptions + the @deprecated parse utils generateDataPlaneOption/parseDataPlaneName/formatDataPlaneName/getDataPlaneScope) still uses PostgREST. It's blocked on the GraphQL DataPlane node lacking id/reactorAddress, which DataPlaneOption needs. Once that path is migrated, src/api/dataPlanes.ts and the deprecated utils can be deleted outright.

Test plan

  • npm run typecheck
  • npm run lint
  • npx vitest run (271 passed)
  • Manual: verify the admin Data Planes table (public + private toggle) renders and the detail dialog opens

Replace the PostgREST-backed DataPlanes admin table with the existing useDataPlanes() GraphQL hook, following the storage mappings migration (#2031).

- Fetch via useDataPlanes() and filter by scope/tenant client-side, dropping the per-scope PostgREST prefetch, TableHydrator, EntityTable, and the DATA_PLANE selectable-table store plumbing (invariableStores entry, SelectTableStoreNames.DATA_PLANE, TablePrefixes.dataPlanes).
- Render a plain MUI Table; the public/private toggle is now a pure client-side filter, so ToggleDataPlaneScope no longer forces the shared store into a loading state.
- Consume DataPlaneNode directly in Rows and the details dialog (name via toPresentableName, region via cloudProvider/region fields), removing the deprecated name-parsing path for this table.
- Remove getDataPlanesForTable from src/api/dataPlanes.ts and inline the touched component strings, pruning the now-dead react-intl keys.

The workflow/details-form path (getDataPlaneOptions and the deprecated parse utils) still uses PostgREST and is left for a follow-up.
@github-actions

Copy link
Copy Markdown

⚪ Code Health

No change to the dead-code surface.

48 Unused files

File imported nowhere — delete (or import) it.

     src/hooks/useDelay.ts
     src/hooks/useDraft.ts
     src/pages/NoGrants.tsx
     src/pages/OAuth.tsx
     src/services/encryption.ts
     src/types/global.ts
     src/types/vitest.ts
     src/context/LoopIndex/index.tsx
     src/context/LoopIndex/shared.ts
     src/context/LoopIndex/types.ts
…and 38 more

64 Unused exports

Exported symbol with no references outside its own file — un-export it, or delete it if unused entirely

     src/context/Theme.tsx : logoColors
     src/context/Theme.tsx : intensifiedOutlineThick
     src/context/Theme.tsx : tableAlternateRowsSx
     src/context/Theme.tsx : draggableChipIconSx
     src/context/Theme.tsx : hiddenButAccessibleInput
     src/context/Theme.tsx : primaryColoredBackground_hovered
     src/context/Theme.tsx : detailsPanelBgColor
     src/context/Theme.tsx : menuBackgroundColor
     src/context/Theme.tsx : flexGrowToSiblingsSx
     src/context/Theme.tsx : shardTableRow
…and 54 more

26 Unused exported types

Exported type with no references outside its own file — un-export it, or delete it if unused entirely

     src/utils/billing-utils.ts : FREE_GB_BY_TIER
     src/types/index.ts : InferredSchemas
     src/types/index.ts : Shard
     src/components/shared/WizardDialog/index.ts : WizardStep
     src/api/dataPlanes.ts : AwsDnsEntry
     src/stores/ShardDetail/types.ts : TaskShardDetailsWithShard
     src/stores/ShardDetail/types.ts : ShardDetails
     src/components/tables/Logs/types.ts : RefreshLogsFunction
     src/types/schemaModels.ts : CollectionSchema
     src/components/editor/Bindings/types.ts : SelectedCollectionChangeData
…and 16 more

14 Unused exported enum members

An enum member referenced nowhere

     src/services/supabase.ts : CONNECTOR_TAGS
     src/services/supabase.ts : DRAFTS_EXT
     src/services/supabase.ts : TASKS_BY_DAY
     src/stores/Tables/hooks.ts : accessGrants
     src/stores/Tables/hooks.ts : accessLinks
     src/stores/Tables/hooks.ts : billing
     src/stores/Tables/hooks.ts : connectors
     src/stores/Tables/hooks.ts : entitySelector
     src/stores/Tables/hooks.ts : prefixes
     src/stores/Tables/hooks.ts : prefixAlerts
…and 4 more

5 Unused dependencies

In package.json but never imported

     package.json : @mui/lab
     package.json : @testing-library/jest-dom
     package.json : @urql/exchange-retry
     package.json : logrocket-react
     package.json : stripe

3 Unused devDependencies

In package.json devDependencies but never used

     package.json : @types/logrocket-react
     package.json : @types/react-inspector
     package.json : sharp

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