@vc-shell/vc-app-skill 2.1.0-pr255.4dc5c0d → 2.1.0-pr256.0fe3abb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +20 -18
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +43 -34
- package/runtime/knowledge/docs/core/blade-navigation/table-query-state/useTableQueryState.docs.md +95 -0
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +5 -3
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +7 -5
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +8 -6
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +3 -1
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +8 -5
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +12 -12
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +4 -3
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +1 -0
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +5 -4
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +2 -0
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +1 -2
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +35 -0
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +1 -1
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +2 -2
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +2 -1
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +18 -18
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +3 -3
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +10 -7
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +18 -12
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +2 -2
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +20 -20
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +15 -24
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +2 -2
- package/runtime/knowledge/docs/core/notifications/composables/useBladeNotifications.docs.md +183 -0
- package/runtime/knowledge/docs/core/notifications/composables/useBroadcastFilter.docs.md +117 -0
- package/runtime/knowledge/docs/core/notifications/composables/useNotificationContext.docs.md +150 -0
- package/runtime/knowledge/docs/core/notifications/composables/useNotificationStore.docs.md +114 -0
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +50 -30
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +30 -11
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +1 -1
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +2 -3
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +26 -26
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +2 -3
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +11 -50
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +9 -6
- package/runtime/knowledge/docs/core/services/services.docs.md +15 -13
- package/runtime/knowledge/docs/core/types/types.docs.md +37 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +1 -2
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +21 -30
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +2 -2
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +9 -8
- package/runtime/knowledge/docs/injection-keys.docs.md +6 -11
- package/runtime/knowledge/docs/modules/assets/assets-details.docs.md +123 -0
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +1 -1
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +20 -12
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +10 -10
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +6 -6
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +4 -4
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +16 -14
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +1 -1
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +12 -11
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +10 -3
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +3 -3
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +9 -2
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +4 -2
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md +35 -31
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -11
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +8 -7
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +23 -21
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +5 -3
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +7 -7
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +11 -11
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +28 -16
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +17 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/dashboard-widget-skeleton.docs.md +33 -0
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +21 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +2 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +15 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +9 -6
- package/runtime/knowledge/docs/ui/components/atoms/vc-environment-banner/vc-environment-banner.docs.md +42 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +19 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +5 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +5 -4
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +9 -8
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +11 -10
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +28 -8
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +22 -19
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +8 -8
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +16 -6
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +9 -8
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +42 -34
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +14 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +3 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +34 -33
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +26 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +12 -14
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +30 -30
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +34 -31
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +14 -12
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +36 -27
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +5 -1
- package/runtime/knowledge/docs/ui/components/molecules/{vc-dropdown-panel/vc-dropdown-panel.docs.md → vc-popover/vc-popover.docs.md} +26 -25
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +10 -9
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +44 -19
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +11 -11
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +15 -14
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +15 -15
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +15 -13
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +5 -1
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +18 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +48 -78
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +9 -11
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +71 -43
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +27 -20
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +2 -2
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +12 -12
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +33 -24
- package/runtime/knowledge/docs/ui/components/organisms/vc-scheduler/vc-scheduler.docs.md +412 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +43 -26
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +15 -9
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +8 -6
- package/runtime/knowledge/docs/ui/composables/useTableSearch.docs.md +130 -0
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +4 -4
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +2 -3
|
@@ -19,18 +19,18 @@ These components provide ready-to-use modal dialogs for common scenarios. Each v
|
|
|
19
19
|
|
|
20
20
|
The foundation component. Wraps `VcPopup` and adds footer action buttons based on the `mode`.
|
|
21
21
|
|
|
22
|
-
| Prop | Type | Default | Description
|
|
23
|
-
| -------------------- | ---------------------------- | --------------- |
|
|
24
|
-
| `title` | `string` | -- | Dialog title
|
|
25
|
-
| `variant` | `PopupVariant` | `"default"` | Visual style: `"default"`, `"warning"`, `"error"`, `"info"`
|
|
26
|
-
| `mode` | `"acknowledge" \| "confirm"` | `"acknowledge"` | `acknowledge` = single OK button; `confirm` = Confirm + Cancel
|
|
27
|
-
| `actionLabel` | `string` | `""` | Label for the single button in acknowledge mode
|
|
28
|
-
| `confirmLabel` | `string` | `""` | Label for the confirm button
|
|
29
|
-
| `cancelLabel` | `string` | `""` | Label for the cancel button
|
|
30
|
-
| `confirmAsText` | `boolean` | `false` | Render confirm button as text-only style
|
|
31
|
-
| `closable` | `boolean` | `true` | Show close (X) button in the header
|
|
32
|
-
| `isMobileFullscreen` | `boolean` | `true` | Expand to fullscreen on mobile
|
|
33
|
-
| `closeOnConfirm` | `boolean` | `false` | Auto-close the popup after confirm is emitted
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| -------------------- | ---------------------------- | --------------- | ------------------------------------------------------------------------ |
|
|
24
|
+
| `title` | `string` | -- | Dialog title |
|
|
25
|
+
| `variant` | `PopupVariant` | `"default"` | Visual style: `"default"`, `"warning"`, `"error"`, `"success"`, `"info"` |
|
|
26
|
+
| `mode` | `"acknowledge" \| "confirm"` | `"acknowledge"` | `acknowledge` = single OK button; `confirm` = Confirm + Cancel |
|
|
27
|
+
| `actionLabel` | `string` | `""` | Label for the single button in acknowledge mode |
|
|
28
|
+
| `confirmLabel` | `string` | `""` | Label for the confirm button |
|
|
29
|
+
| `cancelLabel` | `string` | `""` | Label for the cancel button |
|
|
30
|
+
| `confirmAsText` | `boolean` | `false` | Render confirm button as text-only style |
|
|
31
|
+
| `closable` | `boolean` | `true` | Show close (X) button in the header |
|
|
32
|
+
| `isMobileFullscreen` | `boolean` | `true` | Expand to fullscreen on mobile |
|
|
33
|
+
| `closeOnConfirm` | `boolean` | `false` | Auto-close the popup after confirm is emitted |
|
|
34
34
|
|
|
35
35
|
Events: `close`, `confirm`
|
|
36
36
|
|
|
@@ -118,6 +118,14 @@ Slots: `header`, `default`
|
|
|
118
118
|
- All popups are fullscreen on mobile by default. Set `isMobileFullscreen="false"` to keep the centered dialog style.
|
|
119
119
|
- Button labels default to i18n keys: `COMPONENTS.ORGANISMS.VC_POPUP.CONFIRM`, `.CANCEL`, `.OK`.
|
|
120
120
|
|
|
121
|
+
## CSS Variables
|
|
122
|
+
|
|
123
|
+
| Variable | Default | Description |
|
|
124
|
+
| ---------------------------- | ---------------------- | ------------------------- |
|
|
125
|
+
| `--popup-base-confirm-color` | `var(--secondary-700)` | Confirm-button text color |
|
|
126
|
+
|
|
127
|
+
The deprecated `--confirm-button-color` alias is still honored as a fallback: `--popup-base-confirm-color: var(--confirm-button-color, var(--secondary-700))`. Prefer `--popup-base-confirm-color`.
|
|
128
|
+
|
|
121
129
|
## Related
|
|
122
130
|
|
|
123
131
|
- `framework/ui/components/organisms/vc-popup/` -- the underlying `VcPopup` organism
|
|
@@ -19,12 +19,12 @@ Change password page with current, new, and confirm password fields. Supports a
|
|
|
19
19
|
|
|
20
20
|
```vue
|
|
21
21
|
<template>
|
|
22
|
-
<
|
|
22
|
+
<ChangePasswordPage />
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<!-- Forced mode (expired password) -->
|
|
26
26
|
<template>
|
|
27
|
-
<
|
|
27
|
+
<ChangePasswordPage forced />
|
|
28
28
|
</template>
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ With custom branding:
|
|
|
32
32
|
|
|
33
33
|
```vue
|
|
34
34
|
<template>
|
|
35
|
-
<
|
|
35
|
+
<ChangePasswordPage
|
|
36
36
|
forced
|
|
37
37
|
logo="/assets/my-company-logo.svg"
|
|
38
38
|
background="/assets/custom-background.jpg"
|
|
@@ -42,24 +42,24 @@ With custom branding:
|
|
|
42
42
|
|
|
43
43
|
## Key Props
|
|
44
44
|
|
|
45
|
-
| Prop | Type | Default | Description
|
|
46
|
-
| ------------ | --------- | ------- |
|
|
47
|
-
| `forced` | `boolean` | `false` | Show expired-password info banner and adjusted title
|
|
48
|
-
| `logo` | `string` | - |
|
|
49
|
-
| `background` | `string` | - | Custom background image URL
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
| ------------ | --------- | ------- | ---------------------------------------------------------------------------- |
|
|
47
|
+
| `forced` | `boolean` | `false` | Show expired-password info banner and adjusted title |
|
|
48
|
+
| `logo` | `string` | - | Fallback logo image URL (used when the platform UI-settings logo is not set) |
|
|
49
|
+
| `background` | `string` | - | Custom background image URL |
|
|
50
50
|
|
|
51
51
|
## Recipe: Router Configuration with Forced Mode
|
|
52
52
|
|
|
53
53
|
Set up the route so the login page can redirect here when the password is expired:
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
|
-
import
|
|
56
|
+
import { ChangePasswordPage } from "@vc-shell/framework";
|
|
57
57
|
|
|
58
58
|
const routes = [
|
|
59
59
|
{
|
|
60
60
|
path: "/change-password",
|
|
61
61
|
name: "ChangePassword",
|
|
62
|
-
component:
|
|
62
|
+
component: ChangePasswordPage,
|
|
63
63
|
props: (route) => ({
|
|
64
64
|
forced: route.query.forced === "true",
|
|
65
65
|
}),
|
|
@@ -38,11 +38,11 @@ With custom branding:
|
|
|
38
38
|
|
|
39
39
|
## Key Props
|
|
40
40
|
|
|
41
|
-
| Prop | Type | Default | Description
|
|
42
|
-
| ------------ | -------------------------- | ------- |
|
|
43
|
-
| `logo` | `string` | - |
|
|
44
|
-
| `background` | `string` | - | Custom background image URL
|
|
45
|
-
| `composable` | `() => { forgotPassword }` | - | Custom composable providing `forgotPassword(args)`
|
|
41
|
+
| Prop | Type | Default | Description |
|
|
42
|
+
| ------------ | -------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
43
|
+
| `logo` | `string` | - | Fallback logo image URL (used when the platform UI-settings logo is not set) |
|
|
44
|
+
| `background` | `string` | - | Custom background image URL |
|
|
45
|
+
| `composable` | `() => { forgotPassword }` | - | Custom composable providing `forgotPassword(args)` |
|
|
46
46
|
|
|
47
47
|
## Recipe: Custom Reset Flow with a Different API
|
|
48
48
|
|
|
@@ -73,7 +73,7 @@ export function useCustomPasswordReset() {
|
|
|
73
73
|
Register the page in your application router:
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
|
-
import ForgotPassword from "@vc-shell/framework
|
|
76
|
+
import { ForgotPassword } from "@vc-shell/framework";
|
|
77
77
|
|
|
78
78
|
const routes = [
|
|
79
79
|
{
|
|
@@ -56,7 +56,7 @@ With custom branding:
|
|
|
56
56
|
Set up the route to extract query parameters from the invitation email link:
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
|
-
import Invite from "@vc-shell/framework
|
|
59
|
+
import { Invite } from "@vc-shell/framework";
|
|
60
60
|
|
|
61
61
|
const routes = [
|
|
62
62
|
{
|
|
@@ -79,13 +79,13 @@ The invitation email link typically looks like:
|
|
|
79
79
|
https://your-app.com/invite?userId=abc123&userName=jane@example.com&token=xyz789...
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
## Recipe: Custom
|
|
82
|
+
## Recipe: Custom Branding
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
Wrap `Invite` to pass a custom logo while keeping the standard invitation flow (token validation, password set, and auto sign-in are handled internally):
|
|
85
85
|
|
|
86
86
|
```vue
|
|
87
87
|
<script setup lang="ts">
|
|
88
|
-
import Invite from "@vc-shell/framework
|
|
88
|
+
import { Invite } from "@vc-shell/framework";
|
|
89
89
|
import { useRoute } from "vue-router";
|
|
90
90
|
|
|
91
91
|
const route = useRoute();
|
|
@@ -41,18 +41,18 @@ SSO-only mode:
|
|
|
41
41
|
|
|
42
42
|
## Key Props
|
|
43
43
|
|
|
44
|
-
| Prop | Type | Default | Description
|
|
45
|
-
| ------------ | --------- | --------------------- |
|
|
46
|
-
| `logo` | `string` | - |
|
|
47
|
-
| `background` | `string` | - | Custom background image URL
|
|
48
|
-
| `title` | `string` | i18n `LOGIN.TITLE` | Page heading text
|
|
49
|
-
| `subtitle` | `string` | i18n `LOGIN.SUBTITLE` | Page subheading text
|
|
50
|
-
| `ssoOnly` | `boolean` | `false` | Hide credentials form, show only SSO providers
|
|
44
|
+
| Prop | Type | Default | Description |
|
|
45
|
+
| ------------ | --------- | --------------------- | ---------------------------------------------------------------------------- |
|
|
46
|
+
| `logo` | `string` | - | Fallback logo image URL (used when the platform UI-settings logo is not set) |
|
|
47
|
+
| `background` | `string` | - | Custom background image URL |
|
|
48
|
+
| `title` | `string` | i18n `LOGIN.TITLE` | Page heading text |
|
|
49
|
+
| `subtitle` | `string` | i18n `LOGIN.SUBTITLE` | Page subheading text |
|
|
50
|
+
| `ssoOnly` | `boolean` | `false` | Hide credentials form, show only SSO providers |
|
|
51
51
|
|
|
52
52
|
## Recipe: Router Configuration
|
|
53
53
|
|
|
54
54
|
```ts
|
|
55
|
-
import Login from "@vc-shell/framework
|
|
55
|
+
import { Login } from "@vc-shell/framework";
|
|
56
56
|
|
|
57
57
|
const routes = [
|
|
58
58
|
{
|
|
@@ -73,7 +73,7 @@ const routes = [
|
|
|
73
73
|
|
|
74
74
|
```vue
|
|
75
75
|
<script setup lang="ts">
|
|
76
|
-
import Login from "@vc-shell/framework
|
|
76
|
+
import { Login } from "@vc-shell/framework";
|
|
77
77
|
</script>
|
|
78
78
|
|
|
79
79
|
<template>
|
|
@@ -94,11 +94,13 @@ The login page supports the `auth:after-form` extension point, allowing modules
|
|
|
94
94
|
|
|
95
95
|
```ts
|
|
96
96
|
// In your module setup
|
|
97
|
-
import {
|
|
97
|
+
import { markRaw } from "vue";
|
|
98
|
+
import { useExtensionPoint } from "@vc-shell/framework";
|
|
98
99
|
|
|
99
|
-
const
|
|
100
|
+
const { add } = useExtensionPoint("auth:after-form");
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
add({
|
|
103
|
+
id: "auth-footer",
|
|
102
104
|
component: markRaw(CustomAuthFooter),
|
|
103
105
|
props: { message: "By signing in, you agree to our Terms of Service." },
|
|
104
106
|
});
|
|
@@ -109,7 +111,7 @@ extensions.register("auth:after-form", {
|
|
|
109
111
|
- **Auto-detects SSO providers**: Calls `useExternalProvider().getProviders()` on mount and renders provider buttons only when providers are available
|
|
110
112
|
- **Expired password redirect**: Redirects to the `ChangePassword` route when `user.passwordExpired` is `true` after successful credential authentication
|
|
111
113
|
- **Extension point support**: The `auth:after-form` extension point allows plugins to inject content below the form (terms of service, help links, etc.)
|
|
112
|
-
- **Inline error messages**: Displays error messages for invalid credentials
|
|
114
|
+
- **Inline error messages**: Displays error messages for invalid credentials and generic authentication errors directly in the form
|
|
113
115
|
- **Forgot password link**: Navigates to the `ForgotPassword` route
|
|
114
116
|
|
|
115
117
|
## Details
|
|
@@ -117,7 +119,7 @@ extensions.register("auth:after-form", {
|
|
|
117
119
|
- **Auth layout**: Renders inside `VcAuthLayout`, which provides the centered card design with the logo at the top and the background image filling the page.
|
|
118
120
|
- **Public route**: This page must be accessible without authentication. The route should have `meta: { public: true }` or be excluded from authentication guards.
|
|
119
121
|
- **SSO auto-detection**: The page fetches available providers asynchronously. If the API call fails or returns an empty list, only the credentials form is shown.
|
|
120
|
-
- **Password expiry flow**: After successful login, if the API response indicates `passwordExpired`, the page redirects to
|
|
122
|
+
- **Password expiry flow**: After successful login, if the API response indicates `passwordExpired`, the page redirects to the `ChangePassword` route (`router.push({ name: "ChangePassword" })`) instead of the main application. No `forced` query param is passed; wire that separately via route props if you need it.
|
|
121
123
|
- **Remember me**: The page does not include a "remember me" checkbox. Session persistence is managed by the platform's token expiration settings.
|
|
122
124
|
|
|
123
125
|
## Tips
|
|
@@ -56,7 +56,7 @@ With custom branding:
|
|
|
56
56
|
Set up the route to extract query parameters from the password reset email link:
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
|
-
import ResetPassword from "@vc-shell/framework
|
|
59
|
+
import { ResetPassword } from "@vc-shell/framework";
|
|
60
60
|
|
|
61
61
|
const routes = [
|
|
62
62
|
{
|
|
@@ -34,7 +34,7 @@ const { getProviders } = useExternalProvider();
|
|
|
34
34
|
const providers = ref([]);
|
|
35
35
|
|
|
36
36
|
onMounted(async () => {
|
|
37
|
-
providers.value = await getProviders();
|
|
37
|
+
providers.value = (await getProviders()) ?? [];
|
|
38
38
|
});
|
|
39
39
|
</script>
|
|
40
40
|
```
|
|
@@ -47,26 +47,27 @@ onMounted(async () => {
|
|
|
47
47
|
|
|
48
48
|
## API (`useExternalProvider`)
|
|
49
49
|
|
|
50
|
-
| Method | Signature
|
|
51
|
-
| -------------- |
|
|
52
|
-
| `getProviders` | `() => Promise<ExternalSignInProviderInfo[]>`
|
|
53
|
-
| `signIn` | `(authenticationType
|
|
54
|
-
| `signOut` | `(authenticationType: string) => Promise<void>`
|
|
55
|
-
| `storage` | `Ref<{ providerType?: string }>`
|
|
50
|
+
| Method | Signature | Description |
|
|
51
|
+
| -------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
52
|
+
| `getProviders` | `() => Promise<ExternalSignInProviderInfo[] \| undefined>` | Fetch available SSO providers from the platform API (returns `undefined` on API error) |
|
|
53
|
+
| `signIn` | `(authenticationType?: string) => Promise<void>` | Redirect to external provider login (throws if `authenticationType` is missing) |
|
|
54
|
+
| `signOut` | `(authenticationType: string) => Promise<void>` | Redirect to external provider logout |
|
|
55
|
+
| `storage` | `Ref<{ providerType?: string }>` | Persisted localStorage ref tracking the active provider |
|
|
56
56
|
|
|
57
57
|
## Recipe: Custom Login Page with SSO and Credentials
|
|
58
58
|
|
|
59
59
|
```vue
|
|
60
60
|
<script setup lang="ts">
|
|
61
|
-
import { ref, onMounted } from "vue";
|
|
61
|
+
import { ref, computed, onMounted } from "vue";
|
|
62
62
|
import { ExternalProviders, useExternalProvider } from "@vc-shell/framework";
|
|
63
|
+
import type { ExternalSignInProviderInfo } from "@vc-shell/framework";
|
|
63
64
|
|
|
64
65
|
const { getProviders } = useExternalProvider();
|
|
65
66
|
const providers = ref<ExternalSignInProviderInfo[]>([]);
|
|
66
67
|
const hasProviders = computed(() => providers.value.length > 0);
|
|
67
68
|
|
|
68
69
|
onMounted(async () => {
|
|
69
|
-
providers.value = await getProviders();
|
|
70
|
+
providers.value = (await getProviders()) ?? [];
|
|
70
71
|
});
|
|
71
72
|
</script>
|
|
72
73
|
|
|
@@ -127,7 +128,7 @@ This hides the username/password form and shows only the external provider butto
|
|
|
127
128
|
|
|
128
129
|
## Tips
|
|
129
130
|
|
|
130
|
-
-
|
|
131
|
+
- `getProviders()` returns `undefined` on API error (and whatever the API yields otherwise); the examples fall back to `[]`. When there are no providers, the `ExternalProviders` component renders nothing.
|
|
131
132
|
- The `storage.providerType` value is set automatically during sign-in and used by the `LogoutButton` to trigger the correct provider sign-out.
|
|
132
133
|
- For development, you can test SSO flows by configuring a local identity provider (like Keycloak) in the platform's authentication settings.
|
|
133
134
|
|
|
@@ -135,4 +136,4 @@ This hides the username/password form and shows only the external provider butto
|
|
|
135
136
|
|
|
136
137
|
- **LoginPage** - The primary consumer that renders `ExternalProviders`
|
|
137
138
|
- **VcAuthLayout** - The layout wrapper used by login and other auth pages
|
|
138
|
-
- **LogoutButton** -
|
|
139
|
+
- **LogoutButton** - Calls `useUserManagement().signOut()`, which internally delegates to `useExternalProvider().signOut()` when `storage.providerType` is set (SSO session)
|
|
@@ -47,7 +47,7 @@ The `ChangePassword` component renders a `VcPopup` with three validated input fi
|
|
|
47
47
|
- Field-level: `required` and `min:6` rules via vee-validate's `Field` component.
|
|
48
48
|
- API-level: `validatePassword()` checks the platform's password policy on each input change.
|
|
49
49
|
- Custom checks: confirms that new password matches confirmation and that the new password differs from the current one.
|
|
50
|
-
- Errors are displayed as `
|
|
50
|
+
- Errors are displayed as `IdentityError` codes mapped to i18n keys: `COMPONENTS.CHANGE_PASSWORD.ERRORS.{code}`.
|
|
51
51
|
|
|
52
52
|
## Usage
|
|
53
53
|
|
|
@@ -70,7 +70,7 @@ The `ChangePassword` component renders a `VcPopup` with three validated input fi
|
|
|
70
70
|
|
|
71
71
|
## Error Codes
|
|
72
72
|
|
|
73
|
-
Common `
|
|
73
|
+
Common `IdentityError.code` values (mapped to i18n keys):
|
|
74
74
|
|
|
75
75
|
- `PasswordTooShort` -- below minimum length
|
|
76
76
|
- `PasswordRequiresNonAlphanumeric` -- needs special characters
|
|
@@ -86,7 +86,14 @@ Common `IIdentityError.code` values (mapped to i18n keys):
|
|
|
86
86
|
- In forced mode, there is no way to dismiss the dialog without either changing the password or signing out.
|
|
87
87
|
- The component uses `useRouter()` for navigation after sign-out or successful change.
|
|
88
88
|
|
|
89
|
+
## CSS Variables
|
|
90
|
+
|
|
91
|
+
| Variable | Default | Applies to |
|
|
92
|
+
| ------------------------------- | ----------------------- | ---------------------------- |
|
|
93
|
+
| `--change-password-error-color` | `var(--danger-500)` | Inline API error hints |
|
|
94
|
+
| `--change-password-text-color` | `var(--additional-950)` | Forced-mode info banner text |
|
|
95
|
+
|
|
89
96
|
## Related
|
|
90
97
|
|
|
91
98
|
- `framework/core/composables/useUserManagement/` -- `changeUserPassword`, `validatePassword`, `signOut`
|
|
92
|
-
- `framework/core/api/platform/` -- `
|
|
99
|
+
- `framework/core/api/platform/` -- `IdentityError` type
|
|
@@ -44,7 +44,7 @@ settingsMenu.register({
|
|
|
44
44
|
|
|
45
45
|
## Key Props
|
|
46
46
|
|
|
47
|
-
This component has no props. It uses `usePopup()` to open the ChangePassword form and `
|
|
47
|
+
This component has no props. It uses `usePopup()` to open the ChangePassword form and injects `CloseSettingsMenuKey` to dismiss the parent menu. Password validation lives in the ChangePassword popup, not in this button.
|
|
48
48
|
|
|
49
49
|
## Recipe: Registering Account Actions in a Module
|
|
50
50
|
|
|
@@ -78,12 +78,12 @@ export default {
|
|
|
78
78
|
|
|
79
79
|
- **Flow sequence**: Click button -> close settings menu -> open popup -> user fills form -> submit -> popup closes.
|
|
80
80
|
- **Password validation**: The popup form uses `useUserManagement().validatePassword()` to check the new password against the platform's password policy in real time (minimum length, required character classes, etc.).
|
|
81
|
-
- **Equal password detection**: If the user enters the same value for current and new password, the form shows a specific "Equal-passwords" error without
|
|
81
|
+
- **Equal password detection**: If the user enters the same value for current and new password, the form shows a specific "Equal-passwords" error without submitting the password change (the `changeUserPassword` call is skipped; `validatePassword()` still runs on input).
|
|
82
82
|
- **Error handling**: API errors (e.g., incorrect current password) are displayed inline within the popup form.
|
|
83
83
|
|
|
84
84
|
## Tips
|
|
85
85
|
|
|
86
|
-
- The button renders as a `SettingsMenuItem` with
|
|
86
|
+
- The button renders as a `SettingsMenuItem` with the `lucide-key` icon. Its label comes from the i18n key `SHELL.ACCOUNT.CHANGE_PASSWORD`.
|
|
87
87
|
- If you need to trigger password change from a different context (not the settings menu), use `usePopup()` directly with the ChangePassword component.
|
|
88
88
|
- The popup is modal -- the user must complete or cancel the password change before interacting with the rest of the application.
|
|
89
89
|
|
|
@@ -28,6 +28,13 @@ The component is renderless -- it renders its default slot and passes the curren
|
|
|
28
28
|
| --------- | --------- | ------- | ------------------------------------------------ |
|
|
29
29
|
| `capture` | `boolean` | `false` | Force error capture even outside a blade context |
|
|
30
30
|
|
|
31
|
+
## Events
|
|
32
|
+
|
|
33
|
+
| Event | Payload | Description |
|
|
34
|
+
| ------- | ----------------- | --------------------------------------- |
|
|
35
|
+
| `error` | `Error \| string` | Emitted when a new error is captured |
|
|
36
|
+
| `reset` | -- | Emitted when the error state is cleared |
|
|
37
|
+
|
|
31
38
|
## Slot Props
|
|
32
39
|
|
|
33
40
|
| Prop | Type | Description |
|
|
@@ -74,7 +81,7 @@ The component is renderless -- it renders its default slot and passes the curren
|
|
|
74
81
|
import { ErrorInterceptor } from "@vc-shell/framework";
|
|
75
82
|
```
|
|
76
83
|
|
|
77
|
-
The component
|
|
84
|
+
The component must be imported before use, as shown above.
|
|
78
85
|
|
|
79
86
|
## Tips
|
|
80
87
|
|
|
@@ -86,4 +93,4 @@ The component is registered globally -- it can be used in templates without impo
|
|
|
86
93
|
|
|
87
94
|
- `framework/core/composables/useErrorHandler/` -- the underlying composable
|
|
88
95
|
- `framework/core/utilities/pendingErrorNotifications.ts` -- cancels deferred toasts
|
|
89
|
-
- `framework/
|
|
96
|
+
- `framework/core/blade-navigation/` -- BladeStack error management (types the interceptor injects)
|
|
@@ -73,12 +73,14 @@ If you need to change the locale from code (e.g., based on user profile settings
|
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
import { useLanguages } from "@vc-shell/framework";
|
|
76
|
+
import { useI18n } from "vue-i18n";
|
|
76
77
|
|
|
77
|
-
const { currentLocale, setLocale
|
|
78
|
+
const { currentLocale, setLocale } = useLanguages();
|
|
79
|
+
const { availableLocales } = useI18n();
|
|
78
80
|
|
|
79
81
|
// Set locale on login based on user preference
|
|
80
82
|
async function onLogin(user) {
|
|
81
|
-
if (user.preferredLocale && availableLocales.
|
|
83
|
+
if (user.preferredLocale && availableLocales.includes(user.preferredLocale)) {
|
|
82
84
|
setLocale(user.preferredLocale);
|
|
83
85
|
}
|
|
84
86
|
}
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
- **Menu dismissal**: Before starting the sign-out flow, the component calls the injected `CloseSettingsMenuKey` function to close the dropdown. This prevents a visual artifact where the menu stays open while the page redirects.
|
|
81
81
|
- **Blade cleanup**: All open child blades are closed via `useBladeStack()` before redirecting. This avoids orphaned blade state in the navigation stack.
|
|
82
82
|
- **Redirect**: After sign-out completes, the user is redirected to the `/login` route.
|
|
83
|
-
- **External providers**: If the user signed in through an external SSO provider,
|
|
83
|
+
- **External providers**: If the user signed in through an external SSO provider, `useUserManagement().signOut()` handles the provider's logout redirect internally as part of the same call — the component does not invoke it separately.
|
|
84
84
|
|
|
85
85
|
## Tips
|
|
86
86
|
|
package/runtime/knowledge/docs/shell/components/notification-dropdown/notification-dropdown.docs.md
CHANGED
|
@@ -7,7 +7,9 @@ internal: true
|
|
|
7
7
|
|
|
8
8
|
# NotificationDropdown
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
> **Note:** `useNotifications()` is deprecated (it logs a dev warning). Use `useBladeNotifications()` for blade-scoped subscriptions, or `useNotificationStore()` for direct store access — an advanced escape hatch that most apps do not need, since the shell already wires the bell and unread badge. The component itself uses `useNotificationStore()`.
|
|
11
|
+
|
|
12
|
+
Dropdown panel that displays the push notification history in reverse chronological order. This component renders a scrollable list of all received push notifications, backed by the `useNotificationStore()`. It automatically marks unread notifications as read when the dropdown is closed (unmounted), updating the unread badge count in the toolbar.
|
|
11
13
|
|
|
12
14
|
The dropdown is designed for persistent notification history (server-side push notifications via SignalR), not for transient toast messages.
|
|
13
15
|
|
|
@@ -31,18 +33,21 @@ import { NotificationDropdown } from "@vc-shell/framework";
|
|
|
31
33
|
|
|
32
34
|
## Key Props
|
|
33
35
|
|
|
34
|
-
This component has no props. Notification data comes from the shared notification store via `
|
|
36
|
+
This component has no props. Notification data comes from the shared notification store via `useNotificationStore()` — the same store the shell's bell is wired to.
|
|
35
37
|
|
|
36
38
|
## Recipe: Notification Bell with Unread Badge
|
|
37
39
|
|
|
38
|
-
The
|
|
40
|
+
> **Advanced — most apps do not need this.** The standard `VcApp` shell already renders the bell, dropdown, and unread badge. Build your own only in a custom shell that replaces the shell chrome. To _react_ to notifications inside a blade, use [`useBladeNotifications()`](../../../core/notifications/composables/useBladeNotifications.docs.md) instead; its `unreadCount` is scoped to the notify types you subscribe to. For a global count across all types you need the store, as shown here.
|
|
41
|
+
|
|
42
|
+
A custom bell pairs a toolbar button with the dropdown and reads the global unread count from the store:
|
|
39
43
|
|
|
40
44
|
```vue
|
|
41
45
|
<script setup lang="ts">
|
|
42
46
|
import { ref, computed } from "vue";
|
|
43
|
-
import { NotificationDropdown,
|
|
47
|
+
import { NotificationDropdown, useNotificationStore } from "@vc-shell/framework";
|
|
44
48
|
|
|
45
|
-
const
|
|
49
|
+
const store = useNotificationStore();
|
|
50
|
+
const unreadCount = computed(() => store.unreadCount.value);
|
|
46
51
|
const isOpen = ref(false);
|
|
47
52
|
</script>
|
|
48
53
|
|
|
@@ -70,54 +75,53 @@ const isOpen = ref(false);
|
|
|
70
75
|
For testing or injecting client-side notifications:
|
|
71
76
|
|
|
72
77
|
```ts
|
|
73
|
-
import {
|
|
74
|
-
import { PushNotification } from "@vc-shell/framework";
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
78
|
+
import { useNotificationStore } from "@vc-shell/framework";
|
|
79
|
+
import type { PushNotification } from "@vc-shell/framework";
|
|
80
|
+
|
|
81
|
+
const store = useNotificationStore();
|
|
82
|
+
|
|
83
|
+
store.ingest({
|
|
84
|
+
id: "order-123",
|
|
85
|
+
notifyType: "OrderCreated",
|
|
86
|
+
title: "New order received",
|
|
87
|
+
description: "Order #123 placed by customer.",
|
|
88
|
+
isNew: true,
|
|
89
|
+
created: new Date(),
|
|
90
|
+
} as PushNotification);
|
|
88
91
|
```
|
|
89
92
|
|
|
90
93
|
### Custom notification templates
|
|
91
94
|
|
|
92
|
-
|
|
95
|
+
Register custom templates through the module `notifications` config to render domain-specific notification layouts keyed by `notifyType`. Each module defines how its own notifications look:
|
|
93
96
|
|
|
94
97
|
```ts
|
|
95
|
-
import {
|
|
96
|
-
import { NotificationTemplatesKey } from "@vc-shell/framework";
|
|
98
|
+
import { defineAppModule } from "@vc-shell/framework";
|
|
97
99
|
import OrderNotification from "./OrderNotification.vue";
|
|
98
100
|
import ImportNotification from "./ImportNotification.vue";
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
export default defineAppModule({
|
|
103
|
+
notifications: {
|
|
104
|
+
OrderCreated: { template: OrderNotification, toast: { mode: "auto" } },
|
|
105
|
+
OrderStatusChanged: { template: OrderNotification, toast: { mode: "auto" } },
|
|
106
|
+
CatalogImportCompleted: { template: ImportNotification, toast: { mode: "auto" } },
|
|
107
|
+
},
|
|
104
108
|
});
|
|
105
109
|
```
|
|
106
110
|
|
|
107
|
-
When a notification's `notifyType` matches a registered template
|
|
111
|
+
When a notification's `notifyType` matches a registered template, that component is rendered instead of the default `NotificationTemplate`. See [NotificationTemplate](../notification-template/notification-template.docs.md) for the full recipe.
|
|
108
112
|
|
|
109
113
|
## Details
|
|
110
114
|
|
|
111
115
|
- **Unread tracking**: Notifications have an `isNew` flag. When the dropdown is mounted, it displays all notifications. On unmount (dropdown closes), all visible notifications are marked as read (`isNew = false`), which updates the unread badge count.
|
|
112
116
|
- **Reverse chronological order**: Notifications are displayed newest-first, sorted by their `created` timestamp.
|
|
113
|
-
- **SignalR integration**: Push notifications arrive via SignalR from the VirtoCommerce Platform
|
|
117
|
+
- **SignalR integration**: Push notifications arrive via SignalR from the VirtoCommerce Platform, delivered by the `signalR` plugin and ingested into the notification store; the dropdown renders from that store.
|
|
114
118
|
- **Scroll behavior**: The notification list is scrollable with a fixed maximum height to prevent the dropdown from growing beyond the viewport.
|
|
115
119
|
|
|
116
120
|
## Tips
|
|
117
121
|
|
|
118
122
|
- The dropdown shows all notifications, not just unread ones. Read notifications appear with reduced visual emphasis.
|
|
119
|
-
-
|
|
120
|
-
- For background task progress (e.g., catalog import),
|
|
123
|
+
- There is no clear-history API. `useNotificationStore()` exposes `markAllAsRead()` (flip everything to read) and `loadHistory(take?)` (reload the latest page from the server); neither deletes history.
|
|
124
|
+
- For background task progress (e.g., catalog import), the progress/completion concept keys off a `finished` flag on the notification payload. When a type is configured with a progress toast (`toast: { mode: "progress" }`), `ToastConfig.isComplete` reads that flag (default `(msg) => !!msg.finished`) to decide when the operation is done.
|
|
121
125
|
- The dropdown does not poll for new notifications -- they arrive in real time via SignalR. If the connection drops, a reconnection is attempted automatically.
|
|
122
126
|
|
|
123
127
|
## Related Components
|
package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md
CHANGED
|
@@ -9,7 +9,7 @@ internal: true
|
|
|
9
9
|
|
|
10
10
|
Base template for rendering a single push notification with title, relative timestamp, optional icon, and a default slot for extra detail content. This component provides the standard layout that all notification types share, while allowing domain-specific content to be injected through the default slot.
|
|
11
11
|
|
|
12
|
-
The template displays the notification title
|
|
12
|
+
The template displays the notification title and a timestamp — a relative "time ago" string for recent notifications (< 1 day, e.g., "3 minutes ago") or an absolute short date-time for older ones (>= 1 day) — and optionally a colored icon badge. Custom notification templates extend this base by wrapping it and filling the slot with type-specific content like progress bars, action buttons, or entity links.
|
|
13
13
|
|
|
14
14
|
## When to Use
|
|
15
15
|
|
|
@@ -38,13 +38,19 @@ const notification = computed(() => notificationRef.value);
|
|
|
38
38
|
|
|
39
39
|
## Key Props
|
|
40
40
|
|
|
41
|
-
| Prop | Type
|
|
42
|
-
| -------------- |
|
|
43
|
-
| `title` | `string`
|
|
44
|
-
| `notification` | `
|
|
45
|
-
| `icon` | `string`
|
|
46
|
-
| `color` | `string`
|
|
47
|
-
| `severity` | `string`
|
|
41
|
+
| Prop | Type | Default | Description |
|
|
42
|
+
| -------------- | ------------------ | ----------- | -------------------------------------------------------------- |
|
|
43
|
+
| `title` | `string` | -- | Notification headline text |
|
|
44
|
+
| `notification` | `PushNotification` | -- | Full notification object (required for timestamp) |
|
|
45
|
+
| `icon` | `string` | `undefined` | Icon name displayed in a circular badge |
|
|
46
|
+
| `color` | `string` | `undefined` | Background color for the icon badge |
|
|
47
|
+
| `severity` | `string` | `undefined` | Accepted but currently unused by the base template (reserved). |
|
|
48
|
+
|
|
49
|
+
## Events
|
|
50
|
+
|
|
51
|
+
| Event | Payload | Description |
|
|
52
|
+
| ------- | ------- | ------------------------------------ |
|
|
53
|
+
| `click` | -- | Emitted when the root row is clicked |
|
|
48
54
|
|
|
49
55
|
## Recipe: Custom Notification for Order Events
|
|
50
56
|
|
|
@@ -160,16 +166,16 @@ const isRunning = computed(() => (notification.value as any).isRunning ?? false)
|
|
|
160
166
|
|
|
161
167
|
## Details
|
|
162
168
|
|
|
163
|
-
- **
|
|
169
|
+
- **Timestamps**: For recent notifications (less than a day old) the template shows a relative "time ago" string via `Intl.RelativeTimeFormat` (e.g., "2 minutes ago", "1 hour ago"); for older notifications (>= 1 day) it falls back to an absolute short date-time via `Intl.DateTimeFormat` (`dateStyle: "short"`, `timeStyle: "short"`). It is computed once per render from the notification's created time and does not tick on a clock; it recomputes only when the notification data changes.
|
|
164
170
|
- **Icon badge**: When the `icon` prop is provided, it renders in a small circular badge with the specified `color` background. This helps users quickly identify notification types visually.
|
|
165
171
|
- **Default slot**: The slot content appears below the title and timestamp, providing space for description text, progress indicators, action links, or any custom content.
|
|
166
|
-
- **
|
|
172
|
+
- **Read state**: The base template renders no unread/read indicator — it has no `isNew`/read prop. Read-state styling, if any, is handled by the notification dropdown, not this template.
|
|
167
173
|
|
|
168
174
|
## Tips
|
|
169
175
|
|
|
170
176
|
- Use `useNotificationContext()` to access notification data. No props needed — the renderer provides the notification automatically.
|
|
171
177
|
- Use CSS custom property values for the `color` prop (e.g., `var(--success-500)`) to stay consistent with the active theme.
|
|
172
|
-
- The `severity` prop
|
|
178
|
+
- The `severity` prop is accepted but not yet consumed by the base template — it applies no color scheme. Use the `color` prop for the icon badge color.
|
|
173
179
|
- When creating custom templates, keep the slot content concise. The notification dropdown shows many items in a scrollable list, and overly tall notifications push others out of view.
|
|
174
180
|
|
|
175
181
|
## Related Components
|