Skip to content

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

Fix type errors

dominik-zeglene9858a1f4989
diff --git a/saleor/static/dashboard-next/attributes/views/AttributeCreate/AttributeCreate.tsx b/saleor/static/dashboard-next/attributes/views/AttributeCreate/AttributeCreate.tsx
index e36b739dae..654b9ed33b 100644
--- a/saleor/static/dashboard-next/attributes/views/AttributeCreate/AttributeCreate.tsx
+++ b/saleor/static/dashboard-next/attributes/views/AttributeCreate/AttributeCreate.tsx
@@ -112,7 +112,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ params }) => {
onValueUpdate={id => openModal("edit-value", id)}
saveButtonBarState={createTransitionState}
values={values.map((value, valueIndex) => ({
- __typename: "AttributeValue",
+ __typename: "AttributeValue" as "AttributeValue",
id: valueIndex.toString(),
sortOrder: null,
type: null,
diff --git a/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx b/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx
index 6dddba387d..44fdc01a90 100644
--- a/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx
+++ b/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/index.tsx
@@ -10,20 +10,20 @@ import useBulkActions from "@saleor/hooks/useBulkActions";
import useNavigator from "@saleor/hooks/useNavigator";
import useNotifier from "@saleor/hooks/useNotifier";
import i18n from "@saleor/i18n";
-import { getMutationState, maybe, stopPropagation } from "@saleor/misc";
-import ProductTypeAttributeUnassignDialog from "@saleor/productTypes/components/ProductTypeAttributeUnassignDialog";
-import ProductTypeBulkAttributeUnassignDialog from "@saleor/productTypes/components/ProductTypeBulkAttributeUnassignDialog";
-import ProductTypeDeleteDialog from "@saleor/productTypes/components/ProductTypeDeleteDialog";
-import { AssignAttribute } from "@saleor/productTypes/types/AssignAttribute";
-import { UnassignAttribute } from "@saleor/productTypes/types/UnassignAttribute";
+import { getMutationState, maybe } from "@saleor/misc";
import { AttributeTypeEnum } from "@saleor/types/globalTypes";
+import ProductTypeAttributeUnassignDialog from "../../components/ProductTypeAttributeUnassignDialog";
+import ProductTypeBulkAttributeUnassignDialog from "../../components/ProductTypeBulkAttributeUnassignDialog";
+import ProductTypeDeleteDialog from "../../components/ProductTypeDeleteDialog";
import ProductTypeDetailsPage, {
ProductTypeForm
} from "../../components/ProductTypeDetailsPage";
import ProductTypeOperations from "../../containers/ProductTypeOperations";
import { TypedProductTypeDetailsQuery } from "../../queries";
+import { AssignAttribute } from "../../types/AssignAttribute";
import { ProductTypeDelete } from "../../types/ProductTypeDelete";
import { ProductTypeUpdate as ProductTypeUpdateMutation } from "../../types/ProductTypeUpdate";
+import { UnassignAttribute } from "../../types/UnassignAttribute";
import {
productTypeListUrl,
productTypeUrl,
diff --git a/saleor/static/dashboard-next/storybook/stories/attributes/AttributeValueEditDialog.tsx b/saleor/static/dashboard-next/storybook/stories/attributes/AttributeValueEditDialog.tsx
index 0878a62466..a603e3bfb3 100644
--- a/saleor/static/dashboard-next/storybook/stories/attributes/AttributeValueEditDialog.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/attributes/AttributeValueEditDialog.tsx
@@ -1,7 +1,7 @@
import { storiesOf } from "@storybook/react";
import React from "react";
-import { attributes } from "@saleor/attributes/fixtures";
+import { attribute } from "@saleor/attributes/fixtures";
import { formError } from "@saleor/storybook/misc";
import { AttributeValueType } from "@saleor/types/globalTypes";
import AttributeValueEditDialog, {
@@ -11,7 +11,7 @@ import Decorator from "../../Decorator";
const props: AttributeValueEditDialogProps = {
attributeValue: {
- ...attributes[0].values[0],
+ ...attribute.values[0],
sortOrder: 0,
type: AttributeValueType.STRING,
value: ""
diff --git a/saleor/static/dashboard-next/storybook/stories/productTypes/ProductTypeDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/productTypes/ProductTypeDetailsPage.tsx
index 5e8badd77b..bad72c5e96 100644
--- a/saleor/static/dashboard-next/storybook/stories/productTypes/ProductTypeDetailsPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/productTypes/ProductTypeDetailsPage.tsx
@@ -15,8 +15,8 @@ const props: Omit<ProductTypeDetailsPageProps, "classes"> = {
disabled: false,
errors: [],
onAttributeAdd: () => undefined,
- onAttributeDelete: () => undefined,
- onAttributeUpdate: () => undefined,
+ onAttributeClick: () => undefined,
+ onAttributeUnassign: () => undefined,
onBack: () => undefined,
onDelete: () => undefined,
onSubmit: () => undefined,