Skip to content

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

  1. Install as developer dependency

    npm install -D @webprovisions-registry/alliance-app-notifications --registry https://registry.webprovisions.io
  2. 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

PropertyTypeRequiredDefaultDescription
headerstringYesConfirm modal header.
messagestringYesConfirm modal message.
denyLabelstringNo'Cancel'Confirm modal deny button label.
confirmLabelstringNo'OK'Confirm modal confirm button label.
requiredbooleanNofalseWhether closing of confirm through close button, clicking backdrop or escape key should be prohibited or not.

Result

PropertyTypeDescription
confirmedbooleanWhether 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

PropertyTypeRequiredDefaultDescription
messagestringYesNotification message.
headerstringYesNotification header.
type'success' | 'information' | 'warning' | 'error'No'information'Notification type.

Result

No returned result.

Managed Objects

No available managed objects.