From 2ffc11cfb919710e4d8dc931fd6e49f285ac633d Mon Sep 17 00:00:00 2001 From: manikantakailasa Date: Thu, 18 Jul 2024 16:01:17 +0530 Subject: [PATCH] fix PRESS0-1791 --- src/components/SalesChannel.js | 508 ++++++++++++++++----------------- 1 file changed, 254 insertions(+), 254 deletions(-) diff --git a/src/components/SalesChannel.js b/src/components/SalesChannel.js index 2c8389c7..742cc538 100644 --- a/src/components/SalesChannel.js +++ b/src/components/SalesChannel.js @@ -21,305 +21,305 @@ import { NewfoldRuntime } from "../sdk/NewfoldRuntime"; import { PluginsSdk } from "../sdk/plugins"; import { LoadingPanel } from "./LoadingPanel"; import { Section } from "./Section"; - + let ecomdashParser = ecomdashPluginStatusParser("nfd_slug_ecomdash_wordpress_plugin"); -export function SalesChannel(props){ - +export function SalesChannel(props) { + let ecomdashStatus = useSWR( "nfd_slug_ecomdash_wordpress_plugin-status", () => - PluginsSdk.queries - .status("woocommerce", "nfd_slug_ecomdash_wordpress_plugin") - .then(ecomdashParser), + PluginsSdk.queries + .status("woocommerce", "nfd_slug_ecomdash_wordpress_plugin") + .then(ecomdashParser), { refreshInterval: 30 * 1000 } - ); + ); + + const { wpModules } = props; + const [isOpen, setIsOpen] = useState(false); + const canAccessGlobalCTB = NewfoldRuntime.hasCapability("canAccessGlobalCTB"); + const hasYithExtended = NewfoldRuntime.hasCapability("hasYithExtended"); + const hasEcomdash = NewfoldRuntime.hasCapability("hasEcomdash") + const [ecomdashSetupStatus, setEcomdashSetupStatus] = useState("") + - const {wpModules} = props; - const [isOpen, setIsOpen] = useState(false); - const canAccessGlobalCTB = NewfoldRuntime.hasCapability("canAccessGlobalCTB"); - const hasYithExtended = NewfoldRuntime.hasCapability("hasYithExtended"); - const hasEcomdash = NewfoldRuntime.hasCapability("hasEcomdash") - const [ecomdashSetupStatus, setEcomdashSetupStatus] = useState("") - - - useEffect(() => { - (ecomdashStatus.data?.isInstalling && !ecomdashStatus.data.isInstalled) ? setIsOpen(true) : setIsOpen(false) - }, [ecomdashStatus.data?.isInstalling]) - - useEffect(() => { + useEffect(() => { + (ecomdashStatus.data?.isInstalling && !ecomdashStatus.data.isInstalled) ? setIsOpen(true) : setIsOpen(false) + }, [ecomdashStatus.data?.isInstalling]) + + useEffect(() => { let pluginConnectionStatus = async () => { try { - const response = await fetch("/wp-admin/admin.php?page=newfold-ecomdash-settings"); - const text = await response.text(); - const parser = new DOMParser(); - const doc = parser.parseFromString(text, 'text/html'); - const element = doc.querySelector('#disconnect-instance'); - setEcomdashSetupStatus(element === null); - return element === null + const response = await fetch("/wp-admin/admin.php?page=newfold-ecomdash-settings"); + const text = await response.text(); + const parser = new DOMParser(); + const doc = parser.parseFromString(text, 'text/html'); + const element = doc.querySelector('#disconnect-instance'); + setEcomdashSetupStatus(element === null); + return element === null } catch (error) { - console.error('Error fetching HTML:', error); + console.error('Error fetching HTML:', error); } - } - if(ecomdashStatus?.data?.isInstalled){ + } + if (ecomdashStatus?.data?.isInstalled) { pluginConnectionStatus() - } - }, [ecomdashStatus?.data?.isInstalled]) - - return( + } + }, [ecomdashStatus?.data?.isInstalled]) + + return ( hasYithExtended && canAccessGlobalCTB && hasEcomdash && (ecomdashStatus?.data?.isInstalled || ecomdashStatus?.data?.isNeedToInstall || ecomdashStatus.data?.isInstalling) ? - <> - - - - -
-
-

+ <> + + + + +
+
+

{__("Sell your products everywhere, confidently, with Ecomdash.", "wp-module-ecommerce")} -

-

- {__("With ecomdash, you can manage different sales channels all in one place.", "wp-module-ecommerce")} -
- {__("Simply connect your business accounts from Amazon, Etsy or Walmart to", "wp-module-ecommerce")} -
- {__("your ecomdash platform and easily manage products, customer orders and", "wp-module-ecommerce")} -
- {__("more saving you valuable time.", "wp-module-ecommerce")}​ -

- -
- -
+ ) : null} + id={ecomdashStatus.data.isInstalled ? "manage-ecomdash" : "install-ecomdash"} + > + {ecomdashStatus.data.isInstalled ? (ecomdashSetupStatus ? __("Get Started Now", "wp-module-ecommerce") : __("Go to Ecomdash", "wp-module-ecommerce")) : __("Install Now", "wp-module-ecommerce")} + +

