Skip to content
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

Prevent Selection Panel Info Notice from disappearing until two audiences are selected #8909

Closed
8 tasks
techanvil opened this issue Jun 19, 2024 · 7 comments
Closed
8 tasks
Labels
Module: Analytics Google Analytics module related issues P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Jun 19, 2024

Feature Description

In its initial implementation, the Selection Panel Info Notice will disappear when the user opens the Selection Panel with a single selected audience, and unchecks that audience.

This is not ideal, as the notice is intended to encourage the user to add a second audience to the selection, so it would be better to keep the notice visible until they have at least two audiences selected.


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

Acceptance criteria

  • The Selection Panel Info Notice should only appear when the Selection Panel is opened with a single saved audience in the selection (this is as per the initial implementation).
  • The notice should remain visible until at least two audiences are selected. It should not reappear if the user reduces the selection to a single audience while the selection panel remains open.
  • Once two audiences are selected the notice should disappear.

Implementation Brief

  • Within assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AddGroupNotice.js:
    • Replace the selectionChanges const, instead use the getValue selector to get the selected audiences passing AUDIENCE_SELECTION_FORM, AUDIENCE_SELECTED - this will return the list of currently selected audiences - call this selectedAudiences.
    • Create a new useState called twoOrMoreAudiencesSelected defaulting to false.
    • Create a useEffect watching changes on selectedAudiences:
      • If selectedAudiences is not an array, return early.
      • If selectedAudiences.length > 1, set twoOrMoreAudiencesSelected = true
    • Update the if statement that returns null to be: isDismissed || twoOrMoreAudiencesSelected.
  • Remove the now unused AUDIENCE_SELECTION_CHANGED form key and everywhere it's used/updated.

Test Coverage

  • No additional test are required.

QA Brief

  • Setup Site Kit with Analytics module
  • Enable groups
  • Open selection panel - by default when enabled, groupd will come with 2 audiences selected - verify that notice is not showing when 2 audiences are selected
  • Deselect one - verify that notice is not showing in this scenario
  • Save one audiences, and re-open the selection panel - verify that notice is showing until 2 are selected
  • If one is deselected again - notice should not appear immediately, but only on the next opening

Changelog entry

  • Update the audience segmentation notice that is displayed in selection panel to not disappear until two audiences are selected.
@techanvil techanvil added Module: Analytics Google Analytics module related issues P1 Medium priority Type: Enhancement Improvement of an existing feature labels Jun 19, 2024
@techanvil techanvil changed the title Prevent Selection Panel Info Notice from disappearing in the case where the user unchecks their single saved selected audience Prevent Selection Panel Info Notice from disappearing until two audiences are selected Jun 19, 2024
@benbowler benbowler self-assigned this Jun 24, 2024
@benbowler benbowler added the Team M Issues for Squad 2 label Jun 24, 2024
@benbowler benbowler removed their assignment Jun 24, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Jun 24, 2024

@techanvil Just to quickly confirm, what happens if the user unselects one of the audiences after they've selected two? Should the notice reappear? If not, the IB will need to be updated to address that behaviour. I'll write my IBR feedback based on your response, thank you!

@techanvil
Copy link
Collaborator Author

Thanks @nfmohit - I should have been more explicit in the AC. The not should indeed not reappear - I've updated the AC accordingly.

@techanvil techanvil removed their assignment Jun 25, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Jun 25, 2024

Thank you for the confirmation and amendment, @techanvil !

@benbowler Thank you for the IB. Let's update it to make sure the notice doesn't reappear when the user reduces their selection to one audience. We may be able to use a local state in conjunction with a useEffect to achieve this behaviour.

Also, could you also instruct to remove the AUDIENCE_SELECTED form key if it is no longer needed? It was only added for this component as far as I know.

@nfmohit nfmohit assigned benbowler and unassigned nfmohit Jun 25, 2024
@benbowler benbowler assigned nfmohit and unassigned benbowler Jun 26, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Jun 26, 2024

Thank you for the update, @benbowler . I think 3 as an estimate is quite steep here just in case an unexpected side-effect comes up. Do you think it might be worth increasing it by a notch just so we're safe?

@nfmohit nfmohit assigned benbowler and unassigned nfmohit Jun 26, 2024
@benbowler
Copy link
Collaborator

Good point, updated @nfmohit

@benbowler benbowler assigned nfmohit and unassigned benbowler Jun 27, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Jun 30, 2024

Thanks @benbowler ! IB LGTM 👍 ✅

@nfmohit nfmohit removed their assignment Jun 30, 2024
@binnieshah binnieshah added Team S Issues for Squad 1 and removed Team M Issues for Squad 2 labels Jul 23, 2024
@zutigrm zutigrm self-assigned this Aug 5, 2024
@zutigrm zutigrm mentioned this issue Aug 5, 2024
18 tasks
@zutigrm zutigrm removed their assignment Aug 5, 2024
@mohitwp mohitwp self-assigned this Aug 7, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Aug 7, 2024

QA Update ✅

  • Tested on main environment.
  • Verified The Selection Panel Info Notice s appear only when the Selection Panel is opened with a single saved audience in the selection (this is as per the initial implementation).
  • The notice remain visible until at least two audiences are selected. It not reappear if the user reduces the selection to a single audience while the selection panel remains open.
  • Verified Once two audiences are selected the notice gets disappear.
  • Verified If one is deselected again - notice not appear immediately, but only on the next opening.
Recording.1274.mp4

@mohitwp mohitwp removed their assignment Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Analytics Google Analytics module related issues P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants