View all orders of anonymous customer (#3879)

* feat: view all orders of anonymous customer

* fix: formatting error
fix: translation-messages
This commit is contained in:
Matthias Berchtold 2023-07-11 10:48:49 +02:00 committed by GitHub
parent 4652f56531
commit 5b4d07d547
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View file

@ -2941,6 +2941,10 @@
"J4E+jp": { "J4E+jp": {
"string": "Variant name" "string": "Variant name"
}, },
"J4NBVR": {
"context": "link",
"string": "View Orders"
},
"J7mFhU": { "J7mFhU": {
"context": "currency code select", "context": "currency code select",
"string": "{code} - {countries}" "string": "{code} - {countries}"

View file

@ -18,6 +18,7 @@ import {
} from "@dashboard/graphql"; } from "@dashboard/graphql";
import useStateFromProps from "@dashboard/hooks/useStateFromProps"; import useStateFromProps from "@dashboard/hooks/useStateFromProps";
import { buttonMessages } from "@dashboard/intl"; import { buttonMessages } from "@dashboard/intl";
import { orderListUrl } from "@dashboard/orders/urls";
import { FetchMoreProps, RelayToFlat } from "@dashboard/types"; import { FetchMoreProps, RelayToFlat } from "@dashboard/types";
import createSingleAutocompleteSelectHandler from "@dashboard/utils/handlers/singleAutocompleteSelectChangeHandler"; import createSingleAutocompleteSelectHandler from "@dashboard/utils/handlers/singleAutocompleteSelectChangeHandler";
import { Card, CardContent, Typography } from "@material-ui/core"; import { Card, CardContent, Typography } from "@material-ui/core";
@ -168,7 +169,23 @@ const OrderCustomer: React.FC<OrderCustomerProps> = props => {
<FormattedMessage id="Qovenh" defaultMessage="Anonymous user" /> <FormattedMessage id="Qovenh" defaultMessage="Anonymous user" />
</Typography> </Typography>
) : ( ) : (
<>
<Typography className={classes.userEmail}>{userEmail}</Typography> <Typography className={classes.userEmail}>{userEmail}</Typography>
<div>
<Link
underline={false}
href={orderListUrl({
customer: userEmail,
})}
>
<FormattedMessage
id="J4NBVR"
defaultMessage="View Orders"
description="link"
/>
</Link>
</div>
</>
) )
) : ( ) : (
<> <>