Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ed85b32
Add RefreshedSplash component.
ankitrox Sep 16, 2025
0a7e3d2
Add refresh flow test.
ankitrox Sep 16, 2025
a5c43c2
Update tests and snapshots.
ankitrox Sep 16, 2025
ba39e16
Add stories for SFR.
ankitrox Sep 16, 2025
bda97c5
Add support for wider viewport.
ankitrox Sep 17, 2025
e7864a6
Fix: Redo plugin setup layout.
ankitrox Sep 17, 2025
f548203
Add lazy svg component.
ankitrox Sep 17, 2025
686b0ef
Update tests.
ankitrox Sep 18, 2025
9d5fea2
Restore package.json file.
ankitrox Sep 18, 2025
1908d8a
Snapshots updated.
ankitrox Sep 18, 2025
51938ab
Revert file changes.
ankitrox Sep 18, 2025
447b585
Resolve conflicts.
ankitrox Sep 25, 2025
f22e3c6
Address CR feedback.
ankitrox Sep 25, 2025
908a079
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Sep 26, 2025
5b3d138
Address CR feedback.
ankitrox Sep 26, 2025
88e397a
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Sep 30, 2025
82f43ad
Address CR feedback.
ankitrox Sep 30, 2025
893b317
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Sep 30, 2025
0f9ffaa
Add minor styling adjustments.
ankitrox Sep 30, 2025
193db13
Update status.
ankitrox Sep 30, 2025
bb45f16
Align opt-in checkbox.
ankitrox Sep 30, 2025
63c655f
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Oct 6, 2025
9c8edce
Update: CR feedback addressal.
ankitrox Oct 6, 2025
f0d7501
Update reference images.
ankitrox Oct 6, 2025
40a9c51
Fix: splash screen VRT differences.
ankitrox Oct 6, 2025
0f68333
Update responsive designs.
ankitrox Oct 6, 2025
974e8e1
Update VRT reference images.
ankitrox Oct 6, 2025
a81a9b4
Add `viewBox` to `splash-screenshot-wide-viewport.svg`.
techanvil Oct 7, 2025
8524fba
Simplify screenshot rendering, remove unneeded image, and fix styling.
techanvil Oct 7, 2025
88c5036
Merge branch 'develop' into enhancement/11333-splash-screen.
ankitrox Oct 8, 2025
5734453
Merge branch 'enhancement/11333-splash-screen' of github.com:google/s…
ankitrox Oct 8, 2025
856d9a9
Restore inline rendering of SVGs for the legacy splash screen.
techanvil Oct 8, 2025
5503dbb
Update snapshots.
techanvil Oct 8, 2025
47f3af6
Update VRT reference images.
ankitrox Oct 8, 2025
7bbba32
Update VRT reference images.
ankitrox Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/**
* LegacySplashContent component.
*
* Site Kit by Google, Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* External dependencies
*/
import PropTypes from 'prop-types';

/**
* WordPress dependencies
*/
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import ActivateAnalyticsNotice from '@/js/components/setup/ActivateAnalyticsNotice';
import CompatibilityChecks from '@/js/components/setup/CompatibilityChecks';
import Link from '@/js/components/Link';
import P from '@/js/components/Typography/P';
import SetupFlowSVG from './SetupFlowSVG';
import Typography from '@/js/components/Typography';
import { Cell, Row } from '@/js/material-components';
import { DISCONNECTED_REASON_CONNECTED_URL_MISMATCH } from '@/js/googlesitekit/datastore/user/constants';