+ +
-
-
-
-

- {__("Manage inventory across multiple platforms", "wp-module-ecommerce")} -

- +
+
+
+

+ {__("Manage inventory across multiple platforms", "wp-module-ecommerce")} +

+ +
+
    +
  • + + + {__("Enjoy near real-time inventory updates for an unlimited number of", "wp-module-ecommerce")} +
    + {__("channels with our inventory management software.", "wp-module-ecommerce")} +
    +
  • +
  • + + + {__("Manage product levels across multiple warehouses ", "wp-module-ecommerce")} +
    + {__("without the fear of overselling.", "wp-module-ecommerce")} +
    +
  • +
  • + + + {__("Accurately sync kits, multipacks, and components without any", "wp-module-ecommerce")} +
    + {__("headaches.", "wp-module-ecommerce")} +
    +
  • +
-
    -
  • - - - {__("Enjoy near real-time inventory updates for an unlimited number of", "wp-module-ecommerce")} -
    - {__("number of channels with our inventory management software.", "wp-module-ecommerce")} -
    -
  • -
  • - - - {__("Manage product levels across multiple warehouses without the fear of overselling.", "wp-module-ecommerce")} -
    - {__("without the fear of overselling.", "wp-module-ecommerce")} -
    -
  • -
  • - - - {__("Accurately sync kits, multipacks, and components without any", "wp-module-ecommerce")} -
    - {__("headaches.", "wp-module-ecommerce")} -
    -
  • -
+
- -
- -
-

- {__("Order Management and Reporting", "wp-module-ecommerce")} -

-

- {__("With Ecomdash you can sit back and relax, knowing that all aspects of order fulfillment are under control. Easily track your top selling items, cost of goods sold, stale inventory and more with Ecomdash's extensive reporting tools.", "wp-module-ecommerce")} -

- -
+
+

+ {__("Order Management and Reporting", "wp-module-ecommerce")} +

+

+ {__("With Ecomdash you can sit back and relax, knowing that all aspects of order fulfillment are under control. Easily track your top selling items, cost of goods sold, stale inventory and more with Ecomdash's extensive reporting tools.", "wp-module-ecommerce")} +

+ +
-
-

- {__("Powerful Add-ons", "wp-module-ecommerce")} -

-

- {__("Ecomdash contains a variety of powerful add-ons that will help you handle everything from creating barcodes and inventory templates, to managing warehouse feeds, Fulfillment By Amazon and even accounting.", "wp-module-ecommerce")} -

-
- -
-

- {__("Fullfillment By Amazon (FBA)", "wp-module-ecommerce")} -

-

- {__("Auto-export non-Amazon orders to FBA. Import the tracking and pass it to the", "wp-module-ecommerce")} -
- {__("originating sales channel, marking it as shipped.", "wp-module-ecommerce")} -

-
-
-
-
-
-
- -

- {__("Barcodes", "wp-module-ecommerce")} -

-
-
- {__("Print barcodes for your products that can be", "wp-module-ecommerce")} -
- {__("used for labeling and scanning your", "wp-module-ecommerce")} -
- {__("products", "wp-module-ecommerce")} -
-
-
-
- -

- {__("Shipping Labels", "wp-module-ecommerce")} -

-
-
- {__("Print shipping labels with a preferred carrier", "wp-module-ecommerce")} -
- {__("right from your ecomdash account and save", "wp-module-ecommerce")} +
+

+ {__("Powerful Add-ons", "wp-module-ecommerce")} +

+

+ {__("Ecomdash contains a variety of powerful add-ons that will help you handle everything from creating barcodes and inventory templates, to managing warehouse feeds, Fulfillment By Amazon and even accounting.", "wp-module-ecommerce")} +

+
+ +
+

+ {__("Fullfillment By Amazon (FBA)", "wp-module-ecommerce")} +

+

+ {__("Auto-export non-Amazon orders to FBA. Import the tracking and pass it to the", "wp-module-ecommerce")}
- {__("on postage.", "wp-module-ecommerce")} -

