From b33da7a70a61e6869a979695f40130cefe227895 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Wed, 26 Apr 2023 12:20:08 +0200 Subject: [PATCH] Improve copy in Search app (#428) --- .changeset/shaggy-pumas-develop.md | 5 ++ .../configuration/configuration.view.tsx | 89 ++++++++++++++++++- 2 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 .changeset/shaggy-pumas-develop.md diff --git a/.changeset/shaggy-pumas-develop.md b/.changeset/shaggy-pumas-develop.md new file mode 100644 index 0000000..8b7adb2 --- /dev/null +++ b/.changeset/shaggy-pumas-develop.md @@ -0,0 +1,5 @@ +--- +"saleor-app-search": patch +--- + +Improved helping description - added supported events and links to docs diff --git a/apps/search/src/views/configuration/configuration.view.tsx b/apps/search/src/views/configuration/configuration.view.tsx index acbcf0b..7ef187f 100644 --- a/apps/search/src/views/configuration/configuration.view.tsx +++ b/apps/search/src/views/configuration/configuration.view.tsx @@ -2,20 +2,101 @@ import { Box, Text } from "@saleor/macaw-ui/next"; import { AppSection } from "../../components/AppSection"; import { AlgoliaConfigurationForm } from "../../components/AlgoliaConfigurationForm"; import { ImportProductsToAlgolia } from "../../components/ImportProductsToAlgolia"; +import { actions, useAppBridge } from "@saleor/app-sdk/app-bridge"; + +const SALEOR_EVENTS_DOCS_URL = + "https://docs.saleor.io/docs/3.x/developer/extending/apps/asynchronous-webhooks#available-webhook-events"; + +const ALGOLIA_DASHBOARD_TOKENS_URL = "https://www.algolia.com/account/api-keys/all"; export const ConfigurationView = () => { + const { appBridge } = useAppBridge(); + return ( Configuration - - Configure the App - fill your Algolia settings to allow products indexing - + + + To configure the App, fill in your Algolia settings to enable products indexing. + + + Once the App is configured, you will be able to perform initial index of your existing + Saleor database. + + + The app supports following{" "} + { + e.preventDefault(); + + /** + * TODO extract shared handler + */ + appBridge?.dispatch( + actions.Redirect({ + to: SALEOR_EVENTS_DOCS_URL, + newContext: true, + }) + ); + }} + href={SALEOR_EVENTS_DOCS_URL} + > + events + {" "} + that will synchronize Algolia in the background: + +
    +
  • + - PRODUCT_CREATED +
  • +
  • + - PRODUCT_UPDATED +
  • +
  • + - PRODUCT_DELETED +
  • +
  • + - PRODUCT_VARIANT_CREATED +
  • +
  • + - PRODUCT_VARIANT_UPDATED +
  • +
  • + - PRODUCT_VARIANT_DELETED +
  • +
+
+ } - sideContent={Provide Algolia settings. } + sideContent={ + + + Provide Algolia settings.{" "} + + + You can find your tokens in Algolia Dashboard{" "} + { + e.preventDefault(); + + appBridge?.dispatch( + actions.Redirect({ + to: ALGOLIA_DASHBOARD_TOKENS_URL, + newContext: true, + }) + ); + }} + > + here + + + + } />