-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Data views]: Add quick actions #55488
Conversation
Size Change: +377 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in 88de12e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6638255768
|
@@ -17,6 +23,11 @@ export default function useMoveToTrashAction() { | |||
() => ( { | |||
id: 'move-to-trash', | |||
label: __( 'Move to Trash' ), | |||
type: ACTION_TYPES.primary, | |||
icon: trash, | |||
isEligible( { status } ) { |
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 made me think of this interaction in wp-admin:
Gravacao.do.ecra.2023-10-19.as.17.17.05.mov
Perhaps we should add deletePermanently
action and make it available for every page (just as secondary)?
deletePermanently
would probably require a different interaction (modal to confirm). It could be valuable to showcase what actions can do.
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.
Exactly! I didn't add any of those for now, because we can start adding actions incrementally, after we land the main PR. What you mentioned though and the restore
should be a quick follow up.
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.
I presume you are waiting for design feedback to land this, I'll let others do that. From a code point of view, this could be merged – though I left some comments.
If you'd rather land parts of this PR before the design conversation settles, one thing we could do is merge everything but the type
feature (more actions available, isEligible, renaming things).
Good question, and I'd welcome feedback on it. That said we may not need to prioritise it here since all pages should have the 'Edit' and 'Rename' actions. Some minor notes:
|
0deb7f1
to
88de12e
Compare
@jameskoster I addressed the feedback, but didn't handle this one:
Let's do this in a follow up, to get the actions API in. This way we can iterate and in parallel others could add more actions.
The page opens in the same page for consistency with the current pages list. If you have an icon to suggest, we can update easily. |
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.
LGTM 👍
What?
Resolves: #55096
This PR adds quick actions in data views items. The idea is that an item can have primary and secondary actions. The API was updated with a new
isEligible
property, which handles the rendering or not of an action per item. This is needed because not all of the items can have the same actions.Design notes
This PR will need some design tweaks - at least:
grid
viewTesting Instructions
Screenshots or screencast