k-phoen / backstage-plugin-announcements Goto Github PK
View Code? Open in Web Editor NEWAnnouncements plugin for Backstage
License: MIT License
Announcements plugin for Backstage
License: MIT License
Could there be different announcement types available like info
, warning
and error
that would then be rendered differently to catch more attention from the users?
Collating documents for announcements failed: ResponseError: Request failed with 404 Error type=plugin documentType=announcements
Stacktrace:
at async AnnouncementsClient.announcements (node_modules/@k-phoen/backstage-plugin-announcements-backend/dist/index.cjs.js:151:12)
[1] at async AnnouncementCollatorFactory.execute (node_modules/@k-phoen/backstage-plugin-announcements-backend/dist/index.cjs.js:171:21)
Package versions
"@k-phoen/backstage-plugin-announcements": "^0.1.0",
"@k-phoen/backstage-plugin-announcements-backend": "^0.2.0",
Currently only latest announcement is shown in the banner, could this be made configurable for the user to show multiple banners? Many times there can be several banners that should be shown at the same time.
title
and subtitle
as props to <AnnouncementsPage />
.At our company, we are trying to integrate this plugin into our Backstage instance. Overall, it looks really nice, thanks for the work!
However, we found something that might be interesting to others (or maybe am I misunderstanding how it works?). We wanted to use the NewAnnouncementBanner
as a kind of alert to be shown in every page. However, we expected this element to be like the AlertDisplay
provided by Backstage and not a component that moves down the whole page so it can fit on the top.
After making a couple changes in the css using the Firefox inspector (basically removing the "relative" property and adjusting spacing), I got something like this:
If you think this is something more people would like to have, I can create a PR with a new component and explain how it must be placed.
Hi @K-Phoen, first thanks for your excellent work with this plugin, this is very useful for broadcast information along an organization that uses backstage as devcenter. My suggestion here is creating a way to have an expiration date on announcements, so after some due date this will be expired and won't be displayed anymore
Deleting an announcement should trigger a modal (like it's with deleting an entity) asking if the deletion is really wanted and that it results in potential information loss
Our instance already has a configuration file that "dictates the rules" for accessing the Catalog.
Using this plugin, we are unsure whether to create a new file with the rules for it, or whether it is possible to include it in the existing file.
Hi there, thanks for creating this awesome plugin! Love that you can create announcements from the app itself. On that note, I was wondering if there was any way to disable the create / delete functionality so not every user can add or delete announcements.
Feature would be to be able to set URL where different announcements are shown. For example one could specify /catalog/*
for an announcement and then that announcement would only be shown when the user navigates to any catalog page. This would allow users to create announcements that are only for specific parts of the application.
Integrating the announcements with the alert-api by Backstage (core-plugin-api) would allow to display them at any view. This would not require a "home" page with a provided announcement widget to be used.
Is there any easy way to apply styles for NewAnnouncementBanner component?
Hi it seems the plugin is broken with backstage 1.13?
I get this issue when adding a card to my HomePage:
No implementation available for apiRef{plugin.announcements.service}
Hey guys, someone can explain me how to add the components to integrate announcement banner and announcements on page? Thanks!
The docs have the permissions group as a list so that it can be easily checked in a policy
Currently the onSubmit only displays an alert. As a user this may be confusing and cause a duplicate submission. It would be better if the onSubmit redirected to the Announcements page to show the user their card has been added.
After updating the Backstage version, we are receiving the following error after running yarn tsc
:
packages/backend/src/plugins/announcements.ts:12:5 - error TS2322: Type 'DatabaseService' is not assignable to type 'PluginDatabaseManager'.
The types returned by 'getClient()' are incompatible between these types.
Type 'Promise<import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex<any, any[]>>' is not assignable to type 'Promise<import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex<any, any[]>>'.
Type 'import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex<any, any[]>' is not assignable to type 'import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex<any, any[]>'.
The types of 'raw(...).transacting' are incompatible between these types.
Type '(trx: import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex.Transaction<any, any[]>) => import("/home/padupe/acme/backstage/node_modules/knex/types/index").Knex.Raw<any>' is not assignable to type '(trx: import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex.Transaction<any, any[]>) => import("/home/padupe/acme/backstage/node_modules/@k-phoen/backstage-plugin-announcements-backend/node_modules/knex/types/index").Knex.R...'.
Types of parameters 'trx' and 'trx' are incompatible.
Type 'Transaction<any, any[]>' is missing the following properties from type 'Transaction<any, any[]>': comment, except, havingNull, havingNotNull, updateFrom
12 database,
~~~~~~~~
node_modules/@k-phoen/backstage-plugin-announcements-backend/dist/index.d.ts:75:5
75 database: PluginDatabaseManager;
~~~~~~~~
The expected type comes from property 'database' which is declared here on type 'AnnouncementsContextOptions'
Found 1 error in packages/backend/src/plugins/announcements.ts:12
error Command failed with exit code 2.
O.S: Ubuntu 22.04
Backstage Version: 1.20.3
Node Version: 18.16.1
yarn backstage-cli versions:bump
yarn backstage-cli versions:bump --pattern '@k-phoen/backstage-plugin-announcements-backend'
Hi,
We are trying to integrate this plugin with our backstage announcement. WE want to keep the access to /announcements
route path limited to only certain team (kind:group).
Has anyone tried this or any suggestion on how this can be achieved?
I've been watching this repository for a while now and believe it has a lot of potential to impact Backstage.
There are many open issues and PRs pending review that include either good ideas or nice feature enhancements with little response from the maintainer.
What do you think about adding additional maintainers? I prefer to leverage and contribute to this repo instead of building our own internally.
Hello, the current documentation is not valid with this plugin.
Specifically, the setup markdown is outdated and has no examples of how to integrate with PermissionEvaluator
. (Truthfully I expected this integration to be optional, as the permission plugin is not published and marked experimental)
There doesn't appear to be any documentation for the permission plugin itself either, so there's very little in the way of usable documentation for the announcements
plugin at this time.
Please update the documentation with a working example. Thank you!
Hi,
I have a problem with announcements search integration. It seems that search factory is not able to build index cause by lacking of API endpoint exposed by router.
I had to add this code to make it work:
export default async function createPlugin({
logger,
database,
permissions,
}: PluginEnvironment): Promise<Router> {
const announcementsContext = await buildAnnouncementsContext({
logger: logger,
database: database,
permissions: permissions
});
const router = await createRouter(announcementsContext);
// TODO: seems that there is an error in plugin
router.get(
'/',
async (
req,
res,
) => {
const list = await announcementsContext.persistenceContext.announcementsStore.announcements({});
return res.json(list.results);
},
);
return router;
}
plugin version: "@k-phoen/backstage-plugin-announcements-backend": "^0.2.0",
Hi there, is it possible to have two distinct frontend announcement areas within the same portal?
announcements.ts
and announcements-product.ts
in backend/src/plugins
and<Route path="/announcements" element={<AnnouncementsPage />} />
<Route path="/product/announcements" element={<AnnouncementsPage />} />
apiRouter.use(...
I didn't check if the full link works, regardless, since AnnouncementsCard
takes no context input, I suspect it will look for only one backend source, and therefore making impossible to have two different announcement card areas, pulling from different databases, within the same page.
Instead of checking if the user has seen the announcement, some announcements could be made sticky to be shown every time.
It would be nice to broadcast the announcement created through this plugin to other communication tools like email, google spaces, and Slack channels.
My suggestion is to use backstage backend events to publish an event when an announcement is created. Then an event subscriber would handle the integration with the other communication tools.
Categorizing the announcements help to channelize the notifications in a large developer ecosystem
It would be nice to send out notification about newly created announcements, e.g. emails, slack, etc.
Below is a recording of what I am experiencing upon installation of the plugin inside of backstage.
https://vimeo.com/manage/videos/884063972/a8f1be9c5a?extension_recording=true
Any idea why?
Upgrading to the latest version I now get this error: backstage error Cannot read properties of undefined (reading 'authorize') type=errorHandler stack=TypeError: Cannot read properties of undefined (reading 'authorize')
broken on: "@k-phoen/backstage-plugin-announcements-backend": "^0.1.3",
working on: "@k-phoen/backstage-plugin-announcements-backend": "^0.0.5",
As best i can tell the permissions integration currently only exposes the name of the permission request, requiring all checks to be writtin into the policy. I believe allowing for this functionality would be useful. I would be willing to contribute it myself as well of course.
https://backstage.io/docs/permissions/custom-rules#provide-the-rule-during-plugin-setup
When clicking an annoucement in the AnnouncementsCard, then it works only when clicking directly on the title - but the cursor changes already earlier to a pointer, as well as the background color changes to grey, indicating that it can be clicked and this click triggers nothing.
How can I override styles of the Announcements plugin? Is there any way? Because right now it is only picking the primary color to display the header.
Hi!
thanks for the awesome plugin as it'll save us a considerable amount of time.
However, I am missing an announcementReadPermission, a read permission to the Announcements.
This would be helpful preventing guest users from creating/updating/deleting announcemnts, while still being able to view them.
Also, even if a user is not able to create new announcements, they would still be able to create categories. Would it be possible to link the announcementCreatePermission to the CategoriesPage element?
Another possible solution would be to expose the CategoriesPage so that the users of your plugin could attach any permissions they judge interesting...
Please let me know if I can help in any way! :)
I would like to ask the plug-in developer to change the displayed user field from name to title? Because the name value we are using now is the employee's job number, we cannot see the employee's name. And it also supports using title as the display name in backstage.
Thanks for the great plugin!
However, with updated dependencies "/announcements" crashes.
Error
useRoutes() may be used only in the context of a <Router> component.
Call Stack
invariant
node_modules/react-router/index.js:71:20
useRoutes
node_modules/react-router/index.js:675:35
Routes
node_modules/react-router/index.js:922:10
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js:14985:18
mountIndeterminateComponent
node_modules/react-dom/cjs/react-dom.development.js:17811:13
beginWork
node_modules/react-dom/cjs/react-dom.development.js:19049:16
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js:3945:14
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js:3994:16
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js:4056:31
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js:23959:7
useRoutes() may be used only in the context of a <Router> component.
In root package.json, add a resolution for react-router-dom:
{
"resolutions": {
"@types/react": "^17",
"@types/react-dom": "^17",
"@backstage/core-components": "^0.12.3",
"@backstage/backend-common": "^0.18.1",
"react-router-dom": "~6.3.0"
}
}
import { Routes, Route } from 'react-router';
in Router.tsx should be import { Routes, Route } from 'react-router-dom';
This likely may need to be split into multiple issues (and PRs), but it would be great to get dependencies updates for this plugin and have New Backend System support.
As it stands, this repo is also subject to GHSA-fpw7-j2hg-69v5
If I were to contribute Pull Requests, would they get any attention?
A user will receive a 500 error when attempting to create an announcement with an empty body.
Request failed with status 500 insert into "announcements" ("body", "created_at", "excerpt", "id", "publisher", "title") values ($1, $2, $3, $4, $5, $6) - null value in column "body" of relation "announcements" violates not-null constraint dd=[object Object] type=errorHandler pz=unknown env=unknown stage=unknown cluster=unknown length=308 name=error severity=ERROR code=23502 detail=Failing row contains (ef6e1602-513b-4a9d-aece-28b83416f73b, user:default/user, test, test, null, 2023-06-12 21:46:52.768+00). hint=undefined position=undefined internalPosition=undefined internalQuery=undefined where=undefined schema=public table=announcements column=body dataType=undefined constraint=undefined file=execMain.c line=1883 routine=ExecConstraints stack=error: insert into "announcements" ("body", "created_at", "excerpt", "id", "publisher", "title") values ($1, $2, $3, $4, $5, $6) - null value in column "body" of relation "announcements" violates not-null constraint
Would it be possible to get some metrics like total views on an announcement? That would really help to know how "successful" an announcement is.
Maybe showing X views at the bottom of the announcement
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.