diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index e5c0f3598..8adc597f9 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -7565,21 +7565,6 @@ "context": "input helper text", "string": "Leaving this setting empty will mean that stock won’t be reserved" }, - "src_dot_siteSettings_dot_components_dot_SiteDetailsSettingsCard_dot_1008586926": { - "string": "Name of your store is shown on tab in web browser" - }, - "src_dot_siteSettings_dot_components_dot_SiteDetailsSettingsCard_dot_1170194728": { - "string": "Store domain" - }, - "src_dot_siteSettings_dot_components_dot_SiteDetailsSettingsCard_dot_2286355060": { - "string": "Name of your store" - }, - "src_dot_siteSettings_dot_components_dot_SiteDetailsSettingsCard_dot_3868874271": { - "string": "Store description" - }, - "src_dot_siteSettings_dot_components_dot_SiteDetailsSettingsCard_dot_529433178": { - "string": "Store description is shown on taskbar after your store name" - }, "src_dot_siteSettings_dot_components_dot_SiteSettingsPage_dot_229184360": { "context": "section header", "string": "Store Information" @@ -7600,10 +7585,6 @@ "context": "section title", "string": "Company Information" }, - "src_dot_siteSettings_dot_components_dot_SiteSettingsPage_dot_sectionDetailsDescription": { - "context": "section description", - "string": "These are general information about your store. They define what is the URL of your store and what is shown in browsers taskbar." - }, "src_dot_somethingWentWrong": { "string": "Saleor ran into an unexpected problem" }, diff --git a/src/graphql/hooks.generated.ts b/src/graphql/hooks.generated.ts index 7acd4daf1..de1f023cf 100644 --- a/src/graphql/hooks.generated.ts +++ b/src/graphql/hooks.generated.ts @@ -14124,7 +14124,7 @@ export type ChannelShippingZonesQueryHookResult = ReturnType; export type ChannelShippingZonesQueryResult = Apollo.QueryResult; export const ShopSettingsUpdateDocument = gql` - mutation ShopSettingsUpdate($shopDomainInput: SiteDomainInput!, $shopSettingsInput: ShopSettingsInput!, $addressInput: AddressInput, $isCloudInstance: Boolean!) { + mutation ShopSettingsUpdate($shopSettingsInput: ShopSettingsInput!, $addressInput: AddressInput, $isCloudInstance: Boolean!) { shopSettingsUpdate(input: $shopSettingsInput) { errors { ...ShopError @@ -14133,17 +14133,6 @@ export const ShopSettingsUpdateDocument = gql` ...Shop } } - shopDomainUpdate(input: $shopDomainInput) @skip(if: $isCloudInstance) { - errors { - ...ShopError - } - shop { - domain { - host - url - } - } - } shopAddressUpdate(input: $addressInput) { errors { ...ShopError @@ -14173,7 +14162,6 @@ export type ShopSettingsUpdateMutationFn = Apollo.MutationFunction } | null }; export type ShopSettingsUpdateMutationVariables = Exact<{ - shopDomainInput: SiteDomainInput; shopSettingsInput: ShopSettingsInput; addressInput?: InputMaybe; isCloudInstance: Scalars['Boolean']; }>; -export type ShopSettingsUpdateMutation = { __typename: 'Mutation', shopSettingsUpdate: { __typename: 'ShopSettingsUpdate', errors: Array<{ __typename: 'ShopError', code: ShopErrorCode, field: string | null, message: string | null }>, shop: { __typename: 'Shop', customerSetPasswordUrl: string | null, defaultMailSenderAddress: string | null, defaultMailSenderName: string | null, description: string | null, name: string, reserveStockDurationAnonymousUser: number | null, reserveStockDurationAuthenticatedUser: number | null, limitQuantityPerCheckout: number | null, companyAddress: { __typename: 'Address', city: string, cityArea: string, companyName: string, countryArea: string, firstName: string, id: string, lastName: string, phone: string | null, postalCode: string, streetAddress1: string, streetAddress2: string, country: { __typename: 'CountryDisplay', code: string, country: string } } | null, countries: Array<{ __typename: 'CountryDisplay', code: string, country: string }>, domain: { __typename: 'Domain', host: string } } | null } | null, shopDomainUpdate?: { __typename: 'ShopDomainUpdate', errors: Array<{ __typename: 'ShopError', code: ShopErrorCode, field: string | null, message: string | null }>, shop: { __typename: 'Shop', domain: { __typename: 'Domain', host: string, url: string } } | null } | null, shopAddressUpdate: { __typename: 'ShopAddressUpdate', errors: Array<{ __typename: 'ShopError', code: ShopErrorCode, field: string | null, message: string | null }>, shop: { __typename: 'Shop', companyAddress: { __typename: 'Address', city: string, cityArea: string, companyName: string, countryArea: string, firstName: string, id: string, lastName: string, phone: string | null, postalCode: string, streetAddress1: string, streetAddress2: string, country: { __typename: 'CountryDisplay', code: string, country: string } } | null } | null } | null }; +export type ShopSettingsUpdateMutation = { __typename: 'Mutation', shopSettingsUpdate: { __typename: 'ShopSettingsUpdate', errors: Array<{ __typename: 'ShopError', code: ShopErrorCode, field: string | null, message: string | null }>, shop: { __typename: 'Shop', customerSetPasswordUrl: string | null, defaultMailSenderAddress: string | null, defaultMailSenderName: string | null, description: string | null, name: string, reserveStockDurationAnonymousUser: number | null, reserveStockDurationAuthenticatedUser: number | null, limitQuantityPerCheckout: number | null, companyAddress: { __typename: 'Address', city: string, cityArea: string, companyName: string, countryArea: string, firstName: string, id: string, lastName: string, phone: string | null, postalCode: string, streetAddress1: string, streetAddress2: string, country: { __typename: 'CountryDisplay', code: string, country: string } } | null, countries: Array<{ __typename: 'CountryDisplay', code: string, country: string }>, domain: { __typename: 'Domain', host: string } } | null } | null, shopAddressUpdate: { __typename: 'ShopAddressUpdate', errors: Array<{ __typename: 'ShopError', code: ShopErrorCode, field: string | null, message: string | null }>, shop: { __typename: 'Shop', companyAddress: { __typename: 'Address', city: string, cityArea: string, companyName: string, countryArea: string, firstName: string, id: string, lastName: string, phone: string | null, postalCode: string, streetAddress1: string, streetAddress2: string, country: { __typename: 'CountryDisplay', code: string, country: string } } | null } | null } | null }; export type SiteSettingsQueryVariables = Exact<{ [key: string]: never; }>; diff --git a/src/siteSettings/components/SiteDetailsSettingsCard/SiteDetailsSettingsCard.tsx b/src/siteSettings/components/SiteDetailsSettingsCard/SiteDetailsSettingsCard.tsx deleted file mode 100644 index 77be54ba3..000000000 --- a/src/siteSettings/components/SiteDetailsSettingsCard/SiteDetailsSettingsCard.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import { Card, CardContent, TextField } from "@material-ui/core"; -import CardTitle from "@saleor/components/CardTitle"; -import FormSpacer from "@saleor/components/FormSpacer"; -import { IS_CLOUD_INSTANCE } from "@saleor/config"; -import { ShopErrorFragment } from "@saleor/graphql"; -import { commonMessages } from "@saleor/intl"; -import { getFormErrors } from "@saleor/utils/errors"; -import getShopErrorMessage from "@saleor/utils/errors/shop"; -import React from "react"; -import { useIntl } from "react-intl"; - -import { SiteSettingsPageFormData } from "../SiteSettingsPage"; - -interface SiteDetailsSettingsCardProps { - data: SiteSettingsPageFormData; - errors: ShopErrorFragment[]; - disabled: boolean; - onChange: (event: React.ChangeEvent) => void; -} - -const SiteDetailsSettingsCard: React.FC = ({ - data, - disabled, - errors, - onChange -}) => { - const intl = useIntl(); - - const formErrors = getFormErrors(["name", "domain", "description"], errors); - - return ( - - - - - - - - - - - ); -}; -SiteDetailsSettingsCard.displayName = "SiteDetailsSettingsCard"; -export default SiteDetailsSettingsCard; diff --git a/src/siteSettings/components/SiteDetailsSettingsCard/index.ts b/src/siteSettings/components/SiteDetailsSettingsCard/index.ts deleted file mode 100644 index 89d0c86e3..000000000 --- a/src/siteSettings/components/SiteDetailsSettingsCard/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "./SiteDetailsSettingsCard"; -export * from "./SiteDetailsSettingsCard"; diff --git a/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx b/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx index 405f06cce..d8340dd8d 100644 --- a/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx +++ b/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx @@ -22,7 +22,6 @@ import React from "react"; import { useIntl } from "react-intl"; import SiteCheckoutSettingsCard from "../SiteCheckoutSettingsCard"; -import SiteSettingsDetailsCard from "../SiteDetailsSettingsCard"; import { messages } from "./messages"; export interface SiteSettingsPageAddressFormData { @@ -39,8 +38,6 @@ export interface SiteSettingsPageAddressFormData { export interface SiteSettingsPageFormData extends SiteSettingsPageAddressFormData { description: string; - domain: string; - name: string; reserveStockDurationAnonymousUser: number; reserveStockDurationAuthenticatedUser: number; limitQuantityPerCheckout: number; @@ -116,8 +113,6 @@ const SiteSettingsPage: React.FC = props => { const initialForm: SiteSettingsPageFormData = { ...initialFormAddress, description: shop?.description || "", - domain: shop?.domain.host || "", - name: shop?.name || "", reserveStockDurationAnonymousUser: shop?.reserveStockDurationAnonymousUser, reserveStockDurationAuthenticatedUser: shop?.reserveStockDurationAuthenticatedUser, @@ -154,19 +149,6 @@ const SiteSettingsPage: React.FC = props => { underline={true} /> - - -
= () => { ] = useShopSettingsUpdateMutation({ onCompleted: data => { if ( - [ - ...data.shopAddressUpdate.errors, - ...data.shopSettingsUpdate.errors, - ...(data.shopDomainUpdate?.errors || []) - ].length === 0 + [...data.shopAddressUpdate.errors, ...data.shopSettingsUpdate.errors] + .length === 0 ) { notify({ status: "success", @@ -53,7 +50,6 @@ export const SiteSettings: React.FC = () => { }); const errors = [ - ...(updateShopSettingsOpts.data?.shopDomainUpdate?.errors || []), ...(updateShopSettingsOpts.data?.shopSettingsUpdate.errors || []), ...(updateShopSettingsOpts.data?.shopAddressUpdate.errors || []) ]; @@ -79,10 +75,6 @@ export const SiteSettings: React.FC = () => { updateShopSettings({ variables: { addressInput, - shopDomainInput: { - domain: data.domain, - name: data.name - }, shopSettingsInput: { description: data.description, reserveStockDurationAnonymousUser: diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 665658d11..f9285dc38 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -238575,163 +238575,6 @@ exports[`Storyshots Views / Site settings / Page default 1`] = `
-
-
- Site Settings -
-
-
- These are general information about your store. They define what is the URL of your store and what is shown in browsers taskbar. -
-
-
-
-
- - General Information - -
-
-
-
- -
- - -
-

- Name of your store is shown on tab in web browser -

-
-
-
- -
- - -
-
-
-
- -
- - -
-

- Store description is shown on taskbar after your store name -

-
-
-
-
-
-
- Site Settings -
-
-
- These are general information about your store. They define what is the URL of your store and what is shown in browsers taskbar. -
-
-
-
-
- - General Information - -
-
-
-
- -
- - -
-

- Invalid value -

-
-
-
- -
- - -
-

- Invalid value -

-
-
-
- -
- - -
-

- Invalid value -

-
-
-
-
-
-
- Site Settings -
-
-
- These are general information about your store. They define what is the URL of your store and what is shown in browsers taskbar. -
-
-
-
-
- - General Information - -
-
-
-
- -
- - -
-

- Name of your store is shown on tab in web browser -

-
-
-
- -
- - -
-
-
-
- -
- - -
-

- Store description is shown on taskbar after your store name -

-
-
-
-