Skip to content

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

Restyle customer card

dominik-zeglen147aebfd5423
diff --git a/saleor/static/dashboard-next/components/Link.tsx b/saleor/static/dashboard-next/components/Link.tsx
index fee2fd1013..4c9f03223a 100644
--- a/saleor/static/dashboard-next/components/Link.tsx
+++ b/saleor/static/dashboard-next/components/Link.tsx
@@ -5,6 +5,7 @@ import * as React from "react";
interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
color?: "primary" | "secondary";
+ underline?: boolean;
typographyProps?: TypographyProps;
}
@@ -14,17 +15,31 @@ const decorate = withStyles(theme => ({
},
root: {
cursor: "pointer" as "pointer",
- textDecoration: "underline" as "underline"
+ display: "inline" as "inline"
},
secondary: {
color: theme.palette.secondary.main
+ },
+ underline: {
+ textDecoration: "underline" as "underline"
}
}));
const Link = decorate<LinkProps>(
- ({ classes, className, children, color = "primary", ...linkProps }) => (
+ ({
+ classes,
+ className,
+ children,
+ color = "primary",
+ underline = false,
+ ...linkProps
+ }) => (
<Typography
component="a"
- className={classNames(classes.root, classes[color])}
+ className={classNames({
+ [classes.root]: true,
+ [classes[color]]: true,
+ [classes.underline]: underline
+ })}
{...linkProps}
>
{children}
diff --git a/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx b/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
index 42f836403b..9fb2fffd57 100644
--- a/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
@@ -7,47 +7,40 @@ import * as React from "react";
import CardTitle from "../../../components/CardTitle";
import ExternalLink from "../../../components/ExternalLink";
+import Hr from "../../../components/Hr";
+import Link from "../../../components/Link";
import Skeleton from "../../../components/Skeleton";
import i18n from "../../../i18n";
+import { maybe } from "../../../misc";
+import { OrderDetails_order } from "../../types/OrderDetails";
-interface AddressType {
- city: string;
- cityArea: string;
- companyName: string;
- country: {
- code: string;
- country: string;
- };
- countryArea: string;
- firstName: string;
- id: string;
- lastName: string;
- phone: string;
- postalCode: string;
- streetAddress1: string;
- streetAddress2: string;
-}
export interface OrderCustomerProps {
- customer: {
- id: string;
- email: string;
- };
- shippingAddress?: AddressType;
- billingAddress?: AddressType;
+ order: OrderDetails_order;
canEditCustomer?: boolean;
- onCustomerEditClick?();
- onBillingAddressEdit?();
- onShippingAddressEdit?();
+ onCustomerEditClick();
+ onBillingAddressEdit();
+ onShippingAddressEdit();
}
const decorate = withStyles(
theme => ({
- hr: {
- backgroundColor: theme.palette.grey[200],
- border: "none",
- display: "block",
- height: 1,
- width: "100%"
+ sectionHeader: {
+ alignItems: "center" as "center",
+ display: "flex",
+ marginBottom: theme.spacing.unit * 3
+ },
+ sectionHeaderTitle: {
+ flex: 1,
+ fontWeight: 600 as 600,
+ lineHeight: 1,
+ textTransform: "uppercase" as "uppercase"
+ },
+ sectionHeaderToolbar: {
+ marginRight: -theme.spacing.unit * 2
+ },
+ userEmail: {
+ fontWeight: 600 as 600,
+ marginBottom: theme.spacing.unit
}
}),
{ name: "OrderCustomer" }
@@ -55,141 +48,174 @@ const decorate = withStyles(
const OrderCustomer = decorate<OrderCustomerProps>(
({
classes,
- customer,
- billingAddress,
canEditCustomer,
- shippingAddress,
+ order,
onCustomerEditClick,
onBillingAddressEdit,
onShippingAddressEdit
- }) => (
- <Card>
- <CardTitle
- title={i18n.t("Customer")}
- toolbar={
- !!canEditCustomer && (
- <Button
- color="secondary"
- variant="flat"
- disabled={!onCustomerEditClick}
- onClick={onCustomerEditClick}
- >
- {i18n.t("Edit")}
- </Button>
- )
- }
- />
- <CardContent>
- {customer === undefined ? (
- <>
+ }) => {
+ const billingAddress = maybe(() => order.billingAddress);
+ const shippingAddress = maybe(() => order.shippingAddress);
+ const user = maybe(() => order.user);
+ return (
+ <Card>
+ <CardTitle
+ title={i18n.t("Customer")}
+ toolbar={
+ !!canEditCustomer && (
+ <Button
+ color="secondary"
+ variant="flat"
+ disabled={!onCustomerEditClick}
+ onClick={onCustomerEditClick}
+ >
+ {i18n.t("Edit")}
+ </Button>
+ )
+ }
+ />
+ <CardContent>
+ {user === undefined ? (
<Skeleton />
- <Skeleton />
- </>
- ) : customer === null ? (
- <Typography>{i18n.t("Anonymous customer")}</Typography>
- ) : (
- <ExternalLink href={`mailto:${customer.email}`}>
- {customer.email}
- </ExternalLink>
- )}
- </CardContent>
- <hr className={classes.hr} />
-
- <CardTitle
- title={i18n.t("Shipping Address")}
- toolbar={
- <Button
- color="secondary"
- variant="flat"
- onClick={onShippingAddressEdit}
- disabled={!onShippingAddressEdit && customer === undefined}
- >
- {i18n.t("Edit")}
- </Button>
- }
- />
- <CardContent>
- {shippingAddress === undefined ? (
- <Skeleton />
- ) : shippingAddress === null ? (
- <Typography>{i18n.t("Not set")}</Typography>
- ) : (
- <>
- {shippingAddress.companyName && (
- <Typography>{shippingAddress.companyName}</Typography>
- )}
- <Typography>
- {shippingAddress.firstName} {shippingAddress.lastName}
- </Typography>
- <Typography>
- {shippingAddress.streetAddress1}
- <br />
- {shippingAddress.streetAddress2}
- </Typography>
- <Typography>
- {shippingAddress.postalCode} {shippingAddress.city}
- {shippingAddress.cityArea ? ", " + shippingAddress.cityArea : ""}
- </Typography>
- <Typography>
- {shippingAddress.countryArea
- ? shippingAddress.countryArea +
- ", " +
- shippingAddress.country.country
- : shippingAddress.country.country}
+ ) : user === null ? (
+ <Typography>{i18n.t("Anonymous user")}</Typography>
+ ) : (
+ <>
+ <Typography className={classes.userEmail}>
+ {user.email}
+ </Typography>
+ <div>
+ <Link underline={false}>{i18n.t("View Profile")}</Link>
+ </div>
+ <div>
+ <Link underline={false}>{i18n.t("View Orders")}</Link>
+ </div>
+ </>
+ )}
+ </CardContent>
+ <Hr />
+ <CardContent>
+ <div className={classes.sectionHeader}>
+ <Typography className={classes.sectionHeaderTitle}>
+ {i18n.t("Contact information")}
</Typography>
- </>
- )}
- </CardContent>
- <hr className={classes.hr} />
+ </div>
- <CardTitle
- title={i18n.t("Billing Address")}
- toolbar={
- <Button
- color="secondary"
- variant="flat"
- onClick={onBillingAddressEdit}
- disabled={!onBillingAddressEdit && customer === undefined}
- >
- {i18n.t("Edit")}
- </Button>
- }
- />
- <CardContent>
- {billingAddress === undefined ? (
- <Skeleton />
- ) : billingAddress === null ? (
- <Typography>{i18n.t("Not set")}</Typography>
- ) : shippingAddress.id === billingAddress.id ? (
- <Typography>{i18n.t("Same as shipping address")}</Typography>
- ) : (
- <>
- {billingAddress.companyName && (
- <Typography>{billingAddress.companyName}</Typography>
- )}
- <Typography>
- {billingAddress.firstName} {billingAddress.lastName}
- </Typography>
- <Typography>
- {billingAddress.streetAddress1}
- <br />
- {billingAddress.streetAddress2}
- </Typography>
- <Typography>
- {billingAddress.postalCode} {billingAddress.city}
- {billingAddress.cityArea ? ", " + billingAddress.cityArea : ""}
+ {maybe(() => order.userEmail) === undefined ? (
+ <Skeleton />
+ ) : order.userEmail === null ? (
+ <Typography>{i18n.t("Not set")}</Typography>
+ ) : (
+ <ExternalLink
+ href={`mailto:${maybe(() => order.userEmail)}`}
+ typographyProps={{ color: "primary" }}
+ >
+ order.userEmail
+ </ExternalLink>
+ )}
+ </CardContent>
+ <Hr />
+ <CardContent>
+ <div className={classes.sectionHeader}>
+ <Typography className={classes.sectionHeaderTitle}>
+ {i18n.t("Shipping Address")}
</Typography>
- <Typography>
- {billingAddress.countryArea
- ? billingAddress.countryArea +
- ", " +
- billingAddress.country.country
- : billingAddress.country.country}
+ <div className={classes.sectionHeaderToolbar}>
+ <Button
+ color="secondary"
+ variant="flat"
+ onClick={onShippingAddressEdit}
+ disabled={!onShippingAddressEdit && user === undefined}
+ >
+ {i18n.t("Edit")}
+ </Button>
+ </div>
+ </div>
+ {shippingAddress === undefined ? (
+ <Skeleton />
+ ) : shippingAddress === null ? (
+ <Typography>{i18n.t("Not set")}</Typography>
+ ) : (
+ <>
+ {shippingAddress.companyName && (
+ <Typography>{shippingAddress.companyName}</Typography>
+ )}
+ <Typography>
+ {shippingAddress.firstName} {shippingAddress.lastName}
+ </Typography>
+ <Typography>
+ {shippingAddress.streetAddress1}
+ <br />
+ {shippingAddress.streetAddress2}
+ </Typography>
+ <Typography>
+ {shippingAddress.postalCode} {shippingAddress.city}
+ {shippingAddress.cityArea
+ ? ", " + shippingAddress.cityArea
+ : ""}
+ </Typography>
+ <Typography>
+ {shippingAddress.countryArea
+ ? shippingAddress.countryArea +
+ ", " +
+ shippingAddress.country.country
+ : shippingAddress.country.country}
+ </Typography>
+ </>
+ )}
+ </CardContent>
+ <Hr />
+ <CardContent>
+ <div className={classes.sectionHeader}>
+ <Typography className={classes.sectionHeaderTitle}>
+ {i18n.t("Billing Address")}
</Typography>
- </>
- )}
- </CardContent>
- </Card>
- )
+ <div className={classes.sectionHeaderToolbar}>
+ <Button
+ color="secondary"
+ variant="flat"
+ onClick={onBillingAddressEdit}
+ disabled={!onBillingAddressEdit && user === undefined}
+ >
+ {i18n.t("Edit")}
+ </Button>
+ </div>
+ </div>
+ {billingAddress === undefined ? (
+ <Skeleton />
+ ) : billingAddress === null ? (
+ <Typography>{i18n.t("Not set")}</Typography>
+ ) : shippingAddress.id === billingAddress.id ? (
+ <Typography>{i18n.t("Same as shipping address")}</Typography>
+ ) : (
+ <>
+ {billingAddress.companyName && (
+ <Typography>{billingAddress.companyName}</Typography>
+ )}
+ <Typography>
+ {billingAddress.firstName} {billingAddress.lastName}
+ </Typography>
+ <Typography>
+ {billingAddress.streetAddress1}
+ <br />
+ {billingAddress.streetAddress2}
+ </Typography>
+ <Typography>
+ {billingAddress.postalCode} {billingAddress.city}
+ {billingAddress.cityArea ? ", " + billingAddress.cityArea : ""}
+ </Typography>
+ <Typography>
+ {billingAddress.countryArea
+ ? billingAddress.countryArea +
+ ", " +
+ billingAddress.country.country
+ : billingAddress.country.country}
+ </Typography>
+ </>
+ )}
+ </CardContent>
+ </Card>
+ );
+ }
);
export default OrderCustomer;
diff --git a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
index 48c4a15465..9916615b1d 100644
--- a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
@@ -325,10 +325,8 @@ class OrderDetailsPageComponent extends React.Component<
</div>
<div>
<OrderCustomer
- billingAddress={maybe(() => order.billingAddress)}
- customer={maybe(() => order.user)}
canEditCustomer={false}
- shippingAddress={maybe(() => order.shippingAddress)}
+ order={order}
onBillingAddressEdit={this.toggleBillingAddressEditDialog}
onCustomerEditClick={this.toggleCustomerEditDialog}
onShippingAddressEdit={this.toggleShippingAddressEditDialog}
diff --git a/saleor/static/dashboard-next/orders/fixtures.ts b/saleor/static/dashboard-next/orders/fixtures.ts
index e9266acfcd..683a7e2ddf 100644
--- a/saleor/static/dashboard-next/orders/fixtures.ts
+++ b/saleor/static/dashboard-next/orders/fixtures.ts
@@ -991,7 +991,8 @@ export const order = (placeholder: string): OrderDetails_order => ({
amount: 0,
currency: "USD"
},
- user: null
+ user: null,
+ userEmail: "[email protected]"
});
export const draftOrder = (placeholder: string) => ({
__typename: "Order" as "Order",
@@ -1093,7 +1094,8 @@ export const draftOrder = (placeholder: string) => ({
},
totalAuthorized: null,
totalCaptured: null,
- user: null
+ user: null,
+ userEmail: null
});
export const flatOrders = orders.map(order => ({
...order,
diff --git a/saleor/static/dashboard-next/orders/queries.ts b/saleor/static/dashboard-next/orders/queries.ts
index cc1ce4d005..317942499f 100644
--- a/saleor/static/dashboard-next/orders/queries.ts
+++ b/saleor/static/dashboard-next/orders/queries.ts
@@ -146,6 +146,7 @@ export const fragmentOrderDetails = gql`
id
email
}
+ userEmail
availableShippingMethods {
id
name
diff --git a/saleor/static/dashboard-next/orders/types/OrderCancel.ts b/saleor/static/dashboard-next/orders/types/OrderCancel.ts
index dc4932eb02..14c6131b0a 100644
--- a/saleor/static/dashboard-next/orders/types/OrderCancel.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderCancel.ts
@@ -242,6 +242,7 @@ export interface OrderCancel_orderCancel_order {
totalAuthorized: OrderCancel_orderCancel_order_totalAuthorized | null;
totalCaptured: OrderCancel_orderCancel_order_totalCaptured | null;
user: OrderCancel_orderCancel_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderCancel_orderCancel_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderCapture.ts b/saleor/static/dashboard-next/orders/types/OrderCapture.ts
index 6d3bf5a0f6..3bfdbe934a 100644
--- a/saleor/static/dashboard-next/orders/types/OrderCapture.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderCapture.ts
@@ -248,6 +248,7 @@ export interface OrderCapture_orderCapture_order {
totalAuthorized: OrderCapture_orderCapture_order_totalAuthorized | null;
totalCaptured: OrderCapture_orderCapture_order_totalCaptured | null;
user: OrderCapture_orderCapture_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderCapture_orderCapture_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts b/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts
index 292bd81fed..062d0ae0a5 100644
--- a/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts
@@ -258,6 +258,7 @@ export interface OrderCreateFulfillment_orderFulfillmentCreate_order {
totalAuthorized: OrderCreateFulfillment_orderFulfillmentCreate_order_totalAuthorized | null;
totalCaptured: OrderCreateFulfillment_orderFulfillmentCreate_order_totalCaptured | null;
user: OrderCreateFulfillment_orderFulfillmentCreate_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderCreateFulfillment_orderFulfillmentCreate_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderDetails.ts b/saleor/static/dashboard-next/orders/types/OrderDetails.ts
index b1c682c087..4df8ccbedc 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDetails.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDetails.ts
@@ -1,13 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import {
- OrderEventsEmails,
- OrderEvents,
- FulfillmentStatus,
- PaymentStatusEnum,
- OrderStatus
-} from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentStatusEnum, OrderStatus } from "./../../types/globalTypes";
// ====================================================
// GraphQL query operation: OrderDetails
@@ -248,9 +242,8 @@ export interface OrderDetails_order {
totalAuthorized: OrderDetails_order_totalAuthorized | null;
totalCaptured: OrderDetails_order_totalCaptured | null;
user: OrderDetails_order_user | null;
- availableShippingMethods:
- | (OrderDetails_order_availableShippingMethods | null)[]
- | null;
+ userEmail: string | null;
+ availableShippingMethods: (OrderDetails_order_availableShippingMethods | null)[] | null;
}
export interface OrderDetails_shop_countries {
diff --git a/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts b/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts
index 9dda9129b4..044d7cd55f 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts
@@ -242,5 +242,6 @@ export interface OrderDetailsFragment {
totalAuthorized: OrderDetailsFragment_totalAuthorized | null;
totalCaptured: OrderDetailsFragment_totalCaptured | null;
user: OrderDetailsFragment_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderDetailsFragment_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts b/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts
index ffaa0b69eb..09900fc2f0 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts
@@ -248,6 +248,7 @@ export interface OrderDraftUpdate_draftOrderUpdate_order {
totalAuthorized: OrderDraftUpdate_draftOrderUpdate_order_totalAuthorized | null;
totalCaptured: OrderDraftUpdate_draftOrderUpdate_order_totalCaptured | null;
user: OrderDraftUpdate_draftOrderUpdate_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderDraftUpdate_draftOrderUpdate_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts b/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts
index bef6a3800a..edb17b7d0b 100644
--- a/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts
@@ -258,6 +258,7 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order {
totalAuthorized: OrderFulfillmentCancel_orderFulfillmentCancel_order_totalAuthorized | null;
totalCaptured: OrderFulfillmentCancel_orderFulfillmentCancel_order_totalCaptured | null;
user: OrderFulfillmentCancel_orderFulfillmentCancel_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderFulfillmentCancel_orderFulfillmentCancel_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts b/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts
index cca9f92810..e574dce71b 100644
--- a/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts
@@ -258,6 +258,7 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
totalAuthorized: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_totalAuthorized | null;
totalCaptured: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_totalCaptured | null;
user: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts b/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts
index 76fb13258e..f1b1149aa9 100644
--- a/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts
@@ -248,6 +248,7 @@ export interface OrderLineAdd_draftOrderLineCreate_order {
totalAuthorized: OrderLineAdd_draftOrderLineCreate_order_totalAuthorized | null;
totalCaptured: OrderLineAdd_draftOrderLineCreate_order_totalCaptured | null;
user: OrderLineAdd_draftOrderLineCreate_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderLineAdd_draftOrderLineCreate_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts b/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts
index 5cd8a47570..f81c2bf847 100644
--- a/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts
@@ -248,6 +248,7 @@ export interface OrderLineDelete_draftOrderLineDelete_order {
totalAuthorized: OrderLineDelete_draftOrderLineDelete_order_totalAuthorized | null;
totalCaptured: OrderLineDelete_draftOrderLineDelete_order_totalCaptured | null;
user: OrderLineDelete_draftOrderLineDelete_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderLineDelete_draftOrderLineDelete_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts b/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts
index ce9a3759f6..27a79d6f8d 100644
--- a/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts
@@ -248,6 +248,7 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order {
totalAuthorized: OrderLineUpdate_draftOrderLineUpdate_order_totalAuthorized | null;
totalCaptured: OrderLineUpdate_draftOrderLineUpdate_order_totalCaptured | null;
user: OrderLineUpdate_draftOrderLineUpdate_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderLineUpdate_draftOrderLineUpdate_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderRefund.ts b/saleor/static/dashboard-next/orders/types/OrderRefund.ts
index e16b242443..4e3b2c56d8 100644
--- a/saleor/static/dashboard-next/orders/types/OrderRefund.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderRefund.ts
@@ -248,6 +248,7 @@ export interface OrderRefund_orderRefund_order {
totalAuthorized: OrderRefund_orderRefund_order_totalAuthorized | null;
totalCaptured: OrderRefund_orderRefund_order_totalCaptured | null;
user: OrderRefund_orderRefund_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderRefund_orderRefund_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderRelease.ts b/saleor/static/dashboard-next/orders/types/OrderRelease.ts
index 131272b226..4f7077f5e0 100644
--- a/saleor/static/dashboard-next/orders/types/OrderRelease.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderRelease.ts
@@ -242,6 +242,7 @@ export interface OrderRelease_orderRelease_order {
totalAuthorized: OrderRelease_orderRelease_order_totalAuthorized | null;
totalCaptured: OrderRelease_orderRelease_order_totalCaptured | null;
user: OrderRelease_orderRelease_order_user | null;
+ userEmail: string | null;
availableShippingMethods: (OrderRelease_orderRelease_order_availableShippingMethods | null)[] | null;
}
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx
index 32a3122585..3fb8fd1a5b 100644
--- a/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderCustomer.tsx
@@ -4,25 +4,30 @@ import * as React from "react";
import OrderCustomer, {
OrderCustomerProps
} from "../../../orders/components/OrderCustomer";
-import { order } from "../../../orders/fixtures";
+import { order as orderFixture } from "../../../orders/fixtures";
import Decorator from "../../Decorator";
-const differentAddress = { ...order("").billingAddress, id: "a2" };
+const order = orderFixture("");
const props: OrderCustomerProps = {
- billingAddress: order("").billingAddress,
- customer: order("").user,
onBillingAddressEdit: undefined,
+ onCustomerEditClick: undefined,
onShippingAddressEdit: undefined,
- shippingAddress: order("").shippingAddress
+ order
};
storiesOf("Orders / OrderCustomer", module)
.addDecorator(Decorator)
.add("when loading data", () => (
- <OrderCustomer {...props} customer={undefined} />
+ <OrderCustomer {...props} order={undefined} />
))
.add("when loaded data", () => <OrderCustomer {...props} />)
.add("with different addresses", () => (
- <OrderCustomer {...props} billingAddress={differentAddress} />
+ <OrderCustomer
+ {...props}
+ order={{
+ ...order,
+ shippingAddress: { ...order.shippingAddress, id: "a2" }
+ }}
+ />
));