Skip to content

KM banner setup cancelled but banner shows up again #11171

@kelvinballoo

Description

@kelvinballoo

Bug Description

I tried to test for the Key Metrics banner.
Once initiated, if I cancel the setup, the banner would appear again.

This contradicts the behaviour of other banners where they don't re-appear.
This issue originated from #10961

Steps to reproduce

  1. Set up Site Kit
  2. Click 'Get tailored metrics' on the KM setup banner.
  3. Cancel the setup on the first step
  4. On the dashboard, the KM setup banner would appear again.

Screenshots

Details https://github.com/user-attachments/assets/5fecfae4-1183-42aa-bbfa-232a95064e49

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

Acceptance criteria

  • When either the "Get tailored metrics" or "Select your own metrics" CTA is clicked, the KMW banner should not reappear on the next dashboard load/visit.

Implementation Brief

  • Update assets/js/components/KeyMetrics/KeyMetricsSetupCTAWidget.js
    • Update openMetricsSelectionPanel and onGetTailoredMetricsClick to invoke and await dismissItem action, with KEY_METRICS_SETUP_CTA_WIDGET_SLUG passed for item slug before navigating.

Test Coverage

  • Update existing test assets/js/components/KeyMetrics/KeyMetricsSetupCTAWidget.test.js to verify that clicking either of the updated buttons invokes the dismiss request

QA Brief

"Get Tailored Metrics" button test

  • Set up Site Kit
  • Click "Get tailored metrics" on the Key Metrics setup banner
  • Cancel the setup on the first step and navigate back to the Site Kit dashboard
  • The Key Metrics setup banner should not appear

"Select your own metrics" link test

  • Set up Site Kit
  • Click the "Select your own metrics" link on the Key Metrics setup banner
  • Cancel the setup/navigate back to the Site Kit dashboard
  • The Key Metrics setup banner should not appear

Changelog entry

  • Fix the Key Metrics banner issue that caused it to re-appear even after canceling it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priorityTeam SIssues for Squad 1Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions