@conduction/nextcloud-vue 2.169.0 → 2.170.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/CnCellRenderer/CnCellRenderer.vue.js +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +7 -2
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +88 -0
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +4 -3
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +46 -3
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +9 -3
- 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/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +13 -6
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue2.js +14 -3
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue3.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +243 -201
- package/dist/esm/utils/objectParties.js +50 -5
- package/dist/esm/utils/objectParties.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +237 -30
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +243 -201
- package/package.json +1 -1
- package/src/components/CnCellRenderer/CnCellRenderer.vue +7 -2
- package/src/components/CnDashboardGrid/CnDashboardGrid.md +1 -0
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +100 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +47 -3
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +9 -3
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +14 -5
- package/src/css/dialog.css +7 -5
- package/src/css/look-board-index.css +21 -2
- package/src/css/look-board.css +12 -0
- package/src/integrations/builtin/contacts/CnContactsTab.vue +14 -3
- package/src/integrations/builtin/contacts/__tests__/CnContactsTabBoardRows.spec.js +17 -2
- package/src/utils/objectParties.js +49 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/nextcloud-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.170.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": {
|
|
@@ -752,19 +752,24 @@ export default {
|
|
|
752
752
|
},
|
|
753
753
|
|
|
754
754
|
/**
|
|
755
|
-
* The `badge` widget's entries when the value is a list, each as
|
|
756
|
-
*
|
|
755
|
+
* The `badge` widget's entries when the value is a list, each as its
|
|
756
|
+
* label: the items' `x-enum-labels` (or the normalised `enumLabels`),
|
|
757
|
+
* translated, else the entry as stored. Null for a single value.
|
|
757
758
|
*
|
|
758
759
|
* @return {string[]|null}
|
|
759
760
|
* @spec openspec/changes/badge-cell-list/specs/badge-cell-list/spec.md#requirement-a-badge-cell-draws-one-chip-per-entry-of-a-list
|
|
761
|
+
* @spec openspec/changes/badge-list-labels-and-tags/specs/badge-cell-list/spec.md#requirement-a-badge-list-chip-shows-its-entrys-label
|
|
760
762
|
*/
|
|
761
763
|
badgeList() {
|
|
762
764
|
if (!Array.isArray(this.value)) {
|
|
763
765
|
return null
|
|
764
766
|
}
|
|
767
|
+
const items = (this.property && this.property.items) || {}
|
|
768
|
+
const labels = items.enumLabels || items['x-enum-labels'] || (this.property && (this.property.enumLabels || this.property['x-enum-labels'])) || {}
|
|
765
769
|
return this.value
|
|
766
770
|
.filter((entry) => entry !== null && entry !== undefined && entry !== '' && typeof entry !== 'object')
|
|
767
771
|
.map((entry) => String(entry))
|
|
772
|
+
.map((entry) => (typeof labels[entry] === 'string' ? this.cnTranslate(labels[entry]) : entry))
|
|
768
773
|
},
|
|
769
774
|
|
|
770
775
|
/**
|
|
@@ -99,6 +99,7 @@ export default {
|
|
|
99
99
|
| `editable` | Boolean | `false` | Enable drag and resize interactions |
|
|
100
100
|
| `columns` | Number | `12` | Number of grid columns |
|
|
101
101
|
| `cellHeight` | Number | `80` | Cell height in pixels |
|
|
102
|
+
| `columnWeights` | Array | `null` | Optional weights for the twelve-column grid's column groups, as `[{ span, weight }]` (e.g. three groups of 4 weighted 352/435/352). Applies only on the full twelve-column grid and not while editing; items on a side-column track are left alone. `null` keeps twelve equal shares. |
|
|
102
103
|
| `margin` | Number | `12` | Gutter between grid items in pixels |
|
|
103
104
|
| `minWidth` | Number | `2` | Minimum widget width in grid units |
|
|
104
105
|
| `minHeight` | Number | `2` | Minimum widget height in grid units |
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<template>
|
|
15
15
|
<div ref="gridContainer"
|
|
16
16
|
class="cn-dashboard-grid"
|
|
17
|
-
:class="{ 'cn-dashboard-grid--side-column': sideColumnStyle !== null, 'cn-dashboard-grid--fill': filling }"
|
|
17
|
+
:class="{ 'cn-dashboard-grid--side-column': sideColumnStyle !== null, 'cn-dashboard-grid--weighted': columnBounds !== null, 'cn-dashboard-grid--fill': filling }"
|
|
18
18
|
:style="sideColumnStyle">
|
|
19
19
|
<!--
|
|
20
20
|
Keyboard instructions, referenced by every grid item through
|
|
@@ -48,9 +48,10 @@
|
|
|
48
48
|
:gs-min-h="minRows(item)"
|
|
49
49
|
:gs-size-to-content="sizeToContentAttr(item)"
|
|
50
50
|
:data-cn-track="item.track === 'main' || item.track === 'side' ? item.track : undefined"
|
|
51
|
+
:data-cn-weighted="weightStyle(item) ? '' : undefined"
|
|
51
52
|
:data-cn-widget-id="item.widgetId || undefined"
|
|
52
53
|
:gs-locked="item.clear === true && !editable ? 'true' : undefined"
|
|
53
|
-
:style="
|
|
54
|
+
:style="itemStyle(item)"
|
|
54
55
|
@keydown="onItemKeydown($event, item)">
|
|
55
56
|
<div class="grid-stack-item-content">
|
|
56
57
|
<slot name="widget" :item="item">
|
|
@@ -352,6 +353,22 @@ export default {
|
|
|
352
353
|
default: null,
|
|
353
354
|
},
|
|
354
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Weights for groups of the twelve columns: `[{ span, weight }]`, the
|
|
358
|
+
* spans adding up to 12. Each group takes its weight's share of the
|
|
359
|
+
* width, split evenly over its columns, so three groups of four can be
|
|
360
|
+
* drawn 332 / 415 / 332 (PqWerkplekKlant in a call). Items on a
|
|
361
|
+
* `sideColumn` track keep that column. Only on the full twelve-column
|
|
362
|
+
* grid and not while editing; GridStack keeps the twelve columns
|
|
363
|
+
* underneath.
|
|
364
|
+
*
|
|
365
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
366
|
+
*/
|
|
367
|
+
columnWeights: {
|
|
368
|
+
type: Array,
|
|
369
|
+
default: null,
|
|
370
|
+
},
|
|
371
|
+
|
|
355
372
|
/**
|
|
356
373
|
* Fill the height the host gives the grid instead of growing with
|
|
357
374
|
* the content: in view mode the layout rows divide the grid's own
|
|
@@ -436,6 +453,41 @@ export default {
|
|
|
436
453
|
*
|
|
437
454
|
* @return {object|null}
|
|
438
455
|
*/
|
|
456
|
+
/**
|
|
457
|
+
* The left edge of each of the twelve columns and the right edge of
|
|
458
|
+
* the last, as fractions of the grid's width, from `columnWeights`;
|
|
459
|
+
* null when the grid keeps its twelve shares.
|
|
460
|
+
*
|
|
461
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
462
|
+
* @return {number[]|null}
|
|
463
|
+
*/
|
|
464
|
+
columnBounds() {
|
|
465
|
+
const groups = this.columnWeights
|
|
466
|
+
if (this.editable || !Array.isArray(groups) || groups.length === 0) {
|
|
467
|
+
return null
|
|
468
|
+
}
|
|
469
|
+
const perColumn = []
|
|
470
|
+
for (const group of groups) {
|
|
471
|
+
const span = Number(group?.span)
|
|
472
|
+
const weight = Number(group?.weight)
|
|
473
|
+
if (!Number.isInteger(span) || span < 1 || !Number.isFinite(weight) || weight <= 0) {
|
|
474
|
+
return null
|
|
475
|
+
}
|
|
476
|
+
for (let i = 0; i < span; i++) {
|
|
477
|
+
perColumn.push(weight / span)
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
if (perColumn.length !== 12) {
|
|
481
|
+
return null
|
|
482
|
+
}
|
|
483
|
+
const total = perColumn.reduce((sum, w) => sum + w, 0)
|
|
484
|
+
const bounds = [0]
|
|
485
|
+
for (const w of perColumn) {
|
|
486
|
+
bounds.push(bounds[bounds.length - 1] + w / total)
|
|
487
|
+
}
|
|
488
|
+
return bounds
|
|
489
|
+
},
|
|
490
|
+
|
|
439
491
|
sideColumnStyle() {
|
|
440
492
|
const width = Number(this.sideColumn?.width)
|
|
441
493
|
if (this.editable || !Number.isFinite(width) || width <= 0) {
|
|
@@ -811,6 +863,43 @@ export default {
|
|
|
811
863
|
}
|
|
812
864
|
},
|
|
813
865
|
|
|
866
|
+
/**
|
|
867
|
+
* The left and width fractions of an item on weighted columns, or
|
|
868
|
+
* null when the grid keeps its twelve shares or the item is on a
|
|
869
|
+
* side-column track.
|
|
870
|
+
*
|
|
871
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
872
|
+
* @param {object} item The layout item.
|
|
873
|
+
* @return {object|null}
|
|
874
|
+
*/
|
|
875
|
+
weightStyle(item) {
|
|
876
|
+
const bounds = this.columnBounds
|
|
877
|
+
if (bounds === null || (this.sideColumnStyle !== null && (item.track === 'main' || item.track === 'side'))) {
|
|
878
|
+
return null
|
|
879
|
+
}
|
|
880
|
+
const x = Math.min(Math.max(Number.isFinite(item.gridX) ? item.gridX : 0, 0), 12)
|
|
881
|
+
const w = Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth
|
|
882
|
+
const end = Math.min(Math.max(x + w, x), 12)
|
|
883
|
+
return {
|
|
884
|
+
'--cn-weight-left': String(bounds[x]),
|
|
885
|
+
'--cn-weight-width': String(bounds[end] - bounds[x]),
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* The inline style of an item: its place on a filled grid, or its
|
|
891
|
+
* place on weighted columns.
|
|
892
|
+
*
|
|
893
|
+
* @param {object} item The layout item.
|
|
894
|
+
* @return {object|undefined}
|
|
895
|
+
*/
|
|
896
|
+
itemStyle(item) {
|
|
897
|
+
if (this.filling) {
|
|
898
|
+
return this.fillItemStyle(item)
|
|
899
|
+
}
|
|
900
|
+
return this.weightStyle(item) || undefined
|
|
901
|
+
},
|
|
902
|
+
|
|
814
903
|
resolveItemLabel(item, index) {
|
|
815
904
|
if (this.itemLabel) {
|
|
816
905
|
return String(this.itemLabel(item, index) ?? '')
|
|
@@ -1720,6 +1809,15 @@ export default {
|
|
|
1720
1809
|
width: calc((min(var(--gs-x) + var(--gs-w), var(--cn-side-from)) - min(var(--gs-x), var(--cn-side-from))) * var(--cn-main-col) + (max(var(--gs-x) + var(--gs-w) - var(--cn-side-from), 0) - max(var(--gs-x) - var(--cn-side-from), 0)) * var(--cn-side-col)) !important;
|
|
1721
1810
|
}
|
|
1722
1811
|
|
|
1812
|
+
/* `columnWeights`: an item's left edge and width follow the weighted columns
|
|
1813
|
+
it spans, as fractions of the grid. GridStack writes its own left and width
|
|
1814
|
+
inline, hence !important. */
|
|
1815
|
+
.cn-dashboard-grid--weighted > .grid-stack.gs-12:not(.grid-stack-rtl) > .grid-stack-item[data-cn-weighted] {
|
|
1816
|
+
/* stylelint-disable-next-line csstools/use-logical -- GridStack places a left-to-right item by `left`. */
|
|
1817
|
+
left: calc(var(--cn-weight-left) * 100%) !important;
|
|
1818
|
+
width: calc(var(--cn-weight-width) * 100%) !important;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1723
1821
|
/* Screen-reader-only text: the keyboard key map and the live region. Kept in
|
|
1724
1822
|
the layout (not `display: none`) so assistive tech still reads it. */
|
|
1725
1823
|
.cn-dashboard-grid__sr-only {
|
|
@@ -574,6 +574,7 @@
|
|
|
574
574
|
:margin="gridMargin"
|
|
575
575
|
:float="gridFloat"
|
|
576
576
|
:sideColumn="section.sideColumn"
|
|
577
|
+
:columnWeights="section.columnWeights"
|
|
577
578
|
@layoutChange="section.view ? onViewLayoutChange($event) : onLayoutChange($event)">
|
|
578
579
|
<template #widget="{ item }">
|
|
579
580
|
<!-- In-app edit overlay (ADR-041): a single launchpad-style
|
|
@@ -1499,7 +1500,9 @@ export default {
|
|
|
1499
1500
|
* on). Editing the page shows the page's own layout.
|
|
1500
1501
|
*
|
|
1501
1502
|
* @spec openspec/changes/dashboard-layout-when/specs/dashboard-layout-when/spec.md#requirement-a-dashboard-can-arrange-its-cards-by-the-pages-workspace
|
|
1502
|
-
*
|
|
1503
|
+
* An entry can carry `gridColumnWeights` for its own layout.
|
|
1504
|
+
*
|
|
1505
|
+
* @type {Array<{when: object, layout: Array<object>, gridColumnWeights?: Array<object>}>}
|
|
1503
1506
|
*/
|
|
1504
1507
|
layoutWhen: {
|
|
1505
1508
|
type: Array,
|
|
@@ -1658,6 +1661,20 @@ export default {
|
|
|
1658
1661
|
default: null,
|
|
1659
1662
|
},
|
|
1660
1663
|
|
|
1664
|
+
/**
|
|
1665
|
+
* Weights for groups of the grid's twelve columns (manifest
|
|
1666
|
+
* `config.gridColumnWeights`): `[{ span, weight }]`, see
|
|
1667
|
+
* CnDashboardGrid's `columnWeights`. A `layoutWhen` entry can carry
|
|
1668
|
+
* its own `gridColumnWeights` for the layout it draws
|
|
1669
|
+
* (PqWerkplekKlant in a call: 332 / 415 / 332).
|
|
1670
|
+
*
|
|
1671
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
1672
|
+
*/
|
|
1673
|
+
gridColumnWeights: {
|
|
1674
|
+
type: Array,
|
|
1675
|
+
default: null,
|
|
1676
|
+
},
|
|
1677
|
+
|
|
1661
1678
|
/**
|
|
1662
1679
|
* Widget definitions array. Each widget defines metadata for rendering.
|
|
1663
1680
|
*
|
|
@@ -3124,7 +3141,7 @@ export default {
|
|
|
3124
3141
|
if (!this.gridSectionsShown) {
|
|
3125
3142
|
return []
|
|
3126
3143
|
}
|
|
3127
|
-
const page = { key: 'page', view: false, layout: this.displayLayout, editable: this.gridEditable, sideColumn: this.gridSideColumn, attrs: {} }
|
|
3144
|
+
const page = { key: 'page', view: false, layout: this.displayLayout, editable: this.gridEditable, sideColumn: this.gridSideColumn, columnWeights: this.pageColumnWeights(), attrs: {} }
|
|
3128
3145
|
if (!this.hasViews) {
|
|
3129
3146
|
return [page]
|
|
3130
3147
|
}
|
|
@@ -3398,15 +3415,42 @@ export default {
|
|
|
3398
3415
|
* @spec openspec/changes/dashboard-layout-when/specs/dashboard-layout-when/spec.md#requirement-a-dashboard-can-arrange-its-cards-by-the-pages-workspace
|
|
3399
3416
|
*/
|
|
3400
3417
|
layoutFromWorkspace() {
|
|
3418
|
+
const entry = this.layoutEntryFromWorkspace()
|
|
3419
|
+
return entry ? entry.layout : null
|
|
3420
|
+
},
|
|
3421
|
+
|
|
3422
|
+
/**
|
|
3423
|
+
* The first `layoutWhen` entry whose condition holds on the workspace,
|
|
3424
|
+
* or null when none applies.
|
|
3425
|
+
*
|
|
3426
|
+
* @return {object|null}
|
|
3427
|
+
* @spec openspec/changes/dashboard-layout-when/specs/dashboard-layout-when/spec.md#requirement-a-dashboard-can-arrange-its-cards-by-the-pages-workspace
|
|
3428
|
+
*/
|
|
3429
|
+
layoutEntryFromWorkspace() {
|
|
3401
3430
|
const workspace = this.workspaceContext || {}
|
|
3402
3431
|
for (const entry of Array.isArray(this.layoutWhen) ? this.layoutWhen : []) {
|
|
3403
3432
|
if (entry && Array.isArray(entry.layout) && isWorkspaceCondition(entry.when) && evaluateWorkspaceCondition(entry.when, workspace)) {
|
|
3404
|
-
return entry
|
|
3433
|
+
return entry
|
|
3405
3434
|
}
|
|
3406
3435
|
}
|
|
3407
3436
|
return null
|
|
3408
3437
|
},
|
|
3409
3438
|
|
|
3439
|
+
/**
|
|
3440
|
+
* The column weights of the page's grid: the applying `layoutWhen`
|
|
3441
|
+
* entry's own, else the page's.
|
|
3442
|
+
*
|
|
3443
|
+
* @return {Array<object>|null}
|
|
3444
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
3445
|
+
*/
|
|
3446
|
+
pageColumnWeights() {
|
|
3447
|
+
const entry = this.layoutEntryFromWorkspace()
|
|
3448
|
+
if (entry && Array.isArray(entry.gridColumnWeights)) {
|
|
3449
|
+
return entry.gridColumnWeights
|
|
3450
|
+
}
|
|
3451
|
+
return Array.isArray(this.gridColumnWeights) ? this.gridColumnWeights : null
|
|
3452
|
+
},
|
|
3453
|
+
|
|
3410
3454
|
/**
|
|
3411
3455
|
* The first `titleWhen` title whose condition holds on the workspace,
|
|
3412
3456
|
* its `{workspace.<key>}` tokens filled; '' when none applies.
|
|
@@ -1611,11 +1611,13 @@ export default {
|
|
|
1611
1611
|
},
|
|
1612
1612
|
|
|
1613
1613
|
/**
|
|
1614
|
-
* An integration widget's `labels` (prop name to text
|
|
1615
|
-
* the host's language: a leaf cannot translate
|
|
1614
|
+
* An integration widget's `labels` (prop name to text, or to a map of
|
|
1615
|
+
* texts), translated in the host's language: a leaf cannot translate
|
|
1616
|
+
* the host app's words.
|
|
1616
1617
|
*
|
|
1617
|
-
* @return {object} Prop name to translated text.
|
|
1618
|
+
* @return {object} Prop name to translated text or map.
|
|
1618
1619
|
* @spec openspec/changes/leaf-labels-in-the-host-language/specs/leaf-labels-in-the-host-language/spec.md#requirement-an-integration-widget-gives-its-leaf-labels-in-the-hosts-language
|
|
1620
|
+
* @spec openspec/changes/parties-role-line-from-the-role-record/specs/record-widgets/spec.md#requirement-a-board-contact-row-can-lead-with-the-word-for-its-kind
|
|
1619
1621
|
*/
|
|
1620
1622
|
leafLabels() {
|
|
1621
1623
|
const labels = this.widget?.labels
|
|
@@ -1626,6 +1628,10 @@ export default {
|
|
|
1626
1628
|
for (const [prop, text] of Object.entries(labels)) {
|
|
1627
1629
|
if (typeof text === 'string') {
|
|
1628
1630
|
out[prop] = this.translateLabel(text)
|
|
1631
|
+
} else if (text && typeof text === 'object' && !Array.isArray(text)) {
|
|
1632
|
+
out[prop] = Object.fromEntries(Object.entries(text)
|
|
1633
|
+
.filter(([, word]) => typeof word === 'string')
|
|
1634
|
+
.map(([key, word]) => [key, this.translateLabel(word)]))
|
|
1629
1635
|
}
|
|
1630
1636
|
}
|
|
1631
1637
|
return out
|
|
@@ -262,8 +262,10 @@ import {
|
|
|
262
262
|
kindCode,
|
|
263
263
|
newPartyRecord,
|
|
264
264
|
partyKindAccepted,
|
|
265
|
+
partyNoteOf,
|
|
265
266
|
representedByMap,
|
|
266
267
|
roleLabel,
|
|
268
|
+
roleRowsByParticipant,
|
|
267
269
|
rolesInOrder,
|
|
268
270
|
savedUuid,
|
|
269
271
|
showsNoSecrecy,
|
|
@@ -374,7 +376,9 @@ export default {
|
|
|
374
376
|
* The configuration: `rolesSource` (the listing URL, default
|
|
375
377
|
* OpenRegister's `/parties` of this record), `partySource` (one
|
|
376
378
|
* party, `{uuid}` filled in), `rolesObjects` (`{ register, schema,
|
|
377
|
-
* field }`, the role rows that say who represents whom), `
|
|
379
|
+
* field }`, the role rows that say who represents whom), `note`
|
|
380
|
+
* (`{ from: "roles", field }`: a board row prints that field of the
|
|
381
|
+
* party's role row instead of the link's note), `roleLabels`,
|
|
378
382
|
* `kindsSource` (`{ url, enforce?, sourceText? }`), `extraLines`
|
|
379
383
|
* (`[{ endpoint, path?, valueLabels?, lines }]`, one request per
|
|
380
384
|
* party, `{party}` filled in), `correspondence` (`{ endpoint, path?,
|
|
@@ -417,6 +421,7 @@ export default {
|
|
|
417
421
|
failed: false,
|
|
418
422
|
listing: null,
|
|
419
423
|
partyRecords: {},
|
|
424
|
+
roleRows: {},
|
|
420
425
|
represented: {},
|
|
421
426
|
kinds: null,
|
|
422
427
|
extra: {},
|
|
@@ -826,6 +831,7 @@ export default {
|
|
|
826
831
|
this.failed = false
|
|
827
832
|
this.partyRecords = {}
|
|
828
833
|
this.represented = {}
|
|
834
|
+
this.roleRows = {}
|
|
829
835
|
this.extra = {}
|
|
830
836
|
this.documents = []
|
|
831
837
|
const listing = await this.read(this.urlOf(this.content?.rolesSource || '/apps/openregister/api/objects/@register/@schema/@objectId/parties'))
|
|
@@ -864,6 +870,7 @@ export default {
|
|
|
864
870
|
const data = await this.read(`/apps/openregister/api/objects/${encodeURIComponent(source.register)}/${encodeURIComponent(source.schema)}`, { [source.field || 'object']: String(this.objectId), _limit: 200 })
|
|
865
871
|
const rows = Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])
|
|
866
872
|
this.represented = representedByMap(rows)
|
|
873
|
+
this.roleRows = roleRowsByParticipant(rows)
|
|
867
874
|
},
|
|
868
875
|
|
|
869
876
|
/** @return {Promise<void>} The kinds this record accepts. */
|
|
@@ -1040,8 +1047,9 @@ export default {
|
|
|
1040
1047
|
*/
|
|
1041
1048
|
/**
|
|
1042
1049
|
* The board row's meta line (design-system #811): the primary mark,
|
|
1043
|
-
* the role, the link's
|
|
1044
|
-
*
|
|
1050
|
+
* the role, the note (the link's, or the role row's field named by
|
|
1051
|
+
* `content.note`), whom the party represents when no note says it,
|
|
1052
|
+
* its extra lines, e-mail and documents.
|
|
1045
1053
|
*
|
|
1046
1054
|
* @param {object} party The party.
|
|
1047
1055
|
* @param {object} group Its role group.
|
|
@@ -1050,15 +1058,16 @@ export default {
|
|
|
1050
1058
|
*/
|
|
1051
1059
|
boardMetaOf(party, group) {
|
|
1052
1060
|
const extras = []
|
|
1061
|
+
const note = partyNoteOf(party, this.roleRows, this.content?.note)
|
|
1053
1062
|
const represented = this.representedBy(party)
|
|
1054
|
-
if (represented && !
|
|
1063
|
+
if (represented && !note) {
|
|
1055
1064
|
extras.push(`${this.label('representedBy')}: ${represented}`)
|
|
1056
1065
|
}
|
|
1057
1066
|
extras.push(...this.extraLinesOf(party), party.email, this.correspondenceOf(party))
|
|
1058
1067
|
return boardMetaLine({
|
|
1059
1068
|
primary: this.primary && party.partyUuid === this.primary ? this.label('primary') : '',
|
|
1060
1069
|
role: group.label,
|
|
1061
|
-
note
|
|
1070
|
+
note,
|
|
1062
1071
|
extras,
|
|
1063
1072
|
})
|
|
1064
1073
|
},
|
package/src/css/dialog.css
CHANGED
|
@@ -571,16 +571,18 @@ body:has(.cn-look-board):not(:has(.cn-look-nextcloud)) .modal-mask {
|
|
|
571
571
|
}
|
|
572
572
|
|
|
573
573
|
/* A field's help line sits right under the control in 13px muted ink, flush
|
|
574
|
-
with the label,
|
|
575
|
-
eenmalige code gaat naar dit adres.",
|
|
576
|
-
`!important` against a
|
|
577
|
-
|
|
574
|
+
with the label, on the font's own leading, as the boards draw it
|
|
575
|
+
(PtUitnodigen "De uitnodiging met een eenmalige code gaat naar dit adres.",
|
|
576
|
+
PtAccountUitgeven, DqZaakLocatie). The ink carries `!important` against a
|
|
577
|
+
theme that colours every span and p (thematiq).
|
|
578
|
+
@spec openspec/changes/board-dialog-field-help/specs/board-dialog-field-help/spec.md#requirement-a-board-dialog-fields-help-line-is-13px-muted-under-the-control
|
|
579
|
+
@spec openspec/changes/board-dialog-help-normal-leading/specs/board-dialog-help-normal-leading/spec.md#requirement-a-board-dialog-fields-help-line-stands-on-the-fonts-own-leading */
|
|
578
580
|
.cn-dialog-board .dialog__content .input-field__helper-text-message,
|
|
579
581
|
.cn-dialog-board .dialog__content .textarea__helper-text-message {
|
|
580
582
|
padding: 4px 0 0;
|
|
581
583
|
color: var(--color-text-maxcontrast) !important;
|
|
582
584
|
font-size: 13px;
|
|
583
|
-
line-height:
|
|
585
|
+
line-height: normal;
|
|
584
586
|
}
|
|
585
587
|
|
|
586
588
|
.cn-dialog-board .dialog__content .input-field:has(.input-field__label) .input-field__input:not(:focus)::placeholder,
|
|
@@ -1201,8 +1201,10 @@
|
|
|
1201
1201
|
}
|
|
1202
1202
|
|
|
1203
1203
|
/* `rowTitle: "plain"` (PqTickets, OcPublicaties): the title is bold text in
|
|
1204
|
-
the main text colour without an underline, the secondary line 13px muted
|
|
1205
|
-
2px under it. The row stays clickable
|
|
1204
|
+
the main text colour without an underline, the secondary line 13px muted
|
|
1205
|
+
at a normal line height, 2px under it (PqTaken). The row stays clickable
|
|
1206
|
+
through its stretched row link.
|
|
1207
|
+
@spec openspec/changes/board-plain-title-secondary-normal-leading/specs/board-plain-title-secondary-normal-leading/spec.md */
|
|
1206
1208
|
.cn-look-board .cn-table-container--board.cn-table-container--title-plain .cn-data-table td.cn-table-col--title {
|
|
1207
1209
|
font-weight: 700;
|
|
1208
1210
|
text-decoration: none;
|
|
@@ -1211,6 +1213,7 @@
|
|
|
1211
1213
|
.cn-look-board .cn-table-container--board.cn-table-container--title-plain .cn-data-table td.cn-table-col--title .cn-table-cell__secondary {
|
|
1212
1214
|
margin-top: 2px;
|
|
1213
1215
|
font-size: 13px;
|
|
1216
|
+
line-height: normal;
|
|
1214
1217
|
}
|
|
1215
1218
|
|
|
1216
1219
|
/* `rowTitle: "text"` (DqZaakContact's contact moments): the title column is
|
|
@@ -1368,6 +1371,22 @@
|
|
|
1368
1371
|
line-height: normal;
|
|
1369
1372
|
}
|
|
1370
1373
|
|
|
1374
|
+
/* A list in a table cell draws the boards' small tags, 18px tall and 4px
|
|
1375
|
+
apart (PqServices "Geboekt op", PqBiExport "Dataset", DqContacten
|
|
1376
|
+
"Geheimhouding"), not the 21px status tag.
|
|
1377
|
+
@spec openspec/changes/badge-list-labels-and-tags/specs/badge-cell-list/spec.md#requirement-a-badge-list-draws-the-boards-small-tags */
|
|
1378
|
+
.cn-look-board .cn-cell-renderer__badges:not(.cn-look-nextcloud *) {
|
|
1379
|
+
gap: 4px;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
.cn-look-board .cn-table-container--board .cn-data-table .cn-cell-renderer__badges .cn-status-badge {
|
|
1383
|
+
padding: 2px 8px;
|
|
1384
|
+
border-radius: 10px;
|
|
1385
|
+
font-size: 12px;
|
|
1386
|
+
font-weight: 600;
|
|
1387
|
+
line-height: normal;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1371
1390
|
/* The row menu column holds one 34px button between 16px of padding, so 66px
|
|
1372
1391
|
border to border (see the selection column for why the box model is forced). */
|
|
1373
1392
|
.cn-look-board .cn-table-container--board .cn-data-table .cn-table-col--actions {
|
package/src/css/look-board.css
CHANGED
|
@@ -4887,3 +4887,15 @@ body:has(.cn-look-board):not(:has(.cn-look-nextcloud)) .vs__dropdown-menu:has(.c
|
|
|
4887
4887
|
.cn-look-board .cn-button--tonal.cn-button--tonal .action-item__menutoggle.button-vue:not(.cn-look-nextcloud *):hover:not(:disabled) {
|
|
4888
4888
|
background-color: var(--color-primary-element-light-hover);
|
|
4889
4889
|
}
|
|
4890
|
+
|
|
4891
|
+
/* Action tiles: 10px from the icon to a 14px label at normal leading, so a
|
|
4892
|
+
tile is 97px high as the boards draw it (PqWerkplekKlant "Snelle acties").
|
|
4893
|
+
@spec openspec/changes/board-action-tiles-as-drawn/specs/board-action-tiles-as-drawn/spec.md */
|
|
4894
|
+
.cn-look-board .cn-action-tiles .cn-action-tiles__tile:not(.cn-look-nextcloud *) {
|
|
4895
|
+
gap: 10px;
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
.cn-look-board .cn-action-tiles .cn-action-tiles__label:not(.cn-look-nextcloud *) {
|
|
4899
|
+
font-size: 14px;
|
|
4900
|
+
line-height: normal;
|
|
4901
|
+
}
|
|
@@ -322,6 +322,13 @@ export default {
|
|
|
322
322
|
handlerRoleLabel: { type: String, default: () => t('nextcloud-vue', 'Handler') },
|
|
323
323
|
/** Role badge shown on an advisor. */
|
|
324
324
|
advisorRoleLabel: { type: String, default: () => t('nextcloud-vue', 'Advisor') },
|
|
325
|
+
/**
|
|
326
|
+
* The word that leads a board row's details per kind of person: keyed
|
|
327
|
+
* by the link's `partyKind` (`person`, `organisation`, `colleague`)
|
|
328
|
+
* or else its `kind` (`user`, `contact`). A kind without a word leads
|
|
329
|
+
* with nothing.
|
|
330
|
+
*/
|
|
331
|
+
kindLabels: { type: Object, default: () => ({}) },
|
|
325
332
|
},
|
|
326
333
|
|
|
327
334
|
emits: ['open-reverse-lookup'],
|
|
@@ -639,14 +646,18 @@ export default {
|
|
|
639
646
|
* @return {string} The window.
|
|
640
647
|
*/
|
|
641
648
|
/**
|
|
642
|
-
* A person's details on one line for the board look:
|
|
643
|
-
* organisation and note,
|
|
649
|
+
* A person's details on one line for the board look: the word for
|
|
650
|
+
* their kind (`kindLabels`), e-mail, phone, organisation and note,
|
|
651
|
+
* separated by middots.
|
|
644
652
|
*
|
|
645
653
|
* @param {object} contact The contact link.
|
|
646
654
|
* @return {string}
|
|
655
|
+
* @spec openspec/changes/parties-role-line-from-the-role-record/specs/record-widgets/spec.md#requirement-a-board-contact-row-can-lead-with-the-word-for-its-kind
|
|
647
656
|
*/
|
|
648
657
|
boardMetaOf(contact) {
|
|
649
|
-
|
|
658
|
+
const words = this.kindLabels || {}
|
|
659
|
+
const kind = words[contact?.partyKind] || words[contact?.kind] || ''
|
|
660
|
+
return [kind, contact?.email, contact?.phone, contact?.org, contact?.note].filter((part) => typeof part === 'string' && part !== '').join(' · ')
|
|
650
661
|
},
|
|
651
662
|
|
|
652
663
|
/**
|
|
@@ -25,9 +25,9 @@ const ROWS = [{
|
|
|
25
25
|
validFrom: '2026-10-03',
|
|
26
26
|
}]
|
|
27
27
|
|
|
28
|
-
function mountTab(look) {
|
|
28
|
+
function mountTab(look, props = {}) {
|
|
29
29
|
return mount(CnContactsTab, {
|
|
30
|
-
propsData: { objectId: 'o1', register: 'r1', schema: 's1' },
|
|
30
|
+
propsData: { objectId: 'o1', register: 'r1', schema: 's1', ...props },
|
|
31
31
|
global: { provide: { cnLook: look } },
|
|
32
32
|
})
|
|
33
33
|
}
|
|
@@ -55,6 +55,21 @@ describe('CnContactsTab board rows', () => {
|
|
|
55
55
|
w.unmount()
|
|
56
56
|
})
|
|
57
57
|
|
|
58
|
+
it('leads the details with the word for the party\'s kind the app gives (DqZaakBetrokkenen "Contact", "Organisatie", "Collega")', async () => {
|
|
59
|
+
const rows = [
|
|
60
|
+
{ id: 1, contactUid: 'c1', displayName: 'Sanne de Vries', role: 'r', kind: 'party', partyKind: 'person', note: 'Lindelaan 14 · ingelogd met DigiD' },
|
|
61
|
+
{ id: 2, contactUid: 'c2', displayName: 'Van Wijk B.V.', role: 'r', kind: 'party', partyKind: 'organisation', note: 'KvK 00001005' },
|
|
62
|
+
{ id: 3, contactUid: 'c3', displayName: 'Lars de Koning', role: 'r', kind: 'user', note: 'Mobiliteit en verkeer' },
|
|
63
|
+
{ id: 4, contactUid: 'c4', displayName: 'Iemand', role: 'r', kind: 'party', partyKind: 'unknown', note: 'Zonder soort' },
|
|
64
|
+
]
|
|
65
|
+
global.fetch = jest.fn().mockResolvedValue({ ok: true, json: () => Promise.resolve({ results: rows, total: 4 }) })
|
|
66
|
+
const w = mountTab('board', { kindLabels: { person: 'Contact', organisation: 'Organisatie', user: 'Collega' } })
|
|
67
|
+
await flushPromises()
|
|
68
|
+
const metas = w.findAll('[data-testid="cn-contacts-tab-meta"]').map((meta) => meta.text())
|
|
69
|
+
expect(metas).toEqual(['Contact · Lindelaan 14 · ingelogd met DigiD', 'Organisatie · KvK 00001005', 'Collega · Mobiliteit en verkeer', 'Zonder soort'])
|
|
70
|
+
w.unmount()
|
|
71
|
+
})
|
|
72
|
+
|
|
58
73
|
it('keeps the Nextcloud row in the Nextcloud look', async () => {
|
|
59
74
|
const w = mountTab('nextcloud')
|
|
60
75
|
await flushPromises()
|
|
@@ -283,12 +283,51 @@ export function savedUuid(saved) {
|
|
|
283
283
|
return String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
/**
|
|
287
|
+
* The role rows of a record keyed by their participant.
|
|
288
|
+
*
|
|
289
|
+
* @param {Array<object>} rows The role rows.
|
|
290
|
+
* @return {object} participant uuid → row.
|
|
291
|
+
* @spec openspec/changes/parties-role-line-from-the-role-record/specs/record-widgets/spec.md#requirement-a-board-party-row-can-read-its-note-from-the-role-record
|
|
292
|
+
*/
|
|
293
|
+
export function roleRowsByParticipant(rows) {
|
|
294
|
+
const map = {}
|
|
295
|
+
for (const row of Array.isArray(rows) ? rows : []) {
|
|
296
|
+
const participant = String(row?.participant || '').trim()
|
|
297
|
+
if (participant !== '') {
|
|
298
|
+
map[participant] = row
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return map
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* The note a board row prints: the link's note, or with `spec`
|
|
306
|
+
* (`{ from: 'roles', field }`) that field of the party's role row, and
|
|
307
|
+
* nothing when the party has no role row.
|
|
308
|
+
*
|
|
309
|
+
* @param {object} party The listing row (`partyUuid` or `contactUid`, `note`).
|
|
310
|
+
* @param {object} rolesByParticipant The role rows by participant.
|
|
311
|
+
* @param {{from?: string, field?: string}|undefined} spec Where the note comes from.
|
|
312
|
+
* @return {string} The note, or ''.
|
|
313
|
+
* @spec openspec/changes/parties-role-line-from-the-role-record/specs/record-widgets/spec.md#requirement-a-board-party-row-can-read-its-note-from-the-role-record
|
|
314
|
+
*/
|
|
315
|
+
export function partyNoteOf(party, rolesByParticipant, spec) {
|
|
316
|
+
if (spec?.from === 'roles' && typeof spec.field === 'string' && spec.field !== '') {
|
|
317
|
+
const row = (rolesByParticipant || {})[party?.partyUuid || party?.contactUid || '']
|
|
318
|
+
const value = row ? row[spec.field] : ''
|
|
319
|
+
return typeof value === 'string' ? value.trim() : ''
|
|
320
|
+
}
|
|
321
|
+
return typeof party?.note === 'string' ? party.note : ''
|
|
322
|
+
}
|
|
323
|
+
|
|
286
324
|
/**
|
|
287
325
|
* The board row's meta line (DqZaakBetrokkenen "Rollen", design-system #811):
|
|
288
|
-
* the primary mark, the role, the
|
|
326
|
+
* the primary mark, the role, the note and the extra lines, by middots.
|
|
289
327
|
* A role that follows the primary mark reads in lower case ("Primaire partij ·
|
|
290
|
-
* verzoeker"), unless it is an abbreviation.
|
|
291
|
-
*
|
|
328
|
+
* verzoeker"), unless it is an abbreviation. A note that starts in lower case
|
|
329
|
+
* continues the role ("Gemachtigde namens Van Wijk B.V."). No kind word: the
|
|
330
|
+
* row's role and note already say what the party is.
|
|
292
331
|
*
|
|
293
332
|
* @param {{primary: string, role: string, note: string, extras: Array<string>}} parts The parts.
|
|
294
333
|
* @return {string} The line.
|
|
@@ -300,7 +339,13 @@ export function boardMetaLine({ primary = '', role = '', note = '', extras = []
|
|
|
300
339
|
if (primary && shownRole !== '' && !abbreviation) {
|
|
301
340
|
shownRole = shownRole[0].toLowerCase() + shownRole.slice(1)
|
|
302
341
|
}
|
|
303
|
-
|
|
342
|
+
let shownNote = typeof note === 'string' ? note.trim() : ''
|
|
343
|
+
const continues = shownRole !== '' && shownNote !== '' && shownNote[0] !== shownNote[0].toUpperCase()
|
|
344
|
+
if (continues) {
|
|
345
|
+
shownRole = `${shownRole} ${shownNote}`
|
|
346
|
+
shownNote = ''
|
|
347
|
+
}
|
|
348
|
+
return [primary, shownRole, shownNote, ...(Array.isArray(extras) ? extras : [])]
|
|
304
349
|
.filter((part) => typeof part === 'string' && part.trim() !== '')
|
|
305
350
|
.join(' · ')
|
|
306
351
|
}
|