Skip to content

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

Add mailto link for user email at order details page

Mateusz Stanielewiczb38986b06285
diff --git a/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx b/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
index fd9aa06b88..e6f077ac50 100644
--- a/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderCustomer/OrderCustomer.tsx
@@ -33,7 +33,6 @@ interface OrderCustomerProps {
billingAddress?: AddressType;
editCustomer?: boolean;
onCustomerEditClick?();
- onCustomerEmailClick?(id: string);
onBillingAddressEdit?();
onShippingAddressEdit?();
}
@@ -63,7 +62,6 @@ const OrderCustomer = decorate<OrderCustomerProps>(
editCustomer,
shippingAddress,
onCustomerEditClick,
- onCustomerEmailClick,
onBillingAddressEdit,
onShippingAddressEdit
}) => (
@@ -93,17 +91,12 @@ const OrderCustomer = decorate<OrderCustomerProps>(
<Typography>{i18n.t("Anonymous customer")}</Typography>
) : (
<>
- <Typography>{client.email}</Typography>
- <Typography
+ <a
+ href={`mailto:${client.email}`}
className={classes.link}
- onClick={
- onCustomerEmailClick
- ? onCustomerEmailClick(client.id)
- : undefined
- }
>
- {client.email}
- </Typography>
+ <Typography>{client.email}</Typography>
+ </a>
</>
)}
</CardContent>
diff --git a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
index d544591777..89a0026a6f 100644
--- a/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderDetailsPage/OrderDetailsPage.tsx
@@ -142,7 +142,6 @@ interface OrderDetailsPageProps {
fetchVariants?(value: string);
onBack();
onCreate?();
- onCustomerEmailClick?(id: string);
onOrderFulfill(data: OrderFulfillFormData);
onOrderLineChange?(id: string): (value: string) => () => void;
onOrderLineRemove?(id: string): () => void;
@@ -251,7 +250,6 @@ class OrderDetailsPageComponent extends React.Component<
fetchVariants,
onBack,
onCreate,
- onCustomerEmailClick,
onOrderCancel,
onOrderFulfill,
onOrderLineChange,
@@ -457,7 +455,6 @@ class OrderDetailsPageComponent extends React.Component<
shippingAddress={maybe(() => order.shippingAddress)}
onBillingAddressEdit={this.toggleBillingAddressEditDialog}
onCustomerEditClick={this.toggleCustomerEditDialog}
- onCustomerEmailClick={onCustomerEmailClick}
onShippingAddressEdit={this.toggleShippingAddressEditDialog}
/>
{order && (
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
index 6314eb79c3..21fe78fab4 100644
--- a/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
@@ -25,7 +25,6 @@ const orderWithoutPayment = orderFixture(placeholderImage, {
const callbacks = {
onBack: () => undefined,
onCreate: undefined,
- onCustomerEmailClick: () => undefined,
onOrderCancel: undefined,
onOrderFulfill: undefined,
onOrderLineChange: () => () => () => undefined,