Use the new woocommerce tab

[MAILPOET-2708]
This commit is contained in:
Amine Ben hammou
2020-04-01 05:05:59 +02:00
committed by Veljko V
parent eb8f9ccd2f
commit f6dc87ae83
4 changed files with 13 additions and 167 deletions

View File

@@ -49,9 +49,12 @@ if (jQuery('#mailpoet_settings').length > 0) {
if (tab === 'basics') {
window.location.href = '?page=mailpoet-new-settings#/basics';
}
if (tab === 'woocommerce' && !window.mailpoet_woocommerce_active) {
window.location.hash = '#basics';
return;
if (tab === 'woocommerce') {
if (!window.mailpoet_woocommerce_active) {
window.location.href = '?page=mailpoet-new-settings#/basics';
} else {
window.location.href = '?page=mailpoet-new-settings#/woocommerce';
}
}
// reset all active tabs
jQuery('.nav-tab-wrapper a').removeClass('nav-tab-active');

View File

@@ -33,13 +33,13 @@ export default () => {
{t('sendWithTab')}
</a>
{hasWooCommerce && (
<a
className="nav-tab"
href="?page=mailpoet-settings#woocommerce"
data-automation-id="woocommerce_settings_tab"
<TabLink
name="woocommerce"
current={current}
automationId="woocommerce_settings_tab"
>
{t('wooCommerceTab')}
</a>
</TabLink>
)}
<a
className="nav-tab"