-
Notifications
You must be signed in to change notification settings - Fork 199
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
CSAT survey for Petition banner experiment(MNTOR-3224) #4775
Conversation
Preview URL 🚀 : https://blurts-server-pr-4775-mgjlpikfea-uk.a.run.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow the entire survey data logic yet, but nothing weird jumps out, and the rest looks good, and it works as intended, so
const hasDismissedDataPrivacyPetitionBanner = | ||
typeof Object.keys(cookies.getAll()).find((cookieName) => | ||
cookieName.includes("data_privacy_petition_banner"), | ||
) !== "undefined"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit fragile to me, in that it would break if either <PetitionBanner>
changes the key it passes to useLocalDismissal
, or if useLocalDismissal
changes the structure of the cookie name.
An alternative solution, I think, could be for <PetitionBanner>
to export a small wrapper hook:
export const usePetitionBannerDismissal = () => useLocalDismissal("data_privacy_petition_banner");
and then this component could re-use that hook and check its isDismissed
property?
Only if it's easy to do though, since I don't expect the above breakage to happen - it's just that I wouldn't dare rule it out either 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other question: should the local dismissal ID maybe include the user's subscriber ID? So that if multiple users use Monitor on the same device, one user dismissing it won't dismiss it for the other user? Edge case, but still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
): RelevantSurveyWithMetric | null => { | ||
const surveys = getRelevantSurveys({ ...surveyData, ...props }); | ||
|
||
if (!surveys || surveys?.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh nit, but the first leg already covers the ?
:
if (!surveys || surveys?.length === 0) { | |
if (!surveys || surveys.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
// so the user is not being flashed directly with a second banner after the | ||
// petition banner is being hidden. | ||
rerender(<ComposedDashboardComponent />); | ||
// The petition CSAT survey is only shown on the next visit of the dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, this was also confusing me a bit, so thanks for clarifying!
Cleanup completed - database 'blurts-server-pr-4775' destroyed, cloud run service 'blurts-server-pr-4775' destroyed |
References:
Jira: MNTOR-3224
Description
Adds the CSAT banner for the “Petition banner experiment” introduced by PR #4711.
How to test
Checklist (Definition of Done)