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
Add workflow actions to the Wagtail userbar #9106
Comments
Hi |
Go for it @Lovelyfin00 - we will also need to ensure there are new unit tests for this behaviour. It's likely some existing tests exist for the userbar legacy moderation buttons. |
Ok |
@Lovelyfin00 this may not be a good first issue sorry - but have a read of the issue in full and try to reproduce the problem, then also read all the links to get more context. I'll try to find the PR that implemented workflow and add a link to it. |
@Lovelyfin00 before you claim an issue, please make sure that you do have the appropriate skillset to do so! It takes a lot of time to curate issues so the problems are well described and potential solutions also covered. @lb- has already added plenty of details in the original description, and I don’t think there is much more to be said about this until you or someone else has done their own research. If you’re still feeling very new to this – please do consider the good first issues only. They’re specially made so as to be approachable with very little background on how Wagtail works. |
We’ve discussed this in today’s core team meeting – since this has been broken for such a long time, it’s unclear to us whether this is a bug for us to fix or dead code to remove and move on. If any projects out there rely on this, or would want to rely on this if it worked, please let us know. I’m not sure whether this code had ever been adapted to support workflows, so there may be quite a bit of work needed to make this happen. In particular I believe reject/approve support adding a comment everywhere else in the CMS, not sure whether it’d be a requirement to do this for the userbar too. |
Per my comment on #10968 (comment), I don't think this is a bug. Workflows can have custom tasks which can use custom forms, so approving/rejecting a task may require additional user input instead of just a click of a button. Adding approve and reject items to the userbar would require the ability to render the modal dialog for the workflow approve/reject views rendered by https://github.com/wagtail/wagtail/blob/main/wagtail/admin/views/generic/workflow.py. This might be easier to do once #9246 is done, as that means such modals will use the a11y-dialog, which is already included in the userbar as part of the accessibility checker. And yes, we should remove the unused code for the legacy moderation system's userbar items. I've started #10968 to deprecate them so that they can be removed in the next major release. Labelling as Enhancement. |
Thanks @thibaudcolas & @laymonage - this all makes sense. Thanks for updating the issue and labels. |
Issue Summary
Steps to Reproduce
Potentially broken since Wagtail 2.10
Potential solution
The wagtailuserbar template tag is in https://github.com/wagtail/wagtail/blob/main/wagtail/admin/templatetags/wagtailuserbar.py#L65-L74
wagtail/wagtail/admin/templatetags/wagtailuserbar.py
Lines 65 to 74 in 849d4d7
This instantiates the classes
ApproveModerationEditPageItem
&RejectModerationEditPageItem
which are declared in https://github.com/wagtail/wagtail/blob/main/wagtail/admin/userbar.pywagtail/wagtail/admin/userbar.py
Lines 107 to 126 in 849d4d7
Ideally this logic would be updated to be similar to the logic used in the Dashboard (home) listing to determine the workflow state. Using something like
revision.submitted
submitted_for_moderation
would be good to do also.Technical details
The text was updated successfully, but these errors were encountered: