Add channel default country (#1330)
* Add channel default country (#1323) * Add default country to channel * Fix fixtures * Update snapshots, extract messages * Trigger deployment * Update schema * Update snapshots * Trigger deployment
This commit is contained in:
parent
0cdcec4476
commit
7051181802
22 changed files with 1046 additions and 51 deletions
|
@ -1514,9 +1514,9 @@
|
||||||
"context": "channel settings",
|
"context": "channel settings",
|
||||||
"string": "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",
|
"context": "selected currency",
|
||||||
"string": "Selected Currency"
|
"string": "Selected currency"
|
||||||
},
|
},
|
||||||
"src_dot_channels_dot_components_dot_ChannelForm_dot_2864204643": {
|
"src_dot_channels_dot_components_dot_ChannelForm_dot_2864204643": {
|
||||||
"context": "button",
|
"context": "button",
|
||||||
|
@ -1526,10 +1526,6 @@
|
||||||
"context": "channel slug",
|
"context": "channel slug",
|
||||||
"string": "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": {
|
"src_dot_channels_dot_components_dot_ChannelForm_dot_383867403": {
|
||||||
"context": "button",
|
"context": "button",
|
||||||
"string": "Copy"
|
"string": "Copy"
|
||||||
|
@ -1538,6 +1534,13 @@
|
||||||
"context": "channel currency",
|
"context": "channel currency",
|
||||||
"string": "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": {
|
"src_dot_channels_dot_components_dot_ChannelPickerDialog_dot_2423186459": {
|
||||||
"context": "dialog header",
|
"context": "dialog header",
|
||||||
"string": "Select a channel"
|
"string": "Select a channel"
|
||||||
|
@ -7510,6 +7513,10 @@
|
||||||
"context": "event",
|
"context": "event",
|
||||||
"string": "Product variant deleted"
|
"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": {
|
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_1606361075": {
|
||||||
"context": "event",
|
"context": "event",
|
||||||
"string": "Order updated"
|
"string": "Order updated"
|
||||||
|
|
|
@ -906,6 +906,7 @@ type Channel implements Node {
|
||||||
slug: String!
|
slug: String!
|
||||||
currencyCode: String!
|
currencyCode: String!
|
||||||
hasOrders: Boolean!
|
hasOrders: Boolean!
|
||||||
|
defaultCountry: CountryDisplay!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChannelActivate {
|
type ChannelActivate {
|
||||||
|
@ -925,6 +926,7 @@ input ChannelCreateInput {
|
||||||
name: String!
|
name: String!
|
||||||
slug: String!
|
slug: String!
|
||||||
currencyCode: String!
|
currencyCode: String!
|
||||||
|
defaultCountry: CountryCode!
|
||||||
addShippingZones: [ID!]
|
addShippingZones: [ID!]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,6 +975,7 @@ input ChannelUpdateInput {
|
||||||
isActive: Boolean
|
isActive: Boolean
|
||||||
name: String
|
name: String
|
||||||
slug: String
|
slug: String
|
||||||
|
defaultCountry: CountryCode
|
||||||
addShippingZones: [ID!]
|
addShippingZones: [ID!]
|
||||||
removeShippingZones: [ID!]
|
removeShippingZones: [ID!]
|
||||||
}
|
}
|
||||||
|
@ -2159,7 +2162,7 @@ type FulfillmentCancel {
|
||||||
}
|
}
|
||||||
|
|
||||||
input FulfillmentCancelInput {
|
input FulfillmentCancelInput {
|
||||||
warehouseId: ID!
|
warehouseId: ID
|
||||||
}
|
}
|
||||||
|
|
||||||
type FulfillmentLine implements Node {
|
type FulfillmentLine implements Node {
|
||||||
|
@ -3702,7 +3705,7 @@ type Mutation {
|
||||||
orderCapture(amount: PositiveDecimal!, id: ID!): OrderCapture
|
orderCapture(amount: PositiveDecimal!, id: ID!): OrderCapture
|
||||||
orderConfirm(id: ID!): OrderConfirm
|
orderConfirm(id: ID!): OrderConfirm
|
||||||
orderFulfill(input: OrderFulfillInput!, order: ID): OrderFulfill
|
orderFulfill(input: OrderFulfillInput!, order: ID): OrderFulfill
|
||||||
orderFulfillmentCancel(id: ID!, input: FulfillmentCancelInput!): FulfillmentCancel
|
orderFulfillmentCancel(id: ID!, input: FulfillmentCancelInput): FulfillmentCancel
|
||||||
orderFulfillmentApprove(id: ID!, notifyCustomer: Boolean!): FulfillmentApprove
|
orderFulfillmentApprove(id: ID!, notifyCustomer: Boolean!): FulfillmentApprove
|
||||||
orderFulfillmentUpdateTracking(id: ID!, input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking
|
orderFulfillmentUpdateTracking(id: ID!, input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking
|
||||||
orderFulfillmentRefundProducts(input: OrderRefundProductsInput!, order: ID!): FulfillmentRefundProducts
|
orderFulfillmentRefundProducts(input: OrderRefundProductsInput!, order: ID!): FulfillmentRefundProducts
|
||||||
|
@ -7024,6 +7027,7 @@ enum WebhookEventTypeEnum {
|
||||||
CHECKOUT_CREATED
|
CHECKOUT_CREATED
|
||||||
CHECKOUT_UPDATED
|
CHECKOUT_UPDATED
|
||||||
FULFILLMENT_CREATED
|
FULFILLMENT_CREATED
|
||||||
|
FULFILLMENT_CANCELED
|
||||||
NOTIFY_USER
|
NOTIFY_USER
|
||||||
PAGE_CREATED
|
PAGE_CREATED
|
||||||
PAGE_UPDATED
|
PAGE_UPDATED
|
||||||
|
@ -7060,6 +7064,7 @@ enum WebhookSampleEventTypeEnum {
|
||||||
CHECKOUT_CREATED
|
CHECKOUT_CREATED
|
||||||
CHECKOUT_UPDATED
|
CHECKOUT_UPDATED
|
||||||
FULFILLMENT_CREATED
|
FULFILLMENT_CREATED
|
||||||
|
FULFILLMENT_CANCELED
|
||||||
NOTIFY_USER
|
NOTIFY_USER
|
||||||
PAGE_CREATED
|
PAGE_CREATED
|
||||||
PAGE_UPDATED
|
PAGE_UPDATED
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
import { countries } from "@saleor/fixtures";
|
||||||
import Decorator from "@saleor/storybook/Decorator";
|
import Decorator from "@saleor/storybook/Decorator";
|
||||||
|
import { CountryCode } from "@saleor/types/globalTypes";
|
||||||
import { storiesOf } from "@storybook/react";
|
import { storiesOf } from "@storybook/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
@ -11,11 +13,15 @@ const props: ChannelFormProps = {
|
||||||
shippingZonesIdsToAdd: [],
|
shippingZonesIdsToAdd: [],
|
||||||
shippingZonesIdsToRemove: [],
|
shippingZonesIdsToRemove: [],
|
||||||
name: "Test",
|
name: "Test",
|
||||||
slug: "test"
|
slug: "test",
|
||||||
|
defaultCountry: CountryCode.PL
|
||||||
},
|
},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
errors: [],
|
errors: [],
|
||||||
onChange: () => undefined
|
selectedCountryDisplayName: "Poland",
|
||||||
|
countries: countries.map(({ name, code }) => ({ label: name, value: code })),
|
||||||
|
onChange: () => undefined,
|
||||||
|
onDefaultCountryChange: () => undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
storiesOf("Views / Channels / Channel form", module)
|
storiesOf("Views / Channels / Channel form", module)
|
||||||
|
|
|
@ -16,6 +16,7 @@ import useClipboard from "@saleor/hooks/useClipboard";
|
||||||
import { ChangeEvent } from "@saleor/hooks/useForm";
|
import { ChangeEvent } from "@saleor/hooks/useForm";
|
||||||
import { FormChange } from "@saleor/hooks/useForm";
|
import { FormChange } from "@saleor/hooks/useForm";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
|
import { CountryCode } from "@saleor/types/globalTypes";
|
||||||
import { getFormErrors } from "@saleor/utils/errors";
|
import { getFormErrors } from "@saleor/utils/errors";
|
||||||
import getChannelsErrorMessage from "@saleor/utils/errors/channels";
|
import getChannelsErrorMessage from "@saleor/utils/errors/channels";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -30,6 +31,7 @@ export interface FormData {
|
||||||
slug: string;
|
slug: string;
|
||||||
shippingZonesIdsToAdd: string[];
|
shippingZonesIdsToAdd: string[];
|
||||||
shippingZonesIdsToRemove: string[];
|
shippingZonesIdsToRemove: string[];
|
||||||
|
defaultCountry: CountryCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ChannelFormProps {
|
export interface ChannelFormProps {
|
||||||
|
@ -38,8 +40,11 @@ export interface ChannelFormProps {
|
||||||
currencyCodes?: SingleAutocompleteChoiceType[];
|
currencyCodes?: SingleAutocompleteChoiceType[];
|
||||||
errors: ChannelErrorFragment[];
|
errors: ChannelErrorFragment[];
|
||||||
selectedCurrencyCode?: string;
|
selectedCurrencyCode?: string;
|
||||||
|
selectedCountryDisplayName: string;
|
||||||
|
countries: SingleAutocompleteChoiceType[];
|
||||||
onChange: FormChange;
|
onChange: FormChange;
|
||||||
onCurrencyCodeChange?: (event: ChangeEvent) => void;
|
onCurrencyCodeChange?: (event: ChangeEvent) => void;
|
||||||
|
onDefaultCountryChange: (event: ChangeEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ChannelForm: React.FC<ChannelFormProps> = ({
|
export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
|
@ -48,8 +53,11 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
disabled,
|
disabled,
|
||||||
errors,
|
errors,
|
||||||
selectedCurrencyCode,
|
selectedCurrencyCode,
|
||||||
|
selectedCountryDisplayName,
|
||||||
|
countries,
|
||||||
onChange,
|
onChange,
|
||||||
onCurrencyCodeChange
|
onCurrencyCodeChange,
|
||||||
|
onDefaultCountryChange
|
||||||
}) => {
|
}) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [copied, copy] = useClipboard();
|
const [copied, copy] = useClipboard();
|
||||||
|
@ -58,7 +66,6 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
errors
|
errors
|
||||||
);
|
);
|
||||||
const classes = useStyles({});
|
const classes = useStyles({});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Card>
|
<Card>
|
||||||
|
@ -72,7 +79,7 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
fullWidth
|
fullWidth
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
defaultMessage: "Channel Name",
|
defaultMessage: "Channel name",
|
||||||
description: "channel name"
|
description: "channel name"
|
||||||
})}
|
})}
|
||||||
name="name"
|
name="name"
|
||||||
|
@ -132,7 +139,7 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
{!!currencyCodes ? (
|
{currencyCodes ? (
|
||||||
<SingleAutocompleteSelectField
|
<SingleAutocompleteSelectField
|
||||||
data-test-id="channel-currency-select-input"
|
data-test-id="channel-currency-select-input"
|
||||||
allowCustomValues
|
allowCustomValues
|
||||||
|
@ -161,13 +168,36 @@ export const ChannelForm: React.FC<ChannelFormProps> = ({
|
||||||
<>
|
<>
|
||||||
<Typography variant="caption" className={classes.label}>
|
<Typography variant="caption" className={classes.label}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Selected Currency"
|
defaultMessage="Selected currency"
|
||||||
description="selected currency"
|
description="selected currency"
|
||||||
/>
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography>{data.currencyCode}</Typography>
|
<Typography>{data.currencyCode}</Typography>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<FormSpacer />
|
||||||
|
<SingleAutocompleteSelectField
|
||||||
|
data-test-id="country-select-input"
|
||||||
|
error={!!formErrors.defaultCountry}
|
||||||
|
FormHelperTextProps={
|
||||||
|
{
|
||||||
|
"data-testid": "country-text-input-helper-text"
|
||||||
|
} as ExtendedFormHelperTextProps
|
||||||
|
}
|
||||||
|
helperText={getChannelsErrorMessage(
|
||||||
|
formErrors?.defaultCountry,
|
||||||
|
intl
|
||||||
|
)}
|
||||||
|
disabled={disabled}
|
||||||
|
label={intl.formatMessage({
|
||||||
|
defaultMessage: "Default country"
|
||||||
|
})}
|
||||||
|
choices={countries}
|
||||||
|
name="defaultCountry"
|
||||||
|
displayValue={selectedCountryDisplayName}
|
||||||
|
value={data.defaultCountry}
|
||||||
|
onChange={onDefaultCountryChange}
|
||||||
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -22,7 +22,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbm5lcDoy",
|
id: "Q2hhbm5lcDoy",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Test",
|
name: "Test",
|
||||||
slug: "test"
|
slug: "test",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__typename: "Channel",
|
__typename: "Channel",
|
||||||
|
@ -31,7 +36,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbm7lbDoy213",
|
id: "Q2hhbm7lbDoy213",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Channel",
|
name: "Channel",
|
||||||
slug: "channel"
|
slug: "channel",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__typename: "Channel",
|
__typename: "Channel",
|
||||||
|
@ -40,7 +50,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbn5lbDoytr",
|
id: "Q2hhbn5lbDoytr",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Channel test",
|
name: "Channel test",
|
||||||
slug: "channeltest"
|
slug: "channeltest",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__typename: "Channel",
|
__typename: "Channel",
|
||||||
|
@ -49,7 +64,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbm5lbDo5bot",
|
id: "Q2hhbm5lbDo5bot",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Channel USD",
|
name: "Channel USD",
|
||||||
slug: "channel-usd"
|
slug: "channel-usd",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__typename: "Channel",
|
__typename: "Channel",
|
||||||
|
@ -58,7 +78,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbm7lbDoyr0tr",
|
id: "Q2hhbm7lbDoyr0tr",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Channel",
|
name: "Channel",
|
||||||
slug: "channel2"
|
slug: "channel2",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__typename: "Channel",
|
__typename: "Channel",
|
||||||
|
@ -67,7 +92,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbn5lbDoyya",
|
id: "Q2hhbn5lbDoyya",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Channel test",
|
name: "Channel test",
|
||||||
slug: "channeltest4"
|
slug: "channeltest4",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__typename: "Channel",
|
__typename: "Channel",
|
||||||
|
@ -76,7 +106,12 @@ export const channelsList: Channels_channels[] = [
|
||||||
id: "Q2hhbm5lbDo5w0z",
|
id: "Q2hhbm5lbDo5w0z",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Channel USD",
|
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",
|
id: "Q2hhbm5lbDov78",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
name: "Test",
|
name: "Test",
|
||||||
slug: "test"
|
slug: "test",
|
||||||
|
defaultCountry: {
|
||||||
|
code: "PL",
|
||||||
|
country: "Poland",
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const productChannels: ProductDetails_product_channelListings[] = [
|
export const productChannels: ProductDetails_product_channelListings[] = [
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { countries } from "@saleor/fixtures";
|
||||||
import Decorator from "@saleor/storybook/Decorator";
|
import Decorator from "@saleor/storybook/Decorator";
|
||||||
import { storiesOf } from "@storybook/react";
|
import { storiesOf } from "@storybook/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -21,6 +22,11 @@ const props: ChannelDetailsPageProps = {
|
||||||
updateChannelStatus: () => undefined,
|
updateChannelStatus: () => undefined,
|
||||||
searchShippingZones: () => undefined,
|
searchShippingZones: () => undefined,
|
||||||
searchShippingZonesData: undefined,
|
searchShippingZonesData: undefined,
|
||||||
|
countries: countries.map(({ name, code }) => ({
|
||||||
|
code,
|
||||||
|
country: name,
|
||||||
|
__typename: "CountryDisplay"
|
||||||
|
})),
|
||||||
channelShippingZones: [
|
channelShippingZones: [
|
||||||
{
|
{
|
||||||
__typename: "ShippingZone",
|
__typename: "ShippingZone",
|
||||||
|
|
|
@ -6,6 +6,7 @@ import Grid from "@saleor/components/Grid";
|
||||||
import Savebar from "@saleor/components/Savebar";
|
import Savebar from "@saleor/components/Savebar";
|
||||||
import { SingleAutocompleteChoiceType } from "@saleor/components/SingleAutocompleteSelectField";
|
import { SingleAutocompleteChoiceType } from "@saleor/components/SingleAutocompleteSelectField";
|
||||||
import { ChannelErrorFragment } from "@saleor/fragments/types/ChannelErrorFragment";
|
import { ChannelErrorFragment } from "@saleor/fragments/types/ChannelErrorFragment";
|
||||||
|
import { CountryFragment } from "@saleor/fragments/types/CountryFragment";
|
||||||
import { SearchData } from "@saleor/hooks/makeTopLevelSearch";
|
import { SearchData } from "@saleor/hooks/makeTopLevelSearch";
|
||||||
import { getParsedSearchData } from "@saleor/hooks/makeTopLevelSearch/utils";
|
import { getParsedSearchData } from "@saleor/hooks/makeTopLevelSearch/utils";
|
||||||
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
||||||
|
@ -15,7 +16,9 @@ import {
|
||||||
} from "@saleor/orders/components/OrderReturnPage/utils";
|
} from "@saleor/orders/components/OrderReturnPage/utils";
|
||||||
import { SearchShippingZones_search_edges_node } from "@saleor/searches/types/SearchShippingZones";
|
import { SearchShippingZones_search_edges_node } from "@saleor/searches/types/SearchShippingZones";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
|
import { CountryCode } from "@saleor/types/globalTypes";
|
||||||
import createSingleAutocompleteSelectHandler from "@saleor/utils/handlers/singleAutocompleteSelectChangeHandler";
|
import createSingleAutocompleteSelectHandler from "@saleor/utils/handlers/singleAutocompleteSelectChangeHandler";
|
||||||
|
import { mapCountriesToChoices } from "@saleor/utils/maps";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { ChannelForm, FormData } from "../../components/ChannelForm";
|
import { ChannelForm, FormData } from "../../components/ChannelForm";
|
||||||
|
@ -31,14 +34,15 @@ export interface ChannelDetailsPageProps {
|
||||||
disabledStatus?: boolean;
|
disabledStatus?: boolean;
|
||||||
errors: ChannelErrorFragment[];
|
errors: ChannelErrorFragment[];
|
||||||
saveButtonBarState: ConfirmButtonTransitionState;
|
saveButtonBarState: ConfirmButtonTransitionState;
|
||||||
|
searchShippingZonesData?: SearchData;
|
||||||
|
fetchMoreShippingZones: FetchMoreProps;
|
||||||
|
channelShippingZones?: ChannelShippingZones;
|
||||||
|
countries: CountryFragment[];
|
||||||
onBack?: () => void;
|
onBack?: () => void;
|
||||||
onDelete?: () => void;
|
onDelete?: () => void;
|
||||||
onSubmit: (data: FormData) => void;
|
onSubmit: (data: FormData) => void;
|
||||||
updateChannelStatus?: () => void;
|
updateChannelStatus?: () => void;
|
||||||
searchShippingZones: (query: string) => void;
|
searchShippingZones: (query: string) => void;
|
||||||
searchShippingZonesData?: SearchData;
|
|
||||||
fetchMoreShippingZones: FetchMoreProps;
|
|
||||||
channelShippingZones?: ChannelShippingZones;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ChannelDetailsPage: React.FC<ChannelDetailsPageProps> = ({
|
export const ChannelDetailsPage: React.FC<ChannelDetailsPageProps> = ({
|
||||||
|
@ -55,21 +59,30 @@ export const ChannelDetailsPage: React.FC<ChannelDetailsPageProps> = ({
|
||||||
searchShippingZones,
|
searchShippingZones,
|
||||||
searchShippingZonesData,
|
searchShippingZonesData,
|
||||||
fetchMoreShippingZones,
|
fetchMoreShippingZones,
|
||||||
|
countries,
|
||||||
channelShippingZones = []
|
channelShippingZones = []
|
||||||
}) => {
|
}) => {
|
||||||
const [selectedCurrencyCode, setSelectedCurrencyCode] = useState("");
|
const [selectedCurrencyCode, setSelectedCurrencyCode] = useState("");
|
||||||
|
const [
|
||||||
|
selectedCountryDisplayName,
|
||||||
|
setSelectedCountryDisplayName
|
||||||
|
] = useStateFromProps(channel?.defaultCountry.country || "");
|
||||||
|
|
||||||
const [shippingZonesToDisplay, setShippingZonesToDisplay] = useStateFromProps<
|
const [shippingZonesToDisplay, setShippingZonesToDisplay] = useStateFromProps<
|
||||||
ChannelShippingZones
|
ChannelShippingZones
|
||||||
>(channelShippingZones);
|
>(channelShippingZones);
|
||||||
|
|
||||||
|
const countryChoices = mapCountriesToChoices(countries || []);
|
||||||
|
|
||||||
|
const { defaultCountry, ...formData } = channel || {};
|
||||||
const initialData: FormData = {
|
const initialData: FormData = {
|
||||||
currencyCode: "",
|
currencyCode: "",
|
||||||
name: "",
|
name: "",
|
||||||
slug: "",
|
slug: "",
|
||||||
shippingZonesIdsToAdd: [],
|
shippingZonesIdsToAdd: [],
|
||||||
shippingZonesIdsToRemove: [],
|
shippingZonesIdsToRemove: [],
|
||||||
...channel
|
defaultCountry: (defaultCountry?.code || "") as CountryCode,
|
||||||
|
...formData
|
||||||
};
|
};
|
||||||
|
|
||||||
const getFilteredShippingZonesChoices = (): SearchShippingZones_search_edges_node[] =>
|
const getFilteredShippingZonesChoices = (): SearchShippingZones_search_edges_node[] =>
|
||||||
|
@ -86,6 +99,11 @@ export const ChannelDetailsPage: React.FC<ChannelDetailsPageProps> = ({
|
||||||
setSelectedCurrencyCode,
|
setSelectedCurrencyCode,
|
||||||
currencyCodes
|
currencyCodes
|
||||||
);
|
);
|
||||||
|
const handleDefaultCountrySelect = createSingleAutocompleteSelectHandler(
|
||||||
|
change,
|
||||||
|
setSelectedCountryDisplayName,
|
||||||
|
countryChoices
|
||||||
|
);
|
||||||
|
|
||||||
const addShippingZone = (zoneId: string) => {
|
const addShippingZone = (zoneId: string) => {
|
||||||
set({
|
set({
|
||||||
|
@ -136,9 +154,12 @@ export const ChannelDetailsPage: React.FC<ChannelDetailsPageProps> = ({
|
||||||
data={data}
|
data={data}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
currencyCodes={currencyCodes}
|
currencyCodes={currencyCodes}
|
||||||
|
countries={countryChoices}
|
||||||
selectedCurrencyCode={selectedCurrencyCode}
|
selectedCurrencyCode={selectedCurrencyCode}
|
||||||
|
selectedCountryDisplayName={selectedCountryDisplayName}
|
||||||
onChange={change}
|
onChange={change}
|
||||||
onCurrencyCodeChange={handleCurrencyCodeSelect}
|
onCurrencyCodeChange={handleCurrencyCodeSelect}
|
||||||
|
onDefaultCountryChange={handleDefaultCountrySelect}
|
||||||
errors={errors}
|
errors={errors}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
// GraphQL query operation: BaseChannels
|
// GraphQL query operation: BaseChannels
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface BaseChannels_channels_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface BaseChannels_channels {
|
export interface BaseChannels_channels {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -14,6 +20,7 @@ export interface BaseChannels_channels {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: BaseChannels_channels_defaultCountry;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BaseChannels {
|
export interface BaseChannels {
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
// GraphQL query operation: Channel
|
// GraphQL query operation: Channel
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface Channel_channel_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Channel_channel {
|
export interface Channel_channel {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -14,6 +20,7 @@ export interface Channel_channel {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: Channel_channel_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ import { ChannelErrorCode } from "./../../types/globalTypes";
|
||||||
// GraphQL mutation operation: ChannelActivate
|
// GraphQL mutation operation: ChannelActivate
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface ChannelActivate_channelActivate_channel_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChannelActivate_channelActivate_channel {
|
export interface ChannelActivate_channelActivate_channel {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -16,6 +22,7 @@ export interface ChannelActivate_channelActivate_channel {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: ChannelActivate_channelActivate_channel_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ import { ChannelCreateInput, ChannelErrorCode } from "./../../types/globalTypes"
|
||||||
// GraphQL mutation operation: ChannelCreate
|
// GraphQL mutation operation: ChannelCreate
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface ChannelCreate_channelCreate_channel_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChannelCreate_channelCreate_channel {
|
export interface ChannelCreate_channelCreate_channel {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -16,6 +22,7 @@ export interface ChannelCreate_channelCreate_channel {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: ChannelCreate_channelCreate_channel_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ import { ChannelErrorCode } from "./../../types/globalTypes";
|
||||||
// GraphQL mutation operation: ChannelDeactivate
|
// GraphQL mutation operation: ChannelDeactivate
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface ChannelDeactivate_channelDeactivate_channel_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChannelDeactivate_channelDeactivate_channel {
|
export interface ChannelDeactivate_channelDeactivate_channel {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -16,6 +22,7 @@ export interface ChannelDeactivate_channelDeactivate_channel {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: ChannelDeactivate_channelDeactivate_channel_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ import { ChannelUpdateInput, ChannelErrorCode } from "./../../types/globalTypes"
|
||||||
// GraphQL mutation operation: ChannelUpdate
|
// GraphQL mutation operation: ChannelUpdate
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface ChannelUpdate_channelUpdate_channel_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChannelUpdate_channelUpdate_channel {
|
export interface ChannelUpdate_channelUpdate_channel {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -16,6 +22,7 @@ export interface ChannelUpdate_channelUpdate_channel {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: ChannelUpdate_channelUpdate_channel_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
// GraphQL query operation: Channels
|
// GraphQL query operation: Channels
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface Channels_channels_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Channels_channels {
|
export interface Channels_channels {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -14,6 +20,7 @@ export interface Channels_channels {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: Channels_channels_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { getSearchFetchMoreProps } from "@saleor/hooks/makeTopLevelSearch/utils"
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import { getDefaultNotifierSuccessErrorData } from "@saleor/hooks/useNotifier/utils";
|
import { getDefaultNotifierSuccessErrorData } from "@saleor/hooks/useNotifier/utils";
|
||||||
|
import useShop from "@saleor/hooks/useShop";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { Backlink } from "@saleor/macaw-ui";
|
import { Backlink } from "@saleor/macaw-ui";
|
||||||
import useShippingZonesSearch from "@saleor/searches/useShippingZonesSearch";
|
import useShippingZonesSearch from "@saleor/searches/useShippingZonesSearch";
|
||||||
|
@ -23,6 +24,7 @@ export const ChannelCreateView = ({}) => {
|
||||||
const navigate = useNavigator();
|
const navigate = useNavigator();
|
||||||
const notify = useNotifier();
|
const notify = useNotifier();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const shop = useShop();
|
||||||
|
|
||||||
const handleBack = () => navigate(channelsListUrl());
|
const handleBack = () => navigate(channelsListUrl());
|
||||||
|
|
||||||
|
@ -105,6 +107,7 @@ export const ChannelCreateView = ({}) => {
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
saveButtonBarState={createChannelOpts.status}
|
saveButtonBarState={createChannelOpts.status}
|
||||||
|
countries={shop?.countries || []}
|
||||||
/>
|
/>
|
||||||
</Container>
|
</Container>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { getSearchFetchMoreProps } from "@saleor/hooks/makeTopLevelSearch/utils"
|
||||||
import useNavigator from "@saleor/hooks/useNavigator";
|
import useNavigator from "@saleor/hooks/useNavigator";
|
||||||
import useNotifier from "@saleor/hooks/useNotifier";
|
import useNotifier from "@saleor/hooks/useNotifier";
|
||||||
import { getDefaultNotifierSuccessErrorData } from "@saleor/hooks/useNotifier/utils";
|
import { getDefaultNotifierSuccessErrorData } from "@saleor/hooks/useNotifier/utils";
|
||||||
|
import useShop from "@saleor/hooks/useShop";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { Backlink } from "@saleor/macaw-ui";
|
import { Backlink } from "@saleor/macaw-ui";
|
||||||
import useShippingZonesSearch from "@saleor/searches/useShippingZonesSearch";
|
import useShippingZonesSearch from "@saleor/searches/useShippingZonesSearch";
|
||||||
|
@ -48,6 +49,7 @@ export const ChannelDetails: React.FC<ChannelDetailsProps> = ({
|
||||||
const navigate = useNavigator();
|
const navigate = useNavigator();
|
||||||
const notify = useNotifier();
|
const notify = useNotifier();
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const shop = useShop();
|
||||||
|
|
||||||
const handleBack = () => navigate(channelsListUrl());
|
const handleBack = () => navigate(channelsListUrl());
|
||||||
|
|
||||||
|
@ -100,7 +102,8 @@ export const ChannelDetails: React.FC<ChannelDetailsProps> = ({
|
||||||
name,
|
name,
|
||||||
slug,
|
slug,
|
||||||
shippingZonesIdsToRemove,
|
shippingZonesIdsToRemove,
|
||||||
shippingZonesIdsToAdd
|
shippingZonesIdsToAdd,
|
||||||
|
defaultCountry
|
||||||
}: FormData) =>
|
}: FormData) =>
|
||||||
updateChannel({
|
updateChannel({
|
||||||
variables: {
|
variables: {
|
||||||
|
@ -108,6 +111,7 @@ export const ChannelDetails: React.FC<ChannelDetailsProps> = ({
|
||||||
input: {
|
input: {
|
||||||
name,
|
name,
|
||||||
slug,
|
slug,
|
||||||
|
defaultCountry,
|
||||||
addShippingZones: shippingZonesIdsToAdd,
|
addShippingZones: shippingZonesIdsToAdd,
|
||||||
removeShippingZones: shippingZonesIdsToRemove
|
removeShippingZones: shippingZonesIdsToRemove
|
||||||
}
|
}
|
||||||
|
@ -209,6 +213,7 @@ export const ChannelDetails: React.FC<ChannelDetailsProps> = ({
|
||||||
: activateChannel({ variables: { id } })
|
: activateChannel({ variables: { id } })
|
||||||
}
|
}
|
||||||
saveButtonBarState={updateChannelOpts.status}
|
saveButtonBarState={updateChannelOpts.status}
|
||||||
|
countries={shop?.countries || []}
|
||||||
/>
|
/>
|
||||||
</Container>
|
</Container>
|
||||||
<ChannelDeleteDialog
|
<ChannelDeleteDialog
|
||||||
|
|
|
@ -15,6 +15,10 @@ export const channelFragment = gql`
|
||||||
name
|
name
|
||||||
slug
|
slug
|
||||||
currencyCode
|
currencyCode
|
||||||
|
defaultCountry {
|
||||||
|
code
|
||||||
|
country
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
// GraphQL fragment: ChannelDetailsFragment
|
// GraphQL fragment: ChannelDetailsFragment
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface ChannelDetailsFragment_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChannelDetailsFragment {
|
export interface ChannelDetailsFragment {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -14,5 +20,6 @@ export interface ChannelDetailsFragment {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: ChannelDetailsFragment_defaultCountry;
|
||||||
hasOrders: boolean;
|
hasOrders: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
// GraphQL fragment: ChannelFragment
|
// GraphQL fragment: ChannelFragment
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
|
export interface ChannelFragment_defaultCountry {
|
||||||
|
__typename: "CountryDisplay";
|
||||||
|
code: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChannelFragment {
|
export interface ChannelFragment {
|
||||||
__typename: "Channel";
|
__typename: "Channel";
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -14,4 +20,5 @@ export interface ChannelFragment {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: ChannelFragment_defaultCountry;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1797,6 +1797,7 @@ export enum WebhookEventTypeEnum {
|
||||||
CHECKOUT_UPDATED = "CHECKOUT_UPDATED",
|
CHECKOUT_UPDATED = "CHECKOUT_UPDATED",
|
||||||
CUSTOMER_CREATED = "CUSTOMER_CREATED",
|
CUSTOMER_CREATED = "CUSTOMER_CREATED",
|
||||||
CUSTOMER_UPDATED = "CUSTOMER_UPDATED",
|
CUSTOMER_UPDATED = "CUSTOMER_UPDATED",
|
||||||
|
FULFILLMENT_CANCELED = "FULFILLMENT_CANCELED",
|
||||||
FULFILLMENT_CREATED = "FULFILLMENT_CREATED",
|
FULFILLMENT_CREATED = "FULFILLMENT_CREATED",
|
||||||
INVOICE_DELETED = "INVOICE_DELETED",
|
INVOICE_DELETED = "INVOICE_DELETED",
|
||||||
INVOICE_REQUESTED = "INVOICE_REQUESTED",
|
INVOICE_REQUESTED = "INVOICE_REQUESTED",
|
||||||
|
@ -2007,6 +2008,7 @@ export interface ChannelCreateInput {
|
||||||
name: string;
|
name: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
currencyCode: string;
|
currencyCode: string;
|
||||||
|
defaultCountry: CountryCode;
|
||||||
addShippingZones?: string[] | null;
|
addShippingZones?: string[] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2018,6 +2020,7 @@ export interface ChannelUpdateInput {
|
||||||
isActive?: boolean | null;
|
isActive?: boolean | null;
|
||||||
name?: string | null;
|
name?: string | null;
|
||||||
slug?: string | null;
|
slug?: string | null;
|
||||||
|
defaultCountry?: CountryCode | null;
|
||||||
addShippingZones?: string[] | null;
|
addShippingZones?: string[] | null;
|
||||||
removeShippingZones?: string[] | null;
|
removeShippingZones?: string[] | null;
|
||||||
}
|
}
|
||||||
|
@ -2141,7 +2144,7 @@ export interface ExportProductsInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FulfillmentCancelInput {
|
export interface FulfillmentCancelInput {
|
||||||
warehouseId: string;
|
warehouseId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FulfillmentUpdateTrackingInput {
|
export interface FulfillmentUpdateTrackingInput {
|
||||||
|
|
|
@ -146,6 +146,10 @@ const WebhookEvents: React.FC<WebhookEventsProps> = ({
|
||||||
defaultMessage: "Fulfillment created",
|
defaultMessage: "Fulfillment created",
|
||||||
description: "event"
|
description: "event"
|
||||||
}),
|
}),
|
||||||
|
[WebhookEventTypeEnum.FULFILLMENT_CANCELED]: intl.formatMessage({
|
||||||
|
defaultMessage: "Fulfillment canceled",
|
||||||
|
description: "event"
|
||||||
|
}),
|
||||||
[WebhookEventTypeEnum.INVOICE_REQUESTED]: intl.formatMessage({
|
[WebhookEventTypeEnum.INVOICE_REQUESTED]: intl.formatMessage({
|
||||||
defaultMessage: "Invoice requested",
|
defaultMessage: "Invoice requested",
|
||||||
description: "event"
|
description: "event"
|
||||||
|
|
Loading…
Reference in a new issue