diff --git a/src/apps/index.tsx b/src/apps/index.tsx index 5e8f8e778..fe85de09d 100644 --- a/src/apps/index.tsx +++ b/src/apps/index.tsx @@ -6,22 +6,9 @@ import { useIntl } from "react-intl"; import { Route, RouteComponentProps, Switch } from "react-router-dom"; import { WindowTitle } from "../components/WindowTitle"; -import { - appInstallPath, - AppInstallUrlQueryParams, - AppListUrlQueryParams, - appsListPath, -} from "./urls"; -import AppInstallView from "./views/AppInstall"; +import { AppListUrlQueryParams, appsListPath } from "./urls"; import AppsListView from "./views/AppsList"; -const AppInstall: React.FC = props => { - const qs = parseQs(location.search.substr(1)); - const params: AppInstallUrlQueryParams = qs; - - return ; -}; - const AppsList: React.FC = () => { const qs = parseQs(location.search.substr(1)); const params: AppListUrlQueryParams = qs; @@ -36,7 +23,6 @@ const Component = () => { - diff --git a/src/apps/messages.ts b/src/apps/messages.ts deleted file mode 100644 index 4c8a5b76d..000000000 --- a/src/apps/messages.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineMessages } from "react-intl"; - -export const appMessages = defineMessages({ - failedToFetchAppSettings: { - id: "ac+Y98", - defaultMessage: "Failed to fetch app settings", - description: "app settings error", - }, - appActivated: { - id: "D/+84n", - defaultMessage: "App activated", - description: "snackbar text", - }, - appDeactivated: { - id: "USO8PB", - defaultMessage: "App deactivated", - description: "snackbar text", - }, -}); diff --git a/src/apps/views/AppsList/AppsList.tsx b/src/apps/views/AppsList/AppsList.tsx index 6aae043c1..f0648c48f 100644 --- a/src/apps/views/AppsList/AppsList.tsx +++ b/src/apps/views/AppsList/AppsList.tsx @@ -25,9 +25,9 @@ import { mapEdgesToItems } from "@dashboard/utils/maps"; import React, { useEffect, useRef } from "react"; import { useIntl } from "react-intl"; +import { EXTENSION_LIST_QUERY } from "../../../new-apps/queries"; import AppInProgressDeleteDialog from "../../components/AppInProgressDeleteDialog"; import AppsListPage from "../../components/AppsListPage"; -import { EXTENSION_LIST_QUERY } from "../../queries"; import { appDetailsUrl, AppListUrlDialog, diff --git a/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx b/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx index 8bc78326e..b02618b3a 100644 --- a/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx +++ b/src/custom-apps/views/CustomAppDetails/CustomAppDetails.tsx @@ -1,4 +1,3 @@ -import { appMessages } from "@dashboard/apps/messages"; import NotFoundPage from "@dashboard/components/NotFoundPage"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { getApiUrl } from "@dashboard/config"; @@ -26,6 +25,7 @@ import { commonMessages } from "@dashboard/intl"; import { extractMutationErrors, getStringOrPlaceholder } from "@dashboard/misc"; import AppActivateDialog from "@dashboard/new-apps/components/AppActivateDialog"; import AppDeactivateDialog from "@dashboard/new-apps/components/AppDeactivateDialog"; +import { appMessages } from "@dashboard/new-apps/messages"; import getAppErrorMessage from "@dashboard/utils/errors/app"; import createDialogActionHandlers from "@dashboard/utils/handlers/dialogActionHandlers"; import React from "react"; diff --git a/src/custom-apps/views/CustomAppList.tsx b/src/custom-apps/views/CustomAppList.tsx index 956d728e7..526bdb2de 100644 --- a/src/custom-apps/views/CustomAppList.tsx +++ b/src/custom-apps/views/CustomAppList.tsx @@ -1,5 +1,4 @@ import { useApolloClient } from "@apollo/client"; -import { EXTENSION_LIST_QUERY } from "@dashboard/apps/queries"; import { WindowTitle } from "@dashboard/components/WindowTitle"; import { AppSortField, @@ -13,6 +12,7 @@ import useNotifier from "@dashboard/hooks/useNotifier"; import { sectionNames } from "@dashboard/intl"; import { findById } from "@dashboard/misc"; import AppDeleteDialog from "@dashboard/new-apps/components/AppDeleteDialog"; +import { EXTENSION_LIST_QUERY } from "@dashboard/new-apps/queries"; import createDialogActionHandlers from "@dashboard/utils/handlers/dialogActionHandlers"; import { mapEdgesToItems } from "@dashboard/utils/maps"; import React from "react"; diff --git a/src/graphql/hooks.generated.ts b/src/graphql/hooks.generated.ts index 5055258c6..89d89b51a 100644 --- a/src/graphql/hooks.generated.ts +++ b/src/graphql/hooks.generated.ts @@ -2844,629 +2844,6 @@ export const WebhookDetailsFragmentDoc = gql` customHeaders } ${WebhookFragmentDoc}`; -export const AppCreateDocument = gql` - mutation AppCreate($input: AppInput!) { - appCreate(input: $input) { - authToken - app { - ...App - } - errors { - ...AppError - } - } -} - ${AppFragmentDoc} -${AppErrorFragmentDoc}`; -export type AppCreateMutationFn = Apollo.MutationFunction; - -/** - * __useAppCreateMutation__ - * - * To run a mutation, you first call `useAppCreateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppCreateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appCreateMutation, { data, loading, error }] = useAppCreateMutation({ - * variables: { - * input: // value for 'input' - * }, - * }); - */ -export function useAppCreateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppCreateDocument, options); - } -export type AppCreateMutationHookResult = ReturnType; -export type AppCreateMutationResult = Apollo.MutationResult; -export type AppCreateMutationOptions = Apollo.BaseMutationOptions; -export const AppDeleteDocument = gql` - mutation AppDelete($id: ID!) { - appDelete(id: $id) { - app { - ...App - } - errors { - ...AppError - } - } -} - ${AppFragmentDoc} -${AppErrorFragmentDoc}`; -export type AppDeleteMutationFn = Apollo.MutationFunction; - -/** - * __useAppDeleteMutation__ - * - * To run a mutation, you first call `useAppDeleteMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppDeleteMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appDeleteMutation, { data, loading, error }] = useAppDeleteMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppDeleteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppDeleteDocument, options); - } -export type AppDeleteMutationHookResult = ReturnType; -export type AppDeleteMutationResult = Apollo.MutationResult; -export type AppDeleteMutationOptions = Apollo.BaseMutationOptions; -export const AppDeleteFailedInstallationDocument = gql` - mutation AppDeleteFailedInstallation($id: ID!) { - appDeleteFailedInstallation(id: $id) { - appInstallation { - id - status - appName - message - } - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppDeleteFailedInstallationMutationFn = Apollo.MutationFunction; - -/** - * __useAppDeleteFailedInstallationMutation__ - * - * To run a mutation, you first call `useAppDeleteFailedInstallationMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppDeleteFailedInstallationMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appDeleteFailedInstallationMutation, { data, loading, error }] = useAppDeleteFailedInstallationMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppDeleteFailedInstallationMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppDeleteFailedInstallationDocument, options); - } -export type AppDeleteFailedInstallationMutationHookResult = ReturnType; -export type AppDeleteFailedInstallationMutationResult = Apollo.MutationResult; -export type AppDeleteFailedInstallationMutationOptions = Apollo.BaseMutationOptions; -export const AppFetchDocument = gql` - mutation AppFetch($manifestUrl: String!) { - appFetchManifest(manifestUrl: $manifestUrl) { - manifest { - ...AppManifest - } - errors { - ...AppError - } - } -} - ${AppManifestFragmentDoc} -${AppErrorFragmentDoc}`; -export type AppFetchMutationFn = Apollo.MutationFunction; - -/** - * __useAppFetchMutation__ - * - * To run a mutation, you first call `useAppFetchMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppFetchMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appFetchMutation, { data, loading, error }] = useAppFetchMutation({ - * variables: { - * manifestUrl: // value for 'manifestUrl' - * }, - * }); - */ -export function useAppFetchMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppFetchDocument, options); - } -export type AppFetchMutationHookResult = ReturnType; -export type AppFetchMutationResult = Apollo.MutationResult; -export type AppFetchMutationOptions = Apollo.BaseMutationOptions; -export const AppInstallDocument = gql` - mutation AppInstall($input: AppInstallInput!) { - appInstall(input: $input) { - appInstallation { - id - status - appName - manifestUrl - } - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppInstallMutationFn = Apollo.MutationFunction; - -/** - * __useAppInstallMutation__ - * - * To run a mutation, you first call `useAppInstallMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppInstallMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appInstallMutation, { data, loading, error }] = useAppInstallMutation({ - * variables: { - * input: // value for 'input' - * }, - * }); - */ -export function useAppInstallMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppInstallDocument, options); - } -export type AppInstallMutationHookResult = ReturnType; -export type AppInstallMutationResult = Apollo.MutationResult; -export type AppInstallMutationOptions = Apollo.BaseMutationOptions; -export const AppRetryInstallDocument = gql` - mutation AppRetryInstall($id: ID!) { - appRetryInstall(id: $id) { - appInstallation { - id - status - appName - manifestUrl - } - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppRetryInstallMutationFn = Apollo.MutationFunction; - -/** - * __useAppRetryInstallMutation__ - * - * To run a mutation, you first call `useAppRetryInstallMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppRetryInstallMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appRetryInstallMutation, { data, loading, error }] = useAppRetryInstallMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppRetryInstallMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppRetryInstallDocument, options); - } -export type AppRetryInstallMutationHookResult = ReturnType; -export type AppRetryInstallMutationResult = Apollo.MutationResult; -export type AppRetryInstallMutationOptions = Apollo.BaseMutationOptions; -export const AppUpdateDocument = gql` - mutation AppUpdate($id: ID!, $input: AppInput!) { - appUpdate(id: $id, input: $input) { - app { - ...App - permissions { - code - name - } - } - errors { - ...AppError - message - permissions - } - } -} - ${AppFragmentDoc} -${AppErrorFragmentDoc}`; -export type AppUpdateMutationFn = Apollo.MutationFunction; - -/** - * __useAppUpdateMutation__ - * - * To run a mutation, you first call `useAppUpdateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppUpdateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appUpdateMutation, { data, loading, error }] = useAppUpdateMutation({ - * variables: { - * id: // value for 'id' - * input: // value for 'input' - * }, - * }); - */ -export function useAppUpdateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppUpdateDocument, options); - } -export type AppUpdateMutationHookResult = ReturnType; -export type AppUpdateMutationResult = Apollo.MutationResult; -export type AppUpdateMutationOptions = Apollo.BaseMutationOptions; -export const AppTokenCreateDocument = gql` - mutation AppTokenCreate($input: AppTokenInput!) { - appTokenCreate(input: $input) { - appToken { - name - authToken - id - } - authToken - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppTokenCreateMutationFn = Apollo.MutationFunction; - -/** - * __useAppTokenCreateMutation__ - * - * To run a mutation, you first call `useAppTokenCreateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppTokenCreateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appTokenCreateMutation, { data, loading, error }] = useAppTokenCreateMutation({ - * variables: { - * input: // value for 'input' - * }, - * }); - */ -export function useAppTokenCreateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppTokenCreateDocument, options); - } -export type AppTokenCreateMutationHookResult = ReturnType; -export type AppTokenCreateMutationResult = Apollo.MutationResult; -export type AppTokenCreateMutationOptions = Apollo.BaseMutationOptions; -export const AppTokenDeleteDocument = gql` - mutation AppTokenDelete($id: ID!) { - appTokenDelete(id: $id) { - appToken { - name - authToken - id - } - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppTokenDeleteMutationFn = Apollo.MutationFunction; - -/** - * __useAppTokenDeleteMutation__ - * - * To run a mutation, you first call `useAppTokenDeleteMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppTokenDeleteMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appTokenDeleteMutation, { data, loading, error }] = useAppTokenDeleteMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppTokenDeleteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppTokenDeleteDocument, options); - } -export type AppTokenDeleteMutationHookResult = ReturnType; -export type AppTokenDeleteMutationResult = Apollo.MutationResult; -export type AppTokenDeleteMutationOptions = Apollo.BaseMutationOptions; -export const AppActivateDocument = gql` - mutation AppActivate($id: ID!) { - appActivate(id: $id) { - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppActivateMutationFn = Apollo.MutationFunction; - -/** - * __useAppActivateMutation__ - * - * To run a mutation, you first call `useAppActivateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppActivateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appActivateMutation, { data, loading, error }] = useAppActivateMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppActivateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppActivateDocument, options); - } -export type AppActivateMutationHookResult = ReturnType; -export type AppActivateMutationResult = Apollo.MutationResult; -export type AppActivateMutationOptions = Apollo.BaseMutationOptions; -export const AppDeactivateDocument = gql` - mutation AppDeactivate($id: ID!) { - appDeactivate(id: $id) { - errors { - ...AppError - } - } -} - ${AppErrorFragmentDoc}`; -export type AppDeactivateMutationFn = Apollo.MutationFunction; - -/** - * __useAppDeactivateMutation__ - * - * To run a mutation, you first call `useAppDeactivateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAppDeactivateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [appDeactivateMutation, { data, loading, error }] = useAppDeactivateMutation({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppDeactivateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(AppDeactivateDocument, options); - } -export type AppDeactivateMutationHookResult = ReturnType; -export type AppDeactivateMutationResult = Apollo.MutationResult; -export type AppDeactivateMutationOptions = Apollo.BaseMutationOptions; -export const AppsListDocument = gql` - query AppsList($before: String, $after: String, $first: Int, $last: Int, $sort: AppSortingInput, $filter: AppFilterInput) { - apps( - before: $before - after: $after - first: $first - last: $last - sortBy: $sort - filter: $filter - ) { - pageInfo { - hasNextPage - hasPreviousPage - startCursor - endCursor - } - totalCount - edges { - node { - ...AppListItem - } - } - } -} - ${AppListItemFragmentDoc}`; - -/** - * __useAppsListQuery__ - * - * To run a query within a React component, call `useAppsListQuery` and pass it any options that fit your needs. - * When your component renders, `useAppsListQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useAppsListQuery({ - * variables: { - * before: // value for 'before' - * after: // value for 'after' - * first: // value for 'first' - * last: // value for 'last' - * sort: // value for 'sort' - * filter: // value for 'filter' - * }, - * }); - */ -export function useAppsListQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(AppsListDocument, options); - } -export function useAppsListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(AppsListDocument, options); - } -export type AppsListQueryHookResult = ReturnType; -export type AppsListLazyQueryHookResult = ReturnType; -export type AppsListQueryResult = Apollo.QueryResult; -export const AppsInstallationsDocument = gql` - query AppsInstallations { - appsInstallations { - ...AppInstallation - } -} - ${AppInstallationFragmentDoc}`; - -/** - * __useAppsInstallationsQuery__ - * - * To run a query within a React component, call `useAppsInstallationsQuery` and pass it any options that fit your needs. - * When your component renders, `useAppsInstallationsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useAppsInstallationsQuery({ - * variables: { - * }, - * }); - */ -export function useAppsInstallationsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(AppsInstallationsDocument, options); - } -export function useAppsInstallationsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(AppsInstallationsDocument, options); - } -export type AppsInstallationsQueryHookResult = ReturnType; -export type AppsInstallationsLazyQueryHookResult = ReturnType; -export type AppsInstallationsQueryResult = Apollo.QueryResult; -export const AppDocument = gql` - query App($id: ID!) { - app(id: $id) { - ...App - aboutApp - permissions { - code - name - } - dataPrivacy - dataPrivacyUrl - } -} - ${AppFragmentDoc}`; - -/** - * __useAppQuery__ - * - * To run a query within a React component, call `useAppQuery` and pass it any options that fit your needs. - * When your component renders, `useAppQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useAppQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useAppQuery(baseOptions: ApolloReactHooks.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(AppDocument, options); - } -export function useAppLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(AppDocument, options); - } -export type AppQueryHookResult = ReturnType; -export type AppLazyQueryHookResult = ReturnType; -export type AppQueryResult = Apollo.QueryResult; -export const ExtensionListDocument = gql` - query ExtensionList($filter: AppExtensionFilterInput!) { - appExtensions(filter: $filter, first: 100) { - edges { - node { - id - label - url - mount - target - accessToken - permissions { - code - } - app { - id - appUrl - } - } - } - } -} - `; - -/** - * __useExtensionListQuery__ - * - * To run a query within a React component, call `useExtensionListQuery` and pass it any options that fit your needs. - * When your component renders, `useExtensionListQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useExtensionListQuery({ - * variables: { - * filter: // value for 'filter' - * }, - * }); - */ -export function useExtensionListQuery(baseOptions: ApolloReactHooks.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(ExtensionListDocument, options); - } -export function useExtensionListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(ExtensionListDocument, options); - } -export type ExtensionListQueryHookResult = ReturnType; -export type ExtensionListLazyQueryHookResult = ReturnType; -export type ExtensionListQueryResult = Apollo.QueryResult; export const AttributeBulkDeleteDocument = gql` mutation AttributeBulkDelete($ids: [ID!]!) { attributeBulkDelete(ids: $ids) { @@ -8251,6 +7628,629 @@ export function useMenuDetailsLazyQuery(baseOptions?: ApolloReactHooks.LazyQuery export type MenuDetailsQueryHookResult = ReturnType; export type MenuDetailsLazyQueryHookResult = ReturnType; export type MenuDetailsQueryResult = Apollo.QueryResult; +export const AppCreateDocument = gql` + mutation AppCreate($input: AppInput!) { + appCreate(input: $input) { + authToken + app { + ...App + } + errors { + ...AppError + } + } +} + ${AppFragmentDoc} +${AppErrorFragmentDoc}`; +export type AppCreateMutationFn = Apollo.MutationFunction; + +/** + * __useAppCreateMutation__ + * + * To run a mutation, you first call `useAppCreateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppCreateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appCreateMutation, { data, loading, error }] = useAppCreateMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useAppCreateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppCreateDocument, options); + } +export type AppCreateMutationHookResult = ReturnType; +export type AppCreateMutationResult = Apollo.MutationResult; +export type AppCreateMutationOptions = Apollo.BaseMutationOptions; +export const AppDeleteDocument = gql` + mutation AppDelete($id: ID!) { + appDelete(id: $id) { + app { + ...App + } + errors { + ...AppError + } + } +} + ${AppFragmentDoc} +${AppErrorFragmentDoc}`; +export type AppDeleteMutationFn = Apollo.MutationFunction; + +/** + * __useAppDeleteMutation__ + * + * To run a mutation, you first call `useAppDeleteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppDeleteMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appDeleteMutation, { data, loading, error }] = useAppDeleteMutation({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppDeleteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppDeleteDocument, options); + } +export type AppDeleteMutationHookResult = ReturnType; +export type AppDeleteMutationResult = Apollo.MutationResult; +export type AppDeleteMutationOptions = Apollo.BaseMutationOptions; +export const AppDeleteFailedInstallationDocument = gql` + mutation AppDeleteFailedInstallation($id: ID!) { + appDeleteFailedInstallation(id: $id) { + appInstallation { + id + status + appName + message + } + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppDeleteFailedInstallationMutationFn = Apollo.MutationFunction; + +/** + * __useAppDeleteFailedInstallationMutation__ + * + * To run a mutation, you first call `useAppDeleteFailedInstallationMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppDeleteFailedInstallationMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appDeleteFailedInstallationMutation, { data, loading, error }] = useAppDeleteFailedInstallationMutation({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppDeleteFailedInstallationMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppDeleteFailedInstallationDocument, options); + } +export type AppDeleteFailedInstallationMutationHookResult = ReturnType; +export type AppDeleteFailedInstallationMutationResult = Apollo.MutationResult; +export type AppDeleteFailedInstallationMutationOptions = Apollo.BaseMutationOptions; +export const AppFetchDocument = gql` + mutation AppFetch($manifestUrl: String!) { + appFetchManifest(manifestUrl: $manifestUrl) { + manifest { + ...AppManifest + } + errors { + ...AppError + } + } +} + ${AppManifestFragmentDoc} +${AppErrorFragmentDoc}`; +export type AppFetchMutationFn = Apollo.MutationFunction; + +/** + * __useAppFetchMutation__ + * + * To run a mutation, you first call `useAppFetchMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppFetchMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appFetchMutation, { data, loading, error }] = useAppFetchMutation({ + * variables: { + * manifestUrl: // value for 'manifestUrl' + * }, + * }); + */ +export function useAppFetchMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppFetchDocument, options); + } +export type AppFetchMutationHookResult = ReturnType; +export type AppFetchMutationResult = Apollo.MutationResult; +export type AppFetchMutationOptions = Apollo.BaseMutationOptions; +export const AppInstallDocument = gql` + mutation AppInstall($input: AppInstallInput!) { + appInstall(input: $input) { + appInstallation { + id + status + appName + manifestUrl + } + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppInstallMutationFn = Apollo.MutationFunction; + +/** + * __useAppInstallMutation__ + * + * To run a mutation, you first call `useAppInstallMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppInstallMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appInstallMutation, { data, loading, error }] = useAppInstallMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useAppInstallMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppInstallDocument, options); + } +export type AppInstallMutationHookResult = ReturnType; +export type AppInstallMutationResult = Apollo.MutationResult; +export type AppInstallMutationOptions = Apollo.BaseMutationOptions; +export const AppRetryInstallDocument = gql` + mutation AppRetryInstall($id: ID!) { + appRetryInstall(id: $id) { + appInstallation { + id + status + appName + manifestUrl + } + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppRetryInstallMutationFn = Apollo.MutationFunction; + +/** + * __useAppRetryInstallMutation__ + * + * To run a mutation, you first call `useAppRetryInstallMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppRetryInstallMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appRetryInstallMutation, { data, loading, error }] = useAppRetryInstallMutation({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppRetryInstallMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppRetryInstallDocument, options); + } +export type AppRetryInstallMutationHookResult = ReturnType; +export type AppRetryInstallMutationResult = Apollo.MutationResult; +export type AppRetryInstallMutationOptions = Apollo.BaseMutationOptions; +export const AppUpdateDocument = gql` + mutation AppUpdate($id: ID!, $input: AppInput!) { + appUpdate(id: $id, input: $input) { + app { + ...App + permissions { + code + name + } + } + errors { + ...AppError + message + permissions + } + } +} + ${AppFragmentDoc} +${AppErrorFragmentDoc}`; +export type AppUpdateMutationFn = Apollo.MutationFunction; + +/** + * __useAppUpdateMutation__ + * + * To run a mutation, you first call `useAppUpdateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppUpdateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appUpdateMutation, { data, loading, error }] = useAppUpdateMutation({ + * variables: { + * id: // value for 'id' + * input: // value for 'input' + * }, + * }); + */ +export function useAppUpdateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppUpdateDocument, options); + } +export type AppUpdateMutationHookResult = ReturnType; +export type AppUpdateMutationResult = Apollo.MutationResult; +export type AppUpdateMutationOptions = Apollo.BaseMutationOptions; +export const AppTokenCreateDocument = gql` + mutation AppTokenCreate($input: AppTokenInput!) { + appTokenCreate(input: $input) { + appToken { + name + authToken + id + } + authToken + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppTokenCreateMutationFn = Apollo.MutationFunction; + +/** + * __useAppTokenCreateMutation__ + * + * To run a mutation, you first call `useAppTokenCreateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppTokenCreateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appTokenCreateMutation, { data, loading, error }] = useAppTokenCreateMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useAppTokenCreateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppTokenCreateDocument, options); + } +export type AppTokenCreateMutationHookResult = ReturnType; +export type AppTokenCreateMutationResult = Apollo.MutationResult; +export type AppTokenCreateMutationOptions = Apollo.BaseMutationOptions; +export const AppTokenDeleteDocument = gql` + mutation AppTokenDelete($id: ID!) { + appTokenDelete(id: $id) { + appToken { + name + authToken + id + } + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppTokenDeleteMutationFn = Apollo.MutationFunction; + +/** + * __useAppTokenDeleteMutation__ + * + * To run a mutation, you first call `useAppTokenDeleteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppTokenDeleteMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appTokenDeleteMutation, { data, loading, error }] = useAppTokenDeleteMutation({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppTokenDeleteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppTokenDeleteDocument, options); + } +export type AppTokenDeleteMutationHookResult = ReturnType; +export type AppTokenDeleteMutationResult = Apollo.MutationResult; +export type AppTokenDeleteMutationOptions = Apollo.BaseMutationOptions; +export const AppActivateDocument = gql` + mutation AppActivate($id: ID!) { + appActivate(id: $id) { + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppActivateMutationFn = Apollo.MutationFunction; + +/** + * __useAppActivateMutation__ + * + * To run a mutation, you first call `useAppActivateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppActivateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appActivateMutation, { data, loading, error }] = useAppActivateMutation({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppActivateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppActivateDocument, options); + } +export type AppActivateMutationHookResult = ReturnType; +export type AppActivateMutationResult = Apollo.MutationResult; +export type AppActivateMutationOptions = Apollo.BaseMutationOptions; +export const AppDeactivateDocument = gql` + mutation AppDeactivate($id: ID!) { + appDeactivate(id: $id) { + errors { + ...AppError + } + } +} + ${AppErrorFragmentDoc}`; +export type AppDeactivateMutationFn = Apollo.MutationFunction; + +/** + * __useAppDeactivateMutation__ + * + * To run a mutation, you first call `useAppDeactivateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAppDeactivateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [appDeactivateMutation, { data, loading, error }] = useAppDeactivateMutation({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppDeactivateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(AppDeactivateDocument, options); + } +export type AppDeactivateMutationHookResult = ReturnType; +export type AppDeactivateMutationResult = Apollo.MutationResult; +export type AppDeactivateMutationOptions = Apollo.BaseMutationOptions; +export const AppsListDocument = gql` + query AppsList($before: String, $after: String, $first: Int, $last: Int, $sort: AppSortingInput, $filter: AppFilterInput) { + apps( + before: $before + after: $after + first: $first + last: $last + sortBy: $sort + filter: $filter + ) { + pageInfo { + hasNextPage + hasPreviousPage + startCursor + endCursor + } + totalCount + edges { + node { + ...AppListItem + } + } + } +} + ${AppListItemFragmentDoc}`; + +/** + * __useAppsListQuery__ + * + * To run a query within a React component, call `useAppsListQuery` and pass it any options that fit your needs. + * When your component renders, `useAppsListQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useAppsListQuery({ + * variables: { + * before: // value for 'before' + * after: // value for 'after' + * first: // value for 'first' + * last: // value for 'last' + * sort: // value for 'sort' + * filter: // value for 'filter' + * }, + * }); + */ +export function useAppsListQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useQuery(AppsListDocument, options); + } +export function useAppsListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useLazyQuery(AppsListDocument, options); + } +export type AppsListQueryHookResult = ReturnType; +export type AppsListLazyQueryHookResult = ReturnType; +export type AppsListQueryResult = Apollo.QueryResult; +export const AppsInstallationsDocument = gql` + query AppsInstallations { + appsInstallations { + ...AppInstallation + } +} + ${AppInstallationFragmentDoc}`; + +/** + * __useAppsInstallationsQuery__ + * + * To run a query within a React component, call `useAppsInstallationsQuery` and pass it any options that fit your needs. + * When your component renders, `useAppsInstallationsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useAppsInstallationsQuery({ + * variables: { + * }, + * }); + */ +export function useAppsInstallationsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useQuery(AppsInstallationsDocument, options); + } +export function useAppsInstallationsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useLazyQuery(AppsInstallationsDocument, options); + } +export type AppsInstallationsQueryHookResult = ReturnType; +export type AppsInstallationsLazyQueryHookResult = ReturnType; +export type AppsInstallationsQueryResult = Apollo.QueryResult; +export const AppDocument = gql` + query App($id: ID!) { + app(id: $id) { + ...App + aboutApp + permissions { + code + name + } + dataPrivacy + dataPrivacyUrl + } +} + ${AppFragmentDoc}`; + +/** + * __useAppQuery__ + * + * To run a query within a React component, call `useAppQuery` and pass it any options that fit your needs. + * When your component renders, `useAppQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useAppQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useAppQuery(baseOptions: ApolloReactHooks.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useQuery(AppDocument, options); + } +export function useAppLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useLazyQuery(AppDocument, options); + } +export type AppQueryHookResult = ReturnType; +export type AppLazyQueryHookResult = ReturnType; +export type AppQueryResult = Apollo.QueryResult; +export const ExtensionListDocument = gql` + query ExtensionList($filter: AppExtensionFilterInput!) { + appExtensions(filter: $filter, first: 100) { + edges { + node { + id + label + url + mount + target + accessToken + permissions { + code + } + app { + id + appUrl + } + } + } + } +} + `; + +/** + * __useExtensionListQuery__ + * + * To run a query within a React component, call `useExtensionListQuery` and pass it any options that fit your needs. + * When your component renders, `useExtensionListQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useExtensionListQuery({ + * variables: { + * filter: // value for 'filter' + * }, + * }); + */ +export function useExtensionListQuery(baseOptions: ApolloReactHooks.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useQuery(ExtensionListDocument, options); + } +export function useExtensionListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useLazyQuery(ExtensionListDocument, options); + } +export type ExtensionListQueryHookResult = ReturnType; +export type ExtensionListLazyQueryHookResult = ReturnType; +export type ExtensionListQueryResult = Apollo.QueryResult; export const OrderCancelDocument = gql` mutation OrderCancel($id: ID!) { orderCancel(id: $id) { diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index ac35ecfcd..59681289c 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -6741,115 +6741,6 @@ export enum WeightUnitsEnum { TONNE = 'TONNE' } -export type AppCreateMutationVariables = Exact<{ - input: AppInput; -}>; - - -export type AppCreateMutation = { __typename: 'Mutation', appCreate: { __typename: 'AppCreate', authToken: string | null, app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppDeleteMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppDeleteMutation = { __typename: 'Mutation', appDelete: { __typename: 'AppDelete', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppDeleteFailedInstallationMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppDeleteFailedInstallationMutation = { __typename: 'Mutation', appDeleteFailedInstallation: { __typename: 'AppDeleteFailedInstallation', appInstallation: { __typename: 'AppInstallation', id: string, status: JobStatusEnum, appName: string, message: string | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppFetchMutationVariables = Exact<{ - manifestUrl: Scalars['String']; -}>; - - -export type AppFetchMutation = { __typename: 'Mutation', appFetchManifest: { __typename: 'AppFetchManifest', manifest: { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppInstallMutationVariables = Exact<{ - input: AppInstallInput; -}>; - - -export type AppInstallMutation = { __typename: 'Mutation', appInstall: { __typename: 'AppInstall', appInstallation: { __typename: 'AppInstallation', id: string, status: JobStatusEnum, appName: string, manifestUrl: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppRetryInstallMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppRetryInstallMutation = { __typename: 'Mutation', appRetryInstall: { __typename: 'AppRetryInstall', appInstallation: { __typename: 'AppInstallation', id: string, status: JobStatusEnum, appName: string, manifestUrl: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppUpdateMutationVariables = Exact<{ - id: Scalars['ID']; - input: AppInput; -}>; - - -export type AppUpdateMutation = { __typename: 'Mutation', appUpdate: { __typename: 'AppUpdate', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', message: string | null, permissions: Array | null, field: string | null, code: AppErrorCode }> } | null }; - -export type AppTokenCreateMutationVariables = Exact<{ - input: AppTokenInput; -}>; - - -export type AppTokenCreateMutation = { __typename: 'Mutation', appTokenCreate: { __typename: 'AppTokenCreate', authToken: string | null, appToken: { __typename: 'AppToken', name: string | null, authToken: string | null, id: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppTokenDeleteMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppTokenDeleteMutation = { __typename: 'Mutation', appTokenDelete: { __typename: 'AppTokenDelete', appToken: { __typename: 'AppToken', name: string | null, authToken: string | null, id: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppActivateMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppActivateMutation = { __typename: 'Mutation', appActivate: { __typename: 'AppActivate', errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppDeactivateMutationVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppDeactivateMutation = { __typename: 'Mutation', appDeactivate: { __typename: 'AppDeactivate', errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; - -export type AppsListQueryVariables = Exact<{ - before?: InputMaybe; - after?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - sort?: InputMaybe; - filter?: InputMaybe; -}>; - - -export type AppsListQuery = { __typename: 'Query', apps: { __typename: 'AppCountableConnection', totalCount: number | null, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null, endCursor: string | null }, edges: Array<{ __typename: 'AppCountableEdge', node: { __typename: 'App', id: string, name: string | null, isActive: boolean | null, type: AppTypeEnum | null, appUrl: string | null, manifestUrl: string | null, version: string | null, permissions: Array<{ __typename: 'Permission', name: string, code: PermissionEnum }> | null } }> } | null }; - -export type AppsInstallationsQueryVariables = Exact<{ [key: string]: never; }>; - - -export type AppsInstallationsQuery = { __typename: 'Query', appsInstallations: Array<{ __typename: 'AppInstallation', status: JobStatusEnum, message: string | null, appName: string, manifestUrl: string, id: string }> }; - -export type AppQueryVariables = Exact<{ - id: Scalars['ID']; -}>; - - -export type AppQuery = { __typename: 'Query', app: { __typename: 'App', aboutApp: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null }; - -export type ExtensionListQueryVariables = Exact<{ - filter: AppExtensionFilterInput; -}>; - - -export type ExtensionListQuery = { __typename: 'Query', appExtensions: { __typename: 'AppExtensionCountableConnection', edges: Array<{ __typename: 'AppExtensionCountableEdge', node: { __typename: 'AppExtension', id: string, label: string, url: string, mount: AppExtensionMountEnum, target: AppExtensionTargetEnum, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum }>, app: { __typename: 'App', id: string, appUrl: string | null } } }> } | null }; - export type AttributeBulkDeleteMutationVariables = Exact<{ ids: Array | Scalars['ID']; }>; @@ -8240,6 +8131,115 @@ export type MenuDetailsQueryVariables = Exact<{ export type MenuDetailsQuery = { __typename: 'Query', menu: { __typename: 'Menu', id: string, name: string, items: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, children: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, children: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, children: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, children: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, children: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, children: Array<{ __typename: 'MenuItem', id: string, level: number, name: string, url: string | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null, category: { __typename: 'Category', id: string, name: string } | null, collection: { __typename: 'Collection', id: string, name: string } | null, page: { __typename: 'Page', id: string, title: string } | null }> | null } | null }; +export type AppCreateMutationVariables = Exact<{ + input: AppInput; +}>; + + +export type AppCreateMutation = { __typename: 'Mutation', appCreate: { __typename: 'AppCreate', authToken: string | null, app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppDeleteMutationVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppDeleteMutation = { __typename: 'Mutation', appDelete: { __typename: 'AppDelete', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppDeleteFailedInstallationMutationVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppDeleteFailedInstallationMutation = { __typename: 'Mutation', appDeleteFailedInstallation: { __typename: 'AppDeleteFailedInstallation', appInstallation: { __typename: 'AppInstallation', id: string, status: JobStatusEnum, appName: string, message: string | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppFetchMutationVariables = Exact<{ + manifestUrl: Scalars['String']; +}>; + + +export type AppFetchMutation = { __typename: 'Mutation', appFetchManifest: { __typename: 'AppFetchManifest', manifest: { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppInstallMutationVariables = Exact<{ + input: AppInstallInput; +}>; + + +export type AppInstallMutation = { __typename: 'Mutation', appInstall: { __typename: 'AppInstall', appInstallation: { __typename: 'AppInstallation', id: string, status: JobStatusEnum, appName: string, manifestUrl: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppRetryInstallMutationVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppRetryInstallMutation = { __typename: 'Mutation', appRetryInstall: { __typename: 'AppRetryInstall', appInstallation: { __typename: 'AppInstallation', id: string, status: JobStatusEnum, appName: string, manifestUrl: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppUpdateMutationVariables = Exact<{ + id: Scalars['ID']; + input: AppInput; +}>; + + +export type AppUpdateMutation = { __typename: 'Mutation', appUpdate: { __typename: 'AppUpdate', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', message: string | null, permissions: Array | null, field: string | null, code: AppErrorCode }> } | null }; + +export type AppTokenCreateMutationVariables = Exact<{ + input: AppTokenInput; +}>; + + +export type AppTokenCreateMutation = { __typename: 'Mutation', appTokenCreate: { __typename: 'AppTokenCreate', authToken: string | null, appToken: { __typename: 'AppToken', name: string | null, authToken: string | null, id: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppTokenDeleteMutationVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppTokenDeleteMutation = { __typename: 'Mutation', appTokenDelete: { __typename: 'AppTokenDelete', appToken: { __typename: 'AppToken', name: string | null, authToken: string | null, id: string } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppActivateMutationVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppActivateMutation = { __typename: 'Mutation', appActivate: { __typename: 'AppActivate', errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppDeactivateMutationVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppDeactivateMutation = { __typename: 'Mutation', appDeactivate: { __typename: 'AppDeactivate', errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; + +export type AppsListQueryVariables = Exact<{ + before?: InputMaybe; + after?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + sort?: InputMaybe; + filter?: InputMaybe; +}>; + + +export type AppsListQuery = { __typename: 'Query', apps: { __typename: 'AppCountableConnection', totalCount: number | null, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null, endCursor: string | null }, edges: Array<{ __typename: 'AppCountableEdge', node: { __typename: 'App', id: string, name: string | null, isActive: boolean | null, type: AppTypeEnum | null, appUrl: string | null, manifestUrl: string | null, version: string | null, permissions: Array<{ __typename: 'Permission', name: string, code: PermissionEnum }> | null } }> } | null }; + +export type AppsInstallationsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type AppsInstallationsQuery = { __typename: 'Query', appsInstallations: Array<{ __typename: 'AppInstallation', status: JobStatusEnum, message: string | null, appName: string, manifestUrl: string, id: string }> }; + +export type AppQueryVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type AppQuery = { __typename: 'Query', app: { __typename: 'App', aboutApp: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null }; + +export type ExtensionListQueryVariables = Exact<{ + filter: AppExtensionFilterInput; +}>; + + +export type ExtensionListQuery = { __typename: 'Query', appExtensions: { __typename: 'AppExtensionCountableConnection', edges: Array<{ __typename: 'AppExtensionCountableEdge', node: { __typename: 'AppExtension', id: string, label: string, url: string, mount: AppExtensionMountEnum, target: AppExtensionTargetEnum, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum }>, app: { __typename: 'App', id: string, appUrl: string | null } } }> } | null }; + export type OrderCancelMutationVariables = Exact<{ id: Scalars['ID']; }>; diff --git a/src/apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx b/src/new-apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx similarity index 60% rename from src/apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx rename to src/new-apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx index 75425a5d1..983bd411e 100644 --- a/src/apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx +++ b/src/new-apps/components/AppInstallErrorPage/AppInstallErrorPage.tsx @@ -5,6 +5,7 @@ import { Grid, Typography } from "@material-ui/core"; import React from "react"; import { FormattedMessage } from "react-intl"; +import messages from "./messages"; import { useStyles } from "./styles"; interface AppInstallErrorPageProps { @@ -14,7 +15,7 @@ interface AppInstallErrorPageProps { export const AppInstallErrorPage: React.FC = ({ onBack, }) => { - const classes = useStyles({}); + const classes = useStyles(); return ( @@ -24,25 +25,13 @@ export const AppInstallErrorPage: React.FC = ({ - + - + diff --git a/src/apps/components/AppInstallErrorPage/index.ts b/src/new-apps/components/AppInstallErrorPage/index.ts similarity index 100% rename from src/apps/components/AppInstallErrorPage/index.ts rename to src/new-apps/components/AppInstallErrorPage/index.ts diff --git a/src/new-apps/components/AppInstallErrorPage/messages.ts b/src/new-apps/components/AppInstallErrorPage/messages.ts new file mode 100644 index 000000000..8dca200c4 --- /dev/null +++ b/src/new-apps/components/AppInstallErrorPage/messages.ts @@ -0,0 +1,20 @@ +import { defineMessages } from "react-intl"; + +export default defineMessages({ + title: { + defaultMessage: "There’s a problem with app.", + description: "title", + id: "WnlZMO", + }, + content: { + defaultMessage: + "Saleor couldn’t fetch crucial information regarding installation. Without those System can’t install the app in your Saleor. Please use the button below to get back to system’s dashboard.", + description: "content", + id: "4yRwN+", + }, + backButton: { + defaultMessage: "Back to homepage", + description: "button", + id: "906uUr", + }, +}); diff --git a/src/apps/components/AppInstallErrorPage/styles.ts b/src/new-apps/components/AppInstallErrorPage/styles.ts similarity index 100% rename from src/apps/components/AppInstallErrorPage/styles.ts rename to src/new-apps/components/AppInstallErrorPage/styles.ts diff --git a/src/apps/components/AppInstallPage/AppInstallPage.stories.tsx b/src/new-apps/components/AppInstallPage/AppInstallPage.stories.tsx similarity index 100% rename from src/apps/components/AppInstallPage/AppInstallPage.stories.tsx rename to src/new-apps/components/AppInstallPage/AppInstallPage.stories.tsx diff --git a/src/apps/components/AppInstallPage/AppInstallPage.tsx b/src/new-apps/components/AppInstallPage/AppInstallPage.tsx similarity index 75% rename from src/apps/components/AppInstallPage/AppInstallPage.tsx rename to src/new-apps/components/AppInstallPage/AppInstallPage.tsx index bf84ec617..93cfaf7bb 100644 --- a/src/apps/components/AppInstallPage/AppInstallPage.tsx +++ b/src/new-apps/components/AppInstallPage/AppInstallPage.tsx @@ -19,7 +19,8 @@ import clsx from "clsx"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; -import { useStyles } from "../../styles"; +import messages from "./messages"; +import { useStyles } from "./styles"; export interface AppInstallPageProps { data: NonNullable["manifest"]; @@ -37,7 +38,7 @@ export const AppInstallPage: React.FC = ({ onSubmit, }) => { const intl = useIntl(); - const classes = useStyles({}); + const classes = useStyles(); const name = data?.name || ""; @@ -52,14 +53,7 @@ export const AppInstallPage: React.FC = ({ loading ? ( ) : ( - intl.formatMessage( - { - id: "Id7C0X", - defaultMessage: `You are about to install {name}`, - description: "section header", - }, - { name }, - ) + intl.formatMessage(messages.title, { name }) ) } /> @@ -88,11 +82,7 @@ export const AppInstallPage: React.FC = ({ {!loading && ( )} @@ -102,9 +92,7 @@ export const AppInstallPage: React.FC = ({ <> {!!data?.permissions?.length && ( @@ -121,9 +109,7 @@ export const AppInstallPage: React.FC = ({ className={classes.installPrivacyText} > {!!data?.dataPrivacyUrl && ( @@ -132,11 +118,7 @@ export const AppInstallPage: React.FC = ({ rel="noopener noreferrer" target="_blank" > - + )} @@ -150,11 +132,7 @@ export const AppInstallPage: React.FC = ({ diff --git a/src/apps/components/AppInstallPage/index.ts b/src/new-apps/components/AppInstallPage/index.ts similarity index 100% rename from src/apps/components/AppInstallPage/index.ts rename to src/new-apps/components/AppInstallPage/index.ts diff --git a/src/new-apps/components/AppInstallPage/messages.ts b/src/new-apps/components/AppInstallPage/messages.ts new file mode 100644 index 000000000..69d4e36cd --- /dev/null +++ b/src/new-apps/components/AppInstallPage/messages.ts @@ -0,0 +1,35 @@ +import { defineMessages } from "react-intl"; + +export default defineMessages({ + title: { + id: "Id7C0X", + defaultMessage: "You are about to install {name}", + description: "section header", + }, + permissionsTitle: { + id: "VsGcdP", + defaultMessage: "App permissions", + description: "section header", + }, + permissionsInstallDescription: { + id: "BL/Lbk", + defaultMessage: "Installing this app will give it following permissions:", + description: "install app permissions", + }, + permissionsUninstallDescription: { + id: "t1UYU6", + defaultMessage: + "Uninstalling the app will remove all your customer’s personal data stored by {name}. ", + description: "install app privacy", + }, + dataPrivacyLearnMore: { + id: "k5lHFp", + defaultMessage: "Learn more about data privacy", + description: "app data privacy link", + }, + installButton: { + id: "PkCmGU", + defaultMessage: "Install App", + description: "install button", + }, +}); diff --git a/src/new-apps/components/AppInstallPage/styles.ts b/src/new-apps/components/AppInstallPage/styles.ts new file mode 100644 index 000000000..5121d8f8d --- /dev/null +++ b/src/new-apps/components/AppInstallPage/styles.ts @@ -0,0 +1,75 @@ +import { makeStyles } from "@saleor/macaw-ui"; + +export const useStyles = makeStyles( + theme => ({ + installAppContainer: { + "& > div": { + position: "relative", + }, + "& img": { + position: "relative", + }, + display: "flex", + justifyContent: "space-between", + padding: theme.spacing(2, 0), + position: "relative", + width: theme.spacing(35), + "&:before": { + backgroundColor: theme.palette.divider, + content: "''", + height: 2, + position: "absolute", + top: "50%", + transform: "translateY(-50%)", + width: theme.spacing(30), + }, + }, + installCard: { + display: "flex", + justifyContent: "center", + position: "relative", + }, + installIcon: { + alignItems: "center", + backgroundColor: theme.palette.divider, + border: `1px solid ${theme.palette.divider}`, + borderRadius: "50%", + display: "flex", + height: theme.spacing(9), + justifyContent: "center", + overflow: "hidden", + width: theme.spacing(9), + }, + installPermissionTitle: { + fontWeight: 500, + }, + installPrivacyText: { + "& a": { + color: theme.palette.primary.main, + textDecoration: "none", + }, + color: theme.palette.text.hint, + marginTop: theme.spacing(1), + }, + installSaleorIcon: { + backgroundColor: + theme.palette.type === "dark" + ? theme.palette.saleor.gray.default + : theme.palette.saleor.main[1], + border: "none", + }, + installSpacer: { + margin: theme.spacing(2, 0), + }, + permissionsContainer: { + "& li": { + "&:last-child": { + marginBottom: 0, + }, + marginBottom: theme.spacing(1), + }, + paddingLeft: theme.spacing(2), + }, + }), + { name: "AppInstallPage" }, +); diff --git a/src/new-apps/components/ExternalAppContext/ExternalAppContext.tsx b/src/new-apps/components/ExternalAppContext/ExternalAppContext.tsx index b6b8ff891..5fce570f1 100644 --- a/src/new-apps/components/ExternalAppContext/ExternalAppContext.tsx +++ b/src/new-apps/components/ExternalAppContext/ExternalAppContext.tsx @@ -1,6 +1,6 @@ -import { appDeepUrl } from "@dashboard/apps/urls"; import { AppExtensionTargetEnum } from "@dashboard/graphql"; import useNavigator from "@dashboard/hooks/useNavigator"; +import { AppUrls } from "@dashboard/new-apps/urls"; import React from "react"; import { AppDialog } from "../AppDialog"; @@ -42,9 +42,12 @@ export const useExternalApp = () => { setOpen(true); setAppData(appData); } else { - navigate(appDeepUrl(appData.id, appData.src, appData.params), { - resetScroll: true, - }); + navigate( + AppUrls.resolveAppDeepUrl(appData.id, appData.src, appData.params), + { + resetScroll: true, + }, + ); } }; diff --git a/src/new-apps/components/ExternalAppContext/context.ts b/src/new-apps/components/ExternalAppContext/context.ts index f7e8c8988..028644c92 100644 --- a/src/new-apps/components/ExternalAppContext/context.ts +++ b/src/new-apps/components/ExternalAppContext/context.ts @@ -1,5 +1,5 @@ -import { AppDetailsUrlMountQueryParams } from "@dashboard/apps/urls"; import { AppExtensionTargetEnum } from "@dashboard/graphql"; +import { AppDetailsUrlMountQueryParams } from "@dashboard/new-apps/urls"; import React from "react"; export interface AppData { diff --git a/src/new-apps/hooks/useActiveAppsInstallations.ts b/src/new-apps/hooks/useActiveAppsInstallations.ts index 35cf49a96..50d53ebc4 100644 --- a/src/new-apps/hooks/useActiveAppsInstallations.ts +++ b/src/new-apps/hooks/useActiveAppsInstallations.ts @@ -1,5 +1,4 @@ import { useApolloClient } from "@apollo/client"; -import { EXTENSION_LIST_QUERY } from "@dashboard/apps/queries"; import { AppInstallationFragment, AppsInstallationsQuery, @@ -8,6 +7,7 @@ import { useAppRetryInstallMutation, } from "@dashboard/graphql"; import useLocalStorage from "@dashboard/hooks/useLocalStorage"; +import { EXTENSION_LIST_QUERY } from "@dashboard/new-apps/queries"; import { useEffect, useRef } from "react"; interface UseActiveAppsInstallations { diff --git a/src/new-apps/index.tsx b/src/new-apps/index.tsx index 47aee34e2..b21bff549 100644 --- a/src/new-apps/index.tsx +++ b/src/new-apps/index.tsx @@ -1,9 +1,9 @@ +import { sectionNames } from "@dashboard/intl"; import { AppDetailsUrlQueryParams, AppInstallUrlQueryParams, -} from "@dashboard/apps/urls"; -import AppInstallView from "@dashboard/apps/views/AppInstall"; -import { sectionNames } from "@dashboard/intl"; +} from "@dashboard/new-apps/urls"; +import AppInstallView from "@dashboard/new-apps/views/AppInstall"; import { parse as parseQs } from "qs"; import React from "react"; import { useIntl } from "react-intl"; diff --git a/src/apps/mutations.ts b/src/new-apps/mutations.ts similarity index 100% rename from src/apps/mutations.ts rename to src/new-apps/mutations.ts diff --git a/src/apps/queries.ts b/src/new-apps/queries.ts similarity index 100% rename from src/apps/queries.ts rename to src/new-apps/queries.ts diff --git a/src/new-apps/tsconfig.json b/src/new-apps/tsconfig.json deleted file mode 100644 index 6149d437f..000000000 --- a/src/new-apps/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "strictNullChecks": true - } -} diff --git a/src/new-apps/urls.ts b/src/new-apps/urls.ts index 41bdb43af..215c704dc 100644 --- a/src/new-apps/urls.ts +++ b/src/new-apps/urls.ts @@ -54,6 +54,8 @@ export const AppPaths = { appListPath: AppSections.appsSection, resolveAppPath: (id: string) => urlJoin(AppSections.appsSection, id, "app"), resolveAppDetailsPath: (id: string) => urlJoin(AppSections.appsSection, id), + resolveAppDeepPath: (id: string, subPath: string) => + urlJoin(AppPaths.resolveAppPath(id), subPath), appInstallPath: urlJoin(AppSections.appsSection, "install"), }; @@ -68,6 +70,14 @@ export const AppUrls = { stringifyQs(params), resolveAppInstallUrl: (manifestUrl: string) => `${AppPaths.appInstallPath}?manifestUrl=${manifestUrl}`, + resolveAppDeepUrl: ( + id: string, + subPath: string, + params?: AppDetailsUrlQueryParams, + ) => + AppPaths.resolveAppDeepPath(encodeURIComponent(id), subPath) + + "?" + + stringifyQs(params), isAppDeepUrlChange: (appId: string, from: string, to: string) => { const appCompletePath = AppPaths.resolveAppPath(encodeURIComponent(appId)); diff --git a/src/new-apps/views/AppDetails/AppDetails.tsx b/src/new-apps/views/AppDetails/AppDetails.tsx index 009f127f6..489b7fd3b 100644 --- a/src/new-apps/views/AppDetails/AppDetails.tsx +++ b/src/new-apps/views/AppDetails/AppDetails.tsx @@ -1,5 +1,4 @@ import { useApolloClient } from "@apollo/client"; -import { EXTENSION_LIST_QUERY } from "@dashboard/apps/queries"; import NotFoundPage from "@dashboard/components/NotFoundPage"; import { useAppActivateMutation, @@ -11,6 +10,7 @@ import useNavigator from "@dashboard/hooks/useNavigator"; import useNotifier from "@dashboard/hooks/useNotifier"; import AppDeleteDialog from "@dashboard/new-apps/components/AppDeleteDialog"; import { appMessages } from "@dashboard/new-apps/messages"; +import { EXTENSION_LIST_QUERY } from "@dashboard/new-apps/queries"; import getAppErrorMessage from "@dashboard/utils/errors/app"; import createDialogActionHandlers from "@dashboard/utils/handlers/dialogActionHandlers"; import React from "react"; diff --git a/src/apps/views/AppInstall/AppInstall.tsx b/src/new-apps/views/AppInstall/AppInstall.tsx similarity index 90% rename from src/apps/views/AppInstall/AppInstall.tsx rename to src/new-apps/views/AppInstall/AppInstall.tsx index e19b5a580..fff3866ff 100644 --- a/src/apps/views/AppInstall/AppInstall.tsx +++ b/src/new-apps/views/AppInstall/AppInstall.tsx @@ -4,23 +4,24 @@ import useLocalStorage from "@dashboard/hooks/useLocalStorage"; import useNavigator from "@dashboard/hooks/useNavigator"; import useNotifier from "@dashboard/hooks/useNotifier"; import { extractMutationErrors } from "@dashboard/misc"; +import AppInstallErrorPage from "@dashboard/new-apps/components/AppInstallErrorPage"; +import AppInstallPage from "@dashboard/new-apps/components/AppInstallPage"; +import { + AppInstallUrlQueryParams, + AppUrls, + MANIFEST_ATTR, +} from "@dashboard/new-apps/urls"; import getAppErrorMessage from "@dashboard/utils/errors/app"; import React, { useEffect } from "react"; import { useIntl } from "react-intl"; import { RouteComponentProps } from "react-router-dom"; -import AppInstallErrorPage from "../../components/AppInstallErrorPage"; -import AppInstallPage from "../../components/AppInstallPage"; -import { - AppInstallUrlQueryParams, - appsListUrl, - MANIFEST_ATTR, -} from "../../urls"; import { messages } from "./messages"; interface InstallAppCreateProps extends RouteComponentProps { params: AppInstallUrlQueryParams; } + export const InstallAppCreate: React.FC = ({ params, }) => { @@ -69,7 +70,7 @@ export const InstallAppCreate: React.FC = ({ }, }); - const navigateToAppsList = () => navigate(appsListUrl()); + const navigateToAppsList = () => navigate(AppUrls.resolveAppListUrl()); const handleSubmit = () => { const manifest = fetchManifestOpts?.data?.appFetchManifest?.manifest; @@ -92,7 +93,7 @@ export const InstallAppCreate: React.FC = ({ if (manifestUrl) { fetchManifest({ variables: { manifestUrl } }); } else { - navigate(appsListUrl()); + navigate(AppUrls.resolveAppListUrl()); } }, []); diff --git a/src/apps/views/AppInstall/index.ts b/src/new-apps/views/AppInstall/index.ts similarity index 100% rename from src/apps/views/AppInstall/index.ts rename to src/new-apps/views/AppInstall/index.ts diff --git a/src/apps/views/AppInstall/messages.ts b/src/new-apps/views/AppInstall/messages.ts similarity index 100% rename from src/apps/views/AppInstall/messages.ts rename to src/new-apps/views/AppInstall/messages.ts diff --git a/src/new-apps/views/AppView/AppView.tsx b/src/new-apps/views/AppView/AppView.tsx index fee861ced..afd5ed857 100644 --- a/src/new-apps/views/AppView/AppView.tsx +++ b/src/new-apps/views/AppView/AppView.tsx @@ -1,9 +1,9 @@ -import { appMessages } from "@dashboard/apps/messages"; import NotFoundPage from "@dashboard/components/NotFoundPage"; import { useAppQuery } from "@dashboard/graphql"; import useNavigator from "@dashboard/hooks/useNavigator"; import useNotifier from "@dashboard/hooks/useNotifier"; import AppPage from "@dashboard/new-apps/components/AppPage"; +import { appMessages } from "@dashboard/new-apps/messages"; import { AppPaths, AppUrls } from "@dashboard/new-apps/urls"; import React, { useCallback } from "react"; import { useIntl } from "react-intl"; diff --git a/testUtils/mocks/apps.ts b/testUtils/mocks/apps.ts index f61e03001..e3581e2ee 100644 --- a/testUtils/mocks/apps.ts +++ b/testUtils/mocks/apps.ts @@ -1,5 +1,5 @@ import { MockedResponse } from "@apollo/client/testing"; -import { extensionList } from "@dashboard/apps/queries"; +import { extensionList } from "@dashboard/new-apps/queries"; export const appsMocks: MockedResponse[] = [ {