From 3f4f4f1eb5903c3ff0124df5cf0286644d457d62 Mon Sep 17 00:00:00 2001 From: abhijitb Date: Fri, 9 Dec 2022 03:42:28 +0530 Subject: [PATCH 01/11] help section links added for get started steps --- includes/Data/Brands.php | 145 ++++++++++++------ .../components/LearnMore/SupportLink/index.js | 2 +- .../Sidebar/LearnMore/contents.js | 11 +- .../Sidebar/LearnMore/index.js | 2 +- .../PrimarySite/Sidebar/LearnMore/contents.js | 11 +- .../Sidebar/LearnMore/contents.js | 11 +- .../SecondarySite/Sidebar/LearnMore/index.js | 2 +- .../Welcome/Sidebar/LearnMore/contents.js | 14 +- .../Welcome/Sidebar/LearnMore/index.js | 4 +- src/OnboardingSPA/store/selectors.js | 49 ++++++ 10 files changed, 189 insertions(+), 62 deletions(-) diff --git a/includes/Data/Brands.php b/includes/Data/Brands.php index ea8f3f610..771e541ae 100644 --- a/includes/Data/Brands.php +++ b/includes/Data/Brands.php @@ -6,61 +6,110 @@ */ final class Brands { - protected static $brands = array( - 'bluehost' => array( - 'brand' => 'bluehost', - 'name' => 'Bluehost', - 'url' => 'https://bluehost.com', - 'knowledgeBaseUrl' => 'https://www.bluehost.com/help/results/wordpress', - 'helpUrl' => 'https://www.bluehost.com/help', - 'blogUrl' => 'https://www.bluehost.com/blog/', - 'facebookUrl' => 'https://www.facebook.com/bluehost', - 'twitterName' => '@bluehost', - 'twitterUrl' => 'https://twitter.com/bluehost', - 'youtubeUrl' => 'https://www.youtube.com/user/bluehost', - 'linkedinUrl' => 'https://www.linkedin.com/company/bluehost-com', - 'accountUrl' => 'https://my.bluehost.com', - 'domainsUrl' => 'https://my.bluehost.com/hosting/app?lil=1#/domains', - 'emailUrl' => 'https://my.bluehost.com/hosting/app?lil=1#/email-office', - 'hireExpertsInfo' => array( - 'defaultLink' => 'admin.php?', - 'fragment' => '#/marketplace/services/blue-sky', - 'queryParameters' => array( - 'page' => 'bluehost', - 'utm_source' => 'onboarding', - 'utm_medium' => 'wp_admin', - 'utm_campaign' => 'wp-setup')), - ), - 'bluehost-india' => array( - 'brand' => 'bluehost-india', - 'name' => 'Bluehost', - 'url' => 'https://bluehost.in', - 'knowledgeBaseUrl' => 'https://www.bluehost.in/hosting/help/results/wordpress', - 'helpUrl' => 'https://www.bluehost.in/hosting/help', - 'blogUrl' => 'https://www.bluehost.in/tutorials', - 'facebookUrl' => 'https://www.facebook.com/BlueHostIndia', - 'twitterName' => '@BluehostIndia', - 'twitterUrl' => 'https://twitter.com/bluehostindia', - 'youtubeUrl' => null, - 'linkedinUrl' => null, - 'accountUrl' => 'https://my.bluehost.in', - 'domainsUrl' => 'https://my.bluehost.in/hosting/app?lil=1#/domains', - 'emailUrl' => 'https://my.bluehost.in/hosting/app?lil=1#/email-office', - 'hireExpertsInfo' => array( - 'defaultLink' => 'https://www.bluehost.in/solutions/full-service', - 'utmParameters' => array( + protected static function brands_info() { + return array( + 'bluehost' => array( + 'brand' => 'bluehost', + 'name' => 'Bluehost', + 'url' => 'https://bluehost.com', + 'knowledgeBaseUrl' => 'https://www.bluehost.com/help/results/wordpress', + 'helpUrl' => 'https://www.bluehost.com/help', + 'blogUrl' => 'https://www.bluehost.com/blog/', + 'facebookUrl' => 'https://www.facebook.com/bluehost', + 'twitterName' => '@bluehost', + 'twitterUrl' => 'https://twitter.com/bluehost', + 'youtubeUrl' => 'https://www.youtube.com/user/bluehost', + 'linkedinUrl' => 'https://www.linkedin.com/company/bluehost-com', + 'accountUrl' => 'https://my.bluehost.com', + 'domainsUrl' => 'https://my.bluehost.com/hosting/app?lil=1#/domains', + 'emailUrl' => 'https://my.bluehost.com/hosting/app?lil=1#/email-office', + 'hireExpertsInfo' => array( + 'defaultLink' => 'admin.php?', + 'fragment' => '#/marketplace/services/blue-sky', + 'queryParameters' => array( + 'page' => 'bluehost', + 'utm_source' => 'onboarding', + 'utm_medium' => 'wp_admin', + 'utm_campaign' => 'wp-setup' + ), + ), + 'expertsInfo' => array( + 'defaultLink' => 'https://my.bluehost.com/cgi/app/#/marketplace/product/i/bluesky', + 'queryParams' => array( + 'utm_source' => 'wp-onboarding', + 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + ), + ), + 'fullServiceCreativeTeamInfo' => array( + 'defaultLink' => 'https://www.bluehost.com/solutions/full-service', + 'fragment' => '#full-service', + 'queryParams' => array( + 'utm_source' => 'wp-onboarding', + 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + ), + ), + 'techSupportInfo' => array( + 'defaultLink' => 'https://helpchat.bluehost.com/', + 'queryParams' => array( + 'utm_source' => 'wp-onboarding', + 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + ), + ), + ), + 'bluehost-india' => array( + 'brand' => 'bluehost-india', + 'name' => 'Bluehost', + 'url' => 'https://bluehost.in', + 'knowledgeBaseUrl' => 'https://www.bluehost.in/hosting/help/results/wordpress', + 'helpUrl' => 'https://www.bluehost.in/hosting/help', + 'blogUrl' => 'https://www.bluehost.in/tutorials', + 'facebookUrl' => 'https://www.facebook.com/BlueHostIndia', + 'twitterName' => '@BluehostIndia', + 'twitterUrl' => 'https://twitter.com/bluehostindia', + 'youtubeUrl' => null, + 'linkedinUrl' => null, + 'accountUrl' => 'https://my.bluehost.in', + 'domainsUrl' => 'https://my.bluehost.in/hosting/app?lil=1#/domains', + 'emailUrl' => 'https://my.bluehost.in/hosting/app?lil=1#/email-office', + 'hireExpertsInfo' => array( + 'defaultLink' => 'https://www.bluehost.in/solutions/full-service', + 'utmParameters' => array( 'utm_source' => 'blog', 'utm_medium' => 'socialmedia', - 'utm_campaign' => 'blogpost')), - ), - ); - + 'utm_campaign' => 'blogpost' + ) + ), + 'expertsInfo' => array( + 'defaultLink' => 'https://my.bluehost.in/cgi/app/#/marketplace/product/i/bluesky', + 'queryParams' => array( + 'utm_source' => 'wp-onboarding', + 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + ), + ), + 'fullServiceCreativeTeamInfo' => array( + 'defaultLink' => 'https://www.bluehost.in/solutions/full-service', + 'fragment' => '#full-service', + 'queryParams' => array( + 'utm_source' => 'wp-onboarding', + 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + ), + ), + 'techSupportInfo' => array( + 'defaultLink' => 'https://helpchat.bluehost.in/', + 'queryParams' => array( + 'utm_source' => 'wp-onboarding', + 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + ), + ), + ), + ); + } /** * Get Brand information. * * @return array */ public static function get_brands() { - return self::$brands; + return self::brands_info(); } } diff --git a/src/OnboardingSPA/components/Sidebar/components/LearnMore/SupportLink/index.js b/src/OnboardingSPA/components/Sidebar/components/LearnMore/SupportLink/index.js index 17a6bf616..e835d3d92 100644 --- a/src/OnboardingSPA/components/Sidebar/components/LearnMore/SupportLink/index.js +++ b/src/OnboardingSPA/components/Sidebar/components/LearnMore/SupportLink/index.js @@ -4,7 +4,7 @@ const SupportLink = ( { text, } ) => { return ( - + { text } ); diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js index a3a073907..3faf81182 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js @@ -3,7 +3,14 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; +import { store as nfdOnboardingStore } from '../../../../../../store'; +import { select } from '@wordpress/data'; + const getContents = () => { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'WordPress Experience', 'wp-module-onboarding' ), @@ -40,11 +47,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js index ac5e73556..583e2a3d8 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js @@ -51,7 +51,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank') ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: sprintf( @@ -52,11 +59,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js index 58d7aadca..b06123c3b 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js @@ -3,7 +3,14 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; +import { store as nfdOnboardingStore } from '../../../../../../../store'; +import { select } from '@wordpress/data'; + const getContents = () => { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: sprintf( @@ -52,11 +59,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js index 6b8fe1ca1..aa906069d 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js @@ -51,7 +51,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank') ) } /> { + + const expertsLink = select( nfdOnboardingStore ).getExpertsUrl(); + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Start Setup', 'wp-module-onboarding' ), @@ -74,18 +82,18 @@ const getContents = ( brandName ) => { '1-1 Expert Solutions & Coaching', 'wp-module-onboarding' ), - link: '#', + link: expertsLink, }, fullService: { text: __( 'Hire Our Full-Service Creative Team', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js index 430076208..857e9299e 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js @@ -62,13 +62,13 @@ const LearnMore = () => { - ( window.location.href = content.help.experts.link ) + ( window.open( content.help.experts.link, '_blank' ) ) } /> - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> Date: Fri, 9 Dec 2022 03:51:01 +0530 Subject: [PATCH 02/11] support links added for ecommerce steps --- .../StepAddress/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Ecommerce/StepAddress/Sidebar/LearnMore/index.js | 2 +- .../StepProducts/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Ecommerce/StepProducts/Sidebar/LearnMore/index.js | 2 +- .../Ecommerce/StepTax/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Ecommerce/StepTax/Sidebar/LearnMore/index.js | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js index 2e8f9203a..f0b276b79 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js @@ -3,7 +3,14 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { store } from '@wordpress/icons'; +import { store as nfdOnboardingStore } from '../../../../../../store'; +import { select } from '@wordpress/data'; + const getContents = ( brandName ) => { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Street Address', 'wp-module-onboarding' ), @@ -40,11 +47,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js index e8d00bfb9..103f2c376 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js @@ -59,7 +59,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank') ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Products Info', 'wp-module-onboarding' ), @@ -40,11 +47,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js index bc3a25e76..fec169938 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js @@ -59,7 +59,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank') ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Tax Info', 'wp-module-onboarding' ), @@ -45,11 +52,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js index 2330fcfb0..24fb0ad3f 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js @@ -59,7 +59,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank') ) } /> Date: Fri, 9 Dec 2022 04:06:38 +0530 Subject: [PATCH 03/11] support links added for basicInfo and Design steps --- .../Steps/BasicInfo/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../pages/Steps/BasicInfo/Sidebar/LearnMore/index.js | 2 +- .../Steps/DesignColors/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Steps/DesignColors/Sidebar/LearnMore/index.js | 2 +- .../DesignHeaderMenu/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js | 2 +- .../DesignHomepageMenu/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../DesignHomepageMenu/Sidebar/LearnMore/index.js | 2 +- .../Menu/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../DesignThemeStyles/Menu/Sidebar/LearnMore/index.js | 2 +- .../Preview/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Preview/Sidebar/LearnMore/index.js | 2 +- .../DesignTypography/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Steps/DesignTypography/Sidebar/LearnMore/index.js | 2 +- 14 files changed, 70 insertions(+), 21 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js index f6907f1de..e98fcfa6a 100644 --- a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js @@ -3,7 +3,14 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { info } from '@wordpress/icons'; +import { store as nfdOnboardingStore } from '../../../../../store'; +import { select } from '@wordpress/data'; + const getContents = ( brandName ) => { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Basic Info', 'wp-module-onboarding' ), @@ -55,11 +62,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js index 25ec04753..109cd4ee4 100644 --- a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js @@ -55,7 +55,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank') ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Colors', 'wp-module-onboarding' ), @@ -40,11 +47,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js index 8a4735e4b..0f45196c1 100644 --- a/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js @@ -47,7 +47,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Header & Menu', 'wp-module-onboarding' ), @@ -55,11 +62,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js index 8567ae42b..814db6876 100644 --- a/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js @@ -47,7 +47,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Home Page', 'wp-module-onboarding' ), @@ -46,11 +53,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js index 71cf9150d..1f183b6e7 100644 --- a/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js @@ -47,7 +47,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Theme Styles', 'wp-module-onboarding' ), @@ -51,11 +58,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js index 9ed1573f2..e62e043e5 100644 --- a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js @@ -59,7 +59,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Theme Styles', 'wp-module-onboarding' ), @@ -51,11 +58,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js index ec349801a..3379883e3 100644 --- a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js @@ -59,7 +59,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Typography', 'wp-module-onboarding' ), @@ -39,11 +46,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js index 9426e142d..b9acf2278 100644 --- a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js @@ -47,7 +47,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> Date: Fri, 9 Dec 2022 04:11:42 +0530 Subject: [PATCH 04/11] upport links added for SitePages, SiteFeatures and WhatNext --- .../Steps/SiteFeatures/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../Steps/SiteFeatures/Sidebar/LearnMore/index.js | 2 +- .../Steps/SitePages/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../pages/Steps/SitePages/Sidebar/LearnMore/index.js | 2 +- .../Steps/WhatNext/Sidebar/LearnMore/contents.js | 11 +++++++++-- .../pages/Steps/WhatNext/Sidebar/LearnMore/index.js | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js index 53c6541a2..9b704e9b7 100644 --- a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js @@ -3,7 +3,14 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { plugins } from '@wordpress/icons'; +import { store as nfdOnboardingStore } from '../../../../../store'; +import { select } from '@wordpress/data'; + const getContents = ( brandName ) => { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Features', 'wp-module-onboarding' ), @@ -51,11 +58,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js index 739f4abfc..db5f0ee65 100644 --- a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js @@ -55,7 +55,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'Pages', 'wp-module-onboarding' ), @@ -45,11 +52,11 @@ const getContents = () => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js index 7635dd82e..fc5f86e84 100644 --- a/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js @@ -47,7 +47,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> { + + const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); + const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); + return { introduction: { heading: __( 'What’s Next', 'wp-module-onboarding' ), @@ -57,11 +64,11 @@ const getContents = ( brandName ) => { 'Hire Our Full-Service Creative Studio', 'wp-module-onboarding' ), - link: '#', + link: fullServiceCreativeTeamLink, }, support: { text: __( 'Technical Support', 'wp-module-onboarding' ), - link: '#', + link: techSupportLink, }, }, }; diff --git a/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js index 2bd788a09..7dc691399 100644 --- a/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js @@ -59,7 +59,7 @@ const LearnMore = () => { - ( window.location.href = content.help.fullService.link ) + ( window.open( content.help.fullService.link, '_blank' ) ) } /> Date: Mon, 12 Dec 2022 14:59:09 +0530 Subject: [PATCH 05/11] fetching plugin name from container --- includes/Data/Brands.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/includes/Data/Brands.php b/includes/Data/Brands.php index 771e541ae..20716f77b 100644 --- a/includes/Data/Brands.php +++ b/includes/Data/Brands.php @@ -1,12 +1,18 @@ plugin()->headers ); + $brand_plugin_name = $container_headers->get( 'attributes' )[ 'TextDomain' ]; + return array( 'bluehost' => array( 'brand' => 'bluehost', @@ -37,7 +43,7 @@ protected static function brands_info() { 'defaultLink' => 'https://my.bluehost.com/cgi/app/#/marketplace/product/i/bluesky', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + 'utm_medium' => $brand_plugin_name, ), ), 'fullServiceCreativeTeamInfo' => array( @@ -45,14 +51,14 @@ protected static function brands_info() { 'fragment' => '#full-service', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + 'utm_medium' => $brand_plugin_name, ), ), 'techSupportInfo' => array( 'defaultLink' => 'https://helpchat.bluehost.com/', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + 'utm_medium' => $brand_plugin_name, ), ), ), @@ -83,7 +89,7 @@ protected static function brands_info() { 'defaultLink' => 'https://my.bluehost.in/cgi/app/#/marketplace/product/i/bluesky', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + 'utm_medium' => $brand_plugin_name, ), ), 'fullServiceCreativeTeamInfo' => array( @@ -91,25 +97,17 @@ protected static function brands_info() { 'fragment' => '#full-service', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + 'utm_medium' => $brand_plugin_name, ), ), 'techSupportInfo' => array( 'defaultLink' => 'https://helpchat.bluehost.in/', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => reset(explode('/', str_replace(WP_PLUGIN_DIR . '/', '', __DIR__))), + 'utm_medium' => $brand_plugin_name, ), ), ), ); } - /** - * Get Brand information. - * - * @return array - */ - public static function get_brands() { - return self::brands_info(); - } } From e123b55a8950809bbc74a739b03208c1e767d3ce Mon Sep 17 00:00:00 2001 From: abhijitb Date: Mon, 12 Dec 2022 16:40:04 +0530 Subject: [PATCH 06/11] checking for empty plugin name --- includes/Data/Brands.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Data/Brands.php b/includes/Data/Brands.php index 20716f77b..9565457e8 100644 --- a/includes/Data/Brands.php +++ b/includes/Data/Brands.php @@ -11,7 +11,8 @@ final class Brands { public static function get_brands() { $container_headers = new Fluent( container()->plugin()->headers ); - $brand_plugin_name = $container_headers->get( 'attributes' )[ 'TextDomain' ]; + $brand_plugin_name = $container_headers->getAttributes()[ 'attributes' ][ 'TextDomain' ] ? + $container_headers->getAttributes()[ 'attributes' ][ 'TextDomain' ] : ''; return array( 'bluehost' => array( From f36e746d6f580d0ae64f900de4f5f9dff57a5b54 Mon Sep 17 00:00:00 2001 From: abhijitb Date: Mon, 12 Dec 2022 16:45:57 +0530 Subject: [PATCH 07/11] refactored code for getstarted steps --- .../Sidebar/LearnMore/contents.js | 8 +------- .../GetStartedExperience/Sidebar/LearnMore/index.js | 12 +++++++++++- .../PrimarySite/Sidebar/LearnMore/contents.js | 9 +-------- .../PrimarySite/Sidebar/LearnMore/index.js | 12 +++++++++++- .../SecondarySite/Sidebar/LearnMore/contents.js | 9 +-------- .../SecondarySite/Sidebar/LearnMore/index.js | 13 ++++++++++++- .../Welcome/Sidebar/LearnMore/contents.js | 9 +-------- .../GetStarted/Welcome/Sidebar/LearnMore/index.js | 7 +++++-- 8 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js index 3faf81182..95acc234d 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/contents.js @@ -3,14 +3,8 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - return { introduction: { heading: __( 'WordPress Experience', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js index 583e2a3d8..e903ab9c5 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/GetStartedExperience/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -32,7 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/contents.js index b06123c3b..4b71a742a 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: sprintf( diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/index.js index 6b8fe1ca1..c9504d1cd 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/PrimarySite/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -32,7 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js index b06123c3b..4b71a742a 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: sprintf( diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js index aa906069d..79753e0d4 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -32,7 +34,16 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); + return (
diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/contents.js index 6cf52bedb..26757d35f 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const expertsLink = select( nfdOnboardingStore ).getExpertsUrl(); - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); +const getContents = ( brandName, expertsLink, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js index 857e9299e..dc058afd1 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/Sidebar/LearnMore/index.js @@ -37,13 +37,16 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, expertsLink, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + expertsLink: select( nfdOnboardingStore ).getExpertsUrl(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, expertsLink, techSupportLink, fullServiceCreativeTeamLink ); return (
From 33339797984ddf9d60fc6d5288a93c6cda8dbadc Mon Sep 17 00:00:00 2001 From: abhijitb Date: Mon, 12 Dec 2022 16:54:18 +0530 Subject: [PATCH 08/11] refactored code for ecommerce steps --- .../Ecommerce/StepAddress/Sidebar/LearnMore/contents.js | 9 +-------- .../Ecommerce/StepAddress/Sidebar/LearnMore/index.js | 6 ++++-- .../Ecommerce/StepProducts/Sidebar/LearnMore/contents.js | 9 +-------- .../Ecommerce/StepProducts/Sidebar/LearnMore/index.js | 6 ++++-- .../Ecommerce/StepTax/Sidebar/LearnMore/contents.js | 9 +-------- .../Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js | 6 ++++-- 6 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js index f0b276b79..0931f294b 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { store } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Street Address', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js index 103f2c376..a6e8851cb 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/index.js @@ -34,13 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/contents.js index 9d8e03818..708c93689 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { box } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Products Info', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js index fec169938..a82a1cc69 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepProducts/Sidebar/LearnMore/index.js @@ -34,13 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/contents.js index b6fa0f74e..f0282b90f 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { institution } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Tax Info', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js index 24fb0ad3f..97db95436 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/index.js @@ -34,13 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
From 022f617b4266f4ff359d89346731790761cd76a2 Mon Sep 17 00:00:00 2001 From: abhijitb Date: Mon, 12 Dec 2022 19:03:18 +0530 Subject: [PATCH 09/11] refactored basicinfo and design steps --- .../Steps/BasicInfo/Sidebar/LearnMore/contents.js | 9 +-------- .../pages/Steps/BasicInfo/Sidebar/LearnMore/index.js | 6 ++++-- .../Steps/DesignColors/Sidebar/LearnMore/contents.js | 9 +-------- .../Steps/DesignColors/Sidebar/LearnMore/index.js | 12 +++++++++++- .../DesignHeaderMenu/Sidebar/LearnMore/contents.js | 9 +-------- .../DesignHeaderMenu/Sidebar/LearnMore/index.js | 12 +++++++++++- .../DesignHomepageMenu/Sidebar/LearnMore/contents.js | 9 +-------- .../DesignHomepageMenu/Sidebar/LearnMore/index.js | 12 +++++++++++- .../Menu/Sidebar/LearnMore/contents.js | 9 +-------- .../Menu/Sidebar/LearnMore/index.js | 6 ++++-- .../Preview/Sidebar/LearnMore/contents.js | 9 +-------- .../Preview/Sidebar/LearnMore/index.js | 6 ++++-- .../DesignTypography/Sidebar/LearnMore/contents.js | 9 +-------- .../DesignTypography/Sidebar/LearnMore/index.js | 11 ++++++++++- .../PrimarySite/Sidebar/LearnMore/index.js | 2 +- .../SecondarySite/Sidebar/LearnMore/index.js | 2 +- 16 files changed, 64 insertions(+), 68 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js index e98fcfa6a..b1d91651a 100644 --- a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { info } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Basic Info', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js index 109cd4ee4..ed2bee360 100644 --- a/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/BasicInfo/Sidebar/LearnMore/index.js @@ -30,13 +30,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/contents.js index 107e31aa8..c4f7ed4a0 100644 --- a/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { color } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Colors', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js index 0f45196c1..370a4c473 100644 --- a/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignColors/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -28,7 +30,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/contents.js index c9e6c7c69..c552bf3fb 100644 --- a/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { header } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Header & Menu', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js index 814db6876..0ea0fbcc2 100644 --- a/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignHeaderMenu/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -28,7 +30,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/contents.js index 7b151baca..d6d0d8497 100644 --- a/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { home } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Home Page', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js index 1f183b6e7..a5526ab52 100644 --- a/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignHomepageMenu/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -28,7 +30,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/contents.js index cb56ae178..a8f84f284 100644 --- a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { brush } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Theme Styles', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js index e62e043e5..056d1376c 100644 --- a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Menu/Sidebar/LearnMore/index.js @@ -34,13 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/contents.js index cb56ae178..a8f84f284 100644 --- a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../../utils/locales/translations'; import { brush } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Theme Styles', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js index 3379883e3..0aa47f35c 100644 --- a/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignThemeStyles/Preview/Sidebar/LearnMore/index.js @@ -34,13 +34,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/contents.js index 65585f8e9..44d0ec330 100644 --- a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { typography } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Typography', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js index b9acf2278..0e16baad2 100644 --- a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -28,8 +30,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js index 79753e0d4..9f5406208 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/SiteTypeSetup/SecondarySite/Sidebar/LearnMore/index.js @@ -1,7 +1,7 @@ import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; -import { store as nfdOnboardingStore } from '../../../../../../store'; +import { store as nfdOnboardingStore } from '../../../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => From 823091b6b9d29d181fbc71fec2e83ceeef1be12a Mon Sep 17 00:00:00 2001 From: abhijitb Date: Mon, 12 Dec 2022 19:08:16 +0530 Subject: [PATCH 10/11] refactored sitefeatures, sitepages, whatnext steps --- .../Steps/DesignTypography/Sidebar/LearnMore/index.js | 1 - .../Steps/SiteFeatures/Sidebar/LearnMore/contents.js | 9 +-------- .../Steps/SiteFeatures/Sidebar/LearnMore/index.js | 6 ++++-- .../Steps/SitePages/Sidebar/LearnMore/contents.js | 9 +-------- .../pages/Steps/SitePages/Sidebar/LearnMore/index.js | 10 +++++++++- .../pages/Steps/WhatNext/Sidebar/LearnMore/contents.js | 9 +-------- .../pages/Steps/WhatNext/Sidebar/LearnMore/index.js | 7 +++++-- 7 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js index 0e16baad2..f20c848d9 100644 --- a/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/DesignTypography/Sidebar/LearnMore/index.js @@ -32,7 +32,6 @@ const StepIntroPanel = lazy( () => const LearnMore = () => { const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { - brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; diff --git a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js index 9b704e9b7..bd9a0a0a4 100644 --- a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { plugins } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = ( brandName ) => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Features', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js index db5f0ee65..81e4e1529 100644 --- a/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/SiteFeatures/Sidebar/LearnMore/index.js @@ -30,13 +30,15 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
diff --git a/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/contents.js b/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/contents.js index f517752e2..95d70db6a 100644 --- a/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/contents.js +++ b/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/contents.js @@ -3,14 +3,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../../../../utils/locales/translations'; import { copy } from '@wordpress/icons'; -import { store as nfdOnboardingStore } from '../../../../../store'; -import { select } from '@wordpress/data'; - -const getContents = () => { - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'Pages', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js index fc5f86e84..ab784d8ed 100644 --- a/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/SitePages/Sidebar/LearnMore/index.js @@ -1,5 +1,7 @@ +import { useSelect } from '@wordpress/data'; import { lazy } from '@wordpress/element'; +import { store as nfdOnboardingStore } from '../../../../../store'; import getContents from './contents'; const IllustrationPanel = lazy( () => @@ -28,8 +30,14 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const content = getContents(); + const { techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { + return { + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), + }; + } ); + const content = getContents( techSupportLink, fullServiceCreativeTeamLink ); return (
{ - - const techSupportLink = select( nfdOnboardingStore ).getTechSupportUrl(); - const fullServiceCreativeTeamLink = select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(); - +const getContents = ( brandName, techSupportLink, fullServiceCreativeTeamLink ) => { return { introduction: { heading: __( 'What’s Next', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js b/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js index 7dc691399..2f0385ffc 100644 --- a/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js +++ b/src/OnboardingSPA/pages/Steps/WhatNext/Sidebar/LearnMore/index.js @@ -30,13 +30,16 @@ const StepIntroPanel = lazy( () => ); const LearnMore = () => { - const { brandName } = useSelect( ( select ) => { + + const { brandName, techSupportLink, fullServiceCreativeTeamLink } = useSelect( ( select ) => { return { brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), + techSupportLink: select( nfdOnboardingStore ).getTechSupportUrl(), + fullServiceCreativeTeamLink: select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(), }; } ); - const content = getContents( brandName ); + const content = getContents( brandName, techSupportLink, fullServiceCreativeTeamLink ); return (
From 2927696ff7000a03a4114aa3f2e50ed130bd87c5 Mon Sep 17 00:00:00 2001 From: abhijitb Date: Tue, 13 Dec 2022 19:32:27 +0530 Subject: [PATCH 11/11] hardcoding the utm_medium param value to brand-plugin --- includes/Data/Brands.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/includes/Data/Brands.php b/includes/Data/Brands.php index 9565457e8..af78fd395 100644 --- a/includes/Data/Brands.php +++ b/includes/Data/Brands.php @@ -1,18 +1,12 @@ plugin()->headers ); - $brand_plugin_name = $container_headers->getAttributes()[ 'attributes' ][ 'TextDomain' ] ? - $container_headers->getAttributes()[ 'attributes' ][ 'TextDomain' ] : ''; return array( 'bluehost' => array( @@ -44,7 +38,7 @@ public static function get_brands() { 'defaultLink' => 'https://my.bluehost.com/cgi/app/#/marketplace/product/i/bluesky', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => $brand_plugin_name, + 'utm_medium' => 'brand-plugin', ), ), 'fullServiceCreativeTeamInfo' => array( @@ -52,14 +46,14 @@ public static function get_brands() { 'fragment' => '#full-service', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => $brand_plugin_name, + 'utm_medium' => 'brand-plugin', ), ), 'techSupportInfo' => array( 'defaultLink' => 'https://helpchat.bluehost.com/', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => $brand_plugin_name, + 'utm_medium' => 'brand-plugin', ), ), ), @@ -90,7 +84,7 @@ public static function get_brands() { 'defaultLink' => 'https://my.bluehost.in/cgi/app/#/marketplace/product/i/bluesky', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => $brand_plugin_name, + 'utm_medium' => 'brand-plugin', ), ), 'fullServiceCreativeTeamInfo' => array( @@ -98,14 +92,14 @@ public static function get_brands() { 'fragment' => '#full-service', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => $brand_plugin_name, + 'utm_medium' => 'brand-plugin', ), ), 'techSupportInfo' => array( 'defaultLink' => 'https://helpchat.bluehost.in/', 'queryParams' => array( 'utm_source' => 'wp-onboarding', - 'utm_medium' => $brand_plugin_name, + 'utm_medium' => 'brand-plugin', ), ), ),