Skip to content

🐛 announcements: NewAnnouncementBanner triggers at creation regardless of being an active announcement #5235

@Vikosh1st

Description

@Vikosh1st

Workspace

announcements

📜 Description

It appears that the NewAnnouncementBanner component is triggered solely by the creation of a new announcement, regardless of its active or inactive status. The active prop passed to the component do not seem to influence its visibility. Additionally, updating an existing announcement’s active status after creation has no effect on whether the banner is shown again or not, and further more, with the last changes, it also seems that you can only perform an update when the category exists, but that has already been raised on the PR.

1st Issue: active prop not working on the NewAnnouncementBanner - it seems that the backend receives the value 'true' as a string and not a boolean, as it should have been;
2nd issues: The NewAnnouncementBanner is triggered based on the lastSignal data sent when an announcement is created, however, the signal should also be triggered on update as well, so that the banner will show when an update (switch from inactive status to active) has been performed.

This was clearly not the intended functionality, since the signal is only sent on the creation api, and if the announcement was just created, then it couldn't have been seen by the user, so no need for the extra filter.
https://github.com/backstage/community-plugins/blob/main/workspaces/announcements/plugins/announcements/src/components/NewAnnouncementBanner/NewAnnouncementBanner.tsx#L152

I can conditionally render the banner depending on the lastSignal.data.active value, however, this will only fix our 1st issue. Unfortunately, I cannot identify any temporary fix for the 2nd issue.

👍 Expected behavior

When creating a new announcement with inactive status, the banner should not be shown, and at a later date when the announcement status is edited and becomes active, at least for the first time, the banner should be displayed.

👎 Actual Behavior with Screenshots

When creating a new announcement with inactive status, the banner is immediately shown, even though the active prop is set to true, and the announcement in question might also be hidden in the AnnouncementsPage with the hideInactive={true} prop and the AnnouncementsCard with the active={true} prop. Also, the banner is not shown at all when I create an inactive announcement and then update it's status to active.

👟 Reproduction steps

  1. Make sure the banner has the active={true} prop <NewAnnouncementBanner active />
  2. Create an inactive announcement and confirm that the banner is shown regardless of the prop set
  3. If the active and hideInactive props are set to the AnnouncementsCard and AnnouncementsPage, the newly created announcement will not be visible
  4. Edit the same announcement and set status to active (make sure category is added), and the banner will no be shown again

📃 Provide the context for the Bug.

We're trying to implement the announcement plugin in order to inform the users of the changes that we release with each version of the application. The expectation for the inactive status would be to not show the banner and make the information available to the user only when the announcement is ready and becomes active. With the current implementation, the announcement will have to be created shortly after each release so that all users will be informed of the changes, always with an active status which is not the default in the form.

An additional improvement suggestion would be around the Start date for each announcement, as we expected that the banner will become visible and the announcement active, automatically on the specified start date, but later found that the start date is just shown or hidden in the announcement cards, just for user awareness.

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

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingworkspace/announcementsUsed to tag announcements workspace isses and pull requests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions