Skip to content
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

Tile title and messaging for Top earning pages #10158

Open
1 task
zutigrm opened this issue Feb 3, 2025 · 1 comment
Open
1 task

Tile title and messaging for Top earning pages #10158

zutigrm opened this issue Feb 3, 2025 · 1 comment
Labels
P2 Low priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@zutigrm
Copy link
Collaborator

zutigrm commented Feb 3, 2025

Feature Description

When AdSense is not connected, but it's metric is included as part of the tailored metrics (like for Sell products site purpose), the tile should be updated to include the metric title, and description should be changed to Adsense is disconnected, metric can't be displayed

Image

Originally reported during bug bash in this Asana ticket


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

Acceptance criteria

  • When AdSense is not connected, but it's metric is included as part of the tailored metrics and the connect module tile appears in the dashboard:
    • The tile title is included (Top earning pages in this case)
    • Description text above CTA is Adsense is disconnected, metric can't be displayed (when AdSense related metric is present)
  • This shouldn't be limited only to the AdSense KMW we should implement future proof solution that shows this layout in connect module tile in general, whenever a single metric is shown and it's module is disconnected

Implementation Brief

  • Update assets/js/components/KeyMetrics/ConnectModuleCTATile.js
    • Retrieve the widgets
      const widgets = useSelect(
      ( select ) =>
      select( CORE_WIDGETS ).getWidgets(
      AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY
      ) || []
      );
    • Retrieve currently selected key metrics using getKeyMetrics selector from CORE_USER datastore
    • Loop through selected metrics, and map a new array, by:
      • Filtering selected metrics from retrieved widgets
      • Filtering the metrics by modules property, (it will look like [ 'analytics' ]), so only the ones associated with current module are retrieved. You can use moduleSlug prop already passed to the component for the matching
    • Count the retrieved KMW associated with the module, and if:
      • There is more than 1, keep the current layout
      • If there is only 1 metrics, Include MetricTileHeader component, just bellow the main div wrapper, and pass it the title and tooltip content, which can be extracted from KEY_METRICS_WIDGETS object, using the metric slug
        • Instead of current copy %s is disconnected, some of your metrics can’t be displayed, render %s is disconnected, metric can't be displayed
  • Add any style needed in assets/sass/components/key-metrics/_googlesitekit-km-connect-module-cta-tile.scss

Test Coverage

  • Update failing VRT

QA Brief

Changelog entry

@zutigrm zutigrm added P2 Low priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature labels Feb 3, 2025
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Feb 3, 2025
@eugene-manuilov eugene-manuilov self-assigned this Feb 5, 2025
@eugene-manuilov
Copy link
Collaborator

IB ✔

@eugene-manuilov eugene-manuilov removed their assignment Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Low priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants