@antelopejs/dms 0.21.4-next.998.gc2b0d73 → 0.22.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 (90) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/README.md +2 -2
  3. package/dist/e2e/mongo.d.mts +5 -5
  4. package/dist/e2e/processes.d.mts +18 -4
  5. package/dist/implementations/dms/page/preview-models.d.ts +0 -2
  6. package/dist/implementations/dms-base/phone-number.d.ts +1 -0
  7. package/dist/implementations/dms-base/phone-number.js +17 -0
  8. package/dist/implementations/dms-base/phone-number.js.map +1 -0
  9. package/dist/implementations/dms-notifications/index.d.ts +5 -1
  10. package/dist/implementations/dms-notifications/index.js +39 -11
  11. package/dist/implementations/dms-notifications/index.js.map +1 -1
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/mcp/page-verify/accounts.d.ts +2 -2
  15. package/dist/mcp/page-verify/accounts.js +21 -13
  16. package/dist/mcp/page-verify/accounts.js.map +1 -1
  17. package/dist/pages/settings/users/invite-resend.d.ts +4 -0
  18. package/dist/pages/settings/users/invite-resend.js +27 -19
  19. package/dist/pages/settings/users/invite-resend.js.map +1 -1
  20. package/dist/pages/settings/users/invites.d.ts +2 -4
  21. package/dist/pages/settings/users/invites.js +4 -17
  22. package/dist/pages/settings/users/invites.js.map +1 -1
  23. package/dist/pages/settings/users/notifications.d.ts +4 -1
  24. package/dist/pages/settings/users/notifications.js +12 -4
  25. package/dist/pages/settings/users/notifications.js.map +1 -1
  26. package/dist/store/internal/frontend/dev-reload.d.ts +7 -4
  27. package/dist/store/internal/frontend/dev-reload.js +16 -17
  28. package/dist/store/internal/frontend/dev-reload.js.map +1 -1
  29. package/dist/utils/notification-email.d.ts +13 -0
  30. package/dist/utils/notification-email.js +37 -0
  31. package/dist/utils/notification-email.js.map +1 -0
  32. package/dist/utils/notification-registry/index.d.ts +1 -0
  33. package/dist/utils/notification-registry/index.js +1 -0
  34. package/dist/utils/notification-registry/index.js.map +1 -1
  35. package/e2e/database.mjs +9 -3
  36. package/e2e/mongo.mjs +5 -5
  37. package/e2e/processes.mjs +32 -9
  38. package/e2e/run-state.mjs +40 -2
  39. package/frontend-vue/eslint-globals.generated.mjs +17 -17
  40. package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +20 -14
  41. package/frontend-vue/layers/dms-core/app/types/page.ts +1 -0
  42. package/frontend-vue/layers/dms-core/app/types/row-action.ts +2 -0
  43. package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +1 -0
  44. package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +1 -0
  45. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +30 -29
  46. package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +4 -8
  47. package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +10 -2
  48. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +8 -2
  49. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +32 -1
  50. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +11 -1
  51. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +13 -0
  52. package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationCatalog.ts +16 -0
  53. package/frontend-vue/layers/dms-layout/app/build/composables/notification/useNotificationPreferences.ts +38 -3
  54. package/frontend-vue/layers/dms-layout/app/components/layout/DashboardSearch.vue +10 -0
  55. package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +4 -1
  56. package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +4 -1
  57. package/frontend-vue/layers/dms-ui/app/build/components/button/DisabledReason.vue +27 -0
  58. package/frontend-vue/layers/dms-ui/app/build/components/containers/TargetComponentTree.vue +2 -0
  59. package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +1 -0
  60. package/frontend-vue/layers/dms-ui/app/build/components/stat/StatCell.vue +2 -11
  61. package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +17 -17
  62. package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +1 -0
  63. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +1 -1
  64. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +5 -1
  65. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +19 -9
  66. package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +1 -1
  67. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +12 -3
  68. package/frontend-vue/layers/dms-ui/app/build/composables/global/shortcuts.ts +14 -0
  69. package/frontend-vue/layers/dms-ui/app/build/composables/page/pageUrlValues.ts +1 -1
  70. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +47 -31
  71. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionRendering.ts +19 -3
  72. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -1
  73. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnTypes.ts +2 -0
  74. package/frontend-vue/layers/dms-ui/app/build/types/tree.ts +8 -3
  75. package/frontend-vue/layers/dms-ui/app/build/utils/phoneNumber.ts +143 -0
  76. package/frontend-vue/layers/dms-ui/app/components/form/components/DatePicker.vue +1 -0
  77. package/frontend-vue/layers/dms-ui/app/components/form/components/InputCalendar.vue +1 -0
  78. package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +165 -13
  79. package/frontend-vue/layers/dms-ui/app/components/form/components/InputRelation.vue +3 -2
  80. package/frontend-vue/layers/dms-ui/app/components/form/components/InputRepeater.vue +32 -1
  81. package/frontend-vue/layers/dms-ui/app/components/kpi/KpiCard.vue +1 -6
  82. package/frontend-vue/layers/dms-ui/app/entries/components/button/DisabledReason.ts +1 -0
  83. package/frontend-vue/layers/dms-ui/app/entries/components/stat/StatCell.ts +2 -0
  84. package/frontend-vue/layers/dms-ui/app/entries/composables/global/shortcuts.ts +1 -0
  85. package/frontend-vue/layers/dms-ui/app/entries/utils/phoneNumber.ts +1 -0
  86. package/frontend-vue/layers/dms-ui/app/types/row-action.ts +2 -0
  87. package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +10 -1
  88. package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +10 -1
  89. package/frontend-vue/package.json +1 -0
  90. package/package.json +6 -5
