{"_id":"@batzionrotman123/plugin-notifications","name":"@batzionrotman123/plugin-notifications","dist-tags":{"latest":"1.0.0-redhat-0001"},"versions":{"1.0.0-redhat-0001":{"name":"@batzionrotman123/plugin-notifications","description":"Frontend part of the notifications providing the Notifications API, Notifications page, left-side menu item and other REACT components.","version":"1.0.0-redhat-0001","main":"src/index.ts","types":"src/index.ts","license":"Apache-2.0","publishConfig":{"access":"public","main":"dist/index.esm.js","types":"dist/index.d.ts"},"backstage":{"role":"frontend-plugin"},"scripts":{"start":"backstage-cli package start","build":"backstage-cli package build","export-dynamic":"janus-cli package export-dynamic-plugin","lint":"backstage-cli package lint","test":"backstage-cli package test --passWithNoTests --coverage","clean":"backstage-cli package clean","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack","tsc":"tsc","openapi:generate":"openapi-generator-cli generate -i ../notifications-backend/src/openapi.yaml --enable-post-process-file -g typescript-fetch -o ./src/openapi && find ./src/openapi -name '*.ts' -exec sed  -i '1i // @ts-nocheck' {} \\;"},"dependencies":{"@backstage/core-components":"^0.14.0","@backstage/core-plugin-api":"^1.9.0","@backstage/theme":"^0.5.1","@material-table/core":"^3.1.0","@material-ui/core":"^4.9.13","@material-ui/icons":"^4.11.3","@material-ui/lab":"^4.0.0-alpha.45","@mui/material":"^5.12.2","lodash":"^4.17.21","react-relative-time":"^0.0.9","react-use":"^17.4.0"},"peerDependencies":{"react":"^16.13.1 || ^17.0.0 || ^18.2.0","react-router-dom":"^6.11.2"},"devDependencies":{"@backstage/cli":"0.25.2","@backstage/core-app-api":"1.12.0","@backstage/dev-utils":"1.0.27","@backstage/test-utils":"1.5.0","@janus-idp/cli":"1.7.5","@openapitools/openapi-generator-cli":"2.7.0","@testing-library/jest-dom":"6.4.2","@testing-library/react":"14.2.1","@testing-library/user-event":"14.5.1","@types/node":"*","msw":"1.3.2"},"scalprum":{"name":"janus-idp.backstage-plugin-notifications","exposedModules":{"NotificationsPlugin":"./src/index.ts"}},"repository":{"type":"git","url":"git+https://github.com/janus-idp/backstage-plugins.git"},"keywords":["backstage","plugin"],"homepage":"https://janus-idp.io/","bugs":{"url":"https://github.com/janus-idp/backstage-plugins/issues"},"_id":"@batzionrotman123/plugin-notifications@1.0.0-redhat-0001","gitHead":"2b4faadd43df8c740444d83a7efac955cf443922","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-DNHmjYqcAze/dATWrBo29fEy+LzG4HQPbZnaP5e0HEtoo+kxgzRtoGuLW06Fgfu59Ry8f9vi3/GKwwPZZASbhQ==","shasum":"49a5185ce4a43a084bdb67b1e94f012d88e0daaf","tarball":"https://registry.npmjs.org/@batzionrotman123/plugin-notifications/-/plugin-notifications-1.0.0-redhat-0001.tgz","fileCount":433,"unpackedSize":13927018,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFQKbAYQf1C9foJFjD7ZMADj2edy1q9uwHRfWc1bRd78AiACYuwTzDmpKWijGwDE35rLnrhQ+9qvtV67VhFS8a0+Jw=="}]},"_npmUser":{"name":"batzionrotman123","email":"batzionrotman@gmail.com"},"directories":{},"maintainers":[{"name":"batzionrotman123","email":"batzionrotman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-notifications_1.0.0-redhat-0001_1711886261420_0.5022943949886198"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-31T11:57:41.322Z","1.0.0-redhat-0001":"2024-03-31T11:57:41.665Z","modified":"2024-03-31T11:57:41.921Z"},"maintainers":[{"name":"batzionrotman123","email":"batzionrotman@gmail.com"}],"description":"Frontend part of the notifications providing the Notifications API, Notifications page, left-side menu item and other REACT components.","homepage":"https://janus-idp.io/","keywords":["backstage","plugin"],"repository":{"type":"git","url":"git+https://github.com/janus-idp/backstage-plugins.git"},"bugs":{"url":"https://github.com/janus-idp/backstage-plugins/issues"},"license":"Apache-2.0","readme":"# Notifications\n\nThis Backstage front-end plugin provides:\n\n- the `Notifications` page listing notifications from the logged-in user's perspective\n- the NotificationsApi for accessing the notifications backend from front-end plugins\n- an active item to the main left side menu to both notify the user about new messages and provide navigation to the Notifications page\n- an alert about new system notifications\n\n## Getting started\n\n### Prerequisities\n\nHave `@janus-idp/plugin-notifications-backend` installed and running.\n\n## Installing as a dynamic plugin\n\nThe sections below are relevant for static plugins. If the plugin is expected to be installed as a dynamic one:\n\n- follow https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/dynamic-plugins.md#installing-a-dynamic-plugin-package-in-the-showcase\n- add content of `app-config.janus-idp.yaml` into `app-config.local.yaml`.\n- customize configuration configure as needed\n\n### Configuration\n\nThere is polling used to check for new notifications. It can be tuned via `pollingIntervalMs` config property (see `app-config.janus-idp.yaml`). When set to 0, the polling is turned off.\n\n## Installing as a static plugin\n\n### Add NPM dependency\n\n```\ncd packages/app\nyarn add @janus-idp/plugin-notifications\n```\n\n### Add left-side menu item\n\nIn the `packages/app/src/components/Root/Root.tsx`:\n\n```\nimport { NotificationsActiveIcon } from '@janus-idp/plugin-notifications';\n\n...\nexport const Root = ({ children }: PropsWithChildren<{}>) => (\n    ...\n      {/* New code: */}\n      <SidebarDivider />\n      <SidebarItem icon={NotificationsActiveIcon} to=\"notifications\" text=\"Notifications\" />\n\n      {/* Existing code for reference: */}\n      <SidebarSpace />\n      <SidebarSpace />\n      <SidebarDivider />\n      <SidebarDivider />\n      <SidebarGroup\n        <SidebarGroup label=\"Settings\"\n```\n\n### Add to router\n\nIn the `packages/app/src/App.tsx`:\n\n```\nimport { NotificationsPage } from '@janus-idp/plugin-notifications';\n...\n\nexport const AppBase = () => {\n    ...\n      {/* New code: */}\n      <Route path=\"/notifications\" element={<NotificationsPage />} />\n```\n\n## How to use the NotificationApi\n\nOnce installed as either static or dynamic plugin, a 3rd party frontend plugin can access the notifications via its frontend API:\n\n```\nimport { notificationsApiRef, Notification } from '@janus-idp/plugin-notifications';\n\n...\n\nconst notificationsApi = useApi(notificationsApiRef);\nconst notifications: Notification[] = await notificationsApi.getNotifications(params);\n\n```\n\nSee `src/api/notificationsApi.ts` for more details.\n","readmeFilename":"README.md"}