@conduction/nextcloud-vue 2.78.0 → 2.79.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/bundled-packages.json +0 -2
- package/dist/esm/bundled-packages.json +0 -2
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +113 -104
- package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +12 -2
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +80 -0
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +115 -91
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +139 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +140 -92
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +77 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +4 -2
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +61 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +173 -5
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +181 -99
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +29 -11
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js +252 -0
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js.map +1 -0
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +25 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +3 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +100 -3
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +4 -2
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnQuickFilterBar/CnQuickFilterBar.vue2.js +3 -2
- package/dist/esm/components/CnQuickFilterBar/CnQuickFilterBar.vue2.js.map +1 -1
- package/dist/esm/components/CnQuickFilterBar/CnQuickFilterBar.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue3.js +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +30 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +13 -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/composables/useAppManifest.js +8 -3
- package/dist/esm/composables/useAppManifest.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +61 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +106 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/nextcloud-vue.css +314 -15
- package/dist/esm/utils/boardDate.js +193 -0
- package/dist/esm/utils/boardDate.js.map +1 -0
- package/dist/esm/utils/dynamicProperties.js +5 -1
- package/dist/esm/utils/dynamicProperties.js.map +1 -1
- package/dist/esm/utils/validateManifestV2.compiled.js +57 -6
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +2039 -581
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +314 -15
- package/l10n/en.json +61 -1
- package/l10n/nl.json +106 -2
- package/package.json +1 -1
- package/scripts/build-validators.js +26 -0
- package/src/components/CnActionsBar/CnActionsBar.vue +48 -39
- package/src/components/CnAppRoot/CnAppRoot.vue +12 -2
- package/src/components/CnCellRenderer/CnCellRenderer.vue +119 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +219 -4
- package/src/components/CnDataTable/CnDataTable.md +2 -0
- package/src/components/CnDataTable/CnDataTable.vue +81 -2
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +61 -1
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +232 -11
- package/src/components/CnFilesBrowser/filesBrowser.js +43 -2
- package/src/components/CnFilesBrowser/index.js +1 -0
- package/src/components/CnFilesBrowser/openRegisterSource.js +248 -0
- package/src/components/CnFormDialog/CnFormDialog.vue +1 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +27 -3
- package/src/components/CnObjectSidebar/CnFilesTab.vue +103 -4
- package/src/components/CnQuickFilterBar/CnQuickFilterBar.vue +3 -2
- package/src/components/CnSavedViewsControl/CnSavedViewsControl.vue +1 -1
- package/src/components/CnTabsWidget/CnTabsWidget.vue +30 -1
- package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +13 -0
- package/src/components/index.js +1 -1
- package/src/composables/useAppManifest.js +8 -3
- package/src/css/look-board-detail.css +10 -0
- package/src/css/look-board-index.css +92 -14
- package/src/css/look-board.css +77 -0
- package/src/css/table.css +37 -0
- package/src/index.js +4 -0
- package/src/schemas/app-manifest-v2.schema.json +46 -1
- package/src/utils/boardDate.js +189 -0
- package/src/utils/dynamicProperties.js +5 -1
- package/src/utils/validateManifestV2.compiled.js +57 -2
- package/dist/esm/_virtual/equal.js +0 -4
- package/dist/esm/_virtual/equal.js.map +0 -1
- package/dist/esm/_virtual/ucs2length.js +0 -4
- package/dist/esm/_virtual/ucs2length.js.map +0 -1
- package/dist/esm/node_modules/ajv/dist/runtime/equal.js +0 -9
- package/dist/esm/node_modules/ajv/dist/runtime/equal.js.map +0 -1
- package/dist/esm/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
- package/dist/esm/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
- package/dist/esm/node_modules/fast-deep-equal/index.js +0 -47
- package/dist/esm/node_modules/fast-deep-equal/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnSavedViewsControl.vue2.js","sources":["../../../../src/components/CnSavedViewsControl/CnSavedViewsControl.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<!--\n\t\tBoard look: the saved views are a row of chips on the ground, each with\n\t\tits count, the selected one filled. The menu stays for managing views\n\t\t(apply, rename, share, delete) and is reached from the \"Save view\"\n\t\tbutton. Without the look the control is the menu alone, as before.\n\t-->\n\t<div\n\t\tv-if=\"isBoardLook && chipRows.length > 0\"\n\t\tclass=\"cn-saved-views__chips\"\n\t\trole=\"group\"\n\t\t:aria-label=\"t('nextcloud-vue', 'Saved views')\"\n\t\tdata-testid=\"cn-saved-views-chips\">\n\t\t<button\n\t\t\tv-for=\"row in chipRows\"\n\t\t\t:key=\"`chip-${row.view.id || row.view.slug}`\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cn-saved-views__chip\"\n\t\t\t:class=\"{ 'cn-saved-views__chip--selected': isChipSelected(row.view) }\"\n\t\t\t:aria-pressed=\"isChipSelected(row.view)\"\n\t\t\tdata-testid=\"cn-saved-views-chip\"\n\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t@click=\"onApply(row.view)\">\n\t\t\t<span class=\"cn-saved-views__chip-name\">{{ row.view.name }}</span>\n\t\t\t<span\n\t\t\t\tv-if=\"countOf(row.view) !== null\"\n\t\t\t\tclass=\"cn-saved-views__chip-count\"\n\t\t\t\tdata-testid=\"cn-saved-views-chip-count\">{{ countOf(row.view) }}</span>\n\t\t</button>\n\t</div>\n\t<NcActions\n\t\tv-bind=\"$attrs\"\n\t\t:class=\"{ 'cn-saved-views__save': isBoardLook }\"\n\t\t:forceMenu=\"true\"\n\t\t:forceName=\"true\"\n\t\t:menuName=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\"\n\t\tdata-testid=\"cn-saved-views-control\"\n\t\t:aria-label=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\">\n\t\t<template #icon>\n\t\t\t<ContentSaveOutline v-if=\"isBoardLook\" :size=\"18\" />\n\t\t\t<BookmarkOutline v-else :size=\"20\" />\n\t\t</template>\n\n\t\t<NcActionCaption :name=\"t('nextcloud-vue', 'Saved views')\" />\n\n\t\t<!-- Loading state -->\n\t\t<NcActionCaption\n\t\t\tv-if=\"loading\"\n\t\t\tdata-testid=\"cn-saved-views-loading\"\n\t\t\t:name=\"t('nextcloud-vue', 'Loading…')\" />\n\n\t\t<!-- Empty state -->\n\t\t<NcActionCaption\n\t\t\tv-else-if=\"views.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-empty\"\n\t\t\t:name=\"t('nextcloud-vue', 'No saved views yet')\" />\n\n\t\t<!-- The labels already in use, offered before anybody types a new one. -->\n\t\t<template v-if=\"!loading && offeredLabels.length > 0\">\n\t\t\t<NcActionButton\n\t\t\t\tv-for=\"label in offeredLabels\"\n\t\t\t\t:key=\"`label-${label}`\"\n\t\t\t\tdata-testid=\"cn-saved-views-label\"\n\t\t\t\t:data-label=\"label\"\n\t\t\t\t:modelValue=\"labelFilter === label\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:aria-label=\"labelFilterLabel(label)\"\n\t\t\t\t@click=\"onLabelFilter(label)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<TagOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ label }}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator />\n\t\t</template>\n\n\t\t<!--\n\t\t\tA label that matches nothing says so. Chained to the ROWS rather\n\t\t\tthan to the label list: written as an else-if of the labels block\n\t\t\tit only ever rendered on a page with no labels at all, which is\n\t\t\tthe one case it cannot be about.\n\t\t-->\n\t\t<NcActionCaption\n\t\t\tv-if=\"!loading && views.length > 0 && rows.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-none-for-label\"\n\t\t\t:name=\"t('nextcloud-vue', 'No views with this label')\" />\n\n\t\t<!-- One row per view, in tree order: the name applies it, a trailing\n\t\t icon button deletes it. NcActions only recognises NcAction* vnodes\n\t\t as menu items and silently drops anything else, so a row with more\n\t\t than one control has to be an NcActionButtonGroup. -->\n\t\t<template v-if=\"!loading\">\n\t\t\t<template v-for=\"section in sections\" :key=\"section.key\">\n\t\t\t\t<NcActionCaption\n\t\t\t\t\tv-if=\"section.label\"\n\t\t\t\t\t:data-testid=\"`cn-saved-views-section-${section.key}`\"\n\t\t\t\t\t:name=\"section.label\" />\n\t\t\t\t<NcActionButtonGroup\n\t\t\t\t\tv-for=\"row in section.rows\"\n\t\t\t\t\t:key=\"`view-${row.view.id || row.view.slug}`\"\n\t\t\t\t\tclass=\"cn-saved-view-row\">\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-item\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:data-depth=\"row.depth\"\n\t\t\t\t\t\t:data-group=\"row.group\"\n\t\t\t\t\t\t:data-access=\"accessOf(row)\"\n\t\t\t\t\t\t:aria-label=\"rowLabel(row)\"\n\t\t\t\t\t\t@click=\"onApply(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EyeOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ rowName(row, section.key === 'shared') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`share-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-share\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"shareLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onShareRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ShareVariantOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"(accessOf(row) === 'owner' || accessOf(row) === 'write') && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`presentation-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-presentation\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"presentationLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onPresentationRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ViewDashboardOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'write'\"\n\t\t\t\t\t\t:key=\"`update-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-update\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"updateLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onUpdateRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'read' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`copy-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-copy\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"copyLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onCopyRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentCopy :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`delete-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-delete\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"deleteLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onDeleteRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<TrashCanOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActionButtonGroup>\n\t\t\t</template>\n\t\t</template>\n\n\t\t<NcActionSeparator />\n\n\t\t<NcActionButton\n\t\t\tdata-testid=\"cn-saved-views-save\"\n\t\t\t:aria-label=\"t('nextcloud-vue', 'Save current view…')\"\n\t\t\t@click=\"onSaveRequest\">\n\t\t\t<template #icon>\n\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ t('nextcloud-vue', 'Save current view…') }}\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionButtonGroup, NcActionCaption, NcActions, NcActionSeparator } from '@nextcloud/vue'\nimport BookmarkOutline from 'vue-material-design-icons/BookmarkOutline.vue'\nimport ContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport ContentSaveOutline from 'vue-material-design-icons/ContentSaveOutline.vue'\nimport EyeOutline from 'vue-material-design-icons/EyeOutline.vue'\nimport ShareVariantOutline from 'vue-material-design-icons/ShareVariantOutline.vue'\nimport TagOutline from 'vue-material-design-icons/TagOutline.vue'\nimport TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport ViewDashboardOutline from 'vue-material-design-icons/ViewDashboardOutline.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { buildViewTree, labelsInUse, VIEW_GROUPS } from '../../utils/buildViewTree.js'\nimport { isOwnView, viewAccess } from '../../utils/savedViewHelpers.js'\n\n/**\n * CnSavedViewsControl — toolbar dropdown listing OpenRegister saved-search\n * views for the current index page (saved-views-ui).\n *\n * Purely presentational: the parent (CnIndexPage) owns fetching via\n * `useSavedViewsApi()` and all mutations; this control only lists the\n * given `views` and emits intents:\n *\n * - `@apply(view)` — a view entry was clicked; parent writes the view's\n * stored filters/search/sort into the route query.\n * - `@save-request()` — \"Save current view…\" clicked; parent opens\n * CnSaveViewDialog.\n * - `@delete-request(view)` — a view's trailing delete icon clicked; parent\n * opens a confirm dialog. Only rendered for views the current user owns\n * (`@self.access: owner`, else `view.owner === currentUserId`) — OpenRegister\n * refuses foreign deletes server-side anyway (owner-scoped 404).\n * - `@share-request(view)` — Share on an own view; parent opens the share dialog.\n * - `@update-request(view)` — Save on a view shared with write access; parent\n * saves the current state to it (never sending `sharedWith` or `owner`).\n * - `@presentation-request(view)` — Presentation on a view the user may edit\n * (`owner` or `write`); parent opens the presentation dialog (table, board, calendar).\n * - `@copy-request(view)` — \"Save as my view\" on a view shared read-only.\n *\n * Views shared with the user (`@self.access` `write` or `read`) list under\n * \"Shared with me\", next to \"My views\", once any exist; with none the list\n * renders as before.\n *\n * @event {object} apply — Apply the clicked view. Payload: the View API object.\n * @event {void} save-request — Open the save-current-view dialog.\n * @event {object} delete-request — Confirm-delete the clicked view. Payload: the View API object.\n * @event {object} share-request — Share the clicked own view. Payload: the View API object.\n * @event {object} update-request — Save the current state to the clicked writable shared view. Payload: the View API object.\n * @event {object} presentation-request — Change how the clicked view shows. Payload: the View API object.\n * @event {object} copy-request — Copy the clicked read-only shared view into a personal one. Payload: the View API object.\n */\nexport default {\n\tname: 'CnSavedViewsControl',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionButtonGroup,\n\t\tNcActionCaption,\n\t\tNcActionSeparator,\n\t\tBookmarkOutline,\n\t\tContentCopy,\n\t\tContentSaveOutline,\n\t\tEyeOutline,\n\t\tShareVariantOutline,\n\t\tTagOutline,\n\t\tTrashCanOutline,\n\t\tViewDashboardOutline,\n\t},\n\n\tinject: {\n\t\t/** The look CnAppRoot provides; `board` draws the views as chips. */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\t// The chips and the menu are two roots under the board look.\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/** Views to list (View API objects from `GET /apps/openregister/api/views`). */\n\t\tviews: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** True while the parent is fetching the view list. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The signed-in NC user id — gates the per-view delete affordance. */\n\t\tcurrentUserId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * How deep the tree indents before it flattens. Mirrors\n\t\t * `savedViewTree.maxDepth` in the manifest. Flattening is about\n\t\t * indentation only: a view past the bound still renders.\n\t\t */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/**\n\t\t * How many records each view matches, keyed by view id (or slug). A\n\t\t * view with a number here shows it after its name; a view can also\n\t\t * carry its own `count`. `null` (the default) shows no counts.\n\t\t *\n\t\t * @type {{[viewId: string]: number}|null}\n\t\t */\n\t\tcounts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The id (or slug) of the applied view; its chip renders selected under\n\t\t * the board look.\n\t\t */\n\t\tselectedViewId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['apply', 'copy-request', 'delete-request', 'presentation-request', 'save-request', 'share-request', 'update-request'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The label currently filtering the list, or '' for all of them. */\n\t\t\tlabelFilter: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the saved views draw as chips (the board look).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The views that get a chip: the top level of the tree, in tree order.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tchipRows() {\n\t\t\treturn this.rows.filter((row) => row.depth === 0)\n\t\t},\n\n\t\t/** @return {string} The dropdown trigger label. */\n\t\tmenuLabel() {\n\t\t\treturn t('nextcloud-vue', 'Views')\n\t\t},\n\n\t\t/** @return {string} The seeded group name, for the template. */\n\t\tSEEDED_GROUP() {\n\t\t\treturn VIEW_GROUPS.SEEDED\n\t\t},\n\n\t\t/**\n\t\t * The views in tree order, seeded first, filtered by the active label.\n\t\t *\n\t\t * @return {Array<object>} Rows of `{ view, depth, group, orphaned }`.\n\t\t */\n\t\trows() {\n\t\t\treturn buildViewTree({\n\t\t\t\tviews: this.views,\n\t\t\t\tlabelFilter: this.labelFilter,\n\t\t\t\tmaxDepth: this.maxDepth,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The rows in their sections. With no view shared with this user there\n\t\t * is one section without a caption, as the list always was. With\n\t\t * shared views: seeded views (no caption), \"My views\", \"Shared with me\".\n\t\t *\n\t\t * @return {Array<{key: string, label: string, rows: Array<object>}>} The sections.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\tsections() {\n\t\t\tconst shared = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) !== 'owner')\n\t\t\tif (shared.length === 0) {\n\t\t\t\treturn [{ key: 'all', label: '', rows: this.rows }]\n\t\t\t}\n\t\t\tconst seeded = this.rows.filter((r) => r.group === VIEW_GROUPS.SEEDED)\n\t\t\tconst mine = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) === 'owner')\n\t\t\treturn [\n\t\t\t\t{ key: 'seeded', label: '', rows: seeded },\n\t\t\t\t{ key: 'mine', label: t('nextcloud-vue', 'My views'), rows: mine },\n\t\t\t\t{ key: 'shared', label: t('nextcloud-vue', 'Shared with me'), rows: shared },\n\t\t\t].filter((section) => section.rows.length > 0)\n\t\t},\n\n\t\t/**\n\t\t * The labels already in use.\n\t\t *\n\t\t * Read from the UNFILTERED list on purpose: reading it from `rows`\n\t\t * would remove every other label from the menu the moment one was\n\t\t * chosen, and a filter you cannot change without clearing it first is\n\t\t * a filter people stop using.\n\t\t *\n\t\t * @return {Array<string>} The labels.\n\t\t */\n\t\tofferedLabels() {\n\t\t\treturn labelsInUse(this.views)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Whether a view's chip is the selected one.\n\t\t *\n\t\t * @param {object} view The view.\n\t\t * @return {boolean}\n\t\t */\n\t\tisChipSelected(view) {\n\t\t\treturn this.selectedViewId !== '' && (this.selectedViewId === String(view.id) || this.selectedViewId === String(view.slug))\n\t\t},\n\n\t\t/**\n\t\t * The name a row shows, indented to its depth.\n\t\t *\n\t\t * Indented with figure spaces rather than CSS padding because the row\n\t\t * is an `NcActionButton` whose label is read out as text: a screen\n\t\t * reader gets the same shape a sighted reader does, and no stylesheet\n\t\t * has to know about the tree.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @param {boolean} [withGroups] Append the groups the view is shared with.\n\t\t * @return {string} The name.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowName(row, withGroups = false) {\n\t\t\tconst groups = withGroups ? this.groupsOf(row.view) : ''\n\t\t\treturn `${'\\u2007'.repeat(row.depth * 2)}${this.nameWithCount(row.view)}${groups !== '' ? ` · ${groups}` : ''}`\n\t\t},\n\n\t\t/**\n\t\t * What the current user may do with a row's view.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {'owner'|'write'|'read'} The access.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\taccessOf(row) {\n\t\t\treturn viewAccess(row.view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * The groups a view is shared with, as text for the row.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The group ids, comma-separated; empty when none.\n\t\t */\n\t\tgroupsOf(view) {\n\t\t\treturn (Array.isArray(view.sharedWith) ? view.sharedWith : [])\n\t\t\t\t.map((e) => e && e.group)\n\t\t\t\t.filter((g) => typeof g === 'string' && g !== '')\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\tshareLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Share \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tupdateLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save the current view to \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tcopyLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save \"{name}\" as my view', { name: view.name })\n\t\t},\n\n\t\tpresentationLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Change how \"{name}\" shows', { name: view.name })\n\t\t},\n\n\t\tonPresentationRequest(view) {\n\t\t\t/**\n\t\t\t * @event presentation-request Presentation on an editable view; open the presentation dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('presentation-request', view)\n\t\t},\n\n\t\tonShareRequest(view) {\n\t\t\t/**\n\t\t\t * @event share-request Share on an own view; open the share dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('share-request', view)\n\t\t},\n\n\t\tonUpdateRequest(view) {\n\t\t\t/**\n\t\t\t * @event update-request Save on a writable shared view; save the current state to it.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('update-request', view)\n\t\t},\n\n\t\tonCopyRequest(view) {\n\t\t\t/**\n\t\t\t * @event copy-request \"Save as my view\" on a read-only shared view; store a personal copy.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('copy-request', view)\n\t\t},\n\n\t\t/**\n\t\t * The number of records a view matches, or null when none is known:\n\t\t * `counts[id]` (or `counts[slug]`) first, else the view's own `count`.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {number|null}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tcountOf(view) {\n\t\t\tconst counts = this.counts || {}\n\t\t\tlet value = counts[view.id]\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = counts[view.slug]\n\t\t\t}\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = view.count\n\t\t\t}\n\t\t\treturn (typeof value === 'number' && Number.isFinite(value)) ? value : null\n\t\t},\n\n\t\t/**\n\t\t * A view's name, followed by its count when one is known.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tnameWithCount(view) {\n\t\t\tconst count = this.countOf(view)\n\t\t\treturn count === null ? view.name : `${view.name} (${count})`\n\t\t},\n\n\t\t/**\n\t\t * What a row is called to somebody who cannot see the indentation.\n\t\t *\n\t\t * Says the level in words, and says when a view's parent is one this\n\t\t * reader cannot see. A child that silently sits at the root looks\n\t\t * exactly like a view that never had a parent.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {string} The accessible label.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowLabel(row) {\n\t\t\tconst viewName = this.nameWithCount(row.view)\n\t\t\tconst name = row.depth === 0\n\t\t\t\t? viewName\n\t\t\t\t: t('nextcloud-vue', '{name}, level {level}', { name: viewName, level: row.depth + 1 })\n\n\t\t\tif (row.orphaned !== true) {\n\t\t\t\treturn name\n\t\t\t}\n\n\t\t\treturn t('nextcloud-vue', '{name}. Parts of this view come from one you cannot see.', { name })\n\t\t},\n\n\t\t/**\n\t\t * The accessible label of a label filter entry.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFilterLabel(label) {\n\t\t\treturn this.labelFilter === label\n\t\t\t\t? t('nextcloud-vue', 'Stop filtering on \"{label}\"', { label })\n\t\t\t\t: t('nextcloud-vue', 'Show only views labelled \"{label}\"', { label })\n\t\t},\n\n\t\t/**\n\t\t * Turn a label filter on, or off when it is already on.\n\t\t *\n\t\t * Clicking the active label clears it, so the way out is the way in\n\t\t * rather than a second control somebody has to find.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t */\n\t\tonLabelFilter(label) {\n\t\t\tthis.labelFilter = this.labelFilter === label ? '' : label\n\t\t},\n\n\t\t/**\n\t\t * Whether the delete entry renders for a view.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {boolean} True when the current user owns the view.\n\t\t */\n\t\tisOwn(view) {\n\t\t\treturn isOwnView(view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * Accessible label for a view's delete entry.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The label.\n\t\t */\n\t\tdeleteLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Delete \"{name}\"', { name: view.name })\n\t\t},\n\n\t\t/**\n\t\t * View-entry click: hand the view to the parent to apply.\n\t\t *\n\t\t * @param {object} view The clicked View API object.\n\t\t */\n\t\tonApply(view) {\n\t\t\t/**\n\t\t\t * @event apply A view entry was clicked; apply its stored state.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('apply', view)\n\t\t},\n\n\t\t/**\n\t\t * \"Save current view…\" click: ask the parent to open the save dialog.\n\t\t */\n\t\tonSaveRequest() {\n\t\t\t/**\n\t\t\t * @event save-request \"Save current view…\" clicked; open the save dialog.\n\t\t\t */\n\t\t\tthis.$emit('save-request')\n\t\t},\n\n\t\t/**\n\t\t * Delete-entry click: hand the view to the parent to confirm-delete.\n\t\t *\n\t\t * @param {object} view The View API object to delete.\n\t\t */\n\t\tonDeleteRequest(view) {\n\t\t\t/**\n\t\t\t * @event delete-request A view's delete entry was clicked; confirm and delete.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('delete-request', view)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* NcActionButtonGroup gives every child `flex: 1 1` (equal width) by\n default; override so the name button grows and the delete icon stays\n compact. :deep() is required — these li's belong to NcActionButtonGroup's\n own scope, not this component's. */\n.cn-saved-view-row :deep(.nc-button-group-content) {\n\tgap: 0;\n}\n\n/* Anchored on the FIRST child, not the last: a row carries one or two buttons\n depending on ownership, so \"the last one\" is the name button on a row that\n has only that. */\n.cn-saved-view-row :deep(.nc-button-group-content > li) {\n\tflex: 0 0 auto;\n}\n\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child) {\n\tflex: 1 1 auto;\n}\n\n/* NcActionButtonGroup also centers .action-button content (fine for an\n icon-only toolbar button, wrong for a row with a name) — restore the\n normal left-aligned NcActionButton look for the name button. */\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child .action-button) {\n\tjustify-content: flex-start;\n}\n</style>\n"],"names":["t"],"mappings":";;;;;;;;;;;;;;AA8MA;AACC;AACA;AACA;;;;AAIA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;AAGD,aAAe;CACd,IAAI,EAAE,qBAAqB;;CAE3B,UAAU,EAAE;AACX,EAAA,SAAS;AACT,EAAA,cAAc;AACd,EAAA,mBAAmB;AACnB,EAAA,eAAe;AACf,EAAA,iBAAiB;AACjB,EAAA,eAAe;EACf,WAAW;AACX,EAAA,kBAAkB;EAClB,UAAU;AACV,EAAA,mBAAmB;EACnB,UAAU;AACV,EAAA,eAAe;AACf,EAAA,oBAAoB;EACpB;;AAED,CAAA,MAAM,EAAE;;EAEP,MAAM,EAAE,EAAE,OAAO,EAAE,WAAU,EAAG;EAChC;;;AAGD,CAAA,YAAY,EAAE,KAAK;;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AEA,GAAA,OAAOA,SAAC,CAAC,eAAe,EAAE,0DAA0D,EAAE,EAAE,MAAM,CAAA;GAC9F;;AAED;AACC;AACA;;;;EAID,gBAAgB,CAAC,KAAK,EAAE;GACvB,OAAO,IAAI,CAAC,WAAU,KAAM,KAAI;MAC7BA,SAAC,CAAC,eAAe,EAAE,6BAA6B,EAAE,EAAE,KAAI,EAAG,CAAA;MAC3DA,SAAC,CAAC,eAAe,EAAE,oCAAoC,EAAE,EAAE,KAAI,EAAG,CAAA;GACrE;;AAED;AACC;AACA;;AAEA;AACA;;;AAGD,EAAA,aAAa,CAAC,KAAK,EAAE;GACpB,IAAI,CAAC,WAAY,GAAE,IAAI,CAAC,WAAU,KAAM,QAAQ,KAAK,MAAI;GACzD;;AAED;AACC;AACA;AACA;;;EAGD,KAAK,CAAC,IAAI,EAAE;AACX,GAAA,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAA;GACzC;;AAED;AACC;AACA;AACA;;;AAGD,EAAA,WAAW,CAAC,IAAI,EAAE;GACjB,OAAOA,SAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAG,EAAG,CAAA;GAChE;;AAED;;AAEC;AACA;;EAED,OAAO,CAAC,IAAI,EAAE;AACb;;;;GAIA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAA;GACxB;;AAED;;;AAGA,EAAA,aAAa,GAAG;AACf;AACC;;GAED,IAAI,CAAC,KAAK,CAAC,cAAc,EAAA;GACzB;;AAED;;AAEC;AACA;;AAED,EAAA,eAAe,CAAC,IAAI,EAAE;AACrB;AACC;;;AAGD,GAAA,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAI,EAAA;GACjC;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnSavedViewsControl.vue2.js","sources":["../../../../src/components/CnSavedViewsControl/CnSavedViewsControl.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<!--\n\t\tBoard look: the saved views are a row of chips on the ground, each with\n\t\tits count, the selected one filled. The menu stays for managing views\n\t\t(apply, rename, share, delete) and is reached from the \"Save view\"\n\t\tbutton. Without the look the control is the menu alone, as before.\n\t-->\n\t<div\n\t\tv-if=\"isBoardLook && chipRows.length > 0\"\n\t\tclass=\"cn-saved-views__chips\"\n\t\trole=\"group\"\n\t\t:aria-label=\"t('nextcloud-vue', 'Saved views')\"\n\t\tdata-testid=\"cn-saved-views-chips\">\n\t\t<button\n\t\t\tv-for=\"row in chipRows\"\n\t\t\t:key=\"`chip-${row.view.id || row.view.slug}`\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cn-saved-views__chip\"\n\t\t\t:class=\"{ 'cn-saved-views__chip--selected': isChipSelected(row.view) }\"\n\t\t\t:aria-pressed=\"isChipSelected(row.view)\"\n\t\t\tdata-testid=\"cn-saved-views-chip\"\n\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t@click=\"onApply(row.view)\">\n\t\t\t<span class=\"cn-saved-views__chip-name\">{{ row.view.name }}</span>\n\t\t\t<span\n\t\t\t\tv-if=\"countOf(row.view) !== null\"\n\t\t\t\tclass=\"cn-saved-views__chip-count\"\n\t\t\t\tdata-testid=\"cn-saved-views-chip-count\">{{ countOf(row.view) }}</span>\n\t\t</button>\n\t</div>\n\t<NcActions\n\t\tv-bind=\"$attrs\"\n\t\t:class=\"{ 'cn-saved-views__save': isBoardLook }\"\n\t\t:forceMenu=\"true\"\n\t\t:forceName=\"true\"\n\t\t:menuName=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\"\n\t\tdata-testid=\"cn-saved-views-control\"\n\t\t:aria-label=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\">\n\t\t<template #icon>\n\t\t\t<ContentSaveOutline v-if=\"isBoardLook\" :size=\"14\" />\n\t\t\t<BookmarkOutline v-else :size=\"20\" />\n\t\t</template>\n\n\t\t<NcActionCaption :name=\"t('nextcloud-vue', 'Saved views')\" />\n\n\t\t<!-- Loading state -->\n\t\t<NcActionCaption\n\t\t\tv-if=\"loading\"\n\t\t\tdata-testid=\"cn-saved-views-loading\"\n\t\t\t:name=\"t('nextcloud-vue', 'Loading…')\" />\n\n\t\t<!-- Empty state -->\n\t\t<NcActionCaption\n\t\t\tv-else-if=\"views.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-empty\"\n\t\t\t:name=\"t('nextcloud-vue', 'No saved views yet')\" />\n\n\t\t<!-- The labels already in use, offered before anybody types a new one. -->\n\t\t<template v-if=\"!loading && offeredLabels.length > 0\">\n\t\t\t<NcActionButton\n\t\t\t\tv-for=\"label in offeredLabels\"\n\t\t\t\t:key=\"`label-${label}`\"\n\t\t\t\tdata-testid=\"cn-saved-views-label\"\n\t\t\t\t:data-label=\"label\"\n\t\t\t\t:modelValue=\"labelFilter === label\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:aria-label=\"labelFilterLabel(label)\"\n\t\t\t\t@click=\"onLabelFilter(label)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<TagOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ label }}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator />\n\t\t</template>\n\n\t\t<!--\n\t\t\tA label that matches nothing says so. Chained to the ROWS rather\n\t\t\tthan to the label list: written as an else-if of the labels block\n\t\t\tit only ever rendered on a page with no labels at all, which is\n\t\t\tthe one case it cannot be about.\n\t\t-->\n\t\t<NcActionCaption\n\t\t\tv-if=\"!loading && views.length > 0 && rows.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-none-for-label\"\n\t\t\t:name=\"t('nextcloud-vue', 'No views with this label')\" />\n\n\t\t<!-- One row per view, in tree order: the name applies it, a trailing\n\t\t icon button deletes it. NcActions only recognises NcAction* vnodes\n\t\t as menu items and silently drops anything else, so a row with more\n\t\t than one control has to be an NcActionButtonGroup. -->\n\t\t<template v-if=\"!loading\">\n\t\t\t<template v-for=\"section in sections\" :key=\"section.key\">\n\t\t\t\t<NcActionCaption\n\t\t\t\t\tv-if=\"section.label\"\n\t\t\t\t\t:data-testid=\"`cn-saved-views-section-${section.key}`\"\n\t\t\t\t\t:name=\"section.label\" />\n\t\t\t\t<NcActionButtonGroup\n\t\t\t\t\tv-for=\"row in section.rows\"\n\t\t\t\t\t:key=\"`view-${row.view.id || row.view.slug}`\"\n\t\t\t\t\tclass=\"cn-saved-view-row\">\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-item\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:data-depth=\"row.depth\"\n\t\t\t\t\t\t:data-group=\"row.group\"\n\t\t\t\t\t\t:data-access=\"accessOf(row)\"\n\t\t\t\t\t\t:aria-label=\"rowLabel(row)\"\n\t\t\t\t\t\t@click=\"onApply(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EyeOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ rowName(row, section.key === 'shared') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`share-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-share\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"shareLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onShareRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ShareVariantOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"(accessOf(row) === 'owner' || accessOf(row) === 'write') && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`presentation-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-presentation\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"presentationLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onPresentationRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ViewDashboardOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'write'\"\n\t\t\t\t\t\t:key=\"`update-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-update\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"updateLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onUpdateRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'read' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`copy-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-copy\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"copyLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onCopyRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentCopy :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`delete-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-delete\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"deleteLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onDeleteRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<TrashCanOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActionButtonGroup>\n\t\t\t</template>\n\t\t</template>\n\n\t\t<NcActionSeparator />\n\n\t\t<NcActionButton\n\t\t\tdata-testid=\"cn-saved-views-save\"\n\t\t\t:aria-label=\"t('nextcloud-vue', 'Save current view…')\"\n\t\t\t@click=\"onSaveRequest\">\n\t\t\t<template #icon>\n\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ t('nextcloud-vue', 'Save current view…') }}\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionButtonGroup, NcActionCaption, NcActions, NcActionSeparator } from '@nextcloud/vue'\nimport BookmarkOutline from 'vue-material-design-icons/BookmarkOutline.vue'\nimport ContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport ContentSaveOutline from 'vue-material-design-icons/ContentSaveOutline.vue'\nimport EyeOutline from 'vue-material-design-icons/EyeOutline.vue'\nimport ShareVariantOutline from 'vue-material-design-icons/ShareVariantOutline.vue'\nimport TagOutline from 'vue-material-design-icons/TagOutline.vue'\nimport TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport ViewDashboardOutline from 'vue-material-design-icons/ViewDashboardOutline.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { buildViewTree, labelsInUse, VIEW_GROUPS } from '../../utils/buildViewTree.js'\nimport { isOwnView, viewAccess } from '../../utils/savedViewHelpers.js'\n\n/**\n * CnSavedViewsControl — toolbar dropdown listing OpenRegister saved-search\n * views for the current index page (saved-views-ui).\n *\n * Purely presentational: the parent (CnIndexPage) owns fetching via\n * `useSavedViewsApi()` and all mutations; this control only lists the\n * given `views` and emits intents:\n *\n * - `@apply(view)` — a view entry was clicked; parent writes the view's\n * stored filters/search/sort into the route query.\n * - `@save-request()` — \"Save current view…\" clicked; parent opens\n * CnSaveViewDialog.\n * - `@delete-request(view)` — a view's trailing delete icon clicked; parent\n * opens a confirm dialog. Only rendered for views the current user owns\n * (`@self.access: owner`, else `view.owner === currentUserId`) — OpenRegister\n * refuses foreign deletes server-side anyway (owner-scoped 404).\n * - `@share-request(view)` — Share on an own view; parent opens the share dialog.\n * - `@update-request(view)` — Save on a view shared with write access; parent\n * saves the current state to it (never sending `sharedWith` or `owner`).\n * - `@presentation-request(view)` — Presentation on a view the user may edit\n * (`owner` or `write`); parent opens the presentation dialog (table, board, calendar).\n * - `@copy-request(view)` — \"Save as my view\" on a view shared read-only.\n *\n * Views shared with the user (`@self.access` `write` or `read`) list under\n * \"Shared with me\", next to \"My views\", once any exist; with none the list\n * renders as before.\n *\n * @event {object} apply — Apply the clicked view. Payload: the View API object.\n * @event {void} save-request — Open the save-current-view dialog.\n * @event {object} delete-request — Confirm-delete the clicked view. Payload: the View API object.\n * @event {object} share-request — Share the clicked own view. Payload: the View API object.\n * @event {object} update-request — Save the current state to the clicked writable shared view. Payload: the View API object.\n * @event {object} presentation-request — Change how the clicked view shows. Payload: the View API object.\n * @event {object} copy-request — Copy the clicked read-only shared view into a personal one. Payload: the View API object.\n */\nexport default {\n\tname: 'CnSavedViewsControl',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionButtonGroup,\n\t\tNcActionCaption,\n\t\tNcActionSeparator,\n\t\tBookmarkOutline,\n\t\tContentCopy,\n\t\tContentSaveOutline,\n\t\tEyeOutline,\n\t\tShareVariantOutline,\n\t\tTagOutline,\n\t\tTrashCanOutline,\n\t\tViewDashboardOutline,\n\t},\n\n\tinject: {\n\t\t/** The look CnAppRoot provides; `board` draws the views as chips. */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\t// The chips and the menu are two roots under the board look.\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/** Views to list (View API objects from `GET /apps/openregister/api/views`). */\n\t\tviews: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** True while the parent is fetching the view list. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The signed-in NC user id — gates the per-view delete affordance. */\n\t\tcurrentUserId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * How deep the tree indents before it flattens. Mirrors\n\t\t * `savedViewTree.maxDepth` in the manifest. Flattening is about\n\t\t * indentation only: a view past the bound still renders.\n\t\t */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/**\n\t\t * How many records each view matches, keyed by view id (or slug). A\n\t\t * view with a number here shows it after its name; a view can also\n\t\t * carry its own `count`. `null` (the default) shows no counts.\n\t\t *\n\t\t * @type {{[viewId: string]: number}|null}\n\t\t */\n\t\tcounts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The id (or slug) of the applied view; its chip renders selected under\n\t\t * the board look.\n\t\t */\n\t\tselectedViewId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['apply', 'copy-request', 'delete-request', 'presentation-request', 'save-request', 'share-request', 'update-request'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The label currently filtering the list, or '' for all of them. */\n\t\t\tlabelFilter: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the saved views draw as chips (the board look).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The views that get a chip: the top level of the tree, in tree order.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tchipRows() {\n\t\t\treturn this.rows.filter((row) => row.depth === 0)\n\t\t},\n\n\t\t/** @return {string} The dropdown trigger label. */\n\t\tmenuLabel() {\n\t\t\treturn t('nextcloud-vue', 'Views')\n\t\t},\n\n\t\t/** @return {string} The seeded group name, for the template. */\n\t\tSEEDED_GROUP() {\n\t\t\treturn VIEW_GROUPS.SEEDED\n\t\t},\n\n\t\t/**\n\t\t * The views in tree order, seeded first, filtered by the active label.\n\t\t *\n\t\t * @return {Array<object>} Rows of `{ view, depth, group, orphaned }`.\n\t\t */\n\t\trows() {\n\t\t\treturn buildViewTree({\n\t\t\t\tviews: this.views,\n\t\t\t\tlabelFilter: this.labelFilter,\n\t\t\t\tmaxDepth: this.maxDepth,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The rows in their sections. With no view shared with this user there\n\t\t * is one section without a caption, as the list always was. With\n\t\t * shared views: seeded views (no caption), \"My views\", \"Shared with me\".\n\t\t *\n\t\t * @return {Array<{key: string, label: string, rows: Array<object>}>} The sections.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\tsections() {\n\t\t\tconst shared = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) !== 'owner')\n\t\t\tif (shared.length === 0) {\n\t\t\t\treturn [{ key: 'all', label: '', rows: this.rows }]\n\t\t\t}\n\t\t\tconst seeded = this.rows.filter((r) => r.group === VIEW_GROUPS.SEEDED)\n\t\t\tconst mine = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) === 'owner')\n\t\t\treturn [\n\t\t\t\t{ key: 'seeded', label: '', rows: seeded },\n\t\t\t\t{ key: 'mine', label: t('nextcloud-vue', 'My views'), rows: mine },\n\t\t\t\t{ key: 'shared', label: t('nextcloud-vue', 'Shared with me'), rows: shared },\n\t\t\t].filter((section) => section.rows.length > 0)\n\t\t},\n\n\t\t/**\n\t\t * The labels already in use.\n\t\t *\n\t\t * Read from the UNFILTERED list on purpose: reading it from `rows`\n\t\t * would remove every other label from the menu the moment one was\n\t\t * chosen, and a filter you cannot change without clearing it first is\n\t\t * a filter people stop using.\n\t\t *\n\t\t * @return {Array<string>} The labels.\n\t\t */\n\t\tofferedLabels() {\n\t\t\treturn labelsInUse(this.views)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Whether a view's chip is the selected one.\n\t\t *\n\t\t * @param {object} view The view.\n\t\t * @return {boolean}\n\t\t */\n\t\tisChipSelected(view) {\n\t\t\treturn this.selectedViewId !== '' && (this.selectedViewId === String(view.id) || this.selectedViewId === String(view.slug))\n\t\t},\n\n\t\t/**\n\t\t * The name a row shows, indented to its depth.\n\t\t *\n\t\t * Indented with figure spaces rather than CSS padding because the row\n\t\t * is an `NcActionButton` whose label is read out as text: a screen\n\t\t * reader gets the same shape a sighted reader does, and no stylesheet\n\t\t * has to know about the tree.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @param {boolean} [withGroups] Append the groups the view is shared with.\n\t\t * @return {string} The name.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowName(row, withGroups = false) {\n\t\t\tconst groups = withGroups ? this.groupsOf(row.view) : ''\n\t\t\treturn `${'\\u2007'.repeat(row.depth * 2)}${this.nameWithCount(row.view)}${groups !== '' ? ` · ${groups}` : ''}`\n\t\t},\n\n\t\t/**\n\t\t * What the current user may do with a row's view.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {'owner'|'write'|'read'} The access.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\taccessOf(row) {\n\t\t\treturn viewAccess(row.view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * The groups a view is shared with, as text for the row.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The group ids, comma-separated; empty when none.\n\t\t */\n\t\tgroupsOf(view) {\n\t\t\treturn (Array.isArray(view.sharedWith) ? view.sharedWith : [])\n\t\t\t\t.map((e) => e && e.group)\n\t\t\t\t.filter((g) => typeof g === 'string' && g !== '')\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\tshareLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Share \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tupdateLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save the current view to \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tcopyLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save \"{name}\" as my view', { name: view.name })\n\t\t},\n\n\t\tpresentationLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Change how \"{name}\" shows', { name: view.name })\n\t\t},\n\n\t\tonPresentationRequest(view) {\n\t\t\t/**\n\t\t\t * @event presentation-request Presentation on an editable view; open the presentation dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('presentation-request', view)\n\t\t},\n\n\t\tonShareRequest(view) {\n\t\t\t/**\n\t\t\t * @event share-request Share on an own view; open the share dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('share-request', view)\n\t\t},\n\n\t\tonUpdateRequest(view) {\n\t\t\t/**\n\t\t\t * @event update-request Save on a writable shared view; save the current state to it.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('update-request', view)\n\t\t},\n\n\t\tonCopyRequest(view) {\n\t\t\t/**\n\t\t\t * @event copy-request \"Save as my view\" on a read-only shared view; store a personal copy.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('copy-request', view)\n\t\t},\n\n\t\t/**\n\t\t * The number of records a view matches, or null when none is known:\n\t\t * `counts[id]` (or `counts[slug]`) first, else the view's own `count`.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {number|null}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tcountOf(view) {\n\t\t\tconst counts = this.counts || {}\n\t\t\tlet value = counts[view.id]\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = counts[view.slug]\n\t\t\t}\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = view.count\n\t\t\t}\n\t\t\treturn (typeof value === 'number' && Number.isFinite(value)) ? value : null\n\t\t},\n\n\t\t/**\n\t\t * A view's name, followed by its count when one is known.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tnameWithCount(view) {\n\t\t\tconst count = this.countOf(view)\n\t\t\treturn count === null ? view.name : `${view.name} (${count})`\n\t\t},\n\n\t\t/**\n\t\t * What a row is called to somebody who cannot see the indentation.\n\t\t *\n\t\t * Says the level in words, and says when a view's parent is one this\n\t\t * reader cannot see. A child that silently sits at the root looks\n\t\t * exactly like a view that never had a parent.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {string} The accessible label.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowLabel(row) {\n\t\t\tconst viewName = this.nameWithCount(row.view)\n\t\t\tconst name = row.depth === 0\n\t\t\t\t? viewName\n\t\t\t\t: t('nextcloud-vue', '{name}, level {level}', { name: viewName, level: row.depth + 1 })\n\n\t\t\tif (row.orphaned !== true) {\n\t\t\t\treturn name\n\t\t\t}\n\n\t\t\treturn t('nextcloud-vue', '{name}. Parts of this view come from one you cannot see.', { name })\n\t\t},\n\n\t\t/**\n\t\t * The accessible label of a label filter entry.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFilterLabel(label) {\n\t\t\treturn this.labelFilter === label\n\t\t\t\t? t('nextcloud-vue', 'Stop filtering on \"{label}\"', { label })\n\t\t\t\t: t('nextcloud-vue', 'Show only views labelled \"{label}\"', { label })\n\t\t},\n\n\t\t/**\n\t\t * Turn a label filter on, or off when it is already on.\n\t\t *\n\t\t * Clicking the active label clears it, so the way out is the way in\n\t\t * rather than a second control somebody has to find.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t */\n\t\tonLabelFilter(label) {\n\t\t\tthis.labelFilter = this.labelFilter === label ? '' : label\n\t\t},\n\n\t\t/**\n\t\t * Whether the delete entry renders for a view.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {boolean} True when the current user owns the view.\n\t\t */\n\t\tisOwn(view) {\n\t\t\treturn isOwnView(view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * Accessible label for a view's delete entry.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The label.\n\t\t */\n\t\tdeleteLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Delete \"{name}\"', { name: view.name })\n\t\t},\n\n\t\t/**\n\t\t * View-entry click: hand the view to the parent to apply.\n\t\t *\n\t\t * @param {object} view The clicked View API object.\n\t\t */\n\t\tonApply(view) {\n\t\t\t/**\n\t\t\t * @event apply A view entry was clicked; apply its stored state.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('apply', view)\n\t\t},\n\n\t\t/**\n\t\t * \"Save current view…\" click: ask the parent to open the save dialog.\n\t\t */\n\t\tonSaveRequest() {\n\t\t\t/**\n\t\t\t * @event save-request \"Save current view…\" clicked; open the save dialog.\n\t\t\t */\n\t\t\tthis.$emit('save-request')\n\t\t},\n\n\t\t/**\n\t\t * Delete-entry click: hand the view to the parent to confirm-delete.\n\t\t *\n\t\t * @param {object} view The View API object to delete.\n\t\t */\n\t\tonDeleteRequest(view) {\n\t\t\t/**\n\t\t\t * @event delete-request A view's delete entry was clicked; confirm and delete.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('delete-request', view)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* NcActionButtonGroup gives every child `flex: 1 1` (equal width) by\n default; override so the name button grows and the delete icon stays\n compact. :deep() is required — these li's belong to NcActionButtonGroup's\n own scope, not this component's. */\n.cn-saved-view-row :deep(.nc-button-group-content) {\n\tgap: 0;\n}\n\n/* Anchored on the FIRST child, not the last: a row carries one or two buttons\n depending on ownership, so \"the last one\" is the name button on a row that\n has only that. */\n.cn-saved-view-row :deep(.nc-button-group-content > li) {\n\tflex: 0 0 auto;\n}\n\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child) {\n\tflex: 1 1 auto;\n}\n\n/* NcActionButtonGroup also centers .action-button content (fine for an\n icon-only toolbar button, wrong for a row with a name) — restore the\n normal left-aligned NcActionButton look for the name button. */\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child .action-button) {\n\tjustify-content: flex-start;\n}\n</style>\n"],"names":["t"],"mappings":";;;;;;;;;;;;;;AA8MA;AACC;AACA;AACA;;;;AAIA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;AAGD,aAAe;CACd,IAAI,EAAE,qBAAqB;;CAE3B,UAAU,EAAE;AACX,EAAA,SAAS;AACT,EAAA,cAAc;AACd,EAAA,mBAAmB;AACnB,EAAA,eAAe;AACf,EAAA,iBAAiB;AACjB,EAAA,eAAe;EACf,WAAW;AACX,EAAA,kBAAkB;EAClB,UAAU;AACV,EAAA,mBAAmB;EACnB,UAAU;AACV,EAAA,eAAe;AACf,EAAA,oBAAoB;EACpB;;AAED,CAAA,MAAM,EAAE;;EAEP,MAAM,EAAE,EAAE,OAAO,EAAE,WAAU,EAAG;EACh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Look)
|
|
64
64
|
? (openBlock(), createBlock(_component_ContentSaveOutline, {
|
|
65
65
|
key: 0,
|
|
66
|
-
size:
|
|
66
|
+
size: 14
|
|
67
67
|
}))
|
|
68
68
|
: (openBlock(), createBlock(_component_BookmarkOutline, {
|
|
69
69
|
key: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnSavedViewsControl.vue3.js","sources":["../../../../src/components/CnSavedViewsControl/CnSavedViewsControl.vue?vue&type=template&id=9dd8cb32&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<!--\n\t\tBoard look: the saved views are a row of chips on the ground, each with\n\t\tits count, the selected one filled. The menu stays for managing views\n\t\t(apply, rename, share, delete) and is reached from the \"Save view\"\n\t\tbutton. Without the look the control is the menu alone, as before.\n\t-->\n\t<div\n\t\tv-if=\"isBoardLook && chipRows.length > 0\"\n\t\tclass=\"cn-saved-views__chips\"\n\t\trole=\"group\"\n\t\t:aria-label=\"t('nextcloud-vue', 'Saved views')\"\n\t\tdata-testid=\"cn-saved-views-chips\">\n\t\t<button\n\t\t\tv-for=\"row in chipRows\"\n\t\t\t:key=\"`chip-${row.view.id || row.view.slug}`\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cn-saved-views__chip\"\n\t\t\t:class=\"{ 'cn-saved-views__chip--selected': isChipSelected(row.view) }\"\n\t\t\t:aria-pressed=\"isChipSelected(row.view)\"\n\t\t\tdata-testid=\"cn-saved-views-chip\"\n\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t@click=\"onApply(row.view)\">\n\t\t\t<span class=\"cn-saved-views__chip-name\">{{ row.view.name }}</span>\n\t\t\t<span\n\t\t\t\tv-if=\"countOf(row.view) !== null\"\n\t\t\t\tclass=\"cn-saved-views__chip-count\"\n\t\t\t\tdata-testid=\"cn-saved-views-chip-count\">{{ countOf(row.view) }}</span>\n\t\t</button>\n\t</div>\n\t<NcActions\n\t\tv-bind=\"$attrs\"\n\t\t:class=\"{ 'cn-saved-views__save': isBoardLook }\"\n\t\t:forceMenu=\"true\"\n\t\t:forceName=\"true\"\n\t\t:menuName=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\"\n\t\tdata-testid=\"cn-saved-views-control\"\n\t\t:aria-label=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\">\n\t\t<template #icon>\n\t\t\t<ContentSaveOutline v-if=\"isBoardLook\" :size=\"18\" />\n\t\t\t<BookmarkOutline v-else :size=\"20\" />\n\t\t</template>\n\n\t\t<NcActionCaption :name=\"t('nextcloud-vue', 'Saved views')\" />\n\n\t\t<!-- Loading state -->\n\t\t<NcActionCaption\n\t\t\tv-if=\"loading\"\n\t\t\tdata-testid=\"cn-saved-views-loading\"\n\t\t\t:name=\"t('nextcloud-vue', 'Loading…')\" />\n\n\t\t<!-- Empty state -->\n\t\t<NcActionCaption\n\t\t\tv-else-if=\"views.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-empty\"\n\t\t\t:name=\"t('nextcloud-vue', 'No saved views yet')\" />\n\n\t\t<!-- The labels already in use, offered before anybody types a new one. -->\n\t\t<template v-if=\"!loading && offeredLabels.length > 0\">\n\t\t\t<NcActionButton\n\t\t\t\tv-for=\"label in offeredLabels\"\n\t\t\t\t:key=\"`label-${label}`\"\n\t\t\t\tdata-testid=\"cn-saved-views-label\"\n\t\t\t\t:data-label=\"label\"\n\t\t\t\t:modelValue=\"labelFilter === label\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:aria-label=\"labelFilterLabel(label)\"\n\t\t\t\t@click=\"onLabelFilter(label)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<TagOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ label }}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator />\n\t\t</template>\n\n\t\t<!--\n\t\t\tA label that matches nothing says so. Chained to the ROWS rather\n\t\t\tthan to the label list: written as an else-if of the labels block\n\t\t\tit only ever rendered on a page with no labels at all, which is\n\t\t\tthe one case it cannot be about.\n\t\t-->\n\t\t<NcActionCaption\n\t\t\tv-if=\"!loading && views.length > 0 && rows.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-none-for-label\"\n\t\t\t:name=\"t('nextcloud-vue', 'No views with this label')\" />\n\n\t\t<!-- One row per view, in tree order: the name applies it, a trailing\n\t\t icon button deletes it. NcActions only recognises NcAction* vnodes\n\t\t as menu items and silently drops anything else, so a row with more\n\t\t than one control has to be an NcActionButtonGroup. -->\n\t\t<template v-if=\"!loading\">\n\t\t\t<template v-for=\"section in sections\" :key=\"section.key\">\n\t\t\t\t<NcActionCaption\n\t\t\t\t\tv-if=\"section.label\"\n\t\t\t\t\t:data-testid=\"`cn-saved-views-section-${section.key}`\"\n\t\t\t\t\t:name=\"section.label\" />\n\t\t\t\t<NcActionButtonGroup\n\t\t\t\t\tv-for=\"row in section.rows\"\n\t\t\t\t\t:key=\"`view-${row.view.id || row.view.slug}`\"\n\t\t\t\t\tclass=\"cn-saved-view-row\">\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-item\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:data-depth=\"row.depth\"\n\t\t\t\t\t\t:data-group=\"row.group\"\n\t\t\t\t\t\t:data-access=\"accessOf(row)\"\n\t\t\t\t\t\t:aria-label=\"rowLabel(row)\"\n\t\t\t\t\t\t@click=\"onApply(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EyeOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ rowName(row, section.key === 'shared') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`share-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-share\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"shareLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onShareRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ShareVariantOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"(accessOf(row) === 'owner' || accessOf(row) === 'write') && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`presentation-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-presentation\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"presentationLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onPresentationRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ViewDashboardOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'write'\"\n\t\t\t\t\t\t:key=\"`update-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-update\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"updateLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onUpdateRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'read' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`copy-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-copy\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"copyLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onCopyRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentCopy :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`delete-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-delete\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"deleteLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onDeleteRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<TrashCanOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActionButtonGroup>\n\t\t\t</template>\n\t\t</template>\n\n\t\t<NcActionSeparator />\n\n\t\t<NcActionButton\n\t\t\tdata-testid=\"cn-saved-views-save\"\n\t\t\t:aria-label=\"t('nextcloud-vue', 'Save current view…')\"\n\t\t\t@click=\"onSaveRequest\">\n\t\t\t<template #icon>\n\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ t('nextcloud-vue', 'Save current view…') }}\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionButtonGroup, NcActionCaption, NcActions, NcActionSeparator } from '@nextcloud/vue'\nimport BookmarkOutline from 'vue-material-design-icons/BookmarkOutline.vue'\nimport ContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport ContentSaveOutline from 'vue-material-design-icons/ContentSaveOutline.vue'\nimport EyeOutline from 'vue-material-design-icons/EyeOutline.vue'\nimport ShareVariantOutline from 'vue-material-design-icons/ShareVariantOutline.vue'\nimport TagOutline from 'vue-material-design-icons/TagOutline.vue'\nimport TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport ViewDashboardOutline from 'vue-material-design-icons/ViewDashboardOutline.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { buildViewTree, labelsInUse, VIEW_GROUPS } from '../../utils/buildViewTree.js'\nimport { isOwnView, viewAccess } from '../../utils/savedViewHelpers.js'\n\n/**\n * CnSavedViewsControl — toolbar dropdown listing OpenRegister saved-search\n * views for the current index page (saved-views-ui).\n *\n * Purely presentational: the parent (CnIndexPage) owns fetching via\n * `useSavedViewsApi()` and all mutations; this control only lists the\n * given `views` and emits intents:\n *\n * - `@apply(view)` — a view entry was clicked; parent writes the view's\n * stored filters/search/sort into the route query.\n * - `@save-request()` — \"Save current view…\" clicked; parent opens\n * CnSaveViewDialog.\n * - `@delete-request(view)` — a view's trailing delete icon clicked; parent\n * opens a confirm dialog. Only rendered for views the current user owns\n * (`@self.access: owner`, else `view.owner === currentUserId`) — OpenRegister\n * refuses foreign deletes server-side anyway (owner-scoped 404).\n * - `@share-request(view)` — Share on an own view; parent opens the share dialog.\n * - `@update-request(view)` — Save on a view shared with write access; parent\n * saves the current state to it (never sending `sharedWith` or `owner`).\n * - `@presentation-request(view)` — Presentation on a view the user may edit\n * (`owner` or `write`); parent opens the presentation dialog (table, board, calendar).\n * - `@copy-request(view)` — \"Save as my view\" on a view shared read-only.\n *\n * Views shared with the user (`@self.access` `write` or `read`) list under\n * \"Shared with me\", next to \"My views\", once any exist; with none the list\n * renders as before.\n *\n * @event {object} apply — Apply the clicked view. Payload: the View API object.\n * @event {void} save-request — Open the save-current-view dialog.\n * @event {object} delete-request — Confirm-delete the clicked view. Payload: the View API object.\n * @event {object} share-request — Share the clicked own view. Payload: the View API object.\n * @event {object} update-request — Save the current state to the clicked writable shared view. Payload: the View API object.\n * @event {object} presentation-request — Change how the clicked view shows. Payload: the View API object.\n * @event {object} copy-request — Copy the clicked read-only shared view into a personal one. Payload: the View API object.\n */\nexport default {\n\tname: 'CnSavedViewsControl',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionButtonGroup,\n\t\tNcActionCaption,\n\t\tNcActionSeparator,\n\t\tBookmarkOutline,\n\t\tContentCopy,\n\t\tContentSaveOutline,\n\t\tEyeOutline,\n\t\tShareVariantOutline,\n\t\tTagOutline,\n\t\tTrashCanOutline,\n\t\tViewDashboardOutline,\n\t},\n\n\tinject: {\n\t\t/** The look CnAppRoot provides; `board` draws the views as chips. */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\t// The chips and the menu are two roots under the board look.\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/** Views to list (View API objects from `GET /apps/openregister/api/views`). */\n\t\tviews: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** True while the parent is fetching the view list. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The signed-in NC user id — gates the per-view delete affordance. */\n\t\tcurrentUserId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * How deep the tree indents before it flattens. Mirrors\n\t\t * `savedViewTree.maxDepth` in the manifest. Flattening is about\n\t\t * indentation only: a view past the bound still renders.\n\t\t */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/**\n\t\t * How many records each view matches, keyed by view id (or slug). A\n\t\t * view with a number here shows it after its name; a view can also\n\t\t * carry its own `count`. `null` (the default) shows no counts.\n\t\t *\n\t\t * @type {{[viewId: string]: number}|null}\n\t\t */\n\t\tcounts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The id (or slug) of the applied view; its chip renders selected under\n\t\t * the board look.\n\t\t */\n\t\tselectedViewId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['apply', 'copy-request', 'delete-request', 'presentation-request', 'save-request', 'share-request', 'update-request'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The label currently filtering the list, or '' for all of them. */\n\t\t\tlabelFilter: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the saved views draw as chips (the board look).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The views that get a chip: the top level of the tree, in tree order.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tchipRows() {\n\t\t\treturn this.rows.filter((row) => row.depth === 0)\n\t\t},\n\n\t\t/** @return {string} The dropdown trigger label. */\n\t\tmenuLabel() {\n\t\t\treturn t('nextcloud-vue', 'Views')\n\t\t},\n\n\t\t/** @return {string} The seeded group name, for the template. */\n\t\tSEEDED_GROUP() {\n\t\t\treturn VIEW_GROUPS.SEEDED\n\t\t},\n\n\t\t/**\n\t\t * The views in tree order, seeded first, filtered by the active label.\n\t\t *\n\t\t * @return {Array<object>} Rows of `{ view, depth, group, orphaned }`.\n\t\t */\n\t\trows() {\n\t\t\treturn buildViewTree({\n\t\t\t\tviews: this.views,\n\t\t\t\tlabelFilter: this.labelFilter,\n\t\t\t\tmaxDepth: this.maxDepth,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The rows in their sections. With no view shared with this user there\n\t\t * is one section without a caption, as the list always was. With\n\t\t * shared views: seeded views (no caption), \"My views\", \"Shared with me\".\n\t\t *\n\t\t * @return {Array<{key: string, label: string, rows: Array<object>}>} The sections.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\tsections() {\n\t\t\tconst shared = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) !== 'owner')\n\t\t\tif (shared.length === 0) {\n\t\t\t\treturn [{ key: 'all', label: '', rows: this.rows }]\n\t\t\t}\n\t\t\tconst seeded = this.rows.filter((r) => r.group === VIEW_GROUPS.SEEDED)\n\t\t\tconst mine = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) === 'owner')\n\t\t\treturn [\n\t\t\t\t{ key: 'seeded', label: '', rows: seeded },\n\t\t\t\t{ key: 'mine', label: t('nextcloud-vue', 'My views'), rows: mine },\n\t\t\t\t{ key: 'shared', label: t('nextcloud-vue', 'Shared with me'), rows: shared },\n\t\t\t].filter((section) => section.rows.length > 0)\n\t\t},\n\n\t\t/**\n\t\t * The labels already in use.\n\t\t *\n\t\t * Read from the UNFILTERED list on purpose: reading it from `rows`\n\t\t * would remove every other label from the menu the moment one was\n\t\t * chosen, and a filter you cannot change without clearing it first is\n\t\t * a filter people stop using.\n\t\t *\n\t\t * @return {Array<string>} The labels.\n\t\t */\n\t\tofferedLabels() {\n\t\t\treturn labelsInUse(this.views)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Whether a view's chip is the selected one.\n\t\t *\n\t\t * @param {object} view The view.\n\t\t * @return {boolean}\n\t\t */\n\t\tisChipSelected(view) {\n\t\t\treturn this.selectedViewId !== '' && (this.selectedViewId === String(view.id) || this.selectedViewId === String(view.slug))\n\t\t},\n\n\t\t/**\n\t\t * The name a row shows, indented to its depth.\n\t\t *\n\t\t * Indented with figure spaces rather than CSS padding because the row\n\t\t * is an `NcActionButton` whose label is read out as text: a screen\n\t\t * reader gets the same shape a sighted reader does, and no stylesheet\n\t\t * has to know about the tree.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @param {boolean} [withGroups] Append the groups the view is shared with.\n\t\t * @return {string} The name.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowName(row, withGroups = false) {\n\t\t\tconst groups = withGroups ? this.groupsOf(row.view) : ''\n\t\t\treturn `${'\\u2007'.repeat(row.depth * 2)}${this.nameWithCount(row.view)}${groups !== '' ? ` · ${groups}` : ''}`\n\t\t},\n\n\t\t/**\n\t\t * What the current user may do with a row's view.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {'owner'|'write'|'read'} The access.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\taccessOf(row) {\n\t\t\treturn viewAccess(row.view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * The groups a view is shared with, as text for the row.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The group ids, comma-separated; empty when none.\n\t\t */\n\t\tgroupsOf(view) {\n\t\t\treturn (Array.isArray(view.sharedWith) ? view.sharedWith : [])\n\t\t\t\t.map((e) => e && e.group)\n\t\t\t\t.filter((g) => typeof g === 'string' && g !== '')\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\tshareLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Share \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tupdateLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save the current view to \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tcopyLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save \"{name}\" as my view', { name: view.name })\n\t\t},\n\n\t\tpresentationLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Change how \"{name}\" shows', { name: view.name })\n\t\t},\n\n\t\tonPresentationRequest(view) {\n\t\t\t/**\n\t\t\t * @event presentation-request Presentation on an editable view; open the presentation dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('presentation-request', view)\n\t\t},\n\n\t\tonShareRequest(view) {\n\t\t\t/**\n\t\t\t * @event share-request Share on an own view; open the share dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('share-request', view)\n\t\t},\n\n\t\tonUpdateRequest(view) {\n\t\t\t/**\n\t\t\t * @event update-request Save on a writable shared view; save the current state to it.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('update-request', view)\n\t\t},\n\n\t\tonCopyRequest(view) {\n\t\t\t/**\n\t\t\t * @event copy-request \"Save as my view\" on a read-only shared view; store a personal copy.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('copy-request', view)\n\t\t},\n\n\t\t/**\n\t\t * The number of records a view matches, or null when none is known:\n\t\t * `counts[id]` (or `counts[slug]`) first, else the view's own `count`.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {number|null}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tcountOf(view) {\n\t\t\tconst counts = this.counts || {}\n\t\t\tlet value = counts[view.id]\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = counts[view.slug]\n\t\t\t}\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = view.count\n\t\t\t}\n\t\t\treturn (typeof value === 'number' && Number.isFinite(value)) ? value : null\n\t\t},\n\n\t\t/**\n\t\t * A view's name, followed by its count when one is known.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tnameWithCount(view) {\n\t\t\tconst count = this.countOf(view)\n\t\t\treturn count === null ? view.name : `${view.name} (${count})`\n\t\t},\n\n\t\t/**\n\t\t * What a row is called to somebody who cannot see the indentation.\n\t\t *\n\t\t * Says the level in words, and says when a view's parent is one this\n\t\t * reader cannot see. A child that silently sits at the root looks\n\t\t * exactly like a view that never had a parent.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {string} The accessible label.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowLabel(row) {\n\t\t\tconst viewName = this.nameWithCount(row.view)\n\t\t\tconst name = row.depth === 0\n\t\t\t\t? viewName\n\t\t\t\t: t('nextcloud-vue', '{name}, level {level}', { name: viewName, level: row.depth + 1 })\n\n\t\t\tif (row.orphaned !== true) {\n\t\t\t\treturn name\n\t\t\t}\n\n\t\t\treturn t('nextcloud-vue', '{name}. Parts of this view come from one you cannot see.', { name })\n\t\t},\n\n\t\t/**\n\t\t * The accessible label of a label filter entry.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFilterLabel(label) {\n\t\t\treturn this.labelFilter === label\n\t\t\t\t? t('nextcloud-vue', 'Stop filtering on \"{label}\"', { label })\n\t\t\t\t: t('nextcloud-vue', 'Show only views labelled \"{label}\"', { label })\n\t\t},\n\n\t\t/**\n\t\t * Turn a label filter on, or off when it is already on.\n\t\t *\n\t\t * Clicking the active label clears it, so the way out is the way in\n\t\t * rather than a second control somebody has to find.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t */\n\t\tonLabelFilter(label) {\n\t\t\tthis.labelFilter = this.labelFilter === label ? '' : label\n\t\t},\n\n\t\t/**\n\t\t * Whether the delete entry renders for a view.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {boolean} True when the current user owns the view.\n\t\t */\n\t\tisOwn(view) {\n\t\t\treturn isOwnView(view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * Accessible label for a view's delete entry.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The label.\n\t\t */\n\t\tdeleteLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Delete \"{name}\"', { name: view.name })\n\t\t},\n\n\t\t/**\n\t\t * View-entry click: hand the view to the parent to apply.\n\t\t *\n\t\t * @param {object} view The clicked View API object.\n\t\t */\n\t\tonApply(view) {\n\t\t\t/**\n\t\t\t * @event apply A view entry was clicked; apply its stored state.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('apply', view)\n\t\t},\n\n\t\t/**\n\t\t * \"Save current view…\" click: ask the parent to open the save dialog.\n\t\t */\n\t\tonSaveRequest() {\n\t\t\t/**\n\t\t\t * @event save-request \"Save current view…\" clicked; open the save dialog.\n\t\t\t */\n\t\t\tthis.$emit('save-request')\n\t\t},\n\n\t\t/**\n\t\t * Delete-entry click: hand the view to the parent to confirm-delete.\n\t\t *\n\t\t * @param {object} view The View API object to delete.\n\t\t */\n\t\tonDeleteRequest(view) {\n\t\t\t/**\n\t\t\t * @event delete-request A view's delete entry was clicked; confirm and delete.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('delete-request', view)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* NcActionButtonGroup gives every child `flex: 1 1` (equal width) by\n default; override so the name button grows and the delete icon stays\n compact. :deep() is required — these li's belong to NcActionButtonGroup's\n own scope, not this component's. */\n.cn-saved-view-row :deep(.nc-button-group-content) {\n\tgap: 0;\n}\n\n/* Anchored on the FIRST child, not the last: a row carries one or two buttons\n depending on ownership, so \"the last one\" is the name button on a row that\n has only that. */\n.cn-saved-view-row :deep(.nc-button-group-content > li) {\n\tflex: 0 0 auto;\n}\n\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child) {\n\tflex: 1 1 auto;\n}\n\n/* NcActionButtonGroup also centers .action-button content (fine for an\n icon-only toolbar button, wrong for a row with a name) — restore the\n normal left-aligned NcActionButton look for the name button. */\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child .action-button) {\n\tjustify-content: flex-start;\n}\n</style>\n"],"names":["_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_openBlock","_createVNode","_mergeProps","_createBlock","_createTextVNode"],"mappings":";;;;AA+BS,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAA2B,GAAA;;;AAGtC,EAAA,KAA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AW,EAAC,uBAAG;4BACd,cAAY,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,GAAA,CAAA,IAAA,CAAA,IAAA;AAC7B,4BAAA,YAAS,EAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,IAAA,CAAA;AACT,4BAAA,OAAK,EAAE,MAAA,KAAA,QAAA,CAAA,eAAO,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA;;AACJ,4BAAA,IAAI,UACd,MAAM;8BAANF,WAAM,CAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;mBAOU,CAAA,4BAAA,CAAA;QAEpBA;AACC,UAAA,aAAU,EAAC,qBAAqB;AAChC,UAAA,YAAS,EAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,oBAAA,CAAA;AACT,UAAA,OAAK,EAAE,QAAY,CAAA,aAAA;;AACT,UAAA,IAAI,UACd,MAAQ;YAARA,WAAQ,CAAA,6BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnSavedViewsControl.vue3.js","sources":["../../../../src/components/CnSavedViewsControl/CnSavedViewsControl.vue?vue&type=template&id=9dd8cb32&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<!--\n\t\tBoard look: the saved views are a row of chips on the ground, each with\n\t\tits count, the selected one filled. The menu stays for managing views\n\t\t(apply, rename, share, delete) and is reached from the \"Save view\"\n\t\tbutton. Without the look the control is the menu alone, as before.\n\t-->\n\t<div\n\t\tv-if=\"isBoardLook && chipRows.length > 0\"\n\t\tclass=\"cn-saved-views__chips\"\n\t\trole=\"group\"\n\t\t:aria-label=\"t('nextcloud-vue', 'Saved views')\"\n\t\tdata-testid=\"cn-saved-views-chips\">\n\t\t<button\n\t\t\tv-for=\"row in chipRows\"\n\t\t\t:key=\"`chip-${row.view.id || row.view.slug}`\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cn-saved-views__chip\"\n\t\t\t:class=\"{ 'cn-saved-views__chip--selected': isChipSelected(row.view) }\"\n\t\t\t:aria-pressed=\"isChipSelected(row.view)\"\n\t\t\tdata-testid=\"cn-saved-views-chip\"\n\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t@click=\"onApply(row.view)\">\n\t\t\t<span class=\"cn-saved-views__chip-name\">{{ row.view.name }}</span>\n\t\t\t<span\n\t\t\t\tv-if=\"countOf(row.view) !== null\"\n\t\t\t\tclass=\"cn-saved-views__chip-count\"\n\t\t\t\tdata-testid=\"cn-saved-views-chip-count\">{{ countOf(row.view) }}</span>\n\t\t</button>\n\t</div>\n\t<NcActions\n\t\tv-bind=\"$attrs\"\n\t\t:class=\"{ 'cn-saved-views__save': isBoardLook }\"\n\t\t:forceMenu=\"true\"\n\t\t:forceName=\"true\"\n\t\t:menuName=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\"\n\t\tdata-testid=\"cn-saved-views-control\"\n\t\t:aria-label=\"isBoardLook ? t('nextcloud-vue', 'Save view') : menuLabel\">\n\t\t<template #icon>\n\t\t\t<ContentSaveOutline v-if=\"isBoardLook\" :size=\"14\" />\n\t\t\t<BookmarkOutline v-else :size=\"20\" />\n\t\t</template>\n\n\t\t<NcActionCaption :name=\"t('nextcloud-vue', 'Saved views')\" />\n\n\t\t<!-- Loading state -->\n\t\t<NcActionCaption\n\t\t\tv-if=\"loading\"\n\t\t\tdata-testid=\"cn-saved-views-loading\"\n\t\t\t:name=\"t('nextcloud-vue', 'Loading…')\" />\n\n\t\t<!-- Empty state -->\n\t\t<NcActionCaption\n\t\t\tv-else-if=\"views.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-empty\"\n\t\t\t:name=\"t('nextcloud-vue', 'No saved views yet')\" />\n\n\t\t<!-- The labels already in use, offered before anybody types a new one. -->\n\t\t<template v-if=\"!loading && offeredLabels.length > 0\">\n\t\t\t<NcActionButton\n\t\t\t\tv-for=\"label in offeredLabels\"\n\t\t\t\t:key=\"`label-${label}`\"\n\t\t\t\tdata-testid=\"cn-saved-views-label\"\n\t\t\t\t:data-label=\"label\"\n\t\t\t\t:modelValue=\"labelFilter === label\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:aria-label=\"labelFilterLabel(label)\"\n\t\t\t\t@click=\"onLabelFilter(label)\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<TagOutline :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ label }}\n\t\t\t</NcActionButton>\n\t\t\t<NcActionSeparator />\n\t\t</template>\n\n\t\t<!--\n\t\t\tA label that matches nothing says so. Chained to the ROWS rather\n\t\t\tthan to the label list: written as an else-if of the labels block\n\t\t\tit only ever rendered on a page with no labels at all, which is\n\t\t\tthe one case it cannot be about.\n\t\t-->\n\t\t<NcActionCaption\n\t\t\tv-if=\"!loading && views.length > 0 && rows.length === 0\"\n\t\t\tdata-testid=\"cn-saved-views-none-for-label\"\n\t\t\t:name=\"t('nextcloud-vue', 'No views with this label')\" />\n\n\t\t<!-- One row per view, in tree order: the name applies it, a trailing\n\t\t icon button deletes it. NcActions only recognises NcAction* vnodes\n\t\t as menu items and silently drops anything else, so a row with more\n\t\t than one control has to be an NcActionButtonGroup. -->\n\t\t<template v-if=\"!loading\">\n\t\t\t<template v-for=\"section in sections\" :key=\"section.key\">\n\t\t\t\t<NcActionCaption\n\t\t\t\t\tv-if=\"section.label\"\n\t\t\t\t\t:data-testid=\"`cn-saved-views-section-${section.key}`\"\n\t\t\t\t\t:name=\"section.label\" />\n\t\t\t\t<NcActionButtonGroup\n\t\t\t\t\tv-for=\"row in section.rows\"\n\t\t\t\t\t:key=\"`view-${row.view.id || row.view.slug}`\"\n\t\t\t\t\tclass=\"cn-saved-view-row\">\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-item\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:data-depth=\"row.depth\"\n\t\t\t\t\t\t:data-group=\"row.group\"\n\t\t\t\t\t\t:data-access=\"accessOf(row)\"\n\t\t\t\t\t\t:aria-label=\"rowLabel(row)\"\n\t\t\t\t\t\t@click=\"onApply(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EyeOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ rowName(row, section.key === 'shared') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`share-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-share\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"shareLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onShareRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ShareVariantOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"(accessOf(row) === 'owner' || accessOf(row) === 'write') && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`presentation-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-presentation\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"presentationLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onPresentationRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ViewDashboardOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'write'\"\n\t\t\t\t\t\t:key=\"`update-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-update\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"updateLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onUpdateRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'read' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`copy-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-copy\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"copyLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onCopyRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<ContentCopy :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"accessOf(row) === 'owner' && row.group !== SEEDED_GROUP\"\n\t\t\t\t\t\t:key=\"`delete-${row.view.id || row.view.slug}`\"\n\t\t\t\t\t\tdata-testid=\"cn-saved-views-delete\"\n\t\t\t\t\t\t:data-view-id=\"row.view.id || row.view.slug\"\n\t\t\t\t\t\t:aria-label=\"deleteLabel(row.view)\"\n\t\t\t\t\t\t@click=\"onDeleteRequest(row.view)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<TrashCanOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActionButtonGroup>\n\t\t\t</template>\n\t\t</template>\n\n\t\t<NcActionSeparator />\n\n\t\t<NcActionButton\n\t\t\tdata-testid=\"cn-saved-views-save\"\n\t\t\t:aria-label=\"t('nextcloud-vue', 'Save current view…')\"\n\t\t\t@click=\"onSaveRequest\">\n\t\t\t<template #icon>\n\t\t\t\t<ContentSaveOutline :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ t('nextcloud-vue', 'Save current view…') }}\n\t\t</NcActionButton>\n\t</NcActions>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionButtonGroup, NcActionCaption, NcActions, NcActionSeparator } from '@nextcloud/vue'\nimport BookmarkOutline from 'vue-material-design-icons/BookmarkOutline.vue'\nimport ContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport ContentSaveOutline from 'vue-material-design-icons/ContentSaveOutline.vue'\nimport EyeOutline from 'vue-material-design-icons/EyeOutline.vue'\nimport ShareVariantOutline from 'vue-material-design-icons/ShareVariantOutline.vue'\nimport TagOutline from 'vue-material-design-icons/TagOutline.vue'\nimport TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport ViewDashboardOutline from 'vue-material-design-icons/ViewDashboardOutline.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { buildViewTree, labelsInUse, VIEW_GROUPS } from '../../utils/buildViewTree.js'\nimport { isOwnView, viewAccess } from '../../utils/savedViewHelpers.js'\n\n/**\n * CnSavedViewsControl — toolbar dropdown listing OpenRegister saved-search\n * views for the current index page (saved-views-ui).\n *\n * Purely presentational: the parent (CnIndexPage) owns fetching via\n * `useSavedViewsApi()` and all mutations; this control only lists the\n * given `views` and emits intents:\n *\n * - `@apply(view)` — a view entry was clicked; parent writes the view's\n * stored filters/search/sort into the route query.\n * - `@save-request()` — \"Save current view…\" clicked; parent opens\n * CnSaveViewDialog.\n * - `@delete-request(view)` — a view's trailing delete icon clicked; parent\n * opens a confirm dialog. Only rendered for views the current user owns\n * (`@self.access: owner`, else `view.owner === currentUserId`) — OpenRegister\n * refuses foreign deletes server-side anyway (owner-scoped 404).\n * - `@share-request(view)` — Share on an own view; parent opens the share dialog.\n * - `@update-request(view)` — Save on a view shared with write access; parent\n * saves the current state to it (never sending `sharedWith` or `owner`).\n * - `@presentation-request(view)` — Presentation on a view the user may edit\n * (`owner` or `write`); parent opens the presentation dialog (table, board, calendar).\n * - `@copy-request(view)` — \"Save as my view\" on a view shared read-only.\n *\n * Views shared with the user (`@self.access` `write` or `read`) list under\n * \"Shared with me\", next to \"My views\", once any exist; with none the list\n * renders as before.\n *\n * @event {object} apply — Apply the clicked view. Payload: the View API object.\n * @event {void} save-request — Open the save-current-view dialog.\n * @event {object} delete-request — Confirm-delete the clicked view. Payload: the View API object.\n * @event {object} share-request — Share the clicked own view. Payload: the View API object.\n * @event {object} update-request — Save the current state to the clicked writable shared view. Payload: the View API object.\n * @event {object} presentation-request — Change how the clicked view shows. Payload: the View API object.\n * @event {object} copy-request — Copy the clicked read-only shared view into a personal one. Payload: the View API object.\n */\nexport default {\n\tname: 'CnSavedViewsControl',\n\n\tcomponents: {\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionButtonGroup,\n\t\tNcActionCaption,\n\t\tNcActionSeparator,\n\t\tBookmarkOutline,\n\t\tContentCopy,\n\t\tContentSaveOutline,\n\t\tEyeOutline,\n\t\tShareVariantOutline,\n\t\tTagOutline,\n\t\tTrashCanOutline,\n\t\tViewDashboardOutline,\n\t},\n\n\tinject: {\n\t\t/** The look CnAppRoot provides; `board` draws the views as chips. */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\t// The chips and the menu are two roots under the board look.\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/** Views to list (View API objects from `GET /apps/openregister/api/views`). */\n\t\tviews: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** True while the parent is fetching the view list. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The signed-in NC user id — gates the per-view delete affordance. */\n\t\tcurrentUserId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * How deep the tree indents before it flattens. Mirrors\n\t\t * `savedViewTree.maxDepth` in the manifest. Flattening is about\n\t\t * indentation only: a view past the bound still renders.\n\t\t */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/**\n\t\t * How many records each view matches, keyed by view id (or slug). A\n\t\t * view with a number here shows it after its name; a view can also\n\t\t * carry its own `count`. `null` (the default) shows no counts.\n\t\t *\n\t\t * @type {{[viewId: string]: number}|null}\n\t\t */\n\t\tcounts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The id (or slug) of the applied view; its chip renders selected under\n\t\t * the board look.\n\t\t */\n\t\tselectedViewId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['apply', 'copy-request', 'delete-request', 'presentation-request', 'save-request', 'share-request', 'update-request'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The label currently filtering the list, or '' for all of them. */\n\t\t\tlabelFilter: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the saved views draw as chips (the board look).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The views that get a chip: the top level of the tree, in tree order.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tchipRows() {\n\t\t\treturn this.rows.filter((row) => row.depth === 0)\n\t\t},\n\n\t\t/** @return {string} The dropdown trigger label. */\n\t\tmenuLabel() {\n\t\t\treturn t('nextcloud-vue', 'Views')\n\t\t},\n\n\t\t/** @return {string} The seeded group name, for the template. */\n\t\tSEEDED_GROUP() {\n\t\t\treturn VIEW_GROUPS.SEEDED\n\t\t},\n\n\t\t/**\n\t\t * The views in tree order, seeded first, filtered by the active label.\n\t\t *\n\t\t * @return {Array<object>} Rows of `{ view, depth, group, orphaned }`.\n\t\t */\n\t\trows() {\n\t\t\treturn buildViewTree({\n\t\t\t\tviews: this.views,\n\t\t\t\tlabelFilter: this.labelFilter,\n\t\t\t\tmaxDepth: this.maxDepth,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The rows in their sections. With no view shared with this user there\n\t\t * is one section without a caption, as the list always was. With\n\t\t * shared views: seeded views (no caption), \"My views\", \"Shared with me\".\n\t\t *\n\t\t * @return {Array<{key: string, label: string, rows: Array<object>}>} The sections.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\tsections() {\n\t\t\tconst shared = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) !== 'owner')\n\t\t\tif (shared.length === 0) {\n\t\t\t\treturn [{ key: 'all', label: '', rows: this.rows }]\n\t\t\t}\n\t\t\tconst seeded = this.rows.filter((r) => r.group === VIEW_GROUPS.SEEDED)\n\t\t\tconst mine = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) === 'owner')\n\t\t\treturn [\n\t\t\t\t{ key: 'seeded', label: '', rows: seeded },\n\t\t\t\t{ key: 'mine', label: t('nextcloud-vue', 'My views'), rows: mine },\n\t\t\t\t{ key: 'shared', label: t('nextcloud-vue', 'Shared with me'), rows: shared },\n\t\t\t].filter((section) => section.rows.length > 0)\n\t\t},\n\n\t\t/**\n\t\t * The labels already in use.\n\t\t *\n\t\t * Read from the UNFILTERED list on purpose: reading it from `rows`\n\t\t * would remove every other label from the menu the moment one was\n\t\t * chosen, and a filter you cannot change without clearing it first is\n\t\t * a filter people stop using.\n\t\t *\n\t\t * @return {Array<string>} The labels.\n\t\t */\n\t\tofferedLabels() {\n\t\t\treturn labelsInUse(this.views)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Whether a view's chip is the selected one.\n\t\t *\n\t\t * @param {object} view The view.\n\t\t * @return {boolean}\n\t\t */\n\t\tisChipSelected(view) {\n\t\t\treturn this.selectedViewId !== '' && (this.selectedViewId === String(view.id) || this.selectedViewId === String(view.slug))\n\t\t},\n\n\t\t/**\n\t\t * The name a row shows, indented to its depth.\n\t\t *\n\t\t * Indented with figure spaces rather than CSS padding because the row\n\t\t * is an `NcActionButton` whose label is read out as text: a screen\n\t\t * reader gets the same shape a sighted reader does, and no stylesheet\n\t\t * has to know about the tree.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @param {boolean} [withGroups] Append the groups the view is shared with.\n\t\t * @return {string} The name.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowName(row, withGroups = false) {\n\t\t\tconst groups = withGroups ? this.groupsOf(row.view) : ''\n\t\t\treturn `${'\\u2007'.repeat(row.depth * 2)}${this.nameWithCount(row.view)}${groups !== '' ? ` · ${groups}` : ''}`\n\t\t},\n\n\t\t/**\n\t\t * What the current user may do with a row's view.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {'owner'|'write'|'read'} The access.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\taccessOf(row) {\n\t\t\treturn viewAccess(row.view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * The groups a view is shared with, as text for the row.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The group ids, comma-separated; empty when none.\n\t\t */\n\t\tgroupsOf(view) {\n\t\t\treturn (Array.isArray(view.sharedWith) ? view.sharedWith : [])\n\t\t\t\t.map((e) => e && e.group)\n\t\t\t\t.filter((g) => typeof g === 'string' && g !== '')\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\tshareLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Share \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tupdateLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save the current view to \"{name}\"', { name: view.name })\n\t\t},\n\n\t\tcopyLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Save \"{name}\" as my view', { name: view.name })\n\t\t},\n\n\t\tpresentationLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Change how \"{name}\" shows', { name: view.name })\n\t\t},\n\n\t\tonPresentationRequest(view) {\n\t\t\t/**\n\t\t\t * @event presentation-request Presentation on an editable view; open the presentation dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('presentation-request', view)\n\t\t},\n\n\t\tonShareRequest(view) {\n\t\t\t/**\n\t\t\t * @event share-request Share on an own view; open the share dialog.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('share-request', view)\n\t\t},\n\n\t\tonUpdateRequest(view) {\n\t\t\t/**\n\t\t\t * @event update-request Save on a writable shared view; save the current state to it.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('update-request', view)\n\t\t},\n\n\t\tonCopyRequest(view) {\n\t\t\t/**\n\t\t\t * @event copy-request \"Save as my view\" on a read-only shared view; store a personal copy.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('copy-request', view)\n\t\t},\n\n\t\t/**\n\t\t * The number of records a view matches, or null when none is known:\n\t\t * `counts[id]` (or `counts[slug]`) first, else the view's own `count`.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {number|null}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tcountOf(view) {\n\t\t\tconst counts = this.counts || {}\n\t\t\tlet value = counts[view.id]\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = counts[view.slug]\n\t\t\t}\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = view.count\n\t\t\t}\n\t\t\treturn (typeof value === 'number' && Number.isFinite(value)) ? value : null\n\t\t},\n\n\t\t/**\n\t\t * A view's name, followed by its count when one is known.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\tnameWithCount(view) {\n\t\t\tconst count = this.countOf(view)\n\t\t\treturn count === null ? view.name : `${view.name} (${count})`\n\t\t},\n\n\t\t/**\n\t\t * What a row is called to somebody who cannot see the indentation.\n\t\t *\n\t\t * Says the level in words, and says when a view's parent is one this\n\t\t * reader cannot see. A child that silently sits at the root looks\n\t\t * exactly like a view that never had a parent.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {string} The accessible label.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-counts-on-filters-and-views\n\t\t */\n\t\trowLabel(row) {\n\t\t\tconst viewName = this.nameWithCount(row.view)\n\t\t\tconst name = row.depth === 0\n\t\t\t\t? viewName\n\t\t\t\t: t('nextcloud-vue', '{name}, level {level}', { name: viewName, level: row.depth + 1 })\n\n\t\t\tif (row.orphaned !== true) {\n\t\t\t\treturn name\n\t\t\t}\n\n\t\t\treturn t('nextcloud-vue', '{name}. Parts of this view come from one you cannot see.', { name })\n\t\t},\n\n\t\t/**\n\t\t * The accessible label of a label filter entry.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string} The label.\n\t\t */\n\t\tlabelFilterLabel(label) {\n\t\t\treturn this.labelFilter === label\n\t\t\t\t? t('nextcloud-vue', 'Stop filtering on \"{label}\"', { label })\n\t\t\t\t: t('nextcloud-vue', 'Show only views labelled \"{label}\"', { label })\n\t\t},\n\n\t\t/**\n\t\t * Turn a label filter on, or off when it is already on.\n\t\t *\n\t\t * Clicking the active label clears it, so the way out is the way in\n\t\t * rather than a second control somebody has to find.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t */\n\t\tonLabelFilter(label) {\n\t\t\tthis.labelFilter = this.labelFilter === label ? '' : label\n\t\t},\n\n\t\t/**\n\t\t * Whether the delete entry renders for a view.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {boolean} True when the current user owns the view.\n\t\t */\n\t\tisOwn(view) {\n\t\t\treturn isOwnView(view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * Accessible label for a view's delete entry.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The label.\n\t\t */\n\t\tdeleteLabel(view) {\n\t\t\treturn t('nextcloud-vue', 'Delete \"{name}\"', { name: view.name })\n\t\t},\n\n\t\t/**\n\t\t * View-entry click: hand the view to the parent to apply.\n\t\t *\n\t\t * @param {object} view The clicked View API object.\n\t\t */\n\t\tonApply(view) {\n\t\t\t/**\n\t\t\t * @event apply A view entry was clicked; apply its stored state.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('apply', view)\n\t\t},\n\n\t\t/**\n\t\t * \"Save current view…\" click: ask the parent to open the save dialog.\n\t\t */\n\t\tonSaveRequest() {\n\t\t\t/**\n\t\t\t * @event save-request \"Save current view…\" clicked; open the save dialog.\n\t\t\t */\n\t\t\tthis.$emit('save-request')\n\t\t},\n\n\t\t/**\n\t\t * Delete-entry click: hand the view to the parent to confirm-delete.\n\t\t *\n\t\t * @param {object} view The View API object to delete.\n\t\t */\n\t\tonDeleteRequest(view) {\n\t\t\t/**\n\t\t\t * @event delete-request A view's delete entry was clicked; confirm and delete.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('delete-request', view)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* NcActionButtonGroup gives every child `flex: 1 1` (equal width) by\n default; override so the name button grows and the delete icon stays\n compact. :deep() is required — these li's belong to NcActionButtonGroup's\n own scope, not this component's. */\n.cn-saved-view-row :deep(.nc-button-group-content) {\n\tgap: 0;\n}\n\n/* Anchored on the FIRST child, not the last: a row carries one or two buttons\n depending on ownership, so \"the last one\" is the name button on a row that\n has only that. */\n.cn-saved-view-row :deep(.nc-button-group-content > li) {\n\tflex: 0 0 auto;\n}\n\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child) {\n\tflex: 1 1 auto;\n}\n\n/* NcActionButtonGroup also centers .action-button content (fine for an\n icon-only toolbar button, wrong for a row with a name) — restore the\n normal left-aligned NcActionButton look for the name button. */\n.cn-saved-view-row :deep(.nc-button-group-content > li:first-child .action-button) {\n\tjustify-content: flex-start;\n}\n</style>\n"],"names":["_createElementBlock","_Fragment","_renderList","_createElementVNode","_toDisplayString","_openBlock","_createVNode","_mergeProps","_createBlock","_createTextVNode"],"mappings":";;;;AA+BS,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAA2B,GAAA;;;AAGtC,EAAA,KAAK,EAAC,4BAAA;AACN,EAAA,aAAW,EAAC,2BAAA;;;;;;;;;;;;;;;;;;;KAnBR,QAAW,CAAA,WAAA,IAAI,QAAQ,CAAA,QAAA,CAAC,MAAI,GAAA,CAAA;sBADlCA,kBAsBK,CAAA,KAAA,EAAA;;AApBL,UAAA,KAAK,EAAC,uBAAA;AACL,UAAA,IAAG,EAAC,OAAO;AACX,UAAA,YAAU,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,aAAA,CAAA;uBACH,EAAC,sBAAC;;8CAgBH,CAAAC,QAAA,EAAA,IAAA,EAAAC,UAAA,CAdK,QAAQ,CAAA,QAAA,EAAA,CAAf,GAAG,KAAA;mDAcD,CAAA,QAAA,EAAA;cAbR,GAAG,EAAA,CAAA,KAAA,EAAU,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,IAAC,CAAA,CAAA;AACvC,cAAA,IAAI,EAAC,QAAQ;AACb,cAAA,KAAK,kBAAC,sBAAsB,EAAA,EAAA,gCAAA,EACF,uBAAA,CAAA,GAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AACzB,cAAA,cAAY,EAAE,QAAA,CAAA,cAAc,CAAC,G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** The tab list's name under the board look, provided by CnDetailPage (`config.tabsLabel`). */
|
|
150
150
|
cnDetailTabsLabel: { default: null },
|
|
151
|
+
/**
|
|
152
|
+
* The host's translate (CnAppRoot provides `cnTranslate`), so a tab
|
|
153
|
+
* label written in the manifest reads in the user's language.
|
|
154
|
+
*/
|
|
155
|
+
cnTranslate: { default: () => (key) => key },
|
|
151
156
|
},
|
|
152
157
|
|
|
153
158
|
props: {
|
|
@@ -365,7 +370,7 @@ var script = {
|
|
|
365
370
|
key: `${widgetId || 'tab'}-${index}`,
|
|
366
371
|
id: (tab && typeof tab === 'object' && tab.id) || widgetId || '',
|
|
367
372
|
widgetId,
|
|
368
|
-
label:
|
|
373
|
+
label: this.tabLabel(tab, widget, widgetId),
|
|
369
374
|
icon: (tab && tab.icon) || widget?.icon || '',
|
|
370
375
|
widget,
|
|
371
376
|
count,
|
|
@@ -546,6 +551,30 @@ var script = {
|
|
|
546
551
|
},
|
|
547
552
|
|
|
548
553
|
methods: {
|
|
554
|
+
/**
|
|
555
|
+
* The label a tab shows: the authored `label`, else (board look) History
|
|
556
|
+
* for the activity widget, else the child widget's title, else its id.
|
|
557
|
+
* A manifest label or title goes through the host's translate; the
|
|
558
|
+
* library's own History is translated by the library catalogue.
|
|
559
|
+
*
|
|
560
|
+
* @param {object|string} tab The `content.tabs[]` entry.
|
|
561
|
+
* @param {object|null} widget The widget definition it names.
|
|
562
|
+
* @param {string} widgetId The widget id.
|
|
563
|
+
* @return {string} The label.
|
|
564
|
+
* @spec openspec/changes/screens-detail-labels-parity/specs/detail-labels-board-look/spec.md#requirement-detail-labels-read-in-the-users-language
|
|
565
|
+
*/
|
|
566
|
+
tabLabel(tab, widget, widgetId) {
|
|
567
|
+
const translate$1 = typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key;
|
|
568
|
+
if (tab && typeof tab.label === 'string' && tab.label !== '') {
|
|
569
|
+
return translate$1(tab.label)
|
|
570
|
+
}
|
|
571
|
+
if (this.isBoard && isActivityWidget(widget)) {
|
|
572
|
+
return translate('nextcloud-vue', 'History')
|
|
573
|
+
}
|
|
574
|
+
const title = widgetTitleOf(widget);
|
|
575
|
+
return title ? translate$1(title) : (widgetId || '')
|
|
576
|
+
},
|
|
577
|
+
|
|
549
578
|
/**
|
|
550
579
|
* Whether a tab shows: `visible`, `hidden`, or `pending` while its
|
|
551
580
|
* condition cannot be decided yet (object not loaded, count not back).
|