site-kit-wp
site-kit-wp copied to clipboard
Add the Audience Tile Error (Storybook)
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.
- Its Get help link will open the Analytics insufficient permissions support document.
- The Request access button will open the URL for the connected web data stream in the Analytics UI, allowing the user to request access.
- 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).
- 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.
Implementation Brief
-
[x] Add a new component
/assets/js/modules/analytics-4/components/dashboard/AudienceSegmentation/AudienceTile/AudienceTileError.jswith the properrors, 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
hasInsufficientPermissionsErroris 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 thegetServiceEntityAccessURLselector: - https://github.com/google/site-kit-wp/blob/6f01a837c2e815989235b1aabb0101f5b5ae3bb3/assets/js/components/ReportErrorActions.js#L57-L61
- [x] Render a Get help link linking to
- [x] If
hasInsufficientPermissionsErroris 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 a function to check if any of the errors are insufficient permissions errors,
-
[x] Add
assets/sass/components/analytics-4/audience-segmentation/_googlesitekit-audience-segmentation-tile-error.scssand apply the styles to match the Figma designs in the AC.
Test Coverage
- Add
AudienceTileErrortests 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
Looks good to me 👍🏻
IB ✅
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 -
Storybook-
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.