{ pluginsToPromote.map(
( shippingMethod ) => {
const pluginsForPartner = [
shippingMethod?.slug,
...( shippingMethod?.dependencies ??
[] ),
].filter(
( element ) =>
element !== undefined
); // remove undefineds
return (
{
createNoticesFromResponse(
response
);
recordEvent(
'tasklist_shipping_label_printing',
{
install: true,
plugins_to_activate:
pluginsForPartner,
}
);
invalidateResolutionForStoreSelector();
this.completeStep();
} }
onError={ (
errors,
response
) =>
createNoticesFromResponse(
response
)
}
installText={ __(
'Install and enable',
'woocommerce'
) }
learnMoreLink={
shippingMethod.learn_more_link
}
onLearnMore={ () => {
recordEvent(
'tasklist_shipping_label_printing_learn_more',
{
plugin: shippingMethod.slug,
}
);
} }
pluginSlugs={
pluginsForPartner
}
installButtonVariant={
'secondary'
}
/>
);
}
) }
) }
{ pluginsToPromote.length === 1 &&
pluginsToPromote[ 0 ].slug === undefined && ( // if it doesn't have a slug we just show a download button