Merge pull request #3240 from woocommerce/PCP-4393-minor-features-related-scrolling-and-highlighting-fixes

Settings UI: Add Minor Features scrolling/highlight fixes (4393)
This commit is contained in:
Emili Castells 2025-03-21 17:16:46 +01:00 committed by GitHub
commit 93aa4b73f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 17 deletions

View file

@ -32,7 +32,10 @@ const FeatureItem = ( {
); );
const handleClick = async ( feature ) => { const handleClick = async ( feature ) => {
if ( feature.action?.type === 'tab' ) { if ( feature.action?.type === 'tab' ) {
const highlight = Boolean( feature.action?.highlight ); const highlight =
feature.action?.highlight === undefined
? true
: Boolean( feature.action.highlight );
const tabId = TAB_IDS[ feature.action.tab.toUpperCase() ]; const tabId = TAB_IDS[ feature.action.tab.toUpperCase() ];
await selectTab( tabId, feature.action.section, highlight ); await selectTab( tabId, feature.action.section, highlight );
} }

View file

@ -150,11 +150,10 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-credit-card-gateway', 'section' => 'ppcp-credit-card-gateway',
'highlight' => 'ppcp-credit-card-gateway', 'modal' => 'ppcp-credit-card-gateway',
'modal' => 'ppcp-credit-card-gateway',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -189,7 +188,7 @@ class FeaturesDefinition {
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-alternative-payments-card', 'section' => 'ppcp-alternative-payments-card',
'highlight' => 'ppcp-alternative-payments-card', 'highlight' => false,
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -218,11 +217,10 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-googlepay', 'section' => 'ppcp-googlepay',
'highlight' => 'ppcp-googlepay', 'modal' => 'ppcp-googlepay',
'modal' => 'ppcp-googlepay',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -257,11 +255,10 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-card-payments-card', 'section' => 'ppcp-applepay',
'highlight' => 'ppcp-applepay', 'modal' => 'ppcp-applepay',
'modal' => 'ppcp-applepay',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',