Skip to content

Fix: Remove CampaignWelcomeBanner script and update admin-notices package #8006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 16, 2025

Conversation

JoshuaHungDinh
Copy link
Contributor

@JoshuaHungDinh JoshuaHungDinh commented Jul 7, 2025

Resolves GIVE-2599

Description

The current welcome banner is rendering immediately after the wp-header-end element in an attempt to fix a layout issue on the plugins page. However, since other plugins may also use an element with the same class, the banner can end up being injected into unintended areas of the UI, causing layout conflicts. This PR removes the related JS file that handles the replacement and its webpack config. The necessary changes to handle the placement have been made in the AdminNotices package & our composer files have been updated.

A hover state was also added the to main CTA of the banenr.

Affects

Campaigns Welcome Banner

Visuals

Screenshot 2025-07-07 at 12 46 40 PM

Testing Instructions

  • Load the banner\
  • Verify it is rendered after the "Add Plugin" link on the Plugins page
  • Ensure it does not render in any other context ex. TEC plugin

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@JoshuaHungDinh JoshuaHungDinh marked this pull request as ready for review July 7, 2025 19:36
@JoshuaHungDinh JoshuaHungDinh changed the title Fix: create container to render CampaignWelcomeBanner into Fix: update targeted element to render CampaignWelcomeBanner Jul 7, 2025
@JoshuaHungDinh JoshuaHungDinh changed the title Fix: update targeted element to render CampaignWelcomeBanner Fix: Render CampaignWelcomeBanner into new targeted element Jul 7, 2025
@jonwaldstein
Copy link
Contributor

@JoshuaHungDinh what's the reason that we need JS to render the element? We've been able to display other notices that appear after the add plugins button so just curious why this isn't going into the expected area.

@JoshuaHungDinh
Copy link
Contributor Author

@jon, It can be placed in a couple of locations through the package. The closest being after the h1 below_header- but on the plugins page there is the "Add plugin" button also. So it places it between the two.
https://github.com/stellarwp/admin-notices/blob/main/src/resources/admin-notices.js

@jonwaldstein
Copy link
Contributor

@JoshuaHungDinh ohh I see - so maybe that actually should be accounted for in the admin notices package because that's a common scenario and this doesn't quite work as expected.

@JasonTheAdams what do you think about having the admin notice package take the "add plugin" button into consideration when choosing below_header as the placement? this is the problem we are running into that I don't think we should have to worry about from the implementation side. Curious what you think 😄

@JasonTheAdams
Copy link
Contributor

Ah yeah, sounds like an edge case AdminNotices isn't taking into consideration. I recommend making a patch in that package. I'll be happy to review the PR!

@JoshuaHungDinh
Copy link
Contributor Author

Reference: stellarwp/admin-notices#14

@JoshuaHungDinh JoshuaHungDinh changed the title Fix: Render CampaignWelcomeBanner into new targeted element Fix: Remove CampaignWelcomeBanner script and update admin-notices package Jul 11, 2025
Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jonwaldstein jonwaldstein merged commit 90434e7 into develop Jul 16, 2025
24 checks passed
@jonwaldstein jonwaldstein deleted the fix/campaigns-welcome-modal branch July 16, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants