Skip to content
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

Tp2000 1471 task workflow #1298

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Conversation

paulpepper-trade
Copy link
Collaborator

@paulpepper-trade paulpepper-trade commented Sep 20, 2024

TP2000-1471 Task workflows

Why

Discovery and business analysis work has uncovered a core, and probably reasonably stable, set of behaviours around TAP task and workflow integration. Implementing a kernel of that behaviour in software as a type of minimum viable product has advantages including:

  • Providing early feature validation and feedback to minimise waste and help identify / uncover value.
  • Help TAP users think critically about their existing processes.
  • Encourage TAP users to consider proposed workflow integrations and enhancements.
  • Validate technical approaches.
  • Lay down a foundational layer of software on which to build more advanced workflow management and notification features.

What

This PR implements:

  • Task-related models that capture project management-type info
  • Workflow-related models that allow tasks to be grouped and sequenced
  • Workflow templating to allow users to capture details of common workflows for repeated creation and use
  • A persistent Queue Django model, used by workflows and workflow templates for task sequencing
  • Django admin support
  • For each of the key entities of workflows, tasks and subtasks and their template equivalents, view support is added including:
  • List views with filtering and sorting
  • Create new views
  • Details views
  • Edit views
  • Delete views

image

Checklist

  • Requires migrations? Yes
  • Requires dependency updates? No

paulpepper-trade and others added 12 commits August 29, 2024 18:16
* Rename UserAssignment model to TaskAssignee

* Add TaskCategory and TaskProgressState models

* Add parent_task field to Task model

* Add creator field to Task model

* Add TaskLog model

* Don't require that tasks have a workbasket

* Make progress_state a required field on Task model

* Order task category by name and display progress state by value

* Remove Task prefix from Category and ProgressState models

* Remove workflow app
* Register Category model in admin site

* Register ProgressState in admin site

* Register TaskAssignee in admin site

* Register Task model in admin site
* Add initial TaskCreate view & form

* Add initial Task detail view

* Add initial Task edit form & view

* Add initial Task delete view & form

* Add initial Task list view

* Try pre_save signals for TaskLog creation

* Tidy templates

* Allow Task deletion

* Register TaskLog model in admin

* Add test for TaskLog creation

* Rename user group in conftest

* Set up pre_save signal for TaskAssignee to create TaskLog entries

* Persist TaskLog entries after Task deletion

* Add mixins to override Manager and QuerySet methods for pre_save signal handling

* Fix Task delete view

* Move WithSignalManagerMixin and WithSignalQuerysetMixin to common/models/mixins

* Set initial pagination limit for TaskListView
* create 'subtask create form' with predetermined parent

* add test to check that SubtaskCreateForm.save adds correct parent task when creating subtask
… and workflow task items (#1321)

* Split models file and add stubbed queue support.

* Removed queue from base class; Create TaskItem using TaskItemTemplate position

* Amend TaskItem.position exception error message

* Override QueueItem metaclass to enforce queue field on conrete subclasses

* Export queue-related models from tasks

* Implement Queue instance methods using new get_related_objects util method

* Implement QueueItem instance methods

* Add Queue.get_items() and add return type annotations

* Add concrete test-only models for Queue and QueueItem

* Add queue tests

* Add queue and item tests

* Refactor TableLock into a decorator and context manager

* Override QueueItem's model manager create method to set queue positions on behalf of subclasses

* Amend Queue and QueueItem tests

* Docstring updates.

* Support only a single reverse FK relationship to QueueItem for queue instances

* Support default State instance on ProgressState and Task.progress_state

* Remove redundant model manager. Add task and task template util methods.

* Add workflow unit tests.

* Rely on Task.progress_state default in WB assign users view

---------

Co-authored-by: Dale Cannon <[email protected]>
* Implement prototype TaskWorkflowTemplate detail view

* Rename workflow template jinja template

* Add TaskWorkflowTemplateDetailView test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants