site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Add the Audience Tile Error (Storybook)

Open techanvil opened this issue 1 year ago • 1 comments

Feature Description

Create the Audience Tile Error component and add it to Storybook.

See audience tiles > error states in the design doc.


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

Acceptance criteria

  • The Audience Tile Error component should be created and stories for it added to Storybook.
  • It should be implemented according to the Figma design.
  • The component should accept a list of errors as a prop.
    • If any of the errors is a permissions error, the "insufficient permissions" variant of the error notice will be shown (as mentioned in the design doc, including a Get help link and a Request access buttons.
    • Otherwise, the catch-all variant will be shown which just includes the Retry button.
      • Clicking the Retry button will retry whatever triggered the errors (i.e. it will invalidate the resolution for the selector associated with the errors).

Implementation Brief

  • [x] Add a new component /assets/js/modules/analytics-4/components/dashboard/AudienceSegmentation/AudienceTile/AudienceTileError.js with the prop errors, an array of errors.

    • [x] Add a function to check if any of the errors are insufficient permissions errors, hasInsufficientPermissionsError, as implemented for widget errors:
    • https://github.com/google/site-kit-wp/blob/6f01a837c2e815989235b1aabb0101f5b5ae3bb3/assets/js/components/ReportError.js#L103-L105
    • [x] If hasInsufficientPermissionsError is true:
      • [x] Render a Get help link linking to https://sitekit.withgoogle.com/documentation/troubleshooting/analytics/#insufficient-permissions
      • [x] Render a Request access button, which links to the serviceEntityAccessURL, resolved using the getServiceEntityAccessURL selector:
      • https://github.com/google/site-kit-wp/blob/6f01a837c2e815989235b1aabb0101f5b5ae3bb3/assets/js/components/ReportErrorActions.js#L57-L61
    • [x] If hasInsufficientPermissionsError is false, render a single Retry button which, when clicked, calls a retryErrors function as implemented for widget errors:
    • https://github.com/google/site-kit-wp/blob/6f01a837c2e815989235b1aabb0101f5b5ae3bb3/assets/js/components/ReportErrorActions.js#L103-L113
  • [x] Add assets/sass/components/analytics-4/audience-segmentation/_googlesitekit-audience-segmentation-tile-error.scss and apply the styles to match the Figma designs in the AC.

Test Coverage

  • Add AudienceTileError tests and stories.

QA Brief

  • View the storybooks for AudienceTileError, confirm they match designs and AC. Note: the Get Help link on the insufficient permissions story does not link to the full URL in the AC within the storybooks but will in use in the dashboard.

Changelog entry

techanvil avatar Feb 06 '24 10:02 techanvil

Looks good to me 👍🏻

IB ✅

tofumatt avatar Mar 20 '24 18:03 tofumatt

QA Update ❌

Tested on Storybook Story.

@benbowler In Figma text font family is 'Google Sans Text' and under Storybook implementation Font Family is 'Google Sans Display'.

Figma -

image

Storybook-

image

image

image

mohitwp avatar Apr 15 '24 13:04 mohitwp

QA Update ✅

  • Tested on Storybook Story.
  • Verified that text font family is now updated to 'Google Sans Text' as per Figma.
  • Verified storybook story with Figma design.

image

image

image

image

image

image

mohitwp avatar Apr 16 '24 13:04 mohitwp