Change rateType from enum to string (#1121)
* Change rateType from enum to string * Update snapshots * Fix accidental recurrency caused by race condition * Handle null type on SEO form * Trigger deployment * Fallback to empty string for undefined/null values
This commit is contained in:
parent
fbfe3c8d7c
commit
5ace78f279
10 changed files with 282 additions and 531 deletions
|
@ -6562,119 +6562,19 @@
|
||||||
"src_dot_taxes_dot_components_dot_CountryList_dot_577035076": {
|
"src_dot_taxes_dot_components_dot_CountryList_dot_577035076": {
|
||||||
"string": "Country Name"
|
"string": "Country Name"
|
||||||
},
|
},
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_1040021611": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Accommodation"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_1260218997": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Social housing"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_1323923780": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Bikes"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_1451721797": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Newspapers"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_1755013298": {
|
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_1755013298": {
|
||||||
"string": "Category"
|
"string": "Category"
|
||||||
},
|
},
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2022558114": {
|
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2022558114": {
|
||||||
"string": "Tax Rate"
|
"string": "Tax Rate"
|
||||||
},
|
},
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2185495435": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Admission to cultural events"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2201910191": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Baby foodstuffs"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_231341634": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Domestic services"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2332795012": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Foodstuffs"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2394675125": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Books"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2465450918": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Agricultural supplies"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2482229874": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Standard"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2553129615": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Passenger transport"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2557534380": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Admission to entertainment events"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2584490289": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Children's clothing"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2616794607": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Admission to sporting events"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2737618795": {
|
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2737618795": {
|
||||||
"context": "header",
|
"context": "header",
|
||||||
"string": "Tax Rates in {countryName}"
|
"string": "Tax Rates in {countryName}"
|
||||||
},
|
},
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_2948462144": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Medical"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_3066312070": {
|
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_3066312070": {
|
||||||
"string": "No reduced tax categories found"
|
"string": "No reduced tax categories found"
|
||||||
},
|
},
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_331632763": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Hotels"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_331757068": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "E-books"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_3500730003": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Domestic fuel"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_3525010870": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Water"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_3911019760": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Advertising"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_4199760668": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Property renovations"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_752780599": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Wine"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_776474251": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Restaurants"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_CountryTaxesPage_dot_815189256": {
|
|
||||||
"context": "tax rate",
|
|
||||||
"string": "Pharmaceuticals"
|
|
||||||
},
|
|
||||||
"src_dot_taxes_dot_components_dot_TaxConfiguration_dot_142803418": {
|
"src_dot_taxes_dot_components_dot_TaxConfiguration_dot_142803418": {
|
||||||
"string": "All products prices are entered with tax included"
|
"string": "All products prices are entered with tax included"
|
||||||
},
|
},
|
||||||
|
|
|
@ -699,9 +699,9 @@ input CatalogueInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Category implements Node & ObjectWithMetadata {
|
type Category implements Node & ObjectWithMetadata {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
name: String!
|
name: String!
|
||||||
description: JSONString
|
description: JSONString
|
||||||
slug: String!
|
slug: String!
|
||||||
|
@ -774,9 +774,9 @@ input CategorySortingInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CategoryTranslatableContent implements Node {
|
type CategoryTranslatableContent implements Node {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
name: String!
|
name: String!
|
||||||
description: JSONString
|
description: JSONString
|
||||||
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
|
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
|
||||||
|
@ -791,9 +791,9 @@ type CategoryTranslate {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CategoryTranslation implements Node {
|
type CategoryTranslation implements Node {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
name: String!
|
name: String!
|
||||||
description: JSONString
|
description: JSONString
|
||||||
language: LanguageDisplay!
|
language: LanguageDisplay!
|
||||||
|
@ -813,7 +813,6 @@ type Channel implements Node {
|
||||||
slug: String!
|
slug: String!
|
||||||
currencyCode: String!
|
currencyCode: String!
|
||||||
hasOrders: Boolean!
|
hasOrders: Boolean!
|
||||||
shippingZones: [ShippingZone!]!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChannelActivate {
|
type ChannelActivate {
|
||||||
|
@ -1094,9 +1093,9 @@ type ChoiceValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Collection implements Node & ObjectWithMetadata {
|
type Collection implements Node & ObjectWithMetadata {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
name: String!
|
name: String!
|
||||||
description: JSONString
|
description: JSONString
|
||||||
slug: String!
|
slug: String!
|
||||||
|
@ -1122,9 +1121,9 @@ type CollectionBulkDelete {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CollectionChannelListing implements Node {
|
type CollectionChannelListing implements Node {
|
||||||
|
id: ID!
|
||||||
publicationDate: Date
|
publicationDate: Date
|
||||||
isPublished: Boolean!
|
isPublished: Boolean!
|
||||||
id: ID!
|
|
||||||
channel: Channel!
|
channel: Channel!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1250,9 +1249,9 @@ input CollectionSortingInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CollectionTranslatableContent implements Node {
|
type CollectionTranslatableContent implements Node {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
name: String!
|
name: String!
|
||||||
description: JSONString
|
description: JSONString
|
||||||
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
|
descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
|
||||||
|
@ -1267,9 +1266,9 @@ type CollectionTranslate {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CollectionTranslation implements Node {
|
type CollectionTranslation implements Node {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
name: String!
|
name: String!
|
||||||
description: JSONString
|
description: JSONString
|
||||||
language: LanguageDisplay!
|
language: LanguageDisplay!
|
||||||
|
@ -2975,6 +2974,8 @@ type Order implements Node & ObjectWithMetadata {
|
||||||
availableShippingMethods: [ShippingMethod]
|
availableShippingMethods: [ShippingMethod]
|
||||||
invoices: [Invoice]
|
invoices: [Invoice]
|
||||||
number: String
|
number: String
|
||||||
|
original: ID
|
||||||
|
origin: OrderOriginEnum!
|
||||||
isPaid: Boolean!
|
isPaid: Boolean!
|
||||||
paymentStatus: PaymentChargeStatusEnum!
|
paymentStatus: PaymentChargeStatusEnum!
|
||||||
paymentStatusDisplay: String!
|
paymentStatusDisplay: String!
|
||||||
|
@ -3359,6 +3360,12 @@ type OrderMarkAsPaid {
|
||||||
errors: [OrderError!]!
|
errors: [OrderError!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum OrderOriginEnum {
|
||||||
|
CHECKOUT
|
||||||
|
DRAFT
|
||||||
|
REISSUE
|
||||||
|
}
|
||||||
|
|
||||||
type OrderRefund {
|
type OrderRefund {
|
||||||
order: Order
|
order: Order
|
||||||
orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
|
orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
|
||||||
|
@ -3489,9 +3496,9 @@ type OrderVoid {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Page implements Node & ObjectWithMetadata {
|
type Page implements Node & ObjectWithMetadata {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
title: String!
|
title: String!
|
||||||
content: JSONString
|
content: JSONString
|
||||||
publicationDate: Date
|
publicationDate: Date
|
||||||
|
@ -3625,9 +3632,9 @@ input PageSortingInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PageTranslatableContent implements Node {
|
type PageTranslatableContent implements Node {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
title: String!
|
title: String!
|
||||||
content: JSONString
|
content: JSONString
|
||||||
contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
|
contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
|
||||||
|
@ -3642,9 +3649,9 @@ type PageTranslate {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PageTranslation implements Node {
|
type PageTranslation implements Node {
|
||||||
|
id: ID!
|
||||||
seoTitle: String
|
seoTitle: String
|
||||||
seoDescription: String
|
seoDescription: String
|
||||||
id: ID!
|
|
||||||
title: String!
|
title: String!
|
||||||
content: JSONString
|
content: JSONString
|
||||||
language: LanguageDisplay!
|
language: LanguageDisplay!
|
||||||
|
@ -4759,7 +4766,7 @@ type Query {
|
||||||
|
|
||||||
type ReducedRate {
|
type ReducedRate {
|
||||||
rate: Float!
|
rate: Float!
|
||||||
rateType: TaxRateType!
|
rateType: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
type RefreshToken {
|
type RefreshToken {
|
||||||
|
@ -5443,34 +5450,6 @@ input StockInput {
|
||||||
quantity: Int!
|
quantity: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TaxRateType {
|
|
||||||
ACCOMMODATION
|
|
||||||
ADMISSION_TO_CULTURAL_EVENTS
|
|
||||||
ADMISSION_TO_ENTERTAINMENT_EVENTS
|
|
||||||
ADMISSION_TO_SPORTING_EVENTS
|
|
||||||
ADVERTISING
|
|
||||||
AGRICULTURAL_SUPPLIES
|
|
||||||
BABY_FOODSTUFFS
|
|
||||||
BIKES
|
|
||||||
BOOKS
|
|
||||||
CHILDRENS_CLOTHING
|
|
||||||
DOMESTIC_FUEL
|
|
||||||
DOMESTIC_SERVICES
|
|
||||||
E_BOOKS
|
|
||||||
FOODSTUFFS
|
|
||||||
HOTELS
|
|
||||||
MEDICAL
|
|
||||||
NEWSPAPERS
|
|
||||||
PASSENGER_TRANSPORT
|
|
||||||
PHARMACEUTICALS
|
|
||||||
PROPERTY_RENOVATIONS
|
|
||||||
RESTAURANTS
|
|
||||||
SOCIAL_HOUSING
|
|
||||||
STANDARD
|
|
||||||
WATER
|
|
||||||
WINE
|
|
||||||
}
|
|
||||||
|
|
||||||
type TaxType {
|
type TaxType {
|
||||||
description: String
|
description: String
|
||||||
taxCode: String
|
taxCode: String
|
||||||
|
|
|
@ -81,7 +81,7 @@ const useStyles = makeStyles(
|
||||||
);
|
);
|
||||||
|
|
||||||
interface SeoFormProps {
|
interface SeoFormProps {
|
||||||
description?: string;
|
description?: string | null;
|
||||||
descriptionPlaceholder: string;
|
descriptionPlaceholder: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
errors?: Array<
|
errors?: Array<
|
||||||
|
@ -90,7 +90,7 @@ interface SeoFormProps {
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
helperText?: string;
|
helperText?: string;
|
||||||
allowEmptySlug?: boolean;
|
allowEmptySlug?: boolean;
|
||||||
title: string;
|
title: string | null;
|
||||||
slug: string;
|
slug: string;
|
||||||
slugPlaceholder?: string;
|
slugPlaceholder?: string;
|
||||||
titlePlaceholder: string;
|
titlePlaceholder: string;
|
||||||
|
@ -224,7 +224,7 @@ const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
/>
|
/>
|
||||||
<FormSpacer />
|
<FormSpacer />
|
||||||
<TextField
|
<TextField
|
||||||
error={title.length > maxTitleLength}
|
error={title?.length > maxTitleLength}
|
||||||
name={SeoField.title}
|
name={SeoField.title}
|
||||||
label={
|
label={
|
||||||
<div className={classes.labelContainer}>
|
<div className={classes.labelContainer}>
|
||||||
|
@ -251,7 +251,7 @@ const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
helperText={intl.formatMessage(seoFieldMessage)}
|
helperText={intl.formatMessage(seoFieldMessage)}
|
||||||
value={title}
|
value={title ?? ""}
|
||||||
disabled={loading || disabled}
|
disabled={loading || disabled}
|
||||||
placeholder={titlePlaceholder}
|
placeholder={titlePlaceholder}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
|
@ -259,7 +259,7 @@ const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
/>
|
/>
|
||||||
<FormSpacer />
|
<FormSpacer />
|
||||||
<TextField
|
<TextField
|
||||||
error={description.length > maxDescriptionLength}
|
error={description?.length > maxDescriptionLength}
|
||||||
name={SeoField.description}
|
name={SeoField.description}
|
||||||
label={
|
label={
|
||||||
<div className={classes.labelContainer}>
|
<div className={classes.labelContainer}>
|
||||||
|
@ -286,7 +286,7 @@ const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
maxLength: maxDescriptionLength
|
maxLength: maxDescriptionLength
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
value={description}
|
value={description ?? ""}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
disabled={loading || disabled}
|
disabled={loading || disabled}
|
||||||
fullWidth
|
fullWidth
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { ExtendedFormHelperTextProps } from "@saleor/channels/components/Channel
|
||||||
import { makeStyles } from "@saleor/theme";
|
import { makeStyles } from "@saleor/theme";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import Downshift, { ControllerStateAndHelpers } from "downshift";
|
import Downshift from "downshift";
|
||||||
import { filter } from "fuzzaldrin";
|
import { filter } from "fuzzaldrin";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
@ -81,13 +81,7 @@ const SingleAutocompleteSelectFieldComponent: React.FC<SingleAutocompleteSelectF
|
||||||
} = props;
|
} = props;
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
const handleChange = (
|
const handleChange = (item: string) => {
|
||||||
item: string,
|
|
||||||
stateAndHelpers: ControllerStateAndHelpers
|
|
||||||
) => {
|
|
||||||
stateAndHelpers.reset({
|
|
||||||
inputValue: ""
|
|
||||||
});
|
|
||||||
onChange({
|
onChange({
|
||||||
target: {
|
target: {
|
||||||
name,
|
name,
|
||||||
|
@ -104,7 +98,7 @@ const SingleAutocompleteSelectFieldComponent: React.FC<SingleAutocompleteSelectF
|
||||||
itemToString={() => displayValue || ""}
|
itemToString={() => displayValue || ""}
|
||||||
onInputValueChange={value => debounceFn(value)}
|
onInputValueChange={value => debounceFn(value)}
|
||||||
onSelect={handleChange}
|
onSelect={handleChange}
|
||||||
selectedItem={value}
|
selectedItem={value || ""}
|
||||||
>
|
>
|
||||||
{({
|
{({
|
||||||
getInputProps,
|
getInputProps,
|
||||||
|
@ -157,11 +151,6 @@ const SingleAutocompleteSelectFieldComponent: React.FC<SingleAutocompleteSelectF
|
||||||
closeMenu();
|
closeMenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
// fix for bug where input value is returned from debounce as id instead of label
|
|
||||||
if (value === inputValue && !!inputValue) {
|
|
||||||
ensureProperValues();
|
|
||||||
}
|
|
||||||
|
|
||||||
const TextFieldComponent = nakedInput ? InputBase : TextField;
|
const TextFieldComponent = nakedInput ? InputBase : TextField;
|
||||||
|
|
||||||
const commonInputProps = {
|
const commonInputProps = {
|
||||||
|
|
|
@ -3,15 +3,13 @@
|
||||||
// @generated
|
// @generated
|
||||||
// This file was automatically generated and should not be edited.
|
// This file was automatically generated and should not be edited.
|
||||||
|
|
||||||
import { TaxRateType } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
// ====================================================
|
||||||
// GraphQL fragment: CountryWithTaxesFragment
|
// GraphQL fragment: CountryWithTaxesFragment
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
export interface CountryWithTaxesFragment_vat_reducedRates {
|
export interface CountryWithTaxesFragment_vat_reducedRates {
|
||||||
__typename: "ReducedRate";
|
__typename: "ReducedRate";
|
||||||
rateType: TaxRateType;
|
rateType: string;
|
||||||
rate: number;
|
rate: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3708,7 +3708,20 @@ exports[`Storyshots Generics / Channels availability card default 1`] = `
|
||||||
</span>
|
</span>
|
||||||
<div
|
<div
|
||||||
class="CardTitle-toolbar-id"
|
class="CardTitle-toolbar-id"
|
||||||
/>
|
>
|
||||||
|
<button
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textPrimary-id"
|
||||||
|
data-test-id="channels-availiability-manage-button"
|
||||||
|
tabindex="0"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiButton-label-id"
|
||||||
|
>
|
||||||
|
Manage
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="CardTitle-children-id"
|
class="CardTitle-children-id"
|
||||||
|
@ -3781,7 +3794,20 @@ exports[`Storyshots Generics / Channels availability card with onChange 1`] = `
|
||||||
</span>
|
</span>
|
||||||
<div
|
<div
|
||||||
class="CardTitle-toolbar-id"
|
class="CardTitle-toolbar-id"
|
||||||
/>
|
>
|
||||||
|
<button
|
||||||
|
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textPrimary-id"
|
||||||
|
data-test-id="channels-availiability-manage-button"
|
||||||
|
tabindex="0"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="MuiButton-label-id"
|
||||||
|
>
|
||||||
|
Manage
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="CardTitle-children-id"
|
class="CardTitle-children-id"
|
||||||
|
@ -242328,7 +242354,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Admission to cultural events
|
ADMISSION_TO_CULTURAL_EVENTS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242342,7 +242368,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Admission to entertainment events
|
ADMISSION_TO_ENTERTAINMENT_EVENTS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242356,7 +242382,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Books
|
BOOKS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242370,7 +242396,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Foodstuffs
|
FOODSTUFFS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242384,7 +242410,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Hotels
|
HOTELS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242398,7 +242424,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Newspapers
|
NEWSPAPERS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242412,7 +242438,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Passenger transport
|
PASSENGER_TRANSPORT
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
@ -242426,7 +242452,7 @@ exports[`Storyshots Views / Taxes / Reduced Tax Categories default 1`] = `
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
>
|
>
|
||||||
Pharmaceuticals
|
PHARMACEUTICALS
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="MuiTableCell-root-id MuiTableCell-body-id"
|
class="MuiTableCell-root-id MuiTableCell-body-id"
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -13,9 +13,8 @@ import ResponsiveTable from "@saleor/components/ResponsiveTable";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import { makeStyles } from "@saleor/theme";
|
import { makeStyles } from "@saleor/theme";
|
||||||
import { TaxRateType } from "@saleor/types/globalTypes";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, IntlShape, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
import { maybe, renderCollection } from "../../../misc";
|
import { maybe, renderCollection } from "../../../misc";
|
||||||
import { CountryList_shop_countries_vat_reducedRates } from "../../types/CountryList";
|
import { CountryList_shop_countries_vat_reducedRates } from "../../types/CountryList";
|
||||||
|
@ -29,111 +28,6 @@ const useStyles = makeStyles(
|
||||||
{ name: "CountryTaxesPage" }
|
{ name: "CountryTaxesPage" }
|
||||||
);
|
);
|
||||||
|
|
||||||
function translateTaxRates(intl: IntlShape): Record<TaxRateType, string> {
|
|
||||||
return {
|
|
||||||
[TaxRateType.ACCOMMODATION]: intl.formatMessage({
|
|
||||||
defaultMessage: "Accommodation",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.ADMISSION_TO_CULTURAL_EVENTS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Admission to cultural events",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.ADMISSION_TO_ENTERTAINMENT_EVENTS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Admission to entertainment events",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.ADMISSION_TO_SPORTING_EVENTS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Admission to sporting events",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.ADVERTISING]: intl.formatMessage({
|
|
||||||
defaultMessage: "Advertising",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.AGRICULTURAL_SUPPLIES]: intl.formatMessage({
|
|
||||||
defaultMessage: "Agricultural supplies",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.BABY_FOODSTUFFS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Baby foodstuffs",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.BIKES]: intl.formatMessage({
|
|
||||||
defaultMessage: "Bikes",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.BOOKS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Books",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.CHILDRENS_CLOTHING]: intl.formatMessage({
|
|
||||||
defaultMessage: "Children's clothing",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.DOMESTIC_FUEL]: intl.formatMessage({
|
|
||||||
defaultMessage: "Domestic fuel",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.DOMESTIC_SERVICES]: intl.formatMessage({
|
|
||||||
defaultMessage: "Domestic services",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.E_BOOKS]: intl.formatMessage({
|
|
||||||
defaultMessage: "E-books",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.FOODSTUFFS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Foodstuffs",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.HOTELS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Hotels",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.MEDICAL]: intl.formatMessage({
|
|
||||||
defaultMessage: "Medical",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.NEWSPAPERS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Newspapers",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.PASSENGER_TRANSPORT]: intl.formatMessage({
|
|
||||||
defaultMessage: "Passenger transport",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.PHARMACEUTICALS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Pharmaceuticals",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.PROPERTY_RENOVATIONS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Property renovations",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.RESTAURANTS]: intl.formatMessage({
|
|
||||||
defaultMessage: "Restaurants",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.SOCIAL_HOUSING]: intl.formatMessage({
|
|
||||||
defaultMessage: "Social housing",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.STANDARD]: intl.formatMessage({
|
|
||||||
defaultMessage: "Standard",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.WATER]: intl.formatMessage({
|
|
||||||
defaultMessage: "Water",
|
|
||||||
description: "tax rate"
|
|
||||||
}),
|
|
||||||
[TaxRateType.WINE]: intl.formatMessage({
|
|
||||||
defaultMessage: "Wine",
|
|
||||||
description: "tax rate"
|
|
||||||
})
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CountryTaxesPageProps {
|
export interface CountryTaxesPageProps {
|
||||||
countryName: string;
|
countryName: string;
|
||||||
taxCategories: CountryList_shop_countries_vat_reducedRates[];
|
taxCategories: CountryList_shop_countries_vat_reducedRates[];
|
||||||
|
@ -145,7 +39,6 @@ const CountryTaxesPage: React.FC<CountryTaxesPageProps> = props => {
|
||||||
|
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const translatedTaxRates = translateTaxRates(intl);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
|
@ -189,10 +82,7 @@ const CountryTaxesPage: React.FC<CountryTaxesPageProps> = props => {
|
||||||
key={taxCategory ? taxCategory.rateType : "skeleton"}
|
key={taxCategory ? taxCategory.rateType : "skeleton"}
|
||||||
>
|
>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{maybe<React.ReactNode>(
|
{taxCategory?.rateType ?? <Skeleton />}
|
||||||
() => translatedTaxRates[taxCategory.rateType],
|
|
||||||
<Skeleton />
|
|
||||||
)}
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{maybe<React.ReactNode>(
|
{maybe<React.ReactNode>(
|
||||||
|
|
|
@ -3,15 +3,13 @@
|
||||||
// @generated
|
// @generated
|
||||||
// This file was automatically generated and should not be edited.
|
// This file was automatically generated and should not be edited.
|
||||||
|
|
||||||
import { TaxRateType } from "./../../types/globalTypes";
|
|
||||||
|
|
||||||
// ====================================================
|
// ====================================================
|
||||||
// GraphQL query operation: CountryList
|
// GraphQL query operation: CountryList
|
||||||
// ====================================================
|
// ====================================================
|
||||||
|
|
||||||
export interface CountryList_shop_countries_vat_reducedRates {
|
export interface CountryList_shop_countries_vat_reducedRates {
|
||||||
__typename: "ReducedRate";
|
__typename: "ReducedRate";
|
||||||
rateType: TaxRateType;
|
rateType: string;
|
||||||
rate: number;
|
rate: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -951,34 +951,6 @@ export enum StockErrorCode {
|
||||||
UNIQUE = "UNIQUE",
|
UNIQUE = "UNIQUE",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum TaxRateType {
|
|
||||||
ACCOMMODATION = "ACCOMMODATION",
|
|
||||||
ADMISSION_TO_CULTURAL_EVENTS = "ADMISSION_TO_CULTURAL_EVENTS",
|
|
||||||
ADMISSION_TO_ENTERTAINMENT_EVENTS = "ADMISSION_TO_ENTERTAINMENT_EVENTS",
|
|
||||||
ADMISSION_TO_SPORTING_EVENTS = "ADMISSION_TO_SPORTING_EVENTS",
|
|
||||||
ADVERTISING = "ADVERTISING",
|
|
||||||
AGRICULTURAL_SUPPLIES = "AGRICULTURAL_SUPPLIES",
|
|
||||||
BABY_FOODSTUFFS = "BABY_FOODSTUFFS",
|
|
||||||
BIKES = "BIKES",
|
|
||||||
BOOKS = "BOOKS",
|
|
||||||
CHILDRENS_CLOTHING = "CHILDRENS_CLOTHING",
|
|
||||||
DOMESTIC_FUEL = "DOMESTIC_FUEL",
|
|
||||||
DOMESTIC_SERVICES = "DOMESTIC_SERVICES",
|
|
||||||
E_BOOKS = "E_BOOKS",
|
|
||||||
FOODSTUFFS = "FOODSTUFFS",
|
|
||||||
HOTELS = "HOTELS",
|
|
||||||
MEDICAL = "MEDICAL",
|
|
||||||
NEWSPAPERS = "NEWSPAPERS",
|
|
||||||
PASSENGER_TRANSPORT = "PASSENGER_TRANSPORT",
|
|
||||||
PHARMACEUTICALS = "PHARMACEUTICALS",
|
|
||||||
PROPERTY_RENOVATIONS = "PROPERTY_RENOVATIONS",
|
|
||||||
RESTAURANTS = "RESTAURANTS",
|
|
||||||
SOCIAL_HOUSING = "SOCIAL_HOUSING",
|
|
||||||
STANDARD = "STANDARD",
|
|
||||||
WATER = "WATER",
|
|
||||||
WINE = "WINE",
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum UploadErrorCode {
|
export enum UploadErrorCode {
|
||||||
GRAPHQL_ERROR = "GRAPHQL_ERROR",
|
GRAPHQL_ERROR = "GRAPHQL_ERROR",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue