@conduction/nextcloud-vue 2.165.0 → 2.166.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/CnActionButtons/CnActionButtons.vue.js +1 -1
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js +7 -0
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +10 -0
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js.map +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +50 -7
- 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/CnDataTable/CnDataTable.vue2.js +13 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +1 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +39 -4
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +2 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue.js +1 -1
- package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue2.js.map +1 -1
- package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue3.js.map +1 -1
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js +9 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js.map +1 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js +232 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js.map +1 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js +61 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js.map +1 -0
- package/dist/esm/components/CnFieldGroupsWidget/index.js +28 -0
- package/dist/esm/components/CnFieldGroupsWidget/index.js.map +1 -0
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +80 -6
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +361 -289
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +9 -0
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +2 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js +21 -0
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js +12 -2
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +17 -0
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +6 -3
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js +33 -2
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js.map +1 -1
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js +2 -2
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +83 -8
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js +9 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js +187 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js +106 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js +9 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js +421 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js +131 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/index.js +29 -0
- package/dist/esm/components/CnObjectLinksWidget/index.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/objectLinks.js +22 -0
- package/dist/esm/components/CnObjectLinksWidget/objectLinks.js.map +1 -0
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +48 -13
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +44 -20
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPagination/CnPagination.vue2.js +26 -0
- package/dist/esm/components/CnPagination/CnPagination.vue2.js.map +1 -1
- package/dist/esm/components/CnPagination/CnPagination.vue3.js +40 -37
- package/dist/esm/components/CnPagination/CnPagination.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
- package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +4 -0
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +18 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +18 -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 +635 -329
- package/dist/esm/utils/actionsDispatcher.js +9 -5
- package/dist/esm/utils/actionsDispatcher.js.map +1 -1
- package/dist/esm/utils/libraryWidgetKeys.js +2 -0
- package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
- package/dist/esm/utils/objectParties.js +68 -1
- package/dist/esm/utils/objectParties.js.map +1 -1
- package/dist/esm/utils/overlayInset.js +60 -0
- package/dist/esm/utils/overlayInset.js.map +1 -0
- package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/esm/utils/widgetDispatch.js +4 -1
- package/dist/esm/utils/widgetDispatch.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +8444 -6584
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +635 -329
- package/l10n/en.json +18 -1
- package/l10n/nl.json +18 -1
- package/package.json +1 -1
- package/src/components/CnActionButtons/CnActionButtons.vue +7 -0
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +11 -1
- package/src/components/CnChipListManager/CnChipListManager.vue +4 -1
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +50 -7
- package/src/components/CnDataTable/CnDataTable.md +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +14 -0
- package/src/components/CnDetailPage/CnDetailPage.md +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +40 -4
- package/src/components/CnExpandableRow/CnExpandableRow.vue +7 -4
- package/src/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue +287 -0
- package/src/components/CnFieldGroupsWidget/index.js +27 -0
- package/src/components/CnFieldListWidget/CnFieldListWidget.vue +162 -7
- package/src/components/CnFlowDetail/CnFlowDetail.vue +10 -0
- package/src/components/CnFlowDetail/CnFlowRunSummary.vue +26 -1
- package/src/components/CnFlowsPage/CnFlowBoard.vue +90 -4
- package/src/components/CnGraphCanvas/CnGraphCanvas.vue +35 -4
- package/src/components/CnIndexPage/CnIndexPage.md +1 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +83 -7
- package/src/components/CnObjectLinksWidget/CnObjectLinkDialog.vue +267 -0
- package/src/components/CnObjectLinksWidget/CnObjectLinksWidget.vue +532 -0
- package/src/components/CnObjectLinksWidget/index.js +28 -0
- package/src/components/CnObjectLinksWidget/objectLinks.js +19 -0
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +65 -15
- package/src/components/CnPagination/CnPagination.md +1 -0
- package/src/components/CnPagination/CnPagination.vue +27 -1
- package/src/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
- package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +4 -0
- package/src/components/index.js +2 -0
- package/src/css/dialog.css +25 -3
- package/src/css/index-page.css +22 -8
- package/src/css/look-board-detail.css +41 -0
- package/src/css/look-board-index.css +52 -1
- package/src/css/look-board.css +17 -0
- package/src/index.js +2 -0
- package/src/schemas/app-manifest-v2.schema.json +3 -3
- package/src/utils/actionsDispatcher.js +9 -5
- package/src/utils/libraryWidgetKeys.js +2 -0
- package/src/utils/objectParties.js +67 -0
- package/src/utils/overlayInset.js +57 -0
- package/src/utils/validateManifestV2.compiled.js +2 -2
- package/src/utils/widgetDispatch.js +4 -1
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { NcActionButton, NcActions, NcButton } from '@nextcloud/vue';
|
|
2
|
+
import Plus from 'vue-material-design-icons/Plus.vue';
|
|
3
|
+
import __sfc_main from './CnObjectLinkDialog.vue.js';
|
|
4
|
+
import { prefixUrl } from '../../utils/headers.js';
|
|
5
|
+
import { readPath } from '../../utils/readPath.js';
|
|
6
|
+
import { serverErrorMessage } from '../../utils/serverErrorMessage.js';
|
|
7
|
+
import { objectsUrl } from './objectLinks.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* CnObjectLinksWidget: the `object-links` widget: a record's links to other
|
|
11
|
+
* records, each kept as an object of a link schema that names this record
|
|
12
|
+
* (`from`) and the other one (`to`). Board PqKlant "Relaties": "Secretaris van
|
|
13
|
+
* Buurtvereniging Oost", "Partner van J. de Vries".
|
|
14
|
+
*
|
|
15
|
+
* A row reads the link's type as words (`types[].label`) and the other
|
|
16
|
+
* record's name, read from the schema its `toType` points at (`targets`), as a
|
|
17
|
+
* link to that record's page. Add opens a dialog (search the targets, pick a
|
|
18
|
+
* type, fill the extra `fields`) and writes the link; with `pair` it writes the
|
|
19
|
+
* inverse link from the other record too, and Remove deletes both. Every write
|
|
20
|
+
* goes to OpenRegister, which decides who may write; a refusal shows in the
|
|
21
|
+
* server's words.
|
|
22
|
+
*
|
|
23
|
+
* @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed
|
|
24
|
+
*/
|
|
25
|
+
var script = {
|
|
26
|
+
name: 'CnObjectLinksWidget',
|
|
27
|
+
|
|
28
|
+
components: { CnObjectLinkDialog: __sfc_main, NcActionButton, NcActions, NcButton, Plus },
|
|
29
|
+
|
|
30
|
+
inject: {
|
|
31
|
+
cnTranslate: { default: () => (key) => key },
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
props: {
|
|
35
|
+
/**
|
|
36
|
+
* The widget configuration.
|
|
37
|
+
*
|
|
38
|
+
* - `register`, `schema` (required): where the link objects live.
|
|
39
|
+
* - `from`, `to` (required): the link fields naming this record and the other one.
|
|
40
|
+
* - `fromType`, `toType`, `selfType`: the fields that name each side's kind, and this record's kind.
|
|
41
|
+
* - `typeField`, `inverseField`, `groupField`: the fields the link's type, its inverse type and
|
|
42
|
+
* its group are written to.
|
|
43
|
+
* - `types`: `[{ value, label, inverse?, group?, groupLabel? }]`: the choices, and how a row words its type;
|
|
44
|
+
* `group` is written to `groupField`, `groupLabel` (else `group`) words it in the dialog.
|
|
45
|
+
* - `targets`: `[{ type, register, schema, titleField?, label?, route? }]`: the kinds of record a
|
|
46
|
+
* link may point at; a row reads the name from the target its `toType` names (else the first)
|
|
47
|
+
* and links to its `route` with `params.id`.
|
|
48
|
+
* - `pair`: write and remove the inverse link from the other record as well.
|
|
49
|
+
* - `fields`: `[{ key, label, type?: 'text'|'textarea'|'date' }]`: extra values the dialog asks.
|
|
50
|
+
* - `defaults`: values written on every new link.
|
|
51
|
+
* - `filter`: extra list filters; `limit` (default 100).
|
|
52
|
+
* - `add`: `{ label?, ariaLabel?, placement?: 'title'|'footer', dialogTitle? }`; `title` reports
|
|
53
|
+
* the add for the card's title row on the `header` event.
|
|
54
|
+
* - `remove`: `{ label? }`: a remove in each row's menu. Omitted: no remove.
|
|
55
|
+
* - `readOnly`, `emptyText`, `duplicateText`.
|
|
56
|
+
*
|
|
57
|
+
* @type {object}
|
|
58
|
+
*/
|
|
59
|
+
content: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => ({}),
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
/** The current detail-page object. */
|
|
65
|
+
objectData: {
|
|
66
|
+
type: Object,
|
|
67
|
+
default: null,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
/** The current object id. */
|
|
71
|
+
objectId: {
|
|
72
|
+
type: [String, Number],
|
|
73
|
+
default: '',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
emits: ['header'],
|
|
78
|
+
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
links: [],
|
|
82
|
+
/** Target names, by `<type>:<id>`. */
|
|
83
|
+
names: {},
|
|
84
|
+
loading: false,
|
|
85
|
+
busy: false,
|
|
86
|
+
notice: '',
|
|
87
|
+
dialogOpen: false,
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
computed: {
|
|
92
|
+
recordId() {
|
|
93
|
+
return String(this.objectId || this.objectData?.id || '')
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
/** Whether the configuration names a link list this record can read. */
|
|
97
|
+
configured() {
|
|
98
|
+
const c = this.content;
|
|
99
|
+
return Boolean(c.register && c.schema && c.from && c.to && this.recordId)
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
readOnly() {
|
|
103
|
+
return this.content.readOnly === true
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
canAdd() {
|
|
107
|
+
return this.configured && !this.readOnly
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
canRemove() {
|
|
111
|
+
return this.configured && !this.readOnly && Boolean(this.content.remove)
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
inTitle() {
|
|
115
|
+
return this.content.add?.placement === 'title'
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
addLabel() {
|
|
119
|
+
return this.tr(this.content.add?.label || 'Add')
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
removeLabel() {
|
|
123
|
+
return this.tr(this.content.remove?.label || 'Remove')
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
emptyLabel() {
|
|
127
|
+
return this.tr(this.content.emptyText || 'Nothing linked yet')
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
types() {
|
|
131
|
+
return Array.isArray(this.content.types) ? this.content.types.filter((type) => type && type.value !== undefined) : []
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
targets() {
|
|
135
|
+
return Array.isArray(this.content.targets) ? this.content.targets.filter((target) => target && target.register && target.schema) : []
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The rows: the type in words and the other record's name.
|
|
140
|
+
*
|
|
141
|
+
* @return {Array<{id: string, link: object, label: string, title: string, targetId: string, route: object|null}>}
|
|
142
|
+
*/
|
|
143
|
+
rows() {
|
|
144
|
+
const c = this.content;
|
|
145
|
+
return this.links.map((link) => {
|
|
146
|
+
const targetId = String(readPath(link, c.to) ?? '');
|
|
147
|
+
const target = this.targetOf(link);
|
|
148
|
+
const type = c.typeField ? readPath(link, c.typeField) : undefined;
|
|
149
|
+
return {
|
|
150
|
+
id: String(link.id ?? link.uuid ?? targetId),
|
|
151
|
+
link,
|
|
152
|
+
label: this.typeLabel(type),
|
|
153
|
+
title: this.names[this.nameKey(target, targetId)] || targetId,
|
|
154
|
+
targetId,
|
|
155
|
+
route: target && target.route && targetId ? { name: target.route, params: { id: targetId } } : null,
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The card title row's add.
|
|
162
|
+
*
|
|
163
|
+
* @return {{actions: Array<object>}}
|
|
164
|
+
*/
|
|
165
|
+
header() {
|
|
166
|
+
if (!this.canAdd || !this.inTitle) {
|
|
167
|
+
return { actions: [] }
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
actions: [{
|
|
171
|
+
label: this.addLabel,
|
|
172
|
+
ariaLabel: this.tr(this.content.add?.ariaLabel || '') || this.addLabel,
|
|
173
|
+
icon: 'Plus',
|
|
174
|
+
variant: 'secondary',
|
|
175
|
+
run: () => {
|
|
176
|
+
this.dialogOpen = true;
|
|
177
|
+
},
|
|
178
|
+
}],
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
watch: {
|
|
184
|
+
header: {
|
|
185
|
+
immediate: true,
|
|
186
|
+
handler(header) {
|
|
187
|
+
/**
|
|
188
|
+
* @event header The card's title-row actions, `{ actions }`, for the host to draw.
|
|
189
|
+
*/
|
|
190
|
+
this.$emit('header', header);
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
recordId: {
|
|
195
|
+
immediate: true,
|
|
196
|
+
handler() {
|
|
197
|
+
this.load();
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
methods: {
|
|
203
|
+
tr(text) {
|
|
204
|
+
if (typeof text !== 'string' || text === '') {
|
|
205
|
+
return ''
|
|
206
|
+
}
|
|
207
|
+
return typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
async http() {
|
|
211
|
+
const { default: axios } = await import('@nextcloud/axios');
|
|
212
|
+
return axios
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The target a link points at: the one its `toType` names, else the first.
|
|
217
|
+
*
|
|
218
|
+
* @param {object} link The link object.
|
|
219
|
+
* @return {object|null}
|
|
220
|
+
*/
|
|
221
|
+
targetOf(link) {
|
|
222
|
+
const kind = this.content.toType ? readPath(link, this.content.toType) : undefined;
|
|
223
|
+
return this.targets.find((target) => target.type === kind) || this.targets[0] || null
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
nameKey(target, id) {
|
|
227
|
+
return `${target ? target.type : ''}:${id}`
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* A link type in words: its `types[].label`, translated, else the stored value.
|
|
232
|
+
*
|
|
233
|
+
* @param {unknown} value The stored type.
|
|
234
|
+
* @return {string}
|
|
235
|
+
*/
|
|
236
|
+
typeLabel(value) {
|
|
237
|
+
if (value === undefined || value === null || value === '') {
|
|
238
|
+
return ''
|
|
239
|
+
}
|
|
240
|
+
const type = this.types.find((candidate) => String(candidate.value) === String(value));
|
|
241
|
+
return type && type.label ? this.tr(type.label) : String(value)
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Read this record's links, then the name of every record they point at.
|
|
246
|
+
*
|
|
247
|
+
* @return {Promise<void>}
|
|
248
|
+
* @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed
|
|
249
|
+
*/
|
|
250
|
+
async load() {
|
|
251
|
+
if (!this.configured) {
|
|
252
|
+
this.links = [];
|
|
253
|
+
return
|
|
254
|
+
}
|
|
255
|
+
const c = this.content;
|
|
256
|
+
this.loading = true;
|
|
257
|
+
try {
|
|
258
|
+
const axios = await this.http();
|
|
259
|
+
const { data } = await axios.get(prefixUrl(objectsUrl(c.register, c.schema)), {
|
|
260
|
+
params: { ...(c.filter || {}), [c.from]: this.recordId, _limit: c.limit || 100 },
|
|
261
|
+
});
|
|
262
|
+
this.links = Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : []);
|
|
263
|
+
await this.loadNames(axios);
|
|
264
|
+
} catch (e) {
|
|
265
|
+
this.links = [];
|
|
266
|
+
this.notice = serverErrorMessage(e);
|
|
267
|
+
} finally {
|
|
268
|
+
this.loading = false;
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Read the name of each linked record once.
|
|
274
|
+
*
|
|
275
|
+
* @param {object} axios The HTTP client.
|
|
276
|
+
* @return {Promise<void>}
|
|
277
|
+
*/
|
|
278
|
+
async loadNames(axios) {
|
|
279
|
+
const wanted = new Map();
|
|
280
|
+
for (const link of this.links) {
|
|
281
|
+
const target = this.targetOf(link);
|
|
282
|
+
const id = String(readPath(link, this.content.to) ?? '');
|
|
283
|
+
const key = this.nameKey(target, id);
|
|
284
|
+
if (target && id && !(key in this.names)) {
|
|
285
|
+
wanted.set(key, { target, id });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const names = { ...this.names };
|
|
289
|
+
await Promise.all([...wanted.entries()].map(async ([key, { target, id }]) => {
|
|
290
|
+
try {
|
|
291
|
+
const { data } = await axios.get(prefixUrl(objectsUrl(target.register, target.schema, id)));
|
|
292
|
+
const title = readPath(data || {}, target.titleField || 'name');
|
|
293
|
+
names[key] = title ? String(title) : id;
|
|
294
|
+
} catch {
|
|
295
|
+
names[key] = id;
|
|
296
|
+
}
|
|
297
|
+
}));
|
|
298
|
+
this.names = names;
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The fields a link object is written with, from one side to the other.
|
|
303
|
+
*
|
|
304
|
+
* @param {object} side `{ fromId, fromKind, toId, toKind, type, inverse, group, values }`.
|
|
305
|
+
* @return {object}
|
|
306
|
+
*/
|
|
307
|
+
linkBody(side) {
|
|
308
|
+
const c = this.content;
|
|
309
|
+
const body = { ...(c.defaults || {}), ...(side.values || {}), [c.from]: side.fromId, [c.to]: side.toId };
|
|
310
|
+
const put = (field, value) => {
|
|
311
|
+
if (field && value !== undefined && value !== null && value !== '') {
|
|
312
|
+
body[field] = value;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
put(c.fromType, side.fromKind);
|
|
316
|
+
put(c.toType, side.toKind);
|
|
317
|
+
put(c.typeField, side.type);
|
|
318
|
+
put(c.inverseField, side.inverse);
|
|
319
|
+
put(c.groupField, side.group);
|
|
320
|
+
return body
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Write a new link (and with `pair` its inverse), then read the list again.
|
|
325
|
+
*
|
|
326
|
+
* @param {{target: {id: string, type?: string}, type: string, values?: object}} pick What the dialog chose.
|
|
327
|
+
* @return {Promise<{ok: boolean, message?: string}>}
|
|
328
|
+
* @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed
|
|
329
|
+
*/
|
|
330
|
+
async createLink(pick) {
|
|
331
|
+
const c = this.content;
|
|
332
|
+
if (!this.canAdd || !pick || !pick.target || !pick.target.id) {
|
|
333
|
+
return { ok: false, message: this.tr('This link cannot be saved here.') }
|
|
334
|
+
}
|
|
335
|
+
const exists = this.links.some((link) => String(readPath(link, c.to)) === String(pick.target.id)
|
|
336
|
+
&& (!c.typeField || String(readPath(link, c.typeField)) === String(pick.type)));
|
|
337
|
+
if (exists) {
|
|
338
|
+
return { ok: false, message: this.tr(c.duplicateText || 'This link already exists.') }
|
|
339
|
+
}
|
|
340
|
+
const type = this.types.find((candidate) => String(candidate.value) === String(pick.type));
|
|
341
|
+
const inverse = type && type.inverse !== undefined ? type.inverse : pick.type;
|
|
342
|
+
const group = type ? type.group : undefined;
|
|
343
|
+
this.busy = true;
|
|
344
|
+
try {
|
|
345
|
+
const axios = await this.http();
|
|
346
|
+
const url = prefixUrl(objectsUrl(c.register, c.schema));
|
|
347
|
+
await axios.post(url, this.linkBody({
|
|
348
|
+
fromId: this.recordId,
|
|
349
|
+
fromKind: c.selfType,
|
|
350
|
+
toId: pick.target.id,
|
|
351
|
+
toKind: pick.target.type,
|
|
352
|
+
type: pick.type,
|
|
353
|
+
inverse,
|
|
354
|
+
group,
|
|
355
|
+
values: pick.values,
|
|
356
|
+
}));
|
|
357
|
+
if (c.pair) {
|
|
358
|
+
await axios.post(url, this.linkBody({
|
|
359
|
+
fromId: pick.target.id,
|
|
360
|
+
fromKind: pick.target.type,
|
|
361
|
+
toId: this.recordId,
|
|
362
|
+
toKind: c.selfType,
|
|
363
|
+
type: inverse,
|
|
364
|
+
inverse: pick.type,
|
|
365
|
+
group,
|
|
366
|
+
values: pick.values,
|
|
367
|
+
}));
|
|
368
|
+
}
|
|
369
|
+
await this.load();
|
|
370
|
+
return { ok: true }
|
|
371
|
+
} catch (e) {
|
|
372
|
+
return { ok: false, message: serverErrorMessage(e) }
|
|
373
|
+
} finally {
|
|
374
|
+
this.busy = false;
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Delete a link (and with `pair` the inverse from the other record), then read the list again.
|
|
380
|
+
*
|
|
381
|
+
* @param {object} row The row.
|
|
382
|
+
* @return {Promise<void>}
|
|
383
|
+
* @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed
|
|
384
|
+
*/
|
|
385
|
+
async removeLink(row) {
|
|
386
|
+
const c = this.content;
|
|
387
|
+
if (!this.canRemove || !row) {
|
|
388
|
+
return
|
|
389
|
+
}
|
|
390
|
+
this.busy = true;
|
|
391
|
+
this.notice = '';
|
|
392
|
+
try {
|
|
393
|
+
const axios = await this.http();
|
|
394
|
+
await axios.delete(prefixUrl(objectsUrl(c.register, c.schema, row.id)));
|
|
395
|
+
if (c.pair && row.targetId) {
|
|
396
|
+
const type = c.typeField ? readPath(row.link, c.typeField) : undefined;
|
|
397
|
+
const inverse = c.inverseField ? readPath(row.link, c.inverseField) : undefined;
|
|
398
|
+
const known = this.types.find((candidate) => String(candidate.value) === String(type));
|
|
399
|
+
const inverseType = inverse ?? (known && known.inverse !== undefined ? known.inverse : undefined);
|
|
400
|
+
const { data } = await axios.get(prefixUrl(objectsUrl(c.register, c.schema)), {
|
|
401
|
+
params: { [c.from]: row.targetId, [c.to]: this.recordId, _limit: 10 },
|
|
402
|
+
});
|
|
403
|
+
const back = (Array.isArray(data?.results) ? data.results : [])
|
|
404
|
+
.filter((link) => inverseType === undefined || !c.typeField || String(readPath(link, c.typeField)) === String(inverseType));
|
|
405
|
+
for (const link of back) {
|
|
406
|
+
await axios.delete(prefixUrl(objectsUrl(c.register, c.schema, link.id ?? link.uuid)));
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
} catch (e) {
|
|
410
|
+
this.notice = serverErrorMessage(e);
|
|
411
|
+
return
|
|
412
|
+
} finally {
|
|
413
|
+
this.busy = false;
|
|
414
|
+
}
|
|
415
|
+
await this.load();
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
export { script as default };
|
|
421
|
+
//# sourceMappingURL=CnObjectLinksWidget.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnObjectLinksWidget.vue2.js","sources":["../../../../src/components/CnObjectLinksWidget/CnObjectLinksWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-object-links-widget\" data-testid=\"cn-object-links-widget\">\n\t\t<p v-if=\"!loading && rows.length === 0\" class=\"cn-object-links-widget__empty\" data-testid=\"cn-object-links-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-object-links-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in rows\"\n\t\t\t\t:key=\"row.id\"\n\t\t\t\tclass=\"cn-object-links-widget__row\"\n\t\t\t\t:data-testid=\"`cn-object-links-row-${row.id}`\">\n\t\t\t\t<span class=\"cn-object-links-widget__text\">\n\t\t\t\t\t<span v-if=\"row.label\" class=\"cn-object-links-widget__label\">{{ `${row.label} ` }}</span>\n\t\t\t\t\t<router-link v-if=\"row.route\" :to=\"row.route\" class=\"cn-object-links-widget__target\">\n\t\t\t\t\t\t{{ row.title }}\n\t\t\t\t\t</router-link>\n\t\t\t\t\t<span v-else class=\"cn-object-links-widget__target\">{{ row.title }}</span>\n\t\t\t\t</span>\n\t\t\t\t<NcActions\n\t\t\t\t\tv-if=\"canRemove\"\n\t\t\t\t\t:forceMenu=\"true\"\n\t\t\t\t\t:disabled=\"busy\"\n\t\t\t\t\t:ariaLabel=\"`${tr('More actions')}: ${row.title}`\"\n\t\t\t\t\t:data-testid=\"`cn-object-links-menu-${row.id}`\">\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t:data-testid=\"`cn-object-links-remove-${row.id}`\"\n\t\t\t\t\t\t@click=\"removeLink(row)\">\n\t\t\t\t\t\t{{ removeLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActions>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<p v-if=\"notice\"\n\t\t\tclass=\"cn-object-links-widget__notice\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-object-links-notice\">\n\t\t\t{{ notice }}\n\t\t</p>\n\n\t\t<div v-if=\"canAdd && !inTitle\" class=\"cn-object-links-widget__footer\">\n\t\t\t<NcButton\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t:disabled=\"busy\"\n\t\t\t\tdata-testid=\"cn-object-links-add\"\n\t\t\t\t@click=\"dialogOpen = true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ addLabel }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<CnObjectLinkDialog\n\t\t\tv-if=\"dialogOpen\"\n\t\t\t:content=\"content\"\n\t\t\t:objectId=\"recordId\"\n\t\t\t:save=\"createLink\"\n\t\t\t@close=\"dialogOpen = false\" />\n\t</div>\n</template>\n\n<script>\nimport { NcActionButton, NcActions, NcButton } from '@nextcloud/vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport CnObjectLinkDialog from './CnObjectLinkDialog.vue'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\nimport { objectsUrl } from './objectLinks.js'\n\n/**\n * CnObjectLinksWidget: the `object-links` widget: a record's links to other\n * records, each kept as an object of a link schema that names this record\n * (`from`) and the other one (`to`). Board PqKlant \"Relaties\": \"Secretaris van\n * Buurtvereniging Oost\", \"Partner van J. de Vries\".\n *\n * A row reads the link's type as words (`types[].label`) and the other\n * record's name, read from the schema its `toType` points at (`targets`), as a\n * link to that record's page. Add opens a dialog (search the targets, pick a\n * type, fill the extra `fields`) and writes the link; with `pair` it writes the\n * inverse link from the other record too, and Remove deletes both. Every write\n * goes to OpenRegister, which decides who may write; a refusal shows in the\n * server's words.\n *\n * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n */\nexport default {\n\tname: 'CnObjectLinksWidget',\n\n\tcomponents: { CnObjectLinkDialog, NcActionButton, NcActions, NcButton, Plus },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `register`, `schema` (required): where the link objects live.\n\t\t * - `from`, `to` (required): the link fields naming this record and the other one.\n\t\t * - `fromType`, `toType`, `selfType`: the fields that name each side's kind, and this record's kind.\n\t\t * - `typeField`, `inverseField`, `groupField`: the fields the link's type, its inverse type and\n\t\t * its group are written to.\n\t\t * - `types`: `[{ value, label, inverse?, group?, groupLabel? }]`: the choices, and how a row words its type;\n\t\t * `group` is written to `groupField`, `groupLabel` (else `group`) words it in the dialog.\n\t\t * - `targets`: `[{ type, register, schema, titleField?, label?, route? }]`: the kinds of record a\n\t\t * link may point at; a row reads the name from the target its `toType` names (else the first)\n\t\t * and links to its `route` with `params.id`.\n\t\t * - `pair`: write and remove the inverse link from the other record as well.\n\t\t * - `fields`: `[{ key, label, type?: 'text'|'textarea'|'date' }]`: extra values the dialog asks.\n\t\t * - `defaults`: values written on every new link.\n\t\t * - `filter`: extra list filters; `limit` (default 100).\n\t\t * - `add`: `{ label?, ariaLabel?, placement?: 'title'|'footer', dialogTitle? }`; `title` reports\n\t\t * the add for the card's title row on the `header` event.\n\t\t * - `remove`: `{ label? }`: a remove in each row's menu. Omitted: no remove.\n\t\t * - `readOnly`, `emptyText`, `duplicateText`.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The current detail-page object. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The current object id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['header'],\n\n\tdata() {\n\t\treturn {\n\t\t\tlinks: [],\n\t\t\t/** Target names, by `<type>:<id>`. */\n\t\t\tnames: {},\n\t\t\tloading: false,\n\t\t\tbusy: false,\n\t\t\tnotice: '',\n\t\t\tdialogOpen: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\trecordId() {\n\t\t\treturn String(this.objectId || this.objectData?.id || '')\n\t\t},\n\n\t\t/** Whether the configuration names a link list this record can read. */\n\t\tconfigured() {\n\t\t\tconst c = this.content\n\t\t\treturn Boolean(c.register && c.schema && c.from && c.to && this.recordId)\n\t\t},\n\n\t\treadOnly() {\n\t\t\treturn this.content.readOnly === true\n\t\t},\n\n\t\tcanAdd() {\n\t\t\treturn this.configured && !this.readOnly\n\t\t},\n\n\t\tcanRemove() {\n\t\t\treturn this.configured && !this.readOnly && Boolean(this.content.remove)\n\t\t},\n\n\t\tinTitle() {\n\t\t\treturn this.content.add?.placement === 'title'\n\t\t},\n\n\t\taddLabel() {\n\t\t\treturn this.tr(this.content.add?.label || 'Add')\n\t\t},\n\n\t\tremoveLabel() {\n\t\t\treturn this.tr(this.content.remove?.label || 'Remove')\n\t\t},\n\n\t\temptyLabel() {\n\t\t\treturn this.tr(this.content.emptyText || 'Nothing linked yet')\n\t\t},\n\n\t\ttypes() {\n\t\t\treturn Array.isArray(this.content.types) ? this.content.types.filter((type) => type && type.value !== undefined) : []\n\t\t},\n\n\t\ttargets() {\n\t\t\treturn Array.isArray(this.content.targets) ? this.content.targets.filter((target) => target && target.register && target.schema) : []\n\t\t},\n\n\t\t/**\n\t\t * The rows: the type in words and the other record's name.\n\t\t *\n\t\t * @return {Array<{id: string, link: object, label: string, title: string, targetId: string, route: object|null}>}\n\t\t */\n\t\trows() {\n\t\t\tconst c = this.content\n\t\t\treturn this.links.map((link) => {\n\t\t\t\tconst targetId = String(readPath(link, c.to) ?? '')\n\t\t\t\tconst target = this.targetOf(link)\n\t\t\t\tconst type = c.typeField ? readPath(link, c.typeField) : undefined\n\t\t\t\treturn {\n\t\t\t\t\tid: String(link.id ?? link.uuid ?? targetId),\n\t\t\t\t\tlink,\n\t\t\t\t\tlabel: this.typeLabel(type),\n\t\t\t\t\ttitle: this.names[this.nameKey(target, targetId)] || targetId,\n\t\t\t\t\ttargetId,\n\t\t\t\t\troute: target && target.route && targetId ? { name: target.route, params: { id: targetId } } : null,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The card title row's add.\n\t\t *\n\t\t * @return {{actions: Array<object>}}\n\t\t */\n\t\theader() {\n\t\t\tif (!this.canAdd || !this.inTitle) {\n\t\t\t\treturn { actions: [] }\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tactions: [{\n\t\t\t\t\tlabel: this.addLabel,\n\t\t\t\t\tariaLabel: this.tr(this.content.add?.ariaLabel || '') || this.addLabel,\n\t\t\t\t\ticon: 'Plus',\n\t\t\t\t\tvariant: 'secondary',\n\t\t\t\t\trun: () => {\n\t\t\t\t\t\tthis.dialogOpen = true\n\t\t\t\t\t},\n\t\t\t\t}],\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\theader: {\n\t\t\timmediate: true,\n\t\t\thandler(header) {\n\t\t\t\t/**\n\t\t\t\t * @event header The card's title-row actions, `{ actions }`, for the host to draw.\n\t\t\t\t */\n\t\t\t\tthis.$emit('header', header)\n\t\t\t},\n\t\t},\n\n\t\trecordId: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.load()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\tasync http() {\n\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\treturn axios\n\t\t},\n\n\t\t/**\n\t\t * The target a link points at: the one its `toType` names, else the first.\n\t\t *\n\t\t * @param {object} link The link object.\n\t\t * @return {object|null}\n\t\t */\n\t\ttargetOf(link) {\n\t\t\tconst kind = this.content.toType ? readPath(link, this.content.toType) : undefined\n\t\t\treturn this.targets.find((target) => target.type === kind) || this.targets[0] || null\n\t\t},\n\n\t\tnameKey(target, id) {\n\t\t\treturn `${target ? target.type : ''}:${id}`\n\t\t},\n\n\t\t/**\n\t\t * A link type in words: its `types[].label`, translated, else the stored value.\n\t\t *\n\t\t * @param {unknown} value The stored type.\n\t\t * @return {string}\n\t\t */\n\t\ttypeLabel(value) {\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst type = this.types.find((candidate) => String(candidate.value) === String(value))\n\t\t\treturn type && type.label ? this.tr(type.label) : String(value)\n\t\t},\n\n\t\t/**\n\t\t * Read this record's links, then the name of every record they point at.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n\t\t */\n\t\tasync load() {\n\t\t\tif (!this.configured) {\n\t\t\t\tthis.links = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst c = this.content\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst axios = await this.http()\n\t\t\t\tconst { data } = await axios.get(prefixUrl(objectsUrl(c.register, c.schema)), {\n\t\t\t\t\tparams: { ...(c.filter || {}), [c.from]: this.recordId, _limit: c.limit || 100 },\n\t\t\t\t})\n\t\t\t\tthis.links = Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])\n\t\t\t\tawait this.loadNames(axios)\n\t\t\t} catch (e) {\n\t\t\t\tthis.links = []\n\t\t\t\tthis.notice = serverErrorMessage(e)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read the name of each linked record once.\n\t\t *\n\t\t * @param {object} axios The HTTP client.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadNames(axios) {\n\t\t\tconst wanted = new Map()\n\t\t\tfor (const link of this.links) {\n\t\t\t\tconst target = this.targetOf(link)\n\t\t\t\tconst id = String(readPath(link, this.content.to) ?? '')\n\t\t\t\tconst key = this.nameKey(target, id)\n\t\t\t\tif (target && id && !(key in this.names)) {\n\t\t\t\t\twanted.set(key, { target, id })\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst names = { ...this.names }\n\t\t\tawait Promise.all([...wanted.entries()].map(async ([key, { target, id }]) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst { data } = await axios.get(prefixUrl(objectsUrl(target.register, target.schema, id)))\n\t\t\t\t\tconst title = readPath(data || {}, target.titleField || 'name')\n\t\t\t\t\tnames[key] = title ? String(title) : id\n\t\t\t\t} catch {\n\t\t\t\t\tnames[key] = id\n\t\t\t\t}\n\t\t\t}))\n\t\t\tthis.names = names\n\t\t},\n\n\t\t/**\n\t\t * The fields a link object is written with, from one side to the other.\n\t\t *\n\t\t * @param {object} side `{ fromId, fromKind, toId, toKind, type, inverse, group, values }`.\n\t\t * @return {object}\n\t\t */\n\t\tlinkBody(side) {\n\t\t\tconst c = this.content\n\t\t\tconst body = { ...(c.defaults || {}), ...(side.values || {}), [c.from]: side.fromId, [c.to]: side.toId }\n\t\t\tconst put = (field, value) => {\n\t\t\t\tif (field && value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tbody[field] = value\n\t\t\t\t}\n\t\t\t}\n\t\t\tput(c.fromType, side.fromKind)\n\t\t\tput(c.toType, side.toKind)\n\t\t\tput(c.typeField, side.type)\n\t\t\tput(c.inverseField, side.inverse)\n\t\t\tput(c.groupField, side.group)\n\t\t\treturn body\n\t\t},\n\n\t\t/**\n\t\t * Write a new link (and with `pair` its inverse), then read the list again.\n\t\t *\n\t\t * @param {{target: {id: string, type?: string}, type: string, values?: object}} pick What the dialog chose.\n\t\t * @return {Promise<{ok: boolean, message?: string}>}\n\t\t * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n\t\t */\n\t\tasync createLink(pick) {\n\t\t\tconst c = this.content\n\t\t\tif (!this.canAdd || !pick || !pick.target || !pick.target.id) {\n\t\t\t\treturn { ok: false, message: this.tr('This link cannot be saved here.') }\n\t\t\t}\n\t\t\tconst exists = this.links.some((link) => String(readPath(link, c.to)) === String(pick.target.id)\n\t\t\t\t&& (!c.typeField || String(readPath(link, c.typeField)) === String(pick.type)))\n\t\t\tif (exists) {\n\t\t\t\treturn { ok: false, message: this.tr(c.duplicateText || 'This link already exists.') }\n\t\t\t}\n\t\t\tconst type = this.types.find((candidate) => String(candidate.value) === String(pick.type))\n\t\t\tconst inverse = type && type.inverse !== undefined ? type.inverse : pick.type\n\t\t\tconst group = type ? type.group : undefined\n\t\t\tthis.busy = true\n\t\t\ttry {\n\t\t\t\tconst axios = await this.http()\n\t\t\t\tconst url = prefixUrl(objectsUrl(c.register, c.schema))\n\t\t\t\tawait axios.post(url, this.linkBody({\n\t\t\t\t\tfromId: this.recordId,\n\t\t\t\t\tfromKind: c.selfType,\n\t\t\t\t\ttoId: pick.target.id,\n\t\t\t\t\ttoKind: pick.target.type,\n\t\t\t\t\ttype: pick.type,\n\t\t\t\t\tinverse,\n\t\t\t\t\tgroup,\n\t\t\t\t\tvalues: pick.values,\n\t\t\t\t}))\n\t\t\t\tif (c.pair) {\n\t\t\t\t\tawait axios.post(url, this.linkBody({\n\t\t\t\t\t\tfromId: pick.target.id,\n\t\t\t\t\t\tfromKind: pick.target.type,\n\t\t\t\t\t\ttoId: this.recordId,\n\t\t\t\t\t\ttoKind: c.selfType,\n\t\t\t\t\t\ttype: inverse,\n\t\t\t\t\t\tinverse: pick.type,\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tvalues: pick.values,\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t\tawait this.load()\n\t\t\t\treturn { ok: true }\n\t\t\t} catch (e) {\n\t\t\t\treturn { ok: false, message: serverErrorMessage(e) }\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a link (and with `pair` the inverse from the other record), then read the list again.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n\t\t */\n\t\tasync removeLink(row) {\n\t\t\tconst c = this.content\n\t\t\tif (!this.canRemove || !row) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.notice = ''\n\t\t\ttry {\n\t\t\t\tconst axios = await this.http()\n\t\t\t\tawait axios.delete(prefixUrl(objectsUrl(c.register, c.schema, row.id)))\n\t\t\t\tif (c.pair && row.targetId) {\n\t\t\t\t\tconst type = c.typeField ? readPath(row.link, c.typeField) : undefined\n\t\t\t\t\tconst inverse = c.inverseField ? readPath(row.link, c.inverseField) : undefined\n\t\t\t\t\tconst known = this.types.find((candidate) => String(candidate.value) === String(type))\n\t\t\t\t\tconst inverseType = inverse ?? (known && known.inverse !== undefined ? known.inverse : undefined)\n\t\t\t\t\tconst { data } = await axios.get(prefixUrl(objectsUrl(c.register, c.schema)), {\n\t\t\t\t\t\tparams: { [c.from]: row.targetId, [c.to]: this.recordId, _limit: 10 },\n\t\t\t\t\t})\n\t\t\t\t\tconst back = (Array.isArray(data?.results) ? data.results : [])\n\t\t\t\t\t\t.filter((link) => inverseType === undefined || !c.typeField || String(readPath(link, c.typeField)) === String(inverseType))\n\t\t\t\t\tfor (const link of back) {\n\t\t\t\t\t\tawait axios.delete(prefixUrl(objectsUrl(c.register, c.schema, link.id ?? link.uuid)))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tthis.notice = serverErrorMessage(e)\n\t\t\t\treturn\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t\tawait this.load()\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-object-links-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tfont-size: 14px;\n}\n\n.cn-object-links-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-object-links-widget__row {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tmin-height: 20px;\n}\n\n.cn-object-links-widget__text {\n\tmin-width: 0;\n\toverflow-wrap: anywhere;\n}\n\n.cn-object-links-widget__empty {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-object-links-widget__notice {\n\tmargin: 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-object-links-widget__footer {\n\tdisplay: flex;\n}\n</style>\n"],"names":["CnObjectLinkDialog"],"mappings":";;;;;;;;AA4EA;AACC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,qBAAqB;;AAE3B,CAAA,UAAU,EAAE,sBAAEA,UAAkB,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM;;AAE7E,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;;AAGD,EAAA,QAAQ,EAAE;AACT,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;GACtB,OAAO,EAAE,EAAE;GACX;EACD;;AAED,CAAA,KAAK,EAAE,CAAC,QAAQ,CAAC;;AAEjB,CAAA,IAAI,GAAG;AACN,EAAA,OAAO;AACN,GAAA,KAAK,EAAE,EAAE;AACT;AACA,GAAA,KAAK,EAAE,EAAE;GACT,OAAO,EAAE,KAAK;GACd,IAAI,E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IAAG,GAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAA,GAAI,IAAI,CAAC,OAAM,GAAI,EAAE;OAC5D,MAAM,CAAC,CAAC,IAAI,KAAK,WAAU,KAAM,SAAQ,IAAK,CAAC,CAAC,CAAC,SAAQ,IAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAE,KAAI,MAAM,CAAC,WAAW,CAAC,EAAA;AAC3H,KAAA,KAAK,MAAM,QAAQ,IAAI,EAAE;AACxB,MAAA,MAAM,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAAC,IAAK,IAAI,CAAC,IAAI,CAAC,CAAC,EAAA;AACrF,MAAA;AACD,KAAA;AACD,IAAA,CAAE,OAAO,CAAC,EAAE;AACX,IAAA,IAAI,CAAC,MAAK,GAAI,kBAAkB,CAAC,CAAC,EAAA;IAClC,MAAK;AACN,IAAA,SAAU;AACT,IAAA,IAAI,CAAC,IAAG,GAAI,MAAI;AACjB,IAAA;AACA,GAAA,MAAM,IAAI,CAAC,IAAI,GAAC;GAChB;EACD;AACF;;;;"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, toDisplayString, Fragment, renderList, createElementVNode, createCommentVNode, createBlock, withCtx, createTextVNode, createVNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
class: "cn-object-links-widget",
|
|
5
|
+
"data-testid": "cn-object-links-widget"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "cn-object-links-widget__empty",
|
|
10
|
+
"data-testid": "cn-object-links-empty"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_3 = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "cn-object-links-widget__rows"
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_4 = ["data-testid"];
|
|
17
|
+
const _hoisted_5 = { class: "cn-object-links-widget__text" };
|
|
18
|
+
const _hoisted_6 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "cn-object-links-widget__label"
|
|
21
|
+
};
|
|
22
|
+
const _hoisted_7 = {
|
|
23
|
+
key: 2,
|
|
24
|
+
class: "cn-object-links-widget__target"
|
|
25
|
+
};
|
|
26
|
+
const _hoisted_8 = {
|
|
27
|
+
key: 2,
|
|
28
|
+
class: "cn-object-links-widget__notice",
|
|
29
|
+
role: "alert",
|
|
30
|
+
"data-testid": "cn-object-links-notice"
|
|
31
|
+
};
|
|
32
|
+
const _hoisted_9 = {
|
|
33
|
+
key: 3,
|
|
34
|
+
class: "cn-object-links-widget__footer"
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
38
|
+
const _component_router_link = resolveComponent("router-link");
|
|
39
|
+
const _component_NcActionButton = resolveComponent("NcActionButton");
|
|
40
|
+
const _component_NcActions = resolveComponent("NcActions");
|
|
41
|
+
const _component_Plus = resolveComponent("Plus");
|
|
42
|
+
const _component_NcButton = resolveComponent("NcButton");
|
|
43
|
+
const _component_CnObjectLinkDialog = resolveComponent("CnObjectLinkDialog");
|
|
44
|
+
|
|
45
|
+
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
46
|
+
(!$data.loading && $options.rows.length === 0)
|
|
47
|
+
? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString($options.emptyLabel), 1 /* TEXT */))
|
|
48
|
+
: (openBlock(), createElementBlock("ul", _hoisted_3, [
|
|
49
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($options.rows, (row) => {
|
|
50
|
+
return (openBlock(), createElementBlock("li", {
|
|
51
|
+
key: row.id,
|
|
52
|
+
class: "cn-object-links-widget__row",
|
|
53
|
+
"data-testid": `cn-object-links-row-${row.id}`
|
|
54
|
+
}, [
|
|
55
|
+
createElementVNode("span", _hoisted_5, [
|
|
56
|
+
(row.label)
|
|
57
|
+
? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(`${row.label} `), 1 /* TEXT */))
|
|
58
|
+
: createCommentVNode("v-if", true),
|
|
59
|
+
(row.route)
|
|
60
|
+
? (openBlock(), createBlock(_component_router_link, {
|
|
61
|
+
key: 1,
|
|
62
|
+
to: row.route,
|
|
63
|
+
class: "cn-object-links-widget__target"
|
|
64
|
+
}, {
|
|
65
|
+
default: withCtx(() => [
|
|
66
|
+
createTextVNode(toDisplayString(row.title), 1 /* TEXT */)
|
|
67
|
+
]),
|
|
68
|
+
_: 2 /* DYNAMIC */
|
|
69
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to"]))
|
|
70
|
+
: (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(row.title), 1 /* TEXT */))
|
|
71
|
+
]),
|
|
72
|
+
($options.canRemove)
|
|
73
|
+
? (openBlock(), createBlock(_component_NcActions, {
|
|
74
|
+
key: 0,
|
|
75
|
+
forceMenu: true,
|
|
76
|
+
disabled: $data.busy,
|
|
77
|
+
ariaLabel: `${$options.tr('More actions')}: ${row.title}`,
|
|
78
|
+
"data-testid": `cn-object-links-menu-${row.id}`
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createVNode(_component_NcActionButton, {
|
|
82
|
+
"data-testid": `cn-object-links-remove-${row.id}`,
|
|
83
|
+
onClick: $event => ($options.removeLink(row))
|
|
84
|
+
}, {
|
|
85
|
+
default: withCtx(() => [
|
|
86
|
+
createTextVNode(toDisplayString($options.removeLabel), 1 /* TEXT */)
|
|
87
|
+
]),
|
|
88
|
+
_: 1 /* STABLE */
|
|
89
|
+
}, 8 /* PROPS */, ["data-testid", "onClick"])
|
|
90
|
+
]),
|
|
91
|
+
_: 2 /* DYNAMIC */
|
|
92
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled", "ariaLabel", "data-testid"]))
|
|
93
|
+
: createCommentVNode("v-if", true)
|
|
94
|
+
], 8 /* PROPS */, _hoisted_4))
|
|
95
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
96
|
+
])),
|
|
97
|
+
($data.notice)
|
|
98
|
+
? (openBlock(), createElementBlock("p", _hoisted_8, toDisplayString($data.notice), 1 /* TEXT */))
|
|
99
|
+
: createCommentVNode("v-if", true),
|
|
100
|
+
($options.canAdd && !$options.inTitle)
|
|
101
|
+
? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
102
|
+
createVNode(_component_NcButton, {
|
|
103
|
+
variant: "secondary",
|
|
104
|
+
disabled: $data.busy,
|
|
105
|
+
"data-testid": "cn-object-links-add",
|
|
106
|
+
onClick: _cache[0] || (_cache[0] = $event => ($data.dialogOpen = true))
|
|
107
|
+
}, {
|
|
108
|
+
icon: withCtx(() => [
|
|
109
|
+
createVNode(_component_Plus, { size: 16 })
|
|
110
|
+
]),
|
|
111
|
+
default: withCtx(() => [
|
|
112
|
+
createTextVNode(" " + toDisplayString($options.addLabel), 1 /* TEXT */)
|
|
113
|
+
]),
|
|
114
|
+
_: 1 /* STABLE */
|
|
115
|
+
}, 8 /* PROPS */, ["disabled"])
|
|
116
|
+
]))
|
|
117
|
+
: createCommentVNode("v-if", true),
|
|
118
|
+
($data.dialogOpen)
|
|
119
|
+
? (openBlock(), createBlock(_component_CnObjectLinkDialog, {
|
|
120
|
+
key: 4,
|
|
121
|
+
content: $props.content,
|
|
122
|
+
objectId: $options.recordId,
|
|
123
|
+
save: $options.createLink,
|
|
124
|
+
onClose: _cache[1] || (_cache[1] = $event => ($data.dialogOpen = false))
|
|
125
|
+
}, null, 8 /* PROPS */, ["content", "objectId", "save"]))
|
|
126
|
+
: createCommentVNode("v-if", true)
|
|
127
|
+
]))
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { render };
|
|
131
|
+
//# sourceMappingURL=CnObjectLinksWidget.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnObjectLinksWidget.vue3.js","sources":["../../../../src/components/CnObjectLinksWidget/CnObjectLinksWidget.vue?vue&type=template&id=7701b22f&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-object-links-widget\" data-testid=\"cn-object-links-widget\">\n\t\t<p v-if=\"!loading && rows.length === 0\" class=\"cn-object-links-widget__empty\" data-testid=\"cn-object-links-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-object-links-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in rows\"\n\t\t\t\t:key=\"row.id\"\n\t\t\t\tclass=\"cn-object-links-widget__row\"\n\t\t\t\t:data-testid=\"`cn-object-links-row-${row.id}`\">\n\t\t\t\t<span class=\"cn-object-links-widget__text\">\n\t\t\t\t\t<span v-if=\"row.label\" class=\"cn-object-links-widget__label\">{{ `${row.label} ` }}</span>\n\t\t\t\t\t<router-link v-if=\"row.route\" :to=\"row.route\" class=\"cn-object-links-widget__target\">\n\t\t\t\t\t\t{{ row.title }}\n\t\t\t\t\t</router-link>\n\t\t\t\t\t<span v-else class=\"cn-object-links-widget__target\">{{ row.title }}</span>\n\t\t\t\t</span>\n\t\t\t\t<NcActions\n\t\t\t\t\tv-if=\"canRemove\"\n\t\t\t\t\t:forceMenu=\"true\"\n\t\t\t\t\t:disabled=\"busy\"\n\t\t\t\t\t:ariaLabel=\"`${tr('More actions')}: ${row.title}`\"\n\t\t\t\t\t:data-testid=\"`cn-object-links-menu-${row.id}`\">\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t:data-testid=\"`cn-object-links-remove-${row.id}`\"\n\t\t\t\t\t\t@click=\"removeLink(row)\">\n\t\t\t\t\t\t{{ removeLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActions>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<p v-if=\"notice\"\n\t\t\tclass=\"cn-object-links-widget__notice\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-object-links-notice\">\n\t\t\t{{ notice }}\n\t\t</p>\n\n\t\t<div v-if=\"canAdd && !inTitle\" class=\"cn-object-links-widget__footer\">\n\t\t\t<NcButton\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t:disabled=\"busy\"\n\t\t\t\tdata-testid=\"cn-object-links-add\"\n\t\t\t\t@click=\"dialogOpen = true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ addLabel }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<CnObjectLinkDialog\n\t\t\tv-if=\"dialogOpen\"\n\t\t\t:content=\"content\"\n\t\t\t:objectId=\"recordId\"\n\t\t\t:save=\"createLink\"\n\t\t\t@close=\"dialogOpen = false\" />\n\t</div>\n</template>\n\n<script>\nimport { NcActionButton, NcActions, NcButton } from '@nextcloud/vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport CnObjectLinkDialog from './CnObjectLinkDialog.vue'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { serverErrorMessage } from '../../utils/serverErrorMessage.js'\nimport { objectsUrl } from './objectLinks.js'\n\n/**\n * CnObjectLinksWidget: the `object-links` widget: a record's links to other\n * records, each kept as an object of a link schema that names this record\n * (`from`) and the other one (`to`). Board PqKlant \"Relaties\": \"Secretaris van\n * Buurtvereniging Oost\", \"Partner van J. de Vries\".\n *\n * A row reads the link's type as words (`types[].label`) and the other\n * record's name, read from the schema its `toType` points at (`targets`), as a\n * link to that record's page. Add opens a dialog (search the targets, pick a\n * type, fill the extra `fields`) and writes the link; with `pair` it writes the\n * inverse link from the other record too, and Remove deletes both. Every write\n * goes to OpenRegister, which decides who may write; a refusal shows in the\n * server's words.\n *\n * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n */\nexport default {\n\tname: 'CnObjectLinksWidget',\n\n\tcomponents: { CnObjectLinkDialog, NcActionButton, NcActions, NcButton, Plus },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `register`, `schema` (required): where the link objects live.\n\t\t * - `from`, `to` (required): the link fields naming this record and the other one.\n\t\t * - `fromType`, `toType`, `selfType`: the fields that name each side's kind, and this record's kind.\n\t\t * - `typeField`, `inverseField`, `groupField`: the fields the link's type, its inverse type and\n\t\t * its group are written to.\n\t\t * - `types`: `[{ value, label, inverse?, group?, groupLabel? }]`: the choices, and how a row words its type;\n\t\t * `group` is written to `groupField`, `groupLabel` (else `group`) words it in the dialog.\n\t\t * - `targets`: `[{ type, register, schema, titleField?, label?, route? }]`: the kinds of record a\n\t\t * link may point at; a row reads the name from the target its `toType` names (else the first)\n\t\t * and links to its `route` with `params.id`.\n\t\t * - `pair`: write and remove the inverse link from the other record as well.\n\t\t * - `fields`: `[{ key, label, type?: 'text'|'textarea'|'date' }]`: extra values the dialog asks.\n\t\t * - `defaults`: values written on every new link.\n\t\t * - `filter`: extra list filters; `limit` (default 100).\n\t\t * - `add`: `{ label?, ariaLabel?, placement?: 'title'|'footer', dialogTitle? }`; `title` reports\n\t\t * the add for the card's title row on the `header` event.\n\t\t * - `remove`: `{ label? }`: a remove in each row's menu. Omitted: no remove.\n\t\t * - `readOnly`, `emptyText`, `duplicateText`.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The current detail-page object. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The current object id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['header'],\n\n\tdata() {\n\t\treturn {\n\t\t\tlinks: [],\n\t\t\t/** Target names, by `<type>:<id>`. */\n\t\t\tnames: {},\n\t\t\tloading: false,\n\t\t\tbusy: false,\n\t\t\tnotice: '',\n\t\t\tdialogOpen: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\trecordId() {\n\t\t\treturn String(this.objectId || this.objectData?.id || '')\n\t\t},\n\n\t\t/** Whether the configuration names a link list this record can read. */\n\t\tconfigured() {\n\t\t\tconst c = this.content\n\t\t\treturn Boolean(c.register && c.schema && c.from && c.to && this.recordId)\n\t\t},\n\n\t\treadOnly() {\n\t\t\treturn this.content.readOnly === true\n\t\t},\n\n\t\tcanAdd() {\n\t\t\treturn this.configured && !this.readOnly\n\t\t},\n\n\t\tcanRemove() {\n\t\t\treturn this.configured && !this.readOnly && Boolean(this.content.remove)\n\t\t},\n\n\t\tinTitle() {\n\t\t\treturn this.content.add?.placement === 'title'\n\t\t},\n\n\t\taddLabel() {\n\t\t\treturn this.tr(this.content.add?.label || 'Add')\n\t\t},\n\n\t\tremoveLabel() {\n\t\t\treturn this.tr(this.content.remove?.label || 'Remove')\n\t\t},\n\n\t\temptyLabel() {\n\t\t\treturn this.tr(this.content.emptyText || 'Nothing linked yet')\n\t\t},\n\n\t\ttypes() {\n\t\t\treturn Array.isArray(this.content.types) ? this.content.types.filter((type) => type && type.value !== undefined) : []\n\t\t},\n\n\t\ttargets() {\n\t\t\treturn Array.isArray(this.content.targets) ? this.content.targets.filter((target) => target && target.register && target.schema) : []\n\t\t},\n\n\t\t/**\n\t\t * The rows: the type in words and the other record's name.\n\t\t *\n\t\t * @return {Array<{id: string, link: object, label: string, title: string, targetId: string, route: object|null}>}\n\t\t */\n\t\trows() {\n\t\t\tconst c = this.content\n\t\t\treturn this.links.map((link) => {\n\t\t\t\tconst targetId = String(readPath(link, c.to) ?? '')\n\t\t\t\tconst target = this.targetOf(link)\n\t\t\t\tconst type = c.typeField ? readPath(link, c.typeField) : undefined\n\t\t\t\treturn {\n\t\t\t\t\tid: String(link.id ?? link.uuid ?? targetId),\n\t\t\t\t\tlink,\n\t\t\t\t\tlabel: this.typeLabel(type),\n\t\t\t\t\ttitle: this.names[this.nameKey(target, targetId)] || targetId,\n\t\t\t\t\ttargetId,\n\t\t\t\t\troute: target && target.route && targetId ? { name: target.route, params: { id: targetId } } : null,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The card title row's add.\n\t\t *\n\t\t * @return {{actions: Array<object>}}\n\t\t */\n\t\theader() {\n\t\t\tif (!this.canAdd || !this.inTitle) {\n\t\t\t\treturn { actions: [] }\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tactions: [{\n\t\t\t\t\tlabel: this.addLabel,\n\t\t\t\t\tariaLabel: this.tr(this.content.add?.ariaLabel || '') || this.addLabel,\n\t\t\t\t\ticon: 'Plus',\n\t\t\t\t\tvariant: 'secondary',\n\t\t\t\t\trun: () => {\n\t\t\t\t\t\tthis.dialogOpen = true\n\t\t\t\t\t},\n\t\t\t\t}],\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\theader: {\n\t\t\timmediate: true,\n\t\t\thandler(header) {\n\t\t\t\t/**\n\t\t\t\t * @event header The card's title-row actions, `{ actions }`, for the host to draw.\n\t\t\t\t */\n\t\t\t\tthis.$emit('header', header)\n\t\t\t},\n\t\t},\n\n\t\trecordId: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.load()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\tasync http() {\n\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\treturn axios\n\t\t},\n\n\t\t/**\n\t\t * The target a link points at: the one its `toType` names, else the first.\n\t\t *\n\t\t * @param {object} link The link object.\n\t\t * @return {object|null}\n\t\t */\n\t\ttargetOf(link) {\n\t\t\tconst kind = this.content.toType ? readPath(link, this.content.toType) : undefined\n\t\t\treturn this.targets.find((target) => target.type === kind) || this.targets[0] || null\n\t\t},\n\n\t\tnameKey(target, id) {\n\t\t\treturn `${target ? target.type : ''}:${id}`\n\t\t},\n\n\t\t/**\n\t\t * A link type in words: its `types[].label`, translated, else the stored value.\n\t\t *\n\t\t * @param {unknown} value The stored type.\n\t\t * @return {string}\n\t\t */\n\t\ttypeLabel(value) {\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst type = this.types.find((candidate) => String(candidate.value) === String(value))\n\t\t\treturn type && type.label ? this.tr(type.label) : String(value)\n\t\t},\n\n\t\t/**\n\t\t * Read this record's links, then the name of every record they point at.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n\t\t */\n\t\tasync load() {\n\t\t\tif (!this.configured) {\n\t\t\t\tthis.links = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst c = this.content\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst axios = await this.http()\n\t\t\t\tconst { data } = await axios.get(prefixUrl(objectsUrl(c.register, c.schema)), {\n\t\t\t\t\tparams: { ...(c.filter || {}), [c.from]: this.recordId, _limit: c.limit || 100 },\n\t\t\t\t})\n\t\t\t\tthis.links = Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])\n\t\t\t\tawait this.loadNames(axios)\n\t\t\t} catch (e) {\n\t\t\t\tthis.links = []\n\t\t\t\tthis.notice = serverErrorMessage(e)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read the name of each linked record once.\n\t\t *\n\t\t * @param {object} axios The HTTP client.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadNames(axios) {\n\t\t\tconst wanted = new Map()\n\t\t\tfor (const link of this.links) {\n\t\t\t\tconst target = this.targetOf(link)\n\t\t\t\tconst id = String(readPath(link, this.content.to) ?? '')\n\t\t\t\tconst key = this.nameKey(target, id)\n\t\t\t\tif (target && id && !(key in this.names)) {\n\t\t\t\t\twanted.set(key, { target, id })\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst names = { ...this.names }\n\t\t\tawait Promise.all([...wanted.entries()].map(async ([key, { target, id }]) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst { data } = await axios.get(prefixUrl(objectsUrl(target.register, target.schema, id)))\n\t\t\t\t\tconst title = readPath(data || {}, target.titleField || 'name')\n\t\t\t\t\tnames[key] = title ? String(title) : id\n\t\t\t\t} catch {\n\t\t\t\t\tnames[key] = id\n\t\t\t\t}\n\t\t\t}))\n\t\t\tthis.names = names\n\t\t},\n\n\t\t/**\n\t\t * The fields a link object is written with, from one side to the other.\n\t\t *\n\t\t * @param {object} side `{ fromId, fromKind, toId, toKind, type, inverse, group, values }`.\n\t\t * @return {object}\n\t\t */\n\t\tlinkBody(side) {\n\t\t\tconst c = this.content\n\t\t\tconst body = { ...(c.defaults || {}), ...(side.values || {}), [c.from]: side.fromId, [c.to]: side.toId }\n\t\t\tconst put = (field, value) => {\n\t\t\t\tif (field && value !== undefined && value !== null && value !== '') {\n\t\t\t\t\tbody[field] = value\n\t\t\t\t}\n\t\t\t}\n\t\t\tput(c.fromType, side.fromKind)\n\t\t\tput(c.toType, side.toKind)\n\t\t\tput(c.typeField, side.type)\n\t\t\tput(c.inverseField, side.inverse)\n\t\t\tput(c.groupField, side.group)\n\t\t\treturn body\n\t\t},\n\n\t\t/**\n\t\t * Write a new link (and with `pair` its inverse), then read the list again.\n\t\t *\n\t\t * @param {{target: {id: string, type?: string}, type: string, values?: object}} pick What the dialog chose.\n\t\t * @return {Promise<{ok: boolean, message?: string}>}\n\t\t * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n\t\t */\n\t\tasync createLink(pick) {\n\t\t\tconst c = this.content\n\t\t\tif (!this.canAdd || !pick || !pick.target || !pick.target.id) {\n\t\t\t\treturn { ok: false, message: this.tr('This link cannot be saved here.') }\n\t\t\t}\n\t\t\tconst exists = this.links.some((link) => String(readPath(link, c.to)) === String(pick.target.id)\n\t\t\t\t&& (!c.typeField || String(readPath(link, c.typeField)) === String(pick.type)))\n\t\t\tif (exists) {\n\t\t\t\treturn { ok: false, message: this.tr(c.duplicateText || 'This link already exists.') }\n\t\t\t}\n\t\t\tconst type = this.types.find((candidate) => String(candidate.value) === String(pick.type))\n\t\t\tconst inverse = type && type.inverse !== undefined ? type.inverse : pick.type\n\t\t\tconst group = type ? type.group : undefined\n\t\t\tthis.busy = true\n\t\t\ttry {\n\t\t\t\tconst axios = await this.http()\n\t\t\t\tconst url = prefixUrl(objectsUrl(c.register, c.schema))\n\t\t\t\tawait axios.post(url, this.linkBody({\n\t\t\t\t\tfromId: this.recordId,\n\t\t\t\t\tfromKind: c.selfType,\n\t\t\t\t\ttoId: pick.target.id,\n\t\t\t\t\ttoKind: pick.target.type,\n\t\t\t\t\ttype: pick.type,\n\t\t\t\t\tinverse,\n\t\t\t\t\tgroup,\n\t\t\t\t\tvalues: pick.values,\n\t\t\t\t}))\n\t\t\t\tif (c.pair) {\n\t\t\t\t\tawait axios.post(url, this.linkBody({\n\t\t\t\t\t\tfromId: pick.target.id,\n\t\t\t\t\t\tfromKind: pick.target.type,\n\t\t\t\t\t\ttoId: this.recordId,\n\t\t\t\t\t\ttoKind: c.selfType,\n\t\t\t\t\t\ttype: inverse,\n\t\t\t\t\t\tinverse: pick.type,\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tvalues: pick.values,\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t\tawait this.load()\n\t\t\t\treturn { ok: true }\n\t\t\t} catch (e) {\n\t\t\t\treturn { ok: false, message: serverErrorMessage(e) }\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete a link (and with `pair` the inverse from the other record), then read the list again.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-a-records-links-to-other-records-are-listed-added-and-removed\n\t\t */\n\t\tasync removeLink(row) {\n\t\t\tconst c = this.content\n\t\t\tif (!this.canRemove || !row) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.notice = ''\n\t\t\ttry {\n\t\t\t\tconst axios = await this.http()\n\t\t\t\tawait axios.delete(prefixUrl(objectsUrl(c.register, c.schema, row.id)))\n\t\t\t\tif (c.pair && row.targetId) {\n\t\t\t\t\tconst type = c.typeField ? readPath(row.link, c.typeField) : undefined\n\t\t\t\t\tconst inverse = c.inverseField ? readPath(row.link, c.inverseField) : undefined\n\t\t\t\t\tconst known = this.types.find((candidate) => String(candidate.value) === String(type))\n\t\t\t\t\tconst inverseType = inverse ?? (known && known.inverse !== undefined ? known.inverse : undefined)\n\t\t\t\t\tconst { data } = await axios.get(prefixUrl(objectsUrl(c.register, c.schema)), {\n\t\t\t\t\t\tparams: { [c.from]: row.targetId, [c.to]: this.recordId, _limit: 10 },\n\t\t\t\t\t})\n\t\t\t\t\tconst back = (Array.isArray(data?.results) ? data.results : [])\n\t\t\t\t\t\t.filter((link) => inverseType === undefined || !c.typeField || String(readPath(link, c.typeField)) === String(inverseType))\n\t\t\t\t\tfor (const link of back) {\n\t\t\t\t\t\tawait axios.delete(prefixUrl(objectsUrl(c.register, c.schema, link.id ?? link.uuid)))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tthis.notice = serverErrorMessage(e)\n\t\t\t\treturn\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t\tawait this.load()\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-object-links-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tfont-size: 14px;\n}\n\n.cn-object-links-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-object-links-widget__row {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tmin-height: 20px;\n}\n\n.cn-object-links-widget__text {\n\tmin-width: 0;\n\toverflow-wrap: anywhere;\n}\n\n.cn-object-links-widget__empty {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-object-links-widget__notice {\n\tmargin: 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-object-links-widget__footer {\n\tdisplay: flex;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_Fragment","_renderList","_createElementVNode","_createBlock","_createTextVNode","_createVNode"],"mappings":";;;AAWK,EAAA,KAAA,EAAA,wBAAA;AAAA,EAAA,aAAA,EAAA,wBAAA;;;;AACiB,EAAA,KAAA,EAAA,+BAAA;AAAA,EAAA,aAAA,EAAA,uBAAA;;;;AAGT,EAAA,KAAK,EAAC,8BAA8B;;;AAMxC,MAAA,UAAA,GAAA,EAAA,KAAM,EAAC,8BAA8B,GAAA;;;AACpC,EAAA,KAAA,EAAA,+BAAA;;;;AAIQ,EAAA,KAAE,EAAA,gCAAA;;;;;AAmBjB,EAAA,IAAI,EAAC,OAAO;AACZ,EAAA,aAAQ,EAAA,wBAAA;;;;AAImB,EAAA,KAAA,EAAA,gCAAA;;;;;;;;;;;AAvC3B,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;MACS,KAAO,CAAA,OAAA,IAAG,QAAA,CAAA,IAAA,CAAA,MAAA,KAAA,CAAA;sBAAlBA,kBAEE,CAA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