Skip to content

Commit 8111584

Browse files
authored
Add process activity to card (#9952)
Signed-off-by: Denis Bykhov <[email protected]>
1 parent 3b2da51 commit 8111584

File tree

23 files changed

+188
-23
lines changed

23 files changed

+188
-23
lines changed

.vscode/launch.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@
104104
"UPLOAD_URL": "/files",
105105
"AI_BOT_URL": "http://localhost:4010",
106106
"STATS_URL": "http://huly.local:4900",
107-
"QUEUE_CONFIG": "localhost:19092",
107+
"QUEUE_CONFIG": "huly.local:19092",
108+
"REGION": "cockroach",
109+
"QUEUE_REGION": "cockroach",
108110
"FILES_URL": "http://huly.local:4030/blob/:workspace/:blobId/:filename",
109111
"OTEL_EXPORTER_OTLP_ENDPOINT": "http://huly.local:4318/v1/traces",
110112
"BRANDING_PATH": "${workspaceRoot}/dev/branding.json"

packages/api-client/src/rest/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class RestTxClient implements Client {
8282
params: DomainParams,
8383
options?: DomainRequestOptions
8484
): Promise<DomainResult<T>> {
85-
throw new Error('Domain request operation not supported')
85+
return await this.client.domainRequest(domain, params, options)
8686
}
8787

8888
async findOne<T extends Doc>(

plugins/communication-resources/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@hcengineering/presence-resources": "^0.6.0",
6060
"@hcengineering/presentation": "^0.6.3",
6161
"@hcengineering/rank": "^0.6.4",
62+
"@hcengineering/process": "^0.6.0",
6263
"@hcengineering/text": "^0.6.5",
6364
"@hcengineering/text-editor": "^0.6.0",
6465
"@hcengineering/text-editor-resources": "^0.6.0",
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
// Copyright © 2025 Hardcore Engineering Inc.
3+
//
4+
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License. You may
6+
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
//
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
-->
15+
<script lang="ts">
16+
import { ActivityProcess, Markdown } from '@hcengineering/communication-types'
17+
import { getClient } from '@hcengineering/presentation'
18+
import { Icon, IconAdd, IconArrowRight, IconCheck, IconStart, Label } from '@hcengineering/ui'
19+
import processPlugin from '@hcengineering/process'
20+
21+
export let update: ActivityProcess
22+
export let content: Markdown
23+
24+
const client = getClient()
25+
const hierarchy = client.getHierarchy()
26+
27+
$: _process = client.getModel().findObject(update.process)
28+
$: state = update.transitionTo !== undefined ? client.getModel().findObject(update.transitionTo) : undefined
29+
30+
$: icon = update.action === 'started' ? IconStart : update.action === 'transition' ? IconArrowRight : IconCheck
31+
</script>
32+
33+
<div class="tag overflow-label flex-gap-2">
34+
<Icon {icon} size="small" />
35+
{#if _process !== undefined}
36+
{#if update.action === 'started'}
37+
<Label label={processPlugin.string.ProcessRunned} params={{ process: _process.name }} />
38+
{:else if state !== undefined}
39+
<Label
40+
label={update.action === 'transition'
41+
? processPlugin.string.ProcessStateChanged
42+
: processPlugin.string.ProcessFinished}
43+
params={{ process: _process.name, state: state.title }}
44+
/>
45+
{/if}
46+
{:else}
47+
{content}
48+
{/if}
49+
</div>
50+
51+
<style lang="scss">
52+
.tag {
53+
display: flex;
54+
align-items: center;
55+
}
56+
</style>

plugins/communication-resources/src/components/message/activity/ActivityUpdateViewer.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import { Person } from '@hcengineering/contact'
2323
import { Card } from '@hcengineering/card'
2424
import ActivityUpdateTypeViewer from './ActivityUpdateTypeViewer.svelte'
25+
import ActivityUpdateProcessViewer from './ActivityUpdateProcessViewer.svelte'
2526
2627
export let model: AttributeModel | undefined = undefined
2728
export let update: ActivityUpdate
@@ -38,4 +39,6 @@
3839
<ActivityUpdateCollaboratorsViewer {update} {card} {author} />
3940
{:else if update.type === ActivityUpdateType.Type}
4041
<ActivityUpdateTypeViewer {update} />
42+
{:else if update.type === ActivityUpdateType.Process}
43+
<ActivityUpdateProcessViewer {update} {content} />
4144
{/if}

plugins/process-assets/lang/cs.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@
104104
"AddResult": "Přidat výsledek",
105105
"For": "Pro",
106106
"Context": "Kontext",
107-
"Attribute": "Atribut"
107+
"Attribute": "Atribut",
108+
"ProcessRunned": "Proces \"{process}\" spuštěn",
109+
"ProcessStateChanged": "Stav procesu \"{process}\" změněn na \"{state}\"",
110+
"ProcessFinished": "Proces \"{process}\" dokončen ve stavu \"{state}\""
108111
},
109112
"error": {
110113
"MethodNotFound": "Metoda nenalezena: {methodId}",

plugins/process-assets/lang/de.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@
104104
"AddResult": "Ergebnis hinzufügen",
105105
"For": "Für",
106106
"Context": "Kontext",
107-
"Attribute": "Attribut"
107+
"Attribute": "Attribut",
108+
"ProcessRunned": "Prozess \"{process}\" gestartet",
109+
"ProcessStateChanged": "Prozess \"{process}\" Status geändert zu \"{state}\"",
110+
"ProcessFinished": "Prozess \"{process}\" beendet im Status \"{state}\""
108111
},
109112
"error": {
110113
"MethodNotFound": "Methode nicht gefunden: {methodId}",

plugins/process-assets/lang/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@
109109
"AddResult": "Add result",
110110
"For": "For",
111111
"Context": "Context",
112-
"Attribute": "Attribute"
112+
"Attribute": "Attribute",
113+
"ProcessRunned": "Process \"{process}\" started",
114+
"ProcessStateChanged": "Process \"{process}\" changed state to \"{state}\"",
115+
"ProcessFinished": "Process \"{process}\" finished in \"{state}\""
113116
},
114117
"error": {
115118
"MethodNotFound": "Method not found: {methodId}",

plugins/process-assets/lang/es.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@
109109
"AddResult": "Agregar resultado",
110110
"For": "Para",
111111
"Context": "Contexto",
112-
"Attribute": "Atributo"
112+
"Attribute": "Atributo",
113+
"ProcessRunned": "Proceso \"{process}\" iniciado",
114+
"ProcessStateChanged": "Estado del proceso \"{process}\" cambiado a \"{state}\"",
115+
"ProcessFinished": "Proceso \"{process}\" finalizado en estado \"{state}\""
113116
},
114117
"error": {
115118
"MethodNotFound": "Método no encontrado: {methodId}",

0 commit comments

Comments
 (0)