Skip to content

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

Refactor country selection

dominik-zeglen7d6cb6a1cbd4
diff --git a/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx b/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
index e7eb6bce0b..aece856423 100644
--- a/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
+++ b/saleor/static/dashboard-next/components/CardTitle/CardTitle.tsx
@@ -21,7 +21,9 @@ const styles = (theme: Theme) =>
root: theme.mixins.gutters({
alignItems: "center",
display: "flex",
- height: theme.spacing.unit * 6
+ minHeight: theme.spacing.unit * 6,
+ paddingBottom: theme.spacing.unit * 2,
+ paddingTop: theme.spacing.unit * 2
}),
title: {
flex: 1,
diff --git a/saleor/static/dashboard-next/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx b/saleor/static/dashboard-next/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx
index 4ab4b14063..06e96fce07 100644
--- a/saleor/static/dashboard-next/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx
+++ b/saleor/static/dashboard-next/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx
@@ -96,7 +96,7 @@ const DiscountCountrySelectDialog = withStyles(styles, {
<DialogContent>
<Typography>
{i18n.t(
- "Choose countries you want to add to shipping zone from list below"
+ "Choose countries, you want voucher to be limited to, from the list below"
)}
</Typography>
<FormSpacer />
@@ -115,41 +115,6 @@ const DiscountCountrySelectDialog = withStyles(styles, {
</DialogContent>
<Hr />
<DialogContent className={classes.container}>
- <Typography className={classes.heading} variant="subheading">
- {i18n.t("Quick Pick", {
- context: "country selection"
- })}
- </Typography>
- <Table className={classes.table}>
- <TableBody>
- <TableRow>
- <TableCell className={classes.wideCell}>
- <Typography>{i18n.t("Rest of The World")}</Typography>
- <Typography variant="caption">
- {i18n.t(
- "If selected, this will add all of the countries not selected to other shipping zones"
- )}
- </Typography>
- </TableCell>
- <TableCell
- padding="checkbox"
- className={classes.checkboxCell}
- >
- <Checkbox
- checked={data.allCountries}
- onChange={() =>
- change({
- target: {
- name: "allCountries" as keyof FormData,
- value: !data.allCountries
- }
- } as any)
- }
- />
- </TableCell>
- </TableRow>
- </TableBody>
- </Table>
<Typography className={classes.heading} variant="subheading">
{i18n.t("Countries A to Z", {
context: "country selection"
diff --git a/saleor/static/dashboard-next/discounts/components/VoucherCountries/VoucherCountries.tsx b/saleor/static/dashboard-next/discounts/components/VoucherCountries/VoucherCountries.tsx
index 1eaf04511a..a970b5f3dc 100644
--- a/saleor/static/dashboard-next/discounts/components/VoucherCountries/VoucherCountries.tsx
+++ b/saleor/static/dashboard-next/discounts/components/VoucherCountries/VoucherCountries.tsx
@@ -11,6 +11,7 @@ import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableCell from "@material-ui/core/TableCell";
import TableRow from "@material-ui/core/TableRow";
+import Typography from "@material-ui/core/Typography";
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
import CloseIcon from "@material-ui/icons/Close";
import classNames from "classnames";
@@ -35,6 +36,9 @@ const styles = (theme: Theme) =>
arrow: {
marginRight: theme.spacing.unit * 1.5
},
+ caption: {
+ marginTop: theme.spacing.unit
+ },
pointer: {
cursor: "pointer"
},
@@ -63,9 +67,16 @@ const VoucherCountries = withStyles(styles, {
{(isCollapsed, { toggle: toggleCollapse }) => (
<Card>
<CardTitle
- title={i18n.t("Countries assigned to {{ voucherName }}", {
- voucherName: maybe(() => voucher.name)
- })}
+ title={
+ <>
+ {i18n.t("Countries assigned to {{ voucherName }}", {
+ voucherName: maybe(() => voucher.name)
+ })}
+ <Typography className={classes.caption} variant="caption">
+ {i18n.t("Vouchers limited to these countries")}
+ </Typography>
+ </>
+ }
toolbar={
<Button
variant="flat"
@@ -121,7 +132,7 @@ const VoucherCountries = withStyles(styles, {
() => (
<TableRow>
<TableCell colSpan={2}>
- {i18n.t("No categories found")}
+ {i18n.t("Voucher applies to all countries")}
</TableCell>
</TableRow>
)