@conduction/nextcloud-vue 2.171.0 → 2.173.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/CnAiCompanion/CnAiChatWidget.vue2.js +3 -2
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue3.js +2 -1
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js +39 -0
- package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiCompanion.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/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.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/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 +34 -4
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +42 -34
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +21 -6
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +54 -4
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +32 -26
- 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 +28 -4
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +4 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
- package/dist/esm/composables/aiChatConfig.js +13 -1
- package/dist/esm/composables/aiChatConfig.js.map +1 -1
- package/dist/esm/composables/useAiChatStream.js +53 -1
- package/dist/esm/composables/useAiChatStream.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +745 -403
- package/dist/esm/utils/builtInFormatters.js +19 -1
- package/dist/esm/utils/builtInFormatters.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +919 -569
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +745 -403
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +4 -1
- package/src/components/CnAiCompanion/CnAiChatWidget.md +1 -0
- package/src/components/CnAiCompanion/CnAiChatWidget.vue +4 -2
- package/src/components/CnAiCompanion/CnAiCompanion.md +1 -0
- package/src/components/CnAiCompanion/CnAiCompanion.vue +39 -0
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +24 -3
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +5 -2
- package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +75 -4
- package/src/components/CnFactsWidget/CnFactsWidget.vue +7 -3
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +45 -4
- package/src/components/CnFlowsPage/CnFlowBoard.vue +27 -6
- package/src/components/CnTreeView/CnTreeNode.vue +69 -6
- package/src/components/CnTreeView/CnTreeView.vue +31 -4
- package/src/composables/aiChatConfig.js +12 -0
- package/src/composables/useAiChatStream.js +53 -0
- package/src/css/look-board-detail.css +200 -6
- package/src/css/look-board-index.css +7 -6
- package/src/css/look-board.css +118 -0
- package/src/css/patches.css +4 -1
- package/src/utils/builtInFormatters.js +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/nextcloud-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.173.0",
|
|
4
4
|
"description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
|
|
5
5
|
"homepage": "https://github.com/ConductionNL/nextcloud-vue#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -836,10 +836,11 @@ export default {
|
|
|
836
836
|
</script>
|
|
837
837
|
|
|
838
838
|
<style scoped>
|
|
839
|
+
/* The parts stand 18px apart, as the board draws the dialog (DqArchiveren). */
|
|
839
840
|
.cn-action-dialog {
|
|
840
841
|
display: flex;
|
|
841
842
|
flex-direction: column;
|
|
842
|
-
gap:
|
|
843
|
+
gap: 18px;
|
|
843
844
|
}
|
|
844
845
|
|
|
845
846
|
.cn-action-dialog__summary {
|
|
@@ -910,6 +911,8 @@ export default {
|
|
|
910
911
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
911
912
|
gap: 12px 24px;
|
|
912
913
|
margin: 0;
|
|
914
|
+
/* The server pads every dl 12px. */
|
|
915
|
+
padding: 0;
|
|
913
916
|
}
|
|
914
917
|
|
|
915
918
|
.cn-action-dialog__fact {
|
|
@@ -19,6 +19,7 @@ agents) as items of the card's Actions menu.
|
|
|
19
19
|
| `note` | `string` | `''` | A line above the input, e.g. what the assistant can see. Translated. |
|
|
20
20
|
| `placeholder` | `string` | `''` | The input's placeholder; empty keeps "Message input". Translated. |
|
|
21
21
|
| `sendLabel` | `string` | `''` | A label on the send button instead of the send icon. Translated. |
|
|
22
|
+
| `openSubjectSession` | `boolean` | `false` | Open the user's latest session about the page's record (the context's `objectUuid`) instead of an empty thread, with the proposals the assistant still waits on. No such session, a backend that cannot filter sessions by record, or a session about another record leaves the thread empty. |
|
|
22
23
|
|
|
23
24
|
## Example
|
|
24
25
|
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
:inputPlaceholder="tr(content.placeholder)"
|
|
29
29
|
:sendLabel="tr(content.sendLabel)"
|
|
30
30
|
:chatAppId="content.chatAppId || defaultChatAppId"
|
|
31
|
+
:openSubjectSession="content.openSubjectSession === true"
|
|
31
32
|
@menu="onMenu" />
|
|
32
33
|
</div>
|
|
33
34
|
</template>
|
|
@@ -52,8 +53,9 @@ export default {
|
|
|
52
53
|
* The widget's content: `chatAppId`, the backend app that answers the
|
|
53
54
|
* chat (defaults to the companion's own); `pill` and `pillVariant`, a
|
|
54
55
|
* pill in the card's title row; `note`, a line above the input;
|
|
55
|
-
* `placeholder` and `sendLabel`, the input's wording
|
|
56
|
-
* the
|
|
56
|
+
* `placeholder` and `sendLabel`, the input's wording; `openSubjectSession`,
|
|
57
|
+
* open the user's latest session about the page's record instead of an
|
|
58
|
+
* empty thread. Texts go through the host's translate.
|
|
57
59
|
*/
|
|
58
60
|
content: {
|
|
59
61
|
type: Object,
|
|
@@ -24,6 +24,7 @@ The FAB and panel are both hidden when `useAiContext().pageKind === 'chat'` (i.e
|
|
|
24
24
|
| `note` | `String` | `''` | A line above the input, already translated. |
|
|
25
25
|
| `inputPlaceholder` | `String` | `''` | The input's placeholder, already translated. |
|
|
26
26
|
| `sendLabel` | `String` | `''` | A label on the send button, already translated. |
|
|
27
|
+
| `openSubjectSession` | `Boolean` | `false` | Open the user's latest session about the page's record (the context's `objectUuid`) instead of an empty thread, with its pending approvals. No such session, or one about another record, leaves the thread empty. |
|
|
27
28
|
|
|
28
29
|
## Inject
|
|
29
30
|
|
|
@@ -220,6 +220,16 @@ export default {
|
|
|
220
220
|
type: String,
|
|
221
221
|
default: '',
|
|
222
222
|
},
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Open the user's latest session about the page's record (the context's
|
|
226
|
+
* `objectUuid`) instead of an empty thread, with its pending approvals.
|
|
227
|
+
* No such session, or one about another record, leaves the thread empty.
|
|
228
|
+
*/
|
|
229
|
+
openSubjectSession: {
|
|
230
|
+
type: Boolean,
|
|
231
|
+
default: false,
|
|
232
|
+
},
|
|
223
233
|
},
|
|
224
234
|
|
|
225
235
|
emits: ['menu'],
|
|
@@ -232,6 +242,8 @@ export default {
|
|
|
232
242
|
// Cleared on unmount so a torn-down companion cannot stand itself
|
|
233
243
|
// down after the fact.
|
|
234
244
|
legacySiblingTimer: null,
|
|
245
|
+
// The record whose session was last asked for, so it is asked once.
|
|
246
|
+
openedSubjectUuid: '',
|
|
235
247
|
stream: useAiChatStream(this, { chatAppId: this.chatAppId, context: this.context }),
|
|
236
248
|
}
|
|
237
249
|
},
|
|
@@ -272,6 +284,33 @@ export default {
|
|
|
272
284
|
effectiveContext() {
|
|
273
285
|
return this.context || this.cnAiContext || null
|
|
274
286
|
},
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* The record whose session to open: the context's `objectUuid` once the
|
|
290
|
+
* backend answered, when the companion opts in; '' otherwise.
|
|
291
|
+
*
|
|
292
|
+
* @return {string} The record's uuid or ''.
|
|
293
|
+
* @spec openspec/changes/ai-chat-opens-the-subject-session/specs/ai-companion/spec.md#requirement-an-embedded-chat-may-open-the-users-session-about-the-pages-record
|
|
294
|
+
*/
|
|
295
|
+
subjectUuid() {
|
|
296
|
+
const uuid = this.effectiveContext && this.effectiveContext.objectUuid
|
|
297
|
+
return (this.openSubjectSession && this.probeSucceeded && typeof uuid === 'string') ? uuid : ''
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
watch: {
|
|
302
|
+
/**
|
|
303
|
+
* Open the session about the record once it is known, once per record.
|
|
304
|
+
*
|
|
305
|
+
* @param {string} uuid The record's uuid or ''.
|
|
306
|
+
* @spec openspec/changes/ai-chat-opens-the-subject-session/specs/ai-companion/spec.md#requirement-an-embedded-chat-may-open-the-users-session-about-the-pages-record
|
|
307
|
+
*/
|
|
308
|
+
subjectUuid(uuid) {
|
|
309
|
+
if (uuid !== '' && uuid !== this.openedSubjectUuid) {
|
|
310
|
+
this.openedSubjectUuid = uuid
|
|
311
|
+
this.stream.loadSubjectSession(uuid)
|
|
312
|
+
}
|
|
313
|
+
},
|
|
275
314
|
},
|
|
276
315
|
|
|
277
316
|
created() {
|
|
@@ -306,7 +306,9 @@ function idOf(object) {
|
|
|
306
306
|
*
|
|
307
307
|
* `startAt: "firstOpen"` opens a run that was started earlier at the page of
|
|
308
308
|
* its first unanswered question (the last page when all are answered), once
|
|
309
|
-
* per record;
|
|
309
|
+
* per record; `startAt: "lastAnswered"` at the page of its last answered
|
|
310
|
+
* question, where the inspector was; without it the run opens at the first
|
|
311
|
+
* page.
|
|
310
312
|
*
|
|
311
313
|
* Question kinds: `yes_no`, `yes_no_na`, `choice` (the question's `options`,
|
|
312
314
|
* a list of strings or `{ value, label }`), `number`, `photo` and `text`.
|
|
@@ -524,7 +526,8 @@ export default {
|
|
|
524
526
|
/**
|
|
525
527
|
* The questions of this page that get a photo control: with a
|
|
526
528
|
* `photoRequired` field, those whose rule is not never (and photo
|
|
527
|
-
* questions)
|
|
529
|
+
* questions), less a `{ whenAnswer }` question answered otherwise that
|
|
530
|
+
* holds no photo; without one, the first question of the page.
|
|
528
531
|
*
|
|
529
532
|
* @return {object[]} The questions.
|
|
530
533
|
* @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-question-can-require-a-photo
|
|
@@ -534,7 +537,7 @@ export default {
|
|
|
534
537
|
return []
|
|
535
538
|
}
|
|
536
539
|
if (this.fields.photoRequired) {
|
|
537
|
-
return this.pageQuestions.filter((q) => q.kind === 'photo' || q.photoRule !== 'never')
|
|
540
|
+
return this.pageQuestions.filter((q) => q.kind === 'photo' || (q.photoRule !== 'never' && !this.photoRuledOut(q)))
|
|
538
541
|
}
|
|
539
542
|
const first = this.currentQuestion
|
|
540
543
|
const extra = this.pageQuestions.filter((q) => q.kind === 'photo' && q !== first)
|
|
@@ -749,6 +752,19 @@ export default {
|
|
|
749
752
|
return Boolean(rule && typeof rule === 'object' && String(this.draft[question.id]?.value ?? '') === rule.whenAnswer)
|
|
750
753
|
},
|
|
751
754
|
|
|
755
|
+
/**
|
|
756
|
+
* Whether a question's answer rules its photo out: a `{ whenAnswer }`
|
|
757
|
+
* question answered with another value and holding no photo.
|
|
758
|
+
*
|
|
759
|
+
* @param {object} question The question.
|
|
760
|
+
* @return {boolean} True when no photo control is needed.
|
|
761
|
+
*/
|
|
762
|
+
photoRuledOut(question) {
|
|
763
|
+
const rule = question.photoRule
|
|
764
|
+
const value = String(this.draft[question.id]?.value ?? '')
|
|
765
|
+
return Boolean(rule && typeof rule === 'object' && value !== '' && value !== rule.whenAnswer && !this.hasPhoto(question))
|
|
766
|
+
},
|
|
767
|
+
|
|
752
768
|
/**
|
|
753
769
|
* Whether a question has a photo, stored or held.
|
|
754
770
|
*
|
|
@@ -901,6 +917,9 @@ export default {
|
|
|
901
917
|
if (this.positionedFor !== key && this.content?.startAt === 'firstOpen') {
|
|
902
918
|
const open = questions.findIndex((question) => !this.isAnswered(question))
|
|
903
919
|
this.page = open === -1 ? lastPage : Math.floor(open / this.pageSize)
|
|
920
|
+
} else if (this.positionedFor !== key && this.content?.startAt === 'lastAnswered') {
|
|
921
|
+
const last = questions.findLastIndex((question) => this.isAnswered(question))
|
|
922
|
+
this.page = last === -1 ? 0 : Math.floor(last / this.pageSize)
|
|
904
923
|
}
|
|
905
924
|
this.positionedFor = key
|
|
906
925
|
this.page = Math.min(this.page, lastPage)
|
|
@@ -1314,6 +1333,8 @@ export default {
|
|
|
1314
1333
|
display: flex;
|
|
1315
1334
|
flex-direction: column;
|
|
1316
1335
|
gap: 4px;
|
|
1336
|
+
font-size: 14px;
|
|
1337
|
+
font-weight: 600 !important;
|
|
1317
1338
|
line-height: 1.2;
|
|
1318
1339
|
}
|
|
1319
1340
|
|
|
@@ -1842,8 +1842,11 @@ export default {
|
|
|
1842
1842
|
}
|
|
1843
1843
|
|
|
1844
1844
|
/* A stretched `sameHeight` card keeps its content at the top, as the boards
|
|
1845
|
-
draw a row of cards, not centred in the extra height.
|
|
1846
|
-
|
|
1845
|
+
draw a row of cards, not centred in the extra height. `.grid-stack-item`
|
|
1846
|
+
outranks the dashboard page's centring of a fitted card, which is as
|
|
1847
|
+
strong and loads later (DqProcesanalyse stat tiles).
|
|
1848
|
+
@spec openspec/changes/same-height-fit-card-content-top/specs/dashboard-grid/spec.md#requirement-a-stretched-fitted-card-keeps-its-content-at-the-top */
|
|
1849
|
+
.cn-dashboard-grid__item--same-height.grid-stack-item > :deep(.grid-stack-item-content > * > .cn-widget-wrapper__content) {
|
|
1847
1850
|
justify-content: flex-start;
|
|
1848
1851
|
}
|
|
1849
1852
|
|
|
@@ -50,6 +50,9 @@ import CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'
|
|
|
50
50
|
import CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'
|
|
51
51
|
import InformationOutline from 'vue-material-design-icons/InformationOutline.vue'
|
|
52
52
|
import CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'
|
|
53
|
+
import { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'
|
|
54
|
+
import { readPath } from '../../utils/readPath.js'
|
|
55
|
+
import { hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'
|
|
53
56
|
|
|
54
57
|
/** Counter for unique heading ids across instances. */
|
|
55
58
|
let instanceCounter = 0
|
|
@@ -96,12 +99,16 @@ export default {
|
|
|
96
99
|
/**
|
|
97
100
|
* The widget configuration.
|
|
98
101
|
*
|
|
99
|
-
* - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names
|
|
102
|
+
* - `frames` — `[{ key?, title, titleFrom?, widgetIds? | sections?, status? }]`, in order. `widgetIds` names
|
|
100
103
|
* widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.
|
|
104
|
+
* `titleFrom: { source: { register, schema, filter, sort? }, field }` titles the frame by that field of the
|
|
105
|
+
* first matching record, read under the reader's rights; `title` stays while none matches.
|
|
101
106
|
* - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,
|
|
102
107
|
* followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads
|
|
103
108
|
* `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`
|
|
104
|
-
* (default while offline), `success` or `info`.
|
|
109
|
+
* (default while offline), `success` or `info`. With `syncedFrom: { source: { register, schema,
|
|
110
|
+
* filter }, field }` the newest value of that date field is the last synchronisation, and while
|
|
111
|
+
* offline the line reads `offlineSyncedText` with `{time}` as its time (`offlineText` without one).
|
|
105
112
|
* - `width` — the frame width in pixels (default 350).
|
|
106
113
|
* - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.
|
|
107
114
|
*
|
|
@@ -184,6 +191,8 @@ export default {
|
|
|
184
191
|
return {
|
|
185
192
|
uid: instanceCounter,
|
|
186
193
|
online: typeof navigator === 'undefined' || navigator.onLine !== false,
|
|
194
|
+
readTitles: {},
|
|
195
|
+
syncedTime: '',
|
|
187
196
|
}
|
|
188
197
|
},
|
|
189
198
|
|
|
@@ -215,7 +224,7 @@ export default {
|
|
|
215
224
|
: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))
|
|
216
225
|
return {
|
|
217
226
|
key: String(frame.key || `frame-${index}`).replace(/[^\w-]/g, '-'),
|
|
218
|
-
title: this.tr(frame.title || ''),
|
|
227
|
+
title: this.readTitles[index] || this.tr(frame.title || ''),
|
|
219
228
|
sections,
|
|
220
229
|
status: this.statusOf(frame.status || this.content?.status || null),
|
|
221
230
|
}
|
|
@@ -224,6 +233,7 @@ export default {
|
|
|
224
233
|
},
|
|
225
234
|
|
|
226
235
|
mounted() {
|
|
236
|
+
this.readSources()
|
|
227
237
|
if (typeof window !== 'undefined') {
|
|
228
238
|
window.addEventListener('online', this.onConnection)
|
|
229
239
|
window.addEventListener('offline', this.onConnection)
|
|
@@ -263,13 +273,74 @@ export default {
|
|
|
263
273
|
if (status.followConnection === true) {
|
|
264
274
|
text = this.online ? status.onlineText : status.offlineText
|
|
265
275
|
tone = tone || (this.online ? 'success' : 'warning')
|
|
276
|
+
if (!this.online && this.syncedTime && typeof status.offlineSyncedText === 'string' && status.offlineSyncedText !== '') {
|
|
277
|
+
return this.statusLine(this.tr(status.offlineSyncedText).replace('{time}', this.syncedTime), tone)
|
|
278
|
+
}
|
|
266
279
|
}
|
|
267
280
|
if (typeof text !== 'string' || text === '') {
|
|
268
281
|
return null
|
|
269
282
|
}
|
|
283
|
+
return this.statusLine(this.tr(text), tone)
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* A status line of a text and a tone.
|
|
288
|
+
*
|
|
289
|
+
* @param {string} text The translated text.
|
|
290
|
+
* @param {string} tone The tone.
|
|
291
|
+
* @return {{text: string, tone: string, icon: object}}
|
|
292
|
+
*/
|
|
293
|
+
statusLine(text, tone) {
|
|
270
294
|
const known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'
|
|
271
295
|
const icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)
|
|
272
|
-
return { text
|
|
296
|
+
return { text, tone: known, icon: markRaw(icon) }
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* The first record of a `{ source: { register, schema, filter, sort? } }`, sorted by `sort` (or
|
|
301
|
+
* newest first by `orderBy`), under the reader's rights; null without one or while a token is unresolved.
|
|
302
|
+
*
|
|
303
|
+
* @param {object} spec The source spec.
|
|
304
|
+
* @param {string} [orderBy] A field to sort on, newest first, when the source names no sort.
|
|
305
|
+
* @return {Promise<object|null>}
|
|
306
|
+
*/
|
|
307
|
+
async firstOf(spec, orderBy = '') {
|
|
308
|
+
const source = spec?.source
|
|
309
|
+
if (!source || typeof source !== 'object' || !source.register || !source.schema) {
|
|
310
|
+
return null
|
|
311
|
+
}
|
|
312
|
+
const filter = resolveFilterTokens(source.filter || {}, { objectId: this.objectId || null, object: this.objectData })
|
|
313
|
+
if (hasUnresolvedTokens(filter)) {
|
|
314
|
+
return null
|
|
315
|
+
}
|
|
316
|
+
const sort = source.sort?.field ? { [`_order[${source.sort.field}]`]: source.sort.dir === 'asc' ? 'asc' : 'desc' } : (orderBy ? { [`_order[${orderBy}]`]: 'desc' } : {})
|
|
317
|
+
try {
|
|
318
|
+
const rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter: { ...filter, ...sort }, limit: 1 })
|
|
319
|
+
return Array.isArray(rows) && rows.length > 0 ? rows[0] : null
|
|
320
|
+
} catch {
|
|
321
|
+
return null
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
/** Read the frame titles (`titleFrom`) and the last synchronisation (`status.syncedFrom`). */
|
|
326
|
+
async readSources() {
|
|
327
|
+
const list = Array.isArray(this.content?.frames) ? this.content.frames.filter((frame) => frame && typeof frame === 'object') : []
|
|
328
|
+
const titles = {}
|
|
329
|
+
await Promise.all(list.map(async (frame, index) => {
|
|
330
|
+
if (!frame.titleFrom?.field) {
|
|
331
|
+
return
|
|
332
|
+
}
|
|
333
|
+
const value = readPath(await this.firstOf(frame.titleFrom), frame.titleFrom.field)
|
|
334
|
+
if (typeof value === 'string' && value !== '') {
|
|
335
|
+
titles[index] = value
|
|
336
|
+
}
|
|
337
|
+
}))
|
|
338
|
+
this.readTitles = titles
|
|
339
|
+
const synced = this.content?.status?.syncedFrom
|
|
340
|
+
if (synced?.field) {
|
|
341
|
+
const at = new Date(readPath(await this.firstOf(synced, synced.field), synced.field) ?? '')
|
|
342
|
+
this.syncedTime = Number.isNaN(at.getTime()) ? '' : `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`
|
|
343
|
+
}
|
|
273
344
|
},
|
|
274
345
|
|
|
275
346
|
/** Follow the browser's connection state. */
|
|
@@ -295,7 +295,7 @@ import { useRefLabels } from '../../composables/useRefLabels.js'
|
|
|
295
295
|
import { dispatchAction } from '../../utils/actionsDispatcher.js'
|
|
296
296
|
import { isBadgeVariant } from '../../utils/badgeVariants.js'
|
|
297
297
|
import { formatBoardDate, formatTimeOfDay } from '../../utils/boardDate.js'
|
|
298
|
-
import { formatTermDuration } from '../../utils/builtInFormatters.js'
|
|
298
|
+
import { formatPostcode, formatTermDuration } from '../../utils/builtInFormatters.js'
|
|
299
299
|
import { conditionalLine } from '../../utils/conditionalLine.js'
|
|
300
300
|
import { parseDateValue } from '../../utils/dateVariant.js'
|
|
301
301
|
import { fetchListTotal } from '../../utils/fetchFilterCounts.js'
|
|
@@ -525,8 +525,8 @@ export default {
|
|
|
525
525
|
* - `headerPill` — a status pill in the card header (reported through the `header` event): `{ path?, text?, map?, variant?, variantMap?, colorMap? }`, read from the record like a `pill` entry (DqBezwaar "Advies ontvangen"); nothing shows while the value is empty.
|
|
526
526
|
* - `notice` — `{ text, variant? }`, a note band inside the card under the facts (`info` by default; `success`, `warning` or `error`); the text is translated.
|
|
527
527
|
* - `footnote` — a plain muted line under the facts, without a band (DqZaakBesluiten "Na het ondertekenen ..."); the text is translated.
|
|
528
|
-
* `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `longdatetime` (the month written out, the year and the time: "7 oktober 2026, 09:12"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
|
|
529
|
-
* `format` is `text` (default), `today-time` (a moment today as "10:24", another day as its board date), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
|
|
528
|
+
* `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `longdatetime` (the month written out, the year and the time: "7 oktober 2026, 09:12"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `postcode` (a Dutch postcode with its space, "2999 AA"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
|
|
529
|
+
* `format` is `text` (default), `today-time` (a moment today as "10:24", another day as its board date), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `postcode` (a Dutch postcode with its space, "2999 AA"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
|
|
530
530
|
* `map` turns a raw value into a label (translated). `parts` (on a `line`) lists paths, or `{ path, label?, format? }`, joined by `separator` (default " · "); empty parts are dropped.
|
|
531
531
|
* - `source` — `{ register, schema, id }` or `{ url }`; omitted = the current object. `{ register, schema, filter, sort? }` without `id` reads the first object that matches `filter` in `sort` order (`{ field, dir }`): the latest count of a shift. An entry with `from: "object"` reads the current object even then (a client card that also shows the ticket's channel).
|
|
532
532
|
* - `endpointSource` — `{ url, method?, params?, responsePath? }`, the block a stat or chart takes: the facts read an app endpoint, shared and cached like those.
|
|
@@ -2242,6 +2242,10 @@ export default {
|
|
|
2242
2242
|
const end = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())
|
|
2243
2243
|
return String(Math.max(0, Math.round((end - start) / 86400000)))
|
|
2244
2244
|
}
|
|
2245
|
+
// A Dutch postcode with its space: "2999AA" as "2999 AA".
|
|
2246
|
+
if (format === 'postcode') {
|
|
2247
|
+
return formatPostcode(raw)
|
|
2248
|
+
}
|
|
2245
2249
|
if (format === 'year') {
|
|
2246
2250
|
const date = parseDateValue(raw)
|
|
2247
2251
|
return date === null ? '' : String(date.getFullYear())
|
|
@@ -405,6 +405,9 @@
|
|
|
405
405
|
:widget="column.widget || null"
|
|
406
406
|
:widgetProps="cellWidgetProps(column, node)"
|
|
407
407
|
:row="node" />
|
|
408
|
+
<span v-if="column.key !== 'name' && cellSubline(column, node)"
|
|
409
|
+
class="cn-files-browser__cell-subline"
|
|
410
|
+
data-testid="cn-files-browser-cell-subline">{{ cellSubline(column, node) }}</span>
|
|
408
411
|
</td>
|
|
409
412
|
<td class="cn-files-browser__col-actions" @click.stop @auxclick.stop>
|
|
410
413
|
<!-- The host's one visible button on a file ("Beoordelen"),
|
|
@@ -1185,9 +1188,12 @@ export default {
|
|
|
1185
1188
|
* The columns this browser shows, in order. An entry is a built-in name
|
|
1186
1189
|
* (`name`, `size`, `modified`, `owner`, `type`, `tags`) or an object
|
|
1187
1190
|
* declaring its own: `{ key, label, source, attribute, formatter,
|
|
1188
|
-
* sortable }`, where `source` is `node` (a property of the node),
|
|
1191
|
+
* sortable, subline }`, where `source` is `node` (a property of the node),
|
|
1189
1192
|
* `attribute` (a DAV property, added to the PROPFIND before listing) or
|
|
1190
|
-
* `row` (a value from `rowData`).
|
|
1193
|
+
* `row` (a value from `rowData`). `subline` is a template drawn as a
|
|
1194
|
+
* muted second line under the value, filled from the file's `rowData`
|
|
1195
|
+
* entry ("ground {reviewGrounds|values}"); it is left out when it
|
|
1196
|
+
* names no value.
|
|
1191
1197
|
*
|
|
1192
1198
|
* Declaring none keeps today's table: name, size and modified.
|
|
1193
1199
|
*
|
|
@@ -2219,8 +2225,7 @@ export default {
|
|
|
2219
2225
|
if ((!this.nameSecondary && fields === null) || this.isFolder(node)) {
|
|
2220
2226
|
return ''
|
|
2221
2227
|
}
|
|
2222
|
-
const
|
|
2223
|
-
const entry = byId[node.fileid] ?? byId[String(node.fileid)] ?? {}
|
|
2228
|
+
const entry = this.rowEntryOf(node)
|
|
2224
2229
|
const owner = node.attributes ? node.attributes['owner-display-name'] : undefined
|
|
2225
2230
|
const object = {
|
|
2226
2231
|
...entry,
|
|
@@ -2771,6 +2776,34 @@ export default {
|
|
|
2771
2776
|
return fileColumnValue(column, node, this.resolvedRowData)
|
|
2772
2777
|
},
|
|
2773
2778
|
|
|
2779
|
+
/**
|
|
2780
|
+
* The host's row data for one file (`rowData`, by file id), `{}` without it.
|
|
2781
|
+
*
|
|
2782
|
+
* @param {object} node The node.
|
|
2783
|
+
* @return {object} The row entry.
|
|
2784
|
+
*/
|
|
2785
|
+
rowEntryOf(node) {
|
|
2786
|
+
const byId = this.resolvedRowData && typeof this.resolvedRowData === 'object' ? this.resolvedRowData : {}
|
|
2787
|
+
return byId[node.fileid] ?? byId[String(node.fileid)] ?? {}
|
|
2788
|
+
},
|
|
2789
|
+
|
|
2790
|
+
/**
|
|
2791
|
+
* A declared column's second line under its value: the column's
|
|
2792
|
+
* `subline` template, translated and filled from the file's row data
|
|
2793
|
+
* ("ground {reviewGrounds|values}"), '' when it names no value.
|
|
2794
|
+
*
|
|
2795
|
+
* @param {object} column A resolved column.
|
|
2796
|
+
* @param {object} node The node.
|
|
2797
|
+
* @return {string} The line, or ''.
|
|
2798
|
+
* @spec openspec/changes/files-column-subline/specs/files-column-subline/spec.md#requirement-a-declared-column-can-draw-a-second-line-under-its-value
|
|
2799
|
+
*/
|
|
2800
|
+
cellSubline(column, node) {
|
|
2801
|
+
if (!column || typeof column.subline !== 'string' || column.subline === '') {
|
|
2802
|
+
return ''
|
|
2803
|
+
}
|
|
2804
|
+
return fillTemplate(this.cnTranslate(column.subline), this.rowEntryOf(node))
|
|
2805
|
+
},
|
|
2806
|
+
|
|
2774
2807
|
/**
|
|
2775
2808
|
* The tone a column or card field draws a value in: its `colorMap`
|
|
2776
2809
|
* entry for the value (case-insensitive), read from the `colorKey` field
|
|
@@ -3731,6 +3764,14 @@ export default {
|
|
|
3731
3764
|
white-space: nowrap;
|
|
3732
3765
|
}
|
|
3733
3766
|
|
|
3767
|
+
.cn-files-browser__cell-subline {
|
|
3768
|
+
display: block;
|
|
3769
|
+
margin-top: 3px;
|
|
3770
|
+
color: var(--color-text-maxcontrast);
|
|
3771
|
+
font-size: 12px;
|
|
3772
|
+
line-height: normal;
|
|
3773
|
+
}
|
|
3774
|
+
|
|
3734
3775
|
.cn-files-browser__name-secondary {
|
|
3735
3776
|
display: block;
|
|
3736
3777
|
overflow: hidden;
|
|
@@ -1011,7 +1011,8 @@ export default {
|
|
|
1011
1011
|
const options = field.optionsFrom
|
|
1012
1012
|
? [...(this.loadedOptions[field.optionsFrom] || [])]
|
|
1013
1013
|
: normaliseSelectOptions(field.options)
|
|
1014
|
-
|
|
1014
|
+
const listed = (o) => o.id === value || (o.key !== undefined && o.key === value)
|
|
1015
|
+
if (isSet(value) && typeof value !== 'object' && options.length > 0 && !options.some(listed)) {
|
|
1015
1016
|
options.push({ id: value, label: String(value) })
|
|
1016
1017
|
}
|
|
1017
1018
|
let widget = 'text'
|
|
@@ -1029,7 +1030,7 @@ export default {
|
|
|
1029
1030
|
widget,
|
|
1030
1031
|
value,
|
|
1031
1032
|
options,
|
|
1032
|
-
option: options.find((o) => o.id === value) || null,
|
|
1033
|
+
option: options.find((o) => o.id === value) || options.find(listed) || null,
|
|
1033
1034
|
isObject: value !== null && typeof value === 'object',
|
|
1034
1035
|
}
|
|
1035
1036
|
})
|
|
@@ -1037,8 +1038,10 @@ export default {
|
|
|
1037
1038
|
|
|
1038
1039
|
/**
|
|
1039
1040
|
* Where the selected step goes next: each outgoing line by its name
|
|
1040
|
-
* ("Ja", "Nee"), else
|
|
1041
|
+
* ("Ja", "Nee"), else by the exit it leaves by (its label, else its id
|
|
1042
|
+
* with a capital), else "Next", with the step it leads to.
|
|
1041
1043
|
*
|
|
1044
|
+
* @spec openspec/changes/flow-board-inspector-fields/specs/flow-board/spec.md#requirement-the-flow-board-inspector-edits-the-selected-steps-settings-and-names-its-outcomes
|
|
1042
1045
|
* @return {Array<{id: string, label: string, target: string}>} The outcomes.
|
|
1043
1046
|
*/
|
|
1044
1047
|
stepOutcomes() {
|
|
@@ -1050,9 +1053,18 @@ export default {
|
|
|
1050
1053
|
const node = this.store.nodes.find((item) => item.id === target)
|
|
1051
1054
|
return (node && (node.name || node.label)) || target
|
|
1052
1055
|
}
|
|
1056
|
+
const exits = (this.store.selectedNode && Array.isArray(this.store.selectedNode.exits)) ? this.store.selectedNode.exits : []
|
|
1057
|
+
const exitName = (line) => {
|
|
1058
|
+
const exitId = line.data && line.data.edge && line.data.edge.fromExit
|
|
1059
|
+
if (!exitId) {
|
|
1060
|
+
return ''
|
|
1061
|
+
}
|
|
1062
|
+
const exit = exits.find((item) => item && item.id === exitId)
|
|
1063
|
+
return (exit && exit.label) || String(exitId).charAt(0).toUpperCase() + String(exitId).slice(1)
|
|
1064
|
+
}
|
|
1053
1065
|
return (this.store.canvasEdges || [])
|
|
1054
1066
|
.filter((line) => line.source === id)
|
|
1055
|
-
.map((line) => ({ id: line.id, label: (line.data && line.data.label) || this.t('nextcloud-vue', 'Next'), target: nameOf(line.target) }))
|
|
1067
|
+
.map((line) => ({ id: line.id, label: (line.data && line.data.label) || exitName(line) || this.t('nextcloud-vue', 'Next'), target: nameOf(line.target) }))
|
|
1056
1068
|
},
|
|
1057
1069
|
|
|
1058
1070
|
/**
|
|
@@ -1229,8 +1241,9 @@ export default {
|
|
|
1229
1241
|
|
|
1230
1242
|
/**
|
|
1231
1243
|
* Load the choices of the selected step's select fields that name a
|
|
1232
|
-
* url (`optionsFrom`), once per url.
|
|
1244
|
+
* url (`optionsFrom`), once per url. A row's `key` stays on its option.
|
|
1233
1245
|
*
|
|
1246
|
+
* @spec openspec/changes/flow-board-inspector-fields/specs/flow-board/spec.md#requirement-the-flow-board-inspector-edits-the-selected-steps-settings-and-names-its-outcomes
|
|
1234
1247
|
* @return {Promise<void>}
|
|
1235
1248
|
*/
|
|
1236
1249
|
async loadStepOptions() {
|
|
@@ -1249,7 +1262,9 @@ export default {
|
|
|
1249
1262
|
try {
|
|
1250
1263
|
const response = await axios.get(url.startsWith('/') && !url.startsWith('/apps') && !url.startsWith('/index.php') ? generateUrl(url) : url)
|
|
1251
1264
|
const rows = Array.isArray(response.data) ? response.data : (response.data?.results || [])
|
|
1252
|
-
|
|
1265
|
+
const keys = new Map(rows.filter((row) => row && typeof row === 'object' && row.key).map((row) => [row.id ?? row.value ?? row['@self']?.uuid ?? row.uuid, row.key]))
|
|
1266
|
+
const options = normaliseSelectOptions(rows).map((option) => (keys.has(option.id) ? { ...option, key: keys.get(option.id) } : option))
|
|
1267
|
+
this.loadedOptions = { ...this.loadedOptions, [url]: options }
|
|
1253
1268
|
} catch (error) {
|
|
1254
1269
|
// The field then shows the stored value; Edit step still reaches everything.
|
|
1255
1270
|
// eslint-disable-next-line no-console -- diagnostic for a failure this degrades from
|
|
@@ -1602,6 +1617,12 @@ export default {
|
|
|
1602
1617
|
transform: translateX(18px);
|
|
1603
1618
|
}
|
|
1604
1619
|
|
|
1620
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1621
|
+
.cn-flow-board__toggle::after {
|
|
1622
|
+
transition: none;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1605
1626
|
.cn-flow-board__toggle:focus-visible {
|
|
1606
1627
|
outline: 2px solid var(--color-primary-element);
|
|
1607
1628
|
outline-offset: 2px;
|