Skip to content

Commit 3c20dd4

Browse files
committed
Merge branch 'dotdev-207-staging-sites-redesign-implement-the-figma-designs-for-the' of github.com:Automattic/wp-calypso into dotdev-207-staging-sites-redesign-implement-the-figma-designs-for-the
2 parents 33de64f + 51cdd9a commit 3c20dd4

File tree

100 files changed

+2282
-1419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2282
-1419
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ module.exports = {
505505
'@wordpress/components': [
506506
'__experimentalConfirmDialog',
507507
'__experimentalDivider',
508+
'__experimentalGrid',
508509
'__experimentalHStack',
509510
'__experimentalVStack',
510511
'__experimentalSpacer',

client/a8c-for-agencies/sections/reports/lib/get-site-reports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const getSiteReports = ( reports: Report[] ): SiteReports[] => {
99
const grouped = reports.reduce(
1010
( acc, report ) => {
1111
// Only include reports with "sent" status
12-
if ( report.status !== 'sent' ) {
12+
if ( report.status !== 'sent' || ! report.data.managed_site_id ) {
1313
return acc;
1414
}
1515

client/assets/stylesheets/_wp-base-styles-overrides.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
}
4646

4747
/* Jetpack login */
48-
.layout.is-jetpack-login:not(.is-woocommerce-core-profiler-flow) &:not(.is-error, .is-valid) {
48+
.layout.is-jetpack-login:not(.is-woocommerce-core-profiler-flow) &:not(.is-error, .is-valid) {
4949
--wp-admin-theme-color: var(--studio-jetpack-green-50);
5050
}
5151

client/assets/stylesheets/_wp-components-overrides.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
}
9292

9393
/* Akismet */
94-
.is-white-login.is-akismet .login,
95-
.is-white-login.is-akismet .magic-login,
94+
.is-akismet .login,
95+
.is-akismet .magic-login,
9696
.is-akismet .signup-form,
9797
.is-akismet .auth-form__social {
9898
.components-button:not(.is-destructive) {
@@ -115,7 +115,7 @@
115115

116116
/* Woo */
117117
.woo.is-woo-passwordless {
118-
.components-button:not(.is-destructive) {
118+
.components-button:not(.is-link):not(.is-destructive) {
119119
--wp-components-color-accent: var(--woo-purple-40);
120120
--wp-components-color-accent-darker-10: var(--woo-purple-60);
121121
--wp-components-color-accent-darker-20: var(--woo-purple-60);

client/blocks/authentication/form-divider/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $breakpoint-mobile: 660px;
7373

7474
// In this case we want the separator to be vertical
7575
.signup-form,
76-
.is-white-login .is-social-first,
76+
.layout:not(.is-grav-powered-client) .is-social-first,
7777
.login form.is-woo-passwordless,
7878
.login form.is-blaze-pro {
7979
.auth-form__separator {

client/blocks/login/continue-as-user.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
}
4646
}
4747

48-
.is-white-login {
48+
.layout:not(.is-grav-powered-client) {
4949
.continue-as-user {
5050
height: auto;
5151
}
5252
.continue-as-user__not-you {
5353
position: static;
5454
}
55-
}
55+
}

client/blocks/login/index.jsx

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import page from '@automattic/calypso-router';
2-
import { localizeUrl } from '@automattic/i18n-utils';
32
import clsx from 'clsx';
43
import emailValidator from 'email-validator';
54
import { localize } from 'i18n-calypso';
@@ -9,7 +8,6 @@ import { Component, Fragment } from 'react';
98
import { connect } from 'react-redux';
109
import AsyncLoad from 'calypso/components/async-load';
1110
import Notice from 'calypso/components/notice';
12-
import wooDnaConfig from 'calypso/jetpack-connect/woo-dna-config';
1311
import isAkismetRedirect from 'calypso/lib/akismet/is-akismet-redirect';
1412
import getGravatarOAuth2Flow from 'calypso/lib/get-gravatar-oauth2-flow';
1513
import { getSignupUrl, pathWithLeadingSlash } from 'calypso/lib/login';
@@ -67,7 +65,6 @@ class Login extends Component {
6765
disableAutoFocus: PropTypes.bool,
6866
isLinking: PropTypes.bool,
6967
isJetpack: PropTypes.bool.isRequired,
70-
isWhiteLogin: PropTypes.bool.isRequired,
7168
isFromAkismet: PropTypes.bool,
7269
isFromAutomatticForAgenciesPlugin: PropTypes.bool,
7370
isManualRenewalImmediateLoginAttempt: PropTypes.bool,
@@ -107,7 +104,6 @@ class Login extends Component {
107104

108105
static defaultProps = {
109106
isJetpack: false,
110-
isWhiteLogin: false,
111107
};
112108

113109
componentDidMount() {
@@ -146,7 +142,7 @@ class Login extends Component {
146142
}
147143

148144
if (
149-
this.props.isJetpackWooDnaFlow &&
145+
this.props.isWooJPC &&
150146
this.props.requestError?.code === 'unknown_user' &&
151147
emailValidator.validate( this.props.usernameOrEmail )
152148
) {
@@ -362,37 +358,6 @@ class Login extends Component {
362358
);
363359
}
364360

365-
renderToS() {
366-
const { isSocialFirst, translate, twoFactorAuthType } = this.props;
367-
if ( ! isSocialFirst || twoFactorAuthType ) {
368-
return null;
369-
}
370-
371-
const tos = translate(
372-
'By continuing you agree to our {{tosLink}}Terms of Service{{/tosLink}} and have read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
373-
{
374-
components: {
375-
tosLink: (
376-
<a
377-
href={ localizeUrl( 'https://wordpress.com/tos/' ) }
378-
target="_blank"
379-
rel="noopener noreferrer"
380-
/>
381-
),
382-
privacyLink: (
383-
<a
384-
href={ localizeUrl( 'https://automattic.com/privacy/' ) }
385-
target="_blank"
386-
rel="noopener noreferrer"
387-
/>
388-
),
389-
},
390-
}
391-
);
392-
393-
return <div className="login__form-subheader-terms">{ tos }</div>;
394-
}
395-
396361
renderNotice() {
397362
const { requestNotice } = this.props;
398363

@@ -595,7 +560,6 @@ class Login extends Component {
595560
isGravPoweredLoginPage,
596561
isManualRenewalImmediateLoginAttempt,
597562
isSignupExistingAccount,
598-
isWhiteLogin,
599563
linkingSocialService,
600564
socialConnect,
601565
twoStepNonce,
@@ -636,8 +600,6 @@ class Login extends Component {
636600

637601
{ this.renderNotice() }
638602

639-
{ ! isWhiteLogin && this.renderToS() }
640-
641603
{ this.renderContent() }
642604

643605
{ this.renderFooter() }
@@ -668,7 +630,6 @@ export default connect(
668630
'automattic-for-agencies-client' === get( getCurrentQueryArguments( state ), 'from' ) ||
669631
'automattic-for-agencies-client' ===
670632
new URLSearchParams( getRedirectToOriginal( state )?.split( '?' )[ 1 ] ).get( 'from' ),
671-
isJetpackWooDnaFlow: wooDnaConfig( getCurrentQueryArguments( state ) ).isWooDnaFlow(),
672633
isWooJPC: isWooJPCFlow( state ),
673634
isWCCOM: getIsWCCOM( state ),
674635
isWoo: getIsWoo( state ),

client/blocks/login/login-form.jsx

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Card, FormInputValidation, FormLabel, Gridicon } from '@automattic/comp
44
import { alert } from '@automattic/components/src/icons';
55
import { localizeUrl } from '@automattic/i18n-utils';
66
import { suggestEmailCorrection } from '@automattic/onboarding';
7-
import { Button, TextControl } from '@wordpress/components';
7+
import { Button } from '@wordpress/components';
88
import { Icon } from '@wordpress/icons';
99
import clsx from 'clsx';
1010
import cookie from 'cookie';
@@ -22,7 +22,6 @@ import FormPasswordInput from 'calypso/components/forms/form-password-input';
2222
import FormTextInput from 'calypso/components/forms/form-text-input';
2323
import Notice from 'calypso/components/notice';
2424
import { LastUsedSocialButton } from 'calypso/components/social-buttons';
25-
import wooDnaConfig from 'calypso/jetpack-connect/woo-dna-config';
2625
import {
2726
getSignupUrl,
2827
pathWithLeadingSlash,
@@ -393,131 +392,6 @@ export class LoginForm extends Component {
393392
return false;
394393
};
395394

396-
renderWooCommerce( { showSocialLogin = true, socialToS } = {} ) {
397-
const isFormDisabled = this.state.isFormDisabledWhileLoading || this.props.isFormDisabled;
398-
const { requestError, socialAccountIsLinking: linkingSocialUser } = this.props;
399-
400-
return (
401-
<form method="post">
402-
<Card className="login__form">
403-
<div className="login__form-userdata">
404-
{ linkingSocialUser && (
405-
<p>
406-
{ this.props.translate(
407-
'We found a WordPress.com account with the email address "%(email)s". ' +
408-
'Log in to this account to connect it to your %(service)s profile, ' +
409-
'or choose a different %(service)s profile.',
410-
{
411-
args: {
412-
email: this.props.socialAccountLinkEmail,
413-
service: capitalize( this.props.socialAccountLinkService ),
414-
},
415-
}
416-
) }
417-
</p>
418-
) }
419-
420-
<FormLabel htmlFor="usernameOrEmail">
421-
{ this.isPasswordView() ? (
422-
<Button
423-
variant="link"
424-
className="login__form-change-username"
425-
onClick={ this.resetView }
426-
size="small"
427-
>
428-
<Gridicon icon="arrow-left" size={ 18 } />
429-
430-
{ includes( this.state.usernameOrEmail, '@' )
431-
? this.props.translate( 'Change Email Address' )
432-
: this.props.translate( 'Change Username' ) }
433-
</Button>
434-
) : null }
435-
</FormLabel>
436-
437-
<TextControl
438-
autoCapitalize="off"
439-
autoCorrect="off"
440-
spellCheck="false"
441-
label={ this.props.translate( 'Email address or username' ) }
442-
disabled={ isFormDisabled || this.isPasswordView() }
443-
id="usernameOrEmail"
444-
name="usernameOrEmail"
445-
value={ this.state.usernameOrEmail }
446-
onChange={ ( value ) => {
447-
this.props.formUpdate();
448-
this.setState( {
449-
usernameOrEmail: value,
450-
} );
451-
} }
452-
__next40pxDefaultSize
453-
__nextHasNoMarginBottom
454-
/>
455-
456-
{ requestError && requestError.field === 'usernameOrEmail' && (
457-
<FormInputValidation isError text={ requestError.message } />
458-
) }
459-
460-
<div
461-
className={ clsx( 'login__form-password', {
462-
'is-hidden': this.isUsernameOrEmailView(),
463-
} ) }
464-
>
465-
<TextControl
466-
label={ this.props.translate( 'Password' ) }
467-
disabled={ isFormDisabled }
468-
id="password"
469-
name="password"
470-
type="password"
471-
value={ this.state.password }
472-
onChange={ ( value ) => {
473-
this.props.formUpdate();
474-
this.setState( {
475-
password: value,
476-
} );
477-
} }
478-
__next40pxDefaultSize
479-
__nextHasNoMarginBottom
480-
/>
481-
482-
{ requestError && requestError.field === 'password' && (
483-
<FormInputValidation isError text={ requestError.message } />
484-
) }
485-
</div>
486-
</div>
487-
488-
<div className="login__form-footer">
489-
<p className="login__social-tos">{ socialToS }</p>
490-
<div className="login__form-action">
491-
<Button
492-
variant="primary"
493-
disabled={ isFormDisabled }
494-
onClick={ this.handleWooCommerceSubmit }
495-
type="submit"
496-
__next40pxDefaultSize
497-
>
498-
{ this.getLoginButtonText() }
499-
</Button>
500-
</div>
501-
502-
{ config.isEnabled( 'signup/social' ) && showSocialLogin && (
503-
<div className="login__form-social">
504-
<div className="login__form-social-divider">
505-
<span>{ this.props.translate( 'or' ) }</span>
506-
</div>
507-
<SocialLoginForm
508-
handleLogin={ this.handleSocialLogin }
509-
trackLoginAndRememberRedirect={ this.trackLoginAndRememberRedirect }
510-
socialServiceResponse={ this.props.socialServiceResponse }
511-
isJetpack={ this.props.isJetpack }
512-
/>
513-
</div>
514-
) }
515-
</div>
516-
</Card>
517-
</form>
518-
);
519-
}
520-
521395
renderChangeUsername() {
522396
if ( this.props.isGravatarFixedAccountLogin ) {
523397
return null;
@@ -1061,8 +935,6 @@ export class LoginForm extends Component {
1061935

1062936
render() {
1063937
const {
1064-
accountType,
1065-
isJetpackWooDnaFlow,
1066938
currentQuery,
1067939
showSocialLoginFormOnly,
1068940
isWoo,
@@ -1073,31 +945,6 @@ export class LoginForm extends Component {
1073945
socialAccountIsLinking: linkingSocialUser,
1074946
} = this.props;
1075947

1076-
const socialToS = this.props.translate(
1077-
// To make any changes to this copy please speak to the legal team
1078-
'By continuing with any of the options below, ' +
1079-
'you agree to our {{tosLink}}Terms of Service{{/tosLink}} and' +
1080-
' have read our {{privacyLink}}Privacy Policy{{/privacyLink}}.',
1081-
{
1082-
components: {
1083-
tosLink: (
1084-
<a
1085-
href={ localizeUrl( 'https://wordpress.com/tos/' ) }
1086-
target="_blank"
1087-
rel="noopener noreferrer"
1088-
/>
1089-
),
1090-
privacyLink: (
1091-
<a
1092-
href={ localizeUrl( 'https://automattic.com/privacy/' ) }
1093-
target="_blank"
1094-
rel="noopener noreferrer"
1095-
/>
1096-
),
1097-
},
1098-
}
1099-
);
1100-
1101948
if ( showSocialLoginFormOnly ) {
1102949
return config.isEnabled( 'signup/social' ) ? (
1103950
<Fragment>
@@ -1112,13 +959,6 @@ export class LoginForm extends Component {
1112959
) : null;
1113960
}
1114961

1115-
if ( isJetpackWooDnaFlow ) {
1116-
return this.renderWooCommerce( {
1117-
showSocialLogin: !! accountType, // Only show the social buttons after the user entered an email.
1118-
socialToS,
1119-
} );
1120-
}
1121-
1122962
return (
1123963
<>
1124964
{ isOneTapAuth && ! linkingSocialUser && <OneTapAuthLoaderOverlay showCompactLogo /> }
@@ -1168,7 +1008,6 @@ export default connect(
11681008
oauth2Client,
11691009
isFromAutomatticForAgenciesPlugin:
11701010
'automattic-for-agencies-client' === get( getCurrentQueryArguments( state ), 'from' ),
1171-
isJetpackWooDnaFlow: wooDnaConfig( getCurrentQueryArguments( state ) ).isWooDnaFlow(),
11721011
isWooJPC: isWooJPCFlow( state ),
11731012
isWoo: getIsWoo( state ),
11741013
redirectTo: getRedirectToOriginal( state ),

client/blocks/login/login-form.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ form {
1414
}
1515
}
1616

17-
.is-white-login {
17+
.layout:not(.is-grav-powered-client) {
1818
.login {
1919
display: flex;
2020
flex-direction: column;

0 commit comments

Comments
 (0)