Allow links in row actions and more actions dropdowns#2751
Allow links in row actions and more actions dropdowns#2751david-crespo merged 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| onActivate() { | ||
| navigate(pb.serialConsole({ project, instance: instance.name })) | ||
| }, | ||
| to: pb.serialConsole({ project, instance: instance.name }), |
There was a problem hiding this comment.
This is the narrow change asked for on behalf of an external user in #1855. This allows serial console to be opened in a new tab from both instance list row actions and instance detail "more actions".
| <MoreActionsMenu label="Router actions" actions={actions} /> | ||
| <MoreActionsMenu label="Router actions"> | ||
| <CopyIdItem id={routerData.id} /> | ||
| </MoreActionsMenu> |
There was a problem hiding this comment.
net negative lines speak for themselves I think
| })} | ||
| className="destructive" | ||
| /> | ||
| </MoreActionsMenu> |
There was a problem hiding this comment.
This shows why the children approach is nice. There's no config object where you then elsewhere have to decide what it renders. You just render those things directly.
d27468f to
dffc1ca
Compare
dffc1ca to
48cb2bd
Compare
| /> | ||
| ) | ||
| )} | ||
| </MoreActionsMenu> |
There was a problem hiding this comment.
This is the one spot where we are adding some noise, because this is the one spot where we were passing the same set of action config objects to RowActions in one place (instance list) and MoreActionsMenu in another (here, instance detail). Because MoreActionsMenu has been converted to take children directly, we have to do the conversion to elements here. Maybe this should be extracted since it's the same as what RowActions does internally....
| export const RowActions = ({ id, copyIdLabel = 'Copy ID', actions }: RowActionsProps) => { | ||
| return ( | ||
| <DropdownMenu.Root> | ||
| {/* TODO: This name should not suck; future us, make it so! */} |
There was a problem hiding this comment.
This comment is from May 2022 #883 and refers to the aria label "Row actions", which tbh I don't see anything wrong with. That's what they are.
|
Tolerable external link icon, @benjaminleonard? (I changed it to "about this metric" — somehow "about metric" felt like a typo.)
|
| <Link className={cn('DropdownMenuItem ox-menu-item', className)} to={to}> | ||
| {children} | ||
| <Link className={cn('DropdownMenuItem ox-menu-item', className)} to={to} {...ext}> | ||
| {children} {ext ? <OpenLink12Icon className="ml-1.5" /> : null} |
oxidecomputer/console@eed4a4e...72e2f0c * [72e2f0c1](oxidecomputer/console@72e2f0c1) oxidecomputer/console#2754 * [af255e6b](oxidecomputer/console@af255e6b) bump omicron to latest main * [7cdb9ccb](oxidecomputer/console@7cdb9ccb) oxidecomputer/console#2753 * [27cf6799](oxidecomputer/console@27cf6799) oxidecomputer/console#2751 * [1cfb3b22](oxidecomputer/console@1cfb3b22) oxidecomputer/console#2752 * [6db63364](oxidecomputer/console@6db63364) oxidecomputer/console#2750 * [5241ad74](oxidecomputer/console@5241ad74) oxidecomputer/console#2748
oxidecomputer/console@eed4a4e...72e2f0c * [72e2f0c1](oxidecomputer/console@72e2f0c1) oxidecomputer/console#2754 * [af255e6b](oxidecomputer/console@af255e6b) bump omicron to latest main * [7cdb9ccb](oxidecomputer/console@7cdb9ccb) oxidecomputer/console#2753 * [27cf6799](oxidecomputer/console@27cf6799) oxidecomputer/console#2751 * [1cfb3b22](oxidecomputer/console@1cfb3b22) oxidecomputer/console#2752 * [6db63364](oxidecomputer/console@6db63364) oxidecomputer/console#2750 * [5241ad74](oxidecomputer/console@5241ad74) oxidecomputer/console#2748



Closes #1855
Closes #2174
It's more noisy than it needs to be because I also cleaned up some duplicated logic that didn't need to exist — notice there are net deletes despite the increase in functionality. I think I would like to convert
RowActionsto taking elements directly as children as well instead of using these action config objects we have to memoize, but that would be too much churn for this PR: we have row actions in like 20 files.