site-kit-wp: Update the Modal Dialog component for error and confirmation actions (Storybook)

Feature Description

Add the Error Modal to Storybook. See Error modal in design doc.


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

Acceptance criteria

  • The existing <ModalDialog> component should be modified to look as per the new Audience Segmentation Modals (Figma Mock).
  • When on mobile viewport, the corresponding mobile design should be followed.
  • All existing uses of the <ModalDialog> component mentioned below should be updated:
  • All Storybook stories for each of the above components should be updated. Any old v5 format stories should be migrated to Storybook v6 stories.

Implementation Brief

  • As defined in AC, update the assets/js/components/ModalDialog.js to match the new design. Some of the points to apply:
    • Text alignment is on the left for title and content
    • Buttons are grouped with the right alignment and new spacing between them
    • Buttons order is reversed - handleConfirm comes after handleDialog
    • Modal title can include SVG icon
  • Update the modal in components listed in AC, which can be edited respectively in:
    • assets/js/components/UserMenu/index.js and assets/js/components/ResetButton.js
    • assets/js/components/PermissionsModal/AuthenticatedPermissionsModal.js
    • assets/js/components/settings/SettingsActiveModule/ConfirmDisconnect.js

Test Coverage

  • Update the edited components stories as defined in AC
    • Additional Permissions Required doesn’t seem to have a story, it can be handy to use this issue to add it
    • stories/reset-button.stories.js uses the old storybook API. Move it to the assets/js/components/ResetButton.stories.js and adapt to the v6 API

QA Brief

  • Setup Site Kit
  • Verify that modals mentioned in AC are matching the new Figma designs now, on desktop and mobile
  • Note: font weight 500 in figma is slightly different how it is rendered in the browser, so slight difference might be noticeable
  • To trigger Disconnect modal:
    • Click on the google account menu item in the top right user menu. From the drop down, select Disconnect
  • To trigger Reset site kit modal:
    • Go to settings -> admin settings -> reset site kit link
  • To trigger Additional Permissions Required modal
    • Setup analytics, go to settings and change property to a - setup a new property option and click apply. It will trigger the modal
  • To trigger Confirm Disconnect module modal:
    • Go to settings -> connected services and edit any of the modules. Click on CTA to disconnect the module
  • Note, the default width of the modal in figma is 478px, but after discussion with Sigal regarding the icon alignment, it is agreed that it will 590px

Changelog entry

  • Implement refreshed UI for the modal dialog component.

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 15

Most upvoted comments

@mohitwp Since the font is changed globally we should open a new issue in that case, instead of making a change here, as global edit will fix all CTA’s, and it is a different scope.

Can you please open an issue for this? Thanks.

I will wait for Sigal’s reply regarding your suggestion to increase the features font to 14px, that we can do as a follow up to this issue, if Sigal approves it

@mohitwp thank you for flagging this.

In figma design CTA titles font is ‘Google Sans Display’ where as under Actual implementation font is ‘Google Sans Text’. Is this expected ?

It is not, I just realised we actually use 2 fonts. Thanks, I should create a follow-up issue for this.

Under disconnect module modal listed items font is 12px which is small and difficult to read. Can we increase it’s size to 14px to make it more readable ?

I will need to run this through SIgal, to see if it can be changed

AC LGTM. I had initially envisaged that we’d create the presentational versions of the modal in its three variants as part of this issue, but with the existing Modal Dialog styled appropriately via this issue, it should be straightforward to implement the error modal variants as part of https://github.com/google/site-kit-wp/issues/8134.

AC ✅