Notifications
The Notifications app is designed to handle the display and management of notifications on the platform. With Notifications, other apps can easily generate and manage notifications for various purposes, such as error handling and confirmations. This app provides a unified interface for notifications, allowing for a streamlined and consistent user experience.
How to install
Install as developer dependency
npm install -D @webprovisions-registry/alliance-app-notifications --registry https://registry.webprovisions.io
Add app to your Alliance configuration file.
ts// alliance.config.ts import { defineConfig } from '@telia-ace/alliance-framework/config'; export default defineConfig({ server: { apps: ['@webprovisions-registry/alliance-app-notifications'], }, });
Capabilities
confirm
Displays a modal window to confirm a user action.
Example
ts
// app.ts
import { runCapability } from '@telia-ace/alliance-framework';
const { result } = runCapability('notifications', 'confirm', {
header: 'Delete',
message: 'Are you sure you want to delete this item?',
});
const { confirmed } = await result;
if (confirmed) {
// delete item
}
Args
Property | Type | Required | Default | Description |
---|---|---|---|---|
header | string | Yes | Confirm modal header. | |
message | string | Yes | Confirm modal message. | |
denyLabel | string | No | 'Cancel' | Confirm modal deny button label. |
confirmLabel | string | No | 'OK' | Confirm modal confirm button label. |
required | boolean | No | false | Whether closing of confirm through close button, clicking backdrop or escape key should be prohibited or not. |
Result
Property | Type | Description |
---|---|---|
confirmed | boolean | Whether the action was confirmed or not. |
notify
Displays a notification.
Example
ts
// app.ts
import { runCapability } from '@telia-ace/alliance-framework';
runCapability('notifications', 'notify', {
message: 'An item has been deleted.',
type: 'success',
});
Args
Property | Type | Required | Default | Description |
---|---|---|---|---|
message | string | Yes | Notification message. | |
header | string | Yes | Notification header. | |
type | 'success' | 'information' | 'warning' | 'error' | No | 'information' | Notification type. |
Result
No returned result.
Managed Objects
No available managed objects.