+ {__("originating sales channel, marking it as shipped.", "wp-module-ecommerce")} +

-
-
- -

- {__("Listing Presets", "wp-module-ecommerce")} -

+
+ +
+
+
+
+ +

+ {__("Barcodes", "wp-module-ecommerce")} +

+
+
+ {__("Print barcodes for your products that can be", "wp-module-ecommerce")} +
+ {__("used for labeling and scanning your", "wp-module-ecommerce")} +
+ {__("products", "wp-module-ecommerce")} +
-
- {__("Create listing presets to cut down most of", "wp-module-ecommerce")} -
- {__("the manual data entry needed when creating", "wp-module-ecommerce")} -
- {__("new listings.", "wp-module-ecommerce")} +
+
+ +

+ {__("Shipping Labels", "wp-module-ecommerce")} +

+
+
+ {__("Print shipping labels with a preferred carrier", "wp-module-ecommerce")} +
+ {__("right from your ecomdash account and save", "wp-module-ecommerce")} +
+ {__("on postage.", "wp-module-ecommerce")} +
-
-
-
- -

- {__("Accounting", "wp-module-ecommerce")} -

+
+
+ +

+ {__("Listing Presets", "wp-module-ecommerce")} +

+
+
+ {__("Create listing presets to cut down most of", "wp-module-ecommerce")} +
+ {__("the manual data entry needed when creating", "wp-module-ecommerce")} +
+ {__("new listings.", "wp-module-ecommerce")} +
-
- {__("Seamlessly communicate your sales and", "wp-module-ecommerce")} -
- {__("purchase order information directly to your", "wp-module-ecommerce")} -
- {__("accounting software.", "wp-module-ecommerce")} +
+
+ +

+ {__("Accounting", "wp-module-ecommerce")} +

+
+
+ {__("Seamlessly communicate your sales and", "wp-module-ecommerce")} +
+ {__("purchase order information directly to your", "wp-module-ecommerce")} +
+ {__("accounting software.", "wp-module-ecommerce")} +
-
-
-
-
- -

- {__("Custom Inventory Templates", "wp-module-ecommerce")} -

-
-
- {__("Creating a custom file template allows you to", "wp-module-ecommerce")} -
- {__("upload and/or export files with product data", "wp-module-ecommerce")} -
- {__("for thousands of products at once.", "wp-module-ecommerce")} +
+
+
+ +

+ {__("Custom Inventory Templates", "wp-module-ecommerce")} +

+
+
+ {__("Creating a custom file template allows you to", "wp-module-ecommerce")} +
+ {__("upload and/or export files with product data", "wp-module-ecommerce")} +
+ {__("for thousands of products at once.", "wp-module-ecommerce")} +
-
-
-
- -

- {__("Warehouse Feeds", "wp-module-ecommerce")} -

+
+
+ +

+ {__("Warehouse Feeds", "wp-module-ecommerce")} +

+
+
+ {__("Setup feeds to export your sales orders via", "wp-module-ecommerce")} +
+ {__("email or FTP sites to third parties such as", "wp-module-ecommerce")} +
+ {__("Dropshippers, Suppliers, or 3PL systems.", "wp-module-ecommerce")} +
-
- {__("Setup feeds to export your sales orders via", "wp-module-ecommerce")} -
- {__("email or FTP sites to third parties such as", "wp-module-ecommerce")} -
- {__("Dropshippers, Suppliers, or 3PL systems.", "wp-module-ecommerce")} -
-
-
-
- -

- {__("Purchase Orders", "wp-module-ecommerce")} -

-
-
- {__("Quickly create new orders and have", "wp-module-ecommerce")} -
- {__("inventory quantities adjusted and synced out", "wp-module-ecommerce")} -
- {__("to listings as units are received.", "wp-module-ecommerce")} +
+
+ +

+ {__("Purchase Orders", "wp-module-ecommerce")} +

+
+
+ {__("Quickly create new orders and have", "wp-module-ecommerce")} +
+ {__("inventory quantities adjusted and synced out", "wp-module-ecommerce")} +
+ {__("to listings as units are received.", "wp-module-ecommerce")} +
-
-
+
-
-
- - setIsOpen(false)} - className="wppbh-app-sidenav-mobile nfd-z-40" - initialFocus - > - -
- +
- - - - - : null + + setIsOpen(false)} + className="wppbh-app-sidenav-mobile nfd-z-40" + initialFocus + > + +
+ +
+
+
+ + + : null ) } \ No newline at end of file