Skip to content

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

Add view to configuration menu

dominik-zeglen39da7013ad06
diff --git a/saleor/static/dashboard-next/configuration/index.tsx b/saleor/static/dashboard-next/configuration/index.tsx
index 68bfac7617..f850b54243 100644
--- a/saleor/static/dashboard-next/configuration/index.tsx
+++ b/saleor/static/dashboard-next/configuration/index.tsx
@@ -10,13 +10,15 @@ import Monetization from "../icons/Monetization";
import Navigation from "../icons/Navigation";
import Pages from "../icons/Pages";
import StoreMall from "../icons/StoreMall";
+import { productTypeListUrl } from "../productTypes";
import ConfigurationPage from "./ConfigurationPage";
export const configurationMenu = [
{
description: i18n.t("Define types of products you sell"),
icon: <Folder fontSize="inherit" />,
- title: i18n.t("Product Types")
+ title: i18n.t("Product Types"),
+ url: productTypeListUrl
},
{
description: i18n.t("Define attributes of products yousell"),
diff --git a/saleor/static/dashboard-next/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx b/saleor/static/dashboard-next/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx
index 7362cdb8cd..1a468da7ea 100644
--- a/saleor/static/dashboard-next/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx
+++ b/saleor/static/dashboard-next/productTypes/components/ProductTypeDetailsPage/ProductTypeDetailsPage.tsx
@@ -27,6 +27,10 @@ export interface ProductTypeForm {
variantAttributes: ChoiceType[];
}
interface ProductTypeDetailsPageProps {
+ errors: Array<{
+ field: string;
+ message: string;
+ }>;
productType?: {
id?: string;
name?: string;
@@ -68,6 +72,7 @@ const ProductTypeDetailsPage = decorate<ProductTypeDetailsPageProps>(
({
classes,
disabled,
+ errors,
pageTitle,
productAttributes,
productType,
@@ -107,6 +112,7 @@ const ProductTypeDetailsPage = decorate<ProductTypeDetailsPageProps>(
{(openedDeleteDialog, { toggle: toggleDeleteDialog }) => (
<>
<Form
+ errors={errors}
initial={formInitialData}
onSubmit={onSubmit}
key={JSON.stringify(productType)}
diff --git a/saleor/static/dashboard-next/productTypes/mutations.ts b/saleor/static/dashboard-next/productTypes/mutations.ts
index a4aeceb78e..ecf9314f89 100644
--- a/saleor/static/dashboard-next/productTypes/mutations.ts
+++ b/saleor/static/dashboard-next/productTypes/mutations.ts
@@ -1,5 +1,4 @@
import gql from "graphql-tag";
-import { Mutation, MutationProps } from "react-apollo";
import {
ProductTypeCreateMutation,
diff --git a/saleor/static/dashboard-next/productTypes/views/ProductTypeCreate.tsx b/saleor/static/dashboard-next/productTypes/views/ProductTypeCreate.tsx
index 35a477625e..03c42e28c2 100644
--- a/saleor/static/dashboard-next/productTypes/views/ProductTypeCreate.tsx
+++ b/saleor/static/dashboard-next/productTypes/views/ProductTypeCreate.tsx
@@ -74,6 +74,11 @@ export const ProductTypeCreate: React.StatelessComponent = () => (
return (
<ProductTypeDetailsPage
disabled={loadingCreate}
+ errors={
+ createProductTypeData
+ ? createProductTypeData.productTypeCreate.errors
+ : undefined
+ }
pageTitle={i18n.t("Create Product Type", {
context: "page title"
})}