@conduction/nextcloud-vue 2.160.0 → 2.162.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/CnActionsMenu/CnActionsMenu.vue2.js +3 -2
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js +2 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +20 -2
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +8 -8
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +23 -0
- 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/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +48 -5
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +2 -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 +4 -3
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js +2 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue.js +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js +41 -39
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +11 -3
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnMenuWidget/menuActive.js +2 -1
- package/dist/esm/components/CnMenuWidget/menuActive.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +39 -2
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue.js +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +5 -5
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue.js +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +10 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +3 -2
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js +2 -2
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +130 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js +27 -16
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +9 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +9 -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 +641 -569
- package/dist/esm/utils/auditEntries.js +25 -1
- package/dist/esm/utils/auditEntries.js.map +1 -1
- package/dist/esm/utils/buildManifestRoutes.js +2 -1
- package/dist/esm/utils/buildManifestRoutes.js.map +1 -1
- package/dist/esm/utils/cnFetch.js +1 -15
- package/dist/esm/utils/cnFetch.js.map +1 -1
- package/dist/esm/utils/fillTemplate.js +29 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/forge.js +4 -1
- package/dist/esm/utils/forge.js.map +1 -1
- package/dist/esm/utils/myTeam.js +17 -3
- package/dist/esm/utils/myTeam.js.map +1 -1
- package/dist/esm/utils/rowAggregate.js +20 -1
- package/dist/esm/utils/rowAggregate.js.map +1 -1
- package/dist/esm/utils/trailingSlashes.js +24 -0
- package/dist/esm/utils/trailingSlashes.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +1069 -683
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +641 -569
- package/l10n/en.json +9 -1
- package/l10n/nl.json +9 -1
- package/package.json +1 -1
- package/src/components/CnActionsMenu/CnActionsMenu.vue +3 -2
- package/src/components/CnAddressSearch/CnAddressSearch.vue +2 -1
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +20 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
- package/src/components/CnDataTable/CnDataTable.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +23 -0
- package/src/components/CnFactsWidget/CnFactsWidget.vue +49 -5
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +4 -3
- package/src/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/src/components/CnFilesWidget/CnFilesWidget.vue +2 -1
- package/src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue +1 -1
- package/src/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +11 -3
- package/src/components/CnMenuWidget/menuActive.js +2 -1
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +40 -3
- package/src/components/CnPageTreeNode/CnPageTreeNode.vue +2 -1
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +5 -5
- package/src/components/CnStatWidget/CnStatWidget.vue +10 -1
- package/src/components/CnTabsWidget/CnTabsWidget.vue +3 -2
- package/src/components/CnTimelineWidget/CnTimelineWidget.vue +2 -2
- package/src/css/dialog.css +7 -0
- package/src/css/look-board-detail.css +35 -0
- package/src/css/look-board.css +18 -1
- package/src/integrations/builtin/email/CnEmailTab.vue +155 -4
- package/src/utils/auditEntries.js +24 -0
- package/src/utils/buildManifestRoutes.js +2 -1
- package/src/utils/cnFetch.js +3 -15
- package/src/utils/fillTemplate.js +29 -2
- package/src/utils/forge.js +3 -1
- package/src/utils/myTeam.js +17 -3
- package/src/utils/rowAggregate.js +19 -0
- package/src/utils/trailingSlashes.js +21 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<template>
|
|
7
7
|
<div class="cn-object-parties" :class="{ 'cn-object-parties--board': isBoard }" data-testid="cn-object-parties">
|
|
8
|
-
<div v-if="canAdd" class="cn-object-parties__manage">
|
|
8
|
+
<div v-if="canAdd && !addInTitle" class="cn-object-parties__manage">
|
|
9
9
|
<NcButton data-testid="cn-object-parties-add" @click="adding = true">
|
|
10
10
|
<template #icon>
|
|
11
11
|
<Plus :size="20" />
|
|
@@ -300,13 +300,15 @@ function defaultLabels() {
|
|
|
300
300
|
*
|
|
301
301
|
* `manage` lets a reader change the parties through OpenRegister's party
|
|
302
302
|
* API, which asks the record's update right on every write: `add` (`{ label?,
|
|
303
|
-
* dialogTitle?, kind?, sources, create?, primary?, confirmLabel? }`) opens a
|
|
303
|
+
* dialogTitle?, kind?, sources, create?, primary?, confirmLabel?, placement? }`) opens a
|
|
304
304
|
* dialog to pick somebody known or describe somebody new (`create: {
|
|
305
305
|
* register, schema, label?, fields, compose? }`, see `newPartyRecord`), choose
|
|
306
306
|
* a role and optionally make them the primary party; `remove` (`{ title?,
|
|
307
307
|
* message?, confirmLabel? }`, `{name}` and `{role}` in the message) takes a
|
|
308
308
|
* party off in one role. Both are hidden when OpenRegister says the reader
|
|
309
|
-
* may not update the schema; a refusal is shown, never swallowed.
|
|
309
|
+
* may not update the schema; a refusal is shown, never swallowed. With
|
|
310
|
+
* `add.placement: "title"` the add button is reported to the card's title
|
|
311
|
+
* row (the `header` event) instead of drawn above the parties.
|
|
310
312
|
*
|
|
311
313
|
* `presentation: "primary"` draws only the primary party, as a side card
|
|
312
314
|
* does: initials, name and role label, its correspondence e-mail, and
|
|
@@ -368,6 +370,8 @@ export default {
|
|
|
368
370
|
},
|
|
369
371
|
},
|
|
370
372
|
|
|
373
|
+
emits: ['header'],
|
|
374
|
+
|
|
371
375
|
data() {
|
|
372
376
|
uid += 1
|
|
373
377
|
return {
|
|
@@ -409,6 +413,27 @@ export default {
|
|
|
409
413
|
return Boolean(this.manage.add) && this.mayUpdate && !this.isPrimaryPresentation && !this.loading && !this.failed
|
|
410
414
|
},
|
|
411
415
|
|
|
416
|
+
/** @return {boolean} Whether the add button goes to the card's title row. */
|
|
417
|
+
addInTitle() {
|
|
418
|
+
return this.manage.add?.placement === 'title'
|
|
419
|
+
},
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* The title-row actions: the add button when it is placed there.
|
|
423
|
+
*
|
|
424
|
+
* @spec openspec/changes/parties-add-in-title-row/specs/record-widgets/spec.md#requirement-a-parties-card-can-put-its-add-button-in-the-title-row
|
|
425
|
+
* @return {Array<object>} The actions.
|
|
426
|
+
*/
|
|
427
|
+
titleActions() {
|
|
428
|
+
if (!(this.addInTitle && this.canAdd)) {
|
|
429
|
+
return []
|
|
430
|
+
}
|
|
431
|
+
const run = () => {
|
|
432
|
+
this.adding = true
|
|
433
|
+
}
|
|
434
|
+
return [{ key: 'add', label: this.manageWord('add', 'label', t('nextcloud-vue', 'Add a party')), icon: 'Plus', variant: 'secondary', run }]
|
|
435
|
+
},
|
|
436
|
+
|
|
412
437
|
/** @return {boolean} Whether each party offers its remove button. */
|
|
413
438
|
canRemove() {
|
|
414
439
|
return Boolean(this.manage.remove) && this.mayUpdate && !this.isPrimaryPresentation
|
|
@@ -547,6 +572,18 @@ export default {
|
|
|
547
572
|
},
|
|
548
573
|
|
|
549
574
|
watch: {
|
|
575
|
+
titleActions: {
|
|
576
|
+
immediate: true,
|
|
577
|
+
handler(actions) {
|
|
578
|
+
if (this.addInTitle) {
|
|
579
|
+
/**
|
|
580
|
+
* @event header The card's title-row actions, `{ actions }`, for the host to draw.
|
|
581
|
+
*/
|
|
582
|
+
this.$emit('header', { actions })
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
},
|
|
586
|
+
|
|
550
587
|
recordKey: {
|
|
551
588
|
immediate: true,
|
|
552
589
|
handler() {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
import { translate as t } from '@nextcloud/l10n'
|
|
56
56
|
import draggable from 'vuedraggable'
|
|
57
57
|
import CnPageTreeRow from './CnPageTreeRow.vue'
|
|
58
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
58
59
|
|
|
59
60
|
// Stable per-page-object render keys, independent of the mutable `id`. Keyed by
|
|
60
61
|
// the page ref itself (a WeakMap, so removed pages are GC'd) so a slug rename —
|
|
@@ -317,7 +318,7 @@ export default {
|
|
|
317
318
|
* @return {void}
|
|
318
319
|
*/
|
|
319
320
|
addChild(node) {
|
|
320
|
-
const base = String(node.ref.route || '')
|
|
321
|
+
const base = stripTrailingSlashes(String(node.ref.route || ''))
|
|
321
322
|
const ref = { id: this.nextId(), parent: node.ref.id, type: 'detail', route: `${base}/:id`, title: '', config: {} }
|
|
322
323
|
node.children.push({ ref, children: [] })
|
|
323
324
|
this.flatten()
|
|
@@ -612,7 +612,7 @@ import { isObjectRowsSpec, objectRowsOf } from '../../utils/objectRows.js'
|
|
|
612
612
|
import { pageFilter, pageSort } from '../../utils/pageControls.js'
|
|
613
613
|
import { readPath } from '../../utils/readPath.js'
|
|
614
614
|
import { dropOptionalUnresolved, hasUnresolvedTokens, resolveDeepTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'
|
|
615
|
-
import { fetchRowAggregate, isRowAggregate } from '../../utils/rowAggregate.js'
|
|
615
|
+
import { cellsOf, fetchRowAggregate, isRowAggregate } from '../../utils/rowAggregate.js'
|
|
616
616
|
import { evaluateVisibleWhen, evaluateVisibleWhenLocal } from '../../utils/visibleWhen.js'
|
|
617
617
|
|
|
618
618
|
const PAGE_REFRESH_CHANNEL = 'cn:page:refresh'
|
|
@@ -2304,7 +2304,7 @@ export default {
|
|
|
2304
2304
|
this.aggregateValues = {}
|
|
2305
2305
|
return
|
|
2306
2306
|
}
|
|
2307
|
-
const next =
|
|
2307
|
+
const next = new Map()
|
|
2308
2308
|
const jobs = []
|
|
2309
2309
|
for (const raw of this.rows.slice(0, this.limit)) {
|
|
2310
2310
|
const row = scalarRow(raw)
|
|
@@ -2312,18 +2312,18 @@ export default {
|
|
|
2312
2312
|
if (!rowId) {
|
|
2313
2313
|
continue
|
|
2314
2314
|
}
|
|
2315
|
-
|
|
2315
|
+
const figures = cellsOf(next, rowId)
|
|
2316
2316
|
for (const [key, agg] of entries) {
|
|
2317
2317
|
jobs.push(fetchRowAggregate(agg, row)
|
|
2318
2318
|
.then((value) => {
|
|
2319
|
-
|
|
2319
|
+
figures[key] = this.aggregateText(agg, value)
|
|
2320
2320
|
})
|
|
2321
2321
|
.catch(() => {}))
|
|
2322
2322
|
}
|
|
2323
2323
|
}
|
|
2324
2324
|
await Promise.all(jobs)
|
|
2325
2325
|
if (id === this.aggregateRequestId) {
|
|
2326
|
-
this.aggregateValues = next
|
|
2326
|
+
this.aggregateValues = Object.fromEntries(next)
|
|
2327
2327
|
}
|
|
2328
2328
|
},
|
|
2329
2329
|
|
|
@@ -689,12 +689,17 @@ export default {
|
|
|
689
689
|
* placeholder in the source string and can move it within the sentence —
|
|
690
690
|
* the same contract as Nextcloud's own `t()` parameters.
|
|
691
691
|
*
|
|
692
|
+
* `@object.<field>`, `@objectId`, `@workspace.<key>` and `@config.<key>`
|
|
693
|
+
* read the page's contexts as a source's tokens do, so a register-counted
|
|
694
|
+
* tile can name its record's own figure ("of @object.capacity places").
|
|
695
|
+
*
|
|
692
696
|
* A token with no matching field resolves to the empty string rather
|
|
693
697
|
* than being left as `{levelName}` on screen: a caption is decoration,
|
|
694
698
|
* and showing a reader a raw token is worse than showing them less.
|
|
695
699
|
*
|
|
696
700
|
* @return {string}
|
|
697
701
|
* @spec openspec/changes/stat-caption-formats/specs/stat-widget/spec.md#requirement-a-stat-caption-token-can-carry-a-format
|
|
702
|
+
* @spec openspec/changes/stat-caption-object-token/specs/stat-caption-object-token/spec.md#requirement-a-stat-caption-can-name-a-field-of-the-pages-record
|
|
698
703
|
*/
|
|
699
704
|
resolvedCaption() {
|
|
700
705
|
const override = this.activeOverride
|
|
@@ -713,7 +718,11 @@ export default {
|
|
|
713
718
|
const zero = count !== null && this.content.captionSource.zeroText
|
|
714
719
|
return typeof zero === 'string' && zero !== '' ? this.effectiveTranslate(zero) : ''
|
|
715
720
|
}
|
|
716
|
-
|
|
721
|
+
// `@object.<field>` names a field of the page's record (PqEvenement
|
|
722
|
+
// "van @object.capacity plaatsen" on a register-counted tile).
|
|
723
|
+
const translated = caption.indexOf('@') === -1
|
|
724
|
+
? this.effectiveTranslate(caption)
|
|
725
|
+
: this.interpolateTokens(this.effectiveTranslate(caption)).replace(/\s{2,}/g, ' ').trim()
|
|
717
726
|
if (translated.indexOf('{') === -1) {
|
|
718
727
|
return translated
|
|
719
728
|
}
|
|
@@ -229,7 +229,7 @@ import CnTabs from '../CnTabs/CnTabs.vue'
|
|
|
229
229
|
import CnWidgetHeaderActionButtons from '../CnWidgetWrapper/CnWidgetHeaderActionButtons.vue'
|
|
230
230
|
import { normalizeLook } from '../../composables/useLook.js'
|
|
231
231
|
import { dispatchAction } from '../../utils/actionsDispatcher.js'
|
|
232
|
-
import { keepAuditEntries } from '../../utils/auditEntries.js'
|
|
232
|
+
import { auditExclusionParams, keepAuditEntries } from '../../utils/auditEntries.js'
|
|
233
233
|
import { headerLinkTarget, resolveHeaderLink, widgetHeaderLink } from '../../utils/contentHeaderLink.js'
|
|
234
234
|
import { resolveTabCount } from '../../utils/detailActionModel.js'
|
|
235
235
|
import { detailWidgetVisible } from '../../utils/detailWidgetVisibility.js'
|
|
@@ -1435,7 +1435,8 @@ export default {
|
|
|
1435
1435
|
return null
|
|
1436
1436
|
}
|
|
1437
1437
|
try {
|
|
1438
|
-
const
|
|
1438
|
+
const query = new URLSearchParams({ limit: '100', ...auditExclusionParams(source) })
|
|
1439
|
+
const response = await fetch(prefixUrl(`/apps/openregister/api/objects/${register}/${schema}/${this.objectId}/audit-trails?${query.toString()}`), { headers: buildHeaders() })
|
|
1439
1440
|
if (!response.ok) {
|
|
1440
1441
|
return null
|
|
1441
1442
|
}
|
|
@@ -153,7 +153,7 @@ import CnIcon from '../CnIcon/CnIcon.vue'
|
|
|
153
153
|
import CnNoteComposer from '../CnNoteComposer/CnNoteComposer.vue'
|
|
154
154
|
import CnTimelineManage from './CnTimelineManage.vue'
|
|
155
155
|
import { useRefLabels } from '../../composables/useRefLabels.js'
|
|
156
|
-
import { keepAuditEntries } from '../../utils/auditEntries.js'
|
|
156
|
+
import { auditExclusionParams, keepAuditEntries } from '../../utils/auditEntries.js'
|
|
157
157
|
import { auditLabel } from '../../utils/auditLabels.js'
|
|
158
158
|
import { readPath } from '../../utils/readPath.js'
|
|
159
159
|
import { auditEvents, endpointEvents, fieldEvents, listEvents, relatedEvents, sortEvents, timelineEntryEvents } from '../../utils/timelineEvents.js'
|
|
@@ -813,7 +813,7 @@ export default {
|
|
|
813
813
|
})
|
|
814
814
|
|
|
815
815
|
if (this.content.auditTrail === true) {
|
|
816
|
-
jobs.push(axios.get(generateUrl(`${base}/audit-trails`), { params: { limit: this.content.auditLimit || 50 } })
|
|
816
|
+
jobs.push(axios.get(generateUrl(`${base}/audit-trails`), { params: { limit: this.content.auditLimit || 50, ...auditExclusionParams(this.content) } })
|
|
817
817
|
.then((r) => {
|
|
818
818
|
const data = r && r.data
|
|
819
819
|
this.auditEntries = (data && (data.results || data)) || []
|
package/src/css/dialog.css
CHANGED
|
@@ -744,6 +744,13 @@ body:has(.cn-look-board):not(:has(.cn-look-nextcloud)) .modal-mask {
|
|
|
744
744
|
background: var(--color-primary-element) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z'/%3E%3C/svg%3E") center / 14px no-repeat;
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
+
/* The access purpose's chosen row is filled, as DqZaakDoel draws "Behandeling
|
|
748
|
+
van de zaak": the ground Nextcloud gives a checked option only on hover or
|
|
749
|
+
focus. */
|
|
750
|
+
.cn-dialog-board .cn-access-purpose__choices .checkbox-radio-switch--checked:not(.checkbox-radio-switch--disabled) .checkbox-content {
|
|
751
|
+
background-color: var(--color-primary-element-light-hover);
|
|
752
|
+
}
|
|
753
|
+
|
|
747
754
|
/* The duplicate warning as DqNieuweZaakDubbel draws it. The note is a warning
|
|
748
755
|
line, 12px 14px in at radius 8 on the status warning ground, 15px bold in
|
|
749
756
|
the warning ink with a 20px icon 10px before it; NcNoteCard paints its
|
|
@@ -848,6 +848,14 @@
|
|
|
848
848
|
padding-top: 10px;
|
|
849
849
|
}
|
|
850
850
|
|
|
851
|
+
/* The calendar and Deck cards (DqZaakTaken "Afspraken", "Kaarten") open on a
|
|
852
|
+
ruled row, so no leading comes off: the first row starts 12px under the
|
|
853
|
+
title block, as drawn. */
|
|
854
|
+
.cn-look-board .cn-detail-card .cn-detail-card__content:has(> .cn-calendar-card__list:first-child):not(.cn-look-nextcloud *),
|
|
855
|
+
.cn-look-board .cn-detail-card .cn-detail-card__content:has(> .cn-deck-card__rows:first-child):not(.cn-look-nextcloud *) {
|
|
856
|
+
padding-top: 12px;
|
|
857
|
+
}
|
|
858
|
+
|
|
851
859
|
/* A data card (labels over values) starts 14px below its title (DqZaak
|
|
852
860
|
"Zaakgegevens", DqContact "Contact"); its first label sits at the top of
|
|
853
861
|
its line box, so no leading comes off. A side card keeps its 10px.
|
|
@@ -2088,6 +2096,33 @@
|
|
|
2088
2096
|
color: var(--cn-board-text-soft);
|
|
2089
2097
|
}
|
|
2090
2098
|
|
|
2099
|
+
/* A linked mail's details (DqZaakEmail): an outgoing mail's initials on the
|
|
2100
|
+
light primary tile, and a 13px/600 pill after the text, green for its
|
|
2101
|
+
archive copy ("Als pdf gearchiveerd"), light primary for "Gekoppeld".
|
|
2102
|
+
@spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md */
|
|
2103
|
+
.cn-look-board .cn-email-tab__avatar--outbound:not(.cn-look-nextcloud *) .avatardiv__initials-wrapper {
|
|
2104
|
+
background-color: var(--color-primary-element-light) !important;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
.cn-look-board .cn-email-tab__avatar--outbound:not(.cn-look-nextcloud *) .avatardiv__initials {
|
|
2108
|
+
color: var(--cn-board-primary-light-ink) !important;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
.cn-look-board .cn-email-tab__pill:not(.cn-look-nextcloud *) {
|
|
2112
|
+
padding: 3px 10px;
|
|
2113
|
+
border-radius: 12px;
|
|
2114
|
+
background: var(--color-primary-element-light);
|
|
2115
|
+
color: var(--cn-board-primary-light-ink);
|
|
2116
|
+
font-size: 13px;
|
|
2117
|
+
font-weight: 600;
|
|
2118
|
+
line-height: normal;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
.cn-look-board .cn-email-tab__pill--archived:not(.cn-look-nextcloud *) {
|
|
2122
|
+
background: var(--cn-board-success-tint);
|
|
2123
|
+
color: var(--cn-board-success-ink);
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2091
2126
|
/* ---- The attention flag's buttons --------------------------------------- */
|
|
2092
2127
|
/* The case boards draw "Markeer voor aandacht" and the flag's other labelled
|
|
2093
2128
|
buttons at the 40px control height (DqZaak and the case tab boards);
|
package/src/css/look-board.css
CHANGED
|
@@ -598,7 +598,8 @@
|
|
|
598
598
|
|
|
599
599
|
/* ---- A table on a dashboard card ------------------------------------------ */
|
|
600
600
|
/* The card is the frame: a table on it draws no border of its own, and its
|
|
601
|
-
pager sits on the card's inset under a hairline
|
|
601
|
+
pager sits on the card's inset under a hairline 12px under the table, its
|
|
602
|
+
links 12px below that (DqDoorlooptijd
|
|
602
603
|
"Zaken met risico", "Prestaties per zaaktype"; r32 a second frame inside
|
|
603
604
|
the card, the pager 16px in).
|
|
604
605
|
@spec openspec/changes/board-dashboard-table-in-card/specs/board-dashboard-table-in-card/spec.md#requirement-a-table-on-a-board-dashboard-card-has-no-frame-of-its-own */
|
|
@@ -608,6 +609,7 @@
|
|
|
608
609
|
}
|
|
609
610
|
|
|
610
611
|
.cn-look-board .cn-dashboard-page:not(.cn-look-nextcloud *) .cn-widget-wrapper__content .cn-table-container--board .cn-pagination.cn-pagination--board {
|
|
612
|
+
margin: 12px 0 0;
|
|
611
613
|
padding: 12px 0 0;
|
|
612
614
|
}
|
|
613
615
|
|
|
@@ -3343,6 +3345,15 @@ body:has(.cn-look-board):not(:has(.cn-look-nextcloud)) .vs__dropdown-menu:has(.c
|
|
|
3343
3345
|
padding: 0 var(--cn-board-dashboard-card-inset) 10px;
|
|
3344
3346
|
}
|
|
3345
3347
|
|
|
3348
|
+
/* A card of ruled rows (a record list that rules above its rows, a task
|
|
3349
|
+
list) ends 20px under its last row, the card's own padding, as the Dq
|
|
3350
|
+
boards draw it (DqMijnTeam "Wachtrij van uw team", DqMijnWerk "Mijn
|
|
3351
|
+
taken", "Verder werken"). */
|
|
3352
|
+
.cn-look-board .cn-dashboard-page:not(.cn-look-nextcloud *) .cn-widget-wrapper:not(.cn-widget-wrapper--borderless) .cn-widget-wrapper__content > .cn-record-list.cn-record-list--rule-above,
|
|
3353
|
+
.cn-look-board .cn-dashboard-page:not(.cn-look-nextcloud *) .cn-widget-wrapper:not(.cn-widget-wrapper--borderless) .cn-widget-wrapper__content > .cn-tasks-widget.cn-tasks-widget--list {
|
|
3354
|
+
padding-bottom: 20px;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3346
3357
|
/* The stacked bar's legend in the board's type: the label 14px and the
|
|
3347
3358
|
count 22px, both at the font's normal line height, 2px apart: a 46px item
|
|
3348
3359
|
(DqMijnWerk "Mijn 14 zaken per stap"; live drew 14.25/22.5px at 1.5 and
|
|
@@ -3583,6 +3594,12 @@ body:has(.cn-look-board):not(:has(.cn-look-nextcloud)) .vs__dropdown-menu:has(.c
|
|
|
3583
3594
|
line-height: normal;
|
|
3584
3595
|
}
|
|
3585
3596
|
|
|
3597
|
+
/* The footnote under the sections is a 13px line on the font's own leading
|
|
3598
|
+
(DqDoorlooptijd "Naleving"); the body's 1.5 made it 19.5 high. */
|
|
3599
|
+
.cn-look-board .cn-sections-widget__footnote:not(.cn-look-nextcloud *) {
|
|
3600
|
+
line-height: normal;
|
|
3601
|
+
}
|
|
3602
|
+
|
|
3586
3603
|
/* ---- Week strip (DqMijnWerk "Termijnen deze week") ---------------------- */
|
|
3587
3604
|
/* The days wrap inside the card instead of scrolling sideways: a row holds
|
|
3588
3605
|
as many days of at least 120px as the card fits, and the rest go to the
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
<span class="cn-email-tab__unread-dot" :class="{ 'is-shown': row.unread }" />
|
|
58
58
|
<NcAvatar
|
|
59
59
|
class="cn-email-tab__avatar"
|
|
60
|
+
:class="{ 'cn-email-tab__avatar--outbound': row.outbound }"
|
|
60
61
|
:size="36"
|
|
61
62
|
:displayName="row.avatarName"
|
|
62
63
|
:user="row.avatarUser"
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
<div class="cn-email-tab__body">
|
|
65
66
|
<div class="cn-email-tab__line">
|
|
66
67
|
<span class="cn-email-tab__subject" :title="row.subject">{{ row.subject }}</span>
|
|
67
|
-
<span class="cn-email-tab__date">
|
|
68
|
+
<span v-if="!row.meta" class="cn-email-tab__date">
|
|
68
69
|
<NcDateTime
|
|
69
70
|
v-if="row.dateValid"
|
|
70
71
|
:timestamp="row.dateMs"
|
|
@@ -72,14 +73,20 @@
|
|
|
72
73
|
<template v-else>{{ row.dateRaw }}</template>
|
|
73
74
|
</span>
|
|
74
75
|
</div>
|
|
75
|
-
<div class="cn-email-tab__sender" :title="row.sender">
|
|
76
|
-
{{ row.sender }}
|
|
76
|
+
<div class="cn-email-tab__sender" :title="row.meta || row.sender">
|
|
77
|
+
{{ row.meta || row.sender }}
|
|
77
78
|
</div>
|
|
78
79
|
<div v-if="row.snippet" class="cn-email-tab__snippet" :title="row.snippet">
|
|
79
80
|
{{ row.snippet }}
|
|
80
81
|
</div>
|
|
81
82
|
</div>
|
|
82
83
|
</component>
|
|
84
|
+
<span
|
|
85
|
+
v-if="row.pill"
|
|
86
|
+
class="cn-email-tab__pill"
|
|
87
|
+
:class="{ 'cn-email-tab__pill--archived': row.archived }">
|
|
88
|
+
{{ row.pill }}
|
|
89
|
+
</span>
|
|
83
90
|
<NcActions
|
|
84
91
|
class="cn-email-tab__menu"
|
|
85
92
|
:ariaLabel="moreActionsLabel"
|
|
@@ -125,14 +132,16 @@
|
|
|
125
132
|
</template>
|
|
126
133
|
|
|
127
134
|
<script>
|
|
128
|
-
import { translate as t } from '@nextcloud/l10n'
|
|
135
|
+
import { translatePlural as n, translate as t } from '@nextcloud/l10n'
|
|
129
136
|
import { NcActionButton, NcActionLink, NcActions, NcAvatar, NcButton, NcDateTime, NcLoadingIcon } from '@nextcloud/vue'
|
|
130
137
|
import EmailEditOutline from 'vue-material-design-icons/EmailEditOutline.vue'
|
|
131
138
|
import LinkVariant from 'vue-material-design-icons/LinkVariant.vue'
|
|
132
139
|
import LinkVariantOff from 'vue-material-design-icons/LinkVariantOff.vue'
|
|
133
140
|
import OpenInNew from 'vue-material-design-icons/OpenInNew.vue'
|
|
134
141
|
import CnEmailPicker from '../../../components/CnEmailPicker/CnEmailPicker.vue'
|
|
142
|
+
import { ageInDays, formatBoardDate, formatTimeOfDay } from '../../../utils/boardDate.js'
|
|
135
143
|
import { buildHeaders, prefixUrl } from '../../../utils/index.js'
|
|
144
|
+
import { userDisplayName } from '../../../utils/userDisplayName.js'
|
|
136
145
|
|
|
137
146
|
/**
|
|
138
147
|
* CnEmailTab — sidebar tab rendering the full list of Nextcloud Mail
|
|
@@ -242,6 +251,7 @@ export default {
|
|
|
242
251
|
* buble-compiled Vue 2 template stays free of `?.` / `??`.
|
|
243
252
|
*
|
|
244
253
|
* @return {object[]} One descriptor per message.
|
|
254
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
245
255
|
*/
|
|
246
256
|
rows() {
|
|
247
257
|
return this.messages.map((message) => {
|
|
@@ -249,6 +259,8 @@ export default {
|
|
|
249
259
|
const d = dateRaw === '' ? null : new Date(dateRaw)
|
|
250
260
|
const dateValid = d !== null && Number.isNaN(d.getTime()) === false
|
|
251
261
|
const sender = this.formatSender(message)
|
|
262
|
+
const details = this.linkDetails(message)
|
|
263
|
+
const archivedAs = details === null ? '' : this.text(details.archivedAs)
|
|
252
264
|
return {
|
|
253
265
|
id: message.id,
|
|
254
266
|
message,
|
|
@@ -262,6 +274,10 @@ export default {
|
|
|
262
274
|
avatarName: sender,
|
|
263
275
|
avatarUser: this.senderEmail(message),
|
|
264
276
|
href: this.threadUrl(message),
|
|
277
|
+
meta: details === null ? '' : this.metaLine(message, details, dateValid ? d : null),
|
|
278
|
+
outbound: details !== null && details.direction === 'outbound',
|
|
279
|
+
pill: details === null ? '' : this.archiveLabel(archivedAs),
|
|
280
|
+
archived: archivedAs !== '',
|
|
265
281
|
}
|
|
266
282
|
})
|
|
267
283
|
},
|
|
@@ -439,6 +455,126 @@ export default {
|
|
|
439
455
|
return false
|
|
440
456
|
},
|
|
441
457
|
|
|
458
|
+
/**
|
|
459
|
+
* The link's details (OpenRegister's EmailLink `details`), or null for
|
|
460
|
+
* a link without them, which keeps the plain sender line.
|
|
461
|
+
*
|
|
462
|
+
* @param {object} message The message record.
|
|
463
|
+
* @return {object|null} The details.
|
|
464
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
465
|
+
*/
|
|
466
|
+
linkDetails(message) {
|
|
467
|
+
const details = message.details
|
|
468
|
+
if (details === null || typeof details !== 'object') {
|
|
469
|
+
return null
|
|
470
|
+
}
|
|
471
|
+
const filled = Object.keys(details).some((key) => details[key] !== null && details[key] !== undefined && details[key] !== '')
|
|
472
|
+
return filled ? details : null
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* A trimmed string, or '' for anything that is not a filled string.
|
|
477
|
+
*
|
|
478
|
+
* @param {unknown} value The value.
|
|
479
|
+
* @return {string} The text.
|
|
480
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
481
|
+
*/
|
|
482
|
+
text(value) {
|
|
483
|
+
return typeof value === 'string' ? value.trim() : ''
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* The line under the subject: who it is from or to, when, how many
|
|
488
|
+
* attachments, and how it was linked, joined by middle dots.
|
|
489
|
+
*
|
|
490
|
+
* @param {object} message The message record.
|
|
491
|
+
* @param {object} details The link details.
|
|
492
|
+
* @param {Date|null} date The mail's moment, or null when unknown.
|
|
493
|
+
* @return {string} The meta line.
|
|
494
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
495
|
+
*/
|
|
496
|
+
metaLine(message, details, date) {
|
|
497
|
+
const parts = []
|
|
498
|
+
const recipient = this.text(details.recipientName)
|
|
499
|
+
if (details.direction === 'outbound' && recipient !== '') {
|
|
500
|
+
parts.push(t('nextcloud-vue', 'To {name}', { name: recipient }))
|
|
501
|
+
} else {
|
|
502
|
+
parts.push(t('nextcloud-vue', 'From {name}', { name: this.formatSender(message) }))
|
|
503
|
+
}
|
|
504
|
+
if (date !== null) {
|
|
505
|
+
parts.push(this.whenText(date))
|
|
506
|
+
}
|
|
507
|
+
const count = Number(details.attachmentCount)
|
|
508
|
+
if (Number.isInteger(count) && count > 0) {
|
|
509
|
+
parts.push(n('nextcloud-vue', '%n attachment', '%n attachments', count))
|
|
510
|
+
}
|
|
511
|
+
const linked = this.linkedText(message, details)
|
|
512
|
+
if (linked !== '') {
|
|
513
|
+
parts.push(linked)
|
|
514
|
+
}
|
|
515
|
+
return parts.join(' · ')
|
|
516
|
+
},
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* The mail's date as the boards write it: "5 okt 09.15" in the last
|
|
520
|
+
* week, "12 mrt" before that.
|
|
521
|
+
*
|
|
522
|
+
* @param {Date} date The mail's moment.
|
|
523
|
+
* @return {string} The date.
|
|
524
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
525
|
+
*/
|
|
526
|
+
whenText(date) {
|
|
527
|
+
const day = formatBoardDate(date)
|
|
528
|
+
const age = ageInDays(date)
|
|
529
|
+
if (age !== null && age >= 0 && age <= 7) {
|
|
530
|
+
return day + ' ' + formatTimeOfDay(date)
|
|
531
|
+
}
|
|
532
|
+
return day
|
|
533
|
+
},
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* How the mail was linked: automatically through a shared mailbox, from
|
|
537
|
+
* a saved mail file, or by a person.
|
|
538
|
+
*
|
|
539
|
+
* @param {object} message The message record.
|
|
540
|
+
* @param {object} details The link details.
|
|
541
|
+
* @return {string} The phrase, or '' when unknown.
|
|
542
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
543
|
+
*/
|
|
544
|
+
linkedText(message, details) {
|
|
545
|
+
if (details.linkedVia === 'mailbox') {
|
|
546
|
+
const mailbox = this.text(details.mailboxName)
|
|
547
|
+
return mailbox === ''
|
|
548
|
+
? t('nextcloud-vue', 'linked automatically')
|
|
549
|
+
: t('nextcloud-vue', 'linked automatically via {mailbox}', { mailbox })
|
|
550
|
+
}
|
|
551
|
+
if (details.linkedVia === 'file') {
|
|
552
|
+
return t('nextcloud-vue', 'from a saved mail file')
|
|
553
|
+
}
|
|
554
|
+
if (details.linkedVia === 'manual') {
|
|
555
|
+
const name = userDisplayName(message.linkedBy)
|
|
556
|
+
return name === '' ? '' : t('nextcloud-vue', 'linked by {name}', { name })
|
|
557
|
+
}
|
|
558
|
+
return ''
|
|
559
|
+
},
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* The pill beside a mail with details: its archive copy, or "Linked".
|
|
563
|
+
*
|
|
564
|
+
* @param {string} archivedAs The archive format, such as pdf, or ''.
|
|
565
|
+
* @return {string} The pill text.
|
|
566
|
+
* @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
|
|
567
|
+
*/
|
|
568
|
+
archiveLabel(archivedAs) {
|
|
569
|
+
if (archivedAs === '') {
|
|
570
|
+
return t('nextcloud-vue', 'Linked')
|
|
571
|
+
}
|
|
572
|
+
if (archivedAs.toLowerCase() === 'pdf') {
|
|
573
|
+
return t('nextcloud-vue', 'Archived as PDF')
|
|
574
|
+
}
|
|
575
|
+
return t('nextcloud-vue', 'Archived as {format}', { format: archivedAs })
|
|
576
|
+
},
|
|
577
|
+
|
|
442
578
|
rawWhen(message) {
|
|
443
579
|
const raw = message.mailDate || message.date || message.linkedAt
|
|
444
580
|
if (raw === undefined || raw === null || raw === '') {
|
|
@@ -659,6 +795,21 @@ a.cn-email-tab__row:hover {
|
|
|
659
795
|
white-space: nowrap;
|
|
660
796
|
}
|
|
661
797
|
|
|
798
|
+
.cn-email-tab__pill {
|
|
799
|
+
flex: none;
|
|
800
|
+
padding: 2px 8px;
|
|
801
|
+
border-radius: var(--border-radius-pill, 12px);
|
|
802
|
+
background: var(--color-primary-element-light);
|
|
803
|
+
color: var(--color-primary-element-light-text);
|
|
804
|
+
font-size: 0.85em;
|
|
805
|
+
white-space: nowrap;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.cn-email-tab__pill--archived {
|
|
809
|
+
background: var(--color-success);
|
|
810
|
+
color: var(--color-success-text);
|
|
811
|
+
}
|
|
812
|
+
|
|
662
813
|
.cn-email-tab__snippet {
|
|
663
814
|
color: var(--color-text-maxcontrast);
|
|
664
815
|
font-size: 0.85em;
|
|
@@ -43,3 +43,27 @@ export function keepAuditEntries(entries, { excludeActions = [], excludeActors =
|
|
|
43
43
|
&& !actors.includes(String(entry.user || '').toLowerCase())
|
|
44
44
|
&& !isEmptyUpdate(entry))
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The trail query parameters that leave the excluded actions and actors out
|
|
49
|
+
* on the server (`action[notIn]`, `user[notIn]`), so a page read from the
|
|
50
|
+
* trail holds what a history shows. `keepAuditEntries` still filters what
|
|
51
|
+
* comes back. Empty when nothing is left out.
|
|
52
|
+
*
|
|
53
|
+
* @param {{excludeActions?: Array<string>, excludeActors?: Array<string>}} [options] What to leave out.
|
|
54
|
+
* @return {Object<string, string>} The parameters.
|
|
55
|
+
* @spec openspec/changes/audit-card-exclusions-in-the-query/specs/audit-trail/spec.md#requirement-a-timeline-and-a-tab-count-ask-the-trail-to-leave-out-what-they-hide
|
|
56
|
+
*/
|
|
57
|
+
export function auditExclusionParams({ excludeActions = [], excludeActors = [] } = {}) {
|
|
58
|
+
const list = (values) => (Array.isArray(values) ? values : []).map(String).filter(Boolean)
|
|
59
|
+
const params = {}
|
|
60
|
+
const actions = list(excludeActions)
|
|
61
|
+
const actors = list(excludeActors)
|
|
62
|
+
if (actions.length > 0) {
|
|
63
|
+
params['action[notIn]'] = actions.join(',')
|
|
64
|
+
}
|
|
65
|
+
if (actors.length > 0) {
|
|
66
|
+
params['user[notIn]'] = actors.join(',')
|
|
67
|
+
}
|
|
68
|
+
return params
|
|
69
|
+
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { routeParamNames } from './routeParams.js'
|
|
27
|
+
import { stripTrailingSlashes } from './trailingSlashes.js'
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Suffix that turns a page id into the name of its split route.
|
|
@@ -73,7 +74,7 @@ export function pageHasSplitView(page) {
|
|
|
73
74
|
* @spec openspec/changes/case-page-and-list-as-a-place/specs/index-page/spec.md
|
|
74
75
|
*/
|
|
75
76
|
export function splitRoutePath(route) {
|
|
76
|
-
const base = typeof route === 'string' ? route
|
|
77
|
+
const base = typeof route === 'string' ? stripTrailingSlashes(route) : ''
|
|
77
78
|
const param = routeParamNames(base).includes('id') ? 'splitId' : 'id'
|
|
78
79
|
return `${base}/split/:${param}`
|
|
79
80
|
}
|
package/src/utils/cnFetch.js
CHANGED
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
|
|
32
32
|
import { trackedFetch } from './diagnostics.js'
|
|
33
33
|
import { buildHeaders, buildQueryString, prefixUrl } from './headers.js'
|
|
34
|
+
import { stripTrailingSlashes } from './trailingSlashes.js'
|
|
35
|
+
|
|
36
|
+
export { stripTrailingSlashes }
|
|
34
37
|
|
|
35
38
|
/** The hosts the runtime can boot under. */
|
|
36
39
|
export const CN_HOSTS = ['nextcloud', 'public']
|
|
@@ -64,21 +67,6 @@ export function configureCnFetch(config = {}) {
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
/**
|
|
68
|
-
* Drop trailing `/` characters in one linear pass (a `/\/+$/` pattern
|
|
69
|
-
* backtracks quadratically on a long run of slashes).
|
|
70
|
-
*
|
|
71
|
-
* @param {string} value The string to trim.
|
|
72
|
-
* @return {string} The string without trailing slashes.
|
|
73
|
-
*/
|
|
74
|
-
export function stripTrailingSlashes(value) {
|
|
75
|
-
let end = value.length
|
|
76
|
-
while (end > 0 && value.charCodeAt(end - 1) === 47) {
|
|
77
|
-
end--
|
|
78
|
-
}
|
|
79
|
-
return value.slice(0, end)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
70
|
/**
|
|
83
71
|
* The bearer credential, resolved.
|
|
84
72
|
*
|