diff --git a/build/index.asset.php b/build/index.asset.php index e57e119f..1ca905c3 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'eecc12c22373ac174970'); + array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '69f35e99750e633d9e55'); diff --git a/src/components/YITHPlugins.js b/src/components/YITHPlugins.js index 15ced55a..b0743282 100644 --- a/src/components/YITHPlugins.js +++ b/src/components/YITHPlugins.js @@ -14,19 +14,22 @@ import booking from "../icons/brands/yith-woocommerce-booking.svg"; import customizeAccount from "../icons/brands/yith-woocommerce-customize-myaccount-page.svg"; import gift from "../icons/brands/yith-woocommerce-gift-card.svg"; import wishList from "../icons/brands/yith-woocommerce-wishlist.svg"; -import { RuntimeSdk } from "../sdk/runtime"; +import { + YITH_WOOCOMMERCE_ACCOUNT_PAGE, + YITH_WOOCOMMERCE_AJAX_PRODUCT_FILTER, + YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS, + YITH_WOOCOMMERCE_GIFT_CARDS, + YITH_WOOCOMMERCE_WISHLIST +} from "../constants"; export function YITHPlugins({ woo, wpModules }) { - const isBluehost = RuntimeSdk?.brandSettings?.brand?.includes("bluehost"); const yithPluginsMap = new Map([ [ "fc4cbc14-470d-471b-b448-c6666e5b763d", { title: "nfd_slug_yith_woocommerce_booking", name: "YITH Booking and Appointment for WooCommerce", - learnMore: - isBluehost && - "https://www.bluehost.com/help/article/yith-booking-and-appointment-for-woocommerce", + learnMore: YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS, image: booking, }, ], @@ -43,9 +46,7 @@ export function YITHPlugins({ woo, wpModules }) { { title: "nfd_slug_yith_woocommerce_wishlist", name: "YITH WooCommerce Wishlist", - learnMore: - isBluehost && - "https://www.bluehost.com/help/article/yith-woocommerce-wishlist", + learnMore: YITH_WOOCOMMERCE_WISHLIST, image: wishList, }, ], @@ -54,9 +55,7 @@ export function YITHPlugins({ woo, wpModules }) { { title: "nfd_slug_yith_woocommerce_ajax_product_filter", name: "YITH WooCommerce Ajax Product Filter", - learnMore: - isBluehost && - "https://www.bluehost.com/help/article/yith-woocommerce-ajax-product-filter", + learnMore: YITH_WOOCOMMERCE_AJAX_PRODUCT_FILTER, image: filter, }, ], @@ -65,9 +64,7 @@ export function YITHPlugins({ woo, wpModules }) { { title: "nfd_slug_yith_woocommerce_gift_cards", name: "YITH WooCommerce Gift Cards", - learnMore: - isBluehost && - "https://www.bluehost.com/help/article/yith-woocommerce-gift-cards", + learnMore: YITH_WOOCOMMERCE_GIFT_CARDS, image: gift, }, ], @@ -76,9 +73,7 @@ export function YITHPlugins({ woo, wpModules }) { { title: "nfd_slug_yith_woocommerce_customize_myaccount_page", name: "YITH WooCommerce Customize My Account Page", - learnMore: - isBluehost && - "https://www.bluehost.com/help/article/yith-woocommerce-customize-my-account-page", + learnMore: YITH_WOOCOMMERCE_ACCOUNT_PAGE, image: customizeAccount, }, ], diff --git a/src/configs/ProductsAndServices.config.js b/src/configs/ProductsAndServices.config.js index 790fc13c..5f358ab1 100644 --- a/src/configs/ProductsAndServices.config.js +++ b/src/configs/ProductsAndServices.config.js @@ -17,7 +17,10 @@ import { wcPluginStatusParser, wcProductsParser, } from "./selectors"; -import { RuntimeSdk } from "../sdk/runtime"; +import { + YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS, + YITH_WOOCOMMERCE_GIFT_CARDS +} from "../constants"; const getUrl = (href) => { let [page, qs] = href.split("?"); @@ -26,8 +29,6 @@ const getUrl = (href) => { return `${page}?${query}`; }; -const isBluehost = RuntimeSdk?.brandSettings?.brand?.includes("bluehost"); - function defineFeatureState() { return { isDisabled: (data) => data?.plugins?.isWCActive === false, @@ -159,9 +160,7 @@ export const ProductsAndServicesDefinition = (props) => ({ assets: ({ isActive }) => ({ Image: CalendarIcon, ActionIcon: isActive, - learnMoreUrl: - isBluehost && - "https://www.bluehost.com/help/article/yith-booking-and-appointment-for-woocommerce", + learnMoreUrl: YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS, }), text: (state) => ({ title: __( @@ -217,9 +216,7 @@ export const ProductsAndServicesDefinition = (props) => ({ assets: ({ isActive }) => ({ Image: GiftIcon, ActionIcon: isActive, - learnMoreUrl: - isBluehost && - "https://www.bluehost.com/help/article/yith-woocommerce-gift-cards", + learnMoreUrl: YITH_WOOCOMMERCE_GIFT_CARDS, }), text: (state) => ({ title: __("YITH WooCommerce Gift Cards", "wp-module-ecommerce"), diff --git a/src/configs/YITHPlugins.config.js b/src/configs/YITHPlugins.config.js index 1611bbd6..5893932c 100644 --- a/src/configs/YITHPlugins.config.js +++ b/src/configs/YITHPlugins.config.js @@ -13,7 +13,13 @@ import { MarketplaceSdk } from '../sdk/marketplace'; import { PluginsSdk } from '../sdk/plugins'; import { createPluginInstallAction } from './actions'; import { findUpsellWithName, wcPluginStatusParser } from './selectors'; -import { RuntimeSdk } from '../sdk/runtime'; +import { + YITH_WOOCOMMERCE_ACCOUNT_PAGE, + YITH_WOOCOMMERCE_AJAX_PRODUCT_FILTER, + YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS, + YITH_WOOCOMMERCE_GIFT_CARDS, + YITH_WOOCOMMERCE_WISHLIST +} from '../constants'; export function defineFeatureState() { return { @@ -28,8 +34,6 @@ export function defineFeatureState() { }; } -const isBluehost = RuntimeSdk?.brandSettings?.brand?.includes('bluehost'); - export const YITHPluginsDefinitions = (props) => ({ dataDependencies: { plugins: async () => PluginsSdk.queries.status('all'), @@ -43,9 +47,7 @@ export const YITHPluginsDefinitions = (props) => ({ assets: () => ({ Image: Booking, ActionIcon: null, - learnMoreUrl: - isBluehost && - 'https://www.bluehost.com/help/article/yith-booking-and-appointment-for-woocommerce', + learnMoreUrl: YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS, }), text: ({ isActive }) => ({ title: __( @@ -120,9 +122,7 @@ export const YITHPluginsDefinitions = (props) => ({ name: 'nfd_slug_yith_woocommerce_wishlist', assets: () => ({ Image: WishList, - learnMoreUrl: - isBluehost && - 'https://www.bluehost.com/help/article/yith-woocommerce-wishlist', + learnMoreUrl: YITH_WOOCOMMERCE_WISHLIST, }), text: ({ isActive }) => ({ title: __('YITH WooCommerce Wishlist', 'wp-module-ecommerce'), @@ -158,9 +158,7 @@ export const YITHPluginsDefinitions = (props) => ({ name: 'nfd_slug_yith_woocommerce_ajax_product_filter', assets: () => ({ Image: Filter, - learnMoreUrl: - isBluehost && - 'https://www.bluehost.com/help/article/yith-woocommerce-ajax-product-filter', + learnMoreUrl: YITH_WOOCOMMERCE_AJAX_PRODUCT_FILTER, }), text: ({ isActive }) => ({ title: __( @@ -201,9 +199,7 @@ export const YITHPluginsDefinitions = (props) => ({ name: 'nfd_slug_yith_woocommerce_gift_cards', assets: () => ({ Image: Gift, - learnMoreUrl: - isBluehost && - 'https://www.bluehost.com/help/article/yith-woocommerce-gift-cards', + learnMoreUrl: YITH_WOOCOMMERCE_GIFT_CARDS, }), text: ({ isActive }) => ({ title: __('YITH WooCommerce Gift Cards', 'wp-module-ecommerce'), @@ -241,9 +237,7 @@ export const YITHPluginsDefinitions = (props) => ({ name: 'nfd_slug_yith_woocommerce_customize_myaccount_page', assets: () => ({ Image: CustomizeAccount, - learnMoreUrl: - isBluehost && - 'https://www.bluehost.com/help/article/yith-woocommerce-customize-my-account-page', + learnMoreUrl: YITH_WOOCOMMERCE_ACCOUNT_PAGE, }), text: ({ isActive }) => ({ title: __( diff --git a/src/constants.js b/src/constants.js new file mode 100644 index 00000000..407c1814 --- /dev/null +++ b/src/constants.js @@ -0,0 +1,5 @@ +export const YITH_WOOCOMMERCE_BOOKING_APPOINTMENTS = "https://docs.yithemes.com/yith-woocommerce-booking-extended/"; +export const YITH_WOOCOMMERCE_WISHLIST = "https://docs.yithemes.com/yith-woocommerce-wishlist-extended/"; +export const YITH_WOOCOMMERCE_AJAX_PRODUCT_FILTER = "https://docs.yithemes.com/yith-woocommerce-ajax-product-filter-extended/"; +export const YITH_WOOCOMMERCE_GIFT_CARDS = "https://docs.yithemes.com/yith-woocommerce-gift-cards-extended/"; +export const YITH_WOOCOMMERCE_ACCOUNT_PAGE = "https://docs.yithemes.com/yith-woocommerce-customize-myaccount-page-extended/";