Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -1,5 +1,5 @@
/**
* AnalyticsActivationErrorNotification component stories.
* InitialSetupErrorNotification component stories.
*
* Site Kit by Google, Copyright 2026 Google LLC
*
Expand All @@ -20,16 +20,16 @@
* Internal dependencies
*/
import { Story } from '@/js/types/Story';
import AnalyticsActivationErrorNotification from './AnalyticsActivationErrorNotification';
import InitialSetupErrorNotification from './InitialSetupErrorNotification';

function Template() {
return <AnalyticsActivationErrorNotification onRetry={ () => {} } />;
return <InitialSetupErrorNotification onRetry={ () => {} } />;
}

export const Default = Template.bind( {} ) as Story;
Default.storyName = 'AnalyticsActivationErrorNotification';
Default.storyName = 'InitialSetupErrorNotification';
Default.scenario = {};

export default {
title: 'Setup/Using Proxy With Sign-in/Components/AnalyticsActivationErrorNotification',
title: 'Setup/Using Proxy With Sign-in/Components/InitialSetupErrorNotification',
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* SetupUsingProxyWithSignIn AnalyticsActivationErrorNotification component.
* SetupUsingProxyWithSignIn InitialSetupErrorNotification component.
*
* Site Kit by Google, Copyright 2026 Google LLC
*
Expand Down Expand Up @@ -32,19 +32,19 @@ import { __ } from '@wordpress/i18n';
import Notice from '@/js/components/Notice';
import { NOTICE_TYPES } from '@/js/components/Notice/constants';

interface AnalyticsActivationErrorNotificationProps {
interface InitialSetupErrorNotificationProps {
onRetry?: () => void;
}

export const ANALYTICS_ACTIVATION_ERROR_NOTIFICATION =
'analytics-activation-error-notification';
export const INITIAL_SETUP_ERROR_NOTIFICATION =
'initial-setup-error-notification';

const AnalyticsActivationErrorNotification: FC<
AnalyticsActivationErrorNotificationProps
> = ( { onRetry }: AnalyticsActivationErrorNotificationProps ) => {
const InitialSetupErrorNotification: FC<
InitialSetupErrorNotificationProps
> = ( { onRetry }: InitialSetupErrorNotificationProps ) => {
return (
<Notice
className="googlesitekit-setup__analytics-activation-error-notification"
className="googlesitekit-setup__initial-setup-error-notification"
title={ __( 'Connecting Site Kit failed', 'google-site-kit' ) }
description={ __(
'Something went wrong while connecting Site Kit to your site. Please try again.',
Expand All @@ -59,4 +59,4 @@ const AnalyticsActivationErrorNotification: FC<
);
};

export default AnalyticsActivationErrorNotification;
export default InitialSetupErrorNotification;
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import { withQuery } from '@storybook/addon-queryparams';
*/
import { Provider as ViewContextProvider } from '@/js/components/Root/ViewContextContext';
import SetupUsingProxyWithSignIn from '@/js/components/setup/SetupUsingProxyWithSignIn';
import AnalyticsActivationErrorNotification, {
ANALYTICS_ACTIVATION_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/AnalyticsActivationErrorNotification';
import InitialSetupErrorNotification, {
INITIAL_SETUP_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/InitialSetupErrorNotification';
import { VIEW_CONTEXT_MAIN_DASHBOARD } from '@/js/googlesitekit/constants';
import {
CORE_USER,
Expand Down Expand Up @@ -343,9 +343,9 @@ SecondaryAdminWithSharedServices.parameters = {
};
SecondaryAdminWithSharedServices.scenario = {};

export const AnalyticsActivationError = Template.bind( {} );
AnalyticsActivationError.storyName = 'Analytics activation error';
AnalyticsActivationError.args = {
export const InitialSetupError = Template.bind( {} );
InitialSetupError.storyName = 'Initial setup error';
InitialSetupError.args = {
setupRegistry: ( registry ) => {
provideSiteConnection( registry, {
hasConnectedAdmins: false,
Expand All @@ -362,11 +362,9 @@ AnalyticsActivationError.args = {

registry
.dispatch( CORE_NOTIFICATIONS )
.registerNotification( ANALYTICS_ACTIVATION_ERROR_NOTIFICATION, {
.registerNotification( INITIAL_SETUP_ERROR_NOTIFICATION, {
Component: () => (
<AnalyticsActivationErrorNotification
onRetry={ () => null }
/>
<InitialSetupErrorNotification onRetry={ () => null } />
),
priority: PRIORITY.ERROR_HIGH,
areaSlug: NOTIFICATION_AREAS.SPLASH_CONTENT,
Expand All @@ -377,11 +375,11 @@ AnalyticsActivationError.args = {
},
};

AnalyticsActivationError.parameters = {
InitialSetupError.parameters = {
features: [ 'setupFlowRefresh', 'setupFlowRefreshPhase4' ],
};

AnalyticsActivationError.scenario = {};
InitialSetupError.scenario = {};

export default {
title: 'Setup / Using Proxy With Sign-in and setupFlowRefresh enabled',
Expand Down
10 changes: 5 additions & 5 deletions assets/js/components/setup/SetupUsingProxyWithSignIn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import {
ANALYTICS_NOTICE_CHECKBOX,
ANALYTICS_NOTICE_FORM_NAME,
} from '@/js/components/setup/constants';
import AnalyticsActivationErrorNotification, {
ANALYTICS_ACTIVATION_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/AnalyticsActivationErrorNotification';
import InitialSetupErrorNotification, {
INITIAL_SETUP_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/InitialSetupErrorNotification';
import { setItem } from '@/js/googlesitekit/api/cache';
import { CORE_LOCATION } from '@/js/googlesitekit/datastore/location/constants';
import { CORE_SITE } from '@/js/googlesitekit/datastore/site/constants';
Expand Down Expand Up @@ -181,9 +181,9 @@ export default function SetupUsingProxyWithSignIn() {
return;
}

registerNotification( ANALYTICS_ACTIVATION_ERROR_NOTIFICATION, {
registerNotification( INITIAL_SETUP_ERROR_NOTIFICATION, {
Component: () => (
<AnalyticsActivationErrorNotification
<InitialSetupErrorNotification
onRetry={ onButtonClick }
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ describe( 'SetupUsingProxyWithSignIn', () => {
expect( console ).toHaveErrored();
} );

it( 'should retry plugin setup when the Analytics activation error notification CTA is clicked', async () => {
it( 'should retry plugin setup when the initial setup error notification CTA is clicked', async () => {
fetchMock.postOnce(
new RegExp(
'^/google-site-kit/v1/core/modules/data/activation'
Expand Down