From 0b7ab33f7bd382ed861ca966703f1fa0f3d3d125 Mon Sep 17 00:00:00 2001
From: Allen Benny
Date: Mon, 15 Jan 2024 13:26:40 +0530
Subject: [PATCH 1/6] Add Frontend!
---
src/OnboardingSPA/components/StartOptions/index.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js
index 6991669e4..44be70e49 100644
--- a/src/OnboardingSPA/components/StartOptions/index.js
+++ b/src/OnboardingSPA/components/StartOptions/index.js
@@ -7,6 +7,8 @@ import { memo } from '@wordpress/element';
import { store as nfdOnboardingStore } from '../../store';
const StartOptions = ( { questionnaire, oldFlow, options } ) => {
+ const AI_FLOW = 'ai';
+ const ONBOARDING_FLOW = 'onboarding';
const navigate = useNavigate();
const { brandConfig, migrationUrl, currentData } = useSelect(
( select ) => {
@@ -53,9 +55,9 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
};
const selectFlow = ( flow ) => {
switch ( flow ) {
- case 'onboarding':
+ case ONBOARDING_FLOW:
return switchFlow( oldFlow );
- case 'ai':
+ case AI_FLOW:
return switchFlow( SITEGEN_FLOW );
case 'migration':
return window.open( migrationUrl, '_blank' );
@@ -68,6 +70,10 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
{ options.map( ( tab, idx ) => {
+ if ( tab.flow === AI_FLOW && ! validateFlow( brandConfig, SITEGEN_FLOW ) ) {
+ // Do not show the Sitegen AI option if not enabled for the customer
+ return false;
+ }
return (
Date: Mon, 15 Jan 2024 13:29:40 +0530
Subject: [PATCH 2/6] lint
---
src/OnboardingSPA/components/StartOptions/index.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js
index 44be70e49..23363d497 100644
--- a/src/OnboardingSPA/components/StartOptions/index.js
+++ b/src/OnboardingSPA/components/StartOptions/index.js
@@ -70,7 +70,10 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
{ options.map( ( tab, idx ) => {
- if ( tab.flow === AI_FLOW && ! validateFlow( brandConfig, SITEGEN_FLOW ) ) {
+ if (
+ tab.flow === AI_FLOW &&
+ ! validateFlow( brandConfig, SITEGEN_FLOW )
+ ) {
// Do not show the Sitegen AI option if not enabled for the customer
return false;
}
From 72a853cf4d4be5d0b087469f9154b37b9a51d8f9 Mon Sep 17 00:00:00 2001
From: Allen Benny
Date: Wed, 17 Jan 2024 12:37:33 +0530
Subject: [PATCH 3/6] Minor Changes
---
src/OnboardingSPA/components/StartOptions/index.js | 9 ++++-----
src/OnboardingSPA/steps/TheFork/contents.js | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js
index 23363d497..3f97d74bb 100644
--- a/src/OnboardingSPA/components/StartOptions/index.js
+++ b/src/OnboardingSPA/components/StartOptions/index.js
@@ -7,8 +7,7 @@ import { memo } from '@wordpress/element';
import { store as nfdOnboardingStore } from '../../store';
const StartOptions = ( { questionnaire, oldFlow, options } ) => {
- const AI_FLOW = 'ai';
- const ONBOARDING_FLOW = 'onboarding';
+ const SITEGEN = 'sitegen';
const navigate = useNavigate();
const { brandConfig, migrationUrl, currentData } = useSelect(
( select ) => {
@@ -55,9 +54,9 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
};
const selectFlow = ( flow ) => {
switch ( flow ) {
- case ONBOARDING_FLOW:
+ case 'onboarding':
return switchFlow( oldFlow );
- case AI_FLOW:
+ case SITEGEN:
return switchFlow( SITEGEN_FLOW );
case 'migration':
return window.open( migrationUrl, '_blank' );
@@ -71,7 +70,7 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
{ options.map( ( tab, idx ) => {
if (
- tab.flow === AI_FLOW &&
+ tab.flow === SITEGEN &&
! validateFlow( brandConfig, SITEGEN_FLOW )
) {
// Do not show the Sitegen AI option if not enabled for the customer
diff --git a/src/OnboardingSPA/steps/TheFork/contents.js b/src/OnboardingSPA/steps/TheFork/contents.js
index e4a75f776..3e734e23a 100644
--- a/src/OnboardingSPA/steps/TheFork/contents.js
+++ b/src/OnboardingSPA/steps/TheFork/contents.js
@@ -24,7 +24,7 @@ const getContents = () => {
'wp-module-onboarding'
),
span: __( 'AI', 'wp-module-onboarding' ),
- flow: 'ai',
+ flow: 'sitegen',
},
{
title: __( 'Hire a Pro', 'wp-module-onboarding' ),
From 6d3083f1b0888a9a6f477927f02ff678d2b04561 Mon Sep 17 00:00:00 2001
From: Allen Benny
Date: Wed, 17 Jan 2024 12:55:07 +0530
Subject: [PATCH 4/6] Update stylesheet.scss
---
.../components/ImageUploaderWithText/stylesheet.scss | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/OnboardingSPA/components/ImageUploader/components/ImageUploaderWithText/stylesheet.scss b/src/OnboardingSPA/components/ImageUploader/components/ImageUploaderWithText/stylesheet.scss
index 3d39b7e1f..3a85d48e9 100644
--- a/src/OnboardingSPA/components/ImageUploader/components/ImageUploaderWithText/stylesheet.scss
+++ b/src/OnboardingSPA/components/ImageUploader/components/ImageUploaderWithText/stylesheet.scss
@@ -106,6 +106,11 @@
flex-direction: column;
justify-content: center;
margin-left: 18px;
+ max-width: 27vw;
+
+ @media (max-width: #{ ($break-large) }) {
+ width: 60vw;
+ }
&__filename {
margin: 0;
@@ -133,7 +138,7 @@
border: none;
font-weight: 510;
font-style: normal;
- background-color: #ff0e9099;
+ background-color: transparent;
color: var(--nfd-onboarding-primary);
font-size: clamp(0.5rem, 0.4091rem + 0.4545vw, 1.5rem);
@@ -143,7 +148,7 @@
}
&__icon {
- fill: rgb(255, 14, 144);
+ fill: var(--nfd-onboarding-primary);
}
}
}
From acd31f7c014dc86472867236ede0013e20ada6c7 Mon Sep 17 00:00:00 2001
From: Allen Benny
Date: Wed, 17 Jan 2024 13:05:49 +0530
Subject: [PATCH 5/6] More
---
src/OnboardingSPA/components/StartOptions/index.js | 4 ++--
src/OnboardingSPA/steps/TheFork/contents.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js
index 3f97d74bb..efa27bcde 100644
--- a/src/OnboardingSPA/components/StartOptions/index.js
+++ b/src/OnboardingSPA/components/StartOptions/index.js
@@ -54,7 +54,7 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
};
const selectFlow = ( flow ) => {
switch ( flow ) {
- case 'onboarding':
+ case 'sitebuild':
return switchFlow( oldFlow );
case SITEGEN:
return switchFlow( SITEGEN_FLOW );
@@ -71,7 +71,7 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
{ options.map( ( tab, idx ) => {
if (
tab.flow === SITEGEN &&
- ! validateFlow( brandConfig, SITEGEN_FLOW )
+ ! validateFlow( brandConfig, tab.flow )
) {
// Do not show the Sitegen AI option if not enabled for the customer
return false;
diff --git a/src/OnboardingSPA/steps/TheFork/contents.js b/src/OnboardingSPA/steps/TheFork/contents.js
index 3677e7edc..905a7679b 100644
--- a/src/OnboardingSPA/steps/TheFork/contents.js
+++ b/src/OnboardingSPA/steps/TheFork/contents.js
@@ -15,7 +15,7 @@ const getContents = () => {
"We'll stay out of your way.",
'wp-module-onboarding'
),
- flow: 'onboarding',
+ flow: 'sitebuild',
},
{
title: __( ' Website Creator', 'wp-module-onboarding' ),
From a447a6fcd91e0ffafad7cb775bcc7c59851b22a7 Mon Sep 17 00:00:00 2001
From: Allen Benny
Date: Wed, 17 Jan 2024 15:37:11 +0530
Subject: [PATCH 6/6] Update index.js
---
src/OnboardingSPA/components/StartOptions/index.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/OnboardingSPA/components/StartOptions/index.js b/src/OnboardingSPA/components/StartOptions/index.js
index efa27bcde..4f2fd8b0f 100644
--- a/src/OnboardingSPA/components/StartOptions/index.js
+++ b/src/OnboardingSPA/components/StartOptions/index.js
@@ -7,7 +7,6 @@ import { memo } from '@wordpress/element';
import { store as nfdOnboardingStore } from '../../store';
const StartOptions = ( { questionnaire, oldFlow, options } ) => {
- const SITEGEN = 'sitegen';
const navigate = useNavigate();
const { brandConfig, migrationUrl, currentData } = useSelect(
( select ) => {
@@ -56,7 +55,7 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
switch ( flow ) {
case 'sitebuild':
return switchFlow( oldFlow );
- case SITEGEN:
+ case 'sitegen':
return switchFlow( SITEGEN_FLOW );
case 'migration':
return window.open( migrationUrl, '_blank' );
@@ -70,7 +69,7 @@ const StartOptions = ( { questionnaire, oldFlow, options } ) => {
{ options.map( ( tab, idx ) => {
if (
- tab.flow === SITEGEN &&
+ tab.flow === SITEGEN_FLOW &&
! validateFlow( brandConfig, tab.flow )
) {
// Do not show the Sitegen AI option if not enabled for the customer