Skip to content

Resubmitting Key Metrics makes the Welcome Modal appear with the wrong variant #12477

@abdelmalekkkkk

Description

@abdelmalekkkkk

Bug Description

When submitting the Key Metrics for the first time after setup, we get redirected to the dashboard and the Welcome Modal is displayed, as expected. But if we dismiss the modal then go back and submit the answers again, the Welcome Modal is displayed again with the DATA_GATHERING_COMPLETE variant.

Steps to reproduce

  1. Set up Site Kit with Analytics and setupFlowRefresh enabled
  2. Submit Key Metrics answers
  3. After landing on the dashboard, dismiss the Welcome Modal, then go back and resubmit Key Metrics
  4. Notice that the Welcome Modal is displayed again in the wrong variant

Screenshots

Additional Context

  • PHP Version:
  • OS: [e.g. iOS]
  • Browser: [e.g. chrome, safari]
  • Plugin Version: [e.g. 22]
  • Device: [e.g. iPhone6]

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

Acceptance criteria

  • When the Welcome Modal is dismissed, redoing the Key Metrics setup should not cause the Welcome Modal to appear again.

Implementation Brief

  • In assets/js/components/WelcomeModal.tsx
    • Add a small helper function shouldRenderModalVariant to return a boolean value, it should include this current condition also add a condition where it should return false if isDataGatheringCompleteModalActive is false and modalVariant is data gathering complete variant.
    • Call this helper from inside the component and return null if it returns false.

Test Coverage

  • Add tests for this behaviour in WelcomeModal.test.tsx

QA Brief

  1. Set up Site Kit with Analytics and setupFlowRefresh enabled
  2. Submit Key Metrics answers
  3. After landing on the dashboard, dismiss the Welcome Modal, then go back and resubmit Key Metrics
  4. When landing back on Dashboard, the modal should not reappear.

Changelog entry

  • Fix Welcome Modal reappearing after dismissing and resubmitting Key Metrics answers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam MIssues for Squad 2Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions