@conduction/nextcloud-vue 2.170.0 → 2.172.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +22 -3
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js +9 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js +242 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js +200 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js +9 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js +186 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js +24 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js +3 -15
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js +16 -61
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js +9 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js +120 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js +86 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js.map +1 -0
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +9 -9
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +75 -4
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js +8 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js.map +1 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js +101 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js.map +1 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js +54 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js.map +1 -0
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +7 -3
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +14 -2
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +21 -2
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +7 -0
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +2 -2
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +11 -0
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +2 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue.js +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue.js +9 -0
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue.js.map +1 -0
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue2.js +248 -0
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue2.js.map +1 -0
- package/dist/esm/components/{CnMassDeleteDialog/CnMassDeleteDialog.vue3.js → CnMassActionDialog/CnMassActionDialog.vue3.js} +66 -52
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue3.js.map +1 -0
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue.js +0 -3
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue.js.map +1 -1
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue2.js +25 -121
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue.js +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js +11 -3
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +21 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js +2 -2
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +23 -5
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +3 -0
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +14 -4
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnConfirmDialog.vue.js +1 -1
- package/dist/esm/dialogs/CnConfirmDialog.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnConfirmDialog.vue3.js +5 -3
- package/dist/esm/dialogs/CnConfirmDialog.vue3.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +16 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +16 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +908 -464
- package/dist/esm/utils/builtInFormatters.js +19 -1
- package/dist/esm/utils/builtInFormatters.js.map +1 -1
- package/dist/esm/utils/noteThreads.js +14 -2
- package/dist/esm/utils/noteThreads.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +11435 -10084
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +908 -464
- package/l10n/en.json +16 -1
- package/l10n/nl.json +16 -1
- package/package.json +1 -1
- package/scripts/.jsdoc-baselines.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +4 -1
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +24 -3
- package/src/components/CnConditionGroupEditor/CnConditionGroup.vue +528 -0
- package/src/components/CnConditionGroupEditor/CnConditionGroupEditor.vue +211 -0
- package/src/components/CnConditionGroupEditor/index.js +9 -0
- package/src/components/CnConditionListEditor/CnConditionListEditor.vue +15 -78
- package/src/components/CnConditionListEditor/CnConditionRow.vue +226 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue +6 -0
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +0 -6
- package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +75 -4
- package/src/components/CnDialogActions/CnDialogActions.vue +124 -0
- package/src/components/CnDialogActions/index.js +7 -0
- package/src/components/CnFactsWidget/CnFactsWidget.vue +7 -3
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +15 -3
- package/src/components/CnFilesBrowser/filesBrowser.js +21 -2
- package/src/components/CnFlowsPage/CnFlowBoard.vue +10 -3
- package/src/components/CnFlowsPage/CnFlowEditorPage.vue +12 -0
- package/src/components/CnLinkedWidget/CnLinkedWidget.vue +7 -0
- package/src/components/CnMassActionDialog/CnMassActionDialog.vue +382 -0
- package/src/components/CnMassActionDialog/index.js +7 -0
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.md +4 -0
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +25 -254
- package/src/components/CnNotesCard/CnNotesCard.vue +12 -4
- package/src/components/CnObjectSidebar/CnNotesTab.vue +23 -3
- package/src/components/CnTreeView/CnTreeNode.vue +10 -1
- package/src/components/CnTreeView/CnTreeView.vue +9 -0
- package/src/components/index.js +3 -0
- package/src/css/context-menu.css +7 -0
- package/src/css/look-board-detail.css +220 -2
- package/src/css/look-board-index.css +7 -6
- package/src/css/look-board.css +43 -2
- package/src/css/patches.css +4 -1
- package/src/dialogs/CnConfirmDialog.vue +3 -1
- package/src/index.js +3 -0
- package/src/utils/builtInFormatters.js +18 -0
- package/src/utils/noteThreads.js +13 -1
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue3.js.map +0 -1
|
@@ -227,6 +227,17 @@ var script = {
|
|
|
227
227
|
type: String,
|
|
228
228
|
default: 'cards',
|
|
229
229
|
},
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Board look: how the Active switch is named. `state` names it
|
|
233
|
+
* Active or Paused after the flow; `fixed` always names it Active
|
|
234
|
+
* and the switch shows the state (DqFlow). Manifest key
|
|
235
|
+
* `config.toggleLabel`.
|
|
236
|
+
*/
|
|
237
|
+
toggleLabel: {
|
|
238
|
+
type: String,
|
|
239
|
+
default: 'state',
|
|
240
|
+
},
|
|
230
241
|
},
|
|
231
242
|
|
|
232
243
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFlowEditorPage.vue2.js","sources":["../../../../src/components/CnFlowsPage/CnFlowEditorPage.vue"],"sourcesContent":["<!-- SPDX-License-Identifier: EUPL-1.2 -->\n<!-- Copyright (C) 2026 Conduction B.V. -->\n<template>\n\t<CnFlowBoard v-if=\"isBoard\"\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t:detailRoute=\"detailRoute\"\n\t\t:listLabel=\"listLabel ? cnTranslate(listLabel) : ''\"\n\t\t:breadcrumb=\"(breadcrumb || []).map((crumb) => ({ ...crumb, label: cnTranslate(crumb.label) }))\"\n\t\t:palette=\"palette\"\n\t\t:paletteFootnote=\"paletteFootnote ? cnTranslate(paletteFootnote) : ''\"\n\t\t:paletteGroups=\"translatedPaletteGroups\"\n\t\t:flowDirection=\"flowDirection\"\n\t\t:layout=\"layout\"\n\t\t:nodeLook=\"nodeLook\"\n\t\t:notice=\"notice ? cnTranslate(notice) : ''\"\n\t\t:saveAsVersion=\"saveAsVersion\"\n\t\t:metaParts=\"metaParts\"\n\t\t:metaNote=\"metaNote ? cnTranslate(metaNote) : ''\"\n\t\t:pill=\"pill ? cnTranslate(pill) : ''\"\n\t\t:pillVariant=\"pillVariant\"\n\t\t:testSubject=\"testSubject ? { ...testSubject, label: testSubject.label ? cnTranslate(testSubject.label) : '' } : null\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n\t<CnFlowDetail v-else\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n</template>\n\n<script>\nimport CnFlowDetail from '../CnFlowDetail/CnFlowDetail.vue'\nimport CnFlowBoard from './CnFlowBoard.vue'\nimport { useFlowStore } from '../../composables/useFlowStore.js'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * The flow canvas — manifest page type `flow-detail`.\n *\n * Mounts the shared `CnFlowDetail` node/edge canvas over OpenRegister's one\n * native flow store (ADR-065, ADR-098), scoped to the owning app. Pair it with\n * a `type: \"flows\"` page at `/flows`; this one takes `/flows/:id`.\n *\n * Controls belong in Nextcloud's app sidebar so the canvas keeps the full\n * width — declare `\"sidebarComponent\"` on the manifest page, or mount\n * `CnFlowSidebar` yourself. Canvas and sidebar share `useFlowStore`, which is\n * why neither needs props from the other.\n *\n * Manifest declaration:\n *\n * { \"id\": \"FlowDetail\", \"route\": \"/flows/:id\", \"type\": \"flow-detail\",\n * \"title\": \"Flow\", \"config\": { \"app\": \"dossiq\" } }\n */\nexport default {\n\tname: 'CnFlowEditorPage',\n\n\tcomponents: { CnFlowBoard, CnFlowDetail },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The owning app id, stamped on a flow created here so the app-scoped\n\t\t * list finds it again. Omit only on the fleet-wide surface.\n\t\t */\n\t\tapp: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The flow id to open. Defaults to the `id` route param, which is the\n\t\t * normal case; pass it explicitly only when mounting outside a route.\n\t\t * The literal `new` opens an unsaved flow.\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Route path the editor lives under, used to swap the URL once a new\n\t\t * flow gets its server-assigned id.\n\t\t */\n\t\tdetailRoute: {\n\t\t\ttype: String,\n\t\t\tdefault: '/flows',\n\t\t},\n\n\t\t/**\n\t\t * A run to open on arrival. Defaults to the `run` query parameter,\n\t\t * which is where a run's own address lands: `/flow-runs/{uuid}` reads\n\t\t * the run, finds its flow and redirects to `/flows/{id}?run={uuid}`.\n\t\t * Pass it explicitly only when mounting outside a route.\n\t\t */\n\t\trun: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Draw this page in the `board` look (or `nextcloud`) whatever the app\n\t\t * does. Empty follows the app's look. Manifest key `config.look`.\n\t\t */\n\t\tlook: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: where steps come from. `picker` (default) keeps \"Add a\n\t\t * step\" in the canvas toolbar; `column` draws the palette as a card\n\t\t * beside the canvas, grouped by the app that provides each step.\n\t\t * Manifest key `config.palette`.\n\t\t */\n\t\tpalette: {\n\t\t\ttype: String,\n\t\t\tdefault: 'picker',\n\t\t},\n\n\t\t/**\n\t\t * Board look: a line under the palette card. Manifest key\n\t\t * `config.paletteFootnote`, translated with the app's catalogue.\n\t\t */\n\t\tpaletteFootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the palette's groups as the page curates them,\n\t\t * `[{ app?, label?, pill?, tone?, entries: [{ type, label?, short? }] }]`;\n\t\t * every other step stays behind \"More steps\". Labels are translated\n\t\t * with the app's catalogue. Manifest key `config.paletteGroups`.\n\t\t */\n\t\tpaletteGroups: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `card` draws each step as a card with its name and the\n\t\t * pill of the app that does it; `type` (default) keeps the type line\n\t\t * over the name. Manifest key `config.nodeLook`.\n\t\t */\n\t\tnodeLook: {\n\t\t\ttype: String,\n\t\t\tdefault: 'type',\n\t\t},\n\n\t\t/**\n\t\t * Board look: `down` lays the steps out top to bottom and opens them\n\t\t * at their own size instead of zoomed to fit; `right` (default) lays\n\t\t * them left to right. Manifest key `config.flowDirection`.\n\t\t */\n\t\tflowDirection: {\n\t\t\ttype: String,\n\t\t\tdefault: 'right',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the records a test run can take as its subject,\n\t\t * `{ register, schema, labelField?, label? }`. Manifest key\n\t\t * `config.testSubject`; `label` is translated with the app's catalogue.\n\t\t */\n\t\ttestSubject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Board look: an info notice under the path. Manifest key\n\t\t * `config.notice`, translated with the app's catalogue; `{name}` is\n\t\t * the flow's name.\n\t\t */\n\t\tnotice: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: edit a published flow in place; Save publishes the edits\n\t\t * as the next version and runs already started keep theirs. Manifest\n\t\t * key `config.saveAsVersion`.\n\t\t */\n\t\tsaveAsVersion: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Board look: which of `trigger`, `steps`, `version` and `saved` the\n\t\t * path names after the flow, in that order. Manifest key\n\t\t * `config.metaParts`.\n\t\t */\n\t\tmetaParts: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => ['trigger', 'steps', 'version'],\n\t\t},\n\n\t\t/**\n\t\t * Board look: a closing note after the path's meta (\"changes apply to\n\t\t * new cases\"), translated. Manifest key `config.metaNote`.\n\t\t */\n\t\tmetaNote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the pill beside the flow's name (\"Case type flow\").\n\t\t * Empty shows the lifecycle for a draft or retired flow. Manifest key\n\t\t * `config.pill`.\n\t\t */\n\t\tpill: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the tone of `pill` (a CnStatusBadge variant, \"teal\" on\n\t\t * DqFlow). Manifest key `config.pillVariant`.\n\t\t */\n\t\tpillVariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the list's name at the start of the path (\"Settings /\n\t\t * Flows\"). Empty reads \"Flows\". Manifest key `config.listLabel`.\n\t\t */\n\t\tlistLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the levels before the flow, each its own link\n\t\t * (`[{ label, href? }]`, \"Settings\" / \"Flows\"); a crumb without an\n\t\t * href links to the flow list. Labels are translated with the app's\n\t\t * catalogue. Manifest key `config.breadcrumb`; wins over `listLabel`.\n\t\t */\n\t\tbreadcrumb: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `canvas` lays the page out as boards PqFlow and PqFlowRun\n\t\t * draw it (actions under the title, the canvas without a frame, a\n\t\t * floating inspector); `cards` keeps the DqFlow grid. Manifest key\n\t\t * `config.layout`.\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: 'cards',\n\t\t},\n\t},\n\n\t/**\n\t * Share the one flow store with the toolbar's save/run handlers, and\n\t * resolve the look (`look` is read here, through `useLook`).\n\t *\n\t * @param {object} props The component props.\n\t * @return {object} The setup bindings.\n\t */\n\tsetup(props) {\n\t\tconst { isBoard } = useLook(props)\n\t\treturn { store: useFlowStore(), isBoard }\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {string} The flow id being edited.\n\t\t */\n\t\tflowId() {\n\t\t\treturn this.id || this.$route?.params?.id || ''\n\t\t},\n\n\t\t/**\n\t\t * @return {Array<object>} The curated palette groups with their labels translated.\n\t\t */\n\t\ttranslatedPaletteGroups() {\n\t\t\tconst tr = (text) => (text ? this.cnTranslate(text) : text)\n\t\t\treturn (this.paletteGroups || []).map((group) => ({\n\t\t\t\t...group,\n\t\t\t\tlabel: tr(group?.label),\n\t\t\t\tpill: tr(group?.pill),\n\t\t\t\tentries: (group?.entries || []).map((step) => ({ ...step, label: tr(step?.label), short: tr(step?.short) })),\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The run to open on arrival, or an empty string.\n\t\t */\n\t\trunUuid() {\n\t\t\treturn this.run || this.$route?.query?.run || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onSave() {\n\t\t\tconst saved = await this.store.save()\n\t\t\t// A newly created flow gets its id from the server, so the route has\n\t\t\t// to catch up or a reload would land back on `new` and lose it.\n\t\t\tif (saved?.id && this.flowId === 'new') {\n\t\t\t\tthis.$router.replace(`${this.detailRoute}/${saved.id}`)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onRun() {\n\t\t\tawait this.store.run({})\n\t\t},\n\t},\n}\n</script>\n"],"names":["CnFlowBoard","CnFlowDetail"],"mappings":";;;;;AAuCA;AACC;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,kBAAkB;;AAExB,CAAA,UAAU,EAAE,eAAEA,UAAW,gBAAEC,cAAc;;AAEzC,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;;;EAIA,GAAG,EAAE;GACJ,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;AAED;;;AAGC;;AAED,EAAA,EAAE,EAAE;GACH,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;;;;EAIA,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,QAAQ;GACjB;;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,EAAE,CAAC,IAAI,EAAE,KAAK,CAAA,EAAG,CAAC,CAAC;AAC7G,IAAC,CAAC,CAAA;GACF;;AAED;;;AAGA,EAAA,OAAO,GAAG;AACT,GAAA,OAAO,IAAI,CAAC,GAAI,IAAG,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,GAAI,IAAG,EAAC;GAC/C;EACD;;AAED,CAAA,OAAO,EAAE;AACR;;;EAGA,MAAM,MAAM,GAAG;AACd,GAAA,MAAM,KAAM,GAAE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,GAAC;;;AAGpC,GAAA,IAAI,KAAK,EAAE,EAAC,IAAK,IAAI,CAAC,MAAO,KAAI,KAAK,EAAE;IACvC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAA;AACvD,IAAA;GACA;;AAED;;;EAGA,MAAM,KAAK,GAAG;GACb,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAA;GACvB;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnFlowEditorPage.vue2.js","sources":["../../../../src/components/CnFlowsPage/CnFlowEditorPage.vue"],"sourcesContent":["<!-- SPDX-License-Identifier: EUPL-1.2 -->\n<!-- Copyright (C) 2026 Conduction B.V. -->\n<template>\n\t<CnFlowBoard v-if=\"isBoard\"\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t:detailRoute=\"detailRoute\"\n\t\t:listLabel=\"listLabel ? cnTranslate(listLabel) : ''\"\n\t\t:breadcrumb=\"(breadcrumb || []).map((crumb) => ({ ...crumb, label: cnTranslate(crumb.label) }))\"\n\t\t:palette=\"palette\"\n\t\t:paletteFootnote=\"paletteFootnote ? cnTranslate(paletteFootnote) : ''\"\n\t\t:paletteGroups=\"translatedPaletteGroups\"\n\t\t:flowDirection=\"flowDirection\"\n\t\t:layout=\"layout\"\n\t\t:toggleLabel=\"toggleLabel\"\n\t\t:nodeLook=\"nodeLook\"\n\t\t:notice=\"notice ? cnTranslate(notice) : ''\"\n\t\t:saveAsVersion=\"saveAsVersion\"\n\t\t:metaParts=\"metaParts\"\n\t\t:metaNote=\"metaNote ? cnTranslate(metaNote) : ''\"\n\t\t:pill=\"pill ? cnTranslate(pill) : ''\"\n\t\t:pillVariant=\"pillVariant\"\n\t\t:testSubject=\"testSubject ? { ...testSubject, label: testSubject.label ? cnTranslate(testSubject.label) : '' } : null\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n\t<CnFlowDetail v-else\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n</template>\n\n<script>\nimport CnFlowDetail from '../CnFlowDetail/CnFlowDetail.vue'\nimport CnFlowBoard from './CnFlowBoard.vue'\nimport { useFlowStore } from '../../composables/useFlowStore.js'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * The flow canvas — manifest page type `flow-detail`.\n *\n * Mounts the shared `CnFlowDetail` node/edge canvas over OpenRegister's one\n * native flow store (ADR-065, ADR-098), scoped to the owning app. Pair it with\n * a `type: \"flows\"` page at `/flows`; this one takes `/flows/:id`.\n *\n * Controls belong in Nextcloud's app sidebar so the canvas keeps the full\n * width — declare `\"sidebarComponent\"` on the manifest page, or mount\n * `CnFlowSidebar` yourself. Canvas and sidebar share `useFlowStore`, which is\n * why neither needs props from the other.\n *\n * Manifest declaration:\n *\n * { \"id\": \"FlowDetail\", \"route\": \"/flows/:id\", \"type\": \"flow-detail\",\n * \"title\": \"Flow\", \"config\": { \"app\": \"dossiq\" } }\n */\nexport default {\n\tname: 'CnFlowEditorPage',\n\n\tcomponents: { CnFlowBoard, CnFlowDetail },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The owning app id, stamped on a flow created here so the app-scoped\n\t\t * list finds it again. Omit only on the fleet-wide surface.\n\t\t */\n\t\tapp: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The flow id to open. Defaults to the `id` route param, which is the\n\t\t * normal case; pass it explicitly only when mounting outside a route.\n\t\t * The literal `new` opens an unsaved flow.\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Route path the editor lives under, used to swap the URL once a new\n\t\t * flow gets its server-assigned id.\n\t\t */\n\t\tdetailRoute: {\n\t\t\ttype: String,\n\t\t\tdefault: '/flows',\n\t\t},\n\n\t\t/**\n\t\t * A run to open on arrival. Defaults to the `run` query parameter,\n\t\t * which is where a run's own address lands: `/flow-runs/{uuid}` reads\n\t\t * the run, finds its flow and redirects to `/flows/{id}?run={uuid}`.\n\t\t * Pass it explicitly only when mounting outside a route.\n\t\t */\n\t\trun: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Draw this page in the `board` look (or `nextcloud`) whatever the app\n\t\t * does. Empty follows the app's look. Manifest key `config.look`.\n\t\t */\n\t\tlook: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: where steps come from. `picker` (default) keeps \"Add a\n\t\t * step\" in the canvas toolbar; `column` draws the palette as a card\n\t\t * beside the canvas, grouped by the app that provides each step.\n\t\t * Manifest key `config.palette`.\n\t\t */\n\t\tpalette: {\n\t\t\ttype: String,\n\t\t\tdefault: 'picker',\n\t\t},\n\n\t\t/**\n\t\t * Board look: a line under the palette card. Manifest key\n\t\t * `config.paletteFootnote`, translated with the app's catalogue.\n\t\t */\n\t\tpaletteFootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the palette's groups as the page curates them,\n\t\t * `[{ app?, label?, pill?, tone?, entries: [{ type, label?, short? }] }]`;\n\t\t * every other step stays behind \"More steps\". Labels are translated\n\t\t * with the app's catalogue. Manifest key `config.paletteGroups`.\n\t\t */\n\t\tpaletteGroups: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `card` draws each step as a card with its name and the\n\t\t * pill of the app that does it; `type` (default) keeps the type line\n\t\t * over the name. Manifest key `config.nodeLook`.\n\t\t */\n\t\tnodeLook: {\n\t\t\ttype: String,\n\t\t\tdefault: 'type',\n\t\t},\n\n\t\t/**\n\t\t * Board look: `down` lays the steps out top to bottom and opens them\n\t\t * at their own size instead of zoomed to fit; `right` (default) lays\n\t\t * them left to right. Manifest key `config.flowDirection`.\n\t\t */\n\t\tflowDirection: {\n\t\t\ttype: String,\n\t\t\tdefault: 'right',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the records a test run can take as its subject,\n\t\t * `{ register, schema, labelField?, label? }`. Manifest key\n\t\t * `config.testSubject`; `label` is translated with the app's catalogue.\n\t\t */\n\t\ttestSubject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Board look: an info notice under the path. Manifest key\n\t\t * `config.notice`, translated with the app's catalogue; `{name}` is\n\t\t * the flow's name.\n\t\t */\n\t\tnotice: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: edit a published flow in place; Save publishes the edits\n\t\t * as the next version and runs already started keep theirs. Manifest\n\t\t * key `config.saveAsVersion`.\n\t\t */\n\t\tsaveAsVersion: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Board look: which of `trigger`, `steps`, `version` and `saved` the\n\t\t * path names after the flow, in that order. Manifest key\n\t\t * `config.metaParts`.\n\t\t */\n\t\tmetaParts: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => ['trigger', 'steps', 'version'],\n\t\t},\n\n\t\t/**\n\t\t * Board look: a closing note after the path's meta (\"changes apply to\n\t\t * new cases\"), translated. Manifest key `config.metaNote`.\n\t\t */\n\t\tmetaNote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the pill beside the flow's name (\"Case type flow\").\n\t\t * Empty shows the lifecycle for a draft or retired flow. Manifest key\n\t\t * `config.pill`.\n\t\t */\n\t\tpill: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the tone of `pill` (a CnStatusBadge variant, \"teal\" on\n\t\t * DqFlow). Manifest key `config.pillVariant`.\n\t\t */\n\t\tpillVariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the list's name at the start of the path (\"Settings /\n\t\t * Flows\"). Empty reads \"Flows\". Manifest key `config.listLabel`.\n\t\t */\n\t\tlistLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the levels before the flow, each its own link\n\t\t * (`[{ label, href? }]`, \"Settings\" / \"Flows\"); a crumb without an\n\t\t * href links to the flow list. Labels are translated with the app's\n\t\t * catalogue. Manifest key `config.breadcrumb`; wins over `listLabel`.\n\t\t */\n\t\tbreadcrumb: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `canvas` lays the page out as boards PqFlow and PqFlowRun\n\t\t * draw it (actions under the title, the canvas without a frame, a\n\t\t * floating inspector); `cards` keeps the DqFlow grid. Manifest key\n\t\t * `config.layout`.\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: 'cards',\n\t\t},\n\n\t\t/**\n\t\t * Board look: how the Active switch is named. `state` names it\n\t\t * Active or Paused after the flow; `fixed` always names it Active\n\t\t * and the switch shows the state (DqFlow). Manifest key\n\t\t * `config.toggleLabel`.\n\t\t */\n\t\ttoggleLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: 'state',\n\t\t},\n\t},\n\n\t/**\n\t * Share the one flow store with the toolbar's save/run handlers, and\n\t * resolve the look (`look` is read here, through `useLook`).\n\t *\n\t * @param {object} props The component props.\n\t * @return {object} The setup bindings.\n\t */\n\tsetup(props) {\n\t\tconst { isBoard } = useLook(props)\n\t\treturn { store: useFlowStore(), isBoard }\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {string} The flow id being edited.\n\t\t */\n\t\tflowId() {\n\t\t\treturn this.id || this.$route?.params?.id || ''\n\t\t},\n\n\t\t/**\n\t\t * @return {Array<object>} The curated palette groups with their labels translated.\n\t\t */\n\t\ttranslatedPaletteGroups() {\n\t\t\tconst tr = (text) => (text ? this.cnTranslate(text) : text)\n\t\t\treturn (this.paletteGroups || []).map((group) => ({\n\t\t\t\t...group,\n\t\t\t\tlabel: tr(group?.label),\n\t\t\t\tpill: tr(group?.pill),\n\t\t\t\tentries: (group?.entries || []).map((step) => ({ ...step, label: tr(step?.label), short: tr(step?.short) })),\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The run to open on arrival, or an empty string.\n\t\t */\n\t\trunUuid() {\n\t\t\treturn this.run || this.$route?.query?.run || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onSave() {\n\t\t\tconst saved = await this.store.save()\n\t\t\t// A newly created flow gets its id from the server, so the route has\n\t\t\t// to catch up or a reload would land back on `new` and lose it.\n\t\t\tif (saved?.id && this.flowId === 'new') {\n\t\t\t\tthis.$router.replace(`${this.detailRoute}/${saved.id}`)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onRun() {\n\t\t\tawait this.store.run({})\n\t\t},\n\t},\n}\n</script>\n"],"names":["CnFlowBoard","CnFlowDetail"],"mappings":";;;;;AAwCA;AACC;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAED,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EAAA;GACvB;EACD;AACF;;;;"}
|
|
@@ -18,6 +18,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
18
18
|
paletteGroups: $options.translatedPaletteGroups,
|
|
19
19
|
flowDirection: $props.flowDirection,
|
|
20
20
|
layout: $props.layout,
|
|
21
|
+
toggleLabel: $props.toggleLabel,
|
|
21
22
|
nodeLook: $props.nodeLook,
|
|
22
23
|
notice: $props.notice ? $options.cnTranslate($props.notice) : '',
|
|
23
24
|
saveAsVersion: $props.saveAsVersion,
|
|
@@ -28,7 +29,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
28
29
|
testSubject: $props.testSubject ? { ...$props.testSubject, label: $props.testSubject.label ? $options.cnTranslate($props.testSubject.label) : '' } : null,
|
|
29
30
|
onSave: $options.onSave,
|
|
30
31
|
onRun: $options.onRun
|
|
31
|
-
}, null, 8 /* PROPS */, ["id", "app", "run", "detailRoute", "listLabel", "breadcrumb", "palette", "paletteFootnote", "paletteGroups", "flowDirection", "layout", "nodeLook", "notice", "saveAsVersion", "metaParts", "metaNote", "pill", "pillVariant", "testSubject", "onSave", "onRun"]))
|
|
32
|
+
}, null, 8 /* PROPS */, ["id", "app", "run", "detailRoute", "listLabel", "breadcrumb", "palette", "paletteFootnote", "paletteGroups", "flowDirection", "layout", "toggleLabel", "nodeLook", "notice", "saveAsVersion", "metaParts", "metaNote", "pill", "pillVariant", "testSubject", "onSave", "onRun"]))
|
|
32
33
|
: (openBlock(), createBlock(_component_CnFlowDetail, {
|
|
33
34
|
key: 1,
|
|
34
35
|
id: $options.flowId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFlowEditorPage.vue3.js","sources":["../../../../src/components/CnFlowsPage/CnFlowEditorPage.vue?vue&type=template&id=1a55df42&lang.js"],"sourcesContent":["<!-- SPDX-License-Identifier: EUPL-1.2 -->\n<!-- Copyright (C) 2026 Conduction B.V. -->\n<template>\n\t<CnFlowBoard v-if=\"isBoard\"\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t:detailRoute=\"detailRoute\"\n\t\t:listLabel=\"listLabel ? cnTranslate(listLabel) : ''\"\n\t\t:breadcrumb=\"(breadcrumb || []).map((crumb) => ({ ...crumb, label: cnTranslate(crumb.label) }))\"\n\t\t:palette=\"palette\"\n\t\t:paletteFootnote=\"paletteFootnote ? cnTranslate(paletteFootnote) : ''\"\n\t\t:paletteGroups=\"translatedPaletteGroups\"\n\t\t:flowDirection=\"flowDirection\"\n\t\t:layout=\"layout\"\n\t\t:nodeLook=\"nodeLook\"\n\t\t:notice=\"notice ? cnTranslate(notice) : ''\"\n\t\t:saveAsVersion=\"saveAsVersion\"\n\t\t:metaParts=\"metaParts\"\n\t\t:metaNote=\"metaNote ? cnTranslate(metaNote) : ''\"\n\t\t:pill=\"pill ? cnTranslate(pill) : ''\"\n\t\t:pillVariant=\"pillVariant\"\n\t\t:testSubject=\"testSubject ? { ...testSubject, label: testSubject.label ? cnTranslate(testSubject.label) : '' } : null\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n\t<CnFlowDetail v-else\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n</template>\n\n<script>\nimport CnFlowDetail from '../CnFlowDetail/CnFlowDetail.vue'\nimport CnFlowBoard from './CnFlowBoard.vue'\nimport { useFlowStore } from '../../composables/useFlowStore.js'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * The flow canvas — manifest page type `flow-detail`.\n *\n * Mounts the shared `CnFlowDetail` node/edge canvas over OpenRegister's one\n * native flow store (ADR-065, ADR-098), scoped to the owning app. Pair it with\n * a `type: \"flows\"` page at `/flows`; this one takes `/flows/:id`.\n *\n * Controls belong in Nextcloud's app sidebar so the canvas keeps the full\n * width — declare `\"sidebarComponent\"` on the manifest page, or mount\n * `CnFlowSidebar` yourself. Canvas and sidebar share `useFlowStore`, which is\n * why neither needs props from the other.\n *\n * Manifest declaration:\n *\n * { \"id\": \"FlowDetail\", \"route\": \"/flows/:id\", \"type\": \"flow-detail\",\n * \"title\": \"Flow\", \"config\": { \"app\": \"dossiq\" } }\n */\nexport default {\n\tname: 'CnFlowEditorPage',\n\n\tcomponents: { CnFlowBoard, CnFlowDetail },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The owning app id, stamped on a flow created here so the app-scoped\n\t\t * list finds it again. Omit only on the fleet-wide surface.\n\t\t */\n\t\tapp: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The flow id to open. Defaults to the `id` route param, which is the\n\t\t * normal case; pass it explicitly only when mounting outside a route.\n\t\t * The literal `new` opens an unsaved flow.\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Route path the editor lives under, used to swap the URL once a new\n\t\t * flow gets its server-assigned id.\n\t\t */\n\t\tdetailRoute: {\n\t\t\ttype: String,\n\t\t\tdefault: '/flows',\n\t\t},\n\n\t\t/**\n\t\t * A run to open on arrival. Defaults to the `run` query parameter,\n\t\t * which is where a run's own address lands: `/flow-runs/{uuid}` reads\n\t\t * the run, finds its flow and redirects to `/flows/{id}?run={uuid}`.\n\t\t * Pass it explicitly only when mounting outside a route.\n\t\t */\n\t\trun: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Draw this page in the `board` look (or `nextcloud`) whatever the app\n\t\t * does. Empty follows the app's look. Manifest key `config.look`.\n\t\t */\n\t\tlook: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: where steps come from. `picker` (default) keeps \"Add a\n\t\t * step\" in the canvas toolbar; `column` draws the palette as a card\n\t\t * beside the canvas, grouped by the app that provides each step.\n\t\t * Manifest key `config.palette`.\n\t\t */\n\t\tpalette: {\n\t\t\ttype: String,\n\t\t\tdefault: 'picker',\n\t\t},\n\n\t\t/**\n\t\t * Board look: a line under the palette card. Manifest key\n\t\t * `config.paletteFootnote`, translated with the app's catalogue.\n\t\t */\n\t\tpaletteFootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the palette's groups as the page curates them,\n\t\t * `[{ app?, label?, pill?, tone?, entries: [{ type, label?, short? }] }]`;\n\t\t * every other step stays behind \"More steps\". Labels are translated\n\t\t * with the app's catalogue. Manifest key `config.paletteGroups`.\n\t\t */\n\t\tpaletteGroups: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `card` draws each step as a card with its name and the\n\t\t * pill of the app that does it; `type` (default) keeps the type line\n\t\t * over the name. Manifest key `config.nodeLook`.\n\t\t */\n\t\tnodeLook: {\n\t\t\ttype: String,\n\t\t\tdefault: 'type',\n\t\t},\n\n\t\t/**\n\t\t * Board look: `down` lays the steps out top to bottom and opens them\n\t\t * at their own size instead of zoomed to fit; `right` (default) lays\n\t\t * them left to right. Manifest key `config.flowDirection`.\n\t\t */\n\t\tflowDirection: {\n\t\t\ttype: String,\n\t\t\tdefault: 'right',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the records a test run can take as its subject,\n\t\t * `{ register, schema, labelField?, label? }`. Manifest key\n\t\t * `config.testSubject`; `label` is translated with the app's catalogue.\n\t\t */\n\t\ttestSubject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Board look: an info notice under the path. Manifest key\n\t\t * `config.notice`, translated with the app's catalogue; `{name}` is\n\t\t * the flow's name.\n\t\t */\n\t\tnotice: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: edit a published flow in place; Save publishes the edits\n\t\t * as the next version and runs already started keep theirs. Manifest\n\t\t * key `config.saveAsVersion`.\n\t\t */\n\t\tsaveAsVersion: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Board look: which of `trigger`, `steps`, `version` and `saved` the\n\t\t * path names after the flow, in that order. Manifest key\n\t\t * `config.metaParts`.\n\t\t */\n\t\tmetaParts: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => ['trigger', 'steps', 'version'],\n\t\t},\n\n\t\t/**\n\t\t * Board look: a closing note after the path's meta (\"changes apply to\n\t\t * new cases\"), translated. Manifest key `config.metaNote`.\n\t\t */\n\t\tmetaNote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the pill beside the flow's name (\"Case type flow\").\n\t\t * Empty shows the lifecycle for a draft or retired flow. Manifest key\n\t\t * `config.pill`.\n\t\t */\n\t\tpill: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the tone of `pill` (a CnStatusBadge variant, \"teal\" on\n\t\t * DqFlow). Manifest key `config.pillVariant`.\n\t\t */\n\t\tpillVariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the list's name at the start of the path (\"Settings /\n\t\t * Flows\"). Empty reads \"Flows\". Manifest key `config.listLabel`.\n\t\t */\n\t\tlistLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the levels before the flow, each its own link\n\t\t * (`[{ label, href? }]`, \"Settings\" / \"Flows\"); a crumb without an\n\t\t * href links to the flow list. Labels are translated with the app's\n\t\t * catalogue. Manifest key `config.breadcrumb`; wins over `listLabel`.\n\t\t */\n\t\tbreadcrumb: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `canvas` lays the page out as boards PqFlow and PqFlowRun\n\t\t * draw it (actions under the title, the canvas without a frame, a\n\t\t * floating inspector); `cards` keeps the DqFlow grid. Manifest key\n\t\t * `config.layout`.\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: 'cards',\n\t\t},\n\t},\n\n\t/**\n\t * Share the one flow store with the toolbar's save/run handlers, and\n\t * resolve the look (`look` is read here, through `useLook`).\n\t *\n\t * @param {object} props The component props.\n\t * @return {object} The setup bindings.\n\t */\n\tsetup(props) {\n\t\tconst { isBoard } = useLook(props)\n\t\treturn { store: useFlowStore(), isBoard }\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {string} The flow id being edited.\n\t\t */\n\t\tflowId() {\n\t\t\treturn this.id || this.$route?.params?.id || ''\n\t\t},\n\n\t\t/**\n\t\t * @return {Array<object>} The curated palette groups with their labels translated.\n\t\t */\n\t\ttranslatedPaletteGroups() {\n\t\t\tconst tr = (text) => (text ? this.cnTranslate(text) : text)\n\t\t\treturn (this.paletteGroups || []).map((group) => ({\n\t\t\t\t...group,\n\t\t\t\tlabel: tr(group?.label),\n\t\t\t\tpill: tr(group?.pill),\n\t\t\t\tentries: (group?.entries || []).map((step) => ({ ...step, label: tr(step?.label), short: tr(step?.short) })),\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The run to open on arrival, or an empty string.\n\t\t */\n\t\trunUuid() {\n\t\t\treturn this.run || this.$route?.query?.run || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onSave() {\n\t\t\tconst saved = await this.store.save()\n\t\t\t// A newly created flow gets its id from the server, so the route has\n\t\t\t// to catch up or a reload would land back on `new` and lose it.\n\t\t\tif (saved?.id && this.flowId === 'new') {\n\t\t\t\tthis.$router.replace(`${this.detailRoute}/${saved.id}`)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onRun() {\n\t\t\tawait this.store.run({})\n\t\t},\n\t},\n}\n</script>\n"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G,QAAA,CAAA,WAAU,CAAE,MAAI,CAAA,IAAA,CAAA,GAAA,EAAA;AAC7B,QAAA,WAAW,EAAC,MAAA,CAAA,WAAA;AACZ,QAAA,WAAU,EAAG,MAAA,CAAA,WAAA,GAAA,EAAA,GAAA,MAAA,CAAA,WAAA,EAAA,KAAA,EAAA,MAAA,CAAA,WAAA,CAAA,KAAA,GAAA,QAAA,CAAA,WAAA,CAAA,MAAA,CAAA,WAAA,CAAA,KAAA,CAAA,GAAA,EAAA,EAAA,GAAA,IAAA;AACb,QAAA,MAAI,EAAE,QAAM,CAAA,MAAA;AACZ,QAAA,KAAG,EAAE,QAAK,CAAA,KAAA;;oBACXA;;AACC,QAAA,EAAE,EAAE,QAAM,CAAA,MAAA;AACV,QAAA,GAAG,EAAE,MAAG,CAAA,GAAA;AACR,QAAA,GAAG,EAAE,QAAO,CAAA,OAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnFlowEditorPage.vue3.js","sources":["../../../../src/components/CnFlowsPage/CnFlowEditorPage.vue?vue&type=template&id=d8a88ce6&lang.js"],"sourcesContent":["<!-- SPDX-License-Identifier: EUPL-1.2 -->\n<!-- Copyright (C) 2026 Conduction B.V. -->\n<template>\n\t<CnFlowBoard v-if=\"isBoard\"\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t:detailRoute=\"detailRoute\"\n\t\t:listLabel=\"listLabel ? cnTranslate(listLabel) : ''\"\n\t\t:breadcrumb=\"(breadcrumb || []).map((crumb) => ({ ...crumb, label: cnTranslate(crumb.label) }))\"\n\t\t:palette=\"palette\"\n\t\t:paletteFootnote=\"paletteFootnote ? cnTranslate(paletteFootnote) : ''\"\n\t\t:paletteGroups=\"translatedPaletteGroups\"\n\t\t:flowDirection=\"flowDirection\"\n\t\t:layout=\"layout\"\n\t\t:toggleLabel=\"toggleLabel\"\n\t\t:nodeLook=\"nodeLook\"\n\t\t:notice=\"notice ? cnTranslate(notice) : ''\"\n\t\t:saveAsVersion=\"saveAsVersion\"\n\t\t:metaParts=\"metaParts\"\n\t\t:metaNote=\"metaNote ? cnTranslate(metaNote) : ''\"\n\t\t:pill=\"pill ? cnTranslate(pill) : ''\"\n\t\t:pillVariant=\"pillVariant\"\n\t\t:testSubject=\"testSubject ? { ...testSubject, label: testSubject.label ? cnTranslate(testSubject.label) : '' } : null\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n\t<CnFlowDetail v-else\n\t\t:id=\"flowId\"\n\t\t:app=\"app\"\n\t\t:run=\"runUuid\"\n\t\t@save=\"onSave\"\n\t\t@run=\"onRun\" />\n</template>\n\n<script>\nimport CnFlowDetail from '../CnFlowDetail/CnFlowDetail.vue'\nimport CnFlowBoard from './CnFlowBoard.vue'\nimport { useFlowStore } from '../../composables/useFlowStore.js'\nimport { useLook } from '../../composables/useLook.js'\n\n/**\n * The flow canvas — manifest page type `flow-detail`.\n *\n * Mounts the shared `CnFlowDetail` node/edge canvas over OpenRegister's one\n * native flow store (ADR-065, ADR-098), scoped to the owning app. Pair it with\n * a `type: \"flows\"` page at `/flows`; this one takes `/flows/:id`.\n *\n * Controls belong in Nextcloud's app sidebar so the canvas keeps the full\n * width — declare `\"sidebarComponent\"` on the manifest page, or mount\n * `CnFlowSidebar` yourself. Canvas and sidebar share `useFlowStore`, which is\n * why neither needs props from the other.\n *\n * Manifest declaration:\n *\n * { \"id\": \"FlowDetail\", \"route\": \"/flows/:id\", \"type\": \"flow-detail\",\n * \"title\": \"Flow\", \"config\": { \"app\": \"dossiq\" } }\n */\nexport default {\n\tname: 'CnFlowEditorPage',\n\n\tcomponents: { CnFlowBoard, CnFlowDetail },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The owning app id, stamped on a flow created here so the app-scoped\n\t\t * list finds it again. Omit only on the fleet-wide surface.\n\t\t */\n\t\tapp: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The flow id to open. Defaults to the `id` route param, which is the\n\t\t * normal case; pass it explicitly only when mounting outside a route.\n\t\t * The literal `new` opens an unsaved flow.\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Route path the editor lives under, used to swap the URL once a new\n\t\t * flow gets its server-assigned id.\n\t\t */\n\t\tdetailRoute: {\n\t\t\ttype: String,\n\t\t\tdefault: '/flows',\n\t\t},\n\n\t\t/**\n\t\t * A run to open on arrival. Defaults to the `run` query parameter,\n\t\t * which is where a run's own address lands: `/flow-runs/{uuid}` reads\n\t\t * the run, finds its flow and redirects to `/flows/{id}?run={uuid}`.\n\t\t * Pass it explicitly only when mounting outside a route.\n\t\t */\n\t\trun: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Draw this page in the `board` look (or `nextcloud`) whatever the app\n\t\t * does. Empty follows the app's look. Manifest key `config.look`.\n\t\t */\n\t\tlook: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: where steps come from. `picker` (default) keeps \"Add a\n\t\t * step\" in the canvas toolbar; `column` draws the palette as a card\n\t\t * beside the canvas, grouped by the app that provides each step.\n\t\t * Manifest key `config.palette`.\n\t\t */\n\t\tpalette: {\n\t\t\ttype: String,\n\t\t\tdefault: 'picker',\n\t\t},\n\n\t\t/**\n\t\t * Board look: a line under the palette card. Manifest key\n\t\t * `config.paletteFootnote`, translated with the app's catalogue.\n\t\t */\n\t\tpaletteFootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the palette's groups as the page curates them,\n\t\t * `[{ app?, label?, pill?, tone?, entries: [{ type, label?, short? }] }]`;\n\t\t * every other step stays behind \"More steps\". Labels are translated\n\t\t * with the app's catalogue. Manifest key `config.paletteGroups`.\n\t\t */\n\t\tpaletteGroups: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `card` draws each step as a card with its name and the\n\t\t * pill of the app that does it; `type` (default) keeps the type line\n\t\t * over the name. Manifest key `config.nodeLook`.\n\t\t */\n\t\tnodeLook: {\n\t\t\ttype: String,\n\t\t\tdefault: 'type',\n\t\t},\n\n\t\t/**\n\t\t * Board look: `down` lays the steps out top to bottom and opens them\n\t\t * at their own size instead of zoomed to fit; `right` (default) lays\n\t\t * them left to right. Manifest key `config.flowDirection`.\n\t\t */\n\t\tflowDirection: {\n\t\t\ttype: String,\n\t\t\tdefault: 'right',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the records a test run can take as its subject,\n\t\t * `{ register, schema, labelField?, label? }`. Manifest key\n\t\t * `config.testSubject`; `label` is translated with the app's catalogue.\n\t\t */\n\t\ttestSubject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Board look: an info notice under the path. Manifest key\n\t\t * `config.notice`, translated with the app's catalogue; `{name}` is\n\t\t * the flow's name.\n\t\t */\n\t\tnotice: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: edit a published flow in place; Save publishes the edits\n\t\t * as the next version and runs already started keep theirs. Manifest\n\t\t * key `config.saveAsVersion`.\n\t\t */\n\t\tsaveAsVersion: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Board look: which of `trigger`, `steps`, `version` and `saved` the\n\t\t * path names after the flow, in that order. Manifest key\n\t\t * `config.metaParts`.\n\t\t */\n\t\tmetaParts: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => ['trigger', 'steps', 'version'],\n\t\t},\n\n\t\t/**\n\t\t * Board look: a closing note after the path's meta (\"changes apply to\n\t\t * new cases\"), translated. Manifest key `config.metaNote`.\n\t\t */\n\t\tmetaNote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the pill beside the flow's name (\"Case type flow\").\n\t\t * Empty shows the lifecycle for a draft or retired flow. Manifest key\n\t\t * `config.pill`.\n\t\t */\n\t\tpill: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the tone of `pill` (a CnStatusBadge variant, \"teal\" on\n\t\t * DqFlow). Manifest key `config.pillVariant`.\n\t\t */\n\t\tpillVariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the list's name at the start of the path (\"Settings /\n\t\t * Flows\"). Empty reads \"Flows\". Manifest key `config.listLabel`.\n\t\t */\n\t\tlistLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Board look: the levels before the flow, each its own link\n\t\t * (`[{ label, href? }]`, \"Settings\" / \"Flows\"); a crumb without an\n\t\t * href links to the flow list. Labels are translated with the app's\n\t\t * catalogue. Manifest key `config.breadcrumb`; wins over `listLabel`.\n\t\t */\n\t\tbreadcrumb: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Board look: `canvas` lays the page out as boards PqFlow and PqFlowRun\n\t\t * draw it (actions under the title, the canvas without a frame, a\n\t\t * floating inspector); `cards` keeps the DqFlow grid. Manifest key\n\t\t * `config.layout`.\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: 'cards',\n\t\t},\n\n\t\t/**\n\t\t * Board look: how the Active switch is named. `state` names it\n\t\t * Active or Paused after the flow; `fixed` always names it Active\n\t\t * and the switch shows the state (DqFlow). Manifest key\n\t\t * `config.toggleLabel`.\n\t\t */\n\t\ttoggleLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: 'state',\n\t\t},\n\t},\n\n\t/**\n\t * Share the one flow store with the toolbar's save/run handlers, and\n\t * resolve the look (`look` is read here, through `useLook`).\n\t *\n\t * @param {object} props The component props.\n\t * @return {object} The setup bindings.\n\t */\n\tsetup(props) {\n\t\tconst { isBoard } = useLook(props)\n\t\treturn { store: useFlowStore(), isBoard }\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {string} The flow id being edited.\n\t\t */\n\t\tflowId() {\n\t\t\treturn this.id || this.$route?.params?.id || ''\n\t\t},\n\n\t\t/**\n\t\t * @return {Array<object>} The curated palette groups with their labels translated.\n\t\t */\n\t\ttranslatedPaletteGroups() {\n\t\t\tconst tr = (text) => (text ? this.cnTranslate(text) : text)\n\t\t\treturn (this.paletteGroups || []).map((group) => ({\n\t\t\t\t...group,\n\t\t\t\tlabel: tr(group?.label),\n\t\t\t\tpill: tr(group?.pill),\n\t\t\t\tentries: (group?.entries || []).map((step) => ({ ...step, label: tr(step?.label), short: tr(step?.short) })),\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The run to open on arrival, or an empty string.\n\t\t */\n\t\trunUuid() {\n\t\t\treturn this.run || this.$route?.query?.run || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onSave() {\n\t\t\tconst saved = await this.store.save()\n\t\t\t// A newly created flow gets its id from the server, so the route has\n\t\t\t// to catch up or a reload would land back on `new` and lose it.\n\t\t\tif (saved?.id && this.flowId === 'new') {\n\t\t\t\tthis.$router.replace(`${this.detailRoute}/${saved.id}`)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onRun() {\n\t\t\tawait this.store.run({})\n\t\t},\n\t},\n}\n</script>\n"],"names":["_createBlock"],"mappings":";;;;;;UAKW,MAAA,CAAA,OAAA;oBAATA,WAsBW,CAAA,sBAAA,EAAA;;AArBV,QAAA,EAAE,EAAE,QAAM,CAAA,MAAA;AACV,QAAA,GAAG,EAAE,MAAG,CAAA,GAAA;AACR,QAAA,GAAG,EAAE,QAAO,CAAA,OAAA;AACZ,QAAA,W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A,EAAA,KAAA,EAAA,MAAA,CAAA,WAAA,CAAA,KAAA,GAAA,QAAA,CAAA,WAAA,CAAA,MAAA,CAAA,WAAA,CAAA,KAAA,CAAA,GAAA,EAAA,EAAA,GAAA,IAAA;AACb,QAAA,MAAI,EAAE,QAAM,CAAA,MAAA;AACZ,QAAA,KAAG,EAAE,QAAK,CAAA,KAAA;;oBACXA;;AACC,QAAA,EAAE,EAAE,QAAM,CAAA,MAAA;AACV,QAAA,GAAG,EAAE,MAAG,CAAA,GAAA;AACR,QAAA,GAAG,EAAE,QAAO,CAAA,OAAA;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import script from './CnLinkedWidget.vue2.js';
|
|
|
2
2
|
import { render } from './CnLinkedWidget.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-3b6ef042";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnLinkedWidget.vue2.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { prefixUrl } from '../../utils/headers.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * A leaf may also be a record leaf, written in the manifest instead of\n * registered by an app: `{ id, register, schema, filter?, requiredApp?, noun,\n * label, href?, icon? }`. The card reads that register's records matching\n * `filter` (`@objectId` is this record's id) and lists one row per record,\n * `label` and `href` filled from it (DqZaak \"Vraag in pipelinq\": the\n * requests whose case reference is this case). It is left out when\n * `requiredApp` is not installed. Texts go through the host translate.\n *\n * An integration leaf may be written `{ id, noun }` to name it in the host's\n * own words: the card uses that noun, through the host translate, instead of\n * the one the leaf reports (DqZaak \"Leges en betalingen\" for the finance leaf).\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ leaves: Array<string|object> }`: integration ids or record leaves, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {Array<string|object>} The configured leaves. */\n\t\tleaves() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves : []\n\t\t},\n\n\t\t/** @return {string[]} The configured integration ids, written bare or as `{ id, noun }`. */\n\t\tleafIds() {\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (this.isNamedLeaf(leaf) ? leaf.id : '')))\n\t\t\t\t.filter((id) => id !== '')\n\t\t},\n\n\t\t/** @return {{[id: string]: string}} The host's translated noun per integration leaf written `{ id, noun }`. */\n\t\thostNouns() {\n\t\t\tconst out = {}\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tif (this.isNamedLeaf(leaf) && typeof leaf.noun === 'string' && leaf.noun !== '') {\n\t\t\t\t\tout[leaf.id] = this.cnTranslate(leaf.noun)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {object[]} The record leaves whose app is here. */\n\t\trecordLeaves() {\n\t\t\treturn this.leaves.filter((leaf) => leaf && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== ''\n\t\t\t\t&& leaf.register && leaf.schema && (!leaf.requiredApp || isAppInstalled(leaf.requiredApp)))\n\t\t},\n\n\t\t/** @return {string[]} Every listed leaf's id, in the configured order. */\n\t\torderedIds() {\n\t\t\tconst providers = new Set(this.providers.map((p) => p.id))\n\t\t\tconst records = new Set(this.recordLeaves.map((leaf) => leaf.id))\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (leaf && leaf.id)))\n\t\t\t\t.filter((id) => providers.has(id) || records.has(id))\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.orderedIds\n\t\t\t\t.filter((id) => this.summaries[id])\n\t\t\t\t.map((id) => ({ id, summary: this.summaries[id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\twatch: {\n\t\trecordLeaves: {\n\t\t\thandler() {\n\t\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether a configured leaf is an integration leaf written as an object\n\t\t * (an id, no register or schema of its own).\n\t\t *\n\t\t * @param {string|object} leaf The configured leaf.\n\t\t * @return {boolean}\n\t\t */\n\t\tisNamedLeaf(leaf) {\n\t\t\treturn Boolean(leaf) && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== '' && !leaf.register && !leaf.schema\n\t\t},\n\n\t\t/**\n\t\t * Read a record leaf's records and report them as its summary. A\n\t\t * failed read reports nothing, so the leaf is not listed as empty.\n\t\t *\n\t\t * @param {object} leaf The record leaf.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync readRecordLeaf(leaf) {\n\t\t\tconst objectId = String(this.objectId || '')\n\t\t\tif (objectId === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = {}\n\t\t\tfor (const [key, value] of Object.entries(leaf.filter || {})) {\n\t\t\t\tfilter[key] = value === '@objectId' ? objectId : value\n\t\t\t}\n\t\t\tlet rows\n\t\t\ttry {\n\t\t\t\trows = await fetchReferenceObjects({ register: leaf.register, schema: leaf.schema, filter, limit: leaf.limit || 20 })\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst label = leaf.label ? this.cnTranslate(leaf.label) : ''\n\t\t\tthis.onSummary(leaf.id, {\n\t\t\t\tcount: rows.length,\n\t\t\t\tnoun: leaf.noun ? this.cnTranslate(leaf.noun) : '',\n\t\t\t\trows: rows.map((row) => {\n\t\t\t\t\tconst href = leaf.href ? fillTemplate(leaf.href, row) : ''\n\t\t\t\t\treturn { label: fillTemplate(label, row), href: href ? prefixUrl(href) : undefined, icon: leaf.icon || undefined }\n\t\t\t\t}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst noun = this.hostNouns[id] ?? (typeof s.noun === 'string' ? s.noun : '')\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun,\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\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C,GAAI,KAAI,cAAc,OAAO,MAAM,CAAC,KAAM,KAAI,QAAO,IAAK,MAAM,CAAC,KAAM,KAAI,GAAC;AACrI,GAAA,IAAI,CAAC,YAAY;AAChB,IAAA,GAAG,IAAI,CAAC,SAAS;IACjB,CAAC,EAAE,GAAG;AACL,KAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAA,GAAI,CAAC,CAAC,KAAI,GAAI,CAAC;KAC7C,IAAI;KACJ,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAE,GAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAA,GAAI,EAAE;AAC3D,KAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAE,GAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAE,GAAE,EAAE;KACvE;AACF,KAAA;GACA;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnLinkedWidget.vue2.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { prefixUrl } from '../../utils/headers.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * A leaf may also be a record leaf, written in the manifest instead of\n * registered by an app: `{ id, register, schema, filter?, requiredApp?, noun,\n * label, href?, icon? }`. The card reads that register's records matching\n * `filter` (`@objectId` is this record's id) and lists one row per record,\n * `label` and `href` filled from it (DqZaak \"Vraag in pipelinq\": the\n * requests whose case reference is this case). It is left out when\n * `requiredApp` is not installed. Texts go through the host translate.\n *\n * An integration leaf may be written `{ id, noun }` to name it in the host's\n * own words: the card uses that noun, through the host translate, instead of\n * the one the leaf reports (DqZaak \"Leges en betalingen\" for the finance leaf).\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ leaves: Array<string|object> }`: integration ids or record leaves, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {Array<string|object>} The configured leaves. */\n\t\tleaves() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves : []\n\t\t},\n\n\t\t/** @return {string[]} The configured integration ids, written bare or as `{ id, noun }`. */\n\t\tleafIds() {\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (this.isNamedLeaf(leaf) ? leaf.id : '')))\n\t\t\t\t.filter((id) => id !== '')\n\t\t},\n\n\t\t/** @return {{[id: string]: string}} The host's translated noun per integration leaf written `{ id, noun }`. */\n\t\thostNouns() {\n\t\t\tconst out = {}\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tif (this.isNamedLeaf(leaf) && typeof leaf.noun === 'string' && leaf.noun !== '') {\n\t\t\t\t\tout[leaf.id] = this.cnTranslate(leaf.noun)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {object[]} The record leaves whose app is here. */\n\t\trecordLeaves() {\n\t\t\treturn this.leaves.filter((leaf) => leaf && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== ''\n\t\t\t\t&& leaf.register && leaf.schema && (!leaf.requiredApp || isAppInstalled(leaf.requiredApp)))\n\t\t},\n\n\t\t/** @return {string[]} Every listed leaf's id, in the configured order. */\n\t\torderedIds() {\n\t\t\tconst providers = new Set(this.providers.map((p) => p.id))\n\t\t\tconst records = new Set(this.recordLeaves.map((leaf) => leaf.id))\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (leaf && leaf.id)))\n\t\t\t\t.filter((id) => providers.has(id) || records.has(id))\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.orderedIds\n\t\t\t\t.filter((id) => this.summaries[id])\n\t\t\t\t.map((id) => ({ id, summary: this.summaries[id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\twatch: {\n\t\trecordLeaves: {\n\t\t\thandler() {\n\t\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether a configured leaf is an integration leaf written as an object\n\t\t * (an id, no register or schema of its own).\n\t\t *\n\t\t * @param {string|object} leaf The configured leaf.\n\t\t * @return {boolean}\n\t\t */\n\t\tisNamedLeaf(leaf) {\n\t\t\treturn Boolean(leaf) && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== '' && !leaf.register && !leaf.schema\n\t\t},\n\n\t\t/**\n\t\t * Read a record leaf's records and report them as its summary. A\n\t\t * failed read reports nothing, so the leaf is not listed as empty.\n\t\t *\n\t\t * @param {object} leaf The record leaf.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync readRecordLeaf(leaf) {\n\t\t\tconst objectId = String(this.objectId || '')\n\t\t\tif (objectId === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = {}\n\t\t\tfor (const [key, value] of Object.entries(leaf.filter || {})) {\n\t\t\t\tfilter[key] = value === '@objectId' ? objectId : value\n\t\t\t}\n\t\t\tlet rows\n\t\t\ttry {\n\t\t\t\trows = await fetchReferenceObjects({ register: leaf.register, schema: leaf.schema, filter, limit: leaf.limit || 20 })\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst label = leaf.label ? this.cnTranslate(leaf.label) : ''\n\t\t\tthis.onSummary(leaf.id, {\n\t\t\t\tcount: rows.length,\n\t\t\t\tnoun: leaf.noun ? this.cnTranslate(leaf.noun) : '',\n\t\t\t\trows: rows.map((row) => {\n\t\t\t\t\tconst href = leaf.href ? fillTemplate(leaf.href, row) : ''\n\t\t\t\t\treturn { label: fillTemplate(label, row), href: href ? prefixUrl(href) : undefined, icon: leaf.icon || undefined }\n\t\t\t\t}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst noun = this.hostNouns[id] ?? (typeof s.noun === 'string' ? s.noun : '')\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun,\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n/* The class twice: Nextcloud's `button:not(.button-vue, ...)` rule (0,2,1)\n gives every button a 3px margin that a single scoped class cannot take back. */\nbutton.cn-linked-widget__link.cn-linked-widget__link,\n.cn-linked-widget__action.cn-linked-widget__action {\n\tmargin: 0;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["CnIcon","CnLeafMountHost","t"],"mappings":";;;;;;;;;AAiFA;;AAEC;AACA;;;AAGD,SAAS,QAAQ,CAAC,KAAK,EAAE;AACxB,CAAA,IAAI;EACH,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAC,IAAK,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAc,EAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;AAC3H,EAAA,CAAE,MAAM;AACP,EAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;AACvB,EAAA;AACD,CAAA;;AAEA;AACC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;AAMA;;AAEA;AACA;AACA;AACA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;AAEtB,CAAA,UAAU,EAAE,UAAEA,UAAM,mBAAEC,cAAiB;;AAEvC,CAAA,MAAM,EAAE;;AAEP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;AACA,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;;AAED;AACA,EAAA,QAAQ,EAAE;AACT,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;GACtB,OAAO,EAAE,EAAE;GACX;;;AAGD,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;;A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AC,KAAI,KAAM,QAAO,IAAK,GAAG,CAAC,KAAI,KAAM,GAAC;GAClF,MAAM,YAAa,GAAE,CAAC,MAAM,KAAK,MAAO,IAAG,OAAO,MAAM,CAAC,GAAI,KAAI,cAAc,OAAO,MAAM,CAAC,KAAM,KAAI,QAAO,IAAK,MAAM,CAAC,KAAM,KAAI,GAAC;AACrI,GAAA,IAAI,CAAC,YAAY;AAChB,IAAA,GAAG,IAAI,CAAC,SAAS;IACjB,CAAC,EAAE,GAAG;AACL,KAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAA,GAAI,CAAC,CAAC,KAAI,GAAI,CAAC;KAC7C,IAAI;KACJ,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAE,GAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAA,GAAI,EAAE;AAC3D,KAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAE,GAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAE,GAAE,EAAE;KACvE;AACF,KAAA;GACA;EACD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnLinkedWidget.vue3.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.vue?vue&type=template&id=3b3a49d3&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { prefixUrl } from '../../utils/headers.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * A leaf may also be a record leaf, written in the manifest instead of\n * registered by an app: `{ id, register, schema, filter?, requiredApp?, noun,\n * label, href?, icon? }`. The card reads that register's records matching\n * `filter` (`@objectId` is this record's id) and lists one row per record,\n * `label` and `href` filled from it (DqZaak \"Vraag in pipelinq\": the\n * requests whose case reference is this case). It is left out when\n * `requiredApp` is not installed. Texts go through the host translate.\n *\n * An integration leaf may be written `{ id, noun }` to name it in the host's\n * own words: the card uses that noun, through the host translate, instead of\n * the one the leaf reports (DqZaak \"Leges en betalingen\" for the finance leaf).\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ leaves: Array<string|object> }`: integration ids or record leaves, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {Array<string|object>} The configured leaves. */\n\t\tleaves() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves : []\n\t\t},\n\n\t\t/** @return {string[]} The configured integration ids, written bare or as `{ id, noun }`. */\n\t\tleafIds() {\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (this.isNamedLeaf(leaf) ? leaf.id : '')))\n\t\t\t\t.filter((id) => id !== '')\n\t\t},\n\n\t\t/** @return {{[id: string]: string}} The host's translated noun per integration leaf written `{ id, noun }`. */\n\t\thostNouns() {\n\t\t\tconst out = {}\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tif (this.isNamedLeaf(leaf) && typeof leaf.noun === 'string' && leaf.noun !== '') {\n\t\t\t\t\tout[leaf.id] = this.cnTranslate(leaf.noun)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {object[]} The record leaves whose app is here. */\n\t\trecordLeaves() {\n\t\t\treturn this.leaves.filter((leaf) => leaf && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== ''\n\t\t\t\t&& leaf.register && leaf.schema && (!leaf.requiredApp || isAppInstalled(leaf.requiredApp)))\n\t\t},\n\n\t\t/** @return {string[]} Every listed leaf's id, in the configured order. */\n\t\torderedIds() {\n\t\t\tconst providers = new Set(this.providers.map((p) => p.id))\n\t\t\tconst records = new Set(this.recordLeaves.map((leaf) => leaf.id))\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (leaf && leaf.id)))\n\t\t\t\t.filter((id) => providers.has(id) || records.has(id))\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.orderedIds\n\t\t\t\t.filter((id) => this.summaries[id])\n\t\t\t\t.map((id) => ({ id, summary: this.summaries[id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\twatch: {\n\t\trecordLeaves: {\n\t\t\thandler() {\n\t\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether a configured leaf is an integration leaf written as an object\n\t\t * (an id, no register or schema of its own).\n\t\t *\n\t\t * @param {string|object} leaf The configured leaf.\n\t\t * @return {boolean}\n\t\t */\n\t\tisNamedLeaf(leaf) {\n\t\t\treturn Boolean(leaf) && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== '' && !leaf.register && !leaf.schema\n\t\t},\n\n\t\t/**\n\t\t * Read a record leaf's records and report them as its summary. A\n\t\t * failed read reports nothing, so the leaf is not listed as empty.\n\t\t *\n\t\t * @param {object} leaf The record leaf.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync readRecordLeaf(leaf) {\n\t\t\tconst objectId = String(this.objectId || '')\n\t\t\tif (objectId === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = {}\n\t\t\tfor (const [key, value] of Object.entries(leaf.filter || {})) {\n\t\t\t\tfilter[key] = value === '@objectId' ? objectId : value\n\t\t\t}\n\t\t\tlet rows\n\t\t\ttry {\n\t\t\t\trows = await fetchReferenceObjects({ register: leaf.register, schema: leaf.schema, filter, limit: leaf.limit || 20 })\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst label = leaf.label ? this.cnTranslate(leaf.label) : ''\n\t\t\tthis.onSummary(leaf.id, {\n\t\t\t\tcount: rows.length,\n\t\t\t\tnoun: leaf.noun ? this.cnTranslate(leaf.noun) : '',\n\t\t\t\trows: rows.map((row) => {\n\t\t\t\t\tconst href = leaf.href ? fillTemplate(leaf.href, row) : ''\n\t\t\t\t\treturn { label: fillTemplate(label, row), href: href ? prefixUrl(href) : undefined, icon: leaf.icon || undefined }\n\t\t\t\t}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst noun = this.hostNouns[id] ?? (typeof s.noun === 'string' ? s.noun : '')\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun,\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["_createElementBlock","_Fragment","_renderList","_createBlock","_toDisplayString","_openBlock","_createElementVNode"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,kBAAkB;AAAC,EAAA,aAAC,EAAA,kBAAA;;;;AACD,EAAA,KAAA,EAAA,wBAAA;;;;;;AA0Bd,EAAA,KAAK,EAAC,wBAAG;;;;AAYF,EAAA,KAAK,EAAC,yBAAG;AAAA,EAAA,aAAA,EAAA,iBAAA;;;;AAGE,EAAA,KAAA,EAAA,2BAAA;;;;AAa5B,EAAA,MAAM,EAAN,EAAM;AAAC,EAAA,KAAK,EAAC,0BAA0B;;;;;;;;AAtDlC,IAAA,CAAA,QAAA,CAAA,UAAU,CAAC,MAAM,GAAA,CAAA;yCAmCtB,gBAAA,EAAA;4BAlCHA,kBAiCI,CAAAC,QAAA,EAAA,IAAA,EAAAC,UAAA,CAhCG,QAAA,CAAA,UAAA,EAAA,CAAA,GAAA,KAAA;iCADPF,kBAiCI,CAAA,IAAA,EAAA;cA/BF,GAAE,EAAE,GAAG,CAAC,GAAG;AACX,cAAA,KAAG,EAAC,uBAAW;AACf,cAAA,aAAS,EAAA,eAAA;;AACF,cAAA,CAAA,GAAG,CAAC,IAAI;gCAAfA,kBAOE,CAAA,GAAA,EAAA;;wBAPkB,EAAA,GAAA,CAAA,IAAA;AAAA,oBAAA,KAAA,EAAA,wBAAA;;AAEnB,oBAAA,CAAA,GAAA,CAAA,IAAA;sCADFG,WAIY,CAAA,iBAAA,EAAA;;0BAFV,IAAG,EAAA,GAAA,CAAA,IAAA;AACH,0BAAA,IAAI,EAAE,EAAE;AACT,0BAAA,aAAW,EAAA,MAAA;;;oCAAA,GACZ,GAA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QAAE;AACP,cAAA,KAAI,EAAA,0BAAA;AACJ,cAAA,aAAW,EAAC,kBAAkB;qBACxB,EAAA,MAAA,KAAE,MAAM,CAAC,GAAG,EAAA,CAAA;AACf,aAAA,EAAAE,eAAA,CAAA,MAAK,CAAE,KAAK,CAAA,EAAA,CAAA,oBAAA,UAAA,CAAA,CAAA;;;;AAKf,IAAAE,kBAAA,QAAA;wBACDN,8CACG,QAAA,CAAA,SAAA,EAAA,CAAA,QAAA,KAAA;6BADHG;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnLinkedWidget.vue3.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.vue?vue&type=template&id=3b6ef042&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { prefixUrl } from '../../utils/headers.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * A leaf may also be a record leaf, written in the manifest instead of\n * registered by an app: `{ id, register, schema, filter?, requiredApp?, noun,\n * label, href?, icon? }`. The card reads that register's records matching\n * `filter` (`@objectId` is this record's id) and lists one row per record,\n * `label` and `href` filled from it (DqZaak \"Vraag in pipelinq\": the\n * requests whose case reference is this case). It is left out when\n * `requiredApp` is not installed. Texts go through the host translate.\n *\n * An integration leaf may be written `{ id, noun }` to name it in the host's\n * own words: the card uses that noun, through the host translate, instead of\n * the one the leaf reports (DqZaak \"Leges en betalingen\" for the finance leaf).\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ leaves: Array<string|object> }`: integration ids or record leaves, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {Array<string|object>} The configured leaves. */\n\t\tleaves() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves : []\n\t\t},\n\n\t\t/** @return {string[]} The configured integration ids, written bare or as `{ id, noun }`. */\n\t\tleafIds() {\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (this.isNamedLeaf(leaf) ? leaf.id : '')))\n\t\t\t\t.filter((id) => id !== '')\n\t\t},\n\n\t\t/** @return {{[id: string]: string}} The host's translated noun per integration leaf written `{ id, noun }`. */\n\t\thostNouns() {\n\t\t\tconst out = {}\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tif (this.isNamedLeaf(leaf) && typeof leaf.noun === 'string' && leaf.noun !== '') {\n\t\t\t\t\tout[leaf.id] = this.cnTranslate(leaf.noun)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {object[]} The record leaves whose app is here. */\n\t\trecordLeaves() {\n\t\t\treturn this.leaves.filter((leaf) => leaf && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== ''\n\t\t\t\t&& leaf.register && leaf.schema && (!leaf.requiredApp || isAppInstalled(leaf.requiredApp)))\n\t\t},\n\n\t\t/** @return {string[]} Every listed leaf's id, in the configured order. */\n\t\torderedIds() {\n\t\t\tconst providers = new Set(this.providers.map((p) => p.id))\n\t\t\tconst records = new Set(this.recordLeaves.map((leaf) => leaf.id))\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (leaf && leaf.id)))\n\t\t\t\t.filter((id) => providers.has(id) || records.has(id))\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.orderedIds\n\t\t\t\t.filter((id) => this.summaries[id])\n\t\t\t\t.map((id) => ({ id, summary: this.summaries[id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\twatch: {\n\t\trecordLeaves: {\n\t\t\thandler() {\n\t\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether a configured leaf is an integration leaf written as an object\n\t\t * (an id, no register or schema of its own).\n\t\t *\n\t\t * @param {string|object} leaf The configured leaf.\n\t\t * @return {boolean}\n\t\t */\n\t\tisNamedLeaf(leaf) {\n\t\t\treturn Boolean(leaf) && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== '' && !leaf.register && !leaf.schema\n\t\t},\n\n\t\t/**\n\t\t * Read a record leaf's records and report them as its summary. A\n\t\t * failed read reports nothing, so the leaf is not listed as empty.\n\t\t *\n\t\t * @param {object} leaf The record leaf.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync readRecordLeaf(leaf) {\n\t\t\tconst objectId = String(this.objectId || '')\n\t\t\tif (objectId === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = {}\n\t\t\tfor (const [key, value] of Object.entries(leaf.filter || {})) {\n\t\t\t\tfilter[key] = value === '@objectId' ? objectId : value\n\t\t\t}\n\t\t\tlet rows\n\t\t\ttry {\n\t\t\t\trows = await fetchReferenceObjects({ register: leaf.register, schema: leaf.schema, filter, limit: leaf.limit || 20 })\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst label = leaf.label ? this.cnTranslate(leaf.label) : ''\n\t\t\tthis.onSummary(leaf.id, {\n\t\t\t\tcount: rows.length,\n\t\t\t\tnoun: leaf.noun ? this.cnTranslate(leaf.noun) : '',\n\t\t\t\trows: rows.map((row) => {\n\t\t\t\t\tconst href = leaf.href ? fillTemplate(leaf.href, row) : ''\n\t\t\t\t\treturn { label: fillTemplate(label, row), href: href ? prefixUrl(href) : undefined, icon: leaf.icon || undefined }\n\t\t\t\t}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst noun = this.hostNouns[id] ?? (typeof s.noun === 'string' ? s.noun : '')\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun,\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n/* The class twice: Nextcloud's `button:not(.button-vue, ...)` rule (0,2,1)\n gives every button a 3px margin that a single scoped class cannot take back. */\nbutton.cn-linked-widget__link.cn-linked-widget__link,\n.cn-linked-widget__action.cn-linked-widget__action {\n\tmargin: 0;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["_createElementBlock","_Fragment","_renderList","_createBlock","_toDisplayString","_openBlock","_createElementVNode"],"mappings":";;;AAWM,E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AAA,CAAA,QAAA,KAAA;6BADHG;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import script from './CnMassActionDialog.vue2.js';
|
|
2
|
+
import { render } from './CnMassActionDialog.vue3.js';
|
|
3
|
+
|
|
4
|
+
script.render = render;
|
|
5
|
+
script.__scopeId = "data-v-60c3bc18";
|
|
6
|
+
const __sfc_main = script;
|
|
7
|
+
|
|
8
|
+
export { __sfc_main as default };
|
|
9
|
+
//# sourceMappingURL=CnMassActionDialog.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnMassActionDialog.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|