google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.24k stars 287 forks source link

Audience Selection Panel rendered before the feature has been set up #9475

Open wpdarren opened 1 week ago

wpdarren commented 1 week ago

Bug Description

Issue discovered during bug bash. Asana task here

The Audiences Selection Panel component is rendered into the DOM before the feature has been set up.

I spotted this when I noticed that a request to sync-audiences is made when landing on the dashboard prior to the Audience Segmentation Setup CTA Banner being displayed and actioned.

We should not be rendering the selection panel at all prior to the feature being set up.

Screenshots image.png image.png

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

https://github.com/google/site-kit-wp/blob/3ff3c69cce3f17ec310f57e0a3cfe8aebe2e2759/assets/js/components/DashboardMainApp.js#L297

Test Coverage

QA Brief

Changelog entry

nfmohit commented 3 days ago

Thank you for drafting the IB, @techanvil !

  • In the DashboardMainApp component, retrieve configuredAudiences via the getConfigurableAudiences() selector. Extend the condition for rendering AudienceSelectionPanel to include a check for configuredAudiences being truthy.

Just to confirm, did you mean the core/user getConfiguredAudiences selector instead?

techanvil commented 3 days ago

Thanks for spotting that, @nfmohit! It was indeed a typo, which I've fixed. Back to you for another pass :)

nfmohit commented 2 days ago

IB ✅