diff --git a/.vscode/launch.json b/.vscode/launch.json index 517479d27c..190f1d8ae1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -97,7 +97,7 @@ "MODEL_JSON": "${workspaceRoot}/models/all/bundle/model.json", // "SERVER_PROVIDER":"uweb" "SERVER_PROVIDER": "ws", - "MODEL_VERSION": "0.7.145", + "MODEL_VERSION": "0.7.153", // "VERSION": "0.6.289", "COMMUNICATION_API_ENABLED": "true", "ELASTIC_INDEX_NAME": "local_storage_index", @@ -158,9 +158,9 @@ // "PORT": "4700",// For mongo "PORT": "4710", // for cockroach "FULLTEXT_DB_URL": "http://localhost:9201", - "DB_URL": "mongodb://localhost:27018", + // "DB_URL": "mongodb://localhost:27018", // "DB_URL": "postgresql://postgres:example@localhost:5432", - // "DB_URL": "postgresql://root@huly.local:26257/defaultdb?sslmode=disable", + "DB_URL": "postgresql://root@huly.local:26258/defaultdb?sslmode=disable", "STORAGE_CONFIG": "minio|localhost?accessKey=minioadmin&secretKey=minioadmin", "SERVER_SECRET": "secret", "REKONI_URL": "http://localhost:4004", @@ -168,7 +168,7 @@ "ELASTIC_INDEX_NAME": "local_storage_index", "REGION": "", "STATS_URL": "http://huly.local:4901", - "ACCOUNTS_URL": "http://localhost:3003", + "ACCOUNTS_URL": "http://huly.local:3003", "QUEUE_CONFIG": "localhost:19093;-staging" }, "runtimeArgs": ["--nolazy", "-r", "ts-node/register"], diff --git a/common/scripts/version.txt b/common/scripts/version.txt index 74327e84bd..e7b5dc8728 100644 --- a/common/scripts/version.txt +++ b/common/scripts/version.txt @@ -1 +1 @@ -"0.7.145" \ No newline at end of file +"0.7.153" diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index be916b39b6..3191c6b184 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -175,6 +175,9 @@ services: - cockroach - minio - stats + depends_on: + redpanda: + condition: service_started volumes: - ./branding.json:/var/cfg/branding.json environment: @@ -257,6 +260,9 @@ services: - minio - account - stats + depends_on: + redpanda: + condition: service_started ports: - 3332:3332 volumes: diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index a2261e81be..c72a9adbcb 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -19,7 +19,6 @@ import accountPlugin, { createWorkspaceRecord, flattenStatus, getAccountDB, - getWorkspaceById, getWorkspaceInfoWithStatusById, getWorkspaces, getWorkspacesInfoWithStatusByIds, @@ -117,9 +116,9 @@ import { performGmailAccountMigrations } from './gmail' import { getToolToken, getWorkspace, getWorkspaceTransactorEndpoint } from './utils' import { createRestClient } from '@hcengineering/api-client' -import { mkdir, writeFile } from 'fs/promises' -import { basename, dirname } from 'path' import { existsSync } from 'fs' +import { mkdir, writeFile } from 'fs/promises' +import { dirname } from 'path' import { restoreMarkupRefs } from './markup' const colorConstants = { @@ -438,58 +437,67 @@ export function devTool ( // }) // }) + async function doUpgrade ( + toolCtx: MeasureMetricsContext, + workspace: WorkspaceUuid, + forceUpdate: boolean, + forceIndexes: boolean + ): Promise { + const { version, txes, migrateOperations } = prepareTools() + + await withAccountDatabase(async (db) => { + const info = await getWorkspace(db, workspace) + if (info === null) { + throw new Error(`workspace ${workspace} not found`) + } + + const wsInfo = await getWorkspaceInfoWithStatusById(db, info.uuid) + if (wsInfo === null) { + throw new Error(`workspace ${workspace} not found`) + } + + const coreWsInfo = flattenStatus(wsInfo) + const measureCtx = new MeasureMetricsContext('upgrade-workspace', {}) + const accountClient = getAccountClient(getToolToken(wsInfo.uuid)) + const queue = getPlatformQueue('tool', info.region) + const wsProducer = queue.getProducer(toolCtx, QueueTopic.Workspace) + await upgradeWorkspace( + measureCtx, + version, + txes, + migrateOperations, + accountClient, + coreWsInfo, + consoleModelLogger, + wsProducer, + async () => {}, + forceUpdate, + forceIndexes, + true + ) + + await updateWorkspaceInfo(measureCtx, db, null, getToolToken(), { + workspaceUuid: info.uuid, + event: 'upgrade-done', + version, + progress: 100 + }) + + console.log(metricsToString(measureCtx.metrics, 'upgrade', 60)) + + await wsProducer.send(info.uuid, [workspaceEvents.upgraded()]) + await queue.shutdown() + console.log('upgrade-workspace done') + }) + } + program .command('upgrade-workspace ') .description('upgrade workspace') .option('-f|--force [force]', 'Force update', true) .option('-i|--indexes [indexes]', 'Force indexes rebuild', false) .action(async (workspace, cmd: { force: boolean, indexes: boolean }) => { - const { version, txes, migrateOperations } = prepareTools() - - await withAccountDatabase(async (db) => { - const info = await getWorkspace(db, workspace) - if (info === null) { - throw new Error(`workspace ${workspace} not found`) - } - - const wsInfo = await getWorkspaceInfoWithStatusById(db, info.uuid) - if (wsInfo === null) { - throw new Error(`workspace ${workspace} not found`) - } - - const coreWsInfo = flattenStatus(wsInfo) - const measureCtx = new MeasureMetricsContext('upgrade-workspace', {}) - const accountClient = getAccountClient(getToolToken(wsInfo.uuid)) - const queue = getPlatformQueue('tool', info.region) - const wsProducer = queue.getProducer(toolCtx, QueueTopic.Workspace) - await upgradeWorkspace( - measureCtx, - version, - txes, - migrateOperations, - accountClient, - coreWsInfo, - consoleModelLogger, - wsProducer, - async () => {}, - cmd.force, - cmd.indexes, - true - ) - - await updateWorkspaceInfo(measureCtx, db, null, getToolToken(), { - workspaceUuid: info.uuid, - event: 'upgrade-done', - version, - progress: 100 - }) - - console.log(metricsToString(measureCtx.metrics, 'upgrade', 60)) - - await wsProducer.send(info.uuid, [workspaceEvents.upgraded()]) - await queue.shutdown() - console.log('upgrade-workspace done') - }) + await doUpgrade(toolCtx, workspace, cmd.force, cmd.indexes) }) // program @@ -1133,6 +1141,7 @@ export function devTool ( .option('-i, --include ', 'A list of ; separated domain names to include during backup', '*') .option('-s, --skip ', 'A list of ; separated domain names to skip during backup', '') .option('--use-storage ', 'Use workspace storage adapter from env variable', '') + .option('--upgrade', 'Upgrade workspace', false) .option( '--history-file ', 'Store blob send info into file. Will skip already send documents.', @@ -1152,6 +1161,7 @@ export function devTool ( skip: string useStorage: string historyFile: string + upgrade: boolean } ) => { await withAccountDatabase(async (db) => { @@ -1169,6 +1179,11 @@ export function devTool ( const storage = await createFileBackupStorage(dirName) const storageConfig = cmd.useStorage !== '' ? storageConfigFromEnv(process.env[cmd.useStorage]) : undefined + const queue = getPlatformQueue('tool', ws.region) + const wsProducer = queue.getProducer(toolCtx, QueueTopic.Workspace) + + await wsProducer.send(ws.uuid, [workspaceEvents.restoring()]) + const workspaceStorage: StorageAdapter | undefined = storageConfig !== undefined ? buildStorageFromConfig(storageConfig) : undefined await restore(toolCtx, await getWorkspaceTransactorEndpoint(workspace), wsIds, storage, { @@ -1181,9 +1196,13 @@ export function devTool ( storageAdapter: workspaceStorage, historyFile: cmd.historyFile }) - const queue = getPlatformQueue('tool', ws.region) - const wsProducer = queue.getProducer(toolCtx, QueueTopic.Workspace) - await wsProducer.send(ws.uuid, [workspaceEvents.fullReindex()]) + + if (cmd.upgrade) { + await doUpgrade(toolCtx, workspace, true, true) + } + + console.log('workspace restored') + await wsProducer.send(ws.uuid, [workspaceEvents.restored()]) await queue.shutdown() await workspaceStorage?.close() }) diff --git a/models/card/src/migration.ts b/models/card/src/migration.ts index 93f458365a..1e5dd963f2 100644 --- a/models/card/src/migration.ts +++ b/models/card/src/migration.ts @@ -50,7 +50,7 @@ export const cardOperation: MigrateOperation = { async upgrade (state: Map>, client: () => Promise, mode): Promise { await tryUpgrade(mode, state, client, cardId, [ { - state: 'migrateViewlets-v3', + state: 'migrateViewlets-v4', func: migrateViewlets }, { diff --git a/models/core/src/migration.ts b/models/core/src/migration.ts index dda334462c..c642a468ea 100644 --- a/models/core/src/migration.ts +++ b/models/core/src/migration.ts @@ -236,8 +236,13 @@ async function processMigrateContentFor ( try { const buffer = Buffer.from(value) await storageAdapter.put(client.ctx, client.wsIds, blobId, buffer, 'application/json', buffer.length) - } catch (err) { - client.logger.error('failed to process document', { _class: doc._class, _id: doc._id, err }) + } catch (err: any) { + client.logger.error('failed to process document', { + _class: doc._class, + _id: doc._id, + err: err.message, + stack: err.stack + }) } update[attributeName] = blobId @@ -964,6 +969,11 @@ export const coreOperation: MigrateOperation = { state: 'accounts-to-social-ids', mode: 'upgrade', func: migrateAccounts + }, + { + state: 'clean-old-model', + mode: 'upgrade', + func: cleanOldModel } // , // { @@ -1015,3 +1025,10 @@ async function retry (retries: number, op: () => Promise): Promise { } throw error } + +async function cleanOldModel (client: MigrationClient): Promise { + await client.deleteMany(DOMAIN_MODEL_TX, { + modifiedBy: core.account.System, + objectClass: { $nin: ['core:class:Account', 'contact:class:PersonAccount'] } + }) +} diff --git a/models/process/src/index.ts b/models/process/src/index.ts index de376e45fa..96fe71253f 100644 --- a/models/process/src/index.ts +++ b/models/process/src/index.ts @@ -22,8 +22,7 @@ import core, { type Ref, SortingOrder, type Space, - type Tx, - type Type + type Tx } from '@hcengineering/core' import { type Builder, Model, Prop, ReadOnly, TypeAny, TypeBoolean, TypeRef, TypeString } from '@hcengineering/model' import { TDoc } from '@hcengineering/model-core' @@ -91,6 +90,8 @@ export class TTrigger extends TDoc implements Trigger { requiredParams!: string[] checkFunction?: Resource + + init!: boolean } @Model(process.class.Transition, core.class.Doc, DOMAIN_MODEL) @@ -99,10 +100,10 @@ export class TTransition extends TDoc implements Transition { process!: Ref @Prop(TypeRef(process.class.State), process.string.From) - from!: Ref + from!: Ref | null @Prop(TypeRef(process.class.State), process.string.To) - to!: Ref | null + to!: Ref @Prop(TypeAny(process.component.ActionsPresenter, process.string.Actions), process.string.Actions) actions!: Step[] @@ -147,6 +148,9 @@ export class TProcessToDo extends TToDo implements ProcessToDo { execution!: Ref state!: Ref + + @Prop(TypeBoolean(), process.string.Rollback) + withRollback!: boolean } @Model(process.class.Method, core.class.Doc, DOMAIN_MODEL) @@ -170,8 +174,6 @@ export class TMethod extends TDoc implements Method { export class TState extends TDoc implements State { process!: Ref title!: string - actions!: Step[] - resultType?: Type | null } @Model(process.class.ProcessFunction, core.class.Doc, DOMAIN_MODEL) @@ -508,7 +510,7 @@ export function createModel (builder: Builder): void { baseMenuClass: process.class.Execution }, viewOptions: { - groupBy: ['process', 'done'], + groupBy: ['process', 'currentState', 'card'], orderBy: [ ['modifiedOn', SortingOrder.Descending], ['createdOn', SortingOrder.Descending] @@ -662,6 +664,18 @@ export function createModel (builder: Builder): void { process.method.CreateToDo ) + builder.createDoc( + process.class.Trigger, + core.space.Model, + { + label: process.string.OnExecutionStart, + icon: process.icon.Process, + init: true, + requiredParams: [] + }, + process.trigger.OnExecutionStart + ) + builder.createDoc( process.class.Method, core.space.Model, @@ -682,7 +696,8 @@ export function createModel (builder: Builder): void { { label: process.string.OnSubProcessesDone, icon: process.icon.WaitSubprocesses, - requiredParams: [] + requiredParams: [], + init: false }, process.trigger.OnSubProcessesDone ) @@ -695,7 +710,8 @@ export function createModel (builder: Builder): void { icon: process.icon.ToDo, editor: process.component.ToDoCloseEditor, requiredParams: ['_id'], - checkFunction: process.triggerCheck.ToDo + checkFunction: process.triggerCheck.ToDo, + init: false }, process.trigger.OnToDoClose ) @@ -708,7 +724,8 @@ export function createModel (builder: Builder): void { icon: process.icon.ToDoRemove, editor: process.component.ToDoRemoveEditor, requiredParams: ['_id'], - checkFunction: process.triggerCheck.ToDo + checkFunction: process.triggerCheck.ToDo, + init: false }, process.trigger.OnToDoRemove ) diff --git a/models/process/src/migration.ts b/models/process/src/migration.ts index d26c1a93c7..a93f5fcc2d 100644 --- a/models/process/src/migration.ts +++ b/models/process/src/migration.ts @@ -13,70 +13,72 @@ // limitations under the License. // -import core, { type Ref, TxOperations } from '@hcengineering/core' +import core, { type Client, type Doc, TxOperations } from '@hcengineering/core' import { - tryUpgrade, type MigrateOperation, type MigrationClient, - type MigrationUpgradeClient + type MigrationUpgradeClient, + tryUpgrade } from '@hcengineering/model' -import { type Func, parseContext, type ProcessFunction } from '@hcengineering/process' +import process, { type State, type Step } from '@hcengineering/process' import { processId } from '.' -import process from './plugin' export const processOperation: MigrateOperation = { async migrate (client: MigrationClient, mode): Promise {}, async upgrade (state: Map>, client: () => Promise, mode): Promise { await tryUpgrade(mode, state, client, processId, [ { - state: 'migrateStateFuncs', - func: migrateStateFuncs + state: 'migrateActionsFromStates', + mode: 'upgrade', + func: migrateActionsFromStates } ]) } } -function getContext (value: string): string | undefined { - const context = parseContext(value) - if (context !== undefined) { - let contextChanged = false - if (context.functions !== undefined) { - for (let i = 0; i < context.functions.length; i++) { - const func = context.functions[i] as any - if (typeof func === 'string') { - const res: Func = { - func: func as Ref, - props: {} - } - context.functions[i] = res - contextChanged = true - } - } - } - if (contextChanged) { - return '$' + JSON.stringify(context) - } - } +interface OldState extends State { + actions: Step[] } -async function migrateStateFuncs (client: MigrationUpgradeClient): Promise { +async function migrateActionsFromStates (client: Client): Promise { const txOp = new TxOperations(client, core.account.System) - const states = await client.findAll(process.class.State, {}) + const rollbackTransitions = await client.findAll(process.class.Transition, { to: null as any }) + for (const toRemove of rollbackTransitions) { + await txOp.remove(toRemove, undefined, toRemove.modifiedBy) + } + const states = (await client.findAll(process.class.State, {})) as any as OldState[] + const transitions = await client.findAll(process.class.Transition, {}) + const transitionsMap = new Map() + for (const transition of transitions) { + const arr = transitionsMap.get(transition.to) ?? [] + arr.push(transition) + transitionsMap.set(transition.to, arr) + } for (const state of states) { - let changed = false - const actions = state.actions - for (const action of actions) { - for (const key of Object.keys(action.params)) { - const value = (action.params as any)[key] - const context = getContext(value) - if (context !== undefined) { - ;(action.params as any)[key] = context - changed = true + if (state.actions?.length > 0) { + const transitions = transitionsMap.get(state._id) ?? [] + if (transitions.length === 0) { + await txOp.createDoc( + process.class.Transition, + core.space.Model, + { + from: null, + to: state._id, + actions: state.actions, + trigger: process.trigger.OnExecutionStart, + triggerParams: {}, + process: state.process + }, + undefined, + undefined, + state.modifiedBy + ) + } else { + for (const transition of transitions) { + const actions = [...state.actions, ...transition.actions] + await txOp.update(transition, actions, undefined, undefined, state.modifiedBy) } } } - if (changed) { - await txOp.updateDoc(state._class, state.space, state._id, { actions }) - } } } diff --git a/packages/account-client/src/client.ts b/packages/account-client/src/client.ts index 1cb3b74bf3..361dcc3559 100644 --- a/packages/account-client/src/client.ts +++ b/packages/account-client/src/client.ts @@ -267,7 +267,7 @@ class AccountClientImpl implements AccountClient { return ws } - const result = { ...ws, ...status } + const result = { ...ws, ...status, processingAttemps: status.processingAttempts ?? 0 } delete result.status return result diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index a069bf9dbf..d963720b0c 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -839,6 +839,7 @@ export interface WorkspaceInfoWithStatus extends WorkspaceInfo { mode: WorkspaceMode processingProgress?: number backupInfo?: BackupStatus + processingAttemps: number } export interface WorkspaceMemberInfo { diff --git a/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte b/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte index 9e94424b5c..188fb656fe 100644 --- a/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte +++ b/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte @@ -50,7 +50,12 @@ let selectedSubObjectId: Ref | undefined = undefined let subEditor: AnySvelteComponent | undefined = undefined - let subEditorTitle: string | undefined = undefined + let subEditorParamas: SubEditorParams[] = [] + interface SubEditorParams { + id: Ref + editor: AnyComponent + title: string + } function selectSubItem (editorId: AnyComponent | undefined, objId: Ref | undefined): void { if (editorId !== undefined && objId !== undefined) { @@ -59,14 +64,13 @@ .then((res) => (subEditor = res)) .catch((err) => { subEditor = undefined - subEditorTitle = undefined + subEditorParamas = [] console.error(err) }) } else { + subEditorParamas = [] selectedSubObjectId = undefined - subEditorTitle = undefined subEditor = undefined - subEditorTitle = undefined } } @@ -79,10 +83,12 @@ }) function handleSubEditorOpen (event: CustomEvent): void { - subEditorTitle = event.detail + if (Array.isArray(event.detail)) { + subEditorParamas = event.detail + } } - function getBreadcrumbs (tag: Ref | undefined, subEditorTitle: string | undefined): BreadcrumbItem[] { + function getBreadcrumbs (tag: Ref | undefined, subEditorParams: SubEditorParams[]): BreadcrumbItem[] { if (tag === undefined) return [] const toAncestors = hierarchy.getAncestors(card.class.Card) const ancestors = hierarchy.getAncestors(tag) @@ -91,13 +97,16 @@ id: it, label: hierarchy.getClass(it).label })) - if (subEditorTitle !== undefined) { - res.push({ id: subEditorTitle, title: subEditorTitle }) + for (const subEditorParam of subEditorParams) { + res.push({ + id: subEditorParam.id, + title: subEditorParam.title + }) } return res } - $: items = getBreadcrumbs(masterTag?._id, subEditorTitle) + $: items = getBreadcrumbs(masterTag?._id, subEditorParamas) onMount(() => { setTimeout(() => { @@ -108,9 +117,15 @@ function handleSelect (e: CustomEvent): void { const id = items[e.detail]?.id if (id !== undefined) { + const isSub = subEditorParamas.find((it) => it.id === id) const loc = getCurrentLocation() - loc.path[4] = id - loc.path.length = 5 + if (isSub !== undefined) { + loc.path[5] = isSub.editor + loc.path[6] = isSub.id + } else { + loc.path[4] = id + loc.path.length = 5 + } navigate(loc) } } diff --git a/plugins/process-assets/lang/cs.json b/plugins/process-assets/lang/cs.json index 827e2a2c5a..cfe7232d31 100644 --- a/plugins/process-assets/lang/cs.json +++ b/plugins/process-assets/lang/cs.json @@ -66,6 +66,8 @@ "ToDo": "Úkol", "CurrentCard": "Aktuální karta", "Data": "Data", + "Transitions": "Přechody", + "OnExecutionStart": "Při spuštění provedení", "Prepend": "Přidat na začátek", "Append": "Přidat na konec", "Replace": "Nahradit", diff --git a/plugins/process-assets/lang/de.json b/plugins/process-assets/lang/de.json index db32791afd..d79d2d71d3 100644 --- a/plugins/process-assets/lang/de.json +++ b/plugins/process-assets/lang/de.json @@ -66,6 +66,8 @@ "ToDo": "Aufgabe", "CurrentCard": "Aktuelle Karte", "Data": "Daten", + "Transitions": "Übergänge", + "OnExecutionStart": "Bei Ausführungsstart", "Prepend": "Voranstellen", "Append": "Anhängen", "Replace": "Ersetzen", diff --git a/plugins/process-assets/lang/en.json b/plugins/process-assets/lang/en.json index 376609d422..382575abec 100644 --- a/plugins/process-assets/lang/en.json +++ b/plugins/process-assets/lang/en.json @@ -66,6 +66,8 @@ "ToDo": "ToDo", "CurrentCard": "Current card", "Data": "Data", + "Transitions": "Transitions", + "OnExecutionStart": "On execution start", "Prepend": "Prepend", "Append": "Append", "Replace": "Replace", diff --git a/plugins/process-assets/lang/es.json b/plugins/process-assets/lang/es.json index 558a3b1ded..e2634c6b75 100644 --- a/plugins/process-assets/lang/es.json +++ b/plugins/process-assets/lang/es.json @@ -66,6 +66,8 @@ "ToDo": "Tarea", "CurrentCard": "Tarjeta actual", "Data": "Datos", + "Transitions": "Transiciones", + "OnExecutionStart": "Al iniciar la ejecución", "Prepend": "Anteponer", "Append": "Añadir", "Replace": "Reemplazar", diff --git a/plugins/process-assets/lang/fr.json b/plugins/process-assets/lang/fr.json index c7ebb3a11f..01845b09cb 100644 --- a/plugins/process-assets/lang/fr.json +++ b/plugins/process-assets/lang/fr.json @@ -66,6 +66,8 @@ "ToDo": "Tâche", "CurrentCard": "Carte actuelle", "Data": "Données", + "Transitions": "Transitions", + "OnExecutionStart": "Au début de l'exécution", "Prepend": "Préfixer", "Append": "Ajouter", "Replace": "Remplacer", diff --git a/plugins/process-assets/lang/it.json b/plugins/process-assets/lang/it.json index 340e1a5b14..8525fc9232 100644 --- a/plugins/process-assets/lang/it.json +++ b/plugins/process-assets/lang/it.json @@ -66,6 +66,8 @@ "ToDo": "Attività", "CurrentCard": "Scheda corrente", "Data": "Dati", + "Transitions": "Transizioni", + "OnExecutionStart": "All'avvio dell'esecuzione", "Prepend": "Anteporre", "Append": "Aggiungere", "Replace": "Sostituire", diff --git a/plugins/process-assets/lang/ja.json b/plugins/process-assets/lang/ja.json index 6a131b16e6..efa26999c0 100644 --- a/plugins/process-assets/lang/ja.json +++ b/plugins/process-assets/lang/ja.json @@ -65,6 +65,8 @@ "ToDo": "ToDo", "CurrentCard": "現在のカード", "Data": "データ", + "Transitions": "遷移", + "OnExecutionStart": "実行開始時", "Prepend": "先頭に追加", "Append": "末尾に追加", "Replace": "置換", diff --git a/plugins/process-assets/lang/pt.json b/plugins/process-assets/lang/pt.json index 54819eb698..9454901512 100644 --- a/plugins/process-assets/lang/pt.json +++ b/plugins/process-assets/lang/pt.json @@ -66,6 +66,8 @@ "ToDo": "Tarefa", "CurrentCard": "Cartão Atual", "Data": "Dados", + "Transitions": "Transições", + "OnExecutionStart": "Ao iniciar execução", "Prepend": "Prefixar", "Append": "Anexar", "Replace": "Substituir", diff --git a/plugins/process-assets/lang/ru.json b/plugins/process-assets/lang/ru.json index 1f89aceb5c..43abb0f6a2 100644 --- a/plugins/process-assets/lang/ru.json +++ b/plugins/process-assets/lang/ru.json @@ -66,6 +66,8 @@ "ToDo": "ToDo", "CurrentCard": "Текущая карточка", "Data": "Данные", + "Transitions": "Переходы", + "OnExecutionStart": "При запуске", "Prepend": "Добавить в начало", "Append": "Добавить в конец", "Replace": "Заменить", diff --git a/plugins/process-assets/lang/zh.json b/plugins/process-assets/lang/zh.json index 1f25a7024d..604f85e074 100644 --- a/plugins/process-assets/lang/zh.json +++ b/plugins/process-assets/lang/zh.json @@ -66,6 +66,8 @@ "ToDo": "待办事项", "CurrentCard": "当前卡片", "Data": "数据", + "Transitions": "转换", + "OnExecutionStart": "执行开始时", "Prepend": "前置", "Append": "追加", "Replace": "替换", diff --git a/plugins/process-resources/src/components/ProcessesSection.svelte b/plugins/process-resources/src/components/ProcessesSection.svelte index 2b618ed397..0483cf4198 100644 --- a/plugins/process-resources/src/components/ProcessesSection.svelte +++ b/plugins/process-resources/src/components/ProcessesSection.svelte @@ -17,7 +17,7 @@ import core, { generateId, Ref } from '@hcengineering/core' import { translate } from '@hcengineering/platform' import { createQuery, getClient } from '@hcengineering/presentation' - import { Process, State, Step } from '@hcengineering/process' + import { Process, State } from '@hcengineering/process' import { ButtonIcon, getCurrentLocation, Icon, IconAdd, Label, navigate } from '@hcengineering/ui' import process from '../plugin' @@ -31,19 +31,25 @@ name: await translate(process.string.NewProcess, {}), masterTag: masterTag._id, context: {}, - description: '', - initState + description: '' }) await client.createDoc( process.class.State, core.space.Model, { process: id, - title: await translate(process.string.NewState, {}), - actions: [] + title: await translate(process.string.NewState, {}) }, initState ) + await client.createDoc(process.class.Transition, core.space.Model, { + process: id, + from: null, + to: initState, + trigger: process.trigger.OnExecutionStart, + actions: [], + triggerParams: {} + }) handleSelect(id) } diff --git a/plugins/process-resources/src/components/contextEditors/RequestUserInput.svelte b/plugins/process-resources/src/components/contextEditors/RequestUserInput.svelte index 2963c4aa86..fc32377b31 100644 --- a/plugins/process-resources/src/components/contextEditors/RequestUserInput.svelte +++ b/plugins/process-resources/src/components/contextEditors/RequestUserInput.svelte @@ -15,13 +15,14 @@ {#if method !== undefined} @@ -61,7 +63,7 @@ {/if} {#if method.presenter !== undefined} - + {:else}