Skip to content

A4A: Show a banner based on agency approval status#97708

Merged
travisw merged 7 commits intotrunkfrom
add/a4a_show_banner_based_on_approval_status
Dec 27, 2024
Merged

A4A: Show a banner based on agency approval status#97708
travisw merged 7 commits intotrunkfrom
add/a4a_show_banner_based_on_approval_status

Conversation

@travisw
Copy link
Contributor

@travisw travisw commented Dec 20, 2024

Related to https://github.com/Automattic/automattic-for-agencies-dev/issues/1608
PT: pfunGA-3ie-p2

Proposed Changes

  • We're introducing the ability flag new agencies for review. This change show a banner based on that agency approval status.

Note: There's an existing issue for a layout bug when these banners are displayed on mobile screen sizes.

Why are these changes being made?

  • To better inform users about their approval status.

Testing Instructions

  • Also apply this backend PR (169166-ghe-Automattic/wpcom)
  • As described in the backend PR, update the blog option for your agency and test the values pending, approved, and rejected.
  • Test the following pages to make sure the banner is shown properly (/overview; /marketplace/hosting/wpcom - including hosting, products, and checkout pages; /sites; /purchases/payment-methods/add)

Pending

  • There should not be a close button shown
Screenshot 2024-12-20 at 1 48 49 PM

Rejected

  • There should not be a close button shown
  • The "contact us" link should open the contact form modal
Screenshot 2024-12-20 at 1 49 14 PM

Approved

  • You might need to hard code created_at field, as described in the backend PR if your agency is older than 1 week.
  • There should be a close button shown
  • After closing and refreshing the banner should not show again
  • On the backend hard code the created_at value to be older than 1 week. The banner should no longer be shown in this case
Screenshot 2024-12-20 at 1 48 02 PM

Note: You can clear the Calypso preference after closing the banner if need from the UI.

Screenshot 2024-12-20 at 1 43 35 PM

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@travisw travisw self-assigned this Dec 20, 2024
@github-actions
Copy link

github-actions bot commented Dec 20, 2024

@matticbot
Copy link
Contributor

matticbot commented Dec 20, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/a4a_show_banner_based_on_approval_status on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Dec 20, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~1716 bytes added 📈 [gzipped])

Details
name                          parsed_size           gzip_size
a8c-for-agencies-marketplace      +1978 B  (+0.2%)     +602 B  (+0.2%)
a8c-for-agencies-client           +1956 B  (+0.2%)     +585 B  (+0.2%)
a8c-for-agencies-purchases        +1858 B  (+0.2%)     +566 B  (+0.3%)
a8c-for-agencies-sites            +1855 B  (+0.1%)     +595 B  (+0.1%)
a8c-for-agencies-overview         +1855 B  (+0.2%)     +474 B  (+0.2%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@travisw travisw requested a review from a team December 20, 2024 23:29
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 20, 2024
Copy link
Contributor

@jkguidaven jkguidaven left a comment

Choose a reason for hiding this comment

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

Overall, it looks good. I have a few minor comments, but are non-blockers.

@travisw travisw force-pushed the add/a4a_show_banner_based_on_approval_status branch from bd7608b to d27fd97 Compare December 27, 2024 18:58
@travisw travisw added the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Dec 27, 2024
@a8ci18n
Copy link

a8ci18n commented Dec 27, 2024

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17081164

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @travisw for including a screenshot in the description! This is really helpful for our translators.

@travisw
Copy link
Contributor Author

travisw commented Dec 27, 2024

Thanks for the feedback @jkguidaven! I've made a couple small updates.

@travisw
Copy link
Contributor Author

travisw commented Dec 27, 2024

I'll merge this now. The banner won't ever show however until the backend PR has also been merged.

@travisw travisw merged commit 59ff523 into trunk Dec 27, 2024
@travisw travisw deleted the add/a4a_show_banner_based_on_approval_status branch December 27, 2024 20:13
@github-actions github-actions bot removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging labels Dec 27, 2024
@a8ci18n
Copy link

a8ci18n commented Dec 27, 2024

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17081164

Some locales (Hebrew) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @travisw for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Jan 8, 2025

Translation for this Pull Request has now been finished.

JessBoctor pushed a commit that referenced this pull request Mar 13, 2025
* show banner based on agency approval status

* only show close button for approved; add styles

* if status is approved only show banner for 1 week max

* cleanup

* add banner to sites and marketplace pages

* use CONTACT_URL_HASH_FRAGMENT, simply approval_status check

* also add notice to add payment method page
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