package/e2e/processes.mjs CHANGED
@@ -93,31 +93,54 @@ function ephemeralRange() {
93
93
  return { low, high };
94
94
  }
95
95
 
96
+ /**
97
+ * @typedef {number & { readonly restartable: true }} RestartablePort A loopback port outside the kernel's ephemeral range, or any port where /proc does not tell the range. A function that takes one refuses a port from {@link freePort}, which a restart can fail to listen on again.
98
+ */
99
+
100
+ /**
101
+ * @param {number} port A loopback port
102
+ * @returns {port is RestartablePort} Whether it lies outside the kernel's ephemeral range, or the range is unknown
103
+ */
104
+ export function isRestartablePort(port) {
105
+ const range = ephemeralRange();
106
+ return range === null || port < range.low || port > range.high;
107
+ }
108
+
96
109
  /**
97
110
  * A free loopback port outside the kernel's ephemeral range, for a server
98
111
  * that must listen on the same port again after it restarts. No outgoing
99
112
  * connection takes such a port as its source port, so none can hold it in
100
113
  * TIME_WAIT and make that listen fail with `EADDRINUSE`, as a port from
101
- * {@link freePort} can be held. Where /proc does not tell the range, or no
102
- * unprivileged port outside it is free, it is a port from {@link freePort}.
114
+ * {@link freePort} can be held.
103
115
  *
104
- * @returns {Promise<number>} The port
116
+ * @returns {Promise<RestartablePort>} The port
117
+ * @throws When no unprivileged port outside the range is free
105
118
  */
106
119
  export async function restartablePort() {
107
120
  const range = ephemeralRange();
108
- if (range === null) return freePort();
109
- const below = Math.max(range.low - FIRST_UNPRIVILEGED_PORT, 0);
110
- const above = Math.max(LAST_PORT - range.high, 0);
111
- if (below + above === 0) return freePort();
121
+ const below =
122
+ range === null ? 0 : Math.max(range.low - FIRST_UNPRIVILEGED_PORT, 0);
123
+ const above = range === null ? 0 : Math.max(LAST_PORT - range.high, 0);
124
+ if (range === null || below + above === 0) return restartableFree();
112
125
  for (let attempt = 0; attempt < RESTARTABLE_PORT_ATTEMPTS; attempt += 1) {
113
126
  const index = randomInt(below + above);
114
127
  const port =
115
128
  index < below
116
129
  ? FIRST_UNPRIVILEGED_PORT + index
117
130
  : range.high + 1 + index - below;
118
- if (await canListen(port)) return port;
131
+ if (isRestartablePort(port) && (await canListen(port))) return port;
119
132
  }
120
- return freePort();
133
+ throw new Error("no loopback port outside the ephemeral range is free");
134
+ }
135
+
136
+ /**
137
+ * @returns {Promise<RestartablePort>} A port from {@link freePort}, where /proc does not tell the range
138
+ * @throws When the range is known and the port lies in it
139
+ */
140
+ async function restartableFree() {
141
+ const port = await freePort();
142
+ if (isRestartablePort(port)) return port;
143
+ throw new Error("no loopback port outside the ephemeral range is free");
121
144
  }
122
145
 
123
146
  /**
package/e2e/run-state.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  rmSync,
9
9
  writeFileSync,
10
10
  } from "node:fs";
11
- import { tmpdir } from "node:os";
11
+ import { platform, tmpdir } from "node:os";
12
12
  import { join, resolve } from "node:path";
13
13
  import { describeFailure } from "./failure.mjs";
14
14
  import { assertSameNamespaces } from "./identity.mjs";
@@ -26,6 +26,9 @@ import {
26
26
  } from "./json.mjs";
27
27
 
28
28
  const RUN_FILE = "run.json";
29
+ const REPLACE_RETRY_MS = 2_000;
30
+ const REPLACE_POLL_MS = 5;
31
+ const REPLACE_PAUSE = new Int32Array(new SharedArrayBuffer(4));
29
32
  const ID_BYTES = 3;
30
33
  const TIMESTAMP_LENGTH = 15;
31
34
 
@@ -275,7 +278,42 @@ export function saveRun(state) {
275
278
  writeFileSync(`${file}.next`, `${JSON.stringify(state, null, 2)}\n`, {
276
279
  mode: 0o600,
277
280
  });
278
- renameSync(`${file}.next`, file);
281
+ replaceFile(`${file}.next`, file);
282
+ }
283
+
284
+ /**
285
+ * Renames `from` over `to`. Windows refuses with EPERM to replace a file
286
+ * another process holds open, as a service loading the run does for a
287
+ * moment, so there the rename is tried again until that read is done.
288
+ *
289
+ * @param {string} from The new file
290
+ * @param {string} to The file it replaces
291
+ * @throws When the rename fails for another reason, or Windows still refuses it after {@link REPLACE_RETRY_MS}
292
+ */
293
+ function replaceFile(from, to) {
294
+ const deadline = Date.now() + REPLACE_RETRY_MS;
295
+ for (;;) {
296
+ try {
297
+ renameSync(from, to);
298
+ return;
299
+ } catch (error) {
300
+ if (!isHeldOpen(error) || Date.now() >= deadline) throw error;
301
+ Atomics.wait(REPLACE_PAUSE, 0, 0, REPLACE_POLL_MS);
302
+ }
303
+ }
304
+ }
305
+
306
+ /**
307
+ * @param {unknown} error
308
+ * @returns {boolean}
309
+ */
310
+ function isHeldOpen(error) {
311
+ return (
312
+ platform() === "win32" &&
313
+ error instanceof Error &&
314
+ "code" in error &&
315
+ error.code === "EPERM"
316
+ );
279
317
  }
280
318
 
281
319
  /**
@@ -172,20 +172,20 @@ describeFieldErrors detectDatetimeBuckets detectKeyboardPlatform
172
172
  dispatchQuickActionTarget distributionMap downloadFile ensureApexLocale
173
173
  evaluateRowActionRule extractRouteParams fieldErrorId
174
174
  fieldValuesOfSubmitDefaults fillRouteParams findCascaderNode
175
- findNavigableCategory firstAccessiblePagePath flattenCascaderTree
176
- focusFirstFormError foldBreadcrumb formIssueMessage formShowsActions
177
- formatCascaderPath formatDate formatDateTime formatDeltaPercent formatDuration
178
- formatKeyboardShortcut formatNumber formatPercentage formatPlainAxisValue
179
- formatPrice formatRelativeDistance formatRelativeTime formatTime formatValue
180
- formatValueParts getAppComposedText getAppTranslation getPluginI18n
181
- heatmapRangeColors hideSearchTextMatches holdPageHeaderActions
182
- injectPageHeaderActionsHost interpolateRowText interpolateUrl
183
- isAcceptanceField isAccountMenuRoute isActionEnabled isActionVisible isBigint
184
- isBlankValue isBoolean isCalendarPreset isCascaderNodeSelectable
185
- isClearedFieldValue isComposedText isConfirmFrom isDarkSurface isDate
186
- isDefinitiveMetadataFailure isEligibleKanbanColumn isFavoritePathValid
187
- isFieldGroup isFieldMarkedRequired isFocusInsideOverlay isFoldedCrumbs
188
- isFromAccountsList isFunction isJSON isKeyword isKnownTimeZone
175
+ findNavigableCategory findPageRoute firstAccessiblePagePath
176
+ flattenCascaderTree focusFirstFormError foldBreadcrumb formIssueMessage
177
+ formShowsActions formatCascaderPath formatDate formatDateTime
178
+ formatDeltaPercent formatDuration formatKeyboardShortcut formatNumber
179
+ formatPercentage formatPlainAxisValue formatPrice formatRelativeDistance
180
+ formatRelativeTime formatTime formatValue formatValueParts getAppComposedText
181
+ getAppTranslation getPluginI18n heatmapRangeColors hideSearchTextMatches
182
+ holdPageHeaderActions injectPageHeaderActionsHost interpolateRowText
183
+ interpolateUrl isAcceptanceField isAccountMenuRoute isActionEnabled
184
+ isActionVisible isBigint isBlankValue isBoolean isCalendarPreset
185
+ isCascaderNodeSelectable isClearedFieldValue isComposedText isConfirmFrom
186
+ isDarkSurface isDate isDefinitiveMetadataFailure isEligibleKanbanColumn
187
+ isFavoritePathValid isFieldGroup isFieldMarkedRequired isFocusInsideOverlay
188
+ isFoldedCrumbs isFromAccountsList isFunction isJSON isKeyword isKnownTimeZone
189
189
  isLayoutBannerInScope isMenuItemActive isModuleAreaPath isNull isNumber
190
190
  isObject isReducedMotionActive isRelativePreset isRichTextBlank
191
191
  isSamePageQuery isSameRouteParams isSegmentChart isSidebarWidgetVisible
@@ -219,9 +219,9 @@ resolveRowClickAction resolveSidePanelWidthBounds resolveSidebarWidgetPosition
219
219
  resolveSparklineAccent resolveSubmitDefaults resolveSubmitTarget
220
220
  resolvesPeriodsAsBrowser ringFitsSliceLabels rowCustomActions
221
221
  runCustomValidation runDeduped scrollToBlock searchCascaderTree
222
- setOnboardingComplete setReaderTimeZoneSource setRegionalPreferencesSource
223
- settledRenderedBellCounts shouldExpandMenuItem siblingComponentId
224
- snapshotFormState stripQueryAndHash tableSearchShortcuts
222
+ servedQuickActions setOnboardingComplete setReaderTimeZoneSource
223
+ setRegionalPreferencesSource settledRenderedBellCounts shouldExpandMenuItem
224
+ siblingComponentId snapshotFormState stripQueryAndHash tableSearchShortcuts
225
225
  thinnedCategoryFormatter toBucketSeries toDonutRecords translateMenuItem
226
226
  translateMenuItems unregisterCommandPaletteAssistant
227
227
  unregisterCommandPaletteSource unregisterFooterLink unregisterSidePanel
@@ -393,6 +393,25 @@ function patternPageRoute(
393
393
  return null;
394
394
  }
395
395
 
396
+ /**
397
+ * The page of the site layout a path matches, with its route parameters, or
398
+ * `null` before the layout loads. It reads the layout state only, so a click
399
+ * handler may call it outside a component's setup.
400
+ */
401
+ export function findPageRoute(path: string): MatchRouteResult<PageInfo> | null {
402
+ const layout = useSiteLayoutState().siteLayout.value;
403
+ return layout ? matchPageRoute(path, layout) : null;
404
+ }
405
+
406
+ /**
407
+ * The quick actions the site layout serves the user, or `undefined` before it
408
+ * loads. It reads the layout state only, so a click handler may call it
409
+ * outside a component's setup.
410
+ */
411
+ export function servedQuickActions(): QuickActionsPayload | undefined {
412
+ return useSiteLayoutState().quickActions.value;
413
+ }
414
+
396
415
  export const useSiteLayout = () => {
397
416
  const {
398
417
  state,
@@ -454,19 +473,6 @@ export const useSiteLayout = () => {
454
473
  }
455
474
  };
456
475
 
457
- const findMatchingRoute = (
458
- path: string,
459
- ): {
460
- pattern: string;
461
- metadata: PageInfo;
462
- params: Record<string, string>;
463
- } | null => {
464
- const layout = siteLayout.value;
465
- if (!layout) return null;
466
-
467
- return matchPageRoute(path, layout);
468
- };
469
-
470
476
  const findMatchingRouteOrCategory = (
471
477
  path: string,
472
478
  ): {
@@ -512,7 +518,7 @@ export const useSiteLayout = () => {
512
518
  refresh,
513
519
  resync,
514
520
  refreshIfStale,
515
- findMatchingRoute,
521
+ findMatchingRoute: findPageRoute,
516
522
  findMatchingRouteOrCategory,
517
523
  probeAndCommitRoute,
518
524
  };
@@ -30,6 +30,7 @@ export interface MenuOptions {
30
30
  variant?: MenuItemVariant;
31
31
  status?: MenuItemStatus;
32
32
  badge?: string;
33
+ placement?: "footer";
33
34
  bypassTenantAccessGate?: boolean;
34
35
  /** The page's Direct / Pause valve (see `PageLiveOptions`). */
35
36
  live?: PageLiveOptions;
@@ -70,6 +70,8 @@ export interface RowActionConfig<
70
70
  isEnabled?: boolean;
71
71
  isVisible?: boolean;
72
72
  rule?: RowActionRule<T>;
73
+ /** Shown on a row `rule` keeps the action off, which then stays disabled (`$`: i18n key). */
74
+ disabledReason?: string;
73
75
  /** Label in place of the built-in one (`$`: i18n key). */
74
76
  label?: string;
75
77
  /** Icon in place of the built-in one. */
@@ -411,6 +411,7 @@
411
411
  "required": "This field is required.",
412
412
  "invalid": "This value isn’t valid.",
413
413
  "invalid_email": "Enter a valid email address.",
414
+ "invalid_phone": "Enter a valid phone number, with its country.",
414
415
  "too_long": "This value is too long.",
415
416
  "too_short": "This value is too short.",
416
417
  "too_small": "This value is too small.",
@@ -411,6 +411,7 @@
411
411
  "required": "Ce champ est obligatoire.",
412
412
  "invalid": "Cette valeur n’est pas valide.",
413
413
  "invalid_email": "Saisissez une adresse e-mail valide.",
414
+ "invalid_phone": "Saisissez un numéro de téléphone valide, avec son pays.",
414
415
  "too_long": "Cette valeur est trop longue.",
415
416
  "too_short": "Cette valeur est trop courte.",
416
417
  "too_small": "Cette valeur est trop petite.",
@@ -204,41 +204,37 @@ const favoriteItems = computed((): NavigationMenuItem[][] => {
204
204
  ];
205
205
  });
206
206
 
207
- const items = computed((): NavigationMenuItem[][] => {
208
- if (isInModule.value) {
209
- if (!moduleRootNode.value) {
210
- return [];
211
- }
212
- const moduleMenuItems = convertSiteLayoutTreeToTreeItemsForModule(
213
- moduleRootNode.value,
214
- );
215
- const translatedItems = translateMenuItems(moduleMenuItems, processI18n);
216
- return applyMenuRouteState(
217
- translatedItems,
218
- currentFullId.value,
219
- currentRoute.value,
220
- );
221
- }
222
-
223
- if (!siteLayout.siteLayoutTree.value) {
224
- return [];
225
- }
226
-
227
- const menuItems = convertSiteLayoutTreeToTreeItems(
228
- siteLayout.siteLayoutTree.value,
229
- );
230
- const translatedItems = translateMenuItems(menuItems, processI18n);
207
+ function withRouteState(menuItems: NavigationMenuItem[][]) {
231
208
  return applyMenuRouteState(
232
- translatedItems,
209
+ translateMenuItems(menuItems, processI18n),
233
210
  currentFullId.value,
234
211
  currentRoute.value,
235
212
  );
236
- });
213
+ }
214
+
215
+ const items = computed((): NavigationMenuItem[][] =>
216
+ withRouteState(
217
+ isInModule.value
218
+ ? convertSiteLayoutTreeToTreeItemsForModule(moduleRootNode.value)
219
+ : convertSiteLayoutTreeToTreeItems(siteLayout.siteLayoutTree.value),
220
+ ),
221
+ );
222
+
223
+ const pinnedItems = computed((): NavigationMenuItem[][] =>
224
+ isMockup.value
225
+ ? []
226
+ : withRouteState(
227
+ convertSiteLayoutTreeToTreeItems(
228
+ siteLayout.siteLayoutTree.value,
229
+ "footer",
230
+ ),
231
+ ),
232
+ );
237
233
 
238
234
  const openCategories = ref<string[]>([]);
239
235
 
240
236
  watch(
241
- () => items.value,
237
+ () => [...items.value, ...pinnedItems.value],
242
238
  (menuItems) => {
243
239
  const requiredIds = collectOpenItemIds(menuItems);
244
240
  const current = new Set(openCategories.value);
@@ -292,6 +288,10 @@ const footerItems = computed((): NavigationMenuItem[] => {
292
288
 
293
289
  return result;
294
290
  });
291
+
292
+ const footerGroups = computed((): NavigationMenuItem[][] =>
293
+ [...pinnedItems.value, footerItems.value].filter((group) => group.length > 0),
294
+ );
295
295
  </script>
296
296
 
297
297
  <template>
@@ -442,10 +442,11 @@ const footerItems = computed((): NavigationMenuItem[] => {
442
442
 
443
443
  <template #footer="{ collapsed: sidebarRail }">
444
444
  <DmsNavigationMenu
445
- v-if="footerItems.length > 0"
445
+ v-if="footerGroups.length > 0"
446
+ v-model="openCategories"
446
447
  v-bind="chromeAttrs"
447
448
  :collapsed="isRail(sidebarRail)"
448
- :items="footerItems"
449
+ :items="footerGroups"
449
450
  orientation="vertical"
450
451
  class="w-full"
451
452
  />
@@ -15,6 +15,7 @@ import { PREVIEW_LOCK_ICON } from "#dms-ui/app/entries/utils/permissionPreview";
15
15
  import { runMountedQuickAction } from "#dms-ui/app/entries/utils/quickActionTargets";
16
16
  import { useActionTargets } from "#dms-ui/app/entries/composables/actions/useActionTargets";
17
17
  import { refreshPageBlocks } from "#dms-ui/app/utils/blockRefresh";
18
+ import DmsDisabledReason from "#dms-ui/app/entries/components/button/DisabledReason";
18
19
  import {
19
20
  hasUrlVariables,
20
21
  resolveLinkVariables,
@@ -291,16 +292,11 @@ const entries = computed<HeaderBarEntry[]>(() => {
291
292
  <template>
292
293
  <template v-for="{ key, action } in entries" :key="key">
293
294
  <slot v-if="!action" />
294
- <!-- A disabled button fires no pointer event: the tooltip hangs on a
295
- focusable wrapper, so the reason also reaches keyboard users. -->
296
295
  <UTooltip v-else-if="action.previewLocked" :text="action.previewLocked">
297
296
  <UButton v-bind="action.button" />
298
297
  </UTooltip>
299
- <UTooltip v-else-if="action.disabledReason" :text="action.disabledReason">
300
- <span tabindex="0" class="inline-flex">
301
- <UButton v-bind="action.button" />
302
- </span>
303
- </UTooltip>
304
- <UButton v-else v-bind="action.button" />
298
+ <DmsDisabledReason v-else :reason="action.disabledReason">
299
+ <UButton v-bind="action.button" />
300
+ </DmsDisabledReason>
305
301
  </template>
306
302
  </template>
@@ -8,7 +8,10 @@ import {
8
8
  settledRenderedBellCounts,
9
9
  type UserNotification,
10
10
  } from "../../../composables/notification/useNotifications";
11
- import { resolveNotificationTone } from "../pages/settings/notification/notificationDisplay";
11
+ import {
12
+ formatNotificationFullTime,
13
+ resolveNotificationTone,
14
+ } from "../pages/settings/notification/notificationDisplay";
12
15
  import { DMS_TONE_SOLID, iconWellToneOf } from "#dms-ui/app/entries/utils/tone";
13
16
  import DmsRowSkeleton from "#dms-ui/app/entries/components/skeleton/RowSkeleton";
14
17
 
@@ -227,7 +230,12 @@ const goToNotifications = () => {
227
230
  }}
228
231
  </div>
229
232
  <div class="text-muted mt-1 text-[10px]">
230
- {{ formatRelativeTime(notification.createdAt, t, locale) }}
233
+ <time
234
+ :datetime="notification.createdAt"
235
+ :title="formatNotificationFullTime(notification.createdAt, locale)"
236
+ >
237
+ {{ formatRelativeTime(notification.createdAt, t, locale) }}
238
+ </time>
231
239
  </div>
232
240
  </template>
233
241
 
@@ -4,6 +4,7 @@ import {
4
4
  MODULE_TAG_CLASS,
5
5
  type NotificationSourceTag,
6
6
  SOURCE_TAG_CLASS,
7
+ formatNotificationFullTime,
7
8
  resolveNotificationTone,
8
9
  } from "./notificationDisplay";
9
10
 
@@ -19,7 +20,7 @@ const emit = defineEmits<{
19
20
  toggleRead: [];
20
21
  delete: [];
21
22
  }>();
22
- const { t } = useI18n();
23
+ const { t, locale } = useI18n();
23
24
  const { processI18n } = useTranslation();
24
25
 
25
26
  const isUnread = computed(() => !props.notification.isRead);
@@ -27,6 +28,9 @@ const iconWellTone = computed(() => {
27
28
  const tone = resolveNotificationTone(props.notification);
28
29
  return tone === "neutral" ? "muted" : tone;
29
30
  });
31
+ const fullTime = computed(() =>
32
+ formatNotificationFullTime(props.notification.createdAt, locale.value),
33
+ );
30
34
  const readToggleLabel = computed(() =>
31
35
  isUnread.value
32
36
  ? t("page.settings.notifications.mark_read")
@@ -71,7 +75,9 @@ const actionLabelUi = {
71
75
  }}
72
76
  </template>
73
77
  <template #meta>
74
- <time :datetime="props.notification.createdAt">{{ props.time }}</time>
78
+ <time :datetime="props.notification.createdAt" :title="fullTime">{{
79
+ props.time
80
+ }}</time>
75
81
  <span
76
82
  v-if="props.source"
77
83
  :class="[SOURCE_TAG_CLASS, props.source.isModule && MODULE_TAG_CLASS]"
@@ -10,18 +10,35 @@ interface NotificationMatrixSubjectProps {
10
10
  subject: NotificationSubject;
11
11
  enabled: boolean;
12
12
  state: SaveStatusState;
13
+ emailEnabled?: boolean;
13
14
  }
14
15
 
15
16
  const props = defineProps<NotificationMatrixSubjectProps>();
16
- const emit = defineEmits<{ toggle: [enabled: boolean]; retry: [] }>();
17
+ const emit = defineEmits<{
18
+ toggle: [enabled: boolean];
19
+ "toggle-email": [enabled: boolean];
20
+ retry: [];
21
+ }>();
17
22
  const { t } = useI18n();
18
23
 
19
24
  const label = computed(() => t(props.subject.labelKey));
20
25
  const isLocked = computed(() => props.subject.locked === true);
26
+ /** E-mail follows the in-app notification: none is sent without it. */
27
+ const isEmailDisabled = computed(() => isLocked.value || !props.enabled);
28
+ const emailTitle = computed(() => {
29
+ if (isLocked.value) return t("page.settings.notifications.locked_hint");
30
+ return props.enabled
31
+ ? undefined
32
+ : t("page.settings.notifications.email_needs_in_app");
33
+ });
21
34
 
22
35
  const onToggle = (value: boolean) => {
23
36
  if (props.state !== "saving") emit("toggle", value);
24
37
  };
38
+
39
+ const onToggleEmail = (value: boolean) => {
40
+ if (props.state !== "saving") emit("toggle-email", value);
41
+ };
25
42
  </script>
26
43
 
27
44
  <template>
@@ -68,7 +85,21 @@ const onToggle = (value: boolean) => {
68
85
  @update:model-value="onToggle"
69
86
  />
70
87
  </div>
88
+ <div v-if="props.subject.email" class="flex justify-center" role="cell">
89
+ <USwitch
90
+ :model-value="props.emailEnabled"
91
+ :disabled="isEmailDisabled"
92
+ :title="emailTitle"
93
+ :aria-label="
94
+ t('page.settings.notifications.email_switch', { name: label })
95
+ "
96
+ :aria-busy="props.state === 'saving'"
97
+ data-channel="email"
98
+ @update:model-value="onToggleEmail"
99
+ />
100
+ </div>
71
101
  <div
102
+ v-else
72
103
  class="text-dimmed flex justify-center font-mono text-xs font-medium"
73
104
  role="cell"
74
105
  >
@@ -28,6 +28,9 @@ const {
28
28
  toggleableSubjectsOf,
29
29
  toggleSubject,
30
30
  toggleCategory,
31
+ hasEmailChannel,
32
+ isEmailEnabled,
33
+ toggleEmail,
31
34
  retry,
32
35
  load,
33
36
  } = useNotificationPreferences();
@@ -91,6 +94,7 @@ const failureMessage = computed(() => {
91
94
  >
92
95
  {{ t("page.settings.notifications.column_email") }}
93
96
  <UBadge
97
+ v-if="!hasEmailChannel"
94
98
  color="neutral"
95
99
  size="sm"
96
100
  class="tracking-[0.04em]"
@@ -160,7 +164,9 @@ const failureMessage = computed(() => {
160
164
  :subject="subject"
161
165
  :enabled="isEnabled(subject)"
162
166
  :state="rowState(subject)"
167
+ :email-enabled="isEmailEnabled(subject)"
163
168
  @toggle="(enabled) => toggleSubject(subject, enabled)"
169
+ @toggle-email="(enabled) => toggleEmail(subject, enabled)"
164
170
  @retry="retry"
165
171
  />
166
172
  </div>
@@ -187,7 +193,11 @@ const failureMessage = computed(() => {
187
193
  </template>
188
194
  <span v-else class="flex items-center gap-1.5 text-xs">
189
195
  <UIcon name="i-ph-info" class="text-dimmed size-3.5" />
190
- {{ t("page.settings.notifications.email_hint") }}
196
+ {{
197
+ hasEmailChannel
198
+ ? t("page.settings.notifications.email_hint_active")
199
+ : t("page.settings.notifications.email_hint")
200
+ }}
191
201
  </span>
192
202
  </template>
193
203
  </DmsSectionPanel>
@@ -1,3 +1,4 @@
1
+ import { formatDate } from "#dms-core/app/utils/formatter";
1
2
  import { MONO_TAG_CLASS } from "#dms-ui/app/entries/utils/monoChip";
2
3
  import {
3
4
  formatShortDate,
@@ -82,6 +83,18 @@ export const formatNotificationTime = (
82
83
  return formatShortDate(date, now, locale);
83
84
  };
84
85
 
86
+ const FULL_TIME_FORMAT: Intl.DateTimeFormatOptions = {
87
+ dateStyle: "medium",
88
+ timeStyle: "short",
89
+ };
90
+
91
+ /** The exact date and time, in the user's language, for a time's hover title. */
92
+ export const formatNotificationFullTime = (
93
+ createdAt: string,
94
+ locale: string,
95
+ ): string | undefined =>
96
+ formatDate(createdAt, locale, FULL_TIME_FORMAT) ?? undefined;
97
+
85
98
  /**
86
99
  * The matrix lays out from its own width (`@container/matrix` on the table),
87
100
  * not the viewport's: the settings column at 1024px is narrower than a phone
@@ -20,11 +20,18 @@ export interface NotificationSubject {
20
20
  badgeKey?: string;
21
21
  /** Set by the server: the user may not turn the subject off. */
22
22
  locked?: boolean;
23
+ /** Set by the server when the subject has an e-mail switch: it offers e-mail and a module delivers it. */
24
+ email?: {
25
+ /** E-mail is on for a user who never chose. */
26
+ defaultOn: boolean;
27
+ };
23
28
  }
24
29
 
25
30
  interface NotificationCatalogResponse {
26
31
  categories: NotificationCategory[];
27
32
  subjects: NotificationSubject[];
33
+ /** A module registered the e-mail channel. */
34
+ emailChannel?: boolean;
28
35
  }
29
36
 
30
37
  export const buildPreferenceKey = (categoryId: string, subjectId: string) =>
@@ -33,6 +40,10 @@ export const buildPreferenceKey = (categoryId: string, subjectId: string) =>
33
40
  export const subjectPreferenceKey = (subject: NotificationSubject) =>
34
41
  buildPreferenceKey(subject.category.id, subject.id);
35
42
 
43
+ /** The key the subject's e-mail switch is stored under. */
44
+ export const emailPreferenceKey = (subject: NotificationSubject) =>
45
+ `${subjectPreferenceKey(subject)}@email`;
46
+
36
47
  const CATALOG_URL = pageRoutePath(
37
48
  "/settings/user/notifications",
38
49
  "/categories",
@@ -55,6 +66,10 @@ export const useNotificationCatalog = (enabled: () => boolean = () => true) => {
55
66
  );
56
67
  const categories = computed(() => catalog.data.value?.categories ?? []);
57
68
  const subjects = computed(() => catalog.data.value?.subjects ?? []);
69
+ /** A module registered the e-mail channel: its column holds switches. */
70
+ const hasEmailChannel = computed(
71
+ () => catalog.data.value?.emailChannel === true,
72
+ );
58
73
  const isLoaded = computed(() => !!catalog.data.value);
59
74
  const loadFailed = computed(() => !isLoaded.value && hasFailed(catalog));
60
75
 
@@ -76,6 +91,7 @@ export const useNotificationCatalog = (enabled: () => boolean = () => true) => {
76
91
  return {
77
92
  categories,
78
93
  subjects,
94
+ hasEmailChannel,
79
95
  isLoaded,
80
96
  loadFailed,
81
97
  loadCatalog,