site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Audience Selection Panel rendered before the feature has been set up

Open wpdarren opened this issue 1 year ago • 4 comments

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

  • If the Audience Segmentation feature has not yet been set up for the current user, the Audience Selection Panel should not be rendered into the DOM.

Implementation Brief

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

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

Test Coverage

  • No new tests needed.

QA Brief

  • Set up Site Kit with the audienceSegmentation feature flag enabled, and Analytics connected to a property that is out of the gathering data state.
  • Verify that the Audience Selection Panel is not rendered into the DOM. Check for the presence of an element with the class .googlesitekit-audience-selection-panel as seen in the screenshot in the Feature Description. This should not be present.
  • Click on Enable groups to set up the Audience Segmentation feature.
  • Verify that the Audience Selection Panel is now rendered into the DOM.

Changelog entry

  • Prevent rendering of the Audience Selection Panel before the feature is set up, ensuring it only renders after setup is complete.

wpdarren avatar Oct 08 '24 09:10 wpdarren

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?

nfmohit avatar Oct 14 '24 20:10 nfmohit

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

techanvil avatar Oct 14 '24 23:10 techanvil

IB ✅

nfmohit avatar Oct 15 '24 04:10 nfmohit

QA Update ✅

Verified good as per below. Moving ticket to approval.

  • Before the audience tiles were set up, the class .googlesitekit-audience-selection-panel appeared under the 'latest release' branch.

    Image

  • When switched to 'develop' Branch, the class .googlesitekit-audience-selection-panel disappeared.

    Image

  • Under develop Branch, after the audience tiles were set up, the class .googlesitekit-audience-selection-panel now appeared.

    https://github.com/user-attachments/assets/e0b67570-f1ab-4272-9038-f878fe29a1d7

kelvinballoo avatar Oct 24 '24 19:10 kelvinballoo