Skip to content

set nfd_migrate_site to false #831

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

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion build/3.0.3/onboarding.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-media-utils', 'wp-preferences', 'wp-url'), 'version' => '30e304482fe213320ce4');
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-media-utils', 'wp-preferences', 'wp-url'), 'version' => '1fdbca79c31365f1aa5e');
4 changes: 2 additions & 2 deletions build/3.0.3/onboarding.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/app/steps/Migration/MigrationStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Container, Title, Spinner } from '@newfold/ui-component-library';
import { ExclamationCircleIcon } from '@heroicons/react/24/solid';
import { nfdOnboardingStore } from '@/data/store';
import { Navigate, Step } from '@/components';
import { getSiteMigrateUrl, getWpSettings, migrateRestURL } from '@/utils/api';
import { getSiteMigrateUrl, getWpSettings, updateWpSettings, migrateRestURL } from '@/utils/api';
import migrationFigureUrl from '@/assets/nfd-migration.png';
import { OnboardingEvent, trackOnboardingEvent } from '@/utils/analytics/hiive';
import { ACTION_ERROR_STATE_TRIGGERED, ACTION_MFE_MIGRATION_INITIATED, ACTION_MIGRATION_INITIATED } from '@/utils/analytics/hiive/constants';
Expand All @@ -25,6 +25,7 @@ const MigrationStep = () => {

/**
* Track migration initiated event
*
* @param { string } instaWpMigrationUrl The migration url
* @return { Promise<void> }
*/
Expand Down Expand Up @@ -69,6 +70,10 @@ const MigrationStep = () => {
dispatch( nfdOnboardingStore ).setInstaWpMigrationUrl( migrateUrl );
await trackMigrationInitiatedEvent( migrateUrl );

await updateWpSettings( {
nfd_migrate_site: false,
} );

// Open migration url (external)
window.open( migrateUrl, '_self' );
} else {
Expand Down
10 changes: 10 additions & 0 deletions src/app/utils/api/wp.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ export async function getWpSettings() {
} ).then()
);
}

export async function updateWpSettings( data ) {
return await resolve(
apiFetch( {
url: wpRestURL( 'settings' ),
method: 'POST',
data,
} ).then()
);
}
Loading