Skip to content

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

Fix tslint issues

Krzysztof Bialoglowiczabb051c50f02
diff --git a/saleor/static/dashboard-next/components/RadioGroupField/RadioGroupField.tsx b/saleor/static/dashboard-next/components/RadioGroupField/RadioGroupField.tsx
index 38b2e02925..a5ec5ef80a 100644
--- a/saleor/static/dashboard-next/components/RadioGroupField/RadioGroupField.tsx
+++ b/saleor/static/dashboard-next/components/RadioGroupField/RadioGroupField.tsx
@@ -13,17 +13,17 @@ import i18n from "../../i18n";
const styles = createStyles({
formControl: {
- width: "100%",
- padding: "0 15px"
+ padding: "0 15px",
+ width: "100%"
+ },
+ formLabel: {
+ marginLeft: "-5px",
+ paddingBottom: "10px"
},
radioLabel: {
"& > span": {
padding: "6px"
}
- },
- formLabel: {
- marginLeft: "-5px",
- paddingBottom: "10px"
}
});
@@ -38,7 +38,6 @@ interface RadioGroupFieldProps extends WithStyles<typeof styles> {
hint?: string;
label?: string;
name?: string;
- placeholder?: string;
value?: string;
onChange(event: any);
}
@@ -56,17 +55,8 @@ export const RadioGroupField = withStyles(styles, {
value,
onChange,
name,
- hint,
- placeholder
+ hint
}: RadioGroupFieldProps) => {
- const choicesByKey: { [key: string]: string } =
- choices === undefined
- ? {}
- : choices.reduce((prev, curr) => {
- prev[curr.value] = curr.label;
- return prev;
- }, {});
-
return (
<FormControl
className={classNames(classes.formControl, className)}
@@ -77,7 +67,6 @@ export const RadioGroupField = withStyles(styles, {
<RadioGroup
aria-label={name}
name={name}
- className={classes.group}
value={value}
onChange={onChange}
>
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx b/saleor/static/dashboard-next/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx
index ad3a5de74a..673afb1460 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherCreatePage/VoucherCreatePage.tsx
@@ -72,7 +72,6 @@ const VoucherCreatePage: React.StatelessComponent<VoucherCreatePageProps> = ({
data={data}
errors={formErrors}
disabled={disabled}
- variant="create"
onChange={change}
/>
<CardSpacer />
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx b/saleor/static/dashboard-next/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx
index 64c1c64f3b..75e9955e53 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherDetailsPage/VoucherDetailsPage.tsx
@@ -143,7 +143,6 @@ const VoucherDetailsPage: React.StatelessComponent<VoucherDetailsPageProps> = ({
data={data}
disabled={disabled}
errors={formErrors}
- variant="update"
onChange={change}
/>
<CardSpacer />
@@ -151,7 +150,6 @@ const VoucherDetailsPage: React.StatelessComponent<VoucherDetailsPageProps> = ({
data={data}
disabled={disabled}
errors={formErrors}
- variant="update"
onChange={change}
/>
<CardSpacer />
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx b/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx
index 8fd19fab27..05dc24ec0d 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherInfo/VoucherInfo.tsx
@@ -19,7 +19,6 @@ interface VoucherInfoProps {
data: FormData;
errors: FormErrors<"name" | "code" | "type">;
disabled: boolean;
- variant: "create" | "update";
onChange: (event: React.ChangeEvent<any>) => void;
}
@@ -43,7 +42,6 @@ const VoucherInfo = withStyles(styles, {
data,
disabled,
errors,
- variant,
onChange
}: VoucherInfoProps & WithStyles<typeof styles>) => {
const [generateCode, setGenerateCode] = React.useState();
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherTypes/VoucherTypes.tsx b/saleor/static/dashboard-next/discounts/components/VoucherTypes/VoucherTypes.tsx
index e553885534..fee89a9368 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherTypes/VoucherTypes.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherTypes/VoucherTypes.tsx
@@ -20,7 +20,6 @@ interface VoucherTypesProps {
data: FormData;
errors: FormErrors<"name" | "code" | "type">;
disabled: boolean;
- variant: "create" | "update";
onChange: (event: React.ChangeEvent<any>) => void;
}
@@ -41,7 +40,6 @@ const VoucherTypes = withStyles(styles, {
data,
disabled,
errors,
- variant,
onChange
}: VoucherTypesProps & WithStyles<typeof styles>) => {
const translatedVoucherTypes = translateVoucherTypes();
diff --git a/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx b/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx
index fd663aed73..ae4385c8e8 100644
--- a/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx
+++ b/saleor/static/dashboard-next/discounts/views/VoucherDetails.tsx
@@ -333,7 +333,6 @@ export const VoucherDetails: React.StatelessComponent<VoucherDetailsProps> = ({
? null
: moment(formData.endDate),
- name: formData.name,
startDate:
formData.startDate === null
? null