From 0b06f0bbe7e39098296cf4507c305bc79657a884 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 16 Feb 2024 17:40:17 +0600 Subject: [PATCH] UBERF-5565 (#4669) Signed-off-by: Denis Bykhov --- packages/core/src/client.ts | 7 ++++++- plugins/task/src/utils.ts | 35 ++++++++++++++++------------------- server/tool/src/index.ts | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 7c5c4793b9..04571aff1c 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -398,7 +398,12 @@ async function buildModel ( const userTx: Tx[] = [] const atxes = modelResponse.transactions - atxes.forEach((tx) => (tx.modifiedBy === core.account.System && !isPersonAccount(tx) ? systemTx : userTx).push(tx)) + atxes.forEach((tx) => + ((tx.modifiedBy === core.account.ConfigUser || tx.modifiedBy === core.account.System) && !isPersonAccount(tx) + ? systemTx + : userTx + ).push(tx) + ) if (allowedPlugins != null) { fillConfiguration(systemTx, configs) diff --git a/plugins/task/src/utils.ts b/plugins/task/src/utils.ts index 5f414e69cc..b6e5a2da8d 100644 --- a/plugins/task/src/utils.ts +++ b/plugins/task/src/utils.ts @@ -228,25 +228,6 @@ export async function createProjectType ( const baseClassClass = client.getHierarchy().getClass(categoryObj.baseClass) const targetProjectClassId: Ref> = generateId() - - await client.createDoc( - core.class.Mixin, - core.space.Model, - { - extends: categoryObj.baseClass, - kind: ClassifierKind.MIXIN, - label: getEmbeddedLabel(data.name), - icon: baseClassClass.icon - }, - targetProjectClassId, - undefined, - core.account.ConfigUser - ) - - await client.createMixin(targetProjectClassId, core.class.Mixin, core.space.Model, task.mixin.ProjectTypeClass, { - projectType: _id - }) - const tmpl = await client.createDoc( task.class.ProjectType, core.space.Model, @@ -266,6 +247,22 @@ export async function createProjectType ( _id ) + await client.createDoc( + core.class.Mixin, + core.space.Model, + { + extends: categoryObj.baseClass, + kind: ClassifierKind.MIXIN, + label: getEmbeddedLabel(data.name), + icon: baseClassClass.icon + }, + targetProjectClassId + ) + + await client.createMixin(targetProjectClassId, core.class.Mixin, core.space.Model, task.mixin.ProjectTypeClass, { + projectType: _id + }) + return tmpl } diff --git a/server/tool/src/index.ts b/server/tool/src/index.ts index 858558107b..3620d76cde 100644 --- a/server/tool/src/index.ts +++ b/server/tool/src/index.ts @@ -143,7 +143,7 @@ export async function initModel ( try { for (const op of migrateOperations) { - logger.log('Migrage', op[0]) + logger.log('Migrate', op[0]) await op[1].upgrade(connection, logger) }