wp-calypso icon indicating copy to clipboard operation
wp-calypso copied to clipboard

Always show Add Email link in `EmailListInactive`

Open fredrikekelund opened this issue 3 years ago • 2 comments

Proposed Changes

Letero is iterating on how the email management pages are displayed to users who aren't permitted to add/manage email subscriptions for domains.

This PR covers one of the steps in that process, namely to always show the Add Email button in EmailListInactive, regardless of whether the current user can add email to the domain in question or not. We will change EmailProvidersStackedComparison in another PR and use that component to communicate the permissions issue to users. This PR should not be merged before that change is ready.

Crucially, I also took this opportunity to convert both EmailListActive and EmailListInactive to Typescript.

Before After
before after

Testing Instructions

  1. Have a site with more than one domain, where at least one has no email subscription
  2. Add another admin user to that site (/people/new/:site_slug)
  3. Log in as that other user, accept the invitation
  4. Navigate to /email/:site_slug
  5. Ensure that the Add Email button is visible for every domain in EmailListInactive

Pre-merge Checklist

  • [ ] Have you written new tests for your changes?
  • [ ] Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • [ ] Have you checked for TypeScript, React or other console errors?
  • [ ] Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • [ ] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?

Related to #

fredrikekelund avatar Sep 22 '22 12:09 fredrikekelund

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~44 bytes removed 📉 [gzipped])

name   parsed_size           gzip_size
email       -160 B  (-0.0%)      -44 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

matticbot avatar Sep 22 '22 12:09 matticbot

LGTM! Thanks for clearly warning against merging before the other related feature is ready and for converting the .jsx into .tsx as well!

The "Add Email" button is now shown for both the owner and non-owner of the domain.

  • What the domain owner sees (left) and what the non-domain-owner sees (right)
Screen Shot 2022-09-23 at 10 27 54 AM

wongasy avatar Sep 23 '22 14:09 wongasy