Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix fixtures

Krzysztof Bialoglowicz6aca8289fee1
diff --git a/saleor/static/dashboard-next/productTypes/fixtures.ts b/saleor/static/dashboard-next/productTypes/fixtures.ts
index 169f08b8f4..b8d80ee104 100644
--- a/saleor/static/dashboard-next/productTypes/fixtures.ts
+++ b/saleor/static/dashboard-next/productTypes/fixtures.ts
@@ -2,7 +2,6 @@ import {
ProductCreateData_productTypes_edges_node,
ProductCreateData_productTypes_edges_node_productAttributes
} from "../products/types/ProductCreateData";
-import { TaxRateType } from "../types/globalTypes";
import { ProductTypeDetails_productType } from "./types/ProductTypeDetails";
import { ProductTypeList_productTypes_edges_node } from "./types/ProductTypeList";
@@ -455,7 +454,11 @@ export const productTypes: Array<
isShippingRequired: true,
name: "Candy",
productAttributes: [attributes[0]],
- taxRate: "FOODSTUFFS" as TaxRateType,
+ taxType: {
+ __typename: "TaxType" as "TaxType",
+ description: "PB100000",
+ taxCode: "Books / Manuals"
+ },
variantAttributes: [attributes[1], attributes[2]]
},
{
@@ -465,7 +468,11 @@ export const productTypes: Array<
isShippingRequired: false,
name: "E-books",
productAttributes: [attributes[5]],
- taxRate: "STANDARD" as TaxRateType,
+ taxType: {
+ __typename: "TaxType" as "TaxType",
+ description: "PH403682",
+ taxCode: "Holters"
+ },
variantAttributes: [attributes[0], attributes[3]]
},
{
@@ -475,7 +482,11 @@ export const productTypes: Array<
isShippingRequired: true,
name: "Mugs",
productAttributes: [attributes[7]],
- taxRate: "STANDARD" as TaxRateType,
+ taxType: {
+ __typename: "TaxType" as "TaxType",
+ description: "PC077426",
+ taxCode: "Cabling"
+ },
variantAttributes: [attributes[2], attributes[5]]
},
{
@@ -485,7 +496,11 @@ export const productTypes: Array<
isShippingRequired: true,
name: "Coffee",
productAttributes: [attributes[8]],
- taxRate: "STANDARD" as TaxRateType,
+ taxType: {
+ __typename: "TaxType" as "TaxType",
+ description: "PB100000",
+ taxCode: "Books / Manuals"
+ },
variantAttributes: [attributes[1], attributes[4]]
},
{
@@ -495,7 +510,11 @@ export const productTypes: Array<
isShippingRequired: true,
name: "T-Shirt",
productAttributes: [attributes[4]],
- taxRate: "STANDARD" as TaxRateType,
+ taxType: {
+ __typename: "TaxType" as "TaxType",
+ description: "PH403970",
+ taxCode: "Wheelchair"
+ },
variantAttributes: [attributes[1], attributes[6]]
}
].map(productType => ({
@@ -570,11 +589,15 @@ export const productType: ProductTypeDetails_productType = {
]
}
],
- taxRate: "STANDARD" as TaxRateType,
- variantAttributes: [],
+ taxType: {
+ __typename: "TaxType" as "TaxType",
+ description: "PH405458",
+ taxCode: "Shields"
+ },
weight: {
__typename: "Weight",
unit: "kg",
value: 7.82
- }
+ },
+ variantAttributes: [attributes[1], attributes[6]]
};
diff --git a/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx b/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx
index 25348b6ec6..00225e004a 100644
--- a/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx
+++ b/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx
@@ -153,7 +153,7 @@ export const ProductTypeUpdate: React.StatelessComponent<
productAttributes: formData.productAttributes.map(
choice => choice.value
),
- taxRate: formData.taxRate,
+ taxCode: formData.taxType.value,
variantAttributes: formData.variantAttributes.map(
choice => choice.value
),
@@ -241,6 +241,13 @@ export const ProductTypeUpdate: React.StatelessComponent<
pageTitle={maybe(() => data.productType.name)}
productType={maybe(() => data.productType)}
saveButtonBarState={loading ? "loading" : "default"}
+ taxTypes={maybe(() => data.taxTypes, [
+ {
+ __typename: "TaxType",
+ description: "",
+ taxCode: ""
+ }
+ ])}
onAttributeAdd={type =>
navigate(
productTypeUrl(id, {