Skip to content

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

Add back arrows to configure sections

dominik-zeglenc0accc361346
diff --git a/saleor/static/dashboard-next/pages/components/PageListPage/PageListPage.tsx b/saleor/static/dashboard-next/pages/components/PageListPage/PageListPage.tsx
index a1998661ea..f6c990c126 100644
--- a/saleor/static/dashboard-next/pages/components/PageListPage/PageListPage.tsx
+++ b/saleor/static/dashboard-next/pages/components/PageListPage/PageListPage.tsx
@@ -2,6 +2,7 @@ import Button from "@material-ui/core/Button";
import AddIcon from "@material-ui/icons/Add";
import * as React from "react";
+import AppHeader from "../../../components/AppHeader";
import Container from "../../../components/Container";
import PageHeader from "../../../components/PageHeader";
import i18n from "../../../i18n";
@@ -11,11 +12,13 @@ import PageList from "../PageList/PageList";
export interface PageListPageProps extends PageListProps {
pages: PageList_pages_edges_node[];
+ onBack: () => void;
}
const PageListPage: React.StatelessComponent<PageListPageProps> = ({
disabled,
onAdd,
+ onBack,
onNextPage,
onPreviousPage,
onRowClick,
@@ -23,6 +26,7 @@ const PageListPage: React.StatelessComponent<PageListPageProps> = ({
pages
}) => (
<Container>
+ <AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
<PageHeader title={i18n.t("Pages")}>
<Button
disabled={disabled}
diff --git a/saleor/static/dashboard-next/pages/views/PageList.tsx b/saleor/static/dashboard-next/pages/views/PageList.tsx
index a9b7b13444..07e4d27d5f 100644
--- a/saleor/static/dashboard-next/pages/views/PageList.tsx
+++ b/saleor/static/dashboard-next/pages/views/PageList.tsx
@@ -2,6 +2,7 @@ import * as React from "react";
import Navigator from "../../components/Navigator";
import { createPaginationState, Paginator } from "../../components/Paginator";
+import { configurationMenuUrl } from "../../configuration";
import { maybe } from "../../misc";
import PageListPage from "../components/PageListPage/PageListPage";
import { TypedPageListQuery } from "../queries";
@@ -39,6 +40,7 @@ export const PageList: React.StatelessComponent<PageListProps> = ({
pages={maybe(() => data.pages.edges.map(edge => edge.node))}
pageInfo={pageInfo}
onAdd={() => navigate(pageCreateUrl)}
+ onBack={() => navigate(configurationMenuUrl)}
onNextPage={loadNextPage}
onPreviousPage={loadPreviousPage}
onRowClick={id => () => navigate(pageUrl(id))}
diff --git a/saleor/static/dashboard-next/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx b/saleor/static/dashboard-next/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx
index 5ca012c510..6ed202b6b5 100644
--- a/saleor/static/dashboard-next/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx
+++ b/saleor/static/dashboard-next/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx
@@ -2,6 +2,7 @@ import Button from "@material-ui/core/Button";
import AddIcon from "@material-ui/icons/Add";
import * as React from "react";
+import AppHeader from "../../../components/AppHeader";
import Container from "../../../components/Container";
import PageHeader from "../../../components/PageHeader";
import i18n from "../../../i18n";
@@ -11,6 +12,7 @@ import ProductTypeList from "../ProductTypeList";
interface ProductTypeListPageProps extends PageListProps {
productTypes: ProductTypeList_productTypes_edges_node[];
+ onBack: () => void;
}
const ProductTypeListPage: React.StatelessComponent<
@@ -20,11 +22,13 @@ const ProductTypeListPage: React.StatelessComponent<
disabled,
pageInfo,
onAdd,
+ onBack,
onNextPage,
onPreviousPage,
onRowClick
}) => (
<Container>
+ <AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
<PageHeader title={i18n.t("Product types")}>
<Button
color="secondary"
diff --git a/saleor/static/dashboard-next/productTypes/views/ProductTypeList.tsx b/saleor/static/dashboard-next/productTypes/views/ProductTypeList.tsx
index 19fe2264e8..124f29d8e9 100644
--- a/saleor/static/dashboard-next/productTypes/views/ProductTypeList.tsx
+++ b/saleor/static/dashboard-next/productTypes/views/ProductTypeList.tsx
@@ -2,6 +2,7 @@ import * as React from "react";
import Navigator from "../../components/Navigator";
import { createPaginationState, Paginator } from "../../components/Paginator";
+import { configurationMenuUrl } from "../../configuration";
import { maybe } from "../../misc";
import { Pagination } from "../../types";
import ProductTypeListPage from "../components/ProductTypeListPage";
@@ -38,6 +39,7 @@ export const ProductTypeList: React.StatelessComponent<
)}
pageInfo={pageInfo}
onAdd={() => navigate(productTypeAddUrl)}
+ onBack={() => navigate(configurationMenuUrl)}
onNextPage={loadNextPage}
onPreviousPage={loadPreviousPage}
onRowClick={id => () => navigate(productTypeUrl(id))}
diff --git a/saleor/static/dashboard-next/shipping/components/ShippingZonesListPage/ShippingZonesListPage.tsx b/saleor/static/dashboard-next/shipping/components/ShippingZonesListPage/ShippingZonesListPage.tsx
index 38b3c7e24a..987d1e9f95 100644
--- a/saleor/static/dashboard-next/shipping/components/ShippingZonesListPage/ShippingZonesListPage.tsx
+++ b/saleor/static/dashboard-next/shipping/components/ShippingZonesListPage/ShippingZonesListPage.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
+import AppHeader from "../../../components/AppHeader";
import Container from "../../../components/Container";
import Grid from "../../../components/Grid";
import PageHeader from "../../../components/PageHeader";
@@ -13,6 +14,7 @@ import ShippingZonesList from "../ShippingZonesList";
export interface ShippingZonesListPageProps extends PageListProps {
defaultWeightUnit: WeightUnitsEnum;
shippingZones: ShippingZoneFragment[];
+ onBack: () => void;
onRemove: (id: string) => void;
onSubmit: (unit: WeightUnitsEnum) => void;
}
@@ -23,6 +25,7 @@ const ShippingZonesListPage: React.StatelessComponent<
defaultWeightUnit,
disabled,
onAdd,
+ onBack,
onNextPage,
onPreviousPage,
onRemove,
@@ -32,6 +35,7 @@ const ShippingZonesListPage: React.StatelessComponent<
shippingZones
}) => (
<Container>
+ <AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
<PageHeader
title={i18n.t("Shipping", {
context: "page header"
diff --git a/saleor/static/dashboard-next/shipping/views/ShippingZonesList.tsx b/saleor/static/dashboard-next/shipping/views/ShippingZonesList.tsx
index c0947ce5cd..1611ef1347 100644
--- a/saleor/static/dashboard-next/shipping/views/ShippingZonesList.tsx
+++ b/saleor/static/dashboard-next/shipping/views/ShippingZonesList.tsx
@@ -7,6 +7,7 @@ import Messages from "../../components/messages";
import Navigator from "../../components/Navigator";
import { createPaginationState, Paginator } from "../../components/Paginator";
import Shop from "../../components/Shop";
+import { configurationMenuUrl } from "../../configuration";
import i18n from "../../i18n";
import { getMutationState, maybe } from "../../misc";
import { Pagination } from "../../types";
@@ -137,6 +138,9 @@ export const ShippingZonesList: React.StatelessComponent<
onAdd={() =>
navigate(shippingZoneAddUrl)
}
+ onBack={() =>
+ navigate(configurationMenuUrl)
+ }
onNextPage={loadNextPage}
onPreviousPage={loadPreviousPage}
onRemove={id =>
diff --git a/saleor/static/dashboard-next/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx b/saleor/static/dashboard-next/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx
index 022b731ead..a5f602361f 100644
--- a/saleor/static/dashboard-next/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx
+++ b/saleor/static/dashboard-next/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx
@@ -1,6 +1,7 @@
import Typography from "@material-ui/core/Typography";
import * as React from "react";
+import AppHeader from "../../../components/AppHeader";
import { ConfirmButtonTransitionState } from "../../../components/ConfirmButton/ConfirmButton";
import Container from "../../../components/Container";
import Form from "../../../components/Form";
@@ -58,6 +59,7 @@ const SiteSettingsPage: React.StatelessComponent<SiteSettingsPageProps> = ({
>
{({ change, data, errors: formErrors, hasChanged, submit }) => (
<Container>
+ <AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
<PageHeader
title={i18n.t("General Information", {
context: "page header"
diff --git a/saleor/static/dashboard-next/staff/components/StaffListPage/StaffListPage.tsx b/saleor/static/dashboard-next/staff/components/StaffListPage/StaffListPage.tsx
index f358c78cde..7656d60499 100644
--- a/saleor/static/dashboard-next/staff/components/StaffListPage/StaffListPage.tsx
+++ b/saleor/static/dashboard-next/staff/components/StaffListPage/StaffListPage.tsx
@@ -2,6 +2,7 @@ import Button from "@material-ui/core/Button";
import AddIcon from "@material-ui/icons/Add";
import * as React from "react";
+import AppHeader from "../../../components/AppHeader";
import { Container } from "../../../components/Container";
import PageHeader from "../../../components/PageHeader";
import i18n from "../../../i18n";
@@ -12,6 +13,7 @@ import StaffList from "../StaffList/StaffList";
export interface StaffListPageProps extends ListProps {
staffMembers: StaffList_staffUsers_edges_node[];
onAdd: () => void;
+ onBack: () => void;
}
const StaffListPage: React.StatelessComponent<StaffListPageProps> = ({
@@ -19,11 +21,13 @@ const StaffListPage: React.StatelessComponent<StaffListPageProps> = ({
pageInfo,
staffMembers,
onAdd,
+ onBack,
onNextPage,
onPreviousPage,
onRowClick
}) => (
<Container>
+ <AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
<PageHeader title={i18n.t("Staff members", { context: "page title" })}>
<Button
color="secondary"
diff --git a/saleor/static/dashboard-next/staff/views/StaffList.tsx b/saleor/static/dashboard-next/staff/views/StaffList.tsx
index 1940b2e9f3..008c56e16d 100644
--- a/saleor/static/dashboard-next/staff/views/StaffList.tsx
+++ b/saleor/static/dashboard-next/staff/views/StaffList.tsx
@@ -4,6 +4,7 @@ import { Route } from "react-router-dom";
import Messages from "../../components/messages";
import Navigator from "../../components/Navigator";
import { createPaginationState, Paginator } from "../../components/Paginator";
+import { configurationMenuUrl } from "../../configuration";
import i18n from "../../i18n";
import { getMutationState, maybe } from "../../misc";
import { Pagination } from "../../types";
@@ -89,6 +90,7 @@ export const StaffList: React.StatelessComponent<StaffListProps> = ({
data.staffUsers.edges.map(edge => edge.node)
)}
onAdd={() => navigate(staffMemberAddUrl)}
+ onBack={() => navigate(configurationMenuUrl)}
onNextPage={loadNextPage}
onPreviousPage={loadPreviousPage}
onRowClick={id => () =>
diff --git a/saleor/static/dashboard-next/taxes/components/CountryListPage/CountryListPage.tsx b/saleor/static/dashboard-next/taxes/components/CountryListPage/CountryListPage.tsx
index 2b7090c02b..6051018acf 100644
--- a/saleor/static/dashboard-next/taxes/components/CountryListPage/CountryListPage.tsx
+++ b/saleor/static/dashboard-next/taxes/components/CountryListPage/CountryListPage.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
+import AppHeader from "../../../components/AppHeader";
import { Container } from "../../../components/Container";
import Form from "../../../components/Form";
import Grid from "../../../components/Grid";
@@ -18,6 +19,7 @@ export interface FormData {
export interface CountryListPageProps {
disabled: boolean;
shop: CountryList_shop;
+ onBack: () => void;
onRowClick: (code: string) => void;
onSubmit: (data: FormData) => void;
onTaxFetch: () => void;
@@ -26,6 +28,7 @@ export interface CountryListPageProps {
const CountryListPage: React.StatelessComponent<CountryListPageProps> = ({
disabled,
shop,
+ onBack,
onRowClick,
onSubmit,
onTaxFetch
@@ -39,6 +42,7 @@ const CountryListPage: React.StatelessComponent<CountryListPageProps> = ({
<Form initial={initialForm} onSubmit={onSubmit}>
{({ change, data, submit }) => (
<Container>
+ <AppHeader onBack={onBack}>{i18n.t("Configuration")}</AppHeader>
<PageHeader title={i18n.t("Taxes", { context: "page title" })} />
<Grid>
<div>
diff --git a/saleor/static/dashboard-next/taxes/views/CountryList.tsx b/saleor/static/dashboard-next/taxes/views/CountryList.tsx
index 32d6b5c6bc..2522878a72 100644
--- a/saleor/static/dashboard-next/taxes/views/CountryList.tsx
+++ b/saleor/static/dashboard-next/taxes/views/CountryList.tsx
@@ -1,6 +1,7 @@
import * as React from "react";
import Navigator from "../../components/Navigator";
+import { configurationMenuUrl } from "../../configuration";
import { maybe } from "../../misc";
import CountryListPage from "../components/CountryListPage";
import { TypedFetchTaxes, TypedUpdateTaxSettings } from "../mutations";
@@ -22,6 +23,7 @@ export const CountryList: React.StatelessComponent = () => (
fetchTaxesOpts.loading ||
updateTaxSettingsOpts.loading
}
+ onBack={() => navigate(configurationMenuUrl)}
onRowClick={code => navigate(countryTaxRatesUrl(code))}
onSubmit={formData =>
updateTaxSettings({