@conduction/nextcloud-vue 2.161.0 → 2.163.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js +3 -2
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js +2 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js.map +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js +9 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js.map +1 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js +304 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js.map +1 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js +161 -0
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js.map +1 -0
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +8 -8
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +23 -0
- 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/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +48 -5
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +2 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +4 -3
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js +2 -1
- package/dist/esm/components/CnFilesBrowser/openRegisterSource.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js +2 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue.js +1 -1
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue2.js +4 -0
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnFilterRowsEditor/CnFilterRowsEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue.js +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js +41 -39
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +2 -2
- 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/CnIconPicker/CnIconPicker.vue.js +1 -1
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue2.js +4 -3
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnIconPicker/CnIconPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnIconPicker/iconCatalogues.js +16 -3
- package/dist/esm/components/CnIconPicker/iconCatalogues.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +87 -11
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue2.js +2 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue2.js.map +1 -1
- package/dist/esm/components/CnLinksWidgetForm/CnLinksWidgetForm.vue3.js.map +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue.js +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js +6 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnMenuWidget/menuActive.js +2 -1
- package/dist/esm/components/CnMenuWidget/menuActive.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue2.js +4 -0
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +39 -2
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue.js +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue3.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue.js +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue2.js +10 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeRow.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +5 -5
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue2.js +22 -0
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue2.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue3.js.map +1 -1
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue.js +1 -1
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue2.js +4 -0
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue2.js.map +1 -1
- package/dist/esm/components/CnStagesWidgetForm/CnStagesWidgetForm.vue3.js.map +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue.js +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js.map +1 -1
- package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +30 -2
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js +3 -2
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +130 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js +27 -16
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue2.js +2 -6
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue2.js +2 -6
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/xwiki/CnXwikiTab.vue3.js.map +1 -1
- package/dist/esm/integrations/utils/marker.js +35 -6
- package/dist/esm/integrations/utils/marker.js.map +1 -1
- package/dist/esm/l10n/en.json.js +17 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +17 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1038 -822
- package/dist/esm/utils/buildManifestRoutes.js +2 -1
- package/dist/esm/utils/buildManifestRoutes.js.map +1 -1
- package/dist/esm/utils/cnFetch.js +1 -15
- package/dist/esm/utils/cnFetch.js.map +1 -1
- package/dist/esm/utils/fillTemplate.js +32 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/forge.js +4 -1
- package/dist/esm/utils/forge.js.map +1 -1
- package/dist/esm/utils/htmlToText.js +36 -0
- package/dist/esm/utils/htmlToText.js.map +1 -0
- package/dist/esm/utils/myTeam.js +17 -3
- package/dist/esm/utils/myTeam.js.map +1 -1
- package/dist/esm/utils/prototypeKeys.js +20 -0
- package/dist/esm/utils/prototypeKeys.js.map +1 -0
- package/dist/esm/utils/rowAggregate.js +20 -1
- package/dist/esm/utils/rowAggregate.js.map +1 -1
- package/dist/esm/utils/toastUiRawHtmlGuard.js +166 -0
- package/dist/esm/utils/toastUiRawHtmlGuard.js.map +1 -0
- package/dist/esm/utils/trailingSlashes.js +24 -0
- package/dist/esm/utils/trailingSlashes.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +12490 -11295
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1038 -822
- package/l10n/en.json +17 -1
- package/l10n/nl.json +17 -1
- package/package.json +1 -1
- package/src/components/CnActionsMenu/CnActionsMenu.vue +3 -2
- package/src/components/CnAddressSearch/CnAddressSearch.vue +2 -1
- package/src/components/CnChipListManager/CnChipListManager.vue +504 -0
- package/src/components/CnChipListManager/index.js +4 -0
- package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
- package/src/components/CnDataTable/CnDataTable.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +23 -0
- package/src/components/CnFactsWidget/CnFactsWidget.vue +49 -5
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +4 -3
- package/src/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/src/components/CnFilesBrowser/openRegisterSource.js +2 -1
- package/src/components/CnFilesWidget/CnFilesWidget.vue +2 -1
- package/src/components/CnFilterRowsEditor/CnFilterRowsEditor.vue +4 -0
- package/src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue +1 -1
- package/src/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/src/components/CnFormDialog/CnFormDialog.vue +2 -2
- package/src/components/CnIconPicker/CnIconPicker.vue +4 -3
- package/src/components/CnIconPicker/iconCatalogues.js +16 -3
- package/src/components/CnIndexPage/CnIndexPage.vue +89 -13
- package/src/components/CnLinksWidgetForm/CnLinksWidgetForm.vue +2 -1
- package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +6 -1
- package/src/components/CnMenuWidget/menuActive.js +2 -1
- package/src/components/CnObjectListWidget/CnObjectListWidget.vue +1 -1
- package/src/components/CnObjectListWidgetForm/CnObjectListWidgetForm.vue +4 -0
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +40 -3
- package/src/components/CnPageTreeNode/CnPageTreeNode.vue +2 -1
- package/src/components/CnPageTreeNode/CnPageTreeRow.vue +10 -1
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +5 -5
- package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +22 -0
- package/src/components/CnStagesWidgetForm/CnStagesWidgetForm.vue +4 -0
- package/src/components/CnWalkthrough/CnWalkthrough.vue +1 -1
- package/src/components/index.js +1 -0
- package/src/composables/indexSources.js +30 -2
- package/src/css/dialog.css +7 -0
- package/src/css/look-board-detail.css +41 -4
- package/src/css/look-board.css +64 -2
- package/src/index.js +1 -0
- package/src/integrations/builtin/analytics/CnAnalyticsCard.vue +2 -1
- package/src/integrations/builtin/analytics/CnAnalyticsTab.vue +3 -2
- package/src/integrations/builtin/email/CnEmailTab.vue +155 -4
- package/src/integrations/builtin/photos/CnPhotosCard.vue +2 -1
- package/src/integrations/builtin/photos/CnPhotosTab.vue +2 -1
- package/src/integrations/builtin/xwiki/CnXwikiCard.vue +2 -6
- package/src/integrations/builtin/xwiki/CnXwikiTab.vue +2 -6
- package/src/integrations/utils/marker.js +35 -6
- package/src/utils/buildManifestRoutes.js +2 -1
- package/src/utils/cnFetch.js +3 -15
- package/src/utils/fillTemplate.js +32 -2
- package/src/utils/forge.js +3 -1
- package/src/utils/htmlToText.js +33 -0
- package/src/utils/myTeam.js +17 -3
- package/src/utils/prototypeKeys.js +17 -0
- package/src/utils/rowAggregate.js +19 -0
- package/src/utils/toastUiRawHtmlGuard.js +162 -0
- package/src/utils/trailingSlashes.js +21 -0
|
@@ -498,7 +498,7 @@ import { fillTemplate, firstFilled, joinTemplateParts } from '../../utils/fillTe
|
|
|
498
498
|
import { lensUnavailableText, readLensReports } from '../../utils/lensAvailability.js'
|
|
499
499
|
import { followLinkClick, openRowTarget, resolveHref } from '../../utils/linkNavigation.js'
|
|
500
500
|
import { nextSortState } from '../../utils/multiColumnSort.js'
|
|
501
|
-
import { fetchRowAggregate } from '../../utils/rowAggregate.js'
|
|
501
|
+
import { cellsOf, fetchRowAggregate } from '../../utils/rowAggregate.js'
|
|
502
502
|
import { isNewTabClick, isNewTabHandled, isRowMiddleClick, markNewTabHandled, preventMiddleClickAutoscroll } from '../../utils/rowAuxClick.js'
|
|
503
503
|
import { DEFAULT_ROW_INDICATOR_CAP, indicatorApplies, resolveRowIndicators } from '../../utils/rowIndicators.js'
|
|
504
504
|
import { columnsFromSchema } from '../../utils/schema.js'
|
|
@@ -2438,11 +2438,11 @@ export default {
|
|
|
2438
2438
|
}
|
|
2439
2439
|
const id = ++this.aggregateRequestId
|
|
2440
2440
|
this.aggregateLoading = true
|
|
2441
|
-
const next =
|
|
2441
|
+
const next = new Map()
|
|
2442
2442
|
const jobs = []
|
|
2443
2443
|
for (const row of this.rows) {
|
|
2444
2444
|
const rowKey = String(row[this.rowKey])
|
|
2445
|
-
|
|
2445
|
+
const cells = cellsOf(next, rowKey)
|
|
2446
2446
|
for (const col of aggCols) {
|
|
2447
2447
|
const agg = col.aggregate
|
|
2448
2448
|
if (isEndpointAggregate(col)) {
|
|
@@ -2455,12 +2455,12 @@ export default {
|
|
|
2455
2455
|
// first of them sorted on it descending ("Laatste contact").
|
|
2456
2456
|
jobs.push(fetchRowAggregate(agg, row, (r, path) => this.getCellValue(r, path))
|
|
2457
2457
|
.then((value) => {
|
|
2458
|
-
|
|
2458
|
+
cells[col.key] = value
|
|
2459
2459
|
})
|
|
2460
2460
|
.catch((e) => {
|
|
2461
2461
|
// eslint-disable-next-line no-console
|
|
2462
2462
|
console.warn(`[CnDataTable] aggregate "${col.key}" count failed for row ${rowKey}`, e)
|
|
2463
|
-
|
|
2463
|
+
cells[col.key] = undefined
|
|
2464
2464
|
}))
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
@@ -2471,7 +2471,7 @@ export default {
|
|
|
2471
2471
|
if (id !== this.aggregateRequestId) {
|
|
2472
2472
|
return
|
|
2473
2473
|
}
|
|
2474
|
-
this.aggregateValues = next
|
|
2474
|
+
this.aggregateValues = Object.fromEntries(next)
|
|
2475
2475
|
this.aggregateLoading = false
|
|
2476
2476
|
},
|
|
2477
2477
|
|
|
@@ -2502,7 +2502,7 @@ export default {
|
|
|
2502
2502
|
* hides the column.
|
|
2503
2503
|
*
|
|
2504
2504
|
* @param {object} col The column.
|
|
2505
|
-
* @param {object} next The values being built, by row then column.
|
|
2505
|
+
* @param {Map<string, object>} next The values being built, by row then column.
|
|
2506
2506
|
* @param {number} id The batch id, to drop a stale answer.
|
|
2507
2507
|
* @return {Promise<void>}
|
|
2508
2508
|
* @spec openspec/changes/aggregate-from-endpoint/specs/cn-data-table/spec.md
|
|
@@ -2534,7 +2534,7 @@ export default {
|
|
|
2534
2534
|
}
|
|
2535
2535
|
for (const row of this.rows) {
|
|
2536
2536
|
const k = keyOf(row)
|
|
2537
|
-
next
|
|
2537
|
+
cellsOf(next, String(row[this.rowKey]))[col.key] = k !== '' && values[k] !== undefined ? values[k] : 0
|
|
2538
2538
|
}
|
|
2539
2539
|
},
|
|
2540
2540
|
|
|
@@ -1585,6 +1585,27 @@ export default {
|
|
|
1585
1585
|
return title ? { titleLabel: title } : {}
|
|
1586
1586
|
},
|
|
1587
1587
|
|
|
1588
|
+
/**
|
|
1589
|
+
* An integration widget's `labels` (prop name to text), translated in
|
|
1590
|
+
* the host's language: a leaf cannot translate the host app's words.
|
|
1591
|
+
*
|
|
1592
|
+
* @return {object} Prop name to translated text.
|
|
1593
|
+
* @spec openspec/changes/leaf-labels-in-the-host-language/specs/leaf-labels-in-the-host-language/spec.md#requirement-an-integration-widget-gives-its-leaf-labels-in-the-hosts-language
|
|
1594
|
+
*/
|
|
1595
|
+
leafLabels() {
|
|
1596
|
+
const labels = this.widget?.labels
|
|
1597
|
+
if (!labels || typeof labels !== 'object' || Array.isArray(labels)) {
|
|
1598
|
+
return {}
|
|
1599
|
+
}
|
|
1600
|
+
const out = {}
|
|
1601
|
+
for (const [prop, text] of Object.entries(labels)) {
|
|
1602
|
+
if (typeof text === 'string') {
|
|
1603
|
+
out[prop] = this.translateLabel(text)
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
return out
|
|
1607
|
+
},
|
|
1608
|
+
|
|
1588
1609
|
integrationProps() {
|
|
1589
1610
|
return {
|
|
1590
1611
|
surface: this.surface,
|
|
@@ -1599,6 +1620,7 @@ export default {
|
|
|
1599
1620
|
// the tabs card, repeating the label the open tab already shows.
|
|
1600
1621
|
...(this.usesBareWidget ? { chromeless: true } : {}),
|
|
1601
1622
|
...this.derivedIntegrationContext,
|
|
1623
|
+
...this.leafLabels,
|
|
1602
1624
|
...this.resolvedWidgetProps,
|
|
1603
1625
|
}
|
|
1604
1626
|
},
|
|
@@ -1618,6 +1640,7 @@ export default {
|
|
|
1618
1640
|
// reads `integrationContext.objectId` gets the same object as
|
|
1619
1641
|
// one that reads `objectId`.
|
|
1620
1642
|
integrationContext: this.widgetIntegrationContext,
|
|
1643
|
+
...this.leafLabels,
|
|
1621
1644
|
...this.resolvedWidgetProps,
|
|
1622
1645
|
// A carded leaf reports its title row and empty state here.
|
|
1623
1646
|
...(this.wrapsMountLeaf ? { onHeader: this.onRendererHeader } : {}),
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
v-else-if="block.kind === 'title'"
|
|
114
114
|
:to="block.to || undefined"
|
|
115
115
|
class="cn-facts-widget__title"
|
|
116
|
+
:style="block.size ? { fontSize: `${block.size}px` } : undefined"
|
|
116
117
|
:data-testid="`cn-fact-${block.key}`">
|
|
117
118
|
{{ block.value }}
|
|
118
119
|
</component>
|
|
@@ -300,8 +301,10 @@ import { fetchListTotal } from '../../utils/fetchFilterCounts.js'
|
|
|
300
301
|
import { fillTemplate, formatLongDate } from '../../utils/fillTemplate.js'
|
|
301
302
|
import { formatMoney, metricLocale, unwrapAppConfig } from '../../utils/formatMetric.js'
|
|
302
303
|
import { groupDisplayName, loadGroupDisplayName } from '../../utils/groupAutocomplete.js'
|
|
304
|
+
import { fetchCallerScope } from '../../utils/objectPermissions.js'
|
|
303
305
|
import { readPath } from '../../utils/readPath.js'
|
|
304
306
|
import { hasUnresolvedDeepTokens, resolveDeepTokens } from '../../utils/resolveFilterTokens.js'
|
|
307
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
305
308
|
import { userDisplayName } from '../../utils/userDisplayName.js'
|
|
306
309
|
import { evaluateVisibleWhen, evaluateVisibleWhenLocal, isLocallyDecidableVisibleWhen } from '../../utils/visibleWhen.js'
|
|
307
310
|
|
|
@@ -498,7 +501,7 @@ export default {
|
|
|
498
501
|
* The widget configuration.
|
|
499
502
|
*
|
|
500
503
|
* - `fields` — the entries, in order. Each is `{ path, label?, as?, from?, format?, map?, itemPath?, parts?, separator?, route?, variant?, variantMap?, colorMap?, icon?, copy?, reveal?, inline?, joinPrevious?, joinSeparator?, text?, title?, subtitle?, initialsPath?, tone? }`.
|
|
501
|
-
* `as` is `row` (default when `label` or `icon` is set), `title`, `line`, `text` (a line in the normal ink), `lead` (an icon tile or initials beside `title` and `subtitle`), `pill` or `meter`.
|
|
504
|
+
* `as` is `row` (default when `label` or `icon` is set), `title`, `line`, `text` (a line in the normal ink), `lead` (an icon tile or initials beside `title` and `subtitle`), `pill` or `meter`. A `title` takes `size` in px (a Termijn card's 26px figure).
|
|
502
505
|
* `countFrom` (`{ register, schema, filter? }`, `@objectId` / `@object.<field>` in the filter) shows how many records that list holds ("Lopende zaken 43"); the row is left out while the count cannot be read.
|
|
503
506
|
* A `meter` shows the amount at `path` against the limit at `limitPath` (or a constant `limit`) as "12 of 50" with a bar; past the limit the bar turns red and the text says "over the limit"; without a positive limit it shows the amount and no bar.
|
|
504
507
|
* A `line` or `text` with `joinPrevious: true` is written on after the line or text just before it, as one paragraph (`joinSeparator`, default a space); with none before it, it stands alone. A text joined with a line break (`joinSeparator: "\n"`) keeps it: two address lines as one block.
|
|
@@ -515,7 +518,7 @@ export default {
|
|
|
515
518
|
* `labelPath` ("@context.caseType.handlerLabel") names a value on the record or the page's `@context` records that labels the row when it holds text; `label` is the fallback.
|
|
516
519
|
* `emptyValue` ("No") is shown, translated, when the entry has no value, so the entry stays drawn whatever `hideEmpty` says (an override that was never set reads "No").
|
|
517
520
|
* - `action` — an action drawn as a button under the facts; `headerAction` — one drawn in the card header (reported through the `header` event).
|
|
518
|
-
* - `actions` — action buttons under the facts in the `headerActions` shape (`api-call`, `open-form`, `navigate`, `open-modal`, ...; `confirm`, `variant`). `@source.<field>` names a field of the record shown, and an action whose token names an empty field is not drawn. `visibleWhen` reads the record shown; `adminOnly: true` draws the action for an instance admin only (visibility, never authorisation). An api-call or a saved form refreshes the page, and the facts read their source again.
|
|
521
|
+
* - `actions` — action buttons under the facts in the `headerActions` shape (`api-call`, `open-form`, `navigate`, `open-modal`, ...; `confirm`, `variant`). `@source.<field>` names a field of the record shown, and an action whose token names an empty field is not drawn. `visibleWhen` reads the record shown; `adminOnly: true` draws the action for an instance admin only (visibility, never authorisation). `requires: "update"` draws it only when OpenRegister lets the reader update the page's record (also on `emptyActions`; while the right is unknown it draws, and the server decides). An api-call or a saved form refreshes the page, and the facts read their source again.
|
|
519
522
|
* - `fieldsFrom` — `@context.<name>.<path>`, a list of entries on a record the page reads beside this one (a case type's `requestFields`); when it holds entries they are drawn instead of `fields`.
|
|
520
523
|
* - `rowsPath` — a path to a list of `{ label, value }` the record holds, drawn as rows after `fields` (a preview the server builds).
|
|
521
524
|
* - `headerPill` — a status pill in the card header (reported through the `header` event): `{ path?, text?, map?, variant?, variantMap?, colorMap? }`, read from the record like a `pill` entry (DqBezwaar "Advies ontvangen"); nothing shows while the value is empty.
|
|
@@ -582,6 +585,8 @@ export default {
|
|
|
582
585
|
counts: {},
|
|
583
586
|
/** The outcome of each `actions[]` condition that needs a request, by action id. */
|
|
584
587
|
remoteVisibility: {},
|
|
588
|
+
/** Whether OpenRegister lets the reader update the page's record; null while unknown (the server decides). */
|
|
589
|
+
mayUpdate: null,
|
|
585
590
|
/** Sequence of the source reads, so an older answer never replaces a newer one. */
|
|
586
591
|
loadSeq: 0,
|
|
587
592
|
}
|
|
@@ -796,6 +801,7 @@ export default {
|
|
|
796
801
|
emptyActions() {
|
|
797
802
|
const list = Array.isArray(this.content?.emptyActions) ? this.content.emptyActions : []
|
|
798
803
|
return list
|
|
804
|
+
.filter((action) => this.rightAllows(action))
|
|
799
805
|
.map((action) => ({ view: this.actionView(action), action }))
|
|
800
806
|
.filter((entry) => entry.view)
|
|
801
807
|
.map((entry) => ({ ...entry.view, action: entry.action }))
|
|
@@ -828,7 +834,7 @@ export default {
|
|
|
828
834
|
const admin = this.viewerIsAdmin()
|
|
829
835
|
const out = []
|
|
830
836
|
actions.forEach((action, index) => {
|
|
831
|
-
if (!action || typeof action !== 'object' || (action.adminOnly === true && !admin)) {
|
|
837
|
+
if (!action || typeof action !== 'object' || (action.adminOnly === true && !admin) || !this.rightAllows(action)) {
|
|
832
838
|
return
|
|
833
839
|
}
|
|
834
840
|
const id = this.actionId(action, index)
|
|
@@ -843,7 +849,7 @@ export default {
|
|
|
843
849
|
if (unresolved) {
|
|
844
850
|
return
|
|
845
851
|
}
|
|
846
|
-
const { visibleWhen, adminOnly, ...drawn } = value
|
|
852
|
+
const { visibleWhen, adminOnly, requires, ...drawn } = value
|
|
847
853
|
out.push({ ...drawn, id })
|
|
848
854
|
})
|
|
849
855
|
return out
|
|
@@ -927,6 +933,9 @@ export default {
|
|
|
927
933
|
if (kind === 'title' && field.route) {
|
|
928
934
|
block.to = this.resolveRoute(field.route, record)
|
|
929
935
|
}
|
|
936
|
+
if (kind === 'title' && Number.isFinite(field.size) && field.size > 0) {
|
|
937
|
+
block.size = field.size
|
|
938
|
+
}
|
|
930
939
|
if (kind === 'pill') {
|
|
931
940
|
const raw = readPath(record, field.path)
|
|
932
941
|
const colours = field.variantMap || field.colorMap
|
|
@@ -1152,6 +1161,7 @@ export default {
|
|
|
1152
1161
|
|
|
1153
1162
|
mounted() {
|
|
1154
1163
|
subscribe(PAGE_REFRESH_CHANNEL, this.onPageRefresh)
|
|
1164
|
+
this.loadMayUpdate()
|
|
1155
1165
|
},
|
|
1156
1166
|
|
|
1157
1167
|
beforeUnmount() {
|
|
@@ -1159,6 +1169,40 @@ export default {
|
|
|
1159
1169
|
},
|
|
1160
1170
|
|
|
1161
1171
|
methods: {
|
|
1172
|
+
/**
|
|
1173
|
+
* Whether an action's `requires: "update"` holds: the reader may update
|
|
1174
|
+
* the page's record. Unknown counts as yes; the server decides.
|
|
1175
|
+
*
|
|
1176
|
+
* @param {object} action The declaration.
|
|
1177
|
+
* @return {boolean}
|
|
1178
|
+
* @spec openspec/changes/facts-title-size-and-update-right/specs/facts-widget/spec.md#requirement-a-facts-action-can-ask-for-the-update-right
|
|
1179
|
+
*/
|
|
1180
|
+
rightAllows(action) {
|
|
1181
|
+
return !(action && action.requires === 'update' && this.mayUpdate === false)
|
|
1182
|
+
},
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Read the reader's rights on the page's register and schema, when an
|
|
1186
|
+
* action asks for the update right.
|
|
1187
|
+
*
|
|
1188
|
+
* @return {Promise<void>}
|
|
1189
|
+
* @spec openspec/changes/facts-title-size-and-update-right/specs/facts-widget/spec.md#requirement-a-facts-action-can-ask-for-the-update-right
|
|
1190
|
+
*/
|
|
1191
|
+
async loadMayUpdate() {
|
|
1192
|
+
const all = [...(Array.isArray(this.content?.actions) ? this.content.actions : []), ...(Array.isArray(this.content?.emptyActions) ? this.content.emptyActions : [])]
|
|
1193
|
+
const { register, schema } = this.tokenCtx
|
|
1194
|
+
if (!all.some((action) => action && action.requires === 'update') || !register || !schema) {
|
|
1195
|
+
return
|
|
1196
|
+
}
|
|
1197
|
+
const slug = (value) => (value && typeof value === 'object' ? String(value.slug || value.id || '') : String(value))
|
|
1198
|
+
try {
|
|
1199
|
+
const scope = await fetchCallerScope({ register: slug(register), schema: slug(schema) })
|
|
1200
|
+
this.mayUpdate = !scope || !Array.isArray(scope.actions) || scope.actions.includes('update')
|
|
1201
|
+
} catch {
|
|
1202
|
+
this.mayUpdate = null
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
|
|
1162
1206
|
/**
|
|
1163
1207
|
* A link's label and the muted note under it, their `{path}` and
|
|
1164
1208
|
* `{path:format}` placeholders filled from the record ("{page:last-segment}").
|
|
@@ -1285,7 +1329,7 @@ export default {
|
|
|
1285
1329
|
return LINK_SCHEMES.includes(parsed.protocol) ? parsed.href : ''
|
|
1286
1330
|
}
|
|
1287
1331
|
if (typeof link.hrefBase === 'string' && link.hrefBase !== '') {
|
|
1288
|
-
const path = link.hrefBase
|
|
1332
|
+
const path = stripTrailingSlashes(link.hrefBase) + '/' + value.replace(/^\/+/, '')
|
|
1289
1333
|
return generateUrl(path)
|
|
1290
1334
|
}
|
|
1291
1335
|
return value.startsWith('/') && !value.startsWith('//') ? value : ''
|
|
@@ -777,6 +777,7 @@ import { dispatchAction } from '../../utils/actionsDispatcher.js'
|
|
|
777
777
|
import { fillTemplate } from '../../utils/fillTemplate.js'
|
|
778
778
|
import { readPath } from '../../utils/readPath.js'
|
|
779
779
|
import { isNewTabClick, isRowMiddleClick, preventMiddleClickAutoscroll } from '../../utils/rowAuxClick.js'
|
|
780
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
780
781
|
import { ACTIONS_NEEDING_THE_FILES_PAGE, crumbsFor, hostActionApplies, joinPath } from './filesBrowser.js'
|
|
781
782
|
import {
|
|
782
783
|
attributePropertiesFor,
|
|
@@ -1493,7 +1494,7 @@ export default {
|
|
|
1493
1494
|
* @spec openspec/changes/board-files-root-crumb/specs/board-files-root-crumb/spec.md#requirement-the-board-files-bar-draws-no-trail-at-the-root
|
|
1494
1495
|
*/
|
|
1495
1496
|
atRoot() {
|
|
1496
|
-
const root = String(this.rootPath || '/')
|
|
1497
|
+
const root = stripTrailingSlashes(String(this.rootPath || '/')) || '/'
|
|
1497
1498
|
const last = this.crumbs[this.crumbs.length - 1]
|
|
1498
1499
|
return Boolean(last) && last.path === root
|
|
1499
1500
|
},
|
|
@@ -1986,7 +1987,7 @@ export default {
|
|
|
1986
1987
|
this.nodes = nodes
|
|
1987
1988
|
await this.resolveRowData(this.nodes)
|
|
1988
1989
|
} catch (err) {
|
|
1989
|
-
const atRoot = (this.currentPath
|
|
1990
|
+
const atRoot = (stripTrailingSlashes(this.currentPath) || '/') === (stripTrailingSlashes(this.rootPath) || '/')
|
|
1990
1991
|
this.error = err?.status === 404
|
|
1991
1992
|
? (atRoot ? t('nextcloud-vue', 'You cannot see these files') : t('nextcloud-vue', 'This folder no longer exists'))
|
|
1992
1993
|
: (err?.status === 403 ? t('nextcloud-vue', 'You cannot see this folder') : t('nextcloud-vue', 'The folder could not be read'))
|
|
@@ -2045,7 +2046,7 @@ export default {
|
|
|
2045
2046
|
* @return {void}
|
|
2046
2047
|
*/
|
|
2047
2048
|
navigate(path) {
|
|
2048
|
-
const root = this.rootPath
|
|
2049
|
+
const root = stripTrailingSlashes(this.rootPath) || '/'
|
|
2049
2050
|
if (path !== root && !path.startsWith(root === '/' ? '/' : `${root}/`)) {
|
|
2050
2051
|
return
|
|
2051
2052
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import axios from '@nextcloud/axios'
|
|
11
11
|
import { generateUrl } from '@nextcloud/router'
|
|
12
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Actions the Files app registers that cannot run on a page without the Files
|
|
@@ -42,7 +43,7 @@ export function userRelativePathFromHref(href, uid) {
|
|
|
42
43
|
const marker = `/dav/files/${uid}`
|
|
43
44
|
const at = decoded.indexOf(marker)
|
|
44
45
|
const rest = at === -1 ? decoded : decoded.slice(at + marker.length)
|
|
45
|
-
const trimmed = rest
|
|
46
|
+
const trimmed = stripTrailingSlashes(rest)
|
|
46
47
|
return trimmed === '' ? '/' : trimmed
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -54,7 +55,7 @@ export function userRelativePathFromHref(href, uid) {
|
|
|
54
55
|
* @return {string} The child's path.
|
|
55
56
|
*/
|
|
56
57
|
export function joinPath(dir, name) {
|
|
57
|
-
return `${String(dir || '')
|
|
58
|
+
return `${stripTrailingSlashes(String(dir || ''))}/${String(name || '').replace(/^\/+/, '')}`
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
/**
|
|
@@ -74,8 +75,8 @@ export function joinPath(dir, name) {
|
|
|
74
75
|
* @return {Array<{name: string, path: string, aboveRoot: boolean}>} The crumbs, outermost first.
|
|
75
76
|
*/
|
|
76
77
|
export function crumbsFor(rootPath, currentPath, rootLabel = null) {
|
|
77
|
-
const root = String(rootPath || '/')
|
|
78
|
-
const current = String(currentPath || root)
|
|
78
|
+
const root = stripTrailingSlashes(String(rootPath || '/')) || '/'
|
|
79
|
+
const current = stripTrailingSlashes(String(currentPath || root)) || '/'
|
|
79
80
|
const crumbs = []
|
|
80
81
|
let path = ''
|
|
81
82
|
for (const segment of root.split('/').filter(Boolean)) {
|
|
@@ -209,7 +210,7 @@ export async function resolveObjectFolderInfo({ apiBase, register, schema, objec
|
|
|
209
210
|
try {
|
|
210
211
|
const response = await axios.request({
|
|
211
212
|
method: 'SEARCH',
|
|
212
|
-
url: `${remoteUrl
|
|
213
|
+
url: `${stripTrailingSlashes(remoteUrl)}/`,
|
|
213
214
|
headers: { 'Content-Type': 'application/xml' },
|
|
214
215
|
data: fileIdSearchBody(folderId, uid),
|
|
215
216
|
responseType: 'text',
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import axios from '@nextcloud/axios'
|
|
21
21
|
import { FileType } from '@nextcloud/files'
|
|
22
22
|
import { generateUrl } from '@nextcloud/router'
|
|
23
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* A browser path (`/a/b`) as the API's relative path (`a/b`).
|
|
@@ -28,7 +29,7 @@ import { generateUrl } from '@nextcloud/router'
|
|
|
28
29
|
* @return {string} The relative path, empty for the root.
|
|
29
30
|
*/
|
|
30
31
|
export function toApiPath(path) {
|
|
31
|
-
return String(path || '').replace(
|
|
32
|
+
return stripTrailingSlashes(String(path || '')).replace(/^\/+/, '')
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -197,6 +197,7 @@ import { generateUrl } from '@nextcloud/router'
|
|
|
197
197
|
import CnFilesWidgetDeleteDialog from '../../dialogs/CnFilesWidgetDeleteDialog.vue'
|
|
198
198
|
import CnFilePreview from '../CnFilePreview/CnFilePreview.vue'
|
|
199
199
|
import { useFileOpener } from '../../composables/useFileOpener.js'
|
|
200
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
200
201
|
|
|
201
202
|
/**
|
|
202
203
|
* CnFilesWidget — an inline Nextcloud Files browser rendered as a dashboard
|
|
@@ -815,7 +816,7 @@ export default {
|
|
|
815
816
|
* @return {string} the joined path.
|
|
816
817
|
*/
|
|
817
818
|
joinPath(base, name) {
|
|
818
|
-
const trimmedBase = String(base || '/')
|
|
819
|
+
const trimmedBase = stripTrailingSlashes(String(base || '/'))
|
|
819
820
|
const trimmedName = String(name || '').replace(/^\/+/, '')
|
|
820
821
|
if (trimmedBase === '' || trimmedBase === '/') {
|
|
821
822
|
return '/' + trimmedName
|
|
@@ -58,6 +58,7 @@ import { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'
|
|
|
58
58
|
import Close from 'vue-material-design-icons/Close.vue'
|
|
59
59
|
import Plus from 'vue-material-design-icons/Plus.vue'
|
|
60
60
|
import CnFieldPicker from '../CnFieldPicker/CnFieldPicker.vue'
|
|
61
|
+
import { isPrototypeKey } from '../../utils/prototypeKeys.js'
|
|
61
62
|
import { FILTER_OPERATORS } from './filterRows.js'
|
|
62
63
|
|
|
63
64
|
/**
|
|
@@ -211,6 +212,9 @@ export default {
|
|
|
211
212
|
* @return {void}
|
|
212
213
|
*/
|
|
213
214
|
update(i, cell, value) {
|
|
215
|
+
if (isPrototypeKey(cell)) {
|
|
216
|
+
return
|
|
217
|
+
}
|
|
214
218
|
this.rows[i][cell] = value
|
|
215
219
|
this.emit()
|
|
216
220
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<p v-if="rows.length === 0 && content.quietLineWithHistory !== false" class="cn-flow-runs-widget__empty">
|
|
30
30
|
{{ emptyLabel }}
|
|
31
31
|
</p>
|
|
32
|
-
<ul v-else class="cn-flow-runs-widget__list">
|
|
32
|
+
<ul v-else-if="rows.length > 0" class="cn-flow-runs-widget__list">
|
|
33
33
|
<li
|
|
34
34
|
v-for="(run, index) in rows"
|
|
35
35
|
:key="run.uuid || `row-${index}`"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getCurrentUser } from '@nextcloud/auth'
|
|
2
2
|
import axios from '@nextcloud/axios'
|
|
3
3
|
import { generateRemoteUrl } from '@nextcloud/router'
|
|
4
|
+
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Default WebDAV folder loader for CnFolderSidebar's `files` source.
|
|
@@ -104,7 +105,7 @@ function text(parent, local) {
|
|
|
104
105
|
* @return {string} The normalised path.
|
|
105
106
|
*/
|
|
106
107
|
function normalizePath(path) {
|
|
107
|
-
const trimmed = (path || '/')
|
|
108
|
+
const trimmed = stripTrailingSlashes(path || '/')
|
|
108
109
|
return trimmed.startsWith('/') ? trimmed : '/' + trimmed
|
|
109
110
|
}
|
|
110
111
|
|
|
@@ -1054,6 +1054,7 @@ import { objectDisplayName } from '../../utils/objectName.js'
|
|
|
1054
1054
|
import { fieldWithOptionsFrom, filterOptions, formTokenKeys, isOptionsFrom, loadOptionsFrom, resolveFormTokens } from '../../utils/optionsFrom.js'
|
|
1055
1055
|
import { languageOptions, resolveDefaultToken, timezoneOptions } from '../../utils/pickerOptions.js'
|
|
1056
1056
|
import { getDotted, planPropertySourceFill } from '../../utils/propertySourceFill.js'
|
|
1057
|
+
import { isPrototypeKey } from '../../utils/prototypeKeys.js'
|
|
1057
1058
|
import { pruneRows } from '../../utils/pruneRows.js'
|
|
1058
1059
|
import { readPath } from '../../utils/readPath.js'
|
|
1059
1060
|
import { resolveFilterValue } from '../../utils/resolveFilterTokens.js'
|
|
@@ -4281,8 +4282,7 @@ export default {
|
|
|
4281
4282
|
return
|
|
4282
4283
|
}
|
|
4283
4284
|
const [head, ...rest] = key.split('.')
|
|
4284
|
-
|
|
4285
|
-
if (unsafe.includes(head) || rest.some((k) => unsafe.includes(k))) {
|
|
4285
|
+
if (isPrototypeKey(head) || rest.some(isPrototypeKey)) {
|
|
4286
4286
|
return
|
|
4287
4287
|
}
|
|
4288
4288
|
const clone = JSON.parse(JSON.stringify(this.formData[head] ?? {}))
|
|
@@ -694,12 +694,13 @@ export default {
|
|
|
694
694
|
formatSVG() {
|
|
695
695
|
try {
|
|
696
696
|
const input = String(this.customSvg || '').trim()
|
|
697
|
-
const
|
|
698
|
-
|
|
697
|
+
const start = input.search(/<svg/i)
|
|
698
|
+
const length = start === -1 ? -1 : input.slice(start).search(/<\/svg>/i)
|
|
699
|
+
if (length === -1) {
|
|
699
700
|
return
|
|
700
701
|
}
|
|
701
702
|
const parser = new DOMParser()
|
|
702
|
-
const doc = parser.parseFromString(
|
|
703
|
+
const doc = parser.parseFromString(input.slice(start, start + length + 6), 'image/svg+xml')
|
|
703
704
|
if (doc.getElementsByTagName('parsererror').length > 0) {
|
|
704
705
|
return
|
|
705
706
|
}
|
|
@@ -166,10 +166,23 @@ export function fromOpenGemeenten(list = []) {
|
|
|
166
166
|
* @param {string|undefined} svg the SVG markup.
|
|
167
167
|
* @return {string|undefined} the first path's `d` attribute, or undefined.
|
|
168
168
|
*/
|
|
169
|
-
function extractSvgPath(svg) {
|
|
169
|
+
export function extractSvgPath(svg) {
|
|
170
170
|
if (typeof svg !== 'string') {
|
|
171
171
|
return undefined
|
|
172
172
|
}
|
|
173
|
-
const
|
|
174
|
-
|
|
173
|
+
const open = /<path/gi
|
|
174
|
+
let tag
|
|
175
|
+
while ((tag = open.exec(svg)) !== null) {
|
|
176
|
+
const end = svg.indexOf('>', tag.index)
|
|
177
|
+
const attrs = svg.slice(tag.index + 5, end === -1 ? svg.length : end)
|
|
178
|
+
const d = /\sd="([^"]+)"/i.exec(attrs)
|
|
179
|
+
if (d) {
|
|
180
|
+
return d[1]
|
|
181
|
+
}
|
|
182
|
+
if (end === -1) {
|
|
183
|
+
return undefined
|
|
184
|
+
}
|
|
185
|
+
open.lastIndex = end
|
|
186
|
+
}
|
|
187
|
+
return undefined
|
|
175
188
|
}
|