@conduction/nextcloud-vue 2.56.0-beta.70 → 2.56.0-beta.72
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/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +67 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +93 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +11 -9
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +55 -6
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +40 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue2.js +3 -3
- package/dist/esm/components/CnStorePage/CnStorePage.vue2.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue3.js +5 -5
- package/dist/esm/components/CnStorePage/CnStorePage.vue3.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue2.js +6 -6
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue3.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +62 -59
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +62 -59
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +82 -78
- package/dist/esm/utils/parentCrumb.js +86 -0
- package/dist/esm/utils/parentCrumb.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +923 -586
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +82 -78
- package/l10n/en.json +62 -59
- package/l10n/nl.json +62 -59
- package/package.json +1 -1
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +67 -1
- package/src/components/CnDataMatrix/CnDataMatrix.vue +105 -4
- package/src/components/CnDetailPage/CnDetailPage.vue +55 -6
- package/src/components/CnIndexPage/CnIndexPage.vue +40 -1
- package/src/components/CnStorePage/CnStorePage.vue +8 -8
- package/src/components/CnStorePage/CnStorePublishDialog.vue +7 -7
- package/src/utils/parentCrumb.js +83 -0
|
@@ -54,13 +54,17 @@
|
|
|
54
54
|
type="text"
|
|
55
55
|
class="cn-data-matrix__cell-input"
|
|
56
56
|
:value="cellValue(row, col)"
|
|
57
|
+
:aria-label="inputLabel(row, col)"
|
|
57
58
|
:disabled="readOnly || isCellReadOnly(row, col)"
|
|
58
59
|
@blur="commitEdit(row, col, $event.target.value)"
|
|
59
|
-
@keydown
|
|
60
|
-
@keydown.esc="cancelEdit">
|
|
60
|
+
@keydown="onInputKeydown($event, row, col)">
|
|
61
61
|
<span v-else
|
|
62
62
|
class="cn-data-matrix__cell-value"
|
|
63
|
-
|
|
63
|
+
:tabindex="isCellEditable(row, col) ? 0 : null"
|
|
64
|
+
:role="isCellEditable(row, col) ? 'button' : null"
|
|
65
|
+
:aria-label="isCellEditable(row, col) ? cellLabel(row, col) : null"
|
|
66
|
+
@click="startEdit(row, col)"
|
|
67
|
+
@keydown="onCellKeydown($event, row, col)">
|
|
64
68
|
{{ formatCell(cellValue(row, col), col) }}
|
|
65
69
|
</span>
|
|
66
70
|
</td>
|
|
@@ -114,7 +118,8 @@ function numberIn(raw) {
|
|
|
114
118
|
|
|
115
119
|
/**
|
|
116
120
|
* CnDataMatrix — Inline-edit data grid for matrix-shaped data
|
|
117
|
-
* (rows × columns). Each cell is click-to-edit
|
|
121
|
+
* (rows × columns). Each cell is click-to-edit, and keyboard editable:
|
|
122
|
+
* Tab reaches it, Enter or F2 opens it, Enter commits, Escape cancels. Commits emit
|
|
118
123
|
* `@cell-edit({ rowId, colKey, value })` so the parent can persist.
|
|
119
124
|
* Optional row / column / grand totals computed from the live data
|
|
120
125
|
* with the column's `aggregate` setting (`sum` by default).
|
|
@@ -326,6 +331,97 @@ export default {
|
|
|
326
331
|
return Boolean(col.readOnly || col.formula)
|
|
327
332
|
},
|
|
328
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Whether a cell can be edited, and so takes keyboard focus.
|
|
336
|
+
*
|
|
337
|
+
* @param {object} row Row record.
|
|
338
|
+
* @param {object} col Column definition.
|
|
339
|
+
* @return {boolean}
|
|
340
|
+
*/
|
|
341
|
+
isCellEditable(row, col) {
|
|
342
|
+
return !this.readOnly && !this.isCellReadOnly(row, col)
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Accessible name of a cell's input: its column and row.
|
|
347
|
+
*
|
|
348
|
+
* @param {object} row Row record.
|
|
349
|
+
* @param {object} col Column definition.
|
|
350
|
+
* @return {string} The label.
|
|
351
|
+
*/
|
|
352
|
+
inputLabel(row, col) {
|
|
353
|
+
return t('nextcloud-vue', '{column}, {row}', {
|
|
354
|
+
column: col.label || col.key,
|
|
355
|
+
row: row[this.rowLabelKey] ?? row[this.rowIdKey],
|
|
356
|
+
}, undefined, { escape: false })
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Accessible name of an editable cell: its column, row and value.
|
|
361
|
+
*
|
|
362
|
+
* @param {object} row Row record.
|
|
363
|
+
* @param {object} col Column definition.
|
|
364
|
+
* @return {string} The label.
|
|
365
|
+
*/
|
|
366
|
+
cellLabel(row, col) {
|
|
367
|
+
const value = this.formatCell(this.cellValue(row, col), col)
|
|
368
|
+
const vars = { cell: this.inputLabel(row, col), value: String(value) }
|
|
369
|
+
return value === ''
|
|
370
|
+
? t('nextcloud-vue', '{cell}: empty', vars, undefined, { escape: false })
|
|
371
|
+
: t('nextcloud-vue', '{cell}: {value}', vars, undefined, { escape: false })
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Enter or F2 on a focused cell starts editing it.
|
|
376
|
+
*
|
|
377
|
+
* @param {KeyboardEvent} event The key event.
|
|
378
|
+
* @param {object} row Row record.
|
|
379
|
+
* @param {object} col Column definition.
|
|
380
|
+
* @return {void}
|
|
381
|
+
*/
|
|
382
|
+
onCellKeydown(event, row, col) {
|
|
383
|
+
if ((event.key === 'Enter' || event.key === 'F2') && this.isCellEditable(row, col)) {
|
|
384
|
+
event.preventDefault()
|
|
385
|
+
this.startEdit(row, col)
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Enter commits and Escape cancels the edit; both return focus to the cell.
|
|
391
|
+
*
|
|
392
|
+
* @param {KeyboardEvent} event The key event.
|
|
393
|
+
* @param {object} row Row record.
|
|
394
|
+
* @param {object} col Column definition.
|
|
395
|
+
* @return {void}
|
|
396
|
+
*/
|
|
397
|
+
onInputKeydown(event, row, col) {
|
|
398
|
+
if (event.key === 'Enter') {
|
|
399
|
+
event.preventDefault()
|
|
400
|
+
this.commitEdit(row, col, event.target.value)
|
|
401
|
+
this.focusCell(row, col)
|
|
402
|
+
} else if (event.key === 'Escape' || event.key === 'Esc') {
|
|
403
|
+
event.preventDefault()
|
|
404
|
+
this.cancelEdit()
|
|
405
|
+
this.focusCell(row, col)
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Move focus to a cell's value after the edit input is gone.
|
|
411
|
+
*
|
|
412
|
+
* @param {object} row Row record.
|
|
413
|
+
* @param {object} col Column definition.
|
|
414
|
+
* @return {void}
|
|
415
|
+
*/
|
|
416
|
+
focusCell(row, col) {
|
|
417
|
+
const rowId = String(row[this.rowIdKey])
|
|
418
|
+
this.$nextTick(() => {
|
|
419
|
+
const cell = Array.from(this.$el.querySelectorAll('.cn-data-matrix__cell'))
|
|
420
|
+
.find((td) => td.dataset.rowId === rowId && td.dataset.colKey === col.key)
|
|
421
|
+
cell?.querySelector('.cn-data-matrix__cell-value')?.focus()
|
|
422
|
+
})
|
|
423
|
+
},
|
|
424
|
+
|
|
329
425
|
/**
|
|
330
426
|
* Read the cell value from the row.
|
|
331
427
|
*
|
|
@@ -616,6 +712,11 @@ export default {
|
|
|
616
712
|
min-height: 28px;
|
|
617
713
|
}
|
|
618
714
|
|
|
715
|
+
.cn-data-matrix__cell-value:focus-visible {
|
|
716
|
+
outline: 2px solid var(--color-primary-element);
|
|
717
|
+
outline-offset: -2px;
|
|
718
|
+
}
|
|
719
|
+
|
|
619
720
|
.cn-data-matrix__cell--read-only .cn-data-matrix__cell-value {
|
|
620
721
|
cursor: default;
|
|
621
722
|
background: var(--color-background-hover);
|
|
@@ -1466,6 +1466,7 @@ import { prefixUrl } from '../../utils/headers.js'
|
|
|
1466
1466
|
import { HEADING_LEVEL } from '../../utils/headingLevel.js'
|
|
1467
1467
|
import { interpolateUrlTokens } from '../../utils/interpolateUrlTokens.js'
|
|
1468
1468
|
import { followLinkClick } from '../../utils/linkNavigation.js'
|
|
1469
|
+
import { parentCrumb } from '../../utils/parentCrumb.js'
|
|
1469
1470
|
import { patchStoredSelf } from '../../utils/patchStoredSelf.js'
|
|
1470
1471
|
import { setReadState } from '../../utils/recordInteractions.js'
|
|
1471
1472
|
import { saveEdited } from '../../utils/saveEdited.js'
|
|
@@ -2448,6 +2449,24 @@ export default {
|
|
|
2448
2449
|
default: false,
|
|
2449
2450
|
},
|
|
2450
2451
|
|
|
2452
|
+
/**
|
|
2453
|
+
* A condition on the record, in the `visibleWhen` grammar (manifest
|
|
2454
|
+
* `config.readOnlyWhen`): while it holds, the page treats the record
|
|
2455
|
+
* as one it may not update, as with `can.update` false. The Edit
|
|
2456
|
+
* button, the header actions with role `edit` or `update` and the
|
|
2457
|
+
* inline editors are off. `{ field: "mergedInto", op: "notEmpty" }`
|
|
2458
|
+
* keeps a record merged into another from being edited. It is decided
|
|
2459
|
+
* on the page (no `endpoint` or `source`) and may read the
|
|
2460
|
+
* `visibilityContext` records as `@context.<name>.<path>`. Null
|
|
2461
|
+
* (the default) changes nothing.
|
|
2462
|
+
*
|
|
2463
|
+
* @spec openspec/changes/detail-read-only-when/specs/detail-page/spec.md#requirement-a-detail-page-can-make-a-record-read-only-by-a-condition
|
|
2464
|
+
*/
|
|
2465
|
+
readOnlyWhen: {
|
|
2466
|
+
type: Object,
|
|
2467
|
+
default: null,
|
|
2468
|
+
},
|
|
2469
|
+
|
|
2451
2470
|
/**
|
|
2452
2471
|
* Hide valueless fields on the auto-rendered data widget, instead of
|
|
2453
2472
|
* showing them with an em dash. See `CnObjectDataWidget`'s `hide-empty`.
|
|
@@ -3033,8 +3052,12 @@ export default {
|
|
|
3033
3052
|
* @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-a-breadcrumb-can-name-the-record-by-a-field-and-use-a-text-separator
|
|
3034
3053
|
* A list of such crumbs draws a deeper trail ("Settings / Case types /"
|
|
3035
3054
|
* and then the record); `currentField` and `separator` may sit on any
|
|
3036
|
-
* of them.
|
|
3055
|
+
* of them. A crumb with `parent` (a `visibilityContext` name) instead
|
|
3056
|
+
* of `label` is the record's parent: its `labelField` value (else its
|
|
3057
|
+
* name), linked by `route` + `param` (default `id`) or `href` with
|
|
3058
|
+
* `{id}`; it drops out when the record has no parent.
|
|
3037
3059
|
*
|
|
3060
|
+
* @spec openspec/changes/detail-parent-crumb/specs/detail-page/spec.md#requirement-a-sub-record-trail-can-show-its-parent-record
|
|
3038
3061
|
* @spec openspec/changes/detail-breadcrumb-trail/specs/detail-page/spec.md#requirement-a-record-page-breadcrumb-can-name-more-than-one-level
|
|
3039
3062
|
* @type {{label: string, route?: string, params?: object, href?: string, icon?: string, currentField?: string, separator?: string}|Array<object>|null}
|
|
3040
3063
|
*/
|
|
@@ -5586,13 +5609,30 @@ export default {
|
|
|
5586
5609
|
},
|
|
5587
5610
|
|
|
5588
5611
|
/**
|
|
5589
|
-
* Whether the record refuses this reader's updates (`can.update === false`)
|
|
5612
|
+
* Whether the record refuses this reader's updates (`can.update === false`),
|
|
5613
|
+
* or the page's `readOnlyWhen` holds for it.
|
|
5590
5614
|
*
|
|
5591
5615
|
* @return {boolean}
|
|
5592
5616
|
* @spec openspec/changes/detail-page-record-rights/specs/detail-page-record-rights/spec.md#requirement-edit-controls-follow-the-records-update-right
|
|
5593
5617
|
*/
|
|
5594
5618
|
recordUpdateDenied() {
|
|
5595
|
-
return Boolean(this.recordCan && this.recordCan.update === false)
|
|
5619
|
+
return Boolean(this.recordCan && this.recordCan.update === false) || this.readOnlyByCondition
|
|
5620
|
+
},
|
|
5621
|
+
|
|
5622
|
+
/**
|
|
5623
|
+
* Whether the page's `readOnlyWhen` holds for the record (and its
|
|
5624
|
+
* `visibilityContext` records). False without the option, and while
|
|
5625
|
+
* the record or those records are still on their way.
|
|
5626
|
+
*
|
|
5627
|
+
* @return {boolean}
|
|
5628
|
+
* @spec openspec/changes/detail-read-only-when/specs/detail-page/spec.md#requirement-a-detail-page-can-make-a-record-read-only-by-a-condition
|
|
5629
|
+
*/
|
|
5630
|
+
readOnlyByCondition() {
|
|
5631
|
+
const when = this.readOnlyWhen
|
|
5632
|
+
if (!when || typeof when !== 'object' || !this.widgetVisibilityData || this.visibilityRowsPending) {
|
|
5633
|
+
return false
|
|
5634
|
+
}
|
|
5635
|
+
return detailWidgetVisible({ visibleWhen: when }, this.widgetVisibilityData)
|
|
5596
5636
|
},
|
|
5597
5637
|
|
|
5598
5638
|
/**
|
|
@@ -5657,7 +5697,7 @@ export default {
|
|
|
5657
5697
|
*/
|
|
5658
5698
|
declaredCrumbs() {
|
|
5659
5699
|
const list = Array.isArray(this.breadcrumb) ? this.breadcrumb : (this.breadcrumb ? [this.breadcrumb] : [])
|
|
5660
|
-
return list.filter((crumb) => crumb && typeof crumb.label === 'string' && crumb.label !== ''
|
|
5700
|
+
return list.filter((crumb) => crumb && ((typeof crumb.label === 'string' && crumb.label !== '') || (typeof crumb.parent === 'string' && crumb.parent !== ''))
|
|
5661
5701
|
&& (!crumb.visibleWhen || detailWidgetVisible({ visibleWhen: crumb.visibleWhen }, this.widgetVisibilityData)))
|
|
5662
5702
|
},
|
|
5663
5703
|
|
|
@@ -5665,11 +5705,14 @@ export default {
|
|
|
5665
5705
|
* The breadcrumb trail: the declared crumbs (each a router target from
|
|
5666
5706
|
* `route` + `params`, or an `href`), then the record's display name
|
|
5667
5707
|
* as the current crumb. Empty without a declared crumb. A crumb
|
|
5668
|
-
* carries `icon` only when the manifest declares one.
|
|
5708
|
+
* carries `icon` only when the manifest declares one. A crumb with
|
|
5709
|
+
* `parent` is the record's parent (see `parentCrumb`) and drops out
|
|
5710
|
+
* when the record has none.
|
|
5669
5711
|
*
|
|
5670
5712
|
* @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-detail-page-drops-its-eyebrow-and-shows-a-breadcrumb
|
|
5671
5713
|
* @spec openspec/changes/zuiddrecht-pixel-gaps-2/specs/zuiddrecht-pixel-gaps-2/spec.md#requirement-a-declared-breadcrumb-label-shows-as-text
|
|
5672
5714
|
* @spec openspec/changes/detail-breadcrumb-trail/specs/detail-page/spec.md#requirement-a-record-page-breadcrumb-can-name-more-than-one-level
|
|
5715
|
+
* @spec openspec/changes/detail-parent-crumb/specs/detail-page/spec.md#requirement-a-sub-record-trail-can-show-its-parent-record
|
|
5673
5716
|
* @return {Array<{label: string, to?: object, href?: string, icon?: string}>}
|
|
5674
5717
|
*/
|
|
5675
5718
|
breadcrumbCrumbs() {
|
|
@@ -5677,6 +5720,9 @@ export default {
|
|
|
5677
5720
|
return []
|
|
5678
5721
|
}
|
|
5679
5722
|
const crumbs = this.declaredCrumbs.map((crumb) => {
|
|
5723
|
+
if (typeof crumb.parent === 'string' && crumb.parent !== '') {
|
|
5724
|
+
return parentCrumb(crumb, this.visibilityRefs, this.visibilityRows, this.effectiveTranslate)
|
|
5725
|
+
}
|
|
5680
5726
|
const entry = { label: this.effectiveTranslate(crumb.label) }
|
|
5681
5727
|
if (typeof crumb.icon === 'string' && crumb.icon !== '') {
|
|
5682
5728
|
entry.icon = crumb.icon
|
|
@@ -5687,7 +5733,10 @@ export default {
|
|
|
5687
5733
|
entry.href = crumb.href
|
|
5688
5734
|
}
|
|
5689
5735
|
return entry
|
|
5690
|
-
})
|
|
5736
|
+
}).filter((crumb) => crumb !== null)
|
|
5737
|
+
if (crumbs.length === 0) {
|
|
5738
|
+
return []
|
|
5739
|
+
}
|
|
5691
5740
|
return [...crumbs, { label: this.breadcrumbCurrentLabel }]
|
|
5692
5741
|
},
|
|
5693
5742
|
|
|
@@ -2358,6 +2358,21 @@ export default {
|
|
|
2358
2358
|
default: null,
|
|
2359
2359
|
},
|
|
2360
2360
|
|
|
2361
|
+
/**
|
|
2362
|
+
* Text added to the count line after a middle dot while a quick filter
|
|
2363
|
+
* or lens is selected (manifest `config.countSuffixByFilter`),
|
|
2364
|
+
* `{ <tab id or label>: text }`: a lens that sorts by waiting time
|
|
2365
|
+
* says "longest waiting first". A quick filter tab can also carry
|
|
2366
|
+
* its own `countSuffix`, which comes first. The text goes through the
|
|
2367
|
+
* host translate function. Null (the default) adds nothing.
|
|
2368
|
+
*
|
|
2369
|
+
* @spec openspec/changes/index-count-suffix-per-filter/specs/index-page/spec.md#requirement-the-count-line-can-say-what-the-selected-quick-filter-does
|
|
2370
|
+
*/
|
|
2371
|
+
countSuffixByFilter: {
|
|
2372
|
+
type: Object,
|
|
2373
|
+
default: null,
|
|
2374
|
+
},
|
|
2375
|
+
|
|
2361
2376
|
/**
|
|
2362
2377
|
* The property keys the card's facts list shows, in order (manifest key
|
|
2363
2378
|
* `config.cardFields`). Without it the board look shows the first four
|
|
@@ -9276,7 +9291,8 @@ export default {
|
|
|
9276
9291
|
* @return {string}
|
|
9277
9292
|
*/
|
|
9278
9293
|
headerDescription() {
|
|
9279
|
-
const
|
|
9294
|
+
const suffix = this.quickFilterCountSuffix
|
|
9295
|
+
const base = suffix && this.headerDescriptionBase ? `${this.headerDescriptionBase} · ${suffix}` : this.headerDescriptionBase
|
|
9280
9296
|
if (this.currentViewMode !== 'map' || !this.mapListEnabled) {
|
|
9281
9297
|
return base
|
|
9282
9298
|
}
|
|
@@ -9298,6 +9314,29 @@ export default {
|
|
|
9298
9314
|
return active || this.quickFilterNarrows
|
|
9299
9315
|
},
|
|
9300
9316
|
|
|
9317
|
+
/**
|
|
9318
|
+
* The count line text of the selected quick filters or lenses: each
|
|
9319
|
+
* tab's `countSuffix`, else its entry in `countSuffixByFilter` (by
|
|
9320
|
+
* id, then by label), translated and joined by a middle dot.
|
|
9321
|
+
*
|
|
9322
|
+
* @return {string}
|
|
9323
|
+
* @spec openspec/changes/index-count-suffix-per-filter/specs/index-page/spec.md#requirement-the-count-line-can-say-what-the-selected-quick-filter-does
|
|
9324
|
+
*/
|
|
9325
|
+
quickFilterCountSuffix() {
|
|
9326
|
+
const tabs = this.tabStripEntries || []
|
|
9327
|
+
const byFilter = this.countSuffixByFilter && typeof this.countSuffixByFilter === 'object' ? this.countSuffixByFilter : {}
|
|
9328
|
+
const indices = this.quickFilterMultiple
|
|
9329
|
+
? (this.selectedQuickFilterIndices || [])
|
|
9330
|
+
: [this.activeQuickFilterIndex]
|
|
9331
|
+
return indices
|
|
9332
|
+
.map((index) => (typeof index === 'number' ? tabs[index] : null))
|
|
9333
|
+
.filter(Boolean)
|
|
9334
|
+
.map((tab) => [tab.countSuffix, byFilter[tab.id], byFilter[tab.label]].find((text) => typeof text === 'string' && text !== ''))
|
|
9335
|
+
.filter(Boolean)
|
|
9336
|
+
.map((text) => this.cnTranslate(text))
|
|
9337
|
+
.join(' · ')
|
|
9338
|
+
},
|
|
9339
|
+
|
|
9301
9340
|
/**
|
|
9302
9341
|
* Whether a selected quick filter tab carries a filter (an "All" tab
|
|
9303
9342
|
* does not).
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
v-model="query"
|
|
115
115
|
type="search"
|
|
116
116
|
class="cn-store-page__lens-search-input"
|
|
117
|
-
:placeholder="t('nextcloud-vue', 'Search the
|
|
118
|
-
:aria-label="t('nextcloud-vue', 'Search the
|
|
117
|
+
:placeholder="t('nextcloud-vue', 'Search the marketplace')"
|
|
118
|
+
:aria-label="t('nextcloud-vue', 'Search the marketplace')"
|
|
119
119
|
:disabled="offline"
|
|
120
120
|
data-testid="store-search"
|
|
121
121
|
@input="onSearchInput">
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
<div v-else class="cn-store-page__controls">
|
|
125
125
|
<NcTextField
|
|
126
126
|
v-model="query"
|
|
127
|
-
:label="t('nextcloud-vue', 'Search the
|
|
127
|
+
:label="t('nextcloud-vue', 'Search the marketplace')"
|
|
128
128
|
:disabled="offline"
|
|
129
129
|
data-testid="store-search"
|
|
130
130
|
@update:modelValue="onSearchInput" />
|
|
@@ -294,10 +294,10 @@
|
|
|
294
294
|
<aside v-if="isBoardLook && !loading && !offline && !unreachable" class="cn-store-page__aside">
|
|
295
295
|
<section class="cn-store-page__side-card" data-testid="store-installed">
|
|
296
296
|
<h2 class="cn-store-page__side-title">
|
|
297
|
-
{{ t('nextcloud-vue', 'Installed from this
|
|
297
|
+
{{ t('nextcloud-vue', 'Installed from this marketplace') }}
|
|
298
298
|
</h2>
|
|
299
299
|
<p v-if="installedCards.length === 0" class="cn-store-page__side-note">
|
|
300
|
-
{{ t('nextcloud-vue', 'Nothing from this
|
|
300
|
+
{{ t('nextcloud-vue', 'Nothing from this marketplace is installed yet.') }}
|
|
301
301
|
</p>
|
|
302
302
|
<ul v-else class="cn-store-page__installed">
|
|
303
303
|
<li v-for="card in installedCards" :key="card.slug">
|
|
@@ -625,7 +625,7 @@ export default {
|
|
|
625
625
|
* @return {string} The heading to render.
|
|
626
626
|
*/
|
|
627
627
|
resolvedTitle() {
|
|
628
|
-
return this.title || this.page?.title || t('nextcloud-vue', '
|
|
628
|
+
return this.title || this.page?.title || t('nextcloud-vue', 'Marketplace')
|
|
629
629
|
},
|
|
630
630
|
|
|
631
631
|
/**
|
|
@@ -924,7 +924,7 @@ export default {
|
|
|
924
924
|
notConfiguredMessage() {
|
|
925
925
|
const base = t(
|
|
926
926
|
'nextcloud-vue',
|
|
927
|
-
'No
|
|
927
|
+
'No marketplace registry is configured, so nothing was requested from the network. An administrator can connect one under Administration settings.',
|
|
928
928
|
)
|
|
929
929
|
|
|
930
930
|
return this.builtIn.length > 0
|
|
@@ -938,7 +938,7 @@ export default {
|
|
|
938
938
|
* @return {string} The unreachable note.
|
|
939
939
|
*/
|
|
940
940
|
unreachableMessage() {
|
|
941
|
-
const base = t('nextcloud-vue', 'The
|
|
941
|
+
const base = t('nextcloud-vue', 'The marketplace registry did not answer.')
|
|
942
942
|
|
|
943
943
|
return this.builtIn.length > 0
|
|
944
944
|
? `${base} ${t('nextcloud-vue', 'The items below ship with this app.')}`
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
-->
|
|
19
19
|
<template>
|
|
20
20
|
<CnDialog
|
|
21
|
-
:name="t('nextcloud-vue', 'Publish to the
|
|
21
|
+
:name="t('nextcloud-vue', 'Publish to the marketplace')"
|
|
22
22
|
:subtitle="t('nextcloud-vue', 'Share a template built from your own configuration with the registry.')"
|
|
23
23
|
data-testid="store-publish-dialog"
|
|
24
24
|
@closing="$emit('close')">
|
|
@@ -223,7 +223,7 @@ export default {
|
|
|
223
223
|
})
|
|
224
224
|
const body = await response.json()
|
|
225
225
|
if (body.outcome === 'ok') {
|
|
226
|
-
showSuccess(t('nextcloud-vue', 'Published to the
|
|
226
|
+
showSuccess(t('nextcloud-vue', 'Published to the marketplace.'))
|
|
227
227
|
this.$emit('published', body.slug)
|
|
228
228
|
return
|
|
229
229
|
}
|
|
@@ -244,14 +244,14 @@ export default {
|
|
|
244
244
|
*/
|
|
245
245
|
outcomeMessage(body, status) {
|
|
246
246
|
if (status === 403) {
|
|
247
|
-
return t('nextcloud-vue', 'You may not publish to this
|
|
247
|
+
return t('nextcloud-vue', 'You may not publish to this marketplace.')
|
|
248
248
|
}
|
|
249
249
|
const messages = {
|
|
250
|
-
not_configured: t('nextcloud-vue', 'No
|
|
251
|
-
store_unreachable: t('nextcloud-vue', 'The
|
|
252
|
-
store_rejected: t('nextcloud-vue', 'The
|
|
250
|
+
not_configured: t('nextcloud-vue', 'No marketplace registry is configured. An administrator connects one under Administration settings.'),
|
|
251
|
+
store_unreachable: t('nextcloud-vue', 'The marketplace registry did not answer. Try again later.'),
|
|
252
|
+
store_rejected: t('nextcloud-vue', 'The marketplace registry refused the item.'),
|
|
253
253
|
too_large: t('nextcloud-vue', 'The item is too large to publish.'),
|
|
254
|
-
rate_limited: t('nextcloud-vue', 'The
|
|
254
|
+
rate_limited: t('nextcloud-vue', 'The marketplace registry is busy. Try again in a minute.'),
|
|
255
255
|
}
|
|
256
256
|
return messages[body?.outcome] || body?.message || t('nextcloud-vue', 'The item could not be published.')
|
|
257
257
|
},
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
4
|
+
*
|
|
5
|
+
* parentCrumb: the breadcrumb entry for the record a sub-record belongs to.
|
|
6
|
+
*
|
|
7
|
+
* A crumb that carries `parent` names a `visibilityContext` entry of the
|
|
8
|
+
* detail page. The page reads that record beside the loaded one; this
|
|
9
|
+
* helper turns it into a crumb with the parent's label and a link to its
|
|
10
|
+
* page.
|
|
11
|
+
*
|
|
12
|
+
* @module utils/parentCrumb
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Read a dotted path from an object.
|
|
17
|
+
*
|
|
18
|
+
* @param {object|null} obj The object to read.
|
|
19
|
+
* @param {string} path A dotted path, e.g. `identifier` or `@self.name`.
|
|
20
|
+
* @return {unknown} The value, or undefined.
|
|
21
|
+
*/
|
|
22
|
+
function readPath(obj, path) {
|
|
23
|
+
return path.split('.').reduce((o, part) => (o === null || o === undefined ? undefined : o[part]), obj)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A non-empty string for a value, or ''.
|
|
28
|
+
*
|
|
29
|
+
* @param {unknown} value Any value.
|
|
30
|
+
* @return {string} The text.
|
|
31
|
+
*/
|
|
32
|
+
function text(value) {
|
|
33
|
+
if (typeof value === 'number') {
|
|
34
|
+
return String(value)
|
|
35
|
+
}
|
|
36
|
+
return typeof value === 'string' ? value.trim() : ''
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The crumb for a record's parent.
|
|
41
|
+
*
|
|
42
|
+
* The crumb is dropped (null) when the record holds no reference to a
|
|
43
|
+
* parent. Its label is the parent's `labelField` value, else the parent's
|
|
44
|
+
* name or title, else the crumb's own `label` (translated); without any of
|
|
45
|
+
* those it is dropped too. The link goes to `route` with the parent's id in
|
|
46
|
+
* `param` (default `id`), or to `href` with `{id}` filled in.
|
|
47
|
+
*
|
|
48
|
+
* @param {object} crumb `{ parent, labelField?, label?, route?, params?, param?, href?, icon? }`.
|
|
49
|
+
* @param {Array<{key: string, id: string}>} refs The page's context references.
|
|
50
|
+
* @param {object} rows The context records read so far, by name.
|
|
51
|
+
* @param {(key: string) => string} translate The host translate function.
|
|
52
|
+
* @return {{label: string, to?: object, href?: string, icon?: string}|null} The crumb, or null.
|
|
53
|
+
* @spec openspec/changes/detail-parent-crumb/specs/detail-page/spec.md#requirement-a-sub-record-trail-can-show-its-parent-record
|
|
54
|
+
*/
|
|
55
|
+
export function parentCrumb(crumb, refs, rows, translate) {
|
|
56
|
+
const ref = (refs || []).find((r) => r.key === crumb.parent)
|
|
57
|
+
if (!ref || !ref.id) {
|
|
58
|
+
return null
|
|
59
|
+
}
|
|
60
|
+
const row = rows && rows[crumb.parent] && typeof rows[crumb.parent] === 'object' ? rows[crumb.parent] : null
|
|
61
|
+
let label = ''
|
|
62
|
+
if (row) {
|
|
63
|
+
label = (typeof crumb.labelField === 'string' && crumb.labelField !== '' ? text(readPath(row, crumb.labelField)) : '')
|
|
64
|
+
|| text(readPath(row, '@self.name')) || text(row.name) || text(row.title)
|
|
65
|
+
}
|
|
66
|
+
if (label === '' && typeof crumb.label === 'string' && crumb.label !== '') {
|
|
67
|
+
label = translate(crumb.label)
|
|
68
|
+
}
|
|
69
|
+
if (label === '') {
|
|
70
|
+
return null
|
|
71
|
+
}
|
|
72
|
+
const entry = { label }
|
|
73
|
+
if (typeof crumb.icon === 'string' && crumb.icon !== '') {
|
|
74
|
+
entry.icon = crumb.icon
|
|
75
|
+
}
|
|
76
|
+
if (crumb.route) {
|
|
77
|
+
const param = typeof crumb.param === 'string' && crumb.param !== '' ? crumb.param : 'id'
|
|
78
|
+
entry.to = { name: crumb.route, params: { ...(crumb.params || {}), [param]: ref.id } }
|
|
79
|
+
} else if (typeof crumb.href === 'string' && crumb.href !== '') {
|
|
80
|
+
entry.href = crumb.href.split('{id}').join(encodeURIComponent(ref.id))
|
|
81
|
+
}
|
|
82
|
+
return entry
|
|
83
|
+
}
|