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/richer titan navigation #48781

Merged
merged 6 commits into from
Jan 12, 2021
Merged

Add/richer titan navigation #48781

merged 6 commits into from
Jan 12, 2021

Conversation

daledupreez
Copy link
Contributor

Changes proposed in this Pull Request

  • This PR introduces a vertical nav to show three links for managing a Titan account:
    • A link to the embedded console (if that feature is enabled with the titan/iframe-control-panel flag) OR the external Titan console (when the feature is not enabled)
    • A link to manage the subscription (if we have the subscription ID)
    • A link to pay for more mailboxes

WIP titles for nav

  • This PR also introduces a standalone component at titan/manage to wrap the embedded control panel, as we need a way to signal when we are loading the dedicated management path.
  • As a final change, this PR tweaks the way the "Back" button in the Email Management screen determines where it should go back to, as the changes result in additional paths being possible

Note: For now, I haven't added any styles, as I want some feedback on the core approach first.

Testing instructions

Note 1: The nav section of this feature is currently behind the titan/phase-2 feature flag, but the new titan/manage path is not protected by that feature flag, as it's highly unlikely anyone gets to that URL, and it doesn't expose any new functionality anyway.
Note 2: The PR takes into account the titan/iframe-control-panel feature flag as well:

  • If both this flag and the titan/phase-2 flags are enabled, the clicking on the Titan nav option for "Manage your email settings and accounts" should load the new titan/manage page and show the embedded management console.
  • If the titan/iframe-control-panel flag is disabled, but the titan/phase-2 flag is enabled, clicking on "Manage your email settings and accounts" should immediately launch the external control panel.
  1. Ensure that you're working against a sandboxed back end that has Store Sandbox enabled and has the update from D55163-code.
  2. If you don't have a domain where you have purchased Titan:
    a. Enable the titan/phase-2 feature flag in the UI by adding ?flags=titan/phase-2 to the URL you're using (either locally or on calypso.live).
    b. Purchase Titan for a domain you own.
  3. Ensure the titan/phase-2 and titan/iframe-control-panel flags are enabled.
  4. For the domain above, navigate to the domain management screen and click on the "Manage your email accounts" option.
  5. Verify that you see a list containing three links, one for management/configuration, one for billing, and one for adding accounts.
  6. Confirm that clicking on all three links works and takes you to the correct page. Ensure that clicking the Back button works correctly in all three cases. (Note that you should see the iframed control panel.)
  7. Disable the titan/iframe-control-panel flag and keep the titan/phase-2 flag enabled. (You can do this by adding ?flags=titan/phase-2,-titan/iframe-control-panel to the URL.)
  8. Repeat steps 4-6, and verify that you're launched into the full management console for that link.
  9. Disable both flags. (You can add ?flags=-titan/phase-2,-titan/iframe-control-panel to the URL to make this happen.)
  10. Repeat step 4.
  11. You should be taken to a page showing a basic description and a button to log into the control panel.
  12. Enable titan/iframe-control-panel and disable titan/phase-2.
  13. Repeat step 4.
  14. You should be taken to a page that loads the embedded management console.

And then repeat these steps (especially those involving navigation) starting from the all domains view.

@daledupreez daledupreez requested a review from a team January 11, 2021 23:28
@daledupreez daledupreez self-assigned this Jan 11, 2021
@matticbot
Copy link
Contributor

@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 11, 2021
@matticbot
Copy link
Contributor

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

App Entrypoints (~6 bytes added 📈 [gzipped])

name        parsed_size           gzip_size
entry-main        +88 B  (+0.0%)       +6 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~932 bytes added 📈 [gzipped])

name   parsed_size           gzip_size
email      +5024 B  (+1.4%)     +932 B  (+1.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.

if ( ! externalManagementUrl || isFetchingExternalManagementUrl ) {
return <VerticalNavItem isPlaceholder={ true } />;
}
return <VerticalNavItem path={ externalManagementUrl }>{ linkTitle }</VerticalNavItem>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to have the external attribute set to true here so the item clearly indicates it is an external link. (Though it then opens in a new window, which is a change in behaviour from what we have now.)

@stephanethomas
Copy link
Contributor

Just passing by, and wanted to note that we usually don't embed a list of actions inside a card. Here is an example:

screenshot

if ( isEnabled( 'titan/phase-2' ) ) {
return <TitanManagementNav domain={ domain } key={ domainKey } />;
}
return <TitanControlPanelLoginCard domain={ domain } key={ domainKey } />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth keeping in mind that this will be rendered both in the domain specific view, as well as the site specific view where we list all domains that have email. Maybe we want to have a check in place to see if we're listing all domains or just one?

Same goes for the TitanControlPanelLoginCard component now. If we enable the iframe flag, and we have 2 domains with Titan, we render both iframes if we go to /email/<site_slug>, which is not ideal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TitanControlPanelLoginCard component with the iframe has this problem already when it displays the iframe. I'm happy to just replace that with the dedicated nav moving forward.

RE showing multiple email management for a site -- does the nav take up too much space? I tried to keep it relatively small, as I noticed the logic supports showing details for multiple domains.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the nav take up too much space?

I don't think so, it should be fine IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just to be clear, once we flip the titan/phase-2 feature flag, the new page that's supposed to show the embedded control panel is only visible when a specific domain is selected.

domain.titanMailSubscription.subscriptionId
) }
>
{ translate( 'Update your billing and payment settings' ) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The navigation doesn't work 'as expected' when one navigates to 'Update your billing and payment settings'. It returns to a page that lists all subscriptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll queue this up for a later card.

Copy link
Contributor

@olaseni olaseni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Save some minor, non-blocking comments - Looks good!

@daledupreez daledupreez merged commit f56d645 into trunk Jan 12, 2021
@daledupreez daledupreez deleted the add/richer-titan-navigation branch January 12, 2021 18:52
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 12, 2021
@a8ci18n
Copy link

a8ci18n commented Jan 12, 2021

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/5433841

Thank you @daledupreez for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Jan 22, 2021

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants