Show the Welcome modal on the dashboard.
Feature Description
Determine data availability on the Key Metrics setup screen and show the Welcome modal on the dashboard.
For reference, see the Welcome modal in the Design Doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The Welcome modal is shown on the dashboard, presenting the dashboard tour or gathering data variant of its content as described in the AC for #11808.
- When the user clicks the Maybe later button, the close icon, or outside the modal:
- The modal is dismissed.
- Note that dismissing the dashboard tour variant should also dismiss the gathering data variant, ensuring it won't be shown if Analytics is subsequently connected and in the gathering data state.
- For the dashboard tour variant, a tooltip is shown pointing to the help menu with the following copy (see Figma):
- Content: You can always take the dashboard tour from the help menu
- Button label: Got it
- The modal is dismissed.
- The modal is only shown if the
setupFlowRefreshfeature flag is enabled.
Implementation Brief
See the implementation guide in the Design Doc for guidelines on how to implement this issue.
- [ ] Update
assets/js/components/DashboardMainApp.js- [ ] Check if
setupFlowRefreshis enabled - [ ] If it is, render the
WelcomeModalcomponent at the very end (right before</Fragment>)
- [ ] Check if
- [ ] Update
assets/js/components/WelcomeModal.tsx- [ ] Add a new state
[isOpen, setIsOpen]that defaults totrueand use it in theDialog'sopenprop - [ ] Add a new variable
dismissedItemSlug- If we're showing the gathering data variant (
showGatheringDataModalistrue), it should be "welcome-modal-gathering-data" - Otherwise "welcome-modal-with-tour"
- If we're showing the gathering data variant (
- [ ] Check if the current variant has already been dismissed using the
isItemDismissedselector fromCORE_USER. If it is dismissed, return an earlynull - [ ] Create a callback
dismissModalthat- Sets the
isOpenstate tofalse - Calls
dismissItemwithdismissedItemSlug - If we dismiss the tour version, also dismiss the gathering version ("welcome-modal-with-tour")
- Sets the
- [ ] Use
dismissModalas theonClickcallback forDialog'sonClose- The close button's
onClick - The "Get started" and "Maybe later" buttons'
onClick
- [ ] Add a new state
- [ ] Update
assets/js/components/key-metrics-setup/KeyMetricsSetupApp.js- [ ] In the
useEffectwhere synchronization happens, callisGatheringData()from bothMODULES_ANALYTICS_4andMODULES_SEARCH_CONSOLEstores to make sure the gathering state is resolved before landing on the dashboard
- [ ] In the
Test Coverage
- Update the
WelcomeModaltests to cover the dismissal behavior - Update the
KeyMetricsSetupApptests to cover theisGatheringDatacalls
QA Brief
Changelog entry
Thanks @abdelmalekkkkk, this IB is looking good. A couple of small points, I think we should:
- Put the feature flag condition for rendering the modal in
DashboardMainApprather than returningnullfromWelcomeModal, circumventing the render ofWelcomeModalentirely and avoiding unnecessary calls to the datastore and so forth. - Use
isOpenrather thanopenfor the boolean state value, to be consistent.
Thanks @techanvil. I made the two changes to the IB. Please take another look.
Thanks @abdelmalekkkkk, LGTM!
IB ✅
Hey @abdelmalekkkkk, I've just noticed that the IB doesn't cover this part of the AC. Please can you update it accordingly?
- For the dashboard tour variant, a tooltip is shown pointing to the help menu with the following copy (see Figma):
- Content: You can always take the dashboard tour from the help menu
- Button label: Got it