@conduction/nextcloud-vue 2.161.0 → 2.162.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js +3 -2
  2. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
  4. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js +1 -1
  5. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js +2 -1
  6. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js.map +1 -1
  7. package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js.map +1 -1
  8. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  9. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
  10. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  11. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  12. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +8 -8
  13. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  14. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  15. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  16. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +23 -0
  17. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  18. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  19. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  20. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +48 -5
  21. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  22. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +2 -1
  23. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  24. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
  25. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +4 -3
  26. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  27. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  28. package/dist/esm/components/CnFilesBrowser/filesBrowser.js +6 -5
  29. package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
  30. package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
  31. package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js +2 -1
  32. package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js.map +1 -1
  33. package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue3.js.map +1 -1
  34. package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue.js +1 -1
  35. package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js +41 -39
  37. package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js.map +1 -1
  38. package/dist/esm/components/CnFolderSidebar/webdavFolders.js +2 -1
  39. package/dist/esm/components/CnFolderSidebar/webdavFolders.js.map +1 -1
  40. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +11 -3
  41. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  42. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  43. package/dist/esm/components/CnMenuWidget/menuActive.js +2 -1
  44. package/dist/esm/components/CnMenuWidget/menuActive.js.map +1 -1
  45. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
  46. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +39 -2
  47. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
  48. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +1 -1
  49. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
  50. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue.js +1 -1
  51. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -1
  52. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
  53. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue3.js.map +1 -1
  54. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  55. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +5 -5
  56. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  57. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  58. package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
  59. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +130 -1
  60. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
  61. package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js +27 -16
  62. package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
  63. package/dist/esm/l10n/en.json.js +9 -1
  64. package/dist/esm/l10n/en.json.js.map +1 -1
  65. package/dist/esm/l10n/nl.json.js +9 -1
  66. package/dist/esm/l10n/nl.json.js.map +1 -1
  67. package/dist/esm/library-style.js +1 -1
  68. package/dist/esm/nextcloud-vue.css +560 -488
  69. package/dist/esm/utils/buildManifestRoutes.js +2 -1
  70. package/dist/esm/utils/buildManifestRoutes.js.map +1 -1
  71. package/dist/esm/utils/cnFetch.js +1 -15
  72. package/dist/esm/utils/cnFetch.js.map +1 -1
  73. package/dist/esm/utils/fillTemplate.js +29 -2
  74. package/dist/esm/utils/fillTemplate.js.map +1 -1
  75. package/dist/esm/utils/forge.js +4 -1
  76. package/dist/esm/utils/forge.js.map +1 -1
  77. package/dist/esm/utils/myTeam.js +17 -3
  78. package/dist/esm/utils/myTeam.js.map +1 -1
  79. package/dist/esm/utils/rowAggregate.js +20 -1
  80. package/dist/esm/utils/rowAggregate.js.map +1 -1
  81. package/dist/esm/utils/trailingSlashes.js +24 -0
  82. package/dist/esm/utils/trailingSlashes.js.map +1 -0
  83. package/dist/nextcloud-vue.cjs.js +1009 -675
  84. package/dist/nextcloud-vue.cjs.js.map +2 -2
  85. package/dist/nextcloud-vue.css +560 -488
  86. package/l10n/en.json +9 -1
  87. package/l10n/nl.json +9 -1
  88. package/package.json +1 -1
  89. package/src/components/CnActionsMenu/CnActionsMenu.vue +3 -2
  90. package/src/components/CnAddressSearch/CnAddressSearch.vue +2 -1
  91. package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
  92. package/src/components/CnDataTable/CnDataTable.vue +8 -8
  93. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +23 -0
  94. package/src/components/CnFactsWidget/CnFactsWidget.vue +49 -5
  95. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +4 -3
  96. package/src/components/CnFilesBrowser/filesBrowser.js +6 -5
  97. package/src/components/CnFilesWidget/CnFilesWidget.vue +2 -1
  98. package/src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue +1 -1
  99. package/src/components/CnFolderSidebar/webdavFolders.js +2 -1
  100. package/src/components/CnIndexPage/CnIndexPage.vue +11 -3
  101. package/src/components/CnMenuWidget/menuActive.js +2 -1
  102. package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +40 -3
  103. package/src/components/CnPageTreeNode/CnPageTreeNode.vue +2 -1
  104. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +5 -5
  105. package/src/css/dialog.css +7 -0
  106. package/src/css/look-board-detail.css +35 -0
  107. package/src/css/look-board.css +18 -1
  108. package/src/integrations/builtin/email/CnEmailTab.vue +155 -4
  109. package/src/utils/buildManifestRoutes.js +2 -1
  110. package/src/utils/cnFetch.js +3 -15
  111. package/src/utils/fillTemplate.js +29 -2
  112. package/src/utils/forge.js +3 -1
  113. package/src/utils/myTeam.js +17 -3
  114. package/src/utils/rowAggregate.js +19 -0
  115. package/src/utils/trailingSlashes.js +21 -0
@@ -3736,7 +3736,15 @@ var translations$s = {
3736
3736
  "Filter on {name}": "Filter on {name}",
3737
3737
  "(empty)": "(empty)",
3738
3738
  "Drag, or use the arrow keys, to move": "Drag, or use the arrow keys, to move",
3739
- "The new order could not be saved": "The new order could not be saved"
3739
+ "The new order could not be saved": "The new order could not be saved",
3740
+ "From {name}": "From {name}",
3741
+ "To {name}": "To {name}",
3742
+ "linked automatically": "linked automatically",
3743
+ "linked automatically via {mailbox}": "linked automatically via {mailbox}",
3744
+ "from a saved mail file": "from a saved mail file",
3745
+ "linked by {name}": "linked by {name}",
3746
+ "Archived as PDF": "Archived as PDF",
3747
+ "Archived as {format}": "Archived as {format}"
3740
3748
  };
