Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Update stories
dominik-zeglen96f501144bf5
diff --git a/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx b/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsxindex 2481453e3e..319bad4082 100644--- a/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx+++ b/saleor/static/dashboard-next/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx@@ -26,16 +26,18 @@ const decorate = withStyles(theme => ({}}));const CustomerCreateDetails = decorate<CustomerCreateDetailsProps>(- ({ classes, data, disabled, onChange }) => (+ ({ classes, data, disabled, errors, onChange }) => (<Card><CardTitle title={i18n.t("Customer overview")} /><CardContent><div className={classes.root}><TextFielddisabled={disabled}+ error={!!errors.email}fullWidthname="email"label={i18n.t("E-mail")}+ helperText={errors.email}type="email"value={data.email}onChange={onChange}diff --git a/saleor/static/dashboard-next/customers/components/CustomerCreateNote/CustomerCreateNote.tsx b/saleor/static/dashboard-next/customers/components/CustomerCreateNote/CustomerCreateNote.tsxindex cab3691547..1d21330154 100644--- a/saleor/static/dashboard-next/customers/components/CustomerCreateNote/CustomerCreateNote.tsx+++ b/saleor/static/dashboard-next/customers/components/CustomerCreateNote/CustomerCreateNote.tsx@@ -22,6 +22,7 @@ export interface CustomerCreateNoteProps {const CustomerCreateNote: React.StatelessComponent<CustomerCreateNoteProps> = ({data,disabled,+ errors,onChange}) => (<Card>@@ -33,9 +34,11 @@ const CustomerCreateNote: React.StatelessComponent<CustomerCreateNoteProps> = ({<FormSpacer /><TextFielddisabled={disabled}+ error={!!errors.note}fullWidthmultilinename="note"+ helperText={errors.note}label={i18n.t("Note")}value={data.note}onChange={onChange}diff --git a/saleor/static/dashboard-next/customers/mutations.ts b/saleor/static/dashboard-next/customers/mutations.tsindex d8904c2dfa..8640a280fb 100644--- a/saleor/static/dashboard-next/customers/mutations.ts+++ b/saleor/static/dashboard-next/customers/mutations.ts@@ -47,3 +47,9 @@ export const TypedCreateCustomerMutation = TypedMutation<CreateCustomer,CreateCustomerVariables>(createCustomer);++// const removeCustomer = gql`+// mutation RemoveCustomer($id: ID!) {+// customerRemove+// }+// `diff --git a/saleor/static/dashboard-next/storybook/stories/customers/CustomerCreatePage.tsx b/saleor/static/dashboard-next/storybook/stories/customers/CustomerCreatePage.tsxindex 47bcccf719..4dfceb93b1 100644--- a/saleor/static/dashboard-next/storybook/stories/customers/CustomerCreatePage.tsx+++ b/saleor/static/dashboard-next/storybook/stories/customers/CustomerCreatePage.tsx@@ -2,9 +2,11 @@ import { storiesOf } from "@storybook/react";import * as React from "react";import CustomerCreatePage, {+ CustomerCreatePageFormData,CustomerCreatePageProps} from "../../../customers/components/CustomerCreatePage";import Decorator from "../../Decorator";+import { formError } from "../../misc";const props: CustomerCreatePageProps = {countries: [@@ -12,10 +14,34 @@ const props: CustomerCreatePageProps = {{ __typename: "CountryDisplay", code: "PL", country: "Poland" }],disabled: false,- onBack: () => undefined+ errors: [],+ onBack: () => undefined,+ onSubmit: () => undefined};storiesOf("Views / Customers / Create customer", module).addDecorator(Decorator).add("default", () => <CustomerCreatePage {...props} />)- .add("loading", () => <CustomerCreatePage {...props} disabled={true} />);+ .add("loading", () => <CustomerCreatePage {...props} disabled={true} />)+ .add("form errors", () => (+ <CustomerCreatePage+ {...props}+ errors={([+ "city",+ "cityArea",+ "companyName",+ "country",+ "countryArea",+ "email",+ "firstName",+ "lastName",+ "note",+ "phone",+ "postalCode",+ "streetAddress1",+ "streetAddress2"+ ] as Array<keyof CustomerCreatePageFormData>).map(field =>+ formError(field)+ )}+ />+ ));