0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
Commit Graph

10065 Commits

Author SHA1 Message Date
jacobtoppm
03b6b2f665 Make copy mixin methods work with m2m links with through classes with ParentalKeys: these are now checked for, and left for the copying child objects stage of copying 2020-07-24 16:59:33 +01:00
jacobtm
02a706581e Refactor common copy method mixin from Page and TaskState 2020-07-24 16:59:33 +01:00
jacobtm
0d5c2d6a30 Move removal of triggering user from notification recipients outside if condition 2020-07-24 16:59:33 +01:00
jacobtm
b48c281c8c Re-add safe filter to plain text templates 2020-07-24 16:59:33 +01:00
jacobtm
23ccdb836c Add preview link to actions for dashboard panel, and tidy indentation 2020-07-24 16:59:33 +01:00
jacobtm
4380e4c90e Add workflow pages to moderate dashboard panel 2020-07-24 16:59:33 +01:00
jacobtm
db54d567d6 Add dashboard panel showing pages that the user has submitted for moderation, or that are owned by the user. Add helper function to determine the started_at of a successive run of TaskStates - useful when page has been edited multiple times, so the same task has resumed 2020-07-24 16:59:33 +01:00
jacobtm
007526f77f Only show workflow warning that tasks may need re-approval if WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT=True 2020-07-24 16:59:33 +01:00
jacobtm
3040adccda Remove cached_property decorator. May be worth replacing for efficiency, but was leading to outdated workflow states being updated when a page object was referenced multiple times, which is problematic. Fixed WorkflowState.update method to accept a next_task argument that is the same as the current task without failing. Fix test syntax, and add new tests for copied-forward tasks 2020-07-24 16:59:33 +01:00
jacobtm
8a0b1cb971 Add new setting, WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT, which if False will cause copies of previously approved TaskStates (but with page_revision set to the new revision) on saving a revision. Fix mutable argument in copy. 2020-07-24 16:59:33 +01:00
jacobtm
9cbe66fba6 Add a copy method to TaskState, and add a kwarg to WorkflowState.update allowing the next task to start to be specified. Use this to restart a task when the page is edited. 2020-07-24 16:59:33 +01:00
jacobtm
8d9e085394 Add a resume kwarg to cancel, forcing the current task to restart rather than moving back to the beginning of the workflow when cancelled 2020-07-24 16:59:33 +01:00
jacobtm
5cab96e092 Cancel current task state on page revision save, to force a new task state to start with the current revision 2020-07-24 16:59:33 +01:00
jacobtm
f561cb2e12 Add workflow deletion view 2020-07-24 16:59:33 +01:00
jacobtm
ddaa5a6cd8 Remove unused imports 2020-07-24 16:59:33 +01:00
jacobtm
41881f7ff9 Prevent notifications for cancelled then restarted tasks 2020-07-24 16:59:33 +01:00
Karl Hobley
4cf8225f3b Run Workflow.start() in a transaction 2020-07-24 16:59:33 +01:00
jacobtm
61e17f8445 Remove capitalisation 2020-07-24 16:59:33 +01:00
jacobtm
213bf132b6 Check simply for presence of show_disabled in query parameters rather than converting string to bool 2020-07-24 16:59:33 +01:00
jacobtm
9936b4531d Change can_delete to can_disable 2020-07-24 16:59:33 +01:00
jacobtm
31e9572598 Check for a not-None pk for ExcludeFieldsOnEditMixin to avoid catching non-saved instance binding 2020-07-24 16:59:33 +01:00
jacobtm
2db605df09 Make workflow and task disable warning messages compatible with translation 2020-07-24 16:59:33 +01:00
jacobtm
73b02e4ab1 Re-add rejected and approved notifications for compatibility 2020-07-24 16:59:33 +01:00
jacobtm
3a361c9665 Prevent multiple TaskState approvals/rejections. Allow TaskState to be passed through to workflow_action to prevent race conditions: ie reviewer approving while in the meantime edits have been made. Add a new task preview view to allow preview of the revision in moderation in a specific task. 2020-07-24 16:59:33 +01:00
jacobtm
4c66ebe36d Remove marking title as safe in html and add missing context in blocktrans 2020-07-24 16:59:33 +01:00
jacobtm
fe11259684 Add further docstrings to Notifier classes 2020-07-24 16:59:33 +01:00
jacobtm
97adc2d44d Make signals work with new Notifier subclasses 2020-07-24 16:59:33 +01:00
jacobtm
c825852049 Refactor a more abstract general notification class out, Notifier 2020-07-24 16:59:33 +01:00
jacobtm
ceb17fa849 Remove Notifier submit, reject, approve methods, and replace with specific subclasses of Notifier 2020-07-24 16:59:33 +01:00
jacobtm
21cc989913 Refactor can_handle_class and can_handle_notification into just can_handle for simplicity 2020-07-24 16:59:33 +01:00
jacobtm
2f8c5d3e0a Remove unused js 2020-07-24 16:59:33 +01:00
jacobtm
3f9248f195 Remove dead workflow-action code 2020-07-24 16:59:33 +01:00
jacobtm
443983a064 Make workflow_status.html compatible with translation 2020-07-24 16:59:33 +01:00
jacobtm
bb61668b49 Rename tests for consistency 2020-07-24 16:59:33 +01:00
jacobtm
7093b5a0d8 Add tests for disabling and enabling tasks and workflows 2020-07-24 16:59:33 +01:00
jacobtm
0ac9003860 Amend empty wording for index views depending on whether disabled tasks are shown 2020-07-24 16:59:33 +01:00
jacobtm
731dc95ffd Save deactivated tasks before cancelling in progress states so that WorkflowState.get_next_task does not incorrectly find the deactivating task 2020-07-24 16:59:33 +01:00
jacobtm
eb1a0e3a05 Add a way to deactivate tasks and workflows. When deactivated, in progress TaskStates and WorkflowStates are cancelled. Preventing deletion preserves history. Inactive Tasks on a Workflow will not be started. 2020-07-24 16:59:33 +01:00
jacobtm
48d22b8cea Add ExcludeFieldsOnEditMixin for edit handlers, disabling specific fields when bound to an existing instance rather than creating a new one 2020-07-24 16:59:33 +01:00
jacobtm
759228d37d Add workflow deletion view 2020-07-24 16:59:33 +01:00
jacobtm
a181a85820 Re-add SimpleTask model to testapp 2020-07-24 16:59:33 +01:00
jacobtm
33f9bbf586 Add tests for actions and notifications 2020-07-24 16:59:33 +01:00
jacobtm
009451fbc2 Remove debugging, pass **kwargs into every function 2020-07-24 16:59:33 +01:00
jacobtm
130cf3f94c Rename notification templates to match expected format and tweak wording 2020-07-24 16:59:33 +01:00
jacobtm
3ba0e7cad1 Pass user through workflow/task methods 2020-07-24 16:59:33 +01:00
jacobtm
662446ee04 Fix errors preventing mail sending; configure to work with signals sent on workflow events 2020-07-24 16:59:33 +01:00
jacobtm
cfeef13cfd Add GroupApprovalTaskStateNotifier 2020-07-24 16:59:33 +01:00
jacobtm
8f5535d5bb Add workflow state notification function 2020-07-24 16:59:33 +01:00
jacobtm
7997cb6766 Use pre-opened connection to send multiple notification emails, preventing inefficiency of opening and closing connection for each email 2020-07-24 16:59:33 +01:00
jacobtm
6e68905021 First draft of group approval task and workflow email templates 2020-07-24 16:59:33 +01:00