-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
[5.x] Run actions from publish forms #6375
Conversation
|
Hey @jacksleight, there's a merge conflict now. If you're still interested in this, can you rebase off 3.4 and resolve? I've mark this as draft in the meantime. |
PR Summary
|
I ended up on this PR while Googling. Just to make sure that I understand, the PR will allow us to run action within an entry? Will it allow us to restrict an action to be run only on 1 entry instead of the list view? |
Yep.
Yes, within the action's |
Would love this one to be merged - just wanted the same thing but for users! |
Yeah I think it'd be a nice feature to have. At the moment this PR only covers entries, the intention is to add the other types as well but there are a few implementation details I'm not too sure about right now. |
Isn't naming tough?
I'd just call it
Naming it just
Can we have a |
This could happen if the state of the entry causes different actions to be available. For example when its published, the unpublished action is visible but not the publish action, and visa versa.
…o be consistent with saving. Maybe third party actions will.
When the form is dirty, a warning will be shown. The message will be generic, unless overridden on the action, like the Duplicate action is doing. Actions can opt out of the dirty state navigate-away dialog, like the Delete action is doing. In those cases, the warning won't be shown either.
…e sending password reset.
…ore sense on the user form.
Because that's the release statamic/cms#6375 is included in.
* Refactor extracting values & field meta into trait * Add actions dropdown to publish form * Update delete & duplicate actions to support publish form actions * Fix test The `values` key now returns an array, instead of a collection. * Fix styling * Title on publish form should be the resource's title field * we don't have revisions, so we don't need this * Require Statamic 5.3.0 Because that's the release statamic/cms#6375 is included in. --------- Co-authored-by: duncanmcclean <duncanmcclean@users.noreply.github.com>
This PR allows you to run all actions from the entry, term and user publish forms and the asset editor.
Some implementation details:
view
key in the action context which will either have a value oflist
orform
. This allows actions to display or behave differently depending on where they’re being used.extractFromFields
methods. Maybe they could be refactored so both controllers can use them?extractFromFields
methods returnmeta
values, but they’re not being passed back to the publish forms after save. I have copied that behaviour for actions, but I think they should be included so that all values display correctly?divider
styles so they're hidden if they come first, last or directly after another. This is required to avoid unnecessary dividers in the menu when you don’t have permissions for all options.Closes statamic/ideas#712