Skip to content

Commit 7d936d7

Browse files
authored
Get rid of @oxide/table alias and barrel file (#1981)
* remove Table * get rid of app/table/react-table. my bad * get rid of the rest of it
1 parent b9a6051 commit 7d936d7

35 files changed

+126
-161
lines changed

app/components/ExternalIps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88

99
import { useApiQuery } from '@oxide/api'
10-
import { EmptyCell, SkeletonCell } from '@oxide/table'
1110
import { intersperse } from '@oxide/util'
1211

12+
import { EmptyCell, SkeletonCell } from '~/table/cells/EmptyCell'
1313
import { CopyToClipboard } from '~/ui/lib/CopyToClipboard'
1414

1515
type InstanceSelector = { project: string; instance: string }

app/components/MoreActionsMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8-
import type { MenuAction } from '@oxide/table'
98
import { DropdownMenu, More12Icon, Tooltip, Wrap } from '@oxide/ui'
109

10+
import type { MenuAction } from '~/table/columns/action-col'
11+
1112
interface MoreActionsMenuProps {
1213
/** The accessible name for the menu button */
1314
label: string

app/pages/ProjectsPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
usePrefetchedApiQuery,
1616
type Project,
1717
} from '@oxide/api'
18-
import { DateCell, linkCell, useQueryTable, type MenuAction } from '@oxide/table'
1918
import {
2019
buttonStyle,
2120
EmptyMessage,
@@ -25,6 +24,10 @@ import {
2524
TableActions,
2625
} from '@oxide/ui'
2726

27+
import { DateCell } from '~/table/cells/DateCell'
28+
import { linkCell } from '~/table/cells/LinkCell'
29+
import type { MenuAction } from '~/table/columns/action-col'
30+
import { useQueryTable } from '~/table/QueryTable'
2831
import { confirmDelete } from 'app/stores/confirm-delete'
2932
import { pb } from 'app/util/path-builder'
3033

app/pages/SiloAccessPage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8+
import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table'
89
import { useMemo, useState } from 'react'
910

1011
import {
@@ -19,7 +20,6 @@ import {
1920
type IdentityType,
2021
type RoleKey,
2122
} from '@oxide/api'
22-
import { createColumnHelper, getActionsCol, Table, useReactTable } from '@oxide/table'
2323
import {
2424
Access24Icon,
2525
Button,
@@ -31,6 +31,8 @@ import {
3131
} from '@oxide/ui'
3232
import { groupBy, isTruthy } from '@oxide/util'
3333

34+
import { getActionsCol } from '~/table/columns/action-col'
35+
import { Table } from '~/table/Table'
3436
import { AccessNameCell } from 'app/components/AccessNameCell'
3537
import { HL } from 'app/components/HL'
3638
import { RoleBadgeCell } from 'app/components/RoleBadgeCell'
@@ -147,7 +149,11 @@ export function SiloAccessPage() {
147149
[siloPolicy, updatePolicy]
148150
)
149151

150-
const tableInstance = useReactTable({ columns, data: rows })
152+
const tableInstance = useReactTable({
153+
columns,
154+
data: rows,
155+
getCoreRowModel: getCoreRowModel(),
156+
})
151157

152158
return (
153159
<>

app/pages/project/access/ProjectAccessPage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
import '@tanstack/react-table'
99

10+
import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table'
1011
import { useMemo, useState } from 'react'
1112
import type { LoaderFunctionArgs } from 'react-router-dom'
1213

@@ -22,7 +23,6 @@ import {
2223
type IdentityType,
2324
type RoleKey,
2425
} from '@oxide/api'
25-
import { createColumnHelper, getActionsCol, Table, useReactTable } from '@oxide/table'
2626
import {
2727
Access24Icon,
2828
Button,
@@ -34,6 +34,8 @@ import {
3434
} from '@oxide/ui'
3535
import { groupBy, isTruthy } from '@oxide/util'
3636

37+
import { getActionsCol } from '~/table/columns/action-col'
38+
import { Table } from '~/table/Table'
3739
import { AccessNameCell } from 'app/components/AccessNameCell'
3840
import { HL } from 'app/components/HL'
3941
import { RoleBadgeCell } from 'app/components/RoleBadgeCell'
@@ -174,7 +176,11 @@ export function ProjectAccessPage() {
174176
[projectPolicy, project, updatePolicy]
175177
)
176178

177-
const tableInstance = useReactTable({ columns, data: rows })
179+
const tableInstance = useReactTable({
180+
columns,
181+
data: rows,
182+
getCoreRowModel: getCoreRowModel(),
183+
})
178184

179185
return (
180186
<>

app/pages/project/disks/DisksPage.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ import {
1515
useApiQueryClient,
1616
type Disk,
1717
} from '@oxide/api'
18-
import {
19-
DateCell,
20-
InstanceLinkCell,
21-
SizeCell,
22-
useQueryTable,
23-
type MenuAction,
24-
} from '@oxide/table'
2518
import {
2619
buttonStyle,
2720
EmptyMessage,
@@ -31,6 +24,11 @@ import {
3124
TableActions,
3225
} from '@oxide/ui'
3326

27+
import { DateCell } from '~/table/cells/DateCell'
28+
import { InstanceLinkCell } from '~/table/cells/InstanceLinkCell'
29+
import { SizeCell } from '~/table/cells/SizeCell'
30+
import type { MenuAction } from '~/table/columns/action-col'
31+
import { useQueryTable } from '~/table/QueryTable'
3432
import { DiskStatusBadge } from 'app/components/StatusBadge'
3533
import { getProjectSelector, useProjectSelector, useToast } from 'app/hooks'
3634
import { confirmDelete } from 'app/stores/confirm-delete'

app/pages/project/floating-ips/FloatingIpsPage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
type FloatingIp,
1818
type Instance,
1919
} from '@oxide/api'
20-
import { InstanceLinkCell, useQueryTable, type MenuAction } from '@oxide/table'
2120
import {
2221
buttonStyle,
2322
EmptyMessage,
@@ -31,6 +30,9 @@ import {
3130
TableActions,
3231
} from '@oxide/ui'
3332

33+
import { InstanceLinkCell } from '~/table/cells/InstanceLinkCell'
34+
import type { MenuAction } from '~/table/columns/action-col'
35+
import { useQueryTable } from '~/table/QueryTable'
3436
import { HL } from 'app/components/HL'
3537
import { getProjectSelector, useProjectSelector } from 'app/hooks'
3638
import { confirmAction } from 'app/stores/confirm-action'

app/pages/project/images/ImagesPage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useState } from 'react'
99
import { Link, Outlet, type LoaderFunctionArgs } from 'react-router-dom'
1010

1111
import { apiQueryClient, useApiMutation, useApiQueryClient, type Image } from '@oxide/api'
12-
import { DateCell, linkCell, SizeCell, useQueryTable, type MenuAction } from '@oxide/table'
1312
import {
1413
buttonStyle,
1514
EmptyMessage,
@@ -21,6 +20,11 @@ import {
2120
TableActions,
2221
} from '@oxide/ui'
2322

23+
import { DateCell } from '~/table/cells/DateCell'
24+
import { linkCell } from '~/table/cells/LinkCell'
25+
import { SizeCell } from '~/table/cells/SizeCell'
26+
import type { MenuAction } from '~/table/columns/action-col'
27+
import { useQueryTable } from '~/table/QueryTable'
2428
import { getProjectSelector, useProjectSelector, useToast } from 'app/hooks'
2529
import { confirmDelete } from 'app/stores/confirm-delete'
2630
import { pb } from 'app/util/path-builder'

app/pages/project/instances/InstancesPage.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ import { useMemo } from 'react'
99
import { Link, useNavigate, type LoaderFunctionArgs } from 'react-router-dom'
1010

1111
import { apiQueryClient, useApiQueryClient, usePrefetchedApiQuery } from '@oxide/api'
12-
import {
13-
DateCell,
14-
InstanceResourceCell,
15-
InstanceStatusCell,
16-
linkCell,
17-
useQueryTable,
18-
} from '@oxide/table'
1912
import {
2013
Button,
2114
buttonStyle,
@@ -27,6 +20,11 @@ import {
2720
TableActions,
2821
} from '@oxide/ui'
2922

23+
import { DateCell } from '~/table/cells/DateCell'
24+
import { InstanceResourceCell } from '~/table/cells/InstanceResourceCell'
25+
import { InstanceStatusCell } from '~/table/cells/InstanceStatusCell'
26+
import { linkCell } from '~/table/cells/LinkCell'
27+
import { useQueryTable } from '~/table/QueryTable'
3028
import { getProjectSelector, useProjectSelector, useQuickActions } from 'app/hooks'
3129
import { pb } from 'app/util/path-builder'
3230

app/pages/project/instances/actions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { useCallback } from 'react'
99
import { useNavigate } from 'react-router-dom'
1010

1111
import { instanceCan, useApiMutation, type Instance } from '@oxide/api'
12-
import type { MakeActions } from '@oxide/table'
1312

13+
import type { MakeActions } from '~/table/columns/action-col'
1414
import { confirmDelete } from 'app/stores/confirm-delete'
1515
import { addToast } from 'app/stores/toast'
1616
import { pb } from 'app/util/path-builder'

0 commit comments

Comments
 (0)