diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 23bef347945..11c81347897 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -292,10 +292,6 @@ "context": "products in collection", "string": "Products in {name}" }, - "/eTYOp": { - "context": "app support", - "string": "Support" - }, "/eWPsp": { "string": "Invalid currency used to create transaction" }, @@ -451,10 +447,6 @@ "context": "countries list menu label when no countries are assigned", "string": "There are no countries assigned" }, - "0d6W6p": { - "context": "dialog header", - "string": "Deactivate App" - }, "0dCGBW": { "context": "button", "string": "Create structure" @@ -1000,10 +992,6 @@ "context": "onboarding step description", "string": "Go to all orders where you can create an fulfilment and refund and review corresponding statuses. View the order in GraphQL" }, - "4IgzXs": { - "context": "label", - "string": "App Manifest URL" - }, "4JW9iJ": { "context": "home section name", "string": "Home" @@ -1394,10 +1382,6 @@ "context": "section header", "string": "Create New Shipping Zone" }, - "6hLZNA": { - "context": "delete app", - "string": "Are you sure you want to delete this app?" - }, "6heBHt": { "context": "tooltip, submit form", "string": "Transaction is non-refundable. You have to send refund manually." @@ -1565,10 +1549,6 @@ "context": "select title", "string": "Select channels you want for {contentType} to be available on" }, - "7u9Ep7": { - "context": "Label when app is disabled", - "string": "Disabled" - }, "7v8suW": { "context": "info text", "string": "This rate will apply to all orders" @@ -1703,10 +1683,6 @@ "context": "column header", "string": "Customer e-mail" }, - "94oZR0": { - "context": "deactivate app billing info", - "string": "You will be still billed for the app." - }, "95oJ5d": { "context": "button", "string": "Go back to dashboard" @@ -2582,10 +2558,6 @@ "context": "max price in channel", "string": "Max. value" }, - "EWD/wU": { - "context": "delete app", - "string": "Deleting {name}, you will remove installation of the app. If you are paying for app subscription, remember to unsubscribe from the app in Saleor Marketplace. Are you sure you want to delete the app?" - }, "EYkW1J": { "context": "checkbox label", "string": "Charge taxes for this channel" @@ -2661,10 +2633,6 @@ "context": "invoice create date prefix", "string": "created" }, - "F1VtFa": { - "context": "information", - "string": "Installation is pending..." - }, "F2kF9e": { "string": "You must select transaction that you want to refund" }, @@ -2927,10 +2895,6 @@ "GJwcSd": { "string": "PSP Reference (optional)" }, - "GKQGKG": { - "context": "app data privacy", - "string": "Data privacy" - }, "GLX9II": { "context": "billing address", "string": "Same as shipping address" @@ -3216,9 +3180,6 @@ "HvJPcU": { "string": "Category deleted" }, - "HwHSeY": { - "string": "App disabled" - }, "HwTMFL": { "string": "Go to channels" }, @@ -3269,10 +3230,6 @@ "context": "onboarding step title", "string": "Create a new product" }, - "IEpmGQ": { - "context": "description", - "string": "Use Saleor Cloud to access Saleor Apps" - }, "IF2KbT": { "string": "Saleor Cloud" }, @@ -3930,10 +3887,6 @@ "context": "button label", "string": "All" }, - "MaTR88": { - "context": "header", - "string": "Integrations" - }, "MbZHXE": { "context": "column title balance", "string": "Balance" @@ -4204,10 +4157,6 @@ "O95R3Z": { "string": "Phone" }, - "O987DI": { - "context": "deactivate named app", - "string": "Are you sure you want to disable {name}? Your data will be kept until you reactivate the app." - }, "O9QPe1": { "context": "dialog content", "string": "{counter,plural,one{Are you sure you want to delete this voucher?} other{Are you sure you want to delete {displayQuantity} vouchers?}}" @@ -4760,10 +4709,6 @@ "context": "copy code button label", "string": "Copy code" }, - "RY4PJY": { - "context": "information", - "string": "Installation failed" - }, "RZ32u5": { "context": "PageTypeDeleteWarningDialog single consent label", "string": "Yes, I want to delete this page type and assigned pages" @@ -4799,10 +4744,6 @@ "Rj8LxK": { "string": "Add search engine title and description to make this collection easier to find" }, - "RjT+Vo": { - "context": "label", - "string": "Tunnel - development" - }, "Rjs1CD": { "context": "button", "string": "Continue" @@ -5824,10 +5765,6 @@ "Xu4ST7": { "string": "No conditions added, click button bellow to create one" }, - "Xu4ech": { - "context": "deactivate app", - "string": "Are you sure you want to disable this app? Your data will be kept until you reactivate the app." - }, "XvZCaw": { "string": "Partially refunded" }, @@ -6924,10 +6861,6 @@ "context": "order transaction refund summary description", "string": "The refund amount is calculated automatically based on the items selected. You can modify it manually if needed." }, - "f91E8b": { - "context": "app repository", - "string": "Repository" - }, "fDc5ys": { "context": "order transaction refund summary label", "string": "Selected products" @@ -7148,10 +7081,6 @@ "gVqSnA": { "string": "Assign and save" }, - "gXvoFf": { - "context": "information", - "string": "{releaseDate}" - }, "gZ1qnD": { "string": "No extensions API URL provided" }, @@ -7943,10 +7872,6 @@ "context": "fulfillment status fulfilled", "string": "Fulfilled" }, - "lSd5Zo": { - "context": "app permissions label", - "string": "None" - }, "lT5MYM": { "context": "dialog title", "string": "Unassign users" @@ -8131,9 +8056,6 @@ "context": "resend code to customer title", "string": "Resend code to customer" }, - "mt3SU9": { - "string": "Webhook errors detected" - }, "mvVmbJ": { "string": "Install extension from manifest" }, @@ -8176,10 +8098,6 @@ "context": "money amount input label", "string": "Enter amount" }, - "nA2g2e": { - "context": "label", - "string": "External app" - }, "nABmvC": { "string": "No. of rows" }, @@ -8374,9 +8292,6 @@ "context": "order status", "string": "Unfulfilled" }, - "oCrEdS": { - "string": "Activate the app from the settings. {viewDetails}." - }, "oHbgcK": { "context": "PageTypeDeleteWarningDialog title", "string": "Delete page {selectedTypesCount,plural,one{type} other{types}}" @@ -8385,9 +8300,6 @@ "context": "attribute's editor component", "string": "Catalog Input type for Store Owner" }, - "oJkLQN": { - "string": "Last seen {date}{break}{viewDetails}" - }, "oJkeS6": { "string": "Attribute Code" }, @@ -9696,10 +9608,6 @@ "wQdR8M": { "string": "Add search engine title and description to make this category easier to find" }, - "wRvjoc": { - "context": "app created at label", - "string": "Created at" - }, "wTHjt3": { "string": "Search Orders..." }, @@ -9825,10 +9733,6 @@ "context": "Transaction card title with name", "string": "Transaction - {name}" }, - "xNfh4L": { - "context": "app permissions tooltip header", - "string": "App permissions" - }, "xOEZjV": { "context": "attribute's label", "string": "Default Label" @@ -10119,10 +10023,6 @@ "context": "gift card removed success alert message", "string": "{selectedItemsCount,plural,one{Successfully deleted gift card} other{Successfully deleted gift cards}}" }, - "zQX6xO": { - "context": "dialog header", - "string": "Delete App" - }, "zQvVDJ": { "string": "All" }, @@ -10214,10 +10114,6 @@ "context": "header", "string": "Translation Sale \"{saleName}\" - {languageCode}" }, - "zmnGkp": { - "context": "button", - "string": "Fork on GitHub" - }, "znbVYT": { "context": "product available for purchase date", "string": "Will become available on {date}" diff --git a/src/apps/apps-debug.ts b/src/apps/apps-debug.ts deleted file mode 100644 index 1572ac0fbb7..00000000000 --- a/src/apps/apps-debug.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { createDebug } from "@dashboard/debug"; - -/** @deprecated use utility from extensions/ */ -export const createAppsDebug = (namespace: string) => createDebug(`apps:${namespace}`); diff --git a/src/apps/appstore.types.ts b/src/apps/appstore.types.ts deleted file mode 100644 index 66585c94b3b..00000000000 --- a/src/apps/appstore.types.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Interfaces for shapes of data fetched from AppStore API. - * @deprecated This Appstore SDK is deprecated, and was replaced by Extensions endpoint - * It's now used in extensions/ - */ -// eslint-disable-next-line @typescript-eslint/no-namespace -export namespace AppstoreApi { - export interface SaleorAppBase { - name: { - en: string; - }; - description: { - en: string; - }; - logo: { - source: string | null; - color: string; - }; - integrations: Array<{ - name: string; - logo: { - light: { - source: string; - }; - dark: { - source: string; - }; - }; - }>; - } - - export type ReleasedSaleorApp = SaleorAppBase & { - repositoryUrl: string; - supportUrl: string; - privacyUrl: string; - manifestUrl: string | null; - githubForkUrl?: string; - }; - - export type ComingSoonSaleorApp = SaleorAppBase & { - releaseDate: string; - }; - - export type SaleorApp = ReleasedSaleorApp | ComingSoonSaleorApp; -} diff --git a/src/apps/components/AppAdditionalInfo/AppAdditionalInfo.tsx b/src/apps/components/AppAdditionalInfo/AppAdditionalInfo.tsx deleted file mode 100644 index dc83352bb7f..00000000000 --- a/src/apps/components/AppAdditionalInfo/AppAdditionalInfo.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { AppPermissionFragment } from "@dashboard/graphql"; -import { Box, InfoIcon, Text, Tooltip } from "@saleor/macaw-ui-next"; -import moment from "moment"; -import { PropsWithChildren } from "react"; -import { FormattedMessage } from "react-intl"; - -import { messages } from "./messages"; - -export const AppAdditionalInfo = ({ - permissions, - created, -}: PropsWithChildren<{ - permissions?: AppPermissionFragment[] | null; - created: string | null; -}>) => { - return ( - - - - - - - - - - - - - {permissions?.length ? ( - permissions?.map(permission => ( - - {permission.name} - - )) - ) : ( - - - - )} - - {created && ( - <> - - - - {moment(created).format("YYYY-MM-DD HH:mm")} - - )} - - - ); -}; diff --git a/src/apps/components/AppAdditionalInfo/messages.ts b/src/apps/components/AppAdditionalInfo/messages.ts deleted file mode 100644 index 72f97daf7e0..00000000000 --- a/src/apps/components/AppAdditionalInfo/messages.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineMessages } from "react-intl"; - -export const messages = defineMessages({ - appPermissions: { - id: "xNfh4L", - defaultMessage: "App permissions", - description: "app permissions tooltip header", - }, - noPermissions: { - id: "lSd5Zo", - defaultMessage: "None", - description: "app permissions label", - }, - createdAt: { - id: "wRvjoc", - defaultMessage: "Created at", - description: "app created at label", - }, -}); diff --git a/src/apps/components/AppAlerts/AppRowDisabledAlert.tsx b/src/apps/components/AppAlerts/AppRowDisabledAlert.tsx deleted file mode 100644 index ff793fcbe07..00000000000 --- a/src/apps/components/AppAlerts/AppRowDisabledAlert.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { AppPaths } from "@dashboard/apps/urls"; -import Link from "@dashboard/components/Link"; -import { AppListItemFragment } from "@dashboard/graphql"; -import { DisabledIcon } from "@dashboard/icons/Disabled"; -import { Box, Text, Tooltip } from "@saleor/macaw-ui-next"; -import { FormattedMessage } from "react-intl"; - -interface AppRowDisabledAlertProps { - app: AppListItemFragment; -} - -export const AppRowDisabledAlert = ({ app }: AppRowDisabledAlertProps) => { - if (app.isActive) { - return null; - } - - const detailsLink = AppPaths.resolveAppDetailsPath(app.id); - - return ( - - - - - - - - - - - - - - - - - - - - - - ), - }} - /> - - - - - - ); -}; diff --git a/src/apps/components/AppAlerts/AppRowWebhookIssueAlert.tsx b/src/apps/components/AppAlerts/AppRowWebhookIssueAlert.tsx deleted file mode 100644 index 869565413ef..00000000000 --- a/src/apps/components/AppAlerts/AppRowWebhookIssueAlert.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { AppPaths } from "@dashboard/apps/urls"; -import EventTime from "@dashboard/components/EventTime"; -import Link from "@dashboard/components/Link"; -import { AppListItemFragment } from "@dashboard/graphql"; -import { ExclamationIcon } from "@dashboard/icons/ExclamationIcon"; -import { Box, Text, Tooltip } from "@saleor/macaw-ui-next"; -import { useMemo } from "react"; -import { FormattedMessage } from "react-intl"; - -import { AlertExclamationIcon } from "../AppAlerts/AlertExclamationIcon"; -import { getLatestFailedAttemptFromWebhooks } from "./utils"; - -interface AppRowWebhookIssueAlertProps { - app: AppListItemFragment; -} - -export const AppRowWebhookIssueAlert = ({ app }: AppRowWebhookIssueAlertProps) => { - const latestFailedAttempt = useMemo( - () => app.webhooks && getLatestFailedAttemptFromWebhooks(app.webhooks), - [app], - ); - - if (!latestFailedAttempt) { - return null; - } - - const detailsLink = AppPaths.resolveAppDetailsPath(app.id); - - return ( - - - - - - - - - - - - - - - - - - - , - viewDetails: ( - - - - ), - break:
, - }} - /> -
-
-
-
-
- ); -}; diff --git a/src/apps/components/AppDeactivateDialog/AppDeactivateDialog.test.tsx b/src/apps/components/AppDeactivateDialog/AppDeactivateDialog.test.tsx deleted file mode 100644 index f363f60b6d3..00000000000 --- a/src/apps/components/AppDeactivateDialog/AppDeactivateDialog.test.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import Wrapper from "@test/wrapper"; -import { render, screen } from "@testing-library/react"; - -import { AppDeactivateDialog } from "./AppDeactivateDialog"; -import msgs from "./messages"; - -describe("Apps AppDeactivateDialog", () => { - it("displays action text with app name when third-party app name passed", () => { - // Arrange - const name = "Test App"; - - render( - - - , - ); - - const dialogContent = screen.getByTestId("dialog-content"); - // Assert - const expectedActionText = msgs.deactivateNamedApp.defaultMessage.replace("{name}", name); - const expectedBillingWarning = msgs.deactivateAppBillingInfo.defaultMessage; - - expect(dialogContent).toHaveTextContent(expectedActionText); - expect(dialogContent).toHaveTextContent(expectedBillingWarning); - }); - it("displays action text without app name when third-party app name is empty", () => { - // Arrange - render( - - - , - ); - - const dialogContent = screen.getByTestId("dialog-content"); - // Assert - const expectedText = msgs.deactivateApp.defaultMessage; - const expectedBillingWarning = msgs.deactivateAppBillingInfo.defaultMessage; - - expect(dialogContent).toHaveTextContent(expectedText); - expect(dialogContent).toHaveTextContent(expectedBillingWarning); - }); - it("displays action text without app name when third-party app name is null", () => { - // Arrange - render( - - - , - ); - - const dialogContent = screen.getByTestId("dialog-content"); - // Assert - const expectedText = msgs.deactivateApp.defaultMessage; - const expectedBillingWarning = msgs.deactivateAppBillingInfo.defaultMessage; - - expect(dialogContent).toHaveTextContent(expectedText); - expect(dialogContent).toHaveTextContent(expectedBillingWarning); - }); - it("displays billing warning when app is marked explicitly as third-party", () => { - // Arrange - const name = "Test App"; - - render( - - - , - ); - - const dialogContent = screen.getByTestId("dialog-content"); - // Assert - const expectedBillingWarning = msgs.deactivateAppBillingInfo.defaultMessage; - - expect(dialogContent).toHaveTextContent(expectedBillingWarning); - }); - it("doesn't display billing warning when app is marked explicitly as not third-party", () => { - // Arrange - const name = "Test App"; - - render( - - - , - ); - - const dialogContent = screen.getByTestId("dialog-content"); - // Assert - const notExpectedBillingWarning = msgs.deactivateAppBillingInfo.defaultMessage; - - expect(dialogContent).not.toHaveTextContent(notExpectedBillingWarning); - }); -}); diff --git a/src/apps/components/AppDeactivateDialog/AppDeactivateDialog.tsx b/src/apps/components/AppDeactivateDialog/AppDeactivateDialog.tsx deleted file mode 100644 index 192e12d7190..00000000000 --- a/src/apps/components/AppDeactivateDialog/AppDeactivateDialog.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import ActionDialog from "@dashboard/components/ActionDialog"; -import { ConfirmButtonTransitionState } from "@dashboard/components/ConfirmButton"; -import { buttonMessages } from "@dashboard/intl"; -import { getStringOrPlaceholder } from "@dashboard/misc"; -import { Box } from "@saleor/macaw-ui-next"; -import { PropsWithChildren } from "react"; -import { FormattedMessage, useIntl } from "react-intl"; - -import msgs from "./messages"; - -/** @deprecated use component from extensions/ */ -interface AppDeactivateDialogProps { - confirmButtonState: ConfirmButtonTransitionState; - open: boolean; - name?: string | null; - thirdParty?: boolean; - onClose: () => void; - onConfirm: () => void; -} - -/** @deprecated use component from extensions/ */ -export const AppDeactivateDialog = ({ - confirmButtonState, - open, - name, - thirdParty = true, - onClose, - onConfirm, -}: PropsWithChildren) => { - const intl = useIntl(); - const isNameMissing = name === null || name === ""; - const getMainText = () => { - if (isNameMissing) { - return intl.formatMessage(msgs.deactivateApp); - } - - return intl.formatMessage(msgs.deactivateNamedApp, { - name: {getStringOrPlaceholder(name)}, - }); - }; - - return ( - - - {getMainText()} - {thirdParty && ( - <> - {" "} - - - )} - - - ); -}; - -AppDeactivateDialog.displayName = "AppDeactivateDialog"; diff --git a/src/apps/components/AppDeactivateDialog/messages.ts b/src/apps/components/AppDeactivateDialog/messages.ts deleted file mode 100644 index 60444320a36..00000000000 --- a/src/apps/components/AppDeactivateDialog/messages.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { defineMessages } from "react-intl"; - -/** @deprecated use messages from extensions/ */ -export default defineMessages({ - deactivateAppTitle: { - id: "0d6W6p", - defaultMessage: "Deactivate App", - description: "dialog header", - }, - deactivateApp: { - id: "Xu4ech", - defaultMessage: - "Are you sure you want to disable this app? Your data will be kept until you reactivate the app.", - description: "deactivate app", - }, - deactivateNamedApp: { - id: "O987DI", - defaultMessage: - "Are you sure you want to disable {name}? Your data will be kept until you reactivate the app.", - description: "deactivate named app", - }, - deactivateAppBillingInfo: { - id: "94oZR0", - defaultMessage: "You will be still billed for the app.", - description: "deactivate app billing info", - }, -}); diff --git a/src/apps/components/AppFrame/AppFrame.tsx b/src/apps/components/AppFrame/AppFrame.tsx deleted file mode 100644 index d99f693fb9b..00000000000 --- a/src/apps/components/AppFrame/AppFrame.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { useAppDashboardUpdates } from "@dashboard/apps/components/AppFrame/useAppDashboardUpdates"; -import { useUpdateAppToken } from "@dashboard/apps/components/AppFrame/useUpdateAppToken"; -import { AppDetailsUrlQueryParams } from "@dashboard/apps/urls"; -import { useAllFlags } from "@dashboard/featureFlags"; -import { CircularProgress } from "@material-ui/core"; -import { DashboardEventFactory } from "@saleor/app-sdk/app-bridge"; -import clsx from "clsx"; -import { PropsWithChildren, useCallback, useRef } from "react"; - -import { AppIFrame } from "./AppIFrame"; -import { useStyles } from "./styles"; -import { useAppActions } from "./useAppActions"; -import { useTokenRefresh } from "./useTokenRefresh"; - -interface Props { - src: string; - appToken: string; - appId: string; - className?: string; - params?: AppDetailsUrlQueryParams; - refetch?: () => void; - dashboardVersion: string; - coreVersion?: string; - onError?: () => void; -} - -const getOrigin = (url: string) => new URL(url).origin; - -/** @deprecated Use component from extensions/ */ -export const AppFrame = ({ - src, - appToken, - appId, - className, - params, - onError, - refetch, - dashboardVersion, - coreVersion = "", -}: PropsWithChildren) => { - const frameRef = useRef(null); - const classes = useStyles(); - const appOrigin = getOrigin(src); - const flags = useAllFlags(); - /** - * React on messages from App - */ - const { postToExtension, handshakeDone, setHandshakeDone } = useAppActions( - frameRef.current, - appOrigin, - appId, - appToken, - { - core: coreVersion, - dashboard: dashboardVersion, - }, - ); - - /** - * Listen to Dashboard context like theme or locale and inform app about it - */ - useAppDashboardUpdates(frameRef.current, appOrigin, handshakeDone, appId); - useTokenRefresh(appToken, refetch); - - const handleLoad = useCallback(() => { - /** - * @deprecated - * - * Move handshake to notifyReady, so app is requesting token after it's ready to receive it - * Currently handshake it 2 times, for compatibility - */ - postToExtension( - DashboardEventFactory.createHandshakeEvent(appToken, 1, { - core: coreVersion, - dashboard: dashboardVersion, - }), - ); - setHandshakeDone(true); - }, [appToken, postToExtension, setHandshakeDone]); - - useUpdateAppToken({ - postToExtension, - appToken, - /** - * If app is not ready, ignore this flow - */ - enabled: handshakeDone, - }); - - return ( - <> - {!handshakeDone && ( -
- -
- )} - - - ); -}; diff --git a/src/apps/components/AppFrame/AppIFrame.tsx b/src/apps/components/AppFrame/AppIFrame.tsx deleted file mode 100644 index c2750d63ff7..00000000000 --- a/src/apps/components/AppFrame/AppIFrame.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { AppDetailsUrlQueryParams, AppUrls } from "@dashboard/apps/urls"; -import { FlagList } from "@dashboard/featureFlags"; -import { ThemeType } from "@saleor/app-sdk/app-bridge"; -import { useTheme } from "@saleor/macaw-ui"; -import isEqualWith from "lodash/isEqualWith"; -import { forwardRef, memo, useEffect, useRef } from "react"; - -interface AppIFrameProps { - appId: string; - src: string; - featureFlags: FlagList; - params?: AppDetailsUrlQueryParams; - onLoad: () => void; - onError?: () => void; - className: string; -} - -/** @deprecated Use component from extensions/ */ -const _AppIFrame = forwardRef( - ({ appId, src, featureFlags, params, onLoad, onError, className }, ref) => { - const themeRef = useRef(); - const { themeType } = useTheme(); - - // Ignore updates to themeType - iframe will be notified via events - // Otherwise this will cause reload of entire iframe - useEffect(() => { - themeRef.current = themeType; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - const iframeSrc = AppUrls.resolveAppIframeUrl(appId, src, { - ...params, - featureFlags, - theme: themeRef.current!, - }); - - return ( -