Repository navigation
fix(task): create a default task type for new project types - #11123
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
Creating a project type from Settings (for example a new tracker space type) called createProjectType with an empty task type list. The new type therefore had no task type and no statuses, so issues created in projects of that type had no type and misbehaved in the UI. CreateProjectType now passes a default task type to createProjectType, so the type is created together with it. The task type uses the first allowed (or, if unrestricted, any enabled) creatable task type descriptor. If a built-in (system) project type of the same descriptor has a task type of that descriptor (classic tracker Issue, default vacancy Applicant, default funnel), it is used as a template: its kind, sub-task setting and statuses are reused, limited to the status categories the descriptor reports for the new type (e.g. a non-classic tracker type gets Backlog, In Progress, Done, Canceled). Otherwise a generic task type with one default status per category is created. statusCategoriesFunc receives the fully built project type value that is about to be created. The pure parts live in makeTaskTypeFromTemplate and makeDefaultTaskType in @hcengineering/task, covered by unit tests. Fixes hcengineering#8920 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8920
Problem and change
Creating a project type from Settings (for example a new tracker space type) called createProjectType with an empty task type list. The new type therefore had no task type and no statuses, so issues created in projects of that type had no type and misbehaved in the UI.
CreateProjectType now passes a default task type to createProjectType, so the type is created together with it. The task type uses the first allowed (or, if unrestricted, any enabled) creatable task type descriptor. If a built-in (system) project type of the same descriptor has a task type of that descriptor (classic tracker Issue, default vacancy Applicant, default funnel), it is used as a template: its kind, sub-task setting and statuses are reused, limited to the status categories the descriptor reports for the new type (e.g. a non-classic tracker type gets Backlog, In Progress, Done, Canceled). Otherwise a generic task type with one default status per category is created. statusCategoriesFunc receives the fully built project type value that is about to be created. The pure parts live in makeTaskTypeFromTemplate and makeDefaultTaskType in @hcengineering/task, covered by unit tests.
Tests
New unit tests
plugins/task/src/__tests__/defaultTaskType.test.ts. Checked manually on a self-hosted instance: a new tracker space type immediately has an "Issue" task type with Backlog/Todo/In Progress/Done/Canceled; a project of that type, an issue and a sub-issue can be created.Notes
Deleting a space type still leaves its task types and mixins behind; that is existing behaviour of the space type deletion and not changed here.