-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Part of #2460
As a merchant, I want to know if my Ads account has been suspended so that I can correct the issues so I can continue getting visibility of my products to drive more sales.

We'll also update the Paid Ads card on the dashboard to show that the account is suspended:

Acceptance Criteria
- When an Ads account is marked as suspended, show a dismissible error notice on the plugin screen above the tabs
- The notice should persist across all tabs in the plugin screens
- The notice should stop showing for the logged in user once it's been dismissed
- Clicking the Resolve Issues link should take the user to the [TK URL]
- Once the account is no longer suspended, the notice should disappear
- If the ads account is suspended. The Paid Ads card on the dashboard should include "(Suspended)" in the title of the card (see design)
Implementation Brief
Create a new component called AdsAccountSuspended
that exports a <Notice status="error" isDismissible={ true }>
component with the text and CTA button from the designs. The component should check for the account status returned from the ads/connection
response to see if it's suspended (details to follow).
If the account is suspended, return the notice, otherwise return null. Import the component into the Dashboard, Reports, ProductFeed, and Reports pages listed in /js/src/index.js
. and display the component above the <MainTabNav />
component.
To add the suspended status to the ads/connection
response, we'll update the AdsAccountQuery
to include the 'customer.status' field. Add the status returned from that query to the array returned by Ads::get_account_details()
, which will need to be made public so it can be accessed from the Ads\AccountService::get_connected_account()
callback used by the API, so suspended can be returned as the 'status' when applicable.
To avoid calling the Google Ads API on each REST API request, we'll cache the customer status in a transient for HOUR_IN_SECONDS
.
Test Coverage
- Update the PHPUnit tests
- Update the E2E tests