Skip to content

fix(task): create a default task type for new project types - #11123

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/custom-tracker-type-default-task
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/custom-tracker-type-default-task

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

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.

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

No deployments
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.

Custom tracker space type's not getting a default issue type

1 participant