-
-
+
+
+
+
+
+
+
+
+
+ { content.heading }
+
+
+
+
+ { content.subHeading }
+
+
+
-
-
-
- { content.heading }
-
-
-
-
- { content.subHeading }
-
-
-
-
-
+
+
);
};
diff --git a/src/OnboardingSPA/steps/TheFork/index.js b/src/OnboardingSPA/steps/TheFork/index.js
index 10bce8d89..9ec8a0c2f 100644
--- a/src/OnboardingSPA/steps/TheFork/index.js
+++ b/src/OnboardingSPA/steps/TheFork/index.js
@@ -10,6 +10,7 @@ import { DEFAULT_FLOW } from '../../data/flows/constants';
import HeadingWithSubHeading from '../../components/HeadingWithSubHeading/SiteGen/index';
import StartOptions from '../../components/StartOptions';
import getContents from './contents';
+import SitegenAiStateHandler from '../../components/StateHandlers/SitegenAi';
const TheFork = () => {
const { migrationUrl } = useSelect( ( select ) => {
@@ -44,30 +45,32 @@ const TheFork = () => {
const content = getContents();
return (
-
-
-
-
-
-
+
- { content.importtext }
-
-
+
+
+
+
+
+ { content.importtext }
+
+
+
);
};
diff --git a/src/OnboardingSPA/store/actions.js b/src/OnboardingSPA/store/actions.js
index 9f34b8dae..283681925 100644
--- a/src/OnboardingSPA/store/actions.js
+++ b/src/OnboardingSPA/store/actions.js
@@ -319,3 +319,10 @@ export function updateCustomizeSidebarData( customizeSidebarData ) {
customizeSidebarData,
};
}
+
+export function updateSiteGenErrorStatus( siteGenErrorStatus ) {
+ return {
+ type: 'SET_SITEGEN_AI_ERROR_STATUS',
+ siteGenErrorStatus,
+ };
+}
diff --git a/src/OnboardingSPA/store/reducer.js b/src/OnboardingSPA/store/reducer.js
index e2dccd324..f20e80ae7 100644
--- a/src/OnboardingSPA/store/reducer.js
+++ b/src/OnboardingSPA/store/reducer.js
@@ -193,6 +193,17 @@ export function data( state = {}, action ) {
},
},
};
+ case 'SET_SITEGEN_AI_ERROR_STATUS':
+ return {
+ ...state,
+ flowData: {
+ ...state.flowData,
+ sitegen: {
+ ...state.flowData.sitegen,
+ siteGenErrorStatus: action.siteGenErrorStatus,
+ },
+ },
+ };
}
return state;
diff --git a/src/OnboardingSPA/store/selectors.js b/src/OnboardingSPA/store/selectors.js
index 00d3bce0c..586ac9c6d 100644
--- a/src/OnboardingSPA/store/selectors.js
+++ b/src/OnboardingSPA/store/selectors.js
@@ -466,3 +466,7 @@ export const getAllHomepages = ( state ) => {
export function getCustomizeSidebarData( state ) {
return state.runtime.customizeSidebarData;
}
+
+export function getSiteGenErrorStatus( state ) {
+ return state.data.flowData.sitegen.siteGenErrorStatus;
+}
diff --git a/src/OnboardingSPA/styles/app.scss b/src/OnboardingSPA/styles/app.scss
index 8e955d9a4..4b00aa040 100644
--- a/src/OnboardingSPA/styles/app.scss
+++ b/src/OnboardingSPA/styles/app.scss
@@ -64,6 +64,7 @@
@import "../components/TextInput/TextAreaSiteGenDetails/stylesheet";
@import "../components/TextInput/TextInputSiteGenDetails/stylesheet";
@import "../components/OrbAnimation/stylesheet";
+@import "../components/SiteGenError/stylesheet";
// CSS for Pages
@import "../steps/BasicInfo/stylesheet";
diff --git a/src/OnboardingSPA/utils/api/siteGen.js b/src/OnboardingSPA/utils/api/siteGen.js
index 942d603c1..64893f1c0 100644
--- a/src/OnboardingSPA/utils/api/siteGen.js
+++ b/src/OnboardingSPA/utils/api/siteGen.js
@@ -16,17 +16,17 @@ export async function generateSiteGenMeta(
identifier,
skipCache = true
) {
- return await resolve(
- apiFetch( {
- url: onboardingRestURL( 'sitegen/generate' ),
- method: 'POST',
- data: {
- site_info: siteInfo,
- identifier,
- skip_cache: skipCache,
- },
- } ).then()
- );
+ const data = await apiFetch( {
+ url: onboardingRestURL( 'sitegen/generate' ),
+ method: 'POST',
+ data: {
+ site_info: siteInfo,
+ identifier,
+ skip_cache: skipCache,
+ },
+ } );
+
+ return data;
}
export async function getHomepages( siteDescription ) {
diff --git a/src/constants.js b/src/constants.js
index 98d020239..0418b18ae 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -111,3 +111,9 @@ export const API_REQUEST = {
SET_FLOW: 'SET_FLOW',
SET_GLOBAL_STYLES: 'SET_GLOBAL_STYLES',
};
+
+/**
+ * ERROR code to skip for flow api
+ */
+export const SKIP_FLOW_ERROR_CODE_20 = 20;
+export const SKIP_FLOW_ERROR_CODE_DATABASE = 'database_update_failed';