2023-04-25 16:20:20 +00:00
|
|
|
import { Box, Text } from "@saleor/macaw-ui/next";
|
|
|
|
import { AppSection } from "../../components/AppSection";
|
|
|
|
import { AlgoliaConfigurationForm } from "../../components/AlgoliaConfigurationForm";
|
|
|
|
import { ImportProductsToAlgolia } from "../../components/ImportProductsToAlgolia";
|
2023-04-26 10:20:08 +00:00
|
|
|
import { actions, useAppBridge } from "@saleor/app-sdk/app-bridge";
|
2023-04-29 09:30:48 +00:00
|
|
|
import { WebhooksStatus } from "../../components/WebhooksStatus";
|
|
|
|
import { MainInstructions } from "../../components/MainInstructions";
|
|
|
|
import { WebhooksStatusInstructions } from "../../components/WebhooksStatusInstructions";
|
2023-05-16 19:07:08 +00:00
|
|
|
import { TextLink } from "@saleor/apps-ui";
|
2023-04-26 10:20:08 +00:00
|
|
|
|
|
|
|
const ALGOLIA_DASHBOARD_TOKENS_URL = "https://www.algolia.com/account/api-keys/all";
|
2023-04-25 16:20:20 +00:00
|
|
|
|
|
|
|
export const ConfigurationView = () => {
|
2023-04-26 10:20:08 +00:00
|
|
|
const { appBridge } = useAppBridge();
|
|
|
|
|
2023-04-25 16:20:20 +00:00
|
|
|
return (
|
|
|
|
<Box>
|
|
|
|
<Text variant={"hero"} size={"medium"} as={"h1"}>
|
|
|
|
Configuration
|
|
|
|
</Text>
|
2023-04-29 09:30:48 +00:00
|
|
|
<MainInstructions marginTop={4} __marginBottom={"100px"} />
|
2023-04-26 10:20:08 +00:00
|
|
|
|
2023-04-29 09:30:48 +00:00
|
|
|
<AppSection
|
|
|
|
includePadding
|
|
|
|
heading="Webhooks status"
|
|
|
|
sideContent={<WebhooksStatusInstructions />}
|
|
|
|
mainContent={<WebhooksStatus />}
|
|
|
|
/>
|
2023-04-26 10:20:08 +00:00
|
|
|
|
2023-04-25 16:20:20 +00:00
|
|
|
<AppSection
|
2023-04-29 09:30:48 +00:00
|
|
|
marginTop={13}
|
2023-04-25 16:20:20 +00:00
|
|
|
heading="Algolia settings"
|
|
|
|
mainContent={<AlgoliaConfigurationForm />}
|
2023-04-26 10:20:08 +00:00
|
|
|
sideContent={
|
|
|
|
<Box>
|
|
|
|
<Text as="p" marginBottom={4}>
|
|
|
|
Provide Algolia settings.{" "}
|
|
|
|
</Text>
|
|
|
|
<Text>
|
2023-05-16 19:07:08 +00:00
|
|
|
You can find your tokens in Algolia Dashboard
|
|
|
|
<TextLink href={ALGOLIA_DASHBOARD_TOKENS_URL} newTab>
|
2023-04-26 10:20:08 +00:00
|
|
|
here
|
2023-05-16 19:07:08 +00:00
|
|
|
</TextLink>
|
2023-04-26 10:20:08 +00:00
|
|
|
</Text>
|
|
|
|
</Box>
|
|
|
|
}
|
2023-04-25 16:20:20 +00:00
|
|
|
/>
|
|
|
|
<AppSection
|
|
|
|
includePadding
|
|
|
|
marginTop={13}
|
|
|
|
heading="Index products"
|
|
|
|
mainContent={<ImportProductsToAlgolia />}
|
|
|
|
sideContent={
|
|
|
|
<Box>
|
|
|
|
<Text>Perform initial index of all products in your Saleor database</Text>
|
|
|
|
</Box>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
};
|