Skip to content

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

Type fixes

dominik-zeglen7f38fcd09317
diff --git a/saleor/static/dashboard-next/categories/components/CategoryList/CategoryList.tsx b/saleor/static/dashboard-next/categories/components/CategoryList/CategoryList.tsx
index cea7527a5a..32180f142f 100644
--- a/saleor/static/dashboard-next/categories/components/CategoryList/CategoryList.tsx
+++ b/saleor/static/dashboard-next/categories/components/CategoryList/CategoryList.tsx
@@ -138,7 +138,6 @@ const CategoryList = withStyles(styles, { name: "CategoryList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx b/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx
index 27481feed8..f8140d50e6 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionList/CollectionList.tsx
@@ -110,7 +110,6 @@ const CollectionList = withStyles(styles, { name: "CollectionList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx b/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx
index ee697f1d52..ae2986d882 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionProducts/CollectionProducts.tsx
@@ -128,7 +128,6 @@ const CollectionProducts = withStyles(styles, { name: "CollectionProducts" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx b/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx
index dbc5bb8298..36603173e0 100644
--- a/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx
+++ b/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx
@@ -103,7 +103,7 @@ const Checkbox = withStyles(styles, { name: "Checkbox" })(
name={name}
value={checked.toString()}
ref={inputRef}
- onChange={onChange}
+ onChange={event => onChange(event, !inputRef.current.checked)}
/>
</ButtonBase>
);
diff --git a/saleor/static/dashboard-next/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx b/saleor/static/dashboard-next/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx
index 40ebb8fdf0..fbcda138a8 100644
--- a/saleor/static/dashboard-next/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx
+++ b/saleor/static/dashboard-next/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx
@@ -113,7 +113,6 @@ export const MultiAutocompleteSelectField = withStyles(styles, {
getInputProps,
getItemProps,
isOpen,
- inputValue,
selectedItem,
toggleMenu,
closeMenu,
diff --git a/saleor/static/dashboard-next/components/ProductList/ProductList.tsx b/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
index b4fad471ba..16b2c5cd1d 100644
--- a/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
+++ b/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
@@ -130,7 +130,6 @@ export const ProductList = withStyles(styles, { name: "ProductList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/customers/components/CustomerList/CustomerList.tsx b/saleor/static/dashboard-next/customers/components/CustomerList/CustomerList.tsx
index 6ac360db3f..b5f2426857 100644
--- a/saleor/static/dashboard-next/customers/components/CustomerList/CustomerList.tsx
+++ b/saleor/static/dashboard-next/customers/components/CustomerList/CustomerList.tsx
@@ -106,7 +106,6 @@ const CustomerList = withStyles(styles, { name: "CustomerList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/discounts/components/DiscountCategories/DiscountCategories.tsx b/saleor/static/dashboard-next/discounts/components/DiscountCategories/DiscountCategories.tsx
index f3cc323b25..a5cdb9ede5 100644
--- a/saleor/static/dashboard-next/discounts/components/DiscountCategories/DiscountCategories.tsx
+++ b/saleor/static/dashboard-next/discounts/components/DiscountCategories/DiscountCategories.tsx
@@ -121,7 +121,6 @@ const DiscountCategories = withStyles(styles, {
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/discounts/components/DiscountCollections/DiscountCollections.tsx b/saleor/static/dashboard-next/discounts/components/DiscountCollections/DiscountCollections.tsx
index b38e6248ce..8732c5b859 100644
--- a/saleor/static/dashboard-next/discounts/components/DiscountCollections/DiscountCollections.tsx
+++ b/saleor/static/dashboard-next/discounts/components/DiscountCollections/DiscountCollections.tsx
@@ -120,7 +120,6 @@ const DiscountCollections = withStyles(styles, {
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/discounts/components/DiscountProducts/DiscountProducts.tsx b/saleor/static/dashboard-next/discounts/components/DiscountProducts/DiscountProducts.tsx
index 37015f2532..f1a9e886ae 100644
--- a/saleor/static/dashboard-next/discounts/components/DiscountProducts/DiscountProducts.tsx
+++ b/saleor/static/dashboard-next/discounts/components/DiscountProducts/DiscountProducts.tsx
@@ -132,7 +132,6 @@ const DiscountProducts = withStyles(styles, {
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/discounts/components/SaleList/SaleList.tsx b/saleor/static/dashboard-next/discounts/components/SaleList/SaleList.tsx
index 6fed664190..32d89b2f2f 100644
--- a/saleor/static/dashboard-next/discounts/components/SaleList/SaleList.tsx
+++ b/saleor/static/dashboard-next/discounts/components/SaleList/SaleList.tsx
@@ -132,7 +132,6 @@ const SaleList = withStyles(styles, {
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherList/VoucherList.tsx b/saleor/static/dashboard-next/discounts/components/VoucherList/VoucherList.tsx
index c6a9dbd011..b4fd7fb08b 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherList/VoucherList.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherList/VoucherList.tsx
@@ -157,7 +157,6 @@ const VoucherList = withStyles(styles, {
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/orders/components/OrderDraftList/OrderDraftList.tsx b/saleor/static/dashboard-next/orders/components/OrderDraftList/OrderDraftList.tsx
index 869c15c9fa..5bc7e7b52a 100644
--- a/saleor/static/dashboard-next/orders/components/OrderDraftList/OrderDraftList.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderDraftList/OrderDraftList.tsx
@@ -128,7 +128,6 @@ export const OrderDraftList = withStyles(styles, { name: "OrderDraftList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx b/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
index 1e1886eb11..6a45a41b92 100644
--- a/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderList/OrderList.tsx
@@ -141,7 +141,6 @@ export const OrderList = withStyles(styles, { name: "OrderList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx b/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx
index 6685690713..c930e3c1dc 100644
--- a/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx
+++ b/saleor/static/dashboard-next/pages/components/PageList/PageList.tsx
@@ -103,7 +103,6 @@ const PageList = withStyles(styles, { name: "PageList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx b/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx
index 76f992b3b9..59ca4d5bd5 100644
--- a/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx
+++ b/saleor/static/dashboard-next/productTypes/components/ProductTypeList/ProductTypeList.tsx
@@ -108,7 +108,6 @@ const ProductTypeList = withStyles(styles, { name: "ProductTypeList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/products/components/ProductOrganization/ProductOrganization.tsx b/saleor/static/dashboard-next/products/components/ProductOrganization/ProductOrganization.tsx
index bd59d767fb..8f9f5bc6e2 100644
--- a/saleor/static/dashboard-next/products/components/ProductOrganization/ProductOrganization.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductOrganization/ProductOrganization.tsx
@@ -11,6 +11,7 @@ import * as React from "react";
import CardSpacer from "../../../components/CardSpacer";
import CardTitle from "../../../components/CardTitle";
+import Chip from "../../../components/Chip";
import { FormSpacer } from "../../../components/FormSpacer";
import MultiAutocompleteSelectField from "../../../components/MultiAutocompleteSelectField";
import SingleAutocompleteSelectField from "../../../components/SingleAutocompleteSelectField";
@@ -18,7 +19,6 @@ import Skeleton from "../../../components/Skeleton";
import i18n from "../../../i18n";
import { maybe } from "../../../misc";
import { ProductCreateData_productTypes_edges_node_productAttributes } from "../../types/ProductCreateData";
-import Chip from "../../../components/Chip";
interface ChoiceType {
label: string;
diff --git a/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx b/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
index 95b3437c19..f33d274a8e 100644
--- a/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductVariants/ProductVariants.tsx
@@ -139,7 +139,6 @@ export const ProductVariants = withStyles(styles, { name: "ProductVariants" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/shipping/components/ShippingZonesList/ShippingZonesList.tsx b/saleor/static/dashboard-next/shipping/components/ShippingZonesList/ShippingZonesList.tsx
index d3d89a5b55..b700774d77 100644
--- a/saleor/static/dashboard-next/shipping/components/ShippingZonesList/ShippingZonesList.tsx
+++ b/saleor/static/dashboard-next/shipping/components/ShippingZonesList/ShippingZonesList.tsx
@@ -122,7 +122,6 @@ const ShippingZonesList = withStyles(styles, { name: "ShippingZonesList" })(
>
<TableCell padding="checkbox">
<Checkbox
- color="primary"
checked={isSelected}
disabled={disabled}
onClick={event => {
diff --git a/saleor/static/dashboard-next/storybook/stories/components/Checkbox.tsx b/saleor/static/dashboard-next/storybook/stories/components/Checkbox.tsx
index 1442fad184..49ab77c041 100644
--- a/saleor/static/dashboard-next/storybook/stories/components/Checkbox.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/components/Checkbox.tsx
@@ -25,10 +25,10 @@ storiesOf("Generics / Checkbox", module)
{...props}
checked={data.data}
// Omit second argument
- onClick={event =>
+ onClick={() =>
change({
target: {
- name: event.target.name,
+ name: "data",
value: !data.data
}
} as any)
diff --git a/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx b/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx
index f9896c78b7..c68b4348bb 100644
--- a/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx
@@ -1,10 +1,10 @@
import { storiesOf } from "@storybook/react";
import * as React from "react";
+import Form from "../../../components/Form";
import MultiSelectField from "../../../components/MultiSelectField";
import CardDecorator from "../../CardDecorator";
import Decorator from "../../Decorator";
-import Form from "../../../components/Form";
const choices = [
{ value: "1", label: "Apparel" },