export default function LegacySplashContent( {
analyticsModuleActive,
analyticsModuleAvailable,
children,
connectedProxyURL,
description,
disconnectedReason,
getHelpURL,
homeURL,
secondAdminLearnMoreLink,
title,
} ) {
const showLearnMoreLink = false;

const cellDetailsProp = analyticsModuleActive
? { smSize: 4, mdSize: 8, lgSize: 6 }
: { smSize: 4, mdSize: 8, lgSize: 8 };

return (
<Row className="googlesitekit-setup__content">
<Cell
smSize={ 4 }
mdSize={ 8 }
lgSize={ ! analyticsModuleActive ? 4 : 6 }
className="googlesitekit-setup__icon"
>
{ analyticsModuleActive && (
<SetupFlowSVG name="welcome" width="570" height="336" />
) }
{ ! analyticsModuleActive && (
<SetupFlowSVG
name="welcome-analytics"
height="167"
width="175"
/>
) }
</Cell>

<Cell { ...cellDetailsProp }>
<Typography
as="h1"
className="googlesitekit-setup__title"
size="large"
type="headline"
>
{ title }
</Typography>

<p className="googlesitekit-setup__description">
{ ! showLearnMoreLink && description }

{ showLearnMoreLink &&
createInterpolateElement(
sprintf(
/* translators: 1: The description. 2: The learn more link. */
__(
'%1$s <Link>%2$s</Link>',
'google-site-kit'
),
description,
__( 'Learn more', 'google-site-kit' )
),
{
Link: (
<Link
href={ secondAdminLearnMoreLink }
external
/>
),
}
) }
</p>
{ getHelpURL && (
<Link href={ getHelpURL } external>
{ __( 'Get help', 'google-site-kit' ) }
</Link>
) }
{ DISCONNECTED_REASON_CONNECTED_URL_MISMATCH ===
disconnectedReason &&
connectedProxyURL !== homeURL && (
<P>
{ sprintf(
/* translators: %s: Previous Connected Proxy URL */
__( '— Old URL: %s', 'google-site-kit' ),
connectedProxyURL
) }
<br />
{ sprintf(
/* translators: %s: Connected Proxy URL */
__( '— New URL: %s', 'google-site-kit' ),
homeURL
) }
</P>
) }

{ analyticsModuleAvailable && ! analyticsModuleActive && (
<ActivateAnalyticsNotice />
) }

<CompatibilityChecks>{ children }</CompatibilityChecks>
</Cell>
</Row>
);
}

LegacySplashContent.propTypes = {
analyticsModuleActive: PropTypes.bool,
analyticsModuleAvailable: PropTypes.bool,
children: PropTypes.func,
connectedProxyURL: PropTypes.string,
Copy link
Collaborator

Choose a reason for hiding this comment

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

connectedProxyURL can also be a boolean, please update this prop type.

Suggested change
connectedProxyURL: PropTypes.string,
connectedProxyURL: PropTypes.oneOfType( [
PropTypes.string,
PropTypes.bool,
] ),

description: PropTypes.string,
disconnectedReason: PropTypes.string,
getHelpURL: PropTypes.string,
homeURL: PropTypes.string,
secondAdminLearnMoreLink: PropTypes.string,
title: PropTypes.string.isRequired,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* SetupFlowSVG component.
*
* Site Kit by Google, Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* External dependencies
*/
import PropTypes from 'prop-types';

/**
* WordPress dependencies
*/
import { lazy, Suspense, useMemo } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import PreviewBlock from '@/js/components/PreviewBlock';
import MediaErrorHandler from '@/js/components/MediaErrorHandler';

export default function SetupFlowSVG( { name, width, height } ) {
const LazySVGComponent = useMemo(
() => lazy( () => import( `../../../../svg/graphics/${ name }.svg` ) ),
[ name ]
);

if ( ! name ) {
return null;
}

return (
<Suspense
fallback={ <PreviewBlock width={ width } height={ height } /> }
>
<MediaErrorHandler
errorMessage={ __(
'Failed to load graphic',
'google-site-kit'
) }
>
<LazySVGComponent
name={ name }
width={ width }
height={ height }
/>
</MediaErrorHandler>
</Suspense>
);
}

SetupFlowSVG.propTypes = {
name: PropTypes.string.isRequired,
width: PropTypes.string,
height: PropTypes.string,
};
Loading
Loading