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

A4A > Referrals: Implement client auth #91640

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

yashwin
Copy link
Contributor

@yashwin yashwin commented Jun 10, 2024

Closes https://github.com/Automattic/jetpack-genesis/issues/374

Proposed Changes

This PR

  • Implements the client authentication UI for A4A Referrals.
  • Removes some code that are no more required.

NOTE:

This is the client auth implementation. Currently, the agency users can see the client UI for testing purposes. We will disable it once everything is implemented. While this is not the ideal way to implement this. We decided to go ahead with this for the MVP (CC @vitozev)

Testing Instructions

  1. Check out the branch and start the server.
  2. Set the isClient to false here: https://github.com/Automattic/wp-calypso/pull/91640/files#diff-90a95b186e56a1d11455fff699d8237d3fa7bb6da1d8eba9583518ead6be10b5R32
  3. Visit /client/subscriptions & verify you are redirected to /overview.
  4. Now, set the isClient to true > Visit /client/subscriptions
  5. Verify that you see the page below, which includes two menu items: Your Subscriptions and Payment Methods.Ideally, you will be directed to /overview if you have an agency account.
Screenshot 2024-05-31 at 10 13 02 AM

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • 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)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/a4a/client-auth-implementation on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Jun 10, 2024

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

App Entrypoints (~576 bytes removed 📉 [gzipped])

name           parsed_size           gzip_size
entry-stepper      -2641 B  (-0.1%)     -576 B  (-0.1%)
entry-main         -2641 B  (-0.1%)     -576 B  (-0.1%)

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

Sections (~40 bytes removed 📉 [gzipped])

name                                parsed_size           gzip_size
a8c-for-agencies-client                  -281 B  (-0.2%)      -62 B  (-0.1%)
a8c-for-agencies-sites                    -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-settings                 -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-referrals                -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-purchases                -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-plugins                  -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-partner-directory        -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-overview                 -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-migrations               -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies-marketplace              -35 B  (-0.0%)      +19 B  (+0.0%)
a8c-for-agencies                          -35 B  (-1.3%)      +22 B  (+1.9%)

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.

@yashwin yashwin requested a review from a team June 11, 2024 03:04
@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 Jun 11, 2024
@yashwin yashwin self-assigned this Jun 11, 2024
@yashwin yashwin changed the title A4A - Referrals: Implement client auth A4A > Referrals: Implement client auth Jun 11, 2024
@yashwin yashwin marked this pull request as ready for review June 11, 2024 03:06
Copy link
Contributor

@jkguidaven jkguidaven left a comment

Choose a reason for hiding this comment

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

Tested it and can confirm the changes work as expected based on the test instructions. I left a few comments, but they are not blockers. 🚢

client/sections.js Outdated Show resolved Hide resolved
@yashwin yashwin force-pushed the add/a4a/client-auth-implementation branch from ac029ed to 15c42c9 Compare June 11, 2024 09:10
@yashwin yashwin merged commit 8a93218 into trunk Jun 11, 2024
11 checks passed
@yashwin yashwin deleted the add/a4a/client-auth-implementation branch June 11, 2024 09:32
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants