Open techanvil opened 1 week ago
@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!
Thanks @nfmohit - I should have been more explicit in the AC. The not should indeed not reappear - I've updated the AC accordingly.
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.
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?
Good point, updated @nfmohit
Thanks @benbowler ! IB LGTM 👍 ✅
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
Implementation Brief
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AddGroupNotice.js
:selectionChanges
const, instead use thegetValue
selector to get the selected audiences passingAUDIENCE_SELECTION_FORM, AUDIENCE_SELECTED
- this will return the list of currently selected audiences - call thisselectedAudiences
.useState
calledtwoOrMoreAudiencesSelected
defaulting tofalse
.useEffect
watching changes onselectedAudiences
:selectedAudiences
is not an array, return early.selectedAudiences.length > 1
, settwoOrMoreAudiencesSelected
= trueisDismissed || twoOrMoreAudiencesSelected
.AUDIENCE_SELECTION_CHANGED
form key and everywhere it's used/updated.Test Coverage
QA Brief
Changelog entry