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

Site Migration: Remove migration flow and specialized steps #98503

Merged
merged 3 commits into from
Jan 23, 2025
Merged
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,6 +1,5 @@
import { useIsEnglishLocale } from '@automattic/i18n-utils';
import {
MIGRATION_FLOW,
SITE_MIGRATION_FLOW,
HOSTED_SITE_MIGRATION_FLOW,
MIGRATION_SIGNUP_FLOW,
Expand All @@ -12,7 +11,6 @@ import { Flow } from '../../types';
import { DeferredRender } from '../deferred-render';

const MIGRATION_SURVEY_FLOWS = [
MIGRATION_FLOW,
SITE_MIGRATION_FLOW,
HOSTED_SITE_MIGRATION_FLOW,
MIGRATION_SIGNUP_FLOW,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { StepNavigationLink, MIGRATION_FLOW } from '@automattic/onboarding';
import clsx from 'clsx';
import { useTranslate } from 'i18n-calypso';
import WordpressImporter from 'calypso/blocks/importer/wordpress';
import { WPImportOption } from 'calypso/blocks/importer/wordpress/types';
import { MigrationAssistanceModal } from 'calypso/landing/stepper/declarative-flow/internals/components/migration-assistance-modal';
Expand All @@ -19,7 +16,6 @@ interface Props extends StepProps {
}

const ImporterWordpress: FC< Props > = function ( props ) {
const translate = useTranslate();
const queryParams = useQuery();
const site = useSite();
const migrateFrom = queryParams.get( 'from' );
Expand All @@ -34,21 +30,6 @@ const ImporterWordpress: FC< Props > = function ( props ) {
);

let customizedActionButtons;
switch ( queryParams.get( 'ref' ) ) {
case MIGRATION_FLOW:
customizedActionButtons = (
<StepNavigationLink
direction="forward"
handleClick={ () => {
props.navigation.submit?.( { action: 'customized-action-go-to-flow' } );
} }
label={ translate( 'I want to migrate my entire site' ) }
cssClass={ clsx( 'step-container__navigation-link', 'forward', 'has-underline' ) }
borderless
/>
);
break;
}

return (
<>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions client/landing/stepper/declarative-flow/internals/steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,10 @@ export const STEPS = {
asyncComponent: () => import( './steps-repository/site-migration-how-to-migrate' ),
},

MIGRATION_HOW_TO_MIGRATE: {
slug: 'migration-how-to-migrate',
asyncComponent: () => import( './steps-repository/migration-how-to-migrate' ),
},

SITE_MIGRATION_SOURCE_URL: {
slug: 'site-migration-source-url',
asyncComponent: () => import( './steps-repository/site-migration-source-url' ),
},
MIGRATION_SOURCE_URL: {
slug: 'migration-source-url',
asyncComponent: () => import( './steps-repository/migration-source-url' ),
},

SITE_MIGRATION_UPGRADE_PLAN: {
slug: 'site-migration-upgrade-plan',
Expand Down Expand Up @@ -335,10 +326,6 @@ export const STEPS = {
slug: 'platform-identification',
asyncComponent: () => import( './steps-repository/platform-identification' ),
},
MIGRATION_UPGRADE_PLAN: {
slug: 'migration-upgrade-plan',
asyncComponent: () => import( './steps-repository/migration-upgrade-plan' ),
},
} satisfies Record< string, StepperStep >;

/**
Expand Down
31 changes: 2 additions & 29 deletions client/landing/stepper/declarative-flow/migration/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { MIGRATION_FLOW, SITE_SETUP_FLOW } from '@automattic/onboarding';
import { SITE_SETUP_FLOW } from '@automattic/onboarding';
import { ImporterPlatform } from 'calypso/lib/importer/types';
import { addQueryArgs } from 'calypso/lib/url';
import { getFinalImporterUrl } from '../../internals/steps-repository/import/helper';
import { StepperStep } from '../../internals/types';

const isWpAdminImporter = ( importerPath: string ) =>
importerPath.startsWith( 'http' ) || importerPath.startsWith( '/import' );
Expand All @@ -11,12 +10,7 @@ interface GoToImporterParams {
platform: ImporterPlatform;
siteId: string;
siteSlug: string;
/**
* @deprecated use backToFlow instead
*/
backToStep?: StepperStep;
backToFlow?: string;
migrateEntireSiteStep?: StepperStep;
replaceHistory?: boolean;
from?: string | null;
ref?: string;
Expand All @@ -26,7 +20,6 @@ interface GoToImporterParams {
* @deprecated generate the full flow URL in your flow instead
* @see backToFlow property
*/
const getFlowPath = ( step: string ) => `/${ MIGRATION_FLOW }/${ step }`;

const goTo = ( path: string, replaceHistory: boolean ) => {
if ( replaceHistory ) {
Expand All @@ -36,36 +29,16 @@ const goTo = ( path: string, replaceHistory: boolean ) => {
return window.location.assign( path );
};

const getBackToFlowFromStep = ( backToStep?: StepperStep ) => {
if ( backToStep ) {
return getFlowPath( backToStep.slug );
}

return undefined;
};

export const goToImporter = ( {
platform,
siteId,
siteSlug,
backToStep,
migrateEntireSiteStep,
replaceHistory = false,
backToFlow,
from,
ref,
}: GoToImporterParams ) => {
const backToFlowURL = backToFlow || getBackToFlowFromStep( backToStep );
const customizedActionGoToFlow = migrateEntireSiteStep
? getFlowPath( migrateEntireSiteStep?.slug )
: undefined;
const path = getFinalImporterUrl(
siteSlug,
from || '',
platform,
backToFlowURL,
customizedActionGoToFlow
);
const path = getFinalImporterUrl( siteSlug, from || '', platform, backToFlow );

if ( isWpAdminImporter( path ) ) {
return goTo( path, replaceHistory );
Expand Down

This file was deleted.

Loading
Loading