From 2beb25faf4c291e1c73df228e5e8cf671bbcd387 Mon Sep 17 00:00:00 2001 From: Artyom Savchenko Date: Mon, 23 Feb 2026 20:51:20 +0700 Subject: [PATCH 1/6] Update changelog (#10544) Signed-off-by: Artem Savchenko --- changelog.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/changelog.md b/changelog.md index 8c1ffaf166..3e72553229 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,16 @@ Changelog. +## [0.7.375] - 2026-02-23 + +* 🚀 FEATURES: · Add activity section in controlled doc ([#10457](https://github.com/hcengineering/platform/issues/10457)) · Add data converter plugin ([#10460](https://github.com/hcengineering/platform/issues/10460)) · *(ui)* Add Turkish language to settings popup ([#10441](https://github.com/hcengineering/platform/issues/10441)) · Turkish language in dev setup ([#10462](https://github.com/hcengineering/platform/issues/10462)) · Add import notifications ([#10464](https://github.com/hcengineering/platform/issues/10464)) · Guest users to upload attachments and use reactions ([#10469](https://github.com/hcengineering/platform/issues/10469)) · Add activity input for controlled docs ([#10470](https://github.com/hcengineering/platform/issues/10470)) · Ability to select multiple docs and to export to pdf ([#10468](https://github.com/hcengineering/platform/issues/10468)) · Headers legibility ([#10473](https://github.com/hcengineering/platform/issues/10473)) · Brazilian Portuguese translation ([#10478](https://github.com/hcengineering/platform/issues/10478)) · Add drive permissions ([#10489](https://github.com/hcengineering/platform/issues/10489)) · Add unlock card and section functionality with UI updates ([#10492](https://github.com/hcengineering/platform/issues/10492)) · To define different viewlet actions ([#10502](https://github.com/hcengineering/platform/issues/10502)) · Add ability to copy all data from cards/docs tables ([#10505](https://github.com/hcengineering/platform/issues/10505)) · Redesign workspace join ([#10507](https://github.com/hcengineering/platform/issues/10507)) · For guests to update notification settings ([#10517](https://github.com/hcengineering/platform/issues/10517)) · Add project breadcrumb ([#10515](https://github.com/hcengineering/platform/issues/10515)) · Implement process import/export functionality, enhance process … ([#10528](https://github.com/hcengineering/platform/issues/10528)) · Implement CancelSubProcess action, fix process execution flow. ([#10530](https://github.com/hcengineering/platform/issues/10530)) · Add ability to group by issues by project ([#10531](https://github.com/hcengineering/platform/issues/10531)) +* 🐛 BUG FIXES: · Okit.graphql is not a function ([#10442](https://github.com/hcengineering/platform/issues/10442)) · Custom attributes in markdown table ([#10445](https://github.com/hcengineering/platform/issues/10445)) · Relationship table diff/refresh ([#10446](https://github.com/hcengineering/platform/issues/10446)) · Handle youtu.be links ([#10458](https://github.com/hcengineering/platform/issues/10458)) · Calendar timezone day-shift bug ([#7048](https://github.com/hcengineering/platform/issues/7048)) ([#10459](https://github.com/hcengineering/platform/issues/10459)) · Mute account unauthorized error ([#10461](https://github.com/hcengineering/platform/issues/10461)) · Do not write analytics event when no token ([#10463](https://github.com/hcengineering/platform/issues/10463)) · Documents space export ([#10465](https://github.com/hcengineering/platform/issues/10465)) · Print layout ([#10472](https://github.com/hcengineering/platform/issues/10472)) · Use the error logging level for expected situations ([#10474](https://github.com/hcengineering/platform/issues/10474)) · Allow to open mermaid diagram in fullscreen ([#10477](https://github.com/hcengineering/platform/issues/10477)) · Rows order in relationsheep table compare ([#10479](https://github.com/hcengineering/platform/issues/10479)) · Custom attributes display in original view ([#10480](https://github.com/hcengineering/platform/issues/10480)) · Card formatting in markdown ([#10475](https://github.com/hcengineering/platform/issues/10475)) · Proper mermaid diagram size ([#10487](https://github.com/hcengineering/platform/issues/10487)) · Embed pdf via direct link ([#10491](https://github.com/hcengineering/platform/issues/10491)) · Secure blobs ([#10490](https://github.com/hcengineering/platform/issues/10490)) · Relationship table refresh ([#10494](https://github.com/hcengineering/platform/issues/10494)) · Issues layout ([#10498](https://github.com/hcengineering/platform/issues/10498)) · Exception during github issue id reading ([#10500](https://github.com/hcengineering/platform/issues/10500)) · Email notifications for export ([#10506](https://github.com/hcengineering/platform/issues/10506)) · Prevent datalake from error flood ([#10521](https://github.com/hcengineering/platform/issues/10521)) · Brazilian Portuguese translation ([#10522](https://github.com/hcengineering/platform/issues/10522)) · Datalake in dev setup does not support secure mode ([#10525](https://github.com/hcengineering/platform/issues/10525)) · Date formatting in md table ([#10523](https://github.com/hcengineering/platform/issues/10523)) · Bump with foundation packages ([#10536](https://github.com/hcengineering/platform/issues/10536)) · Process ([#10543](https://github.com/hcengineering/platform/issues/10543)) +* 🚜 REFACTOR: · One metadata interface ([#10444](https://github.com/hcengineering/platform/issues/10444)) +* ⚙️ MISCELLANEOUS TASKS: · Changelog · Changelog ([#10439](https://github.com/hcengineering/platform/issues/10439)) · Mail URL from export pod ([#10476](https://github.com/hcengineering/platform/issues/10476)) · Etc/hosts path for Windows ([#10482](https://github.com/hcengineering/platform/issues/10482)) · Space security and permissions ([#10529](https://github.com/hcengineering/platform/issues/10529)) · Kvs and pulse versions ([#10539](https://github.com/hcengineering/platform/issues/10539)) · And publish npm packages for v tags ([#10542](https://github.com/hcengineering/platform/issues/10542)) +* FIX: · Images not rendering on GitHub side of GitHub integration ([#10520](https://github.com/hcengineering/platform/issues/10520)) · Show print actions for individual documents ([#10484](https://github.com/hcengineering/platform/issues/10484)) · Password signup crashes with JSON parse error when MAIL_URL is configured ([#10519](https://github.com/hcengineering/platform/issues/10519)) +* QFIX: · Allow notifications for guests with collab security ([#10510](https://github.com/hcengineering/platform/issues/10510)) +* QFIX: · Remove unused ui dependencies ([#10511](https://github.com/hcengineering/platform/issues/10511)) + ## [0.7.353] - 2026-01-24 * 🚀 FEATURES: · Link preview service ([#10424](https://github.com/hcengineering/platform/issues/10424)) · Add confirmation modal for table refresh ([#10428](https://github.com/hcengineering/platform/issues/10428)) · Guest update profile (avatar, name etc) ([#10429](https://github.com/hcengineering/platform/issues/10429)) From 5a9c9be6cb60e808056316e2ca1678de7693dcad Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Tue, 24 Feb 2026 23:42:16 +0500 Subject: [PATCH 2/6] Automation only processes (#10548) Signed-off-by: Denis Bykhov --- models/process/src/index.ts | 3 +++ plugins/process-assets/lang/cs.json | 1 + plugins/process-assets/lang/de.json | 1 + plugins/process-assets/lang/en.json | 1 + plugins/process-assets/lang/es.json | 1 + plugins/process-assets/lang/fr.json | 1 + plugins/process-assets/lang/it.json | 1 + plugins/process-assets/lang/ja.json | 1 + plugins/process-assets/lang/pt-br.json | 1 + plugins/process-assets/lang/pt.json | 1 + plugins/process-assets/lang/ru.json | 1 + plugins/process-assets/lang/tr.json | 1 + plugins/process-assets/lang/zh.json | 1 + .../src/components/RunProcessCardPopup.svelte | 5 ++++- .../src/components/RunProcessPopup.svelte | 2 +- .../settings/ProcesssSetting.svelte | 19 ++++++++++++++++++- plugins/process-resources/src/plugin.ts | 1 + plugins/process/src/index.ts | 1 + 18 files changed, 40 insertions(+), 3 deletions(-) diff --git a/models/process/src/index.ts b/models/process/src/index.ts index 15928063f2..b94faf0b7d 100644 --- a/models/process/src/index.ts +++ b/models/process/src/index.ts @@ -103,6 +103,9 @@ export class TProcess extends TDoc implements Process { @Prop(TypeBoolean(), process.string.StartAutomatically) autoStart: boolean | undefined + @Prop(TypeBoolean(), process.string.AutomationOnly) + automationOnly: boolean | undefined + context!: Record } diff --git a/plugins/process-assets/lang/cs.json b/plugins/process-assets/lang/cs.json index 79b38bb09d..aa2cf149f7 100644 --- a/plugins/process-assets/lang/cs.json +++ b/plugins/process-assets/lang/cs.json @@ -45,6 +45,7 @@ "Required": "Povinné", "ParallelExecutionForbidden": "Nedovoluj paralelní spuštění", "StartAutomatically": "Spustit automaticky", + "AutomationOnly": "Pouze automatizace", "Error": "Chyba", "Continue": "Pokračovat", "RequestFromUser": "Požádat uživatele", diff --git a/plugins/process-assets/lang/de.json b/plugins/process-assets/lang/de.json index 010a0f97fd..abd8368375 100644 --- a/plugins/process-assets/lang/de.json +++ b/plugins/process-assets/lang/de.json @@ -45,6 +45,7 @@ "Required": "Erforderlich", "ParallelExecutionForbidden": "Parallele Ausführung verboten", "StartAutomatically": "Automatisch starten", + "AutomationOnly": "Nur Automatisierung", "Error": "Fehler", "Continue": "Fortsetzen", "RequestFromUser": "Anfrage von Benutzer", diff --git a/plugins/process-assets/lang/en.json b/plugins/process-assets/lang/en.json index 4df0e0f90d..5ff88937d4 100644 --- a/plugins/process-assets/lang/en.json +++ b/plugins/process-assets/lang/en.json @@ -45,6 +45,7 @@ "Required": "Required", "ParallelExecutionForbidden": "Parallel execution forbidden", "StartAutomatically": "Start automatically", + "AutomationOnly": "Automation only", "Error": "Error", "Continue": "Continue", "RequestFromUser": "Request from user", diff --git a/plugins/process-assets/lang/es.json b/plugins/process-assets/lang/es.json index c28d0cf55e..d52c4a523b 100644 --- a/plugins/process-assets/lang/es.json +++ b/plugins/process-assets/lang/es.json @@ -49,6 +49,7 @@ "Required": "Requerido", "ParallelExecutionForbidden": "Ejecución paralela prohibida", "StartAutomatically": "Iniciar automáticamente", + "AutomationOnly": "Solo automatización", "Error": "Error", "Continue": "Continuar", "RequestFromUser": "Solicitar desde el usuario", diff --git a/plugins/process-assets/lang/fr.json b/plugins/process-assets/lang/fr.json index 51103def4e..5d691bd021 100644 --- a/plugins/process-assets/lang/fr.json +++ b/plugins/process-assets/lang/fr.json @@ -49,6 +49,7 @@ "Required": "Requis", "ParallelExecutionForbidden": "Exécution parallèle interdite", "StartAutomatically": "Démarrer automatiquement", + "AutomationOnly": "Automatisation uniquement", "Error": "Erreur", "Continue": "Continuer", "RequestFromUser": "Demander à partir de l'utilisateur", diff --git a/plugins/process-assets/lang/it.json b/plugins/process-assets/lang/it.json index 627a7d8370..f3db7c99c8 100644 --- a/plugins/process-assets/lang/it.json +++ b/plugins/process-assets/lang/it.json @@ -49,6 +49,7 @@ "Required": "Obbligatorio", "ParallelExecutionForbidden": "Esecuzione parallela vietata", "StartAutomatically": "Avvia automaticamente", + "AutomationOnly": "Solo automazione", "Error": "Errore", "Continue": "Continua", "RequestFromUser": "Richiedi da utente", diff --git a/plugins/process-assets/lang/ja.json b/plugins/process-assets/lang/ja.json index 5656ab2592..c6d10292ff 100644 --- a/plugins/process-assets/lang/ja.json +++ b/plugins/process-assets/lang/ja.json @@ -49,6 +49,7 @@ "Required": "必須", "ParallelExecutionForbidden": "並列実行は禁止されています", "StartAutomatically": "自動的に開始", + "AutomationOnly": "自動化のみ", "Error": "エラー", "Continue": "続行", "RequestFromUser": "ユーザーからのリクエスト", diff --git a/plugins/process-assets/lang/pt-br.json b/plugins/process-assets/lang/pt-br.json index b98f0f0874..a5e3bd44dd 100644 --- a/plugins/process-assets/lang/pt-br.json +++ b/plugins/process-assets/lang/pt-br.json @@ -49,6 +49,7 @@ "Required": "Obrigatório", "ParallelExecutionForbidden": "Execução Paralela Proibida", "StartAutomatically": "Iniciar automaticamente", + "AutomationOnly": "Apenas automação", "Error": "Erro", "Continue": "Continuar", "RequestFromUser": "Solicitar do usuário", diff --git a/plugins/process-assets/lang/pt.json b/plugins/process-assets/lang/pt.json index 780cbdc467..4bff0e7245 100644 --- a/plugins/process-assets/lang/pt.json +++ b/plugins/process-assets/lang/pt.json @@ -49,6 +49,7 @@ "Required": "Obrigatório", "ParallelExecutionForbidden": "Execução Paralela Proibida", "StartAutomatically": "Iniciar automaticamente", + "AutomationOnly": "Apenas automação", "Error": "Erro", "Continue": "Continuar", "RequestFromUser": "Solicitar do usuário", diff --git a/plugins/process-assets/lang/ru.json b/plugins/process-assets/lang/ru.json index a53bfe2299..0f3b9ca924 100644 --- a/plugins/process-assets/lang/ru.json +++ b/plugins/process-assets/lang/ru.json @@ -49,6 +49,7 @@ "Required": "Обязательно", "ParallelExecutionForbidden": "Одновременное выполнение запрещено", "StartAutomatically": "Запускать автоматически", + "AutomationOnly": "Только автоматизация", "Error": "Ошибка", "Continue": "Продолжить", "RequestFromUser": "Запросить у пользователя", diff --git a/plugins/process-assets/lang/tr.json b/plugins/process-assets/lang/tr.json index 7083ebddfc..b30d7f6d69 100644 --- a/plugins/process-assets/lang/tr.json +++ b/plugins/process-assets/lang/tr.json @@ -45,6 +45,7 @@ "Required": "Gerekli", "ParallelExecutionForbidden": "Paralel yürütme yasak", "StartAutomatically": "Otomatik başlat", + "AutomationOnly": "Sadece otomasyon", "Error": "Hata", "Continue": "Devam et", "RequestFromUser": "Kullanıcıdan talep et", diff --git a/plugins/process-assets/lang/zh.json b/plugins/process-assets/lang/zh.json index 4d395998fb..fd350370d9 100644 --- a/plugins/process-assets/lang/zh.json +++ b/plugins/process-assets/lang/zh.json @@ -49,6 +49,7 @@ "Required": "必需", "ParallelExecutionForbidden": "禁止并行执行", "StartAutomatically": "自动启动", + "AutomationOnly": "仅限自动化", "Error": "错误", "Continue": "继续", "RequestFromUser": "从用户请求", diff --git a/plugins/process-resources/src/components/RunProcessCardPopup.svelte b/plugins/process-resources/src/components/RunProcessCardPopup.svelte index 3e059c5e0b..4e49c4e3aa 100644 --- a/plugins/process-resources/src/components/RunProcessCardPopup.svelte +++ b/plugins/process-resources/src/components/RunProcessCardPopup.svelte @@ -30,7 +30,10 @@ let process: Ref | undefined = value let card: Card | undefined - const processes = client.getModel().findAllSync(plugin.class.Process, {}) + const processes = client + .getModel() + .findAllSync(plugin.class.Process, {}) + .filter((p) => p.automationOnly !== true) const items: ListItem[] = processes.map((p) => ({ label: p.name, _id: p._id })) diff --git a/plugins/process-resources/src/components/RunProcessPopup.svelte b/plugins/process-resources/src/components/RunProcessPopup.svelte index 4a66c5663e..b526f7cc8c 100644 --- a/plugins/process-resources/src/components/RunProcessPopup.svelte +++ b/plugins/process-resources/src/components/RunProcessPopup.svelte @@ -32,7 +32,7 @@ const resClasses = getPossibleClasses() const res = client.getModel().findAllSync(process.class.Process, {}) - const processes = res.filter((it) => resClasses.includes(it.masterTag)) + const processes = res.filter((it) => resClasses.includes(it.masterTag) && it.automationOnly !== true) function getCardPossibleClasses (card: Card): Ref>[] { const asc = h.getAncestors(card._class) diff --git a/plugins/process-resources/src/components/settings/ProcesssSetting.svelte b/plugins/process-resources/src/components/settings/ProcesssSetting.svelte index 8164c83a5c..845e2053b9 100644 --- a/plugins/process-resources/src/components/settings/ProcesssSetting.svelte +++ b/plugins/process-resources/src/components/settings/ProcesssSetting.svelte @@ -35,6 +35,12 @@ await client.update(value, { autoStart: e.detail }) } } + + async function saveAutomationOnly (e: CustomEvent): Promise { + if (value !== undefined) { + await client.update(value, { automationOnly: e.detail }) + } + } - +
+ +
+
diff --git a/plugins/process-resources/src/plugin.ts b/plugins/process-resources/src/plugin.ts index 388154d314..c5feae9859 100644 --- a/plugins/process-resources/src/plugin.ts +++ b/plugins/process-resources/src/plugin.ts @@ -181,6 +181,7 @@ export default mergeIds(processId, process, { Required: '' as IntlString, ParallelExecutionForbidden: '' as IntlString, StartAutomatically: '' as IntlString, + AutomationOnly: '' as IntlString, Continue: '' as IntlString, RequestFromUser: '' as IntlString, EnterValue: '' as IntlString, diff --git a/plugins/process/src/index.ts b/plugins/process/src/index.ts index d43c1a474a..57d90ef780 100644 --- a/plugins/process/src/index.ts +++ b/plugins/process/src/index.ts @@ -31,6 +31,7 @@ export interface Process extends Doc { description: string parallelExecutionForbidden?: boolean autoStart?: boolean + automationOnly?: boolean context: Record resultType?: Type } From 103a81fa3941c81d6ff1e9104c771164fab4e8ad Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Wed, 25 Feb 2026 01:47:02 +0700 Subject: [PATCH 3/6] fix: embed html instead of showing in iframe (#10549) Signed-off-by: Alexander Onnikov --- .../ui/src/components/EmbeddedHTML.svelte | 52 +++++++++++++++++++ packages/ui/src/index.ts | 1 + .../src/components/DOCXViewer.svelte | 4 +- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 packages/ui/src/components/EmbeddedHTML.svelte diff --git a/packages/ui/src/components/EmbeddedHTML.svelte b/packages/ui/src/components/EmbeddedHTML.svelte new file mode 100644 index 0000000000..e8cd5adfb7 --- /dev/null +++ b/packages/ui/src/components/EmbeddedHTML.svelte @@ -0,0 +1,52 @@ + + + + +{#if iframeSrc} + +{:else} + +{/if} diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 5dd99ead29..b489add087 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -284,6 +284,7 @@ export { default as CodeForm } from './components/CodeForm.svelte' export { default as CodeInput } from './components/CodeInput.svelte' export { default as TimeLeft } from './components/TimeLeft.svelte' export { default as SectionEmpty } from './components/SectionEmpty.svelte' +export { default as EmbeddedHTML } from './components/EmbeddedHTML.svelte' export { default as EmbeddedPDF } from './components/EmbeddedPDF.svelte' export { default as NestedMenu } from './components/NestedMenu.svelte' export { default as NestedDropdown } from './components/NestedDropdown.svelte' diff --git a/plugins/print-resources/src/components/DOCXViewer.svelte b/plugins/print-resources/src/components/DOCXViewer.svelte index 70c3518103..73bd02cc6f 100644 --- a/plugins/print-resources/src/components/DOCXViewer.svelte +++ b/plugins/print-resources/src/components/DOCXViewer.svelte @@ -9,7 +9,7 @@ import { getMetadata } from '@hcengineering/platform' import presentation, { getFileUrl } from '@hcengineering/presentation' import { convertToHTML } from '@hcengineering/print' - import { EmbeddedPDF, Spinner, themeStore } from '@hcengineering/ui' + import { EmbeddedHTML, Spinner, themeStore } from '@hcengineering/ui' export let value: Ref export let name: string @@ -270,7 +270,7 @@ {:else} - + {/if} {/if} From 2dd45f56a00c0a48389abea8a9b1d52b3c13f32d Mon Sep 17 00:00:00 2001 From: Artyom Savchenko Date: Wed, 25 Feb 2026 01:50:05 +0700 Subject: [PATCH 4/6] Fix npm publish (#10545) Signed-off-by: Artem Savchenko --- .github/workflows/main.yml | 4 +++- common/scripts/safe-publish.js | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98672449f1..28278f4413 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -969,4 +969,6 @@ jobs: run: | REF="${{ github.event.inputs.ref || github.ref }}" VERSION="${REF#refs/tags/v}" - node common/scripts/bump.js "$VERSION" --publish + VERSION="${VERSION#v}" + node common/scripts/bump.js "$VERSION" + node common/scripts/safe-publish.js diff --git a/common/scripts/safe-publish.js b/common/scripts/safe-publish.js index 82a6fcad3e..2f0b0368bc 100755 --- a/common/scripts/safe-publish.js +++ b/common/scripts/safe-publish.js @@ -43,8 +43,24 @@ function checkPackageExists(packageName, version) { */ function getPublishablePackages(includePattern) { try { - const output = execSync('rush list -p --json', { encoding: 'utf-8' }) - const config = JSON.parse(output) + const repoRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim() + const output = execSync('node common/scripts/install-run-rush.js list -p --json', { + encoding: 'utf-8', + cwd: repoRoot + }) + const lines = output.split('\n') + let jsonStart = -1 + for (let i = 0; i < lines.length; i++) { + if (lines[i].trim().startsWith('{')) { + jsonStart = i + break + } + } + if (jsonStart === -1) { + console.error('Could not find JSON output from rush list') + return [] + } + const config = JSON.parse(lines.slice(jsonStart).join('\n')) return config.projects.filter((project) => { // Check if package should be published according to rush.json From c15060afb0c8c43f2d2df6544848e6f304edbe58 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 25 Feb 2026 01:04:07 +0500 Subject: [PATCH 5/6] Fix fieldChangesCheck (#10550) Signed-off-by: Denis Bykhov --- foundations/core/packages/core/src/tx.ts | 5 ++++- plugins/process-resources/src/utils.ts | 13 ++++++++----- server-plugins/process-resources/src/functions.ts | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/foundations/core/packages/core/src/tx.ts b/foundations/core/packages/core/src/tx.ts index af3cea4f17..493c29b360 100644 --- a/foundations/core/packages/core/src/tx.ts +++ b/foundations/core/packages/core/src/tx.ts @@ -436,7 +436,10 @@ export abstract class TxProcessor implements WithTx { } static txHasUpdate(tx: TxUpdateDoc, attribute: string): boolean { - const ops = tx.operations + return TxProcessor.hasUpdate(tx.operations, attribute) + } + + static hasUpdate(ops: DocumentUpdate, attribute: string): boolean { if ((ops as any)[attribute] !== undefined) return true for (const op in ops) { if (op.startsWith('$')) { diff --git a/plugins/process-resources/src/utils.ts b/plugins/process-resources/src/utils.ts index 3e8e2a33ba..6437ebce6f 100644 --- a/plugins/process-resources/src/utils.ts +++ b/plugins/process-resources/src/utils.ts @@ -20,12 +20,14 @@ import core, { type Client, type Doc, type DocumentQuery, + type DocumentUpdate, generateId, matchQuery, type Ref, type RefTo, type Space, type TxOperations, + TxProcessor, type Type } from '@hcengineering/core' import { getResource, type IntlString, PlatformError, Severity, Status } from '@hcengineering/platform' @@ -207,9 +209,9 @@ export function getContext ( } } const allRelations = client.getModel().findAllSync(core.class.Association, {}) - const descendants = new Set(client.getHierarchy().getDescendants(process.masterTag)) + const ancestors = new Set(client.getHierarchy().getAncestors(process.masterTag)) - const relationsA = allRelations.filter((it) => descendants.has(it.classA)) + const relationsA = allRelations.filter((it) => ancestors.has(it.classA)) for (const rel of relationsA) { if (['object', 'array'].includes(category) && client.getHierarchy().isDerived(rel.classB, target)) { relations[rel.nameB] = { @@ -231,7 +233,7 @@ export function getContext ( } } - const relationsB = allRelations.filter((it) => descendants.has(it.classB)) + const relationsB = allRelations.filter((it) => ancestors.has(it.classB)) for (const rel of relationsB) { if (['object', 'array'].includes(category) && client.getHierarchy().isDerived(rel.classA, target)) { relations[rel.nameA] = { @@ -683,8 +685,9 @@ export function fieldChangesCheck ( ): boolean { const doc = context.card if (doc === undefined) return false - const param = Object.keys(params)[0] - if (!Object.keys(context.operations ?? {}).includes(param)) return false + const operations = (context.operations ?? {}) as DocumentUpdate + const target = Object.keys(params)[0] + if (!TxProcessor.hasUpdate(operations, target)) return false const res = matchQuery([doc], params, doc._class, client.getHierarchy(), true) return res.length > 0 } diff --git a/server-plugins/process-resources/src/functions.ts b/server-plugins/process-resources/src/functions.ts index 403da49ddc..7f40a59367 100644 --- a/server-plugins/process-resources/src/functions.ts +++ b/server-plugins/process-resources/src/functions.ts @@ -20,6 +20,7 @@ import core, { Class, Data, Doc, + DocumentUpdate, fillDefaults, findProperty, generateId, @@ -169,9 +170,9 @@ export function FieldChangedCheck ( const process = control.client.getModel().findObject(execution.process) if (process === undefined) return false if (context.operations === undefined) return false - const changedFields = Object.keys(context.operations) + const operations = context.operations as DocumentUpdate const target = Object.keys(params)[0] - if (!changedFields.includes(target)) return false + if (!TxProcessor.hasUpdate(operations, target)) return false const res = matchQuery([context.card], params, process.masterTag, control.client.getHierarchy(), true) return res.length > 0 } From 6030f921c83fcb3450efa476bf297e2f9db21c0b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 25 Feb 2026 08:23:29 +0500 Subject: [PATCH 6/6] Fix missing enum when export type (#10551) Signed-off-by: Denis Bykhov --- plugins/process-resources/src/exporter.ts | 101 ++++++++++++++++++++-- 1 file changed, 94 insertions(+), 7 deletions(-) diff --git a/plugins/process-resources/src/exporter.ts b/plugins/process-resources/src/exporter.ts index 30d206d5a5..83f22fc8a8 100644 --- a/plugins/process-resources/src/exporter.ts +++ b/plugins/process-resources/src/exporter.ts @@ -1,21 +1,37 @@ import { type MasterTag } from '@hcengineering/card' -import core, { type Doc, type Ref, type Class, generateId } from '@hcengineering/core' +import card from '@hcengineering/card' +import core, { + type Doc, + type Ref, + type Class, + generateId, + type EnumOf, + type RefTo, + type ArrOf, + type ModelDb, + type Hierarchy +} from '@hcengineering/core' import { getClient } from '@hcengineering/presentation' -import process from './plugin' +import { type Process, type Transition } from '@hcengineering/process' +import processPlugin from './plugin' export function exportProcesses (_id: Ref): { docs: Doc[] required: Array>> } { const docs: Doc[] = [] + const required: Array>> = [] const client = getClient() const m = client.getModel() - const processes = m.findAllSync(process.class.Process, { masterTag: _id }) + const processes = m.findAllSync(processPlugin.class.Process, { masterTag: _id }) for (const proc of processes) { const res = exportProcess(proc) docs.push(...res.docs) + for (const req of res.required) { + if (!required.includes(req)) required.push(req) + } } - return { docs, required: [] } + return { docs, required } } export function exportProcess (proc: Doc): { @@ -23,13 +39,84 @@ export function exportProcess (proc: Doc): { required: Array>> } { const docs: Doc[] = [proc] + const required: Array>> = [] const client = getClient() const m = client.getModel() + const h = client.getHierarchy() - docs.push(...m.findAllSync(process.class.State, { process: proc._id as any })) - docs.push(...m.findAllSync(process.class.Transition, { process: proc._id as any })) + docs.push(...m.findAllSync(processPlugin.class.State, { process: proc._id as any })) + const transitions = m.findAllSync(processPlugin.class.Transition, { process: proc._id as any }) as Transition[] + docs.push(...transitions) - return { docs, required: [] } + const processDoc = proc as Process + + for (const tr of transitions) { + processParams(tr.triggerParams, processDoc.masterTag, docs, required, m, h) + for (const action of tr.actions) { + processParams(action.params, processDoc.masterTag, docs, required, m, h) + } + } + + return { docs, required } +} + +function processParams ( + params: Record | undefined, + masterTag: Ref, + docs: Doc[], + required: Array>>, + m: ModelDb, + h: Hierarchy +): void { + if (params === undefined) return + for (const key in params) { + if (key.startsWith('$')) { + const val = params[key] + if (Array.isArray(val)) { + for (const item of val) { + if (typeof item === 'object' && item !== null) { + processParams(item, masterTag, docs, required, m, h) + } + } + } else if (typeof val === 'object' && val !== null) { + processParams(val, masterTag, docs, required, m, h) + } + continue + } + const attr = h.findAttribute(masterTag, key) + if (attr !== undefined) { + const type = attr.type + if (type._class === core.class.EnumOf) { + const enumRef = (type as EnumOf).of + const enumDoc = m.findObject(enumRef) + if (enumDoc !== undefined && !docs.some((d) => d._id === enumDoc._id)) { + docs.push(enumDoc) + } + } + if (type._class === core.class.RefTo) { + const to = (type as RefTo).to + if (h.isDerived(to, card.class.Card) && !required.includes(to)) { + required.push(to) + } + } + if (type._class === core.class.ArrOf) { + const of = (type as ArrOf).of + if (of._class === core.class.EnumOf) { + const enumRef = (of as EnumOf).of + const enumDoc = m.findObject(enumRef) + if (enumDoc !== undefined && !docs.some((d) => d._id === enumDoc._id)) { + docs.push(enumDoc) + } + } + if (of._class === core.class.RefTo) { + const to = (of as RefTo).to + if (h.isDerived(to, card.class.Card) && !required.includes(to)) { + required.push(to) + } + } + } + } + } } export async function importProcess (masterTag: Ref, json: string): Promise {