From 5752b827d58ba11871b6c48f9b5f64b139fa559b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 27 Feb 2026 05:31:05 +0500 Subject: [PATCH] =?UTF-8?q?Action=20types=20for=20approval=20requests,=20e?= =?UTF-8?q?nable=20field=20synchronization=20for=20=E2=80=A6=20(#10565)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Denis Bykhov --- models/process/src/index.ts | 17 ++++ plugins/process-assets/lang/cs.json | 7 +- plugins/process-assets/lang/de.json | 7 +- plugins/process-assets/lang/en.json | 7 +- plugins/process-assets/lang/es.json | 7 +- plugins/process-assets/lang/fr.json | 7 +- plugins/process-assets/lang/it.json | 7 +- plugins/process-assets/lang/ja.json | 7 +- plugins/process-assets/lang/pt-br.json | 7 +- plugins/process-assets/lang/pt.json | 7 +- plugins/process-assets/lang/ru.json | 7 +- plugins/process-assets/lang/tr.json | 7 +- plugins/process-assets/lang/zh.json | 7 +- .../src/components/ActionTypePresenter.svelte | 22 +++++ .../components/ApproveRequestButtons.svelte | 6 +- .../components/ExecutionRefPresenter.svelte | 38 +++++++++ .../settings/ApproveRequestEditor.svelte | 39 ++++++++- .../src/components/settings/ToDoEditor.svelte | 29 ++++++- plugins/process-resources/src/index.ts | 7 +- plugins/process-resources/src/plugin.ts | 4 +- plugins/process/src/index.ts | 10 ++- .../process-resources/src/functions.ts | 11 ++- server-plugins/process-resources/src/index.ts | 82 +++++++++++++++++++ services/process/src/main.ts | 11 ++- services/worker/src/config.ts | 2 +- 25 files changed, 337 insertions(+), 25 deletions(-) create mode 100644 plugins/process-resources/src/components/ActionTypePresenter.svelte create mode 100644 plugins/process-resources/src/components/ExecutionRefPresenter.svelte diff --git a/models/process/src/index.ts b/models/process/src/index.ts index b94faf0b7d..0db367ced1 100644 --- a/models/process/src/index.ts +++ b/models/process/src/index.ts @@ -221,6 +221,9 @@ export class TApproveRequest extends TProcessToDo implements ApproveRequest { group!: string card!: Ref + + @Prop(TypeString(), process.string.ActionType) + actionType?: 'approve' | 'review' } @Model(process.class.Method, core.class.Doc, DOMAIN_MODEL) @@ -478,7 +481,17 @@ export function createModel (builder: Builder): void { strict: true }, config: [ + { + key: 'execution', + label: process.string.Process, + presenter: process.component.ExecutionRefPresenter + }, 'user', + { + key: 'actionType', + label: process.string.ActionType, + presenter: process.component.ActionTypePresenter + }, { key: '', presenter: view.component.GrowPresenter, @@ -495,6 +508,10 @@ export function createModel (builder: Builder): void { process.viewlet.CardRequests ) + builder.mixin(process.class.ApproveRequest, core.class.Class, view.mixin.IgnoreActions, { + actions: [view.action.Delete] + }) + builder.createDoc( view.class.Viewlet, core.space.Model, diff --git a/plugins/process-assets/lang/cs.json b/plugins/process-assets/lang/cs.json index aa2cf149f7..a2eb5b9f16 100644 --- a/plugins/process-assets/lang/cs.json +++ b/plugins/process-assets/lang/cs.json @@ -145,7 +145,12 @@ "CancelToDo": "Zrušit akční položku", "Export": "Exportovat", "Import": "Importovat", - "CancelProcess": "Zrušit proces" + "CancelProcess": "Zrušit proces", + "SyncWithField": "Synchronizovat s polem", + "ActionType": "Typ", + "ApproveAction": "Schválit", + "ReviewAction": "Zkontrolovat", + "Review": "Zkontrolovat" }, "error": { "MethodNotFound": "Metoda nenalezena: {methodId}", diff --git a/plugins/process-assets/lang/de.json b/plugins/process-assets/lang/de.json index abd8368375..372510e39b 100644 --- a/plugins/process-assets/lang/de.json +++ b/plugins/process-assets/lang/de.json @@ -145,7 +145,12 @@ "CancelToDo": "Action Item abbrechen", "Export": "Exportieren", "Import": "Importieren", - "CancelProcess": "Prozess abbrechen" + "CancelProcess": "Prozess abbrechen", + "SyncWithField": "Synchronisieren mit Feld", + "ActionType": "Typ", + "ApproveAction": "Genehmigen", + "ReviewAction": "Prüfen", + "Review": "Prüfen" }, "error": { "MethodNotFound": "Methode nicht gefunden: {methodId}", diff --git a/plugins/process-assets/lang/en.json b/plugins/process-assets/lang/en.json index 5ff88937d4..6da4d6741d 100644 --- a/plugins/process-assets/lang/en.json +++ b/plugins/process-assets/lang/en.json @@ -150,7 +150,12 @@ "CancelToDo": "Cancel Action item", "Export": "Export", "Import": "Import", - "CancelProcess": "Cancel process" + "CancelProcess": "Cancel process", + "SyncWithField": "Sync with field", + "ActionType": "Type", + "ApproveAction": "Approve", + "ReviewAction": "Review", + "Review": "Review" }, "error": { "MethodNotFound": "Method not found: {methodId}", diff --git a/plugins/process-assets/lang/es.json b/plugins/process-assets/lang/es.json index d52c4a523b..ec7823a3cb 100644 --- a/plugins/process-assets/lang/es.json +++ b/plugins/process-assets/lang/es.json @@ -150,7 +150,12 @@ "CancelToDo": "Cancelar acción", "Export": "Exportar", "Import": "Importar", - "CancelProcess": "Cancelar proceso" + "CancelProcess": "Cancelar proceso", + "SyncWithField": "Sincronizar con campo", + "ActionType": "Tipo", + "ApproveAction": "Aprobar", + "ReviewAction": "Revisar", + "Review": "Revisar" }, "error": { "MethodNotFound": "Método no encontrado: {methodId}", diff --git a/plugins/process-assets/lang/fr.json b/plugins/process-assets/lang/fr.json index 5d691bd021..157b78ba8c 100644 --- a/plugins/process-assets/lang/fr.json +++ b/plugins/process-assets/lang/fr.json @@ -150,7 +150,12 @@ "CancelToDo": "Annuler l'action", "Export": "Exporter", "Import": "Importer", - "CancelProcess": "Annuler le processus" + "CancelProcess": "Annuler le processus", + "SyncWithField": "Synchroniser avec le champ", + "ActionType": "Type", + "ApproveAction": "Approuver", + "ReviewAction": "Revoir", + "Review": "Revoir" }, "error": { "MethodNotFound": "Méthode introuvable : {methodId}", diff --git a/plugins/process-assets/lang/it.json b/plugins/process-assets/lang/it.json index f3db7c99c8..0a6c05f1cc 100644 --- a/plugins/process-assets/lang/it.json +++ b/plugins/process-assets/lang/it.json @@ -150,7 +150,12 @@ "CancelToDo": "Annulla azione", "Export": "Esporta", "Import": "Importa", - "CancelProcess": "Annulla processo" + "CancelProcess": "Annulla processo", + "SyncWithField": "Sincronizza con campo", + "ActionType": "Tipo", + "ApproveAction": "Approva", + "ReviewAction": "Revisa", + "Review": "Revisa" }, "error": { "MethodNotFound": "Metodo non trovato: {methodId}", diff --git a/plugins/process-assets/lang/ja.json b/plugins/process-assets/lang/ja.json index c6d10292ff..3f2aacc4c0 100644 --- a/plugins/process-assets/lang/ja.json +++ b/plugins/process-assets/lang/ja.json @@ -149,7 +149,12 @@ "CancelToDo": "アクションをキャンセル", "Export": "エクスポート", "Import": "インポート", - "CancelProcess": "プロセスをキャンセル" + "CancelProcess": "プロセスをキャンセル", + "SyncWithField": "フィールドと同期", + "ActionType": "タイプ", + "ApproveAction": "承認", + "ReviewAction": "レビュー", + "Review": "レビュー" }, "error": { "MethodNotFound": "メソッドが見つかりません: {methodId}", diff --git a/plugins/process-assets/lang/pt-br.json b/plugins/process-assets/lang/pt-br.json index a5e3bd44dd..74b2a6658e 100644 --- a/plugins/process-assets/lang/pt-br.json +++ b/plugins/process-assets/lang/pt-br.json @@ -138,7 +138,12 @@ "CancelToDo": "Cancelar ação", "Export": "Exportar", "Import": "Importar", - "CancelProcess": "Cancelar processo" + "CancelProcess": "Cancelar processo", + "SyncWithField": "Sincronizar com campo", + "ActionType": "Tipo", + "ApproveAction": "Aprovar", + "ReviewAction": "Revisar", + "Review": "Revisar" }, "error": { "MethodNotFound": "Método não encontrado: {methodId}", diff --git a/plugins/process-assets/lang/pt.json b/plugins/process-assets/lang/pt.json index 4bff0e7245..c47ec49867 100644 --- a/plugins/process-assets/lang/pt.json +++ b/plugins/process-assets/lang/pt.json @@ -150,7 +150,12 @@ "CancelToDo": "Cancelar ação", "Export": "Exportar", "Import": "Importar", - "CancelProcess": "Cancelar processo" + "CancelProcess": "Cancelar processo", + "SyncWithField": "Sincronizar com campo", + "ActionType": "Tipo", + "ApproveAction": "Aprovar", + "ReviewAction": "Revisar", + "Review": "Revisar" }, "error": { "MethodNotFound": "Método não encontrado: {methodId}", diff --git a/plugins/process-assets/lang/ru.json b/plugins/process-assets/lang/ru.json index 0f3b9ca924..1f7902e096 100644 --- a/plugins/process-assets/lang/ru.json +++ b/plugins/process-assets/lang/ru.json @@ -150,7 +150,12 @@ "CancelToDo": "Отменить задачу", "Export": "Экспорт", "Import": "Импорт", - "CancelProcess": "Отменить процесс" + "CancelProcess": "Отменить процесс", + "SyncWithField": "Синхронизировать с полем", + "ActionType": "Тип", + "ApproveAction": "Утверждение", + "ReviewAction": "Рецензирование", + "Review": "Рецензировать" }, "error": { "MethodNotFound": "Метод не найден: {methodId}", diff --git a/plugins/process-assets/lang/tr.json b/plugins/process-assets/lang/tr.json index b30d7f6d69..80fa74fba6 100644 --- a/plugins/process-assets/lang/tr.json +++ b/plugins/process-assets/lang/tr.json @@ -147,7 +147,12 @@ "CancelToDo": "Eylem öğesini iptal et", "Export": "Dışa aktar", "Import": "İçe aktar", - "CancelProcess": "Süreci iptal et" + "CancelProcess": "Süreci iptal et", + "SyncWithField": "Alan ile senkronize et", + "ActionType": "Tür", + "ApproveAction": "Onayla", + "ReviewAction": "Gözden geçir", + "Review": "Gözden geçir" }, "error": { "MethodNotFound": "Metod bulunamadı: {methodId}", diff --git a/plugins/process-assets/lang/zh.json b/plugins/process-assets/lang/zh.json index fd350370d9..09731eef38 100644 --- a/plugins/process-assets/lang/zh.json +++ b/plugins/process-assets/lang/zh.json @@ -150,7 +150,12 @@ "CancelToDo": "取消任务", "Export": "导出", "Import": "导入", - "CancelProcess": "取消过程" + "CancelProcess": "取消过程", + "SyncWithField": "字段同步", + "ActionType": "类型", + "ApproveAction": "批准", + "ReviewAction": "审查", + "Review": "审查" }, "error": { "MethodNotFound": "找不到方法:{methodId}", diff --git a/plugins/process-resources/src/components/ActionTypePresenter.svelte b/plugins/process-resources/src/components/ActionTypePresenter.svelte new file mode 100644 index 0000000000..272246cf0a --- /dev/null +++ b/plugins/process-resources/src/components/ActionTypePresenter.svelte @@ -0,0 +1,22 @@ + + + +