Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions models/process/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ export function defineMethods (builder: Builder): void {
process.method.AddTag
)

builder.createDoc(
process.class.Method,
core.space.Model,
{
label: process.string.CancelToDo,
editor: process.component.CancelToDoEditor,
presenter: process.component.ToDoValuePresenter,
objectClass: process.class.ProcessToDo,
requiredParams: ['_id'],
createdContext: null
},
process.method.CancelToDo
)

builder.createDoc(
process.class.Method,
core.space.Model,
Expand Down
4 changes: 4 additions & 0 deletions models/server-process/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export function createModel (builder: Builder): void {
func: serverProcess.func.RequestApproval
})

builder.mixin(process.method.CancelToDo, process.class.Method, serverProcess.mixin.MethodImpl, {
func: serverProcess.func.CancelToDo
})

builder.mixin(process.method.LockCard, process.class.Method, serverProcess.mixin.MethodImpl, {
func: serverProcess.func.LockCard
})
Expand Down
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"LockSection": "Zamknout sekci",
"Approvers": "Schvalovatelé",
"UnlockCard": "Odemknout kartu",
"UnlockSection": "Odemknout sekci"
"UnlockSection": "Odemknout sekci",
"CancelToDo": "Zrušit akční položku"
},
"error": {
"MethodNotFound": "Metoda nenalezena: {methodId}",
Expand All @@ -156,6 +157,7 @@
"EmptyFunctionResult": "Prázdný výsledek funkce {func}",
"ContextValueNotProvided": "Hodnota kontextu nebyla poskytnuta: {name}",
"RequiredParamsNotProvided": "Chybí požadované parametry: {params}",
"TooDeepTransitionRecursion": "Příliš hluboká rekurze přechodů"
"TooDeepTransitionRecursion": "Příliš hluboká rekurze přechodů",
"ToDoAlreadyCompleted": "Akční položka již byla dokončena"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"LockSection": "Abschnitt sperren",
"Approvers": "Genehmiger",
"UnlockCard": "Karte entsperren",
"UnlockSection": "Abschnitt entsperren"
"UnlockSection": "Abschnitt entsperren",
"CancelToDo": "Action Item abbrechen"
},
"error": {
"MethodNotFound": "Methode nicht gefunden: {methodId}",
Expand All @@ -156,6 +157,7 @@
"EmptyFunctionResult": "Leerer Funktionsresultat {func}",
"ContextValueNotProvided": "Kontextwert nicht bereitgestellt: {name}",
"RequiredParamsNotProvided": "Erforderliche Parameter nicht bereitgestellt: {params}",
"TooDeepTransitionRecursion": "Zu tiefe Übergangsrekursion"
"TooDeepTransitionRecursion": "Zu tiefe Übergangsrekursion",
"ToDoAlreadyCompleted": "Action Item bereits abgeschlossen"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "Lock section",
"Approvers": "Approvers",
"UnlockCard": "Unlock card",
"UnlockSection": "Unlock section"
"UnlockSection": "Unlock section",
"CancelToDo": "Cancel Action item"
},
"error": {
"MethodNotFound": "Method not found: {methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "Empty function result {func}",
"ContextValueNotProvided": "Context value not provided: {name}",
"RequiredParamsNotProvided": "Required parameters not provided: {params}",
"TooDeepTransitionRecursion": "Too deep transition recursion"
"TooDeepTransitionRecursion": "Too deep transition recursion",
"ToDoAlreadyCompleted": "Action item already completed"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "Bloquear sección",
"Approvers": "Aprobadores",
"UnlockCard": "Desbloquear tarjeta",
"UnlockSection": "Desbloquear sección"
"UnlockSection": "Desbloquear sección",
"CancelToDo": "Cancelar acción"
},
"error": {
"MethodNotFound": "Método no encontrado: {methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "Resultado de función vacío {func}",
"ContextValueNotProvided": "Valor de contexto no proporcionado: {name}",
"RequiredParamsNotProvided": "Faltan parámetros requeridos: {params}",
"TooDeepTransitionRecursion": "Demasiada recursión de transición"
"TooDeepTransitionRecursion": "Demasiada recursión de transición",
"ToDoAlreadyCompleted": "Acción ya completada"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "Verrouiller la section",
"Approvers": "Approbateurs",
"UnlockCard": "Déverrouiller la carte",
"UnlockSection": "Déverrouiller la section"
"UnlockSection": "Déverrouiller la section",
"CancelToDo": "Annuler l'action"
},
"error": {
"MethodNotFound": "Méthode introuvable : {methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "Résultat de fonction vide {func}",
"ContextValueNotProvided": "Valeur de contexte non fournie : {name}",
"RequiredParamsNotProvided": "Paramètres requis non fournis : {params}",
"TooDeepTransitionRecursion": "Récursion de transition trop profonde"
"TooDeepTransitionRecursion": "Récursion de transition trop profonde",
"ToDoAlreadyCompleted": "Action déjà terminée"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "Blocca sezione",
"Approvers": "Approvatori",
"UnlockCard": "Sblocca scheda",
"UnlockSection": "Sblocca sezione"
"UnlockSection": "Sblocca sezione",
"CancelToDo": "Annulla azione"
},
"error": {
"MethodNotFound": "Metodo non trovato: {methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "Risultato funzione vuoto {func}",
"ContextValueNotProvided": "Valore di contesto non fornito: {name}",
"RequiredParamsNotProvided": "Parametri richiesti non forniti: {params}",
"TooDeepTransitionRecursion": "Ricorsione di transizione troppo profonda"
"TooDeepTransitionRecursion": "Ricorsione di transizione troppo profonda",
"ToDoAlreadyCompleted": "Azione già completata"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@
"LockSection": "セクションをロック",
"Approvers": "承認者",
"UnlockCard": "カードのロックを解除",
"UnlockSection": "セクションのロックを解除"
"UnlockSection": "セクションのロックを解除",
"CancelToDo": "アクションをキャンセル"
},
"error": {
"MethodNotFound": "メソッドが見つかりません: {methodId}",
Expand All @@ -160,6 +161,7 @@
"ContextValueNotProvided": "コンテキスト値が提供されていません: {name}",
"RequiredParamsNotProvided": "必須パラメータが提供されていません: {params}",
"ResultNotProvided": "結果が提供されていません",
"TooDeepTransitionRecursion": "遷移の再帰が深すぎます"
"TooDeepTransitionRecursion": "遷移の再帰が深すぎます",
"ToDoAlreadyCompleted": "アクションは既に完了しています"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Reviewers": "Revisores",
"FieldIsEmpty": "Campo vazio",
"UnlockCard": "Desbloquear cartão",
"UnlockSection": "Desbloquear seção"
"UnlockSection": "Desbloquear seção",
"CancelToDo": "Cancelar ação"
},
"error": {
"MethodNotFound": "Método não encontrado: {methodId}",
Expand All @@ -149,6 +150,7 @@
"EmptyFunctionResult": "Resultado da função vazio {func}",
"ContextValueNotProvided": "Valor de contexto não fornecido: {name}",
"RequiredParamsNotProvided": "Parâmetros obrigatórios não fornecidos: {params}",
"TooDeepTransitionRecursion": "Recursão de transição muito profunda"
"TooDeepTransitionRecursion": "Recursão de transição muito profunda",
"ToDoAlreadyCompleted": "Ação já concluída"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "Bloquear seção",
"Approvers": "Aprovadores",
"UnlockCard": "Desbloquear cartão",
"UnlockSection": "Desbloquear seção"
"UnlockSection": "Desbloquear seção",
"CancelToDo": "Cancelar ação"
},
"error": {
"MethodNotFound": "Método não encontrado: {methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "Resultado da função vazio {func}",
"ContextValueNotProvided": "Valor de contexto não fornecido: {name}",
"RequiredParamsNotProvided": "Parâmetros obrigatórios não fornecidos: {params}",
"TooDeepTransitionRecursion": "Recursão de transição muito profunda"
"TooDeepTransitionRecursion": "Recursão de transição muito profunda",
"ToDoAlreadyCompleted": "Ação já concluída"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "Заблокировать секцию",
"Approvers": "Утверждающие",
"UnlockCard": "Разблокировать карточку",
"UnlockSection": "Разблокировать секцию"
"UnlockSection": "Разблокировать секцию",
"CancelToDo": "Отменить задачу"
},
"error": {
"MethodNotFound": "Метод не найден: {methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "Отсутствуют результат функции {func}",
"ContextValueNotProvided": "Значение контекста не предоставлено: {name}",
"RequiredParamsNotProvided": "Отсутствуют обязательные параметры: {params}",
"TooDeepTransitionRecursion": "Слишком глубокая рекурсия переходов"
"TooDeepTransitionRecursion": "Слишком глубокая рекурсия переходов",
"ToDoAlreadyCompleted": "Задача уже выполнена"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@
"LockSection": "Bölümü kilitle",
"Approvers": "Onaylayanlar",
"UnlockCard": "Kartın kilidini aç",
"UnlockSection": "Bölümün kilidini aç"
"UnlockSection": "Bölümün kilidini aç",
"CancelToDo": "Eylem öğesini iptal et"
},
"error": {
"MethodNotFound": "Metod bulunamadı: {methodId}",
Expand All @@ -158,6 +159,7 @@
"EmptyFunctionResult": "Boş fonksiyon sonucu {func}",
"ContextValueNotProvided": "Bağlam değeri sağlanmadı: {name}",
"RequiredParamsNotProvided": "Gerekli parametreler sağlanmadı: {params}",
"TooDeepTransitionRecursion": "Çok derin geçiş özyinelemesi"
"TooDeepTransitionRecursion": "Çok derin geçiş özyinelemesi",
"ToDoAlreadyCompleted": "Eylem öğesi zaten tamamlandı"
}
}
6 changes: 4 additions & 2 deletions plugins/process-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"LockSection": "锁定部分",
"Approvers": "批准人",
"UnlockCard": "解锁卡片",
"UnlockSection": "解锁部分"
"UnlockSection": "解锁部分",
"CancelToDo": "取消任务"
},
"error": {
"MethodNotFound": "找不到方法:{methodId}",
Expand All @@ -161,6 +162,7 @@
"EmptyFunctionResult": "空函数结果 {func}",
"ContextValueNotProvided": "未提供上下文值:{name}",
"RequiredParamsNotProvided": "未提供必需的参数:{params}",
"TooDeepTransitionRecursion": "转换递归过深"
"TooDeepTransitionRecursion": "转换递归过深",
"ToDoAlreadyCompleted": "任务已完成"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
// Copyright © 2026 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->

<script lang="ts">
import { Ref } from '@hcengineering/core'
import { Process, ProcessToDo, Step } from '@hcengineering/process'
import { Label } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
import plugin from '../../plugin'
import ToDoContextSelector from '../contextEditors/ToDoContextSelector.svelte'

export let process: Process
export let step: Step<ProcessToDo>

const dispatch = createEventDispatcher()

const params = step.params
let _id = params._id as Ref<ProcessToDo>

function change (e: CustomEvent): void {
if (e.detail !== undefined) {
_id = e.detail
params._id = _id
step.params = params
dispatch('change', step)
}
}
</script>

<div class="editor-grid">
<Label label={plugin.string.ToDo} />
<ToDoContextSelector readonly={false} {process} value={_id} on:change={change} />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
-->

<script lang="ts">
import core, { AnyAttribute, generateId } from '@hcengineering/core'
import { Analytics } from '@hcengineering/analytics'
import core, { AnyAttribute } from '@hcengineering/core'
import { getResource } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation'
import { Process } from '@hcengineering/process'
import { AnySvelteComponent } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { createEventDispatcher } from 'svelte'
import plugin from '../../plugin'
import { getContext, getMockAttribute } from '../../utils'
import ProcessAttribute from '../ProcessAttribute.svelte'
import { createEventDispatcher } from 'svelte'
import { Analytics } from '@hcengineering/analytics'

export let readonly: boolean
export let process: Process
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!--
// Copyright © 2026 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { getClient } from '@hcengineering/presentation'
import {
Process,
ProcessToDo,
SelectedContext,
SelectedExecutionContext,
Step,
parseContext
} from '@hcengineering/process'
import { Label } from '@hcengineering/ui'
import plugin from '../../plugin'
import ExecutionContextPresenter from '../attributeEditors/ExecutionContextPresenter.svelte'

export let step: Step<ProcessToDo>
export let process: Process

const client = getClient()
$: method = client.getModel().findAllSync(plugin.class.Method, { _id: step.methodId })[0]

$: context = getContext(step.params._id as string)

function getContext (value: string | undefined): SelectedExecutionContext | undefined {
if (value === undefined) return
const context = parseContext(value)
if (context !== undefined && isExecutionContext(context)) {
return context
}
}

function isExecutionContext (context: SelectedContext): context is SelectedExecutionContext {
return context.type === 'context'
}
</script>

<div class="flex-row-center flex-gap-2">
<Label label={method.label} />
{#if context}
:
<div class="title">
<ExecutionContextPresenter {process} contextValue={context} />
</div>
{/if}
</div>

<style lang="scss">
.title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: var(--theme-caption-color);
}
</style>
Loading
Loading