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

Job for bulk operations on UserTasks #1057

Merged
merged 11 commits into from
Dec 4, 2024

Conversation

FyreByrd
Copy link

@FyreByrd FyreByrd commented Dec 2, 2024

Handles multiple potential use cases:

  • Reassign tasks from one list of users to another.
  • Delete all tasks for a product/project, optionally limit by user and/or user role.
  • Create new tasks, optionally by user and/or role.
  • Update tasks, optionally by user and/or role. (This is the main one used by workflow)

In all cases, can be applied to either a single product, or all products within a project. Will also refresh the PreExecuteEntries (i.e. blank-ish ProductTransitions that show the ideal path beyond the current workflow state).

IMPORTANT:
If a user has more than one role that could apply to a task, one task will be created for each of those roles.

@FyreByrd FyreByrd force-pushed the feature/bulk-modify-usertasks branch from e5c8c55 to 1c171cf Compare December 4, 2024 20:03
@FyreByrd
Copy link
Author

FyreByrd commented Dec 4, 2024

I added code to add/remove user tasks when:

  • An author is added or removed from a project.
  • UserRoles are changed and that change includes the OrgAdmin role.
  • The owner of a project is reassigned.

@chrisvire
Copy link
Member

Changes:

  1. default of UserTask.Role
  2. Don't show multiple tasks for a user in task last (i.e. a take back task for owner and author download task for author if the user had role of both owner and author).

Handles multiple potential use cases:
- Reassign tasks from one list of users to another.
- Delete all tasks for a product/project, optionally limit by user or user role.
- Create new tasks, optionally by user or role.
- Update tasks, optionally by user or role. (This is the main one used by workflow)

In all cases, can be applied to either a single product, or all products within a project. Will also refresh the PreExecuteEntries (i.e. blank-ish ProductTransitions that show the ideal path beyond the current workflow state).

Updated `databaseWrites/Projects.ts` and `workflow/index.ts` to use the new code.
Will this result in the desired behavior if a user has multiple roles? What if, for some unfathomable reason, a user is both a project owner and an Author on the same project? As of right now, all tasks for that user in that project will be deleted, regardless of role. Should a user be prevented from having more than one role for a project?
Moved the delete tasks up so that they are properly deleted if the workflow is terminated.
Removed unneeded call to create ProductTransitions entries.
@FyreByrd FyreByrd force-pushed the feature/bulk-modify-usertasks branch from 68fcaab to 707310e Compare December 4, 2024 22:31
@FyreByrd
Copy link
Author

FyreByrd commented Dec 4, 2024

Resolved merge conflicts

@FyreByrd FyreByrd merged commit c4c019e into feature/svelte Dec 4, 2024
2 checks passed
@FyreByrd FyreByrd deleted the feature/bulk-modify-usertasks branch December 4, 2024 22:32
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.

2 participants