From 808d484a3c4a452fb72af4a745df2a6b9c69c9e4 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Sat, 10 Feb 2024 19:04:53 +0600 Subject: [PATCH] Disable BaseProjectType (#4597) --- models/tracker/src/migration.ts | 62 ++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/models/tracker/src/migration.ts b/models/tracker/src/migration.ts index eb0026fe94..26f6d0168c 100644 --- a/models/tracker/src/migration.ts +++ b/models/tracker/src/migration.ts @@ -39,11 +39,10 @@ import tags from '@hcengineering/tags' import task, { type ProjectType, type TaskType } from '@hcengineering/task' import { TimeReportDayType, - baseIssueTaskStatuses, classicIssueTaskStatuses, createStatesData, - type IssueStatus, type Issue, + type IssueStatus, type Project } from '@hcengineering/tracker' import { PaletteColorIndexes } from '@hcengineering/ui/src/colors' @@ -87,36 +86,37 @@ async function createDefaultProject (tx: TxOperations): Promise { ) } - if ((await tx.findOne(task.class.ProjectType, { _id: tracker.ids.BaseProjectType })) === undefined) { - const issueId: Ref = generateId() + // temporary disabled until nice automation + // if ((await tx.findOne(task.class.ProjectType, { _id: tracker.ids.BaseProjectType })) === undefined) { + // const issueId: Ref = generateId() - const states: Omit, 'rank'>[] = createStatesData(baseIssueTaskStatuses) - await createProjectType( - tx, - { - name: 'Base project', - descriptor: tracker.descriptors.ProjectType, - description: '', - tasks: [], - classic: false - }, - [ - { - _id: issueId, - name: 'Issue', - descriptor: tracker.descriptors.Issue, - factory: states, - ofClass: tracker.class.Issue, - targetClass: tracker.class.Issue, - statusCategories: baseIssueTaskStatuses.map((it) => it.category), - statusClass: core.class.Status, - kind: 'both', - allowedAsChildOf: [issueId] - } - ], - tracker.ids.BaseProjectType - ) - } + // const states: Omit, 'rank'>[] = createStatesData(baseIssueTaskStatuses) + // await createProjectType( + // tx, + // { + // name: 'Base project', + // descriptor: tracker.descriptors.ProjectType, + // description: '', + // tasks: [], + // classic: false + // }, + // [ + // { + // _id: issueId, + // name: 'Issue', + // descriptor: tracker.descriptors.Issue, + // factory: states, + // ofClass: tracker.class.Issue, + // targetClass: tracker.class.Issue, + // statusCategories: baseIssueTaskStatuses.map((it) => it.category), + // statusClass: core.class.Status, + // kind: 'both', + // allowedAsChildOf: [issueId] + // } + // ], + // tracker.ids.BaseProjectType + // ) + // } // Create new if not deleted by customers. if (current === undefined && currentDeleted === undefined) {