Frontend part of the notifications providing the Notifications API, Notifications page, left-side menu item and other REACT components.
npm install @marek.libra/backstage-plugin-notificationsThis Backstage front-end plugin provides:
- the Notifications page listing notifications from the logged-in user's perspective
- the NotificationsApi for accessing the notifications backend from front-end plugins
- an active item to the main left side menu to both notify the user about new messages and provide navigation to the Notifications page
- an alert about new system notifications
Have @janus-idp/plugin-notifications-backend installed and running.
```
cd packages/app
yarn add @janus-idp/plugin-notifications
In the packages/app/src/components/Root/Root.tsx:
`
import { NotificationsSidebarItem } from '@janus-idp/plugin-notifications';
...
export const Root = ({ children }: PropsWithChildren<{}>) => (
...
{/ New code: /}
{/ Existing code for reference: /}
In the packages/app/src/App.tsx:
`
import { NOTIFICATIONS_ROUTE, NotificationsPage } from '@janus-idp/plugin-notifications';
...
export const AppBase = () => {
...
{/ New code: /}
`
`
import { notificationsApiRef, Notification } from '@janus-idp/plugin-notifications';
...
const notificationsApi = useApi(notificationsApiRef);
const notifications: Notification[] = await notificationsApi.getNotifications(params);
`
See src/api/notificationsApi.ts` for more details.