@conduction/nextcloud-vue 2.108.0 → 2.109.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.
Files changed (155) hide show
  1. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js +10 -0
  2. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js.map +1 -0
  3. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js +305 -0
  4. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js.map +1 -0
  5. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js +38 -0
  6. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js.map +1 -0
  7. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js +10 -0
  8. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js.map +1 -0
  9. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js +398 -0
  10. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js.map +1 -0
  11. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js +155 -0
  12. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js.map +1 -0
  13. package/dist/esm/components/CnDecisionListWidget/CnDecisionListWidget.vue.js +9 -0
  14. package/dist/esm/components/CnDecisionListWidget/CnDecisionListWidget.vue.js.map +1 -0
  15. package/dist/esm/components/CnDecisionListWidget/CnDecisionListWidget.vue2.js +281 -0
  16. package/dist/esm/components/CnDecisionListWidget/CnDecisionListWidget.vue2.js.map +1 -0
  17. package/dist/esm/components/CnDecisionListWidget/CnDecisionListWidget.vue3.js +137 -0
  18. package/dist/esm/components/CnDecisionListWidget/CnDecisionListWidget.vue3.js.map +1 -0
  19. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue.js +9 -0
  20. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue.js.map +1 -0
  21. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js +225 -0
  22. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js.map +1 -0
  23. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js +110 -0
  24. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js.map +1 -0
  25. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  26. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +19 -3
  27. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  28. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  29. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +30 -0
  30. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  31. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +513 -481
  32. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  33. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue.js +9 -0
  34. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue.js.map +1 -0
  35. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue2.js +181 -0
  36. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue2.js.map +1 -0
  37. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue3.js +50 -0
  38. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue3.js.map +1 -0
  39. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
  40. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +102 -1
  41. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  42. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js +6 -6
  43. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  44. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue.js +9 -0
  45. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue.js.map +1 -0
  46. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js +190 -0
  47. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js.map +1 -0
  48. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js +91 -0
  49. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js.map +1 -0
  50. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue.js +9 -0
  51. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue.js.map +1 -0
  52. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js +64 -0
  53. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js.map +1 -0
  54. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js +49 -0
  55. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js.map +1 -0
  56. package/dist/esm/components/CnRedactionEditor/CnRedactionEditor.vue.js +9 -0
  57. package/dist/esm/components/CnRedactionEditor/CnRedactionEditor.vue.js.map +1 -0
  58. package/dist/esm/components/CnRedactionEditor/CnRedactionEditor.vue2.js +382 -0
  59. package/dist/esm/components/CnRedactionEditor/CnRedactionEditor.vue2.js.map +1 -0
  60. package/dist/esm/components/CnRedactionEditor/CnRedactionEditor.vue3.js +285 -0
  61. package/dist/esm/components/CnRedactionEditor/CnRedactionEditor.vue3.js.map +1 -0
  62. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue.js +9 -0
  63. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue.js.map +1 -0
  64. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue2.js +277 -0
  65. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue2.js.map +1 -0
  66. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue3.js +183 -0
  67. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue3.js.map +1 -0
  68. package/dist/esm/components/CnWidgetGrid/builtInWidgets.js +16 -14
  69. package/dist/esm/components/CnWidgetGrid/builtInWidgets.js.map +1 -1
  70. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +53 -22
  71. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  72. package/dist/esm/components/CnWorkQueue/CnWorkQueue.vue.js +9 -0
  73. package/dist/esm/components/CnWorkQueue/CnWorkQueue.vue.js.map +1 -0
  74. package/dist/esm/components/CnWorkQueue/CnWorkQueue.vue2.js +246 -0
  75. package/dist/esm/components/CnWorkQueue/CnWorkQueue.vue2.js.map +1 -0
  76. package/dist/esm/components/CnWorkQueue/CnWorkQueue.vue3.js +197 -0
  77. package/dist/esm/components/CnWorkQueue/CnWorkQueue.vue3.js.map +1 -0
  78. package/dist/esm/index.js +12 -0
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/esm/l10n/en.json.js +106 -1
  81. package/dist/esm/l10n/en.json.js.map +1 -1
  82. package/dist/esm/l10n/nl.json.js +105 -1
  83. package/dist/esm/l10n/nl.json.js.map +1 -1
  84. package/dist/esm/library-style.js +1 -1
  85. package/dist/esm/nextcloud-vue.css +495 -61
  86. package/dist/esm/utils/actionsDispatcher.js +6 -1
  87. package/dist/esm/utils/actionsDispatcher.js.map +1 -1
  88. package/dist/esm/utils/builtInModals.js +3 -1
  89. package/dist/esm/utils/builtInModals.js.map +1 -1
  90. package/dist/esm/utils/duplicateWarning.js +62 -0
  91. package/dist/esm/utils/duplicateWarning.js.map +1 -0
  92. package/dist/esm/utils/errors.js +4 -0
  93. package/dist/esm/utils/errors.js.map +1 -1
  94. package/dist/esm/utils/libraryWidgetKeys.js +4 -0
  95. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  96. package/dist/esm/utils/openDuplicateWarning.js +39 -0
  97. package/dist/esm/utils/openDuplicateWarning.js.map +1 -0
  98. package/dist/esm/utils/optionsFrom.js +69 -2
  99. package/dist/esm/utils/optionsFrom.js.map +1 -1
  100. package/dist/esm/utils/planTree.js +57 -0
  101. package/dist/esm/utils/planTree.js.map +1 -0
  102. package/dist/esm/utils/redactionSegments.js +53 -0
  103. package/dist/esm/utils/redactionSegments.js.map +1 -0
  104. package/dist/esm/utils/registerNcDashboardWidgets.js +61 -0
  105. package/dist/esm/utils/registerNcDashboardWidgets.js.map +1 -0
  106. package/dist/esm/utils/searchRefusal.js +62 -0
  107. package/dist/esm/utils/searchRefusal.js.map +1 -0
  108. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  109. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  110. package/dist/nextcloud-vue.cjs.js +17409 -12832
  111. package/dist/nextcloud-vue.cjs.js.map +2 -2
  112. package/dist/nextcloud-vue.css +495 -61
  113. package/l10n/en.json +106 -1
  114. package/l10n/nl.json +105 -1
  115. package/package.json +1 -1
  116. package/src/components/CnAddressSearch/CnAddressSearch.vue +343 -0
  117. package/src/components/CnAddressSearch/index.js +12 -0
  118. package/src/components/CnAssignDialog/CnAssignDialog.vue +525 -0
  119. package/src/components/CnAssignDialog/index.js +12 -0
  120. package/src/components/CnDecisionListWidget/CnDecisionListWidget.vue +388 -0
  121. package/src/components/CnDecisionListWidget/index.js +12 -0
  122. package/src/components/CnDuplicateWarning/CnDuplicateWarning.vue +318 -0
  123. package/src/components/CnDuplicateWarning/index.js +12 -0
  124. package/src/components/CnFormDialog/CnFormDialog.vue +19 -3
  125. package/src/components/CnIndexPage/CnIndexPage.vue +52 -0
  126. package/src/components/CnNcDashboardList/CnNcDashboardList.vue +218 -0
  127. package/src/components/CnNcDashboardList/index.js +12 -0
  128. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +107 -6
  129. package/src/components/CnPlanWidget/CnPlanWidget.vue +246 -0
  130. package/src/components/CnPlanWidget/CnPlanWidgetRow.vue +117 -0
  131. package/src/components/CnPlanWidget/index.js +12 -0
  132. package/src/components/CnRedactionEditor/CnRedactionEditor.vue +655 -0
  133. package/src/components/CnRedactionEditor/index.js +13 -0
  134. package/src/components/CnRetentionWidget/CnRetentionWidget.vue +413 -0
  135. package/src/components/CnRetentionWidget/index.js +12 -0
  136. package/src/components/CnWidgetGrid/builtInWidgets.js +2 -0
  137. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +31 -0
  138. package/src/components/CnWorkQueue/CnWorkQueue.vue +456 -0
  139. package/src/components/CnWorkQueue/index.js +12 -0
  140. package/src/components/index.js +9 -0
  141. package/src/css/index-page.css +24 -0
  142. package/src/index.js +12 -0
  143. package/src/schemas/app-manifest-v2.schema.json +119 -3
  144. package/src/utils/actionsDispatcher.js +6 -1
  145. package/src/utils/builtInModals.js +3 -1
  146. package/src/utils/duplicateWarning.js +59 -0
  147. package/src/utils/errors.js +4 -0
  148. package/src/utils/libraryWidgetKeys.js +4 -0
  149. package/src/utils/openDuplicateWarning.js +35 -0
  150. package/src/utils/optionsFrom.js +68 -1
  151. package/src/utils/planTree.js +54 -0
  152. package/src/utils/redactionSegments.js +50 -0
  153. package/src/utils/registerNcDashboardWidgets.js +57 -0
  154. package/src/utils/searchRefusal.js +59 -0
  155. package/src/utils/validateManifestV2.compiled.js +3 -3
