Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add description field to collection
dominik-zeglene7a3b0d0b67e
diff --git a/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx b/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsxindex b384568787..195fd665ab 100644--- a/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx+++ b/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx@@ -27,6 +27,7 @@ export interface CollectionCreatePageFormData {url: string;value: string;};+ description: string;name: string;isPublished: boolean;seoDescription: string;@@ -55,6 +56,7 @@ const initialForm: CollectionCreatePageFormData = {url: null,value: null},+ description: "",isPublished: false,name: "",seoDescription: "",diff --git a/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx b/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsxindex 6fb86486a4..a478c7d5cb 100644--- a/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx+++ b/saleor/static/dashboard-next/collections/components/CollectionDetails/CollectionDetails.tsx@@ -5,6 +5,8 @@ import TextField from "@material-ui/core/TextField";import * as React from "react";import CardTitle from "../../../components/CardTitle";+import FormSpacer from "../../../components/FormSpacer";+import RichTextEditor from "../../../components/RichTextEditor";import i18n from "../../../i18n";const styles = createStyles({@@ -15,10 +17,12 @@ const styles = createStyles({export interface CollectionDetailsProps extends WithStyles<typeof styles> {data: {+ description: string;name: string;};disabled: boolean;errors: {+ description?: string;name?: string;};onChange: (event: React.ChangeEvent<any>) => void;@@ -39,6 +43,21 @@ const CollectionDetails = withStyles(styles, { name: "CollectionDetails" })(error={!!errors.name}helperText={errors.name}/>+ <FormSpacer />+ <RichTextEditor+ label={i18n.t("Description")}+ name="description"+ disabled={disabled}+ value={data.description}+ onChange={onChange}+ error={!!errors.name}+ helperText={+ !!errors.name+ ? errors.name+ : i18n.t("Select text to enable text-formatting tools.")+ }+ fullWidth+ /></CardContent></Card>)diff --git a/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx b/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsxindex f9a9cff243..0e2c925bf8 100644--- a/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx+++ b/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx@@ -23,6 +23,7 @@ import CollectionProducts from "../CollectionProducts/CollectionProducts";import CollectionStatus from "../CollectionStatus/CollectionStatus";export interface CollectionDetailsPageFormData {+ description: string;name: string;seoDescription: string;seoTitle: string;@@ -71,6 +72,7 @@ const CollectionDetailsPage = withStyles(styles, {}: CollectionDetailsPageProps) => (<Forminitial={{+ description: maybe(() => collection.description),isFeatured,isPublished: maybe(() => collection.isPublished),name: maybe(() => collection.name),diff --git a/saleor/static/dashboard-next/collections/queries.ts b/saleor/static/dashboard-next/collections/queries.tsindex c7f179f5b8..e4ade54422 100644--- a/saleor/static/dashboard-next/collections/queries.ts+++ b/saleor/static/dashboard-next/collections/queries.ts@@ -29,6 +29,7 @@ export const collectionDetailsFragment = gql`backgroundImage {url}+ descriptionseoDescriptionseoTitleisPublisheddiff --git a/saleor/static/dashboard-next/collections/types/CollectionDetails.ts b/saleor/static/dashboard-next/collections/types/CollectionDetails.tsindex d2ed445a25..7ddfd5c787 100644--- a/saleor/static/dashboard-next/collections/types/CollectionDetails.ts+++ b/saleor/static/dashboard-next/collections/types/CollectionDetails.ts@@ -50,6 +50,7 @@ export interface CollectionDetails_collection {isPublished: boolean;name: string;backgroundImage: CollectionDetails_collection_backgroundImage | null;+ description: string;seoDescription: string | null;seoTitle: string | null;products: CollectionDetails_collection_products | null;diff --git a/saleor/static/dashboard-next/collections/types/CollectionDetailsFragment.ts b/saleor/static/dashboard-next/collections/types/CollectionDetailsFragment.tsindex 6f7fbc50ed..c7850f60a8 100644--- a/saleor/static/dashboard-next/collections/types/CollectionDetailsFragment.ts+++ b/saleor/static/dashboard-next/collections/types/CollectionDetailsFragment.ts@@ -16,6 +16,7 @@ export interface CollectionDetailsFragment {isPublished: boolean;name: string;backgroundImage: CollectionDetailsFragment_backgroundImage | null;+ description: string;seoDescription: string | null;seoTitle: string | null;}diff --git a/saleor/static/dashboard-next/collections/types/CollectionUpdate.ts b/saleor/static/dashboard-next/collections/types/CollectionUpdate.tsindex feb8b51d15..f336347b4b 100644--- a/saleor/static/dashboard-next/collections/types/CollectionUpdate.ts+++ b/saleor/static/dashboard-next/collections/types/CollectionUpdate.ts@@ -24,6 +24,7 @@ export interface CollectionUpdate_collectionUpdate_collection {isPublished: boolean;name: string;backgroundImage: CollectionUpdate_collectionUpdate_collection_backgroundImage | null;+ description: string;seoDescription: string | null;seoTitle: string | null;}diff --git a/saleor/static/dashboard-next/collections/types/CreateCollection.ts b/saleor/static/dashboard-next/collections/types/CreateCollection.tsindex 8395a17637..757c961dbf 100644--- a/saleor/static/dashboard-next/collections/types/CreateCollection.ts+++ b/saleor/static/dashboard-next/collections/types/CreateCollection.ts@@ -24,6 +24,7 @@ export interface CreateCollection_collectionCreate_collection {isPublished: boolean;name: string;backgroundImage: CreateCollection_collectionCreate_collection_backgroundImage | null;+ description: string;seoDescription: string | null;seoTitle: string | null;}diff --git a/saleor/static/dashboard-next/collections/views/CollectionCreate.tsx b/saleor/static/dashboard-next/collections/views/CollectionCreate.tsxindex dc3b00af3b..3c13997d73 100644--- a/saleor/static/dashboard-next/collections/views/CollectionCreate.tsx+++ b/saleor/static/dashboard-next/collections/views/CollectionCreate.tsx@@ -50,6 +50,7 @@ export const CollectionCreate: React.StatelessComponent<{}> = () => (variables: {input: {backgroundImage: formData.backgroundImage.value,+ description: formData.description,isPublished: formData.isPublished,name: formData.name,seo: {diff --git a/saleor/static/dashboard-next/collections/views/CollectionDetails.tsx b/saleor/static/dashboard-next/collections/views/CollectionDetails.tsxindex f65e7e1eca..ebb18b5f5d 100644--- a/saleor/static/dashboard-next/collections/views/CollectionDetails.tsx+++ b/saleor/static/dashboard-next/collections/views/CollectionDetails.tsx@@ -70,7 +70,7 @@ export const CollectionDetails: React.StatelessComponent<context: "notification"})});- navigate(collectionUrl(id))+ navigate(collectionUrl(id));}};@@ -140,6 +140,7 @@ export const CollectionDetails: React.StatelessComponent<updateCollection.mutate({id,input: {+ description: formData.description,isPublished: formData.isPublished,name: formData.name,seo: {diff --git a/saleor/static/dashboard-next/components/RichTextEditor.tsx b/saleor/static/dashboard-next/components/RichTextEditor.tsxindex a7e3587505..070c369394 100644--- a/saleor/static/dashboard-next/components/RichTextEditor.tsx+++ b/saleor/static/dashboard-next/components/RichTextEditor.tsx@@ -1,10 +1,11 @@import FormControl from "@material-ui/core/FormControl";import FormHelperText from "@material-ui/core/FormHelperText";-import Input from "@material-ui/core/Input";+import Input, { InputClassKey } from "@material-ui/core/Input";import InputLabel from "@material-ui/core/InputLabel";import * as React from "react";interface RichTextEditorProps {+ classes?: Partial<Record<InputClassKey, string>>;disabled?: boolean;error?: boolean;fullWidth?: boolean;@@ -16,6 +17,7 @@ interface RichTextEditorProps {}export const RichTextEditor: React.StatelessComponent<RichTextEditorProps> = ({+ classes,disabled,error,fullWidth,@@ -28,6 +30,7 @@ export const RichTextEditor: React.StatelessComponent<RichTextEditorProps> = ({<FormControl style={fullWidth ? { width: "100%" } : {}} error={error}>{label && <InputLabel shrink={!!value}>{label}</InputLabel>}<Input+ classes={classes}disabled={disabled}multilinename={name}