diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 9ce957542..247330295 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -1514,9 +1514,9 @@ "context": "channel settings", "string": "Channel Settings" }, - "src_dot_channels_dot_components_dot_ChannelForm_dot_1843613796": { + "src_dot_channels_dot_components_dot_ChannelForm_dot_146559392": { "context": "selected currency", - "string": "Selected Currency" + "string": "Selected currency" }, "src_dot_channels_dot_components_dot_ChannelForm_dot_2864204643": { "context": "button", @@ -1526,10 +1526,6 @@ "context": "channel slug", "string": "Slug" }, - "src_dot_channels_dot_components_dot_ChannelForm_dot_3511613983": { - "context": "channel name", - "string": "Channel Name" - }, "src_dot_channels_dot_components_dot_ChannelForm_dot_383867403": { "context": "button", "string": "Copy" @@ -1538,6 +1534,13 @@ "context": "channel currency", "string": "Currency" }, + "src_dot_channels_dot_components_dot_ChannelForm_dot_3962880609": { + "string": "Default country" + }, + "src_dot_channels_dot_components_dot_ChannelForm_dot_507892781": { + "context": "channel name", + "string": "Channel name" + }, "src_dot_channels_dot_components_dot_ChannelPickerDialog_dot_2423186459": { "context": "dialog header", "string": "Select a channel" @@ -7510,6 +7513,10 @@ "context": "event", "string": "Product variant deleted" }, + "src_dot_webhooks_dot_components_dot_WebhookEvents_dot_1594316266": { + "context": "event", + "string": "Fulfillment canceled" + }, "src_dot_webhooks_dot_components_dot_WebhookEvents_dot_1606361075": { "context": "event", "string": "Order updated" diff --git a/schema.graphql b/schema.graphql index e59070057..4e7641dc0 100644 --- a/schema.graphql +++ b/schema.graphql @@ -906,6 +906,7 @@ type Channel implements Node { slug: String! currencyCode: String! hasOrders: Boolean! + defaultCountry: CountryDisplay! } type ChannelActivate { @@ -925,6 +926,7 @@ input ChannelCreateInput { name: String! slug: String! currencyCode: String! + defaultCountry: CountryCode! addShippingZones: [ID!] } @@ -973,6 +975,7 @@ input ChannelUpdateInput { isActive: Boolean name: String slug: String + defaultCountry: CountryCode addShippingZones: [ID!] removeShippingZones: [ID!] } @@ -2159,7 +2162,7 @@ type FulfillmentCancel { } input FulfillmentCancelInput { - warehouseId: ID! + warehouseId: ID } type FulfillmentLine implements Node { @@ -3702,7 +3705,7 @@ type Mutation { orderCapture(amount: PositiveDecimal!, id: ID!): OrderCapture orderConfirm(id: ID!): OrderConfirm orderFulfill(input: OrderFulfillInput!, order: ID): OrderFulfill - orderFulfillmentCancel(id: ID!, input: FulfillmentCancelInput!): FulfillmentCancel + orderFulfillmentCancel(id: ID!, input: FulfillmentCancelInput): FulfillmentCancel orderFulfillmentApprove(id: ID!, notifyCustomer: Boolean!): FulfillmentApprove orderFulfillmentUpdateTracking(id: ID!, input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking orderFulfillmentRefundProducts(input: OrderRefundProductsInput!, order: ID!): FulfillmentRefundProducts @@ -7024,6 +7027,7 @@ enum WebhookEventTypeEnum { CHECKOUT_CREATED CHECKOUT_UPDATED FULFILLMENT_CREATED + FULFILLMENT_CANCELED NOTIFY_USER PAGE_CREATED PAGE_UPDATED @@ -7060,6 +7064,7 @@ enum WebhookSampleEventTypeEnum { CHECKOUT_CREATED CHECKOUT_UPDATED FULFILLMENT_CREATED + FULFILLMENT_CANCELED NOTIFY_USER PAGE_CREATED PAGE_UPDATED diff --git a/src/channels/components/ChannelForm/ChannelForm.stories.tsx b/src/channels/components/ChannelForm/ChannelForm.stories.tsx index 5cc6ae3a7..ded569546 100644 --- a/src/channels/components/ChannelForm/ChannelForm.stories.tsx +++ b/src/channels/components/ChannelForm/ChannelForm.stories.tsx @@ -1,4 +1,6 @@ +import { countries } from "@saleor/fixtures"; import Decorator from "@saleor/storybook/Decorator"; +import { CountryCode } from "@saleor/types/globalTypes"; import { storiesOf } from "@storybook/react"; import React from "react"; @@ -11,11 +13,15 @@ const props: ChannelFormProps = { shippingZonesIdsToAdd: [], shippingZonesIdsToRemove: [], name: "Test", - slug: "test" + slug: "test", + defaultCountry: CountryCode.PL }, disabled: false, errors: [], - onChange: () => undefined + selectedCountryDisplayName: "Poland", + countries: countries.map(({ name, code }) => ({ label: name, value: code })), + onChange: () => undefined, + onDefaultCountryChange: () => undefined }; storiesOf("Views / Channels / Channel form", module) diff --git a/src/channels/components/ChannelForm/ChannelForm.tsx b/src/channels/components/ChannelForm/ChannelForm.tsx index 31ee8ca2a..57992745c 100644 --- a/src/channels/components/ChannelForm/ChannelForm.tsx +++ b/src/channels/components/ChannelForm/ChannelForm.tsx @@ -16,6 +16,7 @@ import useClipboard from "@saleor/hooks/useClipboard"; import { ChangeEvent } from "@saleor/hooks/useForm"; import { FormChange } from "@saleor/hooks/useForm"; import { commonMessages } from "@saleor/intl"; +import { CountryCode } from "@saleor/types/globalTypes"; import { getFormErrors } from "@saleor/utils/errors"; import getChannelsErrorMessage from "@saleor/utils/errors/channels"; import React from "react"; @@ -30,6 +31,7 @@ export interface FormData { slug: string; shippingZonesIdsToAdd: string[]; shippingZonesIdsToRemove: string[]; + defaultCountry: CountryCode; } export interface ChannelFormProps { @@ -38,8 +40,11 @@ export interface ChannelFormProps { currencyCodes?: SingleAutocompleteChoiceType[]; errors: ChannelErrorFragment[]; selectedCurrencyCode?: string; + selectedCountryDisplayName: string; + countries: SingleAutocompleteChoiceType[]; onChange: FormChange; onCurrencyCodeChange?: (event: ChangeEvent) => void; + onDefaultCountryChange: (event: ChangeEvent) => void; } export const ChannelForm: React.FC = ({ @@ -48,8 +53,11 @@ export const ChannelForm: React.FC = ({ disabled, errors, selectedCurrencyCode, + selectedCountryDisplayName, + countries, onChange, - onCurrencyCodeChange + onCurrencyCodeChange, + onDefaultCountryChange }) => { const intl = useIntl(); const [copied, copy] = useClipboard(); @@ -58,7 +66,6 @@ export const ChannelForm: React.FC = ({ errors ); const classes = useStyles({}); - return ( <> @@ -72,7 +79,7 @@ export const ChannelForm: React.FC = ({ disabled={disabled} fullWidth label={intl.formatMessage({ - defaultMessage: "Channel Name", + defaultMessage: "Channel name", description: "channel name" })} name="name" @@ -132,7 +139,7 @@ export const ChannelForm: React.FC = ({ })} /> - {!!currencyCodes ? ( + {currencyCodes ? ( = ({ <> {data.currencyCode} )} + + diff --git a/src/channels/fixtures.ts b/src/channels/fixtures.ts index 2a4617f63..7ffdaa8e1 100644 --- a/src/channels/fixtures.ts +++ b/src/channels/fixtures.ts @@ -22,7 +22,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbm5lcDoy", isActive: true, name: "Test", - slug: "test" + slug: "test", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }, { __typename: "Channel", @@ -31,7 +36,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbm7lbDoy213", isActive: true, name: "Channel", - slug: "channel" + slug: "channel", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }, { __typename: "Channel", @@ -40,7 +50,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbn5lbDoytr", isActive: true, name: "Channel test", - slug: "channeltest" + slug: "channeltest", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }, { __typename: "Channel", @@ -49,7 +64,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbm5lbDo5bot", isActive: true, name: "Channel USD", - slug: "channel-usd" + slug: "channel-usd", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }, { __typename: "Channel", @@ -58,7 +78,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbm7lbDoyr0tr", isActive: true, name: "Channel", - slug: "channel2" + slug: "channel2", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }, { __typename: "Channel", @@ -67,7 +92,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbn5lbDoyya", isActive: true, name: "Channel test", - slug: "channeltest4" + slug: "channeltest4", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }, { __typename: "Channel", @@ -76,7 +106,12 @@ export const channelsList: Channels_channels[] = [ id: "Q2hhbm5lbDo5w0z", isActive: true, name: "Channel USD", - slug: "channel-usd1" + slug: "channel-usd1", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } } ]; @@ -87,7 +122,12 @@ export const channel: Channel_channel = { id: "Q2hhbm5lbDov78", isActive: true, name: "Test", - slug: "test" + slug: "test", + defaultCountry: { + code: "PL", + country: "Poland", + __typename: "CountryDisplay" + } }; export const productChannels: ProductDetails_product_channelListings[] = [ diff --git a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx index 1386a2d34..8a227c045 100644 --- a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx +++ b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.stories.tsx @@ -1,3 +1,4 @@ +import { countries } from "@saleor/fixtures"; import Decorator from "@saleor/storybook/Decorator"; import { storiesOf } from "@storybook/react"; import React from "react"; @@ -21,6 +22,11 @@ const props: ChannelDetailsPageProps = { updateChannelStatus: () => undefined, searchShippingZones: () => undefined, searchShippingZonesData: undefined, + countries: countries.map(({ name, code }) => ({ + code, + country: name, + __typename: "CountryDisplay" + })), channelShippingZones: [ { __typename: "ShippingZone", diff --git a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx index 9a7700bbb..00c959e6b 100644 --- a/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx +++ b/src/channels/pages/ChannelDetailsPage/ChannelDetailsPage.tsx @@ -6,6 +6,7 @@ import Grid from "@saleor/components/Grid"; import Savebar from "@saleor/components/Savebar"; import { SingleAutocompleteChoiceType } from "@saleor/components/SingleAutocompleteSelectField"; import { ChannelErrorFragment } from "@saleor/fragments/types/ChannelErrorFragment"; +import { CountryFragment } from "@saleor/fragments/types/CountryFragment"; import { SearchData } from "@saleor/hooks/makeTopLevelSearch"; import { getParsedSearchData } from "@saleor/hooks/makeTopLevelSearch/utils"; import useStateFromProps from "@saleor/hooks/useStateFromProps"; @@ -15,7 +16,9 @@ import { } from "@saleor/orders/components/OrderReturnPage/utils"; import { SearchShippingZones_search_edges_node } from "@saleor/searches/types/SearchShippingZones"; import { FetchMoreProps } from "@saleor/types"; +import { CountryCode } from "@saleor/types/globalTypes"; import createSingleAutocompleteSelectHandler from "@saleor/utils/handlers/singleAutocompleteSelectChangeHandler"; +import { mapCountriesToChoices } from "@saleor/utils/maps"; import React, { useState } from "react"; import { ChannelForm, FormData } from "../../components/ChannelForm"; @@ -31,14 +34,15 @@ export interface ChannelDetailsPageProps { disabledStatus?: boolean; errors: ChannelErrorFragment[]; saveButtonBarState: ConfirmButtonTransitionState; + searchShippingZonesData?: SearchData; + fetchMoreShippingZones: FetchMoreProps; + channelShippingZones?: ChannelShippingZones; + countries: CountryFragment[]; onBack?: () => void; onDelete?: () => void; onSubmit: (data: FormData) => void; updateChannelStatus?: () => void; searchShippingZones: (query: string) => void; - searchShippingZonesData?: SearchData; - fetchMoreShippingZones: FetchMoreProps; - channelShippingZones?: ChannelShippingZones; } export const ChannelDetailsPage: React.FC = ({ @@ -55,21 +59,30 @@ export const ChannelDetailsPage: React.FC = ({ searchShippingZones, searchShippingZonesData, fetchMoreShippingZones, + countries, channelShippingZones = [] }) => { const [selectedCurrencyCode, setSelectedCurrencyCode] = useState(""); + const [ + selectedCountryDisplayName, + setSelectedCountryDisplayName + ] = useStateFromProps(channel?.defaultCountry.country || ""); const [shippingZonesToDisplay, setShippingZonesToDisplay] = useStateFromProps< ChannelShippingZones >(channelShippingZones); + const countryChoices = mapCountriesToChoices(countries || []); + + const { defaultCountry, ...formData } = channel || {}; const initialData: FormData = { currencyCode: "", name: "", slug: "", shippingZonesIdsToAdd: [], shippingZonesIdsToRemove: [], - ...channel + defaultCountry: (defaultCountry?.code || "") as CountryCode, + ...formData }; const getFilteredShippingZonesChoices = (): SearchShippingZones_search_edges_node[] => @@ -86,6 +99,11 @@ export const ChannelDetailsPage: React.FC = ({ setSelectedCurrencyCode, currencyCodes ); + const handleDefaultCountrySelect = createSingleAutocompleteSelectHandler( + change, + setSelectedCountryDisplayName, + countryChoices + ); const addShippingZone = (zoneId: string) => { set({ @@ -136,9 +154,12 @@ export const ChannelDetailsPage: React.FC = ({ data={data} disabled={disabled} currencyCodes={currencyCodes} + countries={countryChoices} selectedCurrencyCode={selectedCurrencyCode} + selectedCountryDisplayName={selectedCountryDisplayName} onChange={change} onCurrencyCodeChange={handleCurrencyCodeSelect} + onDefaultCountryChange={handleDefaultCountrySelect} errors={errors} /> diff --git a/src/channels/types/BaseChannels.ts b/src/channels/types/BaseChannels.ts index 774060e40..cd2ff7e8a 100644 --- a/src/channels/types/BaseChannels.ts +++ b/src/channels/types/BaseChannels.ts @@ -7,6 +7,12 @@ // GraphQL query operation: BaseChannels // ==================================================== +export interface BaseChannels_channels_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface BaseChannels_channels { __typename: "Channel"; id: string; @@ -14,6 +20,7 @@ export interface BaseChannels_channels { name: string; slug: string; currencyCode: string; + defaultCountry: BaseChannels_channels_defaultCountry; } export interface BaseChannels { diff --git a/src/channels/types/Channel.ts b/src/channels/types/Channel.ts index eaebfe162..21e41917a 100644 --- a/src/channels/types/Channel.ts +++ b/src/channels/types/Channel.ts @@ -7,6 +7,12 @@ // GraphQL query operation: Channel // ==================================================== +export interface Channel_channel_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface Channel_channel { __typename: "Channel"; id: string; @@ -14,6 +20,7 @@ export interface Channel_channel { name: string; slug: string; currencyCode: string; + defaultCountry: Channel_channel_defaultCountry; hasOrders: boolean; } diff --git a/src/channels/types/ChannelActivate.ts b/src/channels/types/ChannelActivate.ts index ec2c451fb..72aa425d4 100644 --- a/src/channels/types/ChannelActivate.ts +++ b/src/channels/types/ChannelActivate.ts @@ -9,6 +9,12 @@ import { ChannelErrorCode } from "./../../types/globalTypes"; // GraphQL mutation operation: ChannelActivate // ==================================================== +export interface ChannelActivate_channelActivate_channel_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface ChannelActivate_channelActivate_channel { __typename: "Channel"; id: string; @@ -16,6 +22,7 @@ export interface ChannelActivate_channelActivate_channel { name: string; slug: string; currencyCode: string; + defaultCountry: ChannelActivate_channelActivate_channel_defaultCountry; hasOrders: boolean; } diff --git a/src/channels/types/ChannelCreate.ts b/src/channels/types/ChannelCreate.ts index bb6b70d1a..aade69d44 100644 --- a/src/channels/types/ChannelCreate.ts +++ b/src/channels/types/ChannelCreate.ts @@ -9,6 +9,12 @@ import { ChannelCreateInput, ChannelErrorCode } from "./../../types/globalTypes" // GraphQL mutation operation: ChannelCreate // ==================================================== +export interface ChannelCreate_channelCreate_channel_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface ChannelCreate_channelCreate_channel { __typename: "Channel"; id: string; @@ -16,6 +22,7 @@ export interface ChannelCreate_channelCreate_channel { name: string; slug: string; currencyCode: string; + defaultCountry: ChannelCreate_channelCreate_channel_defaultCountry; hasOrders: boolean; } diff --git a/src/channels/types/ChannelDeactivate.ts b/src/channels/types/ChannelDeactivate.ts index e99f790d7..2621d5e0e 100644 --- a/src/channels/types/ChannelDeactivate.ts +++ b/src/channels/types/ChannelDeactivate.ts @@ -9,6 +9,12 @@ import { ChannelErrorCode } from "./../../types/globalTypes"; // GraphQL mutation operation: ChannelDeactivate // ==================================================== +export interface ChannelDeactivate_channelDeactivate_channel_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface ChannelDeactivate_channelDeactivate_channel { __typename: "Channel"; id: string; @@ -16,6 +22,7 @@ export interface ChannelDeactivate_channelDeactivate_channel { name: string; slug: string; currencyCode: string; + defaultCountry: ChannelDeactivate_channelDeactivate_channel_defaultCountry; hasOrders: boolean; } diff --git a/src/channels/types/ChannelUpdate.ts b/src/channels/types/ChannelUpdate.ts index 2380a32e9..1d9b53367 100644 --- a/src/channels/types/ChannelUpdate.ts +++ b/src/channels/types/ChannelUpdate.ts @@ -9,6 +9,12 @@ import { ChannelUpdateInput, ChannelErrorCode } from "./../../types/globalTypes" // GraphQL mutation operation: ChannelUpdate // ==================================================== +export interface ChannelUpdate_channelUpdate_channel_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface ChannelUpdate_channelUpdate_channel { __typename: "Channel"; id: string; @@ -16,6 +22,7 @@ export interface ChannelUpdate_channelUpdate_channel { name: string; slug: string; currencyCode: string; + defaultCountry: ChannelUpdate_channelUpdate_channel_defaultCountry; hasOrders: boolean; } diff --git a/src/channels/types/Channels.ts b/src/channels/types/Channels.ts index 4a6c2418c..7698a7343 100644 --- a/src/channels/types/Channels.ts +++ b/src/channels/types/Channels.ts @@ -7,6 +7,12 @@ // GraphQL query operation: Channels // ==================================================== +export interface Channels_channels_defaultCountry { + __typename: "CountryDisplay"; + code: string; + country: string; +} + export interface Channels_channels { __typename: "Channel"; id: string; @@ -14,6 +20,7 @@ export interface Channels_channels { name: string; slug: string; currencyCode: string; + defaultCountry: Channels_channels_defaultCountry; hasOrders: boolean; } diff --git a/src/channels/views/ChannelCreate/ChannelCreate.tsx b/src/channels/views/ChannelCreate/ChannelCreate.tsx index 8fcb2d956..8c7094a7d 100644 --- a/src/channels/views/ChannelCreate/ChannelCreate.tsx +++ b/src/channels/views/ChannelCreate/ChannelCreate.tsx @@ -8,6 +8,7 @@ import { getSearchFetchMoreProps } from "@saleor/hooks/makeTopLevelSearch/utils" import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; import { getDefaultNotifierSuccessErrorData } from "@saleor/hooks/useNotifier/utils"; +import useShop from "@saleor/hooks/useShop"; import { sectionNames } from "@saleor/intl"; import { Backlink } from "@saleor/macaw-ui"; import useShippingZonesSearch from "@saleor/searches/useShippingZonesSearch"; @@ -23,6 +24,7 @@ export const ChannelCreateView = ({}) => { const navigate = useNavigator(); const notify = useNotifier(); const intl = useIntl(); + const shop = useShop(); const handleBack = () => navigate(channelsListUrl()); @@ -105,6 +107,7 @@ export const ChannelCreateView = ({}) => { onSubmit={handleSubmit} onBack={handleBack} saveButtonBarState={createChannelOpts.status} + countries={shop?.countries || []} /> diff --git a/src/channels/views/ChannelDetails/ChannelDetails.tsx b/src/channels/views/ChannelDetails/ChannelDetails.tsx index 4977c14ec..63a723b2c 100644 --- a/src/channels/views/ChannelDetails/ChannelDetails.tsx +++ b/src/channels/views/ChannelDetails/ChannelDetails.tsx @@ -11,6 +11,7 @@ import { getSearchFetchMoreProps } from "@saleor/hooks/makeTopLevelSearch/utils" import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; import { getDefaultNotifierSuccessErrorData } from "@saleor/hooks/useNotifier/utils"; +import useShop from "@saleor/hooks/useShop"; import { sectionNames } from "@saleor/intl"; import { Backlink } from "@saleor/macaw-ui"; import useShippingZonesSearch from "@saleor/searches/useShippingZonesSearch"; @@ -48,6 +49,7 @@ export const ChannelDetails: React.FC = ({ const navigate = useNavigator(); const notify = useNotifier(); const intl = useIntl(); + const shop = useShop(); const handleBack = () => navigate(channelsListUrl()); @@ -100,7 +102,8 @@ export const ChannelDetails: React.FC = ({ name, slug, shippingZonesIdsToRemove, - shippingZonesIdsToAdd + shippingZonesIdsToAdd, + defaultCountry }: FormData) => updateChannel({ variables: { @@ -108,6 +111,7 @@ export const ChannelDetails: React.FC = ({ input: { name, slug, + defaultCountry, addShippingZones: shippingZonesIdsToAdd, removeShippingZones: shippingZonesIdsToRemove } @@ -209,6 +213,7 @@ export const ChannelDetails: React.FC = ({ : activateChannel({ variables: { id } }) } saveButtonBarState={updateChannelOpts.status} + countries={shop?.countries || []} /> +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
- Channel Name + Channel name @@ -53601,6 +53857,66 @@ exports[`Storyshots Views / Channels / Channel details default 1`] = `
+
+
+
+ + +
+
@@ -53912,7 +54228,7 @@ exports[`Storyshots Views / Channels / Channel details disabled 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id MuiFormLabel-disabled-id MuiInputLabel-disabled-id" data-shrink="false" > - Channel Name + Channel name
- Channel Name + Channel name @@ -54071,6 +54387,67 @@ exports[`Storyshots Views / Channels / Channel details disabled 1`] = `
+
+
+
+ + +
+
@@ -54382,7 +54759,7 @@ exports[`Storyshots Views / Channels / Channel details loading 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id" data-shrink="false" > - Channel Name + Channel name
- Channel Name + Channel name @@ -54538,6 +54915,66 @@ exports[`Storyshots Views / Channels / Channel details loading 1`] = `
+
+
+
+ + +
+
@@ -54849,7 +55286,7 @@ exports[`Storyshots Views / Channels / Channel details with data 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-filled-id" data-shrink="true" > - Channel Name + Channel name
- Channel Name + Channel name @@ -55005,6 +55442,66 @@ exports[`Storyshots Views / Channels / Channel details with data 1`] = `
+
+
+
+ + +
+
@@ -55316,7 +55813,7 @@ exports[`Storyshots Views / Channels / Channel details with errors 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id" data-shrink="false" > - Channel Name + Channel name
- Channel Name + Channel name @@ -55478,6 +55975,66 @@ exports[`Storyshots Views / Channels / Channel details with errors 1`] = `
+
+
+
+ + +
+
@@ -55789,7 +56346,7 @@ exports[`Storyshots Views / Channels / Channel details without editable currency class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-filled-id" data-shrink="true" > - Channel Name + Channel name
- Channel Name + Channel name @@ -55891,13 +56448,73 @@ exports[`Storyshots Views / Channels / Channel details without editable currency
- Selected Currency + Selected currency
zl
+
+
+
+ + +
+
@@ -56204,7 +56821,7 @@ exports[`Storyshots Views / Channels / Channel form default 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-filled-id" data-shrink="true" > - Channel Name + Channel name
- Channel Name + Channel name @@ -56306,13 +56923,73 @@ exports[`Storyshots Views / Channels / Channel form default 1`] = `
- Selected Currency + Selected currency
euro
+
+
+
+ + +
+
@@ -56353,7 +57030,7 @@ exports[`Storyshots Views / Channels / Channel form disabled 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-disabled-id MuiInputLabel-disabled-id MuiFormLabel-filled-id" data-shrink="true" > - Channel Name + Channel name
- Channel Name + Channel name @@ -56457,13 +57134,74 @@ exports[`Storyshots Views / Channels / Channel form disabled 1`] = `
- Selected Currency + Selected currency
euro
+
+
+
+ + +
+
@@ -56504,7 +57242,7 @@ exports[`Storyshots Views / Channels / Channel form with errors 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-filled-id" data-shrink="true" > - Channel Name + Channel name
- Channel Name + Channel name @@ -56612,13 +57350,73 @@ exports[`Storyshots Views / Channels / Channel form with errors 1`] = `
- Selected Currency + Selected currency
euro
+
+
+
+ + +
+
diff --git a/src/types/globalTypes.ts b/src/types/globalTypes.ts index c3938662d..13abe6c5c 100644 --- a/src/types/globalTypes.ts +++ b/src/types/globalTypes.ts @@ -1797,6 +1797,7 @@ export enum WebhookEventTypeEnum { CHECKOUT_UPDATED = "CHECKOUT_UPDATED", CUSTOMER_CREATED = "CUSTOMER_CREATED", CUSTOMER_UPDATED = "CUSTOMER_UPDATED", + FULFILLMENT_CANCELED = "FULFILLMENT_CANCELED", FULFILLMENT_CREATED = "FULFILLMENT_CREATED", INVOICE_DELETED = "INVOICE_DELETED", INVOICE_REQUESTED = "INVOICE_REQUESTED", @@ -2007,6 +2008,7 @@ export interface ChannelCreateInput { name: string; slug: string; currencyCode: string; + defaultCountry: CountryCode; addShippingZones?: string[] | null; } @@ -2018,6 +2020,7 @@ export interface ChannelUpdateInput { isActive?: boolean | null; name?: string | null; slug?: string | null; + defaultCountry?: CountryCode | null; addShippingZones?: string[] | null; removeShippingZones?: string[] | null; } @@ -2141,7 +2144,7 @@ export interface ExportProductsInput { } export interface FulfillmentCancelInput { - warehouseId: string; + warehouseId?: string | null; } export interface FulfillmentUpdateTrackingInput { diff --git a/src/webhooks/components/WebhookEvents/WebhookEvents.tsx b/src/webhooks/components/WebhookEvents/WebhookEvents.tsx index 28b4cd4b9..0b7d049e8 100644 --- a/src/webhooks/components/WebhookEvents/WebhookEvents.tsx +++ b/src/webhooks/components/WebhookEvents/WebhookEvents.tsx @@ -146,6 +146,10 @@ const WebhookEvents: React.FC = ({ defaultMessage: "Fulfillment created", description: "event" }), + [WebhookEventTypeEnum.FULFILLMENT_CANCELED]: intl.formatMessage({ + defaultMessage: "Fulfillment canceled", + description: "event" + }), [WebhookEventTypeEnum.INVOICE_REQUESTED]: intl.formatMessage({ defaultMessage: "Invoice requested", description: "event"