backstage-plugin-announcements icon indicating copy to clipboard operation
backstage-plugin-announcements copied to clipboard

🚀 Feature: Ability to set a replacement for "Announcement" button in AnnouncementsPage Props

Open billabongrob opened this issue 10 months ago • 3 comments

🔖 Feature description

The plugin currently allows for the customization of the title, subtitle and categories on AnnouncementsPageProps.
It would be nice if we can modify what the button would say.

🎤 Context

In our case, we're using multiple routes to serve certain announcements - for instance - "Training", "Team Lunch" etc... Currently, button says "New Announcement" - but it would be cool to override this with New - $thing. Would probably look to the Categories for inspiration, but even then things may not align.

✌️ Possible Implementation

No response

👀 Have you spent some time to check if this feature request has been raised before?

  • [X] I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

billabongrob avatar Apr 19 '24 17:04 billabongrob

Hey @billabongrob, this change is fine, but it has me thinking. The functionality missing here is the ability to manage and create announcements from any page of your choice. Therefore, it sounds like you are importing many versions of the <AnnouncementsPage />, overwriting the button name, and doing some filtering. Does that sound right?

If so, this seems like a stopgap when we should decouple announcements so you can create and display them anywhere.

kurtaking avatar Apr 26 '24 13:04 kurtaking

Right now, I've created routes for each. I've used the <AnnouncementsPage /> within them. Then just added them as a Nav bars on the side. Here's an example of what my use case looks like.
Screenshot 2024-04-26 at 10 02 27 AM

billabongrob avatar Apr 26 '24 16:04 billabongrob

Right now, I've created routes for each. I've used the <AnnouncementsPage /> within them. Then just added them as a Nav bars on the side. Here's an example of what my use case looks like. Screenshot 2024-04-26 at 10 02 27 AM

This is an interesting use of the plugins. My one concern is that you will continue to need to override to fit your unique use case.

My approach for this would be to create some training plugin (plugin-training) where different options (plugin-training-module-*)s need to show announcements based on a category. Use the AnnouncementsApi.announcements from announcements-react to get the announcements for said training module. You would then supply your own <Button /> that is wired up to AnnouncementsApi.createAnnouncement.

Or, make it slightly easier and we could provide additional components such as <AnnouncementsGrid /> and/or <AnnouncementsList />.

kurtaking avatar Apr 29 '24 02:04 kurtaking

@billabongrob are we good to close this?

kurtaking avatar May 10 '24 16:05 kurtaking

All good @kurtaking Thanks!

billabongrob avatar May 10 '24 17:05 billabongrob