@@ -0,0 +1,398 @@
1
+ import axios__default from '@nextcloud/axios';
2
+ import { emit } from '@nextcloud/event-bus';
3
+ import { translate } from '@nextcloud/l10n';
4
+ import { generateUrl } from '@nextcloud/router';
5
+ import { NcButton, NcCheckboxRadioSwitch, NcTextArea } from '@nextcloud/vue';
6
+ import { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js';
7
+ import { fillTemplate } from '../../utils/fillTemplate.js';
8
+ import { readPath } from '../../utils/readPath.js';
9
+ import { searchNextcloudGroups, searchNextcloudUsers } from '../../utils/userAutocomplete.js';
10
+ import __sfc_main from '../CnDialog/CnDialog.vue.js';
11
+ import __sfc_main$1 from '../CnIcon/CnIcon.vue.js';
12
+ import __sfc_main$2 from '../CnSearchSelect/CnSearchSelect.vue.js';
13
+
14
+ /** The page refresh channel the built-in widgets listen on. */
15
+ const PAGE_REFRESH = 'cn:page:refresh';
16
+
17
+ /** How long typing rests before a search runs, in ms. */
18
+ const SEARCH_DELAY = 250;
19
+
20
+ /** Gives each dialog's fields their own ids. */
21
+ let fieldSeq = 0;
22
+
23
+ /**
24
+ * The found rows, with what was typed offered as an assignee of its own when
25
+ * no row carries that id or name: where sharing is restricted the search
26
+ * answers nothing, and an endpoint may still take the name.
27
+ *
28
+ * @param {Array<object>} found The rows found.
29
+ * @param {string} typed What was typed.
30
+ * @param {string} label The typed row's label.
31
+ * @return {Array<object>} The rows.
32
+ */
33
+ function withTypedAssignee(found, typed, label) {
34
+ const lower = typed.toLowerCase();
35
+ if (typed === '' || found.some((row) => String(row.id) === typed || String(row.label).toLowerCase() === lower)) {
36
+ return found
37
+ }
38
+ return [...found, { id: typed, label, icon: 'AccountGroupOutline', kind: 'typed' }]
39
+ }
40
+
41
+ /**
42
+ * CnAssignDialog — hand a record to another user or team, with a note and
43
+ * optional switches, configured from the manifest (an `open-modal` action's
44
+ * props). dossiq's case handover (board DqOverdragen: new team, why it moves,
45
+ * "this is a doorzending (Awb 2:3)") is the first; pipelinq tickets and bulk
46
+ * reassignment use the same dialog.
47
+ *
48
+ * `config`:
49
+ * - `title`, `subtitle`, `doneText`: texts, through the host translate;
50
+ * `eyebrow` a template filled from the record.
51
+ * - `source`: an endpointSource to read the record from, else `object`.
52
+ * - `assignee`: `{ kinds?, label?, placeholder?, hint?, currentPath?,
53
+ * currentHint?, currentAs?, allowTyped?, field?, kindField? }`. `kinds` is `["group"]`
54
+ * (default), `["user"]` or both; `currentPath` reads who has it now from the
55
+ * record and `currentHint` ("Now with {current}.", the placeholder named
56
+ * by `currentAs`) says so, in place of `hint`; `allowTyped`
57
+ * offers what was typed as a choice; the id is sent as `field` (default
58
+ * `assignee`) and its kind as `kindField` when set.
59
+ * - `note`: `{ label?, hint?, required?, field? }`, required by default and
60
+ * sent as `field` (default `note`); `false` drops it.
61
+ * - `toggles`: `[{ field, label, note? }]`: switches that start off and are
62
+ * sent as booleans.
63
+ * - `confirm`: `{ label?, icon?, request?: { method?, url, body? }, action? }`.
64
+ * `request` sends the choice itself (`body` templates filled from the
65
+ * record); `action` dispatches a manifest action with the choice as its
66
+ * last argument.
67
+ *
68
+ * Tokens (`@objectId`, `@object.<field>`) resolve in every url. A refusal is
69
+ * shown in the server's own words and the dialog stays open.
70
+ */
71
+ var script = {
72
+ name: 'CnAssignDialog',
73
+
74
+ components: { CnDialog: __sfc_main, CnIcon: __sfc_main$1, CnSearchSelect: __sfc_main$2, NcButton, NcCheckboxRadioSwitch, NcTextArea },
75
+
76
+ inject: {
77
+ /** The host app's translate (CnAppRoot `cnTranslate`). */
78
+ cnTranslate: { default: () => (key) => key },
79
+ /** The page's pre-bound action dispatcher (CnPageRenderer), for `confirm.action`. */
80
+ cnDispatchAction: { default: null },
81
+ },
82
+
83
+ props: {
84
+ /**
85
+ * The dialog's configuration (see the component docs).
86
+ *
87
+ * @type {object}
88
+ */
89
+ config: {
90
+ type: Object,
91
+ default: () => ({}),
92
+ },
93
+
94
+ /** The record's id, for the `@objectId` token. */
95
+ objectId: {
96
+ type: [String, Number],
97
+ default: '',
98
+ },
99
+
100
+ /**
101
+ * The record, when the host has it.
102
+ *
103
+ * @type {object|null}
104
+ */
105
+ object: {
106
+ type: Object,
107
+ default: null,
108
+ },
109
+ },
110
+
111
+ emits: ['close', 'done'],
112
+
113
+ data() {
114
+ const seq = ++fieldSeq;
115
+ const flags = {};
116
+ for (const toggle of Array.isArray(this.config.toggles) ? this.config.toggles : []) {
117
+ if (toggle && toggle.field) {
118
+ flags[toggle.field] = false;
119
+ }
120
+ }
121
+ return {
122
+ record: this.object,
123
+ options: [],
124
+ picked: null,
125
+ searching: false,
126
+ timer: null,
127
+ searchSeq: 0,
128
+ note: '',
129
+ flags,
130
+ busy: false,
131
+ refusal: '',
132
+ done: false,
133
+ assigneeId: `cn-assign-dialog-assignee-${seq}`,
134
+ noteId: `cn-assign-dialog-note-${seq}`,
135
+ }
136
+ },
137
+
138
+ computed: {
139
+ /** @return {object} The token context. */
140
+ tokenCtx() {
141
+ return { objectId: this.recordId, object: this.record || {} }
142
+ },
143
+
144
+ /**
145
+ * The record's id: `objectId`, or the route's `id` when the prop is
146
+ * empty or a token the opener could not resolve.
147
+ *
148
+ * @return {string|number}
149
+ */
150
+ recordId() {
151
+ const given = this.objectId;
152
+ if (given !== '' && given !== null && given !== undefined && !String(given).startsWith('@')) {
153
+ return given
154
+ }
155
+ return (this.$route && this.$route.params && this.$route.params.id) || ''
156
+ },
157
+
158
+ /** @return {object} The assignee config. */
159
+ assigneeConfig() {
160
+ return this.config.assignee && typeof this.config.assignee === 'object' ? this.config.assignee : {}
161
+ },
162
+
163
+ /** @return {object} The note config. */
164
+ noteConfig() {
165
+ return this.config.note && typeof this.config.note === 'object' ? this.config.note : {}
166
+ },
167
+
168
+ /** @return {object} The confirm config. */
169
+ confirmConfig() {
170
+ return this.config.confirm && typeof this.config.confirm === 'object' ? this.config.confirm : {}
171
+ },
172
+
173
+ /** @return {Array<object>} The switches with a field. */
174
+ toggles() {
175
+ return (Array.isArray(this.config.toggles) ? this.config.toggles : []).filter((toggle) => toggle && toggle.field)
176
+ },
177
+
178
+ /** @return {string[]} The kinds searched: `group`, `user`. */
179
+ kinds() {
180
+ const kinds = Array.isArray(this.assigneeConfig.kinds) ? this.assigneeConfig.kinds.filter((k) => k === 'group' || k === 'user') : [];
181
+ return kinds.length ? kinds : ['group']
182
+ },
183
+
184
+ /** @return {string} The assignee field's label. */
185
+ assigneeLabel() {
186
+ if (this.assigneeConfig.label) {
187
+ return this.text(this.assigneeConfig.label)
188
+ }
189
+ return this.kinds.length === 1 && this.kinds[0] === 'user' ? translate('nextcloud-vue', 'New handler') : translate('nextcloud-vue', 'New team')
190
+ },
191
+
192
+ /** @return {string} Who has the record now, read from it. */
193
+ current() {
194
+ const path = this.assigneeConfig.currentPath;
195
+ const value = path && this.record ? readPath(this.record, path) : '';
196
+ return value === undefined || value === null ? '' : String(value)
197
+ },
198
+
199
+ /**
200
+ * The hint under the assignee field: who has it now, else the configured hint.
201
+ *
202
+ * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog
203
+ * @return {string}
204
+ */
205
+ assigneeHint() {
206
+ const name = this.assigneeConfig.currentAs || 'current';
207
+ const now = this.current && this.assigneeConfig.currentHint ? fillTemplate(this.cnTranslate(this.assigneeConfig.currentHint), { [name]: this.current }) : '';
208
+ return now || this.text(this.assigneeConfig.hint)
209
+ },
210
+
211
+ /** @return {Array<object>} The rows, keeping the picked one listed. */
212
+ shownOptions() {
213
+ if (this.picked && !this.options.some((o) => String(o.id) === String(this.picked.id))) {
214
+ return [this.picked, ...this.options]
215
+ }
216
+ return this.options
217
+ },
218
+
219
+ /** @return {boolean} Whether a note is asked and needed. */
220
+ noteNeeded() {
221
+ return this.config.note !== false && this.noteConfig.required !== false
222
+ },
223
+
224
+ /** @return {string} The note field's label. */
225
+ noteLabel() {
226
+ return this.text(this.noteConfig.label) || translate('nextcloud-vue', 'Why it is moving')
227
+ },
228
+
229
+ /**
230
+ * Whether the assignment may run: an assignee, a note when needed, nothing in flight.
231
+ *
232
+ * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog
233
+ * @return {boolean}
234
+ */
235
+ canConfirm() {
236
+ return !this.busy && this.picked !== null && (!this.noteNeeded || this.note.trim() !== '')
237
+ },
238
+ },
239
+
240
+ async mounted() {
241
+ const source = this.config.source;
242
+ if (source && source.url) {
243
+ try {
244
+ const data = await fetchEndpointSource(source, this.tokenCtx, { fresh: true });
245
+ this.record = data && typeof data === 'object' ? data : this.record;
246
+ } catch {
247
+ // The hint stays without the current assignee; the dialog still works.
248
+ }
249
+ }
250
+ },
251
+
252
+ beforeUnmount() {
253
+ clearTimeout(this.timer);
254
+ },
255
+
256
+ methods: {
257
+ t: translate,
258
+
259
+ /**
260
+ * A config text through the host translate, '' for anything else.
261
+ *
262
+ * @param {unknown} value The text.
263
+ * @return {string}
264
+ */
265
+ text(value) {
266
+ return typeof value === 'string' && value !== '' ? this.cnTranslate(value) : ''
267
+ },
268
+
269
+ /**
270
+ * A template filled from the record, translated first.
271
+ *
272
+ * @param {unknown} template The template.
273
+ * @return {string}
274
+ */
275
+ fill(template) {
276
+ if (typeof template !== 'string' || template === '') {
277
+ return ''
278
+ }
279
+ return fillTemplate(this.cnTranslate(template), this.record || {}).trim()
280
+ },
281
+
282
+ /**
283
+ * Search after typing rests.
284
+ *
285
+ * @param {string} query What was typed.
286
+ */
287
+ onSearch(query) {
288
+ clearTimeout(this.timer);
289
+ const typed = String(query ?? '').trim();
290
+ if (typed === '') {
291
+ this.options = [];
292
+ return
293
+ }
294
+ this.timer = setTimeout(() => this.search(typed), SEARCH_DELAY);
295
+ },
296
+
297
+ /**
298
+ * Search the configured kinds; offer what was typed when allowed.
299
+ *
300
+ * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog
301
+ * @param {string} typed What was typed.
302
+ * @return {Promise<void>}
303
+ */
304
+ async search(typed) {
305
+ const seq = ++this.searchSeq;
306
+ this.searching = true;
307
+ const [groups, users] = await Promise.all([
308
+ this.kinds.includes('group') ? searchNextcloudGroups(typed, { limit: 20 }) : [],
309
+ this.kinds.includes('user') ? searchNextcloudUsers(typed, { limit: 20 }) : [],
310
+ ]);
311
+ if (seq !== this.searchSeq) {
312
+ return
313
+ }
314
+ const found = [
315
+ ...groups.map((g) => ({ id: g.id, label: g.label, secondary: g.subline || '', icon: 'AccountGroupOutline', kind: 'group' })),
316
+ ...users.map((u) => ({ id: u.id, label: u.label, secondary: u.subline || '', avatar: true, kind: 'user' })),
317
+ ];
318
+ this.options = this.assigneeConfig.allowTyped ? withTypedAssignee(found, typed, translate('nextcloud-vue', 'Use "{name}"', { name: typed })) : found;
319
+ this.searching = false;
320
+ },
321
+
322
+ /**
323
+ * Take the picked row.
324
+ *
325
+ * @param {string|null} id The picked id.
326
+ */
327
+ onPick(id) {
328
+ this.picked = id === null ? null : (this.shownOptions.find((o) => String(o.id) === String(id)) || null);
329
+ },
330
+
331
+ /**
332
+ * The choice as sent: assignee, its kind, the note and the switches.
333
+ *
334
+ * @return {object}
335
+ */
336
+ choice() {
337
+ const out = { [this.assigneeConfig.field || 'assignee']: String(this.picked.id) };
338
+ if (this.assigneeConfig.kindField) {
339
+ out[this.assigneeConfig.kindField] = this.picked.kind === 'typed' ? this.kinds[0] : this.picked.kind;
340
+ }
341
+ if (this.config.note !== false) {
342
+ out[this.noteConfig.field || 'note'] = this.note.trim();
343
+ }
344
+ return { ...out, ...this.flags }
345
+ },
346
+
347
+ /**
348
+ * Assign once: send `confirm.request`, or dispatch `confirm.action`,
349
+ * then show the done text and refresh the page.
350
+ *
351
+ * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog
352
+ * @return {Promise<void>}
353
+ */
354
+ async confirm() {
355
+ if (!this.canConfirm) {
356
+ return
357
+ }
358
+ this.busy = true;
359
+ this.refusal = '';
360
+ const choice = this.choice();
361
+ try {
362
+ const request = this.confirmConfig.request;
363
+ if (request && request.url) {
364
+ const url = interpolateUrlTokens(request.url, this.tokenCtx);
365
+ const body = {};
366
+ for (const [key, value] of Object.entries(request.body || {})) {
367
+ body[key] = typeof value === 'string' ? fillTemplate(value, this.record || {}) : value;
368
+ }
369
+ const method = String(request.method || 'POST').toLowerCase();
370
+ await axios__default[['post', 'put', 'patch'].includes(method) ? method : 'post'](/^https?:\/\//i.test(url) ? url : generateUrl(url), { ...body, ...choice });
371
+ } else if (this.confirmConfig.action && typeof this.cnDispatchAction === 'function') {
372
+ await this.cnDispatchAction({ ...this.confirmConfig.action, args: [...(this.confirmConfig.action.args || []), choice] });
373
+ }
374
+ this.done = true;
375
+ emit(PAGE_REFRESH, {});
376
+ /** @event done The assignment ran. Payload: the choice as sent. */
377
+ this.$emit('done', choice);
378
+ } catch (failure) {
379
+ const data = failure && failure.response && failure.response.data;
380
+ this.refusal = String((data && (data.message || data.error)) || translate('nextcloud-vue', 'It was not handed over.'));
381
+ } finally {
382
+ this.busy = false;
383
+ }
384
+ },
385
+
386
+ /** Close the dialog, unless the assignment is running. */
387
+ close() {
388
+ if (this.busy) {
389
+ return
390
+ }
391
+ /** @event close The dialog was closed. */
392
+ this.$emit('close');
393
+ },
394
+ },
395
+ };
396
+
397
+ export { script as default, withTypedAssignee };
398
+ //# sourceMappingURL=CnAssignDialog.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CnAssignDialog.vue2.js","sources":["../../../../src/components/CnAssignDialog/CnAssignDialog.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<CnDialog\n\t\t:name=\"text(config.title) || t('nextcloud-vue', 'Assign')\"\n\t\t:eyebrow=\"fill(config.eyebrow)\"\n\t\t:subtitle=\"text(config.subtitle)\"\n\t\twidth=\"form\"\n\t\t:noClose=\"busy\"\n\t\tdata-testid=\"cn-assign-dialog\"\n\t\t@closing=\"close\">\n\t\t<div v-if=\"!done\" class=\"cn-assign-dialog\">\n\t\t\t<div class=\"cn-assign-dialog__field\">\n\t\t\t\t<CnSearchSelect\n\t\t\t\t\t:modelValue=\"picked ? picked.id : null\"\n\t\t\t\t\t:inputId=\"assigneeId\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\t:labelOutside=\"true\"\n\t\t\t\t\t:options=\"shownOptions\"\n\t\t\t\t\t:loading=\"searching\"\n\t\t\t\t\t:filterable=\"false\"\n\t\t\t\t\t:placeholder=\"text(assigneeConfig.placeholder)\"\n\t\t\t\t\tdata-testid=\"cn-assign-dialog-assignee\"\n\t\t\t\t\t@search=\"onSearch\"\n\t\t\t\t\t@update:modelValue=\"onPick\" />\n\t\t\t\t<span v-if=\"assigneeHint\" class=\"cn-assign-dialog__hint\">{{ assigneeHint }}</span>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"config.note !== false\" class=\"cn-assign-dialog__field\">\n\t\t\t\t<NcTextArea\n\t\t\t\t\t:id=\"noteId\"\n\t\t\t\t\tv-model=\"note\"\n\t\t\t\t\t:label=\"noteLabel\"\n\t\t\t\t\t:labelOutside=\"false\"\n\t\t\t\t\tresize=\"vertical\"\n\t\t\t\t\tdata-testid=\"cn-assign-dialog-note\" />\n\t\t\t\t<span v-if=\"noteConfig.hint\" class=\"cn-assign-dialog__hint\">{{ text(noteConfig.hint) }}</span>\n\t\t\t</div>\n\n\t\t\t<div v-for=\"toggle in toggles\"\n\t\t\t\t:key=\"toggle.field\"\n\t\t\t\tclass=\"cn-assign-dialog__toggle\"\n\t\t\t\t:class=\"{ 'cn-assign-dialog__toggle--on': flags[toggle.field] }\"\n\t\t\t\t:data-testid=\"`cn-assign-dialog-toggle-${toggle.field}`\">\n\t\t\t\t<NcCheckboxRadioSwitch :modelValue=\"flags[toggle.field] === true\" @update:modelValue=\"flags[toggle.field] = $event\">\n\t\t\t\t\t<span class=\"cn-assign-dialog__toggle-title\">{{ text(toggle.label) }}</span>\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t<span v-if=\"toggle.note\" class=\"cn-assign-dialog__hint cn-assign-dialog__toggle-note\">{{ text(toggle.note) }}</span>\n\t\t\t</div>\n\n\t\t\t<p v-if=\"refusal\"\n\t\t\t\tclass=\"cn-assign-dialog__error\"\n\t\t\t\trole=\"alert\"\n\t\t\t\tdata-testid=\"cn-assign-dialog-refusal\">\n\t\t\t\t{{ refusal }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<p v-else role=\"status\" data-testid=\"cn-assign-dialog-done\">\n\t\t\t{{ text(config.doneText) || t('nextcloud-vue', 'Done') }}\n\t\t</p>\n\n\t\t<template #actions>\n\t\t\t<NcButton :disabled=\"busy\" data-testid=\"cn-assign-dialog-cancel\" @click=\"close\">\n\t\t\t\t{{ done ? t('nextcloud-vue', 'Close') : t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"!done\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canConfirm\"\n\t\t\t\tdata-testid=\"cn-assign-dialog-confirm\"\n\t\t\t\t@click=\"confirm\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CnIcon :name=\"confirmConfig.icon || 'SwapHorizontal'\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ text(confirmConfig.label) || t('nextcloud-vue', 'Assign') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcCheckboxRadioSwitch, NcTextArea } from '@nextcloud/vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { searchNextcloudGroups, searchNextcloudUsers } from '../../utils/userAutocomplete.js'\nimport { CnDialog } from '../CnDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** The page refresh channel the built-in widgets listen on. */\nconst PAGE_REFRESH = 'cn:page:refresh'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/** Gives each dialog's fields their own ids. */\nlet fieldSeq = 0\n\n/**\n * The found rows, with what was typed offered as an assignee of its own when\n * no row carries that id or name: where sharing is restricted the search\n * answers nothing, and an endpoint may still take the name.\n *\n * @param {Array<object>} found The rows found.\n * @param {string} typed What was typed.\n * @param {string} label The typed row's label.\n * @return {Array<object>} The rows.\n */\nexport function withTypedAssignee(found, typed, label) {\n\tconst lower = typed.toLowerCase()\n\tif (typed === '' || found.some((row) => String(row.id) === typed || String(row.label).toLowerCase() === lower)) {\n\t\treturn found\n\t}\n\treturn [...found, { id: typed, label, icon: 'AccountGroupOutline', kind: 'typed' }]\n}\n\n/**\n * CnAssignDialog — hand a record to another user or team, with a note and\n * optional switches, configured from the manifest (an `open-modal` action's\n * props). dossiq's case handover (board DqOverdragen: new team, why it moves,\n * \"this is a doorzending (Awb 2:3)\") is the first; pipelinq tickets and bulk\n * reassignment use the same dialog.\n *\n * `config`:\n * - `title`, `subtitle`, `doneText`: texts, through the host translate;\n * `eyebrow` a template filled from the record.\n * - `source`: an endpointSource to read the record from, else `object`.\n * - `assignee`: `{ kinds?, label?, placeholder?, hint?, currentPath?,\n * currentHint?, currentAs?, allowTyped?, field?, kindField? }`. `kinds` is `[\"group\"]`\n * (default), `[\"user\"]` or both; `currentPath` reads who has it now from the\n * record and `currentHint` (\"Now with {current}.\", the placeholder named\n * by `currentAs`) says so, in place of `hint`; `allowTyped`\n * offers what was typed as a choice; the id is sent as `field` (default\n * `assignee`) and its kind as `kindField` when set.\n * - `note`: `{ label?, hint?, required?, field? }`, required by default and\n * sent as `field` (default `note`); `false` drops it.\n * - `toggles`: `[{ field, label, note? }]`: switches that start off and are\n * sent as booleans.\n * - `confirm`: `{ label?, icon?, request?: { method?, url, body? }, action? }`.\n * `request` sends the choice itself (`body` templates filled from the\n * record); `action` dispatches a manifest action with the choice as its\n * last argument.\n *\n * Tokens (`@objectId`, `@object.<field>`) resolve in every url. A refusal is\n * shown in the server's own words and the dialog stays open.\n */\nexport default {\n\tname: 'CnAssignDialog',\n\n\tcomponents: { CnDialog, CnIcon, CnSearchSelect, NcButton, NcCheckboxRadioSwitch, NcTextArea },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's pre-bound action dispatcher (CnPageRenderer), for `confirm.action`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The dialog's configuration (see the component docs).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tconfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The record, when the host has it.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['close', 'done'],\n\n\tdata() {\n\t\tconst seq = ++fieldSeq\n\t\tconst flags = {}\n\t\tfor (const toggle of Array.isArray(this.config.toggles) ? this.config.toggles : []) {\n\t\t\tif (toggle && toggle.field) {\n\t\t\t\tflags[toggle.field] = false\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\trecord: this.object,\n\t\t\toptions: [],\n\t\t\tpicked: null,\n\t\t\tsearching: false,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\tnote: '',\n\t\t\tflags,\n\t\t\tbusy: false,\n\t\t\trefusal: '',\n\t\t\tdone: false,\n\t\t\tassigneeId: `cn-assign-dialog-assignee-${seq}`,\n\t\t\tnoteId: `cn-assign-dialog-note-${seq}`,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The token context. */\n\t\ttokenCtx() {\n\t\t\treturn { objectId: this.recordId, object: this.record || {} }\n\t\t},\n\n\t\t/**\n\t\t * The record's id: `objectId`, or the route's `id` when the prop is\n\t\t * empty or a token the opener could not resolve.\n\t\t *\n\t\t * @return {string|number}\n\t\t */\n\t\trecordId() {\n\t\t\tconst given = this.objectId\n\t\t\tif (given !== '' && given !== null && given !== undefined && !String(given).startsWith('@')) {\n\t\t\t\treturn given\n\t\t\t}\n\t\t\treturn (this.$route && this.$route.params && this.$route.params.id) || ''\n\t\t},\n\n\t\t/** @return {object} The assignee config. */\n\t\tassigneeConfig() {\n\t\t\treturn this.config.assignee && typeof this.config.assignee === 'object' ? this.config.assignee : {}\n\t\t},\n\n\t\t/** @return {object} The note config. */\n\t\tnoteConfig() {\n\t\t\treturn this.config.note && typeof this.config.note === 'object' ? this.config.note : {}\n\t\t},\n\n\t\t/** @return {object} The confirm config. */\n\t\tconfirmConfig() {\n\t\t\treturn this.config.confirm && typeof this.config.confirm === 'object' ? this.config.confirm : {}\n\t\t},\n\n\t\t/** @return {Array<object>} The switches with a field. */\n\t\ttoggles() {\n\t\t\treturn (Array.isArray(this.config.toggles) ? this.config.toggles : []).filter((toggle) => toggle && toggle.field)\n\t\t},\n\n\t\t/** @return {string[]} The kinds searched: `group`, `user`. */\n\t\tkinds() {\n\t\t\tconst kinds = Array.isArray(this.assigneeConfig.kinds) ? this.assigneeConfig.kinds.filter((k) => k === 'group' || k === 'user') : []\n\t\t\treturn kinds.length ? kinds : ['group']\n\t\t},\n\n\t\t/** @return {string} The assignee field's label. */\n\t\tassigneeLabel() {\n\t\t\tif (this.assigneeConfig.label) {\n\t\t\t\treturn this.text(this.assigneeConfig.label)\n\t\t\t}\n\t\t\treturn this.kinds.length === 1 && this.kinds[0] === 'user' ? t('nextcloud-vue', 'New handler') : t('nextcloud-vue', 'New team')\n\t\t},\n\n\t\t/** @return {string} Who has the record now, read from it. */\n\t\tcurrent() {\n\t\t\tconst path = this.assigneeConfig.currentPath\n\t\t\tconst value = path && this.record ? readPath(this.record, path) : ''\n\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t},\n\n\t\t/**\n\t\t * The hint under the assignee field: who has it now, else the configured hint.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {string}\n\t\t */\n\t\tassigneeHint() {\n\t\t\tconst name = this.assigneeConfig.currentAs || 'current'\n\t\t\tconst now = this.current && this.assigneeConfig.currentHint ? fillTemplate(this.cnTranslate(this.assigneeConfig.currentHint), { [name]: this.current }) : ''\n\t\t\treturn now || this.text(this.assigneeConfig.hint)\n\t\t},\n\n\t\t/** @return {Array<object>} The rows, keeping the picked one listed. */\n\t\tshownOptions() {\n\t\t\tif (this.picked && !this.options.some((o) => String(o.id) === String(this.picked.id))) {\n\t\t\t\treturn [this.picked, ...this.options]\n\t\t\t}\n\t\t\treturn this.options\n\t\t},\n\n\t\t/** @return {boolean} Whether a note is asked and needed. */\n\t\tnoteNeeded() {\n\t\t\treturn this.config.note !== false && this.noteConfig.required !== false\n\t\t},\n\n\t\t/** @return {string} The note field's label. */\n\t\tnoteLabel() {\n\t\t\treturn this.text(this.noteConfig.label) || t('nextcloud-vue', 'Why it is moving')\n\t\t},\n\n\t\t/**\n\t\t * Whether the assignment may run: an assignee, a note when needed, nothing in flight.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {boolean}\n\t\t */\n\t\tcanConfirm() {\n\t\t\treturn !this.busy && this.picked !== null && (!this.noteNeeded || this.note.trim() !== '')\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tconst source = this.config.source\n\t\tif (source && source.url) {\n\t\t\ttry {\n\t\t\t\tconst data = await fetchEndpointSource(source, this.tokenCtx, { fresh: true })\n\t\t\t\tthis.record = data && typeof data === 'object' ? data : this.record\n\t\t\t} catch {\n\t\t\t\t// The hint stays without the current assignee; the dialog still works.\n\t\t\t}\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.timer)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A config text through the host translate, '' for anything else.\n\t\t *\n\t\t * @param {unknown} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn typeof value === 'string' && value !== '' ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * A template filled from the record, translated first.\n\t\t *\n\t\t * @param {unknown} template The template.\n\t\t * @return {string}\n\t\t */\n\t\tfill(template) {\n\t\t\tif (typeof template !== 'string' || template === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(template), this.record || {}).trim()\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query What was typed.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst typed = String(query ?? '').trim()\n\t\t\tif (typed === '') {\n\t\t\t\tthis.options = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(typed), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search the configured kinds; offer what was typed when allowed.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @param {string} typed What was typed.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(typed) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tconst [groups, users] = await Promise.all([\n\t\t\t\tthis.kinds.includes('group') ? searchNextcloudGroups(typed, { limit: 20 }) : [],\n\t\t\t\tthis.kinds.includes('user') ? searchNextcloudUsers(typed, { limit: 20 }) : [],\n\t\t\t])\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst found = [\n\t\t\t\t...groups.map((g) => ({ id: g.id, label: g.label, secondary: g.subline || '', icon: 'AccountGroupOutline', kind: 'group' })),\n\t\t\t\t...users.map((u) => ({ id: u.id, label: u.label, secondary: u.subline || '', avatar: true, kind: 'user' })),\n\t\t\t]\n\t\t\tthis.options = this.assigneeConfig.allowTyped ? withTypedAssignee(found, typed, t('nextcloud-vue', 'Use \"{name}\"', { name: typed })) : found\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Take the picked row.\n\t\t *\n\t\t * @param {string|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tthis.picked = id === null ? null : (this.shownOptions.find((o) => String(o.id) === String(id)) || null)\n\t\t},\n\n\t\t/**\n\t\t * The choice as sent: assignee, its kind, the note and the switches.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tchoice() {\n\t\t\tconst out = { [this.assigneeConfig.field || 'assignee']: String(this.picked.id) }\n\t\t\tif (this.assigneeConfig.kindField) {\n\t\t\t\tout[this.assigneeConfig.kindField] = this.picked.kind === 'typed' ? this.kinds[0] : this.picked.kind\n\t\t\t}\n\t\t\tif (this.config.note !== false) {\n\t\t\t\tout[this.noteConfig.field || 'note'] = this.note.trim()\n\t\t\t}\n\t\t\treturn { ...out, ...this.flags }\n\t\t},\n\n\t\t/**\n\t\t * Assign once: send `confirm.request`, or dispatch `confirm.action`,\n\t\t * then show the done text and refresh the page.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync confirm() {\n\t\t\tif (!this.canConfirm) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.refusal = ''\n\t\t\tconst choice = this.choice()\n\t\t\ttry {\n\t\t\t\tconst request = this.confirmConfig.request\n\t\t\t\tif (request && request.url) {\n\t\t\t\t\tconst url = interpolateUrlTokens(request.url, this.tokenCtx)\n\t\t\t\t\tconst body = {}\n\t\t\t\t\tfor (const [key, value] of Object.entries(request.body || {})) {\n\t\t\t\t\t\tbody[key] = typeof value === 'string' ? fillTemplate(value, this.record || {}) : value\n\t\t\t\t\t}\n\t\t\t\t\tconst method = String(request.method || 'POST').toLowerCase()\n\t\t\t\t\tawait axios[['post', 'put', 'patch'].includes(method) ? method : 'post'](/^https?:\\/\\//i.test(url) ? url : generateUrl(url), { ...body, ...choice })\n\t\t\t\t} else if (this.confirmConfig.action && typeof this.cnDispatchAction === 'function') {\n\t\t\t\t\tawait this.cnDispatchAction({ ...this.confirmConfig.action, args: [...(this.confirmConfig.action.args || []), choice] })\n\t\t\t\t}\n\t\t\t\tthis.done = true\n\t\t\t\temit(PAGE_REFRESH, {})\n\t\t\t\t/** @event done The assignment ran. Payload: the choice as sent. */\n\t\t\t\tthis.$emit('done', choice)\n\t\t\t} catch (failure) {\n\t\t\t\tconst data = failure && failure.response && failure.response.data\n\t\t\t\tthis.refusal = String((data && (data.message || data.error)) || t('nextcloud-vue', 'It was not handed over.'))\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/** Close the dialog, unless the assignment is running. */\n\t\tclose() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event close The dialog was closed. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-assign-dialog {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 18px;\n}\n\n.cn-assign-dialog__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-assign-dialog__hint {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-assign-dialog__toggle {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tpadding: 12px 14px;\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large, 8px);\n}\n\n.cn-assign-dialog__toggle--on {\n\tborder: 2px solid var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-assign-dialog__toggle-title {\n\tfont-weight: 600;\n}\n\n.cn-assign-dialog__toggle-note {\n\tpadding-inline-start: 44px;\n}\n\n.cn-assign-dialog__error {\n\tmargin: 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["CnDialog","CnIcon","CnSearchSelect","t","axios"],"mappings":";;;;;;;;;;;;;AAgGA;AACA,MAAM,YAAW,GAAI,kBAAgB;;AAErC;AACA,MAAM,YAAa,GAAE,IAAE;;AAEvB;AACA,IAAI,QAAO,GAAI,E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AAO,OAAO,EAAE;IACjB,MAAM,IAAG,GAAI,OAAQ,IAAG,OAAO,CAAC,QAAO,IAAK,OAAO,CAAC,QAAQ,CAAC,KAAG;IAChE,IAAI,CAAC,UAAU,MAAM,CAAC,CAAC,IAAK,KAAI,IAAI,CAAC,OAAQ,IAAG,IAAI,CAAC,KAAK,CAAC,KAAKD,SAAC,CAAC,eAAe,EAAE,yBAAyB,CAAC,EAAA;AAC9G,IAAA,SAAU;AACT,IAAA,IAAI,CAAC,IAAG,GAAI,MAAI;AACjB,IAAA;GACA;;;AAGD,EAAA,KAAK,GAAG;GACP,IAAI,IAAI,CAAC,IAAI,EAAE;IACd,MAAK;AACN,IAAA;AACA;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAA;GAClB;EACD;AACF;;;;"}
@@ -0,0 +1,155 @@
1
+ import { resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, toDisplayString, createCommentVNode, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass } from 'vue';
2
+
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "cn-assign-dialog"
6
+ };
7
+ const _hoisted_2 = { class: "cn-assign-dialog__field" };
8
+ const _hoisted_3 = {
9
+ key: 0,
10
+ class: "cn-assign-dialog__hint"
11
+ };
12
+ const _hoisted_4 = {
13
+ key: 0,
14
+ class: "cn-assign-dialog__field"
15
+ };
16
+ const _hoisted_5 = {
17
+ key: 0,
18
+ class: "cn-assign-dialog__hint"
19
+ };
20
+ const _hoisted_6 = ["data-testid"];
21
+ const _hoisted_7 = { class: "cn-assign-dialog__toggle-title" };
22
+ const _hoisted_8 = {
23
+ key: 0,
24
+ class: "cn-assign-dialog__hint cn-assign-dialog__toggle-note"
25
+ };
26
+ const _hoisted_9 = {
27
+ key: 1,
28
+ class: "cn-assign-dialog__error",
29
+ role: "alert",
30
+ "data-testid": "cn-assign-dialog-refusal"
31
+ };
32
+ const _hoisted_10 = {
33
+ key: 1,
34
+ role: "status",
35
+ "data-testid": "cn-assign-dialog-done"
36
+ };
37
+
38
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
39
+ const _component_CnSearchSelect = resolveComponent("CnSearchSelect");
40
+ const _component_NcTextArea = resolveComponent("NcTextArea");
41
+ const _component_NcCheckboxRadioSwitch = resolveComponent("NcCheckboxRadioSwitch");
42
+ const _component_NcButton = resolveComponent("NcButton");
43
+ const _component_CnIcon = resolveComponent("CnIcon");
44
+ const _component_CnDialog = resolveComponent("CnDialog");
45
+
46
+ return (openBlock(), createBlock(_component_CnDialog, {
47
+ name: $options.text($props.config.title) || $options.t('nextcloud-vue', 'Assign'),
48
+ eyebrow: $options.fill($props.config.eyebrow),
49
+ subtitle: $options.text($props.config.subtitle),
50
+ width: "form",
51
+ noClose: $data.busy,
52
+ "data-testid": "cn-assign-dialog",
53
+ onClosing: $options.close
54
+ }, {
55
+ actions: withCtx(() => [
56
+ createVNode(_component_NcButton, {
57
+ disabled: $data.busy,
58
+ "data-testid": "cn-assign-dialog-cancel",
59
+ onClick: $options.close
60
+ }, {
61
+ default: withCtx(() => [
62
+ createTextVNode(toDisplayString($data.done ? $options.t('nextcloud-vue', 'Close') : $options.t('nextcloud-vue', 'Cancel')), 1 /* TEXT */)
63
+ ]),
64
+ _: 1 /* STABLE */
65
+ }, 8 /* PROPS */, ["disabled", "onClick"]),
66
+ (!$data.done)
67
+ ? (openBlock(), createBlock(_component_NcButton, {
68
+ key: 0,
69
+ variant: "primary",
70
+ disabled: !$options.canConfirm,
71
+ "data-testid": "cn-assign-dialog-confirm",
72
+ onClick: $options.confirm
73
+ }, {
74
+ icon: withCtx(() => [
75
+ createVNode(_component_CnIcon, {
76
+ name: $options.confirmConfig.icon || 'SwapHorizontal',
77
+ size: 20
78
+ }, null, 8 /* PROPS */, ["name"])
79
+ ]),
80
+ default: withCtx(() => [
81
+ createTextVNode(" " + toDisplayString($options.text($options.confirmConfig.label) || $options.t('nextcloud-vue', 'Assign')), 1 /* TEXT */)
82
+ ]),
83
+ _: 1 /* STABLE */
84
+ }, 8 /* PROPS */, ["disabled", "onClick"]))
85
+ : createCommentVNode("v-if", true)
86
+ ]),
87
+ default: withCtx(() => [
88
+ (!$data.done)
89
+ ? (openBlock(), createElementBlock("div", _hoisted_1, [
90
+ createElementVNode("div", _hoisted_2, [
91
+ createVNode(_component_CnSearchSelect, {
92
+ modelValue: $data.picked ? $data.picked.id : null,
93
+ inputId: $data.assigneeId,
94
+ inputLabel: $options.assigneeLabel,
95
+ labelOutside: true,
96
+ options: $options.shownOptions,
97
+ loading: $data.searching,
98
+ filterable: false,
99
+ placeholder: $options.text($options.assigneeConfig.placeholder),
100
+ "data-testid": "cn-assign-dialog-assignee",
101
+ onSearch: $options.onSearch,
102
+ "onUpdate:modelValue": $options.onPick
103
+ }, null, 8 /* PROPS */, ["modelValue", "inputId", "inputLabel", "options", "loading", "placeholder", "onSearch", "onUpdate:modelValue"]),
104
+ ($options.assigneeHint)
105
+ ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString($options.assigneeHint), 1 /* TEXT */))
106
+ : createCommentVNode("v-if", true)
107
+ ]),
108
+ ($props.config.note !== false)
109
+ ? (openBlock(), createElementBlock("div", _hoisted_4, [
110
+ createVNode(_component_NcTextArea, {
111
+ id: $data.noteId,
112
+ modelValue: $data.note,
113
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.note) = $event)),
114
+ label: $options.noteLabel,
115
+ labelOutside: false,
116
+ resize: "vertical",
117
+ "data-testid": "cn-assign-dialog-note"
118
+ }, null, 8 /* PROPS */, ["id", "modelValue", "label"]),
119
+ ($options.noteConfig.hint)
120
+ ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString($options.text($options.noteConfig.hint)), 1 /* TEXT */))
121
+ : createCommentVNode("v-if", true)
122
+ ]))
123
+ : createCommentVNode("v-if", true),
124
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.toggles, (toggle) => {
125
+ return (openBlock(), createElementBlock("div", {
126
+ key: toggle.field,
127
+ class: normalizeClass(["cn-assign-dialog__toggle", { 'cn-assign-dialog__toggle--on': $data.flags[toggle.field] }]),
128
+ "data-testid": `cn-assign-dialog-toggle-${toggle.field}`
129
+ }, [
130
+ createVNode(_component_NcCheckboxRadioSwitch, {
131
+ modelValue: $data.flags[toggle.field] === true,
132
+ "onUpdate:modelValue": $event => ($data.flags[toggle.field] = $event)
133
+ }, {
134
+ default: withCtx(() => [
135
+ createElementVNode("span", _hoisted_7, toDisplayString($options.text(toggle.label)), 1 /* TEXT */)
136
+ ]),
137
+ _: 2 /* DYNAMIC */
138
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "onUpdate:modelValue"]),
139
+ (toggle.note)
140
+ ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString($options.text(toggle.note)), 1 /* TEXT */))
141
+ : createCommentVNode("v-if", true)
142
+ ], 10 /* CLASS, PROPS */, _hoisted_6))
143
+ }), 128 /* KEYED_FRAGMENT */)),
144
+ ($data.refusal)
145
+ ? (openBlock(), createElementBlock("p", _hoisted_9, toDisplayString($data.refusal), 1 /* TEXT */))
146
+ : createCommentVNode("v-if", true)
147
+ ]))
148
+ : (openBlock(), createElementBlock("p", _hoisted_10, toDisplayString($options.text($props.config.doneText) || $options.t('nextcloud-vue', 'Done')), 1 /* TEXT */))
149
+ ]),
150
+ _: 1 /* STABLE */
151
+ }, 8 /* PROPS */, ["name", "eyebrow", "subtitle", "noClose", "onClosing"]))
152
+ }
153
+
154
+ export { render };
155
+ //# sourceMappingURL=CnAssignDialog.vue3.js.map