-
Notifications
You must be signed in to change notification settings - Fork 13
More table conversions #2115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More table conversions #2115
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Oh, capitalization; fun times. |
Looks great pending the casing fixes. You should also be able to delete |
app/pages/project/vpcs/VpcsPage.tsx
Outdated
cell: (info) => <DateCell value={info.getValue()} />, | ||
}), | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one, on the other hand, has a column that can't be defined outside of render because it relies on project
. In this case, we need to memoize.
const columns = useMemo(() => [
colHelper.accessor('name', { cell: makeLinkCell((vpc) => pb.vpc({ project, vpc }))}),
colHelper.accessor('dnsName', { header: 'DNS name' }),
colHelper.accessor('description', {}),
colHelper.accessor('timeCreated', {
header: 'created',
cell: (info) => <DateCell value={info.getValue()} />,
}),
getActionsCol(makeActions)
], [project, makeActions])
There's no point using useColsWithActions
here — all it really does is wrap that useMemo
. We may find we're using useColsWithActions
in so few places after this change that we should just get rid of it.
In theory we could move the four statically definable columns out of here and spread them in with ...staticCols
, but I don't think the misdirection is worth it. Because of the useMemo
they are only ever defined once anyway.
app/pages/ProjectsPage.tsx
Outdated
} | ||
|
||
const colHelper = createColumnHelper<Project>() | ||
const projectsPageStaticCols = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but for future reference I think the long name is overkill in files where there's only one, which is nearly all of them. It's actually kind of nice for them all to have the same name; it's like export const loader
in a remix app.
We did it. |
oxidecomputer/console@156c082...b22ca1d * [b22ca1dc](oxidecomputer/console@b22ca1dc) add loop comment to scp-assets * [99173b92](oxidecomputer/console@99173b92) bump omicron script: automatically run gh run watch when assets aren't ready * [2cfc8ee7](oxidecomputer/console@2cfc8ee7) oxidecomputer/console#2076 * [11411bb8](oxidecomputer/console@11411bb8) oxidecomputer/console#2121 * [1f8b25d7](oxidecomputer/console@1f8b25d7) oxidecomputer/console#2119 * [95f2e49e](oxidecomputer/console@95f2e49e) oxidecomputer/console#2108 * [8e3a2005](oxidecomputer/console@8e3a2005) oxidecomputer/console#2116 * [bf592a31](oxidecomputer/console@bf592a31) oxidecomputer/console#2105 * [b63c81ea](oxidecomputer/console@b63c81ea) oxidecomputer/console#2115 * [d5d70bd7](oxidecomputer/console@d5d70bd7) oxidecomputer/console#2113 * [1954709e](oxidecomputer/console@1954709e) oxidecomputer/console#2112 * [4db8d830](oxidecomputer/console@4db8d830) oxidecomputer/console#2111 * [9485ca23](oxidecomputer/console@9485ca23) Revert "Revert "Change all uses of RHF `<Controller>` to `useController` (oxidecomputer/console#2102)""
oxidecomputer/console@156c082...b22ca1d * [b22ca1dc](oxidecomputer/console@b22ca1dc) add loop comment to scp-assets * [99173b92](oxidecomputer/console@99173b92) bump omicron script: automatically run gh run watch when assets aren't ready * [2cfc8ee7](oxidecomputer/console@2cfc8ee7) oxidecomputer/console#2076 * [11411bb8](oxidecomputer/console@11411bb8) oxidecomputer/console#2121 * [1f8b25d7](oxidecomputer/console@1f8b25d7) oxidecomputer/console#2119 * [95f2e49e](oxidecomputer/console@95f2e49e) oxidecomputer/console#2108 * [8e3a2005](oxidecomputer/console@8e3a2005) oxidecomputer/console#2116 * [bf592a31](oxidecomputer/console@bf592a31) oxidecomputer/console#2105 * [b63c81ea](oxidecomputer/console@b63c81ea) oxidecomputer/console#2115 * [d5d70bd7](oxidecomputer/console@d5d70bd7) oxidecomputer/console#2113 * [1954709e](oxidecomputer/console@1954709e) oxidecomputer/console#2112 * [4db8d830](oxidecomputer/console@4db8d830) oxidecomputer/console#2111 * [9485ca23](oxidecomputer/console@9485ca23) Revert "Revert "Change all uses of RHF `<Controller>` to `useController` (oxidecomputer/console#2102)""
This PR finishes the QueryTable move from
~/table/QueryTable
to~/table/QueryTable2
(though — not to be confusing — it also renames the file~/table/QueryTable2
back to~/table/QueryTable
.All tests are passing and I clicked through to check that the tables are still rendering their data correctly. Will look for a few more optimizations / refactors in this, but I it's ready for review.