3741
3749
  var plurals$1 = {
3742
3750
  "{count} member": [
@@ -6908,7 +6916,15 @@ var translations$c = {
6908
6916
  "Filter on {name}": "Filteren op {name}",
6909
6917
  "(empty)": "(leeg)",
6910
6918
  "Drag, or use the arrow keys, to move": "Sleep, of gebruik de pijltjestoetsen, om te verplaatsen",
6911
- "The new order could not be saved": "De nieuwe volgorde kon niet worden opgeslagen"
6919
+ "The new order could not be saved": "De nieuwe volgorde kon niet worden opgeslagen",
6920
+ "From {name}": "Van {name}",
6921
+ "To {name}": "Aan {name}",
6922
+ "linked automatically": "automatisch gekoppeld",
6923
+ "linked automatically via {mailbox}": "automatisch gekoppeld via {mailbox}",
6924
+ "from a saved mail file": "uit een opgeslagen mailbestand",
6925
+ "linked by {name}": "door {name} gekoppeld",
6926
+ "Archived as PDF": "Als pdf gearchiveerd",
6927
+ "Archived as {format}": "Als {format} gearchiveerd"
6912
6928
  };
6913
6929
  var plurals = {
6914
6930
  "{count} member": [
@@ -13967,9 +13983,23 @@ function fillMyTeamToken(text, name) {
13967
13983
  if (typeof text !== 'string' || !text.includes('{myTeam}')) {
13968
13984
  return text
13969
13985
  }
13970
- return text
13971
- .replace(/\[([^\]]*\{myTeam\}[^\]]*)\]/g, (match, part) => (name ? part.replaceAll('{myTeam}', name) : ''))
13972
- .replaceAll('{myTeam}', name)
13986
+ let out = '';
13987
+ let pos = 0;
13988
+ for (;;) {
13989
+ const open = text.indexOf('[', pos);
13990
+ const close = open === -1 ? -1 : text.indexOf(']', open + 1);
13991
+ if (close === -1) {
13992
+ break
13993
+ }
13994
+ const part = text.slice(open + 1, close);
13995
+ if (part.includes('{myTeam}')) {
13996
+ out += text.slice(pos, open) + (name ? part.replaceAll('{myTeam}', name) : '');
13997
+ } else {
13998
+ out += text.slice(pos, close + 1);
13999
+ }
14000
+ pos = close + 1;
14001
+ }
14002
+ return (out + text.slice(pos)).replaceAll('{myTeam}', name)
13973
14003
  }
13974
14004
 
13975
14005
  /**
@@ -33364,6 +33394,28 @@ script$8t.render = render$8s;
33364
33394
  script$8t.__scopeId = "data-v-f319dc6a";
33365
33395
  const __sfc_main$8n = script$8t;
33366
33396
 
33397
+ /**
33398
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
33399
+ * SPDX-License-Identifier: EUPL-1.2
33400
+ *
33401
+ * Trailing-slash trimming, with no imports, so any module can use it.
33402
+ */
33403
+
33404
+ /**
33405
+ * Drop trailing `/` characters in one linear pass (a `/\/+$/` pattern
33406
+ * backtracks quadratically on a long run of slashes).
33407
+ *
33408
+ * @param {string} value The string to trim.
33409
+ * @return {string} The string without trailing slashes.
33410
+ */
33411
+ function stripTrailingSlashes(value) {
33412
+ let end = value.length;
33413
+ while (end > 0 && value.charCodeAt(end - 1) === 47) {
33414
+ end--;
33415
+ }
33416
+ return value.slice(0, end)
33417
+ }
33418
+
33367
33419
  /**
33368
33420
  * The one HTTP client for Conduction Nextcloud apps (ADR-071 Decision 1).
33369
33421
  *
@@ -33428,21 +33480,6 @@ function configureCnFetch(config = {}) {
33428
33480
  };
33429
33481
  }
33430
33482
 
33431
- /**
33432
- * Drop trailing `/` characters in one linear pass (a `/\/+$/` pattern
33433
- * backtracks quadratically on a long run of slashes).
33434
- *
33435
- * @param {string} value The string to trim.
33436
- * @return {string} The string without trailing slashes.
33437
- */
33438
- function stripTrailingSlashes(value) {
33439
- let end = value.length;
33440
- while (end > 0 && value.charCodeAt(end - 1) === 47) {
33441
- end--;
33442
- }
33443
- return value.slice(0, end)
33444
- }
33445
-
33446
33483
  /**
33447
33484
  * The bearer credential, resolved.
33448
33485
  *
@@ -43749,6 +43786,34 @@ function firstFilled(templates, object, translate = (key) => key, now = new Date
43749
43786
  return ''
43750
43787
  }
43751
43788
 
43789
+ /**
43790
+ * Split a template into literal, field, literal, … as
43791
+ * `template.split(/\{([^}]+)\}/)` does, in one linear pass.
43792
+ *
43793
+ * @param {string} template The template, with `{field}` placeholders.
43794
+ * @return {string[]} The literals at even indexes, the field names at odd ones.
43795
+ */
43796
+ function splitFields(template) {
43797
+ const parts = [];
43798
+ let literalStart = 0;
43799
+ let open = template.indexOf('{');
43800
+ while (open !== -1) {
43801
+ const close = template.indexOf('}', open + 1);
43802
+ if (close === -1) {
43803
+ break
43804
+ }
43805
+ if (close === open + 1) {
43806
+ open = template.indexOf('{', close + 1);
43807
+ continue
43808
+ }
43809
+ parts.push(template.slice(literalStart, open), template.slice(open + 1, close));
43810
+ literalStart = close + 1;
43811
+ open = template.indexOf('{', literalStart);
43812
+ }
43813
+ parts.push(template.slice(literalStart));
43814
+ return parts
43815
+ }
43816
+
43752
43817
  /**
43753
43818
  * Fill a template such as `"{identifier} · {requester}"` field by field
43754
43819
  * (a table column's `secondary` line, a detail page's meta line).
@@ -43766,8 +43831,7 @@ function firstFilled(templates, object, translate = (key) => key, now = new Date
43766
43831
  * @return {string} The filled template.
43767
43832
  */
43768
43833
  function joinTemplateParts(template, valueOf) {
43769
- // split() with a capture group alternates literal, field, literal, …
43770
- const parts = template.split(/\{([^}]+)\}/);
43834
+ const parts = splitFields(template);
43771
43835
  const lead = parts[0];
43772
43836
  const tail = parts[parts.length - 1];
43773
43837
  let body = '';
@@ -45559,6 +45623,25 @@ function isRowAggregate(agg) {
45559
45623
  return Boolean(agg && agg.register && agg.schema && (agg.op === 'count' || (agg.op === 'max' && agg.field)))
45560
45624
  }
45561
45625
 
45626
+ /**
45627
+ * One row's figures in a map of rows, created on first use. Rows live in a
45628
+ * Map and figures in a prototype-less object, so a row id or figure key such
45629
+ * as `__proto__` stays an ordinary key.
45630
+ *
45631
+ * @param {Map<string, object>} rows The figures by row id.
45632
+ * @param {string|number} rowId The row id (read as a string).
45633
+ * @return {object} The row's figures, by key.
45634
+ */
45635
+ function cellsOf(rows, rowId) {
45636
+ const key = String(rowId);
45637
+ let cells = rows.get(key);
45638
+ if (!cells) {
45639
+ cells = Object.create(null);
45640
+ rows.set(key, cells);
45641
+ }
45642
+ return cells
45643
+ }
45644
+
45562
45645
  /**
45563
45646
  * Fill an aggregate's `where` for one row: a string `"@self.<path>"` reads
45564
45647
  * that path of the row, everything else is passed through.
@@ -50980,11 +51063,11 @@ var script$8b = {
50980
51063
  }
50981
51064
  const id = ++this.aggregateRequestId;
50982
51065
  this.aggregateLoading = true;
50983
- const next = {};
51066
+ const next = new Map();
50984
51067
  const jobs = [];
50985
51068
  for (const row of this.rows) {
50986
51069
  const rowKey = String(row[this.rowKey]);
50987
- next[rowKey] = {};
51070
+ const cells = cellsOf(next, rowKey);
50988
51071
  for (const col of aggCols) {
50989
51072
  const agg = col.aggregate;
50990
51073
  if (isEndpointAggregate(col)) {
@@ -50997,12 +51080,12 @@ var script$8b = {
50997
51080
  // first of them sorted on it descending ("Laatste contact").
50998
51081
  jobs.push(fetchRowAggregate(agg, row, (r, path) => this.getCellValue(r, path))
50999
51082
  .then((value) => {
51000
- next[rowKey][col.key] = value;
51083
+ cells[col.key] = value;
51001
51084
  })
51002
51085
  .catch((e) => {
51003
51086
  // eslint-disable-next-line no-console
51004
51087
  console.warn(`[CnDataTable] aggregate "${col.key}" count failed for row ${rowKey}`, e);
51005
- next[rowKey][col.key] = undefined;
51088
+ cells[col.key] = undefined;
51006
51089
  }));
51007
51090
  }
51008
51091
  }
@@ -51013,7 +51096,7 @@ var script$8b = {
51013
51096
  if (id !== this.aggregateRequestId) {
51014
51097
  return
51015
51098
  }
51016
- this.aggregateValues = next;
51099
+ this.aggregateValues = Object.fromEntries(next);
51017
51100
  this.aggregateLoading = false;
51018
51101
  },
51019
51102
 
@@ -51044,7 +51127,7 @@ var script$8b = {
51044
51127
  * hides the column.
51045
51128
  *
51046
51129
  * @param {object} col The column.
51047
- * @param {object} next The values being built, by row then column.
51130
+ * @param {Map<string, object>} next The values being built, by row then column.
51048
51131
  * @param {number} id The batch id, to drop a stale answer.
51049
51132
  * @return {Promise<void>}
51050
51133
  * @spec openspec/changes/aggregate-from-endpoint/specs/cn-data-table/spec.md
@@ -51076,7 +51159,7 @@ var script$8b = {
51076
51159
  }
51077
51160
  for (const row of this.rows) {
51078
51161
  const k = keyOf(row);
51079
- next[String(row[this.rowKey])][col.key] = k !== '' && values[k] !== undefined ? values[k] : 0;
51162
+ cellsOf(next, String(row[this.rowKey]))[col.key] = k !== '' && values[k] !== undefined ? values[k] : 0;
51080
51163
  }
51081
51164
  },
51082
51165
 
@@ -113942,6 +114025,7 @@ var script$7i = {
113942
114025
  * buble-compiled Vue 2 template stays free of `?.` / `??`.
113943
114026
  *
113944
114027
  * @return {object[]} One descriptor per message.
114028
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
113945
114029
  */
113946
114030
  rows() {
113947
114031
  return this.messages.map((message) => {
@@ -113949,6 +114033,8 @@ var script$7i = {
113949
114033
  const d = dateRaw === '' ? null : new Date(dateRaw);
113950
114034
  const dateValid = d !== null && Number.isNaN(d.getTime()) === false;
113951
114035
  const sender = this.formatSender(message);
114036
+ const details = this.linkDetails(message);
114037
+ const archivedAs = details === null ? '' : this.text(details.archivedAs);
113952
114038
  return {
113953
114039
  id: message.id,
113954
114040
  message,
@@ -113962,6 +114048,10 @@ var script$7i = {
113962
114048
  avatarName: sender,
113963
114049
  avatarUser: this.senderEmail(message),
113964
114050
  href: this.threadUrl(message),
114051
+ meta: details === null ? '' : this.metaLine(message, details, dateValid ? d : null),
114052
+ outbound: details !== null && details.direction === 'outbound',
114053
+ pill: details === null ? '' : this.archiveLabel(archivedAs),
114054
+ archived: archivedAs !== '',
113965
114055
  }
113966
114056
  })
113967
114057
  },
@@ -114139,6 +114229,126 @@ var script$7i = {
114139
114229
  return false
114140
114230
  },
114141
114231
 
114232
+ /**
114233
+ * The link's details (OpenRegister's EmailLink `details`), or null for
114234
+ * a link without them, which keeps the plain sender line.
114235
+ *
114236
+ * @param {object} message The message record.
114237
+ * @return {object|null} The details.
114238
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
114239
+ */
114240
+ linkDetails(message) {
114241
+ const details = message.details;
114242
+ if (details === null || typeof details !== 'object') {
114243
+ return null
114244
+ }
114245
+ const filled = Object.keys(details).some((key) => details[key] !== null && details[key] !== undefined && details[key] !== '');
114246
+ return filled ? details : null
114247
+ },
114248
+
114249
+ /**
114250
+ * A trimmed string, or '' for anything that is not a filled string.
114251
+ *
114252
+ * @param {unknown} value The value.
114253
+ * @return {string} The text.
114254
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
114255
+ */
114256
+ text(value) {
114257
+ return typeof value === 'string' ? value.trim() : ''
114258
+ },
114259
+
114260
+ /**
114261
+ * The line under the subject: who it is from or to, when, how many
114262
+ * attachments, and how it was linked, joined by middle dots.
114263
+ *
114264
+ * @param {object} message The message record.
114265
+ * @param {object} details The link details.
114266
+ * @param {Date|null} date The mail's moment, or null when unknown.
114267
+ * @return {string} The meta line.
114268
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
114269
+ */
114270
+ metaLine(message, details, date) {
114271
+ const parts = [];
114272
+ const recipient = this.text(details.recipientName);
114273
+ if (details.direction === 'outbound' && recipient !== '') {
114274
+ parts.push(l10n.translate('nextcloud-vue', 'To {name}', { name: recipient }));
114275
+ } else {
114276
+ parts.push(l10n.translate('nextcloud-vue', 'From {name}', { name: this.formatSender(message) }));
114277
+ }
114278
+ if (date !== null) {
114279
+ parts.push(this.whenText(date));
114280
+ }
114281
+ const count = Number(details.attachmentCount);
114282
+ if (Number.isInteger(count) && count > 0) {
114283
+ parts.push(l10n.translatePlural('nextcloud-vue', '%n attachment', '%n attachments', count));
114284
+ }
114285
+ const linked = this.linkedText(message, details);
114286
+ if (linked !== '') {
114287
+ parts.push(linked);
114288
+ }
114289
+ return parts.join(' · ')
114290
+ },
114291
+
114292
+ /**
114293
+ * The mail's date as the boards write it: "5 okt 09.15" in the last
114294
+ * week, "12 mrt" before that.
114295
+ *
114296
+ * @param {Date} date The mail's moment.
114297
+ * @return {string} The date.
114298
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
114299
+ */
114300
+ whenText(date) {
114301
+ const day = formatBoardDate(date);
114302
+ const age = ageInDays(date);
114303
+ if (age !== null && age >= 0 && age <= 7) {
114304
+ return day + ' ' + formatTimeOfDay(date)
114305
+ }
114306
+ return day
114307
+ },
114308
+
114309
+ /**
114310
+ * How the mail was linked: automatically through a shared mailbox, from
114311
+ * a saved mail file, or by a person.
114312
+ *
114313
+ * @param {object} message The message record.
114314
+ * @param {object} details The link details.
114315
+ * @return {string} The phrase, or '' when unknown.
114316
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
114317
+ */
114318
+ linkedText(message, details) {
114319
+ if (details.linkedVia === 'mailbox') {
114320
+ const mailbox = this.text(details.mailboxName);
114321
+ return mailbox === ''
114322
+ ? l10n.translate('nextcloud-vue', 'linked automatically')
114323
+ : l10n.translate('nextcloud-vue', 'linked automatically via {mailbox}', { mailbox })
114324
+ }
114325
+ if (details.linkedVia === 'file') {
114326
+ return l10n.translate('nextcloud-vue', 'from a saved mail file')
114327
+ }
114328
+ if (details.linkedVia === 'manual') {
114329
+ const name = userDisplayName(message.linkedBy);
114330
+ return name === '' ? '' : l10n.translate('nextcloud-vue', 'linked by {name}', { name })
114331
+ }
114332
+ return ''
114333
+ },
114334
+
114335
+ /**
114336
+ * The pill beside a mail with details: its archive copy, or "Linked".
114337
+ *
114338
+ * @param {string} archivedAs The archive format, such as pdf, or ''.
114339
+ * @return {string} The pill text.
114340
+ * @spec openspec/changes/linked-mail-row-details/specs/linked-mail-row-details/spec.md#requirement-a-linked-mail-with-details-reads-as-the-boards-draw-it
114341
+ */
114342
+ archiveLabel(archivedAs) {
114343
+ if (archivedAs === '') {
114344
+ return l10n.translate('nextcloud-vue', 'Linked')
114345
+ }
114346
+ if (archivedAs.toLowerCase() === 'pdf') {
114347
+ return l10n.translate('nextcloud-vue', 'Archived as PDF')
114348
+ }
114349
+ return l10n.translate('nextcloud-vue', 'Archived as {format}', { format: archivedAs })
114350
+ },
114351
+
114142
114352
  rawWhen(message) {
114143
114353
  const raw = message.mailDate || message.date || message.linkedAt;
114144
114354
  if (raw === undefined || raw === null || raw === '') {
@@ -114247,7 +114457,10 @@ const _hoisted_6$4v = {
114247
114457
  const _hoisted_7$41 = { class: "cn-email-tab__body" };
114248
114458
  const _hoisted_8$3E = { class: "cn-email-tab__line" };
114249
114459
  const _hoisted_9$3j = ["title"];
114250
- const _hoisted_10$2X = { class: "cn-email-tab__date" };
114460
+ const _hoisted_10$2X = {
114461
+ key: 0,
114462
+ class: "cn-email-tab__date"
114463
+ };
114251
114464
  const _hoisted_11$2D = ["title"];
114252
114465
  const _hoisted_12$2n = ["title"];
114253
114466
 
@@ -114317,34 +114530,36 @@ function render$7h(_ctx, _cache, $props, $setup, $data, $options) {
114317
114530
  class: vue$1.normalizeClass(["cn-email-tab__unread-dot", { 'is-shown': row.unread }])
114318
114531
  }, null, 2 /* CLASS */),
114319
114532
  vue$1.createVNode(_component_NcAvatar, {
114320
- class: "cn-email-tab__avatar",
114533
+ class: vue$1.normalizeClass(["cn-email-tab__avatar", { 'cn-email-tab__avatar--outbound': row.outbound }]),
114321
114534
  size: 36,
114322
114535
  displayName: row.avatarName,
114323
114536
  user: row.avatarUser,
114324
114537
  isNoUser: true
114325
- }, null, 8 /* PROPS */, ["displayName", "user"]),
114538
+ }, null, 8 /* PROPS */, ["class", "displayName", "user"]),
114326
114539
  vue$1.createElementVNode("div", _hoisted_7$41, [
114327
114540
  vue$1.createElementVNode("div", _hoisted_8$3E, [
114328
114541
  vue$1.createElementVNode("span", {
114329
114542
  class: "cn-email-tab__subject",
114330
114543
  title: row.subject
114331
114544
  }, vue$1.toDisplayString(row.subject), 9 /* TEXT, PROPS */, _hoisted_9$3j),
114332
- vue$1.createElementVNode("span", _hoisted_10$2X, [
114333
- (row.dateValid)
114334
- ? (vue$1.openBlock(), vue$1.createBlock(_component_NcDateTime, {
114335
- key: 0,
114336
- timestamp: row.dateMs,
114337
- relativeTime: "short"
114338
- }, null, 8 /* PROPS */, ["timestamp"]))
114339
- : (vue$1.openBlock(), vue$1.createElementBlock(vue$1.Fragment, { key: 1 }, [
114340
- vue$1.createTextVNode(vue$1.toDisplayString(row.dateRaw), 1 /* TEXT */)
114341
- ], 64 /* STABLE_FRAGMENT */))
114342
- ])
114545
+ (!row.meta)
114546
+ ? (vue$1.openBlock(), vue$1.createElementBlock("span", _hoisted_10$2X, [
114547
+ (row.dateValid)
114548
+ ? (vue$1.openBlock(), vue$1.createBlock(_component_NcDateTime, {
114549
+ key: 0,
114550
+ timestamp: row.dateMs,
114551
+ relativeTime: "short"
114552
+ }, null, 8 /* PROPS */, ["timestamp"]))
114553
+ : (vue$1.openBlock(), vue$1.createElementBlock(vue$1.Fragment, { key: 1 }, [
114554
+ vue$1.createTextVNode(vue$1.toDisplayString(row.dateRaw), 1 /* TEXT */)
114555
+ ], 64 /* STABLE_FRAGMENT */))
114556
+ ]))
114557
+ : vue$1.createCommentVNode("v-if", true)
114343
114558
  ]),
114344
114559
  vue$1.createElementVNode("div", {
114345
114560
  class: "cn-email-tab__sender",
114346
- title: row.sender
114347
- }, vue$1.toDisplayString(row.sender), 9 /* TEXT, PROPS */, _hoisted_11$2D),
114561
+ title: row.meta || row.sender
114562
+ }, vue$1.toDisplayString(row.meta || row.sender), 9 /* TEXT, PROPS */, _hoisted_11$2D),
114348
114563
  (row.snippet)
114349
114564
  ? (vue$1.openBlock(), vue$1.createElementBlock("div", {
114350
114565
  key: 0,
@@ -114356,6 +114571,12 @@ function render$7h(_ctx, _cache, $props, $setup, $data, $options) {
114356
114571
  ]),
114357
114572
  _: 2 /* DYNAMIC */
114358
114573
  }, 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["class"])),
114574
+ (row.pill)
114575
+ ? (vue$1.openBlock(), vue$1.createElementBlock("span", {
114576
+ key: 0,
114577
+ class: vue$1.normalizeClass(["cn-email-tab__pill", { 'cn-email-tab__pill--archived': row.archived }])
114578
+ }, vue$1.toDisplayString(row.pill), 3 /* TEXT, CLASS */))
114579
+ : vue$1.createCommentVNode("v-if", true),
114359
114580
  vue$1.createVNode(_component_NcActions, {
114360
114581
  class: "cn-email-tab__menu",
114361
114582
  ariaLabel: $props.moreActionsLabel,
@@ -114433,7 +114654,7 @@ function render$7h(_ctx, _cache, $props, $setup, $data, $options) {
114433
114654
  }
114434
114655
 
114435
114656
  script$7i.render = render$7h;
114436
- script$7i.__scopeId = "data-v-62b8b25e";
114657
+ script$7i.__scopeId = "data-v-83dac03a";
114437
114658
  const __sfc_main$7c = script$7i;
114438
114659
 
114439
114660
  /**
@@ -118940,7 +119161,7 @@ function userRelativePathFromHref(href, uid) {
118940
119161
  const marker = `/dav/files/${uid}`;
118941
119162
  const at = decoded.indexOf(marker);
118942
119163
  const rest = at === -1 ? decoded : decoded.slice(at + marker.length);
118943
- const trimmed = rest.replace(/\/+$/, '');
119164
+ const trimmed = stripTrailingSlashes(rest);
118944
119165
  return trimmed === '' ? '/' : trimmed
118945
119166
  }
118946
119167
 
@@ -118952,7 +119173,7 @@ function userRelativePathFromHref(href, uid) {
118952
119173
  * @return {string} The child's path.
118953
119174
  */
118954
119175
  function joinPath(dir, name) {
118955
- return `${String(dir || '').replace(/\/+$/, '')}/${String(name || '').replace(/^\/+/, '')}`
119176
+ return `${stripTrailingSlashes(String(dir || ''))}/${String(name || '').replace(/^\/+/, '')}`
118956
119177
  }
118957
119178
 
118958
119179
  /**
@@ -118972,8 +119193,8 @@ function joinPath(dir, name) {
118972
119193
  * @return {Array<{name: string, path: string, aboveRoot: boolean}>} The crumbs, outermost first.
118973
119194
  */
118974
119195
  function crumbsFor(rootPath, currentPath, rootLabel = null) {
118975
- const root = String(rootPath || '/').replace(/\/+$/, '') || '/';
118976
- const current = String(currentPath || root).replace(/\/+$/, '') || '/';
119196
+ const root = stripTrailingSlashes(String(rootPath || '/')) || '/';
119197
+ const current = stripTrailingSlashes(String(currentPath || root)) || '/';
118977
119198
  const crumbs = [];
118978
119199
  let path = '';
118979
119200
  for (const segment of root.split('/').filter(Boolean)) {
@@ -119084,7 +119305,7 @@ async function resolveObjectFolderInfo({ apiBase, register, schema, objectId, ui
119084
119305
  try {
119085
119306
  const response = await axios$1.request({
119086
119307
  method: 'SEARCH',
119087
- url: `${remoteUrl.replace(/\/+$/, '')}/`,
119308
+ url: `${stripTrailingSlashes(remoteUrl)}/`,
119088
119309
  headers: { 'Content-Type': 'application/xml' },
119089
119310
  data: fileIdSearchBody(folderId, uid),
119090
119311
  responseType: 'text',
@@ -120366,7 +120587,7 @@ var script$7a = {
120366
120587
  * @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
120367
120588
  */
120368
120589
  atRoot() {
120369
- const root = String(this.rootPath || '/').replace(/\/+$/, '') || '/';
120590
+ const root = stripTrailingSlashes(String(this.rootPath || '/')) || '/';
120370
120591
  const last = this.crumbs[this.crumbs.length - 1];
120371
120592
  return Boolean(last) && last.path === root
120372
120593
  },
@@ -120859,7 +121080,7 @@ var script$7a = {
120859
121080
  this.nodes = nodes;
120860
121081
  await this.resolveRowData(this.nodes);
120861
121082
  } catch (err) {
120862
- const atRoot = (this.currentPath.replace(/\/+$/, '') || '/') === (this.rootPath.replace(/\/+$/, '') || '/');
121083
+ const atRoot = (stripTrailingSlashes(this.currentPath) || '/') === (stripTrailingSlashes(this.rootPath) || '/');
120863
121084
  this.error = err?.status === 404
120864
121085
  ? (atRoot ? l10n.translate('nextcloud-vue', 'You cannot see these files') : l10n.translate('nextcloud-vue', 'This folder no longer exists'))
120865
121086
  : (err?.status === 403 ? l10n.translate('nextcloud-vue', 'You cannot see this folder') : l10n.translate('nextcloud-vue', 'The folder could not be read'));
@@ -120918,7 +121139,7 @@ var script$7a = {
120918
121139
  * @return {void}
120919
121140
  */
120920
121141
  navigate(path) {
120921
- const root = this.rootPath.replace(/\/+$/, '') || '/';
121142
+ const root = stripTrailingSlashes(this.rootPath) || '/';
120922
121143
  if (path !== root && !path.startsWith(root === '/' ? '/' : `${root}/`)) {
120923
121144
  return
120924
121145
  }
@@ -123324,7 +123545,7 @@ function render$79(_ctx, _cache, $props, $setup, $data, $options) {
123324
123545
  }
123325
123546
 
123326
123547
  script$7a.render = render$79;
123327
- script$7a.__scopeId = "data-v-4990d6a1";
123548
+ script$7a.__scopeId = "data-v-b37addb6";
123328
123549
  const __sfc_main$74 = script$7a;
123329
123550
 
123330
123551
  /**
@@ -164872,6 +165093,7 @@ function slotRenders(slot) {
164872
165093
  * else in the suggestion flow needs to change.
164873
165094
  */
164874
165095
 
165096
+
164875
165097
  /**
164876
165098
  * Default host per forge type. `forgejo`/`gitea` are self-hosted, so they
164877
165099
  * have no canonical public host — a `baseUrl` MUST be supplied for those.
@@ -164948,7 +165170,7 @@ function resolveForge(forge) {
164948
165170
  const baseUrl = (forge && forge.baseUrl)
164949
165171
  || FORGE_DEFAULT_BASE_URLS[type]
164950
165172
  || DEFAULT_FORGE.baseUrl;
164951
- return { type, baseUrl: baseUrl.replace(/\/+$/, '') }
165173
+ return { type, baseUrl: stripTrailingSlashes(baseUrl) }
164952
165174
  }
164953
165175
 
164954
165176
  /**
@@ -165113,10 +165335,10 @@ function resolveDocsUrl(base, anchor) {
165113
165335
  try {
165114
165336
  return new URL(a, b).toString()
165115
165337
  } catch {
165116
- return `${b.replace(/\/+$/, '')}${a}`
165338
+ return `${stripTrailingSlashes(b)}${a}`
165117
165339
  }
165118
165340
  }
165119
- return `${b.replace(/#.*$/, '').replace(/\/+$/, '')}#${a}`
165341
+ return `${stripTrailingSlashes(b.replace(/#.*$/, ''))}#${a}`
165120
165342
  }
165121
165343
 
165122
165344
  /**
@@ -205806,6 +206028,27 @@ var script$5n = {
205806
206028
  return title ? { titleLabel: title } : {}
205807
206029
  },
205808
206030
 
206031
+ /**
206032
+ * An integration widget's `labels` (prop name to text), translated in
206033
+ * the host's language: a leaf cannot translate the host app's words.
206034
+ *
206035
+ * @return {object} Prop name to translated text.
206036
+ * @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
206037
+ */
206038
+ leafLabels() {
206039
+ const labels = this.widget?.labels;
206040
+ if (!labels || typeof labels !== 'object' || Array.isArray(labels)) {
206041
+ return {}
206042
+ }
206043
+ const out = {};
206044
+ for (const [prop, text] of Object.entries(labels)) {
206045
+ if (typeof text === 'string') {
206046
+ out[prop] = this.translateLabel(text);
206047
+ }
206048
+ }
206049
+ return out
206050
+ },
206051
+
205809
206052
  integrationProps() {
205810
206053
  return {
205811
206054
  surface: this.surface,
@@ -205820,6 +206063,7 @@ var script$5n = {
205820
206063
  // the tabs card, repeating the label the open tab already shows.
205821
206064
  ...(this.usesBareWidget ? { chromeless: true } : {}),
205822
206065
  ...this.derivedIntegrationContext,
206066
+ ...this.leafLabels,
205823
206067
  ...this.resolvedWidgetProps,
205824
206068
  }
205825
206069
  },
@@ -205839,6 +206083,7 @@ var script$5n = {
205839
206083
  // reads `integrationContext.objectId` gets the same object as
205840
206084
  // one that reads `objectId`.
205841
206085
  integrationContext: this.widgetIntegrationContext,
206086
+ ...this.leafLabels,
205842
206087
  ...this.resolvedWidgetProps,
205843
206088
  // A carded leaf reports its title row and empty state here.
205844
206089
  ...(this.wrapsMountLeaf ? { onHeader: this.onRendererHeader } : {}),
@@ -207046,7 +207291,7 @@ function render$5m(_ctx, _cache, $props, $setup, $data, $options) {
207046
207291
  }
207047
207292
 
207048
207293
  script$5n.render = render$5m;
207049
- script$5n.__scopeId = "data-v-4d1a1839";
207294
+ script$5n.__scopeId = "data-v-f25f07ec";
207050
207295
  const __sfc_main$5h = script$5n;
207051
207296
 
207052
207297
  /**
@@ -223526,7 +223771,7 @@ function isRouterPath(url) {
223526
223771
  */
223527
223772
  function routerBase(router) {
223528
223773
  const base = router?.options?.history?.base;
223529
- return typeof base === 'string' ? base.replace(/\/+$/, '') : ''
223774
+ return typeof base === 'string' ? stripTrailingSlashes(base) : ''
223530
223775
  }
223531
223776
 
223532
223777
  /**
@@ -226860,7 +227105,7 @@ var script$4G = {
226860
227105
  * @return {string} the joined path.
226861
227106
  */
226862
227107
  joinPath(base, name) {
226863
- const trimmedBase = String(base || '/').replace(/\/+$/, '');
227108
+ const trimmedBase = stripTrailingSlashes(String(base || '/'));
226864
227109
  const trimmedName = String(name || '').replace(/^\/+/, '');
226865
227110
  if (trimmedBase === '' || trimmedBase === '/') {
226866
227111
  return '/' + trimmedName
@@ -227349,7 +227594,7 @@ function render$4F(_ctx, _cache, $props, $setup, $data, $options) {
227349
227594
  }
227350
227595
 
227351
227596
  script$4G.render = render$4F;
227352
- script$4G.__scopeId = "data-v-7f34dd98";
227597
+ script$4G.__scopeId = "data-v-1626aa43";
227353
227598
  const __sfc_main$4G = script$4G;
227354
227599
 
227355
227600
  /**
@@ -233531,46 +233776,48 @@ function render$4u(_ctx, _cache, $props, $setup, $data, $options) {
233531
233776
  : (vue$1.openBlock(), vue$1.createElementBlock(vue$1.Fragment, { key: 4 }, [
233532
233777
  ($options.rows.length === 0 && $props.content.quietLineWithHistory !== false)
233533
233778
  ? (vue$1.openBlock(), vue$1.createElementBlock("p", _hoisted_5$33, vue$1.toDisplayString($options.emptyLabel), 1 /* TEXT */))
233534
- : (vue$1.openBlock(), vue$1.createElementBlock("ul", _hoisted_6$2P, [
233535
- (vue$1.openBlock(true), vue$1.createElementBlock(vue$1.Fragment, null, vue$1.renderList($options.rows, (run, index) => {
233536
- return (vue$1.openBlock(), vue$1.createElementBlock("li", {
233537
- key: run.uuid || `row-${index}`,
233538
- class: vue$1.normalizeClass(["cn-flow-runs-widget__row", { 'cn-flow-runs-widget__row--linked': $options.isLinked }]),
233539
- "data-status": run.status
233540
- }, [
233541
- (vue$1.openBlock(), vue$1.createBlock(vue$1.resolveDynamicComponent($options.runHref(run) ? 'a' : 'div'), {
233542
- class: "cn-flow-runs-widget__row-content",
233543
- href: $options.runHref(run) || undefined,
233544
- onClick: $event => ($options.onRowClick($event, run))
233545
- }, {
233546
- default: vue$1.withCtx(() => [
233547
- (!$options.pills)
233548
- ? (vue$1.openBlock(), vue$1.createElementBlock("span", {
233549
- key: 0,
233550
- class: vue$1.normalizeClass(["cn-flow-runs-widget__dot", `cn-flow-runs-widget__dot--${run.status}`]),
233551
- title: $options.statusLabel(run.status)
233552
- }, null, 10 /* CLASS, PROPS */, _hoisted_8$2i))
233553
- : vue$1.createCommentVNode("v-if", true),
233554
- vue$1.createElementVNode("span", _hoisted_9$24, [
233555
- vue$1.createElementVNode("span", _hoisted_10$1T, vue$1.toDisplayString(run.flowName), 1 /* TEXT */),
233556
- vue$1.createElementVNode("span", _hoisted_11$1G, vue$1.toDisplayString($options.metaLine(run)), 1 /* TEXT */)
233779
+ : ($options.rows.length > 0)
233780
+ ? (vue$1.openBlock(), vue$1.createElementBlock("ul", _hoisted_6$2P, [
233781
+ (vue$1.openBlock(true), vue$1.createElementBlock(vue$1.Fragment, null, vue$1.renderList($options.rows, (run, index) => {
233782
+ return (vue$1.openBlock(), vue$1.createElementBlock("li", {
233783
+ key: run.uuid || `row-${index}`,
233784
+ class: vue$1.normalizeClass(["cn-flow-runs-widget__row", { 'cn-flow-runs-widget__row--linked': $options.isLinked }]),
233785
+ "data-status": run.status
233786
+ }, [
233787
+ (vue$1.openBlock(), vue$1.createBlock(vue$1.resolveDynamicComponent($options.runHref(run) ? 'a' : 'div'), {
233788
+ class: "cn-flow-runs-widget__row-content",
233789
+ href: $options.runHref(run) || undefined,
233790
+ onClick: $event => ($options.onRowClick($event, run))
233791
+ }, {
233792
+ default: vue$1.withCtx(() => [
233793
+ (!$options.pills)
233794
+ ? (vue$1.openBlock(), vue$1.createElementBlock("span", {
233795
+ key: 0,
233796
+ class: vue$1.normalizeClass(["cn-flow-runs-widget__dot", `cn-flow-runs-widget__dot--${run.status}`]),
233797
+ title: $options.statusLabel(run.status)
233798
+ }, null, 10 /* CLASS, PROPS */, _hoisted_8$2i))
233799
+ : vue$1.createCommentVNode("v-if", true),
233800
+ vue$1.createElementVNode("span", _hoisted_9$24, [
233801
+ vue$1.createElementVNode("span", _hoisted_10$1T, vue$1.toDisplayString(run.flowName), 1 /* TEXT */),
233802
+ vue$1.createElementVNode("span", _hoisted_11$1G, vue$1.toDisplayString($options.metaLine(run)), 1 /* TEXT */)
233803
+ ]),
233804
+ ($options.pills)
233805
+ ? (vue$1.openBlock(), vue$1.createBlock(_component_CnStatusBadge, {
233806
+ key: 1,
233807
+ class: "cn-flow-runs-widget__pill",
233808
+ label: $options.statusLabel(run.status),
233809
+ variant: $options.statusVariant(run.status),
233810
+ size: "small"
233811
+ }, null, 8 /* PROPS */, ["label", "variant"]))
233812
+ : vue$1.createCommentVNode("v-if", true),
233813
+ vue$1.createElementVNode("span", _hoisted_12$1u, vue$1.toDisplayString($options.ageLabel(run)), 1 /* TEXT */)
233557
233814
  ]),
233558
- ($options.pills)
233559
- ? (vue$1.openBlock(), vue$1.createBlock(_component_CnStatusBadge, {
233560
- key: 1,
233561
- class: "cn-flow-runs-widget__pill",
233562
- label: $options.statusLabel(run.status),
233563
- variant: $options.statusVariant(run.status),
233564
- size: "small"
233565
- }, null, 8 /* PROPS */, ["label", "variant"]))
233566
- : vue$1.createCommentVNode("v-if", true),
233567
- vue$1.createElementVNode("span", _hoisted_12$1u, vue$1.toDisplayString($options.ageLabel(run)), 1 /* TEXT */)
233568
- ]),
233569
- _: 2 /* DYNAMIC */
233570
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["href", "onClick"]))
233571
- ], 10 /* CLASS, PROPS */, _hoisted_7$2w))
233572
- }), 128 /* KEYED_FRAGMENT */))
233573
- ])),
233815
+ _: 2 /* DYNAMIC */
233816
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["href", "onClick"]))
233817
+ ], 10 /* CLASS, PROPS */, _hoisted_7$2w))
233818
+ }), 128 /* KEYED_FRAGMENT */))
233819
+ ]))
233820
+ : vue$1.createCommentVNode("v-if", true),
233574
233821
  ($options.hiddenCount > 0)
233575
233822
  ? (vue$1.openBlock(), vue$1.createElementBlock("p", _hoisted_13$1g, vue$1.toDisplayString($options.moreLabel), 1 /* TEXT */))
233576
233823
  : vue$1.createCommentVNode("v-if", true),
@@ -233631,7 +233878,7 @@ function render$4u(_ctx, _cache, $props, $setup, $data, $options) {
233631
233878
  }
233632
233879
 
233633
233880
  script$4v.render = render$4u;
233634
- script$4v.__scopeId = "data-v-e4bd0174";
233881
+ script$4v.__scopeId = "data-v-2cd6fe28";
233635
233882
  const __sfc_main$4v = script$4v;
233636
233883
 
233637
233884
  /**
@@ -242387,6 +242634,552 @@ function conditionalLine(candidates, row, translate = (text) => text, context =
242387
242634
  return ''
242388
242635
  }
242389
242636
 
242637
+ /**
242638
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
242639
+ * SPDX-License-Identifier: EUPL-1.2
242640
+ *
242641
+ * Who holds which right on one OpenRegister object, and where each grant came
242642
+ * from. The reads behind CnObjectPermissionsTab.
242643
+ *
242644
+ * Every function here is a read. Nothing decides who may open an object: the
242645
+ * grant, its provenance, the deny and the inheritance live in OpenRegister, and
242646
+ * these helpers hand on what it answered. A deny is never subtracted from a
242647
+ * grant, a missing answer is never filled with a default, and nothing is
242648
+ * cached: a copy of an access decision is a second decision nobody updates.
242649
+ *
242650
+ * The object's own permission set (`/permissions`) is preferred; an older
242651
+ * OpenRegister answers 404 to it, and then five reads are the fallback:
242652
+ *
242653
+ * GET {apiBase}/permissions the verb catalogue + deny mode
242654
+ * GET {apiBase}/objects/{register}/{schema}/{id}/shares grants written on the object
242655
+ * GET {apiBase}/permissions/compare-roles?register= each role and its verbs
242656
+ * GET {apiBase}/scopes?register=&schema= the caller's own verdict + provenance
242657
+ * GET {apiBase}/permissions/deny-preview?register=&schema= the deny rules as written
242658
+ *
242659
+ * plus the history read `{...}/{id}/permissions/history?at=` for "who held a
242660
+ * right on a date".
242661
+ *
242662
+ * A failed read answers `null`, never `[]`: "we could not ask" and "nobody
242663
+ * holds this" are opposite answers that would otherwise render as the same
242664
+ * empty table.
242665
+ */
242666
+
242667
+ /** The OpenRegister API root a target defaults to. */
242668
+ const DEFAULT_API_BASE = '/apps/openregister/api';
242669
+
242670
+ /**
242671
+ * Normalise a target to `{register, schema, apiBase}`.
242672
+ *
242673
+ * @param {object} target The object's register, schema and optional apiBase.
242674
+ * @return {{register: string, schema: string, apiBase: string}} The target.
242675
+ */
242676
+ function normalise$1(target = {}) {
242677
+ return {
242678
+ register: String(target.register || ''),
242679
+ schema: String(target.schema || ''),
242680
+ apiBase: String(target.apiBase || DEFAULT_API_BASE).replace(/\/$/, ''),
242681
+ }
242682
+ }
242683
+
242684
+ /**
242685
+ * GET one path, keeping the status beside the body.
242686
+ *
242687
+ * The status is part of the answer: a 403 on the access set means the reader
242688
+ * may open the object and may not enumerate who else can, which is not a
242689
+ * failed read. A transport failure has no status and reports 0. A non-JSON
242690
+ * body (the SPA shell answering 200) is a failed read, not "no rules".
242691
+ *
242692
+ * @param {string} url App-absolute URL.
242693
+ * @param {object} params Query parameters.
242694
+ * @return {Promise<{status: number, data: object|null}>} The status and the body.
242695
+ */
242696
+ async function readResult(url, params = {}) {
242697
+ try {
242698
+ const response = await axios$1.get(prefixUrl(url), { params });
242699
+ if (typeof response?.data !== 'object' || response.data === null) {
242700
+ return { status: response?.status || 0, data: null }
242701
+ }
242702
+ return { status: response.status || 200, data: response.data }
242703
+ } catch (error) {
242704
+ return { status: error?.response?.status || 0, data: null }
242705
+ }
242706
+ }
242707
+
242708
+ /**
242709
+ * GET one path, answering null when it cannot be read.
242710
+ *
242711
+ * @param {string} url App-absolute URL.
242712
+ * @param {object} params Query parameters.
242713
+ * @return {Promise<object|null>} The body, or null.
242714
+ */
242715
+ async function read(url, params = {}) {
242716
+ const { data } = await readResult(url, params);
242717
+ return data
242718
+ }
242719
+
242720
+ /**
242721
+ * The URL of one object, under its target.
242722
+ *
242723
+ * @param {object} target The target.
242724
+ * @param {string} objectId The object id.
242725
+ * @param {string} [schema] A schema other than the target's.
242726
+ * @return {string} The URL.
242727
+ */
242728
+ function objectUrl(target, objectId, schema) {
242729
+ const { register, apiBase } = normalise$1(target);
242730
+ return `${apiBase}/objects/${register}/${schema || normalise$1(target).schema}/${objectId}`
242731
+ }
242732
+
242733
+ /**
242734
+ * The grantable verbs and the deny enforcement mode.
242735
+ *
242736
+ * @param {object} target The target (only `apiBase` is read).
242737
+ * @return {Promise<object|null>} `{permissions, denyEnforcement}`, or null.
242738
+ */
242739
+ function fetchPermissionCatalogue(target) {
242740
+ return read(`${normalise$1(target).apiBase}/permissions`)
242741
+ }
242742
+
242743
+ /**
242744
+ * The grants written on one object.
242745
+ *
242746
+ * @param {object} target The target.
242747
+ * @param {string} objectId The object id.
242748
+ * @return {Promise<Array|null>} The grants, or null.
242749
+ */
242750
+ async function fetchObjectGrants(target, objectId) {
242751
+ const body = await read(`${objectUrl(target, objectId)}/shares`);
242752
+ if (body === null || !Array.isArray(body.results)) {
242753
+ return null
242754
+ }
242755
+ return body.results
242756
+ }
242757
+
242758
+ /**
242759
+ * Each role in the register and the verbs it holds.
242760
+ *
242761
+ * @param {object} target The target.
242762
+ * @return {Promise<object|null>} `{roles}`, or null.
242763
+ */
242764
+ function fetchRoleGrants(target) {
242765
+ const { apiBase, register } = normalise$1(target);
242766
+ return read(`${apiBase}/permissions/compare-roles`, { register })
242767
+ }
242768
+
242769
+ /**
242770
+ * The caller's own effective verbs on the schema, with their provenance.
242771
+ *
242772
+ * The endpoint answers a matrix even when narrowed, so the row is picked by
242773
+ * schema name rather than by position.
242774
+ *
242775
+ * @param {object} target The target.
242776
+ * @return {Promise<object|null>} The scope entry, or null.
242777
+ */
242778
+ async function fetchCallerScope(target) {
242779
+ const { apiBase, register, schema } = normalise$1(target);
242780
+ const body = await read(`${apiBase}/scopes`, { register, schema });
242781
+ if (body === null || !Array.isArray(body.scopes)) {
242782
+ return null
242783
+ }
242784
+ const scope = body.scopes.find((entry) => entry?.schema === schema);
242785
+ if (!scope) {
242786
+ return null
242787
+ }
242788
+ return { user: body.user, isAdmin: body.isAdmin, groups: body.groups, ...scope }
242789
+ }
242790
+
242791
+ /**
242792
+ * The deny rules as written for the register and schema.
242793
+ *
242794
+ * @param {object} target The target.
242795
+ * @return {Promise<object|null>} `{denyEnforcement, enforcing, rules}`, or null.
242796
+ */
242797
+ function fetchDenyRules(target) {
242798
+ const { apiBase, register, schema } = normalise$1(target);
242799
+ return read(`${apiBase}/permissions/deny-preview`, { register, schema })
242800
+ }
242801
+
242802
+ /**
242803
+ * The permission set OpenRegister publishes for this object, with its status.
242804
+ *
242805
+ * @param {object} target The target.
242806
+ * @param {string} objectId The object id.
242807
+ * @return {Promise<{status: number, set: object|null}>} The status and the set.
242808
+ */
242809
+ async function fetchObjectPermissions(target, objectId) {
242810
+ const { status, data } = await readResult(`${objectUrl(target, objectId)}/permissions`);
242811
+ if (data === null || Array.isArray(data.holders) === false) {
242812
+ return { status, set: null }
242813
+ }
242814
+ return { status, set: data }
242815
+ }
242816
+
242817
+ /**
242818
+ * The set as it stood at a moment, from the object's audit trail.
242819
+ *
242820
+ * @param {object} target The target.
242821
+ * @param {string} objectId The object id.
242822
+ * @param {string} at An ISO-8601 moment.
242823
+ * @return {Promise<{status: number, history: object|null}>} The status and the history.
242824
+ */
242825
+ async function fetchAccessHistory(target, objectId, at) {
242826
+ const { status, data } = await readResult(`${objectUrl(target, objectId)}/permissions/history`, { at });
242827
+ if (data === null || Array.isArray(data.changes) === false) {
242828
+ return { status, history: null }
242829
+ }
242830
+ return { status, history: data }
242831
+ }
242832
+
242833
+ /**
242834
+ * The end and the area written on one rule, as OpenRegister reported them.
242835
+ *
242836
+ * Neither is compared to anything: whether an expired grant still answers is
242837
+ * resolved in OpenRegister. A role grant carries the whole holder list, so the
242838
+ * entry naming this principal is picked out of it.
242839
+ *
242840
+ * @param {object|Array|string|null} rule The rule as written.
242841
+ * @param {string} principal The holder of the row.
242842
+ * @return {{until: string, scopedTo: object|null}} The end and the area.
242843
+ */
242844
+ function constraintsOf(rule, principal) {
242845
+ const none = { until: '', scopedTo: null };
242846
+ if (rule === null || typeof rule !== 'object') {
242847
+ return none
242848
+ }
242849
+
242850
+ let entry = rule;
242851
+ if (Array.isArray(rule)) {
242852
+ entry = rule.find((candidate) => candidate === principal
242853
+ || (candidate !== null
242854
+ && typeof candidate === 'object'
242855
+ && [candidate.principal, candidate.group, candidate.role, candidate.user].includes(principal)));
242856
+ }
242857
+
242858
+ if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) {
242859
+ return none
242860
+ }
242861
+
242862
+ return {
242863
+ until: typeof entry.until === 'string' ? entry.until : '',
242864
+ scopedTo: entry.scopedTo || null,
242865
+ }
242866
+ }
242867
+
242868
+ /**
242869
+ * One reported rule as a row.
242870
+ *
242871
+ * @param {object} rule The rule.
242872
+ * @param {boolean} refusing Whether the rule takes a right away.
242873
+ * @param {boolean} enforcing Whether refusals are in force.
242874
+ * @return {object} The row.
242875
+ */
242876
+ function ruleRow(rule, refusing, enforcing) {
242877
+ const principal = rule?.principal || '';
242878
+ const { until, scopedTo } = constraintsOf(rule?.rule ?? null, principal);
242879
+
242880
+ let source = rule?.level || 'object';
242881
+ if (refusing === true) {
242882
+ source = enforcing === true ? 'deny' : 'staged-deny';
242883
+ }
242884
+
242885
+ return {
242886
+ holder: principal,
242887
+ right: rule?.action || '',
242888
+ source,
242889
+ detail: rule?.role || '',
242890
+ inheritedFrom: rule?.inheritedFrom || '',
242891
+ level: rule?.level || '',
242892
+ role: rule?.role || '',
242893
+ declared: rule?.declared !== false,
242894
+ conditional: rule?.conditional === true,
242895
+ until,
242896
+ scopedTo,
242897
+ }
242898
+ }
242899
+
242900
+ /**
242901
+ * The object's own permission set as rows. A deny is its own row.
242902
+ *
242903
+ * @param {object|null} set The set from `fetchObjectPermissions`.
242904
+ * @return {Array<object>} The rows.
242905
+ */
242906
+ function objectPermissionRows(set) {
242907
+ if (set === null || typeof set !== 'object') {
242908
+ return []
242909
+ }
242910
+
242911
+ const enforcing = set.denyEnforcement === 'enforcing';
242912
+ const rows = [];
242913
+ for (const holder of set.holders || []) {
242914
+ for (const rule of holder?.rules || []) {
242915
+ rows.push(ruleRow(rule, false, enforcing));
242916
+ }
242917
+ }
242918
+ for (const rule of set.denied || []) {
242919
+ rows.push(ruleRow(rule, true, enforcing));
242920
+ }
242921
+ return rows
242922
+ }
242923
+
242924
+ /**
242925
+ * The set as it stood at the moment asked about.
242926
+ *
242927
+ * `asOf: null` (the trail does not reach back that far) is "unanswered", never
242928
+ * an empty table: an empty table would claim nobody held a right that day.
242929
+ *
242930
+ * @param {object|null} history The history from `fetchAccessHistory`.
242931
+ * @return {{answered: boolean, at: string, rows: Array<object>, setBy: string, changedAfterwardsBy: object|null}} The answer.
242932
+ */
242933
+ function asOfRows(history) {
242934
+ const unanswered = { answered: false, at: history?.at || '', rows: [], setBy: '', changedAfterwardsBy: null };
242935
+
242936
+ const asOf = history?.asOf || null;
242937
+ if (asOf === null || typeof asOf !== 'object') {
242938
+ return unanswered
242939
+ }
242940
+
242941
+ const rows = [];
242942
+ for (const holder of asOf.holders || []) {
242943
+ for (const rule of holder?.rules || []) {
242944
+ rows.push(ruleRow(rule, false, false));
242945
+ }
242946
+ }
242947
+
242948
+ return {
242949
+ answered: true,
242950
+ at: asOf.at || history?.at || '',
242951
+ rows,
242952
+ setBy: asOf.setBy || '',
242953
+ changedAfterwardsBy: asOf.changedAfterwardsBy || null,
242954
+ }
242955
+ }
242956
+
242957
+ /**
242958
+ * All answers as one list of rows. A renderer, not an evaluator: each row
242959
+ * restates ONE reported rule, and no row is the product of two.
242960
+ *
242961
+ * When the object answered for itself the share, role and deny reads are not
242962
+ * replayed on top (the same grant would be counted twice). The caller's own
242963
+ * verdict always rides along last, because it is the one answer about this
242964
+ * reader rather than a rule about everybody.
242965
+ *
242966
+ * @param {object} answers The reads.
242967
+ * @param {object|null} answers.objectPermissions The object's own set.
242968
+ * @param {Array|null} answers.objectGrants Grants on the object.
242969
+ * @param {object|null} answers.roleGrants Roles and their verbs.
242970
+ * @param {object|null} answers.callerScope The caller's own verdict.
242971
+ * @param {object|null} answers.denyRules The deny rules.
242972
+ * @return {Array<object>} The rows.
242973
+ */
242974
+ function grantRows({ objectPermissions = null, objectGrants, roleGrants, callerScope, denyRules }) {
242975
+ const rows = [];
242976
+
242977
+ if (objectPermissions !== null) {
242978
+ rows.push(...objectPermissionRows(objectPermissions));
242979
+ }
242980
+
242981
+ for (const grant of (objectPermissions === null ? objectGrants : null) || []) {
242982
+ for (const right of grant?.actions || []) {
242983
+ rows.push({
242984
+ holder: grant.principal || grant.userId || grant.groupId || '',
242985
+ right,
242986
+ // `inheritedFrom` is the id of the ancestor, not a source key.
242987
+ source: grant.source || (grant.inheritedFrom ? 'inherited' : 'share'),
242988
+ inheritedFrom: grant.inheritedFrom || '',
242989
+ detail: grant.expires ? String(grant.expires) : '',
242990
+ });
242991
+ }
242992
+ }
242993
+
242994
+ for (const role of (objectPermissions === null ? roleGrants?.roles : null) || []) {
242995
+ for (const right of role?.actions || []) {
242996
+ rows.push({ holder: role.role || '', right, source: 'role', detail: '' });
242997
+ }
242998
+ }
242999
+
243000
+ for (const rule of (objectPermissions === null ? denyRules?.rules : null) || []) {
243001
+ rows.push({
243002
+ holder: rule.principal || '',
243003
+ right: rule.action || '',
243004
+ source: denyRules.enforcing ? 'deny' : 'staged-deny',
243005
+ detail: rule.level ? `${rule.level}: ${rule.subject || ''}` : '',
243006
+ });
243007
+ }
243008
+
243009
+ for (const [right, record] of Object.entries(callerScope?.provenance || {})) {
243010
+ rows.push({
243011
+ holder: callerScope.user || '',
243012
+ right,
243013
+ source: record?.source || 'unknown',
243014
+ granted: record?.granted,
243015
+ detail: record?.role || record?.principal || '',
243016
+ stagedDeny: record?.stagedDeny || null,
243017
+ });
243018
+ }
243019
+
243020
+ return rows
243021
+ }
243022
+
243023
+ /**
243024
+ * The id a reference carries, as a uuid string or as an expanded object.
243025
+ *
243026
+ * @param {unknown} value The reference.
243027
+ * @return {string} The id, or ''.
243028
+ */
243029
+ function referenceId$1(value) {
243030
+ if (value && typeof value === 'object') {
243031
+ return String(value['@self']?.id ?? value.id ?? value.uuid ?? '')
243032
+ }
243033
+ return String(value ?? '')
243034
+ }
243035
+
243036
+ /**
243037
+ * The object's decided field rules, and the per-role field rules its TYPE
243038
+ * object declares.
243039
+ *
243040
+ * Two reads, because they answer different questions: `@self.fieldRules` is
243041
+ * what OpenRegister decided for THIS reader, the declaration on the type
243042
+ * object is the rule behind it. Neither is evaluated here.
243043
+ *
243044
+ * @param {object} target The target.
243045
+ * @param {string} objectId The object id.
243046
+ * @param {object} config Where the declaration lives.
243047
+ * @param {string} config.typeField Field on the object referencing its type object.
243048
+ * @param {string} config.typeSchema Schema of the type object (same register).
243049
+ * @param {string} [config.declarationField] Field on the type object holding the rules.
243050
+ * @return {Promise<{decided: object|null, declared: Array<object>|null}>} The answer.
243051
+ */
243052
+ async function fetchFieldRoleRules(target, objectId, config) {
243053
+ if (!objectId || !config?.typeField || !config?.typeSchema) {
243054
+ return { decided: null, declared: null }
243055
+ }
243056
+
243057
+ const object = await read(objectUrl(target, objectId));
243058
+ if (object === null) {
243059
+ return { decided: null, declared: null }
243060
+ }
243061
+
243062
+ const decided = object['@self']?.fieldRules ?? null;
243063
+ const typeId = referenceId$1(object[config.typeField]);
243064
+ if (!typeId) {
243065
+ return { decided, declared: null }
243066
+ }
243067
+
243068
+ const type = await read(objectUrl(target, typeId, config.typeSchema));
243069
+ if (type === null) {
243070
+ return { decided, declared: null }
243071
+ }
243072
+
243073
+ const declared = type[config.declarationField || 'fieldRoleRules'];
243074
+ return { decided, declared: Array.isArray(declared) ? declared : [] }
243075
+ }
243076
+
243077
+ /**
243078
+ * The two things a role rule can do to a field. The spelling is OpenRegister's
243079
+ * contract (`hidden`, `readOnly`); any other rule is dropped.
243080
+ */
243081
+ const ROLE_RULES = ['hidden', 'readOnly'];
243082
+
243083
+ /**
243084
+ * The reader's word for each field rule.
243085
+ *
243086
+ * @return {object} The labels, by rule id.
243087
+ */
243088
+ function roleRuleLabels() {
243089
+ return {
243090
+ hidden: l10n.translate('nextcloud-vue', 'Not shown'),
243091
+ readOnly: l10n.translate('nextcloud-vue', 'Cannot be changed'),
243092
+ }
243093
+ }
243094
+
243095
+ /**
243096
+ * A declared list of names, blanks and repeats removed.
243097
+ *
243098
+ * @param {unknown} value The list.
243099
+ * @return {Array<string>} The names.
243100
+ */
243101
+ function names(value) {
243102
+ if (Array.isArray(value) === false) {
243103
+ return []
243104
+ }
243105
+ const found = [];
243106
+ value.forEach((entry) => {
243107
+ const name = String(entry ?? '').trim();
243108
+ if (name !== '' && found.includes(name) === false) {
243109
+ found.push(name);
243110
+ }
243111
+ });
243112
+ return found
243113
+ }
243114
+
243115
+ /**
243116
+ * Whether OpenRegister applied this rule to the reader. False when the object
243117
+ * carries no decision at all (an older OpenRegister), never invented.
243118
+ *
243119
+ * @param {string} field The field.
243120
+ * @param {string} rule The rule.
243121
+ * @param {object|null} decided The object's `@self.fieldRules`.
243122
+ * @return {boolean} True when the reader met this rule.
243123
+ */
243124
+ function appliesToMe(field, rule, decided) {
243125
+ const applied = decided?.[rule];
243126
+ if (Array.isArray(applied) === false) {
243127
+ return false
243128
+ }
243129
+ return applied.map((name) => String(name)).includes(field)
243130
+ }
243131
+
243132
+ /**
243133
+ * The declared field rules as rows. A row naming no field, or an unknown rule,
243134
+ * is dropped rather than rendered blank.
243135
+ *
243136
+ * @param {Array<object>|null} declared The declaration.
243137
+ * @param {object|null} decided The object's `@self.fieldRules`.
243138
+ * @return {Array<object>} The rows.
243139
+ */
243140
+ function fieldRoleRows(declared, decided) {
243141
+ if (Array.isArray(declared) === false) {
243142
+ return []
243143
+ }
243144
+
243145
+ return declared
243146
+ .filter((rule) => rule && ROLE_RULES.includes(rule.rule) && typeof rule.field === 'string' && rule.field.trim() !== '')
243147
+ .map((rule) => {
243148
+ const field = rule.field.trim();
243149
+ return {
243150
+ field,
243151
+ rule: rule.rule,
243152
+ groups: names(rule.groups),
243153
+ heldBy: names(rule.heldBy),
243154
+ reason: String(rule.reason ?? '').trim(),
243155
+ appliesToMe: appliesToMe(field, rule.rule, decided),
243156
+ }
243157
+ })
243158
+ }
243159
+
243160
+ /**
243161
+ * One field-rule row as a whole sentence (whole sentences, so a translator can
243162
+ * reorder the groups).
243163
+ *
243164
+ * @param {object} row One row from `fieldRoleRows`.
243165
+ * @return {string} The sentence.
243166
+ */
243167
+ function roleRuleSentence(row) {
243168
+ const groups = row?.groups?.join(', ') ?? '';
243169
+ const heldBy = row?.heldBy?.join(', ') ?? '';
243170
+
243171
+ if (row?.rule === 'hidden' && heldBy !== '') {
243172
+ return l10n.translate('nextcloud-vue', '{groups} do not see this field. {heldBy} do.', { groups, heldBy })
243173
+ }
243174
+ if (row?.rule === 'hidden') {
243175
+ return l10n.translate('nextcloud-vue', '{groups} do not see this field.', { groups })
243176
+ }
243177
+ if (heldBy !== '') {
243178
+ return l10n.translate('nextcloud-vue', '{groups} cannot change this field. {heldBy} can.', { groups, heldBy })
243179
+ }
243180
+ return l10n.translate('nextcloud-vue', '{groups} cannot change this field.', { groups })
243181
+ }
243182
+
242390
243183
  /** Event-bus channel of the page-level Refresh, which an api-call or a saved form also sends. */
242391
243184
  const PAGE_REFRESH_CHANNEL$4 = 'cn:page:refresh';
242392
243185
 
@@ -242580,7 +243373,7 @@ var script$4h = {
242580
243373
  * The widget configuration.
242581
243374
  *
242582
243375
  * - `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? }`.
242583
- * `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`.
243376
+ * `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).
242584
243377
  * `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.
242585
243378
  * 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.
242586
243379
  * 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.
@@ -242597,7 +243390,7 @@ var script$4h = {
242597
243390
  * `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.
242598
243391
  * `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").
242599
243392
  * - `action` — an action drawn as a button under the facts; `headerAction` — one drawn in the card header (reported through the `header` event).
242600
- * - `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.
243393
+ * - `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.
242601
243394
  * - `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`.
242602
243395
  * - `rowsPath` — a path to a list of `{ label, value }` the record holds, drawn as rows after `fields` (a preview the server builds).
242603
243396
  * - `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.
@@ -242664,6 +243457,8 @@ var script$4h = {
242664
243457
  counts: {},
242665
243458
  /** The outcome of each `actions[]` condition that needs a request, by action id. */
242666
243459
  remoteVisibility: {},
243460
+ /** Whether OpenRegister lets the reader update the page's record; null while unknown (the server decides). */
243461
+ mayUpdate: null,
242667
243462
  /** Sequence of the source reads, so an older answer never replaces a newer one. */
242668
243463
  loadSeq: 0,
242669
243464
  }
@@ -242878,6 +243673,7 @@ var script$4h = {
242878
243673
  emptyActions() {
242879
243674
  const list = Array.isArray(this.content?.emptyActions) ? this.content.emptyActions : [];
242880
243675
  return list
243676
+ .filter((action) => this.rightAllows(action))
242881
243677
  .map((action) => ({ view: this.actionView(action), action }))
242882
243678
  .filter((entry) => entry.view)
242883
243679
  .map((entry) => ({ ...entry.view, action: entry.action }))
@@ -242910,7 +243706,7 @@ var script$4h = {
242910
243706
  const admin = this.viewerIsAdmin();
242911
243707
  const out = [];
242912
243708
  actions.forEach((action, index) => {
242913
- if (!action || typeof action !== 'object' || (action.adminOnly === true && !admin)) {
243709
+ if (!action || typeof action !== 'object' || (action.adminOnly === true && !admin) || !this.rightAllows(action)) {
242914
243710
  return
242915
243711
  }
242916
243712
  const id = this.actionId(action, index);
@@ -242925,7 +243721,7 @@ var script$4h = {
242925
243721
  if (unresolved) {
242926
243722
  return
242927
243723
  }
242928
- const { visibleWhen, adminOnly, ...drawn } = value;
243724
+ const { visibleWhen, adminOnly, requires, ...drawn } = value;
242929
243725
  out.push({ ...drawn, id });
242930
243726
  });
242931
243727
  return out
@@ -243009,6 +243805,9 @@ var script$4h = {
243009
243805
  if (kind === 'title' && field.route) {
243010
243806
  block.to = this.resolveRoute(field.route, record);
243011
243807
  }
243808
+ if (kind === 'title' && Number.isFinite(field.size) && field.size > 0) {
243809
+ block.size = field.size;
243810
+ }
243012
243811
  if (kind === 'pill') {
243013
243812
  const raw = readPath$9(record, field.path);
243014
243813
  const colours = field.variantMap || field.colorMap;
@@ -243234,6 +244033,7 @@ var script$4h = {
243234
244033
 
243235
244034
  mounted() {
243236
244035
  eventBus.subscribe(PAGE_REFRESH_CHANNEL$4, this.onPageRefresh);
244036
+ this.loadMayUpdate();
243237
244037
  },
243238
244038
 
243239
244039
  beforeUnmount() {
@@ -243241,6 +244041,40 @@ var script$4h = {
243241
244041
  },
243242
244042
 
243243
244043
  methods: {
244044
+ /**
244045
+ * Whether an action's `requires: "update"` holds: the reader may update
244046
+ * the page's record. Unknown counts as yes; the server decides.
244047
+ *
244048
+ * @param {object} action The declaration.
244049
+ * @return {boolean}
244050
+ * @spec openspec/changes/facts-title-size-and-update-right/specs/facts-widget/spec.md#requirement-a-facts-action-can-ask-for-the-update-right
244051
+ */
244052
+ rightAllows(action) {
244053
+ return !(action && action.requires === 'update' && this.mayUpdate === false)
244054
+ },
244055
+
244056
+ /**
244057
+ * Read the reader's rights on the page's register and schema, when an
244058
+ * action asks for the update right.
244059
+ *
244060
+ * @return {Promise<void>}
244061
+ * @spec openspec/changes/facts-title-size-and-update-right/specs/facts-widget/spec.md#requirement-a-facts-action-can-ask-for-the-update-right
244062
+ */
244063
+ async loadMayUpdate() {
244064
+ const all = [...(Array.isArray(this.content?.actions) ? this.content.actions : []), ...(Array.isArray(this.content?.emptyActions) ? this.content.emptyActions : [])];
244065
+ const { register, schema } = this.tokenCtx;
244066
+ if (!all.some((action) => action && action.requires === 'update') || !register || !schema) {
244067
+ return
244068
+ }
244069
+ const slug = (value) => (value && typeof value === 'object' ? String(value.slug || value.id || '') : String(value));
244070
+ try {
244071
+ const scope = await fetchCallerScope({ register: slug(register), schema: slug(schema) });
244072
+ this.mayUpdate = !scope || !Array.isArray(scope.actions) || scope.actions.includes('update');
244073
+ } catch {
244074
+ this.mayUpdate = null;
244075
+ }
244076
+ },
244077
+
243244
244078
  /**
243245
244079
  * A link's label and the muted note under it, their `{path}` and
243246
244080
  * `{path:format}` placeholders filled from the record ("{page:last-segment}").
@@ -243367,7 +244201,7 @@ var script$4h = {
243367
244201
  return LINK_SCHEMES.includes(parsed.protocol) ? parsed.href : ''
243368
244202
  }
243369
244203
  if (typeof link.hrefBase === 'string' && link.hrefBase !== '') {
243370
- const path = link.hrefBase.replace(/\/+$/, '') + '/' + value.replace(/^\/+/, '');
244204
+ const path = stripTrailingSlashes(link.hrefBase) + '/' + value.replace(/^\/+/, '');
243371
244205
  return router.generateUrl(path)
243372
244206
  }
243373
244207
  return value.startsWith('/') && !value.startsWith('//') ? value : ''
@@ -244691,13 +245525,14 @@ function render$4g(_ctx, _cache, $props, $setup, $data, $options) {
244691
245525
  key: 1,
244692
245526
  to: block.to || undefined,
244693
245527
  class: "cn-facts-widget__title",
245528
+ style: vue$1.normalizeStyle(block.size ? { fontSize: `${block.size}px` } : undefined),
244694
245529
  "data-testid": `cn-fact-${block.key}`
244695
245530
  }, {
244696
245531
  default: vue$1.withCtx(() => [
244697
245532
  vue$1.createTextVNode(vue$1.toDisplayString(block.value), 1 /* TEXT */)
244698
245533
  ]),
244699
245534
  _: 2 /* DYNAMIC */
244700
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to", "data-testid"]))
245535
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to", "style", "data-testid"]))
244701
245536
  : (block.kind === 'line')
244702
245537
  ? (vue$1.openBlock(), vue$1.createElementBlock("span", {
244703
245538
  key: 2,
@@ -244935,7 +245770,7 @@ function render$4g(_ctx, _cache, $props, $setup, $data, $options) {
244935
245770
  }
244936
245771
 
244937
245772
  script$4h.render = render$4g;
244938
- script$4h.__scopeId = "data-v-680ad283";
245773
+ script$4h.__scopeId = "data-v-4235ed18";
244939
245774
  const __sfc_main$4h = script$4h;
244940
245775
 
244941
245776
  /**
@@ -259607,7 +260442,7 @@ var script$3Y = {
259607
260442
  this.aggregateValues = {};
259608
260443
  return
259609
260444
  }
259610
- const next = {};
260445
+ const next = new Map();
259611
260446
  const jobs = [];
259612
260447
  for (const raw of this.rows.slice(0, this.limit)) {
259613
260448
  const row = scalarRow(raw);
@@ -259615,18 +260450,18 @@ var script$3Y = {
259615
260450
  if (!rowId) {
259616
260451
  continue
259617
260452
  }
259618
- next[rowId] = {};
260453
+ const figures = cellsOf(next, rowId);
259619
260454
  for (const [key, agg] of entries) {
259620
260455
  jobs.push(fetchRowAggregate(agg, row)
259621
260456
  .then((value) => {
259622
- next[rowId][key] = this.aggregateText(agg, value);
260457
+ figures[key] = this.aggregateText(agg, value);
259623
260458
  })
259624
260459
  .catch(() => {}));
259625
260460
  }
259626
260461
  }
259627
260462
  await Promise.all(jobs);
259628
260463
  if (id === this.aggregateRequestId) {
259629
- this.aggregateValues = next;
260464
+ this.aggregateValues = Object.fromEntries(next);
259630
260465
  }
259631
260466
  },
259632
260467
 
@@ -261532,7 +262367,7 @@ function render$3X(_ctx, _cache, $props, $setup, $data, $options) {
261532
262367
  }
261533
262368
 
261534
262369
  script$3Y.render = render$3X;
261535
- script$3Y.__scopeId = "data-v-4ab5c4c5";
262370
+ script$3Y.__scopeId = "data-v-b35728f0";
261536
262371
  const __sfc_main$3Y = script$3Y;
261537
262372
 
261538
262373
  /**
@@ -280123,7 +280958,7 @@ var script$3I = {
280123
280958
  * @return {void}
280124
280959
  */
280125
280960
  addChild(node) {
280126
- const base = String(node.ref.route || '').replace(/\/+$/, '');
280961
+ const base = stripTrailingSlashes(String(node.ref.route || ''));
280127
280962
  const ref = { id: this.nextId(), parent: node.ref.id, type: 'detail', route: `${base}/:id`, title: '', config: {} };
280128
280963
  node.children.push({ ref, children: [] });
280129
280964
  this.flatten();
@@ -280214,7 +281049,7 @@ function render$3H(_ctx, _cache, $props, $setup, $data, $options) {
280214
281049
  }
280215
281050
 
280216
281051
  script$3I.render = render$3H;
280217
- script$3I.__scopeId = "data-v-056d4fd4";
281052
+ script$3I.__scopeId = "data-v-559b1c1a";
280218
281053
  const __sfc_main$3I = script$3I;
280219
281054
 
280220
281055
  var script$3H = {
@@ -325212,7 +326047,7 @@ function text(parent, local) {
325212
326047
  * @return {string} The normalised path.
325213
326048
  */
325214
326049
  function normalizePath(path) {
325215
- const trimmed = (path || '/').replace(/\/+$/, '');
326050
+ const trimmed = stripTrailingSlashes(path || '/');
325216
326051
  return trimmed.startsWith('/') ? trimmed : '/' + trimmed
325217
326052
  }
325218
326053
 
@@ -337987,7 +338822,10 @@ var script$2M = {
337987
338822
  * filter? }`), or a field read from an app endpoint (`{ endpoint,
337988
338823
  * path, followFilters? }`; `followFilters: true` sends the active
337989
338824
  * filters along as `filter[<field>]=<value>`). A value not read (yet) leaves its token empty (board PqLeads
337990
- * "€ 509.928 in de pijplijn").
338825
+ * "€ 509.928 in de pijplijn"). `unfiltered: true` reads an aggregation
338826
+ * under the page's own `filter` only, so the footer note can name the
338827
+ * whole list ("73 aanmeldingen in totaal"); the footer note fills the
338828
+ * same tokens.
337991
338829
  *
337992
338830
  * @spec openspec/changes/index-count-values/specs/index-page/spec.md#requirement-the-count-line-can-name-sums-and-values
337993
338831
  * @type {Record<string, object>|null}
@@ -344091,6 +344929,7 @@ var script$2M = {
344091
344929
  const footerNote = scoped !== undefined ? scoped : footerNoteForView(this.footerNoteByView, this.currentViewMode, this.footerNote);
344092
344930
  if (footerNote) {
344093
344931
  return this.fillConfigTokens(this.cnTranslate(footerNote))
344932
+ .replace(/\{(\w+)\|[^}]*\}|\{(\w+)\}/g, (token, a, b) => this.countValueToken(token, a || b))
344094
344933
  }
344095
344934
  const source = this.isNamedSource ? this.namedSource : null;
344096
344935
  return (source && source.footerNote) || footerNote
@@ -345929,9 +346768,12 @@ var script$2M = {
345929
346768
  }
345930
346769
  const params = (this.$route && this.$route.params) || {};
345931
346770
  const ctx = typeof this.selfFetchTokenCtx === 'function' ? this.selfFetchTokenCtx() : {};
345932
- const base = { ...resolveFilterMap(this.filter, params, ctx), ...(this.effectiveActiveFilters || {}) };
346771
+ const pageFilter = resolveFilterMap(this.filter, params, ctx);
346772
+ const filtered = { ...pageFilter, ...(this.effectiveActiveFilters || {}) };
345933
346773
  const results = {};
345934
346774
  await Promise.all(entries.map(async ([name, cfg]) => {
346775
+ // `unfiltered`: the whole list under the page's own filter, not the user's.
346776
+ const base = cfg && cfg.unfiltered === true ? pageFilter : filtered;
345935
346777
  try {
345936
346778
  let value;
345937
346779
  if (cfg && typeof cfg.endpoint === 'string' && cfg.endpoint !== '') {
@@ -349107,7 +349949,7 @@ var script$2M = {
349107
349949
  return !!this.$route && tab.to.name !== undefined && this.$route.name === tab.to.name
349108
349950
  }
349109
349951
  const path = this.$route && this.$route.path;
349110
- return !!path && String(path).replace(/\/+$/, '') === String(tab.to).replace(/\/+$/, '')
349952
+ return !!path && stripTrailingSlashes(String(path)) === stripTrailingSlashes(String(tab.to))
349111
349953
  },
349112
349954
 
349113
349955
  /**
@@ -359014,552 +359856,6 @@ function savedUuid(saved) {
359014
359856
  return String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')
359015
359857
  }
359016
359858
 
359017
- /**
359018
- * SPDX-FileCopyrightText: 2026 Conduction B.V.
359019
- * SPDX-License-Identifier: EUPL-1.2
359020
- *
359021
- * Who holds which right on one OpenRegister object, and where each grant came
359022
- * from. The reads behind CnObjectPermissionsTab.
359023
- *
359024
- * Every function here is a read. Nothing decides who may open an object: the
359025
- * grant, its provenance, the deny and the inheritance live in OpenRegister, and
359026
- * these helpers hand on what it answered. A deny is never subtracted from a
359027
- * grant, a missing answer is never filled with a default, and nothing is
359028
- * cached: a copy of an access decision is a second decision nobody updates.
359029
- *
359030
- * The object's own permission set (`/permissions`) is preferred; an older
359031
- * OpenRegister answers 404 to it, and then five reads are the fallback:
359032
- *
359033
- * GET {apiBase}/permissions the verb catalogue + deny mode
359034
- * GET {apiBase}/objects/{register}/{schema}/{id}/shares grants written on the object
359035
- * GET {apiBase}/permissions/compare-roles?register= each role and its verbs
359036
- * GET {apiBase}/scopes?register=&schema= the caller's own verdict + provenance
359037
- * GET {apiBase}/permissions/deny-preview?register=&schema= the deny rules as written
359038
- *
359039
- * plus the history read `{...}/{id}/permissions/history?at=` for "who held a
359040
- * right on a date".
359041
- *
359042
- * A failed read answers `null`, never `[]`: "we could not ask" and "nobody
359043
- * holds this" are opposite answers that would otherwise render as the same
359044
- * empty table.
359045
- */
359046
-
359047
- /** The OpenRegister API root a target defaults to. */
359048
- const DEFAULT_API_BASE = '/apps/openregister/api';
359049
-
359050
- /**
359051
- * Normalise a target to `{register, schema, apiBase}`.
359052
- *
359053
- * @param {object} target The object's register, schema and optional apiBase.
359054
- * @return {{register: string, schema: string, apiBase: string}} The target.
359055
- */
359056
- function normalise$1(target = {}) {
359057
- return {
359058
- register: String(target.register || ''),
359059
- schema: String(target.schema || ''),
359060
- apiBase: String(target.apiBase || DEFAULT_API_BASE).replace(/\/$/, ''),
359061
- }
359062
- }
359063
-
359064
- /**
359065
- * GET one path, keeping the status beside the body.
359066
- *
359067
- * The status is part of the answer: a 403 on the access set means the reader
359068
- * may open the object and may not enumerate who else can, which is not a
359069
- * failed read. A transport failure has no status and reports 0. A non-JSON
359070
- * body (the SPA shell answering 200) is a failed read, not "no rules".
359071
- *
359072
- * @param {string} url App-absolute URL.
359073
- * @param {object} params Query parameters.
359074
- * @return {Promise<{status: number, data: object|null}>} The status and the body.
359075
- */
359076
- async function readResult(url, params = {}) {
359077
- try {
359078
- const response = await axios$1.get(prefixUrl(url), { params });
359079
- if (typeof response?.data !== 'object' || response.data === null) {
359080
- return { status: response?.status || 0, data: null }
359081
- }
359082
- return { status: response.status || 200, data: response.data }
359083
- } catch (error) {
359084
- return { status: error?.response?.status || 0, data: null }
359085
- }
359086
- }
359087
-
359088
- /**
359089
- * GET one path, answering null when it cannot be read.
359090
- *
359091
- * @param {string} url App-absolute URL.
359092
- * @param {object} params Query parameters.
359093
- * @return {Promise<object|null>} The body, or null.
359094
- */
359095
- async function read(url, params = {}) {
359096
- const { data } = await readResult(url, params);
359097
- return data
359098
- }
359099
-
359100
- /**
359101
- * The URL of one object, under its target.
359102
- *
359103
- * @param {object} target The target.
359104
- * @param {string} objectId The object id.
359105
- * @param {string} [schema] A schema other than the target's.
359106
- * @return {string} The URL.
359107
- */
359108
- function objectUrl(target, objectId, schema) {
359109
- const { register, apiBase } = normalise$1(target);
359110
- return `${apiBase}/objects/${register}/${schema || normalise$1(target).schema}/${objectId}`
359111
- }
359112
-
359113
- /**
359114
- * The grantable verbs and the deny enforcement mode.
359115
- *
359116
- * @param {object} target The target (only `apiBase` is read).
359117
- * @return {Promise<object|null>} `{permissions, denyEnforcement}`, or null.
359118
- */
359119
- function fetchPermissionCatalogue(target) {
359120
- return read(`${normalise$1(target).apiBase}/permissions`)
359121
- }
359122
-
359123
- /**
359124
- * The grants written on one object.
359125
- *
359126
- * @param {object} target The target.
359127
- * @param {string} objectId The object id.
359128
- * @return {Promise<Array|null>} The grants, or null.
359129
- */
359130
- async function fetchObjectGrants(target, objectId) {
359131
- const body = await read(`${objectUrl(target, objectId)}/shares`);
359132
- if (body === null || !Array.isArray(body.results)) {
359133
- return null
359134
- }
359135
- return body.results
359136
- }
359137
-
359138
- /**
359139
- * Each role in the register and the verbs it holds.
359140
- *
359141
- * @param {object} target The target.
359142
- * @return {Promise<object|null>} `{roles}`, or null.
359143
- */
359144
- function fetchRoleGrants(target) {
359145
- const { apiBase, register } = normalise$1(target);
359146
- return read(`${apiBase}/permissions/compare-roles`, { register })
359147
- }
359148
-
359149
- /**
359150
- * The caller's own effective verbs on the schema, with their provenance.
359151
- *
359152
- * The endpoint answers a matrix even when narrowed, so the row is picked by
359153
- * schema name rather than by position.
359154
- *
359155
- * @param {object} target The target.
359156
- * @return {Promise<object|null>} The scope entry, or null.
359157
- */
359158
- async function fetchCallerScope(target) {
359159
- const { apiBase, register, schema } = normalise$1(target);
359160
- const body = await read(`${apiBase}/scopes`, { register, schema });
359161
- if (body === null || !Array.isArray(body.scopes)) {
359162
- return null
359163
- }
359164
- const scope = body.scopes.find((entry) => entry?.schema === schema);
359165
- if (!scope) {
359166
- return null
359167
- }
359168
- return { user: body.user, isAdmin: body.isAdmin, groups: body.groups, ...scope }
359169
- }
359170
-
359171
- /**
359172
- * The deny rules as written for the register and schema.
359173
- *
359174
- * @param {object} target The target.
359175
- * @return {Promise<object|null>} `{denyEnforcement, enforcing, rules}`, or null.
359176
- */
359177
- function fetchDenyRules(target) {
359178
- const { apiBase, register, schema } = normalise$1(target);
359179
- return read(`${apiBase}/permissions/deny-preview`, { register, schema })
359180
- }
359181
-
359182
- /**
359183
- * The permission set OpenRegister publishes for this object, with its status.
359184
- *
359185
- * @param {object} target The target.
359186
- * @param {string} objectId The object id.
359187
- * @return {Promise<{status: number, set: object|null}>} The status and the set.
359188
- */
359189
- async function fetchObjectPermissions(target, objectId) {
359190
- const { status, data } = await readResult(`${objectUrl(target, objectId)}/permissions`);
359191
- if (data === null || Array.isArray(data.holders) === false) {
359192
- return { status, set: null }
359193
- }
359194
- return { status, set: data }
359195
- }
359196
-
359197
- /**
359198
- * The set as it stood at a moment, from the object's audit trail.
359199
- *
359200
- * @param {object} target The target.
359201
- * @param {string} objectId The object id.
359202
- * @param {string} at An ISO-8601 moment.
359203
- * @return {Promise<{status: number, history: object|null}>} The status and the history.
359204
- */
359205
- async function fetchAccessHistory(target, objectId, at) {
359206
- const { status, data } = await readResult(`${objectUrl(target, objectId)}/permissions/history`, { at });
359207
- if (data === null || Array.isArray(data.changes) === false) {
359208
- return { status, history: null }
359209
- }
359210
- return { status, history: data }
359211
- }
359212
-
359213
- /**
359214
- * The end and the area written on one rule, as OpenRegister reported them.
359215
- *
359216
- * Neither is compared to anything: whether an expired grant still answers is
359217
- * resolved in OpenRegister. A role grant carries the whole holder list, so the
359218
- * entry naming this principal is picked out of it.
359219
- *
359220
- * @param {object|Array|string|null} rule The rule as written.
359221
- * @param {string} principal The holder of the row.
359222
- * @return {{until: string, scopedTo: object|null}} The end and the area.
359223
- */
359224
- function constraintsOf(rule, principal) {
359225
- const none = { until: '', scopedTo: null };
359226
- if (rule === null || typeof rule !== 'object') {
359227
- return none
359228
- }
359229
-
359230
- let entry = rule;
359231
- if (Array.isArray(rule)) {
359232
- entry = rule.find((candidate) => candidate === principal
359233
- || (candidate !== null
359234
- && typeof candidate === 'object'
359235
- && [candidate.principal, candidate.group, candidate.role, candidate.user].includes(principal)));
359236
- }
359237
-
359238
- if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) {
359239
- return none
359240
- }
359241
-
359242
- return {
359243
- until: typeof entry.until === 'string' ? entry.until : '',
359244
- scopedTo: entry.scopedTo || null,
359245
- }
359246
- }
359247
-
359248
- /**
359249
- * One reported rule as a row.
359250
- *
359251
- * @param {object} rule The rule.
359252
- * @param {boolean} refusing Whether the rule takes a right away.
359253
- * @param {boolean} enforcing Whether refusals are in force.
359254
- * @return {object} The row.
359255
- */
359256
- function ruleRow(rule, refusing, enforcing) {
359257
- const principal = rule?.principal || '';
359258
- const { until, scopedTo } = constraintsOf(rule?.rule ?? null, principal);
359259
-
359260
- let source = rule?.level || 'object';
359261
- if (refusing === true) {
359262
- source = enforcing === true ? 'deny' : 'staged-deny';
359263
- }
359264
-
359265
- return {
359266
- holder: principal,
359267
- right: rule?.action || '',
359268
- source,
359269
- detail: rule?.role || '',
359270
- inheritedFrom: rule?.inheritedFrom || '',
359271
- level: rule?.level || '',
359272
- role: rule?.role || '',
359273
- declared: rule?.declared !== false,
359274
- conditional: rule?.conditional === true,
359275
- until,
359276
- scopedTo,
359277
- }
359278
- }
359279
-
359280
- /**
359281
- * The object's own permission set as rows. A deny is its own row.
359282
- *
359283
- * @param {object|null} set The set from `fetchObjectPermissions`.
359284
- * @return {Array<object>} The rows.
359285
- */
359286
- function objectPermissionRows(set) {
359287
- if (set === null || typeof set !== 'object') {
359288
- return []
359289
- }
359290
-
359291
- const enforcing = set.denyEnforcement === 'enforcing';
359292
- const rows = [];
359293
- for (const holder of set.holders || []) {
359294
- for (const rule of holder?.rules || []) {
359295
- rows.push(ruleRow(rule, false, enforcing));
359296
- }
359297
- }
359298
- for (const rule of set.denied || []) {
359299
- rows.push(ruleRow(rule, true, enforcing));
359300
- }
359301
- return rows
359302
- }
359303
-
359304
- /**
359305
- * The set as it stood at the moment asked about.
359306
- *
359307
- * `asOf: null` (the trail does not reach back that far) is "unanswered", never
359308
- * an empty table: an empty table would claim nobody held a right that day.
359309
- *
359310
- * @param {object|null} history The history from `fetchAccessHistory`.
359311
- * @return {{answered: boolean, at: string, rows: Array<object>, setBy: string, changedAfterwardsBy: object|null}} The answer.
359312
- */
359313
- function asOfRows(history) {
359314
- const unanswered = { answered: false, at: history?.at || '', rows: [], setBy: '', changedAfterwardsBy: null };
359315
-
359316
- const asOf = history?.asOf || null;
359317
- if (asOf === null || typeof asOf !== 'object') {
359318
- return unanswered
359319
- }
359320
-
359321
- const rows = [];
359322
- for (const holder of asOf.holders || []) {
359323
- for (const rule of holder?.rules || []) {
359324
- rows.push(ruleRow(rule, false, false));
359325
- }
359326
- }
359327
-
359328
- return {
359329
- answered: true,
359330
- at: asOf.at || history?.at || '',
359331
- rows,
359332
- setBy: asOf.setBy || '',
359333
- changedAfterwardsBy: asOf.changedAfterwardsBy || null,
359334
- }
359335
- }
359336
-
359337
- /**
359338
- * All answers as one list of rows. A renderer, not an evaluator: each row
359339
- * restates ONE reported rule, and no row is the product of two.
359340
- *
359341
- * When the object answered for itself the share, role and deny reads are not
359342
- * replayed on top (the same grant would be counted twice). The caller's own
359343
- * verdict always rides along last, because it is the one answer about this
359344
- * reader rather than a rule about everybody.
359345
- *
359346
- * @param {object} answers The reads.
359347
- * @param {object|null} answers.objectPermissions The object's own set.
359348
- * @param {Array|null} answers.objectGrants Grants on the object.
359349
- * @param {object|null} answers.roleGrants Roles and their verbs.
359350
- * @param {object|null} answers.callerScope The caller's own verdict.
359351
- * @param {object|null} answers.denyRules The deny rules.
359352
- * @return {Array<object>} The rows.
359353
- */
359354
- function grantRows({ objectPermissions = null, objectGrants, roleGrants, callerScope, denyRules }) {
359355
- const rows = [];
359356
-
359357
- if (objectPermissions !== null) {
359358
- rows.push(...objectPermissionRows(objectPermissions));
359359
- }
359360
-
359361
- for (const grant of (objectPermissions === null ? objectGrants : null) || []) {
359362
- for (const right of grant?.actions || []) {
359363
- rows.push({
359364
- holder: grant.principal || grant.userId || grant.groupId || '',
359365
- right,
359366
- // `inheritedFrom` is the id of the ancestor, not a source key.
359367
- source: grant.source || (grant.inheritedFrom ? 'inherited' : 'share'),
359368
- inheritedFrom: grant.inheritedFrom || '',
359369
- detail: grant.expires ? String(grant.expires) : '',
359370
- });
359371
- }
359372
- }
359373
-
359374
- for (const role of (objectPermissions === null ? roleGrants?.roles : null) || []) {
359375
- for (const right of role?.actions || []) {
359376
- rows.push({ holder: role.role || '', right, source: 'role', detail: '' });
359377
- }
359378
- }
359379
-
359380
- for (const rule of (objectPermissions === null ? denyRules?.rules : null) || []) {
359381
- rows.push({
359382
- holder: rule.principal || '',
359383
- right: rule.action || '',
359384
- source: denyRules.enforcing ? 'deny' : 'staged-deny',
359385
- detail: rule.level ? `${rule.level}: ${rule.subject || ''}` : '',
359386
- });
359387
- }
359388
-
359389
- for (const [right, record] of Object.entries(callerScope?.provenance || {})) {
359390
- rows.push({
359391
- holder: callerScope.user || '',
359392
- right,
359393
- source: record?.source || 'unknown',
359394
- granted: record?.granted,
359395
- detail: record?.role || record?.principal || '',
359396
- stagedDeny: record?.stagedDeny || null,
359397
- });
359398
- }
359399
-
359400
- return rows
359401
- }
359402
-
359403
- /**
359404
- * The id a reference carries, as a uuid string or as an expanded object.
359405
- *
359406
- * @param {unknown} value The reference.
359407
- * @return {string} The id, or ''.
359408
- */
359409
- function referenceId$1(value) {
359410
- if (value && typeof value === 'object') {
359411
- return String(value['@self']?.id ?? value.id ?? value.uuid ?? '')
359412
- }
359413
- return String(value ?? '')
359414
- }
359415
-
359416
- /**
359417
- * The object's decided field rules, and the per-role field rules its TYPE
359418
- * object declares.
359419
- *
359420
- * Two reads, because they answer different questions: `@self.fieldRules` is
359421
- * what OpenRegister decided for THIS reader, the declaration on the type
359422
- * object is the rule behind it. Neither is evaluated here.
359423
- *
359424
- * @param {object} target The target.
359425
- * @param {string} objectId The object id.
359426
- * @param {object} config Where the declaration lives.
359427
- * @param {string} config.typeField Field on the object referencing its type object.
359428
- * @param {string} config.typeSchema Schema of the type object (same register).
359429
- * @param {string} [config.declarationField] Field on the type object holding the rules.
359430
- * @return {Promise<{decided: object|null, declared: Array<object>|null}>} The answer.
359431
- */
359432
- async function fetchFieldRoleRules(target, objectId, config) {
359433
- if (!objectId || !config?.typeField || !config?.typeSchema) {
359434
- return { decided: null, declared: null }
359435
- }
359436
-
359437
- const object = await read(objectUrl(target, objectId));
359438
- if (object === null) {
359439
- return { decided: null, declared: null }
359440
- }
359441
-
359442
- const decided = object['@self']?.fieldRules ?? null;
359443
- const typeId = referenceId$1(object[config.typeField]);
359444
- if (!typeId) {
359445
- return { decided, declared: null }
359446
- }
359447
-
359448
- const type = await read(objectUrl(target, typeId, config.typeSchema));
359449
- if (type === null) {
359450
- return { decided, declared: null }
359451
- }
359452
-
359453
- const declared = type[config.declarationField || 'fieldRoleRules'];
359454
- return { decided, declared: Array.isArray(declared) ? declared : [] }
359455
- }
359456
-
359457
- /**
359458
- * The two things a role rule can do to a field. The spelling is OpenRegister's
359459
- * contract (`hidden`, `readOnly`); any other rule is dropped.
359460
- */
359461
- const ROLE_RULES = ['hidden', 'readOnly'];
359462
-
359463
- /**
359464
- * The reader's word for each field rule.
359465
- *
359466
- * @return {object} The labels, by rule id.
359467
- */
359468
- function roleRuleLabels() {
359469
- return {
359470
- hidden: l10n.translate('nextcloud-vue', 'Not shown'),
359471
- readOnly: l10n.translate('nextcloud-vue', 'Cannot be changed'),
359472
- }
359473
- }
359474
-
359475
- /**
359476
- * A declared list of names, blanks and repeats removed.
359477
- *
359478
- * @param {unknown} value The list.
359479
- * @return {Array<string>} The names.
359480
- */
359481
- function names(value) {
359482
- if (Array.isArray(value) === false) {
359483
- return []
359484
- }
359485
- const found = [];
359486
- value.forEach((entry) => {
359487
- const name = String(entry ?? '').trim();
359488
- if (name !== '' && found.includes(name) === false) {
359489
- found.push(name);
359490
- }
359491
- });
359492
- return found
359493
- }
359494
-
359495
- /**
359496
- * Whether OpenRegister applied this rule to the reader. False when the object
359497
- * carries no decision at all (an older OpenRegister), never invented.
359498
- *
359499
- * @param {string} field The field.
359500
- * @param {string} rule The rule.
359501
- * @param {object|null} decided The object's `@self.fieldRules`.
359502
- * @return {boolean} True when the reader met this rule.
359503
- */
359504
- function appliesToMe(field, rule, decided) {
359505
- const applied = decided?.[rule];
359506
- if (Array.isArray(applied) === false) {
359507
- return false
359508
- }
359509
- return applied.map((name) => String(name)).includes(field)
359510
- }
359511
-
359512
- /**
359513
- * The declared field rules as rows. A row naming no field, or an unknown rule,
359514
- * is dropped rather than rendered blank.
359515
- *
359516
- * @param {Array<object>|null} declared The declaration.
359517
- * @param {object|null} decided The object's `@self.fieldRules`.
359518
- * @return {Array<object>} The rows.
359519
- */
359520
- function fieldRoleRows(declared, decided) {
359521
- if (Array.isArray(declared) === false) {
359522
- return []
359523
- }
359524
-
359525
- return declared
359526
- .filter((rule) => rule && ROLE_RULES.includes(rule.rule) && typeof rule.field === 'string' && rule.field.trim() !== '')
359527
- .map((rule) => {
359528
- const field = rule.field.trim();
359529
- return {
359530
- field,
359531
- rule: rule.rule,
359532
- groups: names(rule.groups),
359533
- heldBy: names(rule.heldBy),
359534
- reason: String(rule.reason ?? '').trim(),
359535
- appliesToMe: appliesToMe(field, rule.rule, decided),
359536
- }
359537
- })
359538
- }
359539
-
359540
- /**
359541
- * One field-rule row as a whole sentence (whole sentences, so a translator can
359542
- * reorder the groups).
359543
- *
359544
- * @param {object} row One row from `fieldRoleRows`.
359545
- * @return {string} The sentence.
359546
- */
359547
- function roleRuleSentence(row) {
359548
- const groups = row?.groups?.join(', ') ?? '';
359549
- const heldBy = row?.heldBy?.join(', ') ?? '';
359550
-
359551
- if (row?.rule === 'hidden' && heldBy !== '') {
359552
- return l10n.translate('nextcloud-vue', '{groups} do not see this field. {heldBy} do.', { groups, heldBy })
359553
- }
359554
- if (row?.rule === 'hidden') {
359555
- return l10n.translate('nextcloud-vue', '{groups} do not see this field.', { groups })
359556
- }
359557
- if (heldBy !== '') {
359558
- return l10n.translate('nextcloud-vue', '{groups} cannot change this field. {heldBy} can.', { groups, heldBy })
359559
- }
359560
- return l10n.translate('nextcloud-vue', '{groups} cannot change this field.', { groups })
359561
- }
359562
-
359563
359859
  let uid = 0;
359564
359860
 
359565
359861
  /**
@@ -359603,13 +359899,15 @@ function defaultLabels$1() {
359603
359899
  *
359604
359900
  * `manage` lets a reader change the parties through OpenRegister's party
359605
359901
  * API, which asks the record's update right on every write: `add` (`{ label?,
359606
- * dialogTitle?, kind?, sources, create?, primary?, confirmLabel? }`) opens a
359902
+ * dialogTitle?, kind?, sources, create?, primary?, confirmLabel?, placement? }`) opens a
359607
359903
  * dialog to pick somebody known or describe somebody new (`create: {
359608
359904
  * register, schema, label?, fields, compose? }`, see `newPartyRecord`), choose
359609
359905
  * a role and optionally make them the primary party; `remove` (`{ title?,
359610
359906
  * message?, confirmLabel? }`, `{name}` and `{role}` in the message) takes a
359611
359907
  * party off in one role. Both are hidden when OpenRegister says the reader
359612
- * may not update the schema; a refusal is shown, never swallowed.
359908
+ * may not update the schema; a refusal is shown, never swallowed. With
359909
+ * `add.placement: "title"` the add button is reported to the card's title
359910
+ * row (the `header` event) instead of drawn above the parties.
359613
359911
  *
359614
359912
  * `presentation: "primary"` draws only the primary party, as a side card
359615
359913
  * does: initials, name and role label, its correspondence e-mail, and
@@ -359671,6 +359969,8 @@ var script$2t = {
359671
359969
  },
359672
359970
  },
359673
359971
 
359972
+ emits: ['header'],
359973
+
359674
359974
  data() {
359675
359975
  uid += 1;
359676
359976
  return {
@@ -359712,6 +360012,27 @@ var script$2t = {
359712
360012
  return Boolean(this.manage.add) && this.mayUpdate && !this.isPrimaryPresentation && !this.loading && !this.failed
359713
360013
  },
359714
360014
 
360015
+ /** @return {boolean} Whether the add button goes to the card's title row. */
360016
+ addInTitle() {
360017
+ return this.manage.add?.placement === 'title'
360018
+ },
360019
+
360020
+ /**
360021
+ * The title-row actions: the add button when it is placed there.
360022
+ *
360023
+ * @spec openspec/changes/parties-add-in-title-row/specs/record-widgets/spec.md#requirement-a-parties-card-can-put-its-add-button-in-the-title-row
360024
+ * @return {Array<object>} The actions.
360025
+ */
360026
+ titleActions() {
360027
+ if (!(this.addInTitle && this.canAdd)) {
360028
+ return []
360029
+ }
360030
+ const run = () => {
360031
+ this.adding = true;
360032
+ };
360033
+ return [{ key: 'add', label: this.manageWord('add', 'label', l10n.translate('nextcloud-vue', 'Add a party')), icon: 'Plus', variant: 'secondary', run }]
360034
+ },
360035
+
359715
360036
  /** @return {boolean} Whether each party offers its remove button. */
359716
360037
  canRemove() {
359717
360038
  return Boolean(this.manage.remove) && this.mayUpdate && !this.isPrimaryPresentation
@@ -359850,6 +360171,18 @@ var script$2t = {
359850
360171
  },
359851
360172
 
359852
360173
  watch: {
360174
+ titleActions: {
360175
+ immediate: true,
360176
+ handler(actions) {
360177
+ if (this.addInTitle) {
360178
+ /**
360179
+ * @event header The card's title-row actions, `{ actions }`, for the host to draw.
360180
+ */
360181
+ this.$emit('header', { actions });
360182
+ }
360183
+ },
360184
+ },
360185
+
359853
360186
  recordKey: {
359854
360187
  immediate: true,
359855
360188
  handler() {
@@ -360422,7 +360755,7 @@ function render$2s(_ctx, _cache, $props, $setup, $data, $options) {
360422
360755
  class: vue$1.normalizeClass(["cn-object-parties", { 'cn-object-parties--board': $options.isBoard }]),
360423
360756
  "data-testid": "cn-object-parties"
360424
360757
  }, [
360425
- ($options.canAdd)
360758
+ ($options.canAdd && !$options.addInTitle)
360426
360759
  ? (vue$1.openBlock(), vue$1.createElementBlock("div", _hoisted_1$2u, [
360427
360760
  vue$1.createVNode(_component_NcButton, {
360428
360761
  "data-testid": "cn-object-parties-add",
@@ -360709,7 +361042,7 @@ function render$2s(_ctx, _cache, $props, $setup, $data, $options) {
360709
361042
  }
360710
361043
 
360711
361044
  script$2t.render = render$2s;
360712
- script$2t.__scopeId = "data-v-24a3d77a";
361045
+ script$2t.__scopeId = "data-v-57dcd9b1";
360713
361046
  const __sfc_main$2t = script$2t;
360714
361047
 
360715
361048
  /**
@@ -407459,7 +407792,8 @@ var script$1w = {
407459
407792
  if (reported && Number.isFinite(reported.count)) {
407460
407793
  return title.replace(/\{count\}/g, String(reported.count))
407461
407794
  }
407462
- return title.replace(/\s*\{count\}/g, '').trim()
407795
+ const parts = title.split('{count}');
407796
+ return parts.map((part, i) => (i < parts.length - 1 ? part.trimEnd() : part)).join('').trim()
407463
407797
  },
407464
407798
 
407465
407799
  /**
@@ -409411,7 +409745,7 @@ function render$1v(_ctx, _cache, $props, $setup, $data, $options) {
409411
409745
  }
409412
409746
 
409413
409747
  script$1w.render = render$1v;
409414
- script$1w.__scopeId = "data-v-3cf7e9cf";
409748
+ script$1w.__scopeId = "data-v-6e71986b";
409415
409749
  const __sfc_main$1w = script$1w;
409416
409750
 
409417
409751
  var CnDashboardPage = /*#__PURE__*/Object.freeze({
@@ -415031,7 +415365,7 @@ var script$1k = {
415031
415365
  */
415032
415366
  baseUrl() {
415033
415367
  if (this.endpoint) {
415034
- return this.endpoint.replace(/\/+$/, '')
415368
+ return stripTrailingSlashes(this.endpoint)
415035
415369
  }
415036
415370
  const roots = (typeof window !== 'undefined' && window.OC && window.OC.appswebroots) || {};
415037
415371
  const app = this.appCandidates.find((id) => Object.hasOwn(roots, id)) || this.appCandidates[0] || 'integriq';
@@ -415201,7 +415535,7 @@ function render$1j(_ctx, _cache, $props, $setup, $data, $options) {
415201
415535
  }
415202
415536
 
415203
415537
  script$1k.render = render$1j;
415204
- script$1k.__scopeId = "data-v-5c8ae3f1";
415538
+ script$1k.__scopeId = "data-v-9015bbf0";
415205
415539
  const __sfc_main$1k = script$1k;
415206
415540
 
415207
415541
  /**
@@ -438524,7 +438858,7 @@ function pageHasSplitView(page) {
438524
438858
  * @spec openspec/changes/case-page-and-list-as-a-place/specs/index-page/spec.md
438525
438859
  */
438526
438860
  function splitRoutePath(route) {
438527
- const base = typeof route === 'string' ? route.replace(/\/+$/, '') : '';
438861
+ const base = typeof route === 'string' ? stripTrailingSlashes(route) : '';
438528
438862
  const param = routeParamNames(base).includes('id') ? 'splitId' : 'id';
438529
438863
  return `${base}/split/:${param}`
438530
438864
  }