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

Add the Audience Tile Error (Storybook) #8228

Closed
7 tasks done
techanvil opened this issue Feb 6, 2024 · 3 comments
Closed
7 tasks done

Add the Audience Tile Error (Storybook) #8228

techanvil opened this issue Feb 6, 2024 · 3 comments
Labels
Module: Analytics Google Analytics module related issues P1 Medium priority Squad 1 (Team S) Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Feb 6, 2024

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

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

    • Add a function to check if any of the errors are insufficient permissions errors, hasInsufficientPermissionsError, as implemented for widget errors:
    • const hasInsufficientPermissionsError = errors.some( ( err ) =>
      isInsufficientPermissionsError( err )
      );
    • If hasInsufficientPermissionsError is true:
      • Render a Get help link linking to https://sitekit.withgoogle.com/documentation/troubleshooting/analytics/#insufficient-permissions
      • Render a Request access button, which links to the serviceEntityAccessURL, resolved using the getServiceEntityAccessURL selector:
      • const requestAccessURL = useSelect( ( select ) =>
        typeof select( storeName )?.getServiceEntityAccessURL === 'function'
        ? select( storeName ).getServiceEntityAccessURL()
        : null
        );
    • If hasInsufficientPermissionsError is false, render a single Retry button which, when clicked, calls a retryErrors function as implemented for widget errors:
    • const handleRetry = useCallback( () => {
      retryableErrors.forEach( ( err ) => {
      const { selectorData } = err;
      dispatch( selectorData.storeName ).invalidateResolution(
      selectorData.name,
      selectorData.args
      );
      } );
      onRetry?.();
      }, [ dispatch, retryableErrors, onRetry ] );
  • 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

  • Add an error state for the Audience tile component.
@techanvil techanvil added Module: Analytics Google Analytics module related issues P1 Medium priority Type: Enhancement Improvement of an existing feature labels Feb 6, 2024
@ivonac4 ivonac4 added Next Up Issues to prioritize for definition and removed Next Up Issues to prioritize for definition labels Feb 9, 2024
@ivonac4 ivonac4 added the Next Up Issues to prioritize for definition label Mar 6, 2024
@techanvil techanvil assigned techanvil and unassigned techanvil Mar 15, 2024
@benbowler benbowler assigned benbowler and unassigned benbowler Mar 19, 2024
@tofumatt tofumatt self-assigned this Mar 20, 2024
@tofumatt
Copy link
Collaborator

Looks good to me 👍🏻

IB ✅

@tofumatt tofumatt removed their assignment Mar 20, 2024
@tofumatt tofumatt removed the Next Up Issues to prioritize for definition label Mar 20, 2024
@benbowler benbowler self-assigned this Mar 25, 2024
@benbowler benbowler removed their assignment Mar 25, 2024
@hussain-t hussain-t assigned hussain-t and benbowler and unassigned hussain-t Mar 25, 2024
@benbowler benbowler assigned hussain-t and unassigned benbowler Mar 28, 2024
@hussain-t hussain-t removed their assignment Mar 28, 2024
@tofumatt tofumatt assigned tofumatt and benbowler and unassigned tofumatt Mar 28, 2024
@bethanylang bethanylang added the Squad 1 (Team S) Issues for Squad 1 label Apr 3, 2024
@benbowler benbowler assigned tofumatt and unassigned benbowler Apr 3, 2024
@tofumatt tofumatt removed their assignment Apr 3, 2024
@mohitwp mohitwp self-assigned this Apr 4, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 15, 2024

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 mohitwp assigned benbowler and unassigned mohitwp Apr 15, 2024
@wpdarren wpdarren added Good First Issue Good first issue for new engineers and removed Good First Issue Good first issue for new engineers labels Apr 15, 2024
@benbowler benbowler removed their assignment Apr 15, 2024
@tofumatt tofumatt assigned tofumatt and mohitwp and unassigned tofumatt Apr 15, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 16, 2024

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 mohitwp removed their assignment Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Analytics Google Analytics module related issues P1 Medium priority Squad 1 (Team S) Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

9 participants