Skip to content

Commit

Permalink
Resolve trunk branch conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
aratidgr8 committed Jun 26, 2024
2 parents d44c892 + d3737fe commit bb0ee79
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 78 deletions.
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use function NewfoldLabs\WP\ModuleLoader\register;

define( 'NFD_ECOMMERCE_MODULE_VERSION', '1.3.33' );
define( 'NFD_ECOMMERCE_MODULE_VERSION', '1.3.34' );

if ( function_exists( 'is_admin' ) && is_admin() ) {
$old_woocommerce_module_version = get_option( 'nfd_ecommerce_module_version' );
Expand Down
153 changes: 89 additions & 64 deletions composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions includes/ECommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ECommerce {
'woocommerce_cheque_settings',
'onboarding_experience_level',
'yoast_seo_signup_status',
'showMigrationSteps',
'nfd_show_migration_steps',
'update_site_server_clicked',
);

Expand Down Expand Up @@ -322,7 +322,7 @@ public function register_settings() {
);
\register_setting(
'general',
'showMigrationSteps',
'nfd_show_migration_steps',
array(
'show_in_rest' => true,
'type' => 'boolean',
Expand Down Expand Up @@ -707,7 +707,7 @@ function check_url_match( $brand_name, $site_url ) {
}
}
if ( check_url_match( $brand, $site_url ) ) {
update_option( 'showMigrationSteps', false );
update_option( 'nfd_show_migration_steps', false );
}
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@newfold-labs/wp-module-ecommerce",
"description": "Brand Agnostic eCommerce Experience",
"license": "GPL-2.0-or-later",
"version": "1.3.33",
"version": "1.3.34",
"main": "build/index.js",
"files": [
"build/",
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnboardingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function OnboardingScreen({

useEffect(() => {
WordPressSdk.settings.get().then((res) => {
setIsMigrationCompleted( res.showMigrationSteps || false );
setIsMigrationCompleted( res.nfd_show_migration_steps || false );
setWebServersUpdated( res.update_site_server_clicked );
if (res?.page_on_front && res?.show_on_front === "page") {
setEditUrl(
Expand Down
6 changes: 6 additions & 0 deletions src/components/SiteStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ export function SiteStatus({ comingSoon, toggleComingSoon, notify }) {
$statusText.style.setProperty("color", "var(--nfd-ecommerce-text-dark-success)");
}
});

if (!comingSoon) {
return null;
}

return (
<div
data-testid="siteStatus"
className={classNames(
"nfd-px-4 nfd-py-2 nfd-rounded-lg nfd-bg-canvas",
"max-[1027px]:nfd-flex max-[1027px]:nfd-flex-col",
Expand Down
10 changes: 5 additions & 5 deletions src/configs/OnboardingList.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const updateMigrateViewGuide = () => {
};

const updateStoreSetup = (setIsMigrationCompleted) => {
WordPressSdk.settings.put({ showMigrationSteps: false }).then(() => {
WordPressSdk.settings.put({ nfd_show_migration_steps: false }).then(() => {
WordPressSdk.settings.get();
setIsMigrationCompleted(false);
});
Expand Down Expand Up @@ -88,7 +88,7 @@ export function OnboardingListDefinition(props) {
),
state: {
isCompleted: (queries) => queries?.settings?.update_site_server_clicked || check_url_match(brandName),
isMigrated: (queries) => queries?.settings?.showMigrationSteps && props.isMigrationCompleted
isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps && props.isMigrationCompleted
},
shouldRender: (state) => (state.isMigrated),
actions: {
Expand All @@ -112,7 +112,7 @@ export function OnboardingListDefinition(props) {
),
state: {
isCompleted: () => check_url_match( brandName ),
isMigrated: (queries) => queries?.settings?.showMigrationSteps && props.isMigrationCompleted,
isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps && props.isMigrationCompleted,
},

"data-nfdhelpcenterquery": __(
Expand All @@ -136,7 +136,7 @@ export function OnboardingListDefinition(props) {
),
state: {
isCompleted: (queries) => (queries?.settings?.update_site_server_clicked && check_url_match(brandName)) || check_url_match(brandName),
isMigrated: (queries) => queries?.settings?.showMigrationSteps,
isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps,
className: () => "nfd-bg-canvas",
hideCheck: () => true,
showText: () => <a className="nfd-underline" href={ VIEW_GUIDE_LINK[brandName] } target="_blank">View Guide</a>
Expand All @@ -158,7 +158,7 @@ export function OnboardingListDefinition(props) {
),
state: {
isCompleted: (queries) => !props.isMigrationCompleted,
isMigrated: (queries) => queries?.settings?.showMigrationSteps && (queries?.settings?.update_site_server_clicked || check_url_match(brandName)),
isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps && (queries?.settings?.update_site_server_clicked || check_url_match(brandName)),
},
shouldRender: (state) => state.isMigrated && !state.isCompleted,
actions: {
Expand Down
1 change: 1 addition & 0 deletions tests/cypress/integration/Home/ecommerce-coming-soon.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe(
cy.url().should( 'eq', Cypress.config().baseUrl + '/' );
cy.go( 'back' );
cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click();
cy.get('[data-testid="siteStatus"]').should('not.exist');
cy.get( '.nfd-notification--success' ).should( 'exist' );
} );
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/Home/migration.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe(
this.skip();
}
cy.exec(
`npx wp-env run cli wp option set showMigrationSteps "true"`
`npx wp-env run cli wp option set nfd_show_migration_steps "true"`
);
cy.exec(
`npx wp-env run cli wp option delete _transient_nfd_site_capabilities`,
Expand Down

0 comments on commit bb0ee79

Please sign in to comment.