@graphcommerce/magento-customer 9.1.0-canary.55 → 10.0.0-canary.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/components/AccountAddress/AccountAddress.tsx +2 -2
- package/components/AccountAddresses/AccountAddresses.tsx +7 -7
- package/components/AccountDeleteForm/AccountDeleteForm.tsx +2 -1
- package/components/AccountSignInUpForm/AccountSignInUpForm.tsx +19 -18
- package/components/AddressFields/AddressAddition.tsx +2 -2
- package/components/AddressFields/AddressCity.tsx +2 -2
- package/components/AddressFields/AddressCountryRegion.tsx +4 -4
- package/components/AddressFields/AddressHouseNumber.tsx +4 -4
- package/components/AddressFields/AddressPostcode.tsx +1 -1
- package/components/AddressFields/AddressStreet.tsx +2 -2
- package/components/ApolloCustomerError/ApolloCustomerErrorAlert.tsx +2 -2
- package/components/ApolloCustomerError/ApolloCustomerErrorFullPage.tsx +2 -2
- package/components/ApolloCustomerError/ApolloCustomerErrorSnackbar.tsx +2 -2
- package/components/ApolloCustomerError/useAuthorizationErrorMasked.ts +3 -5
- package/components/CancelOrder/CancelOrderForm.tsx +1 -1
- package/components/ChangeNameForm/ChangeNameForm.tsx +3 -3
- package/components/ChangePasswordForm/ChangePasswordForm.tsx +6 -6
- package/components/CompanyFields/CompanyFields.tsx +4 -5
- package/components/CompanyFields/CompanyName.tsx +2 -2
- package/components/CompanyFields/CompanyVAT.tsx +2 -2
- package/components/ConfirmCustomer/ConfirmCustomerForm.tsx +7 -7
- package/components/ContactForm/ContactForm.tsx +1 -1
- package/components/CreateCustomerAddressForm/CreateCustomerAddressForm.tsx +3 -3
- package/components/CreditMemo/CreditMemoCard.tsx +1 -1
- package/components/CreditMemo/CreditMemoDetails.tsx +1 -1
- package/components/CreditMemo/CreditMemoItem.tsx +2 -2
- package/components/CreditMemo/CreditMemoItems.tsx +1 -1
- package/components/CreditMemo/CreditMemoTotals.tsx +1 -1
- package/components/CustomerFab/CustomerFab.tsx +2 -2
- package/components/CustomerForms/CustomerAttributeField.tsx +2 -2
- package/components/CustomerForms/CustomerUpdateForm.tsx +2 -2
- package/components/CustomerForms/customerAttributeFieldHelpers.ts +1 -1
- package/components/CustomerForms/nameFieldset.tsx +2 -2
- package/components/DeleteCustomerAddressForm/DeleteCustomerAddressForm.tsx +2 -2
- package/components/EditAddressForm/EditAddressForm.tsx +2 -2
- package/components/ForgotPasswordForm/ForgotPasswordForm.tsx +6 -6
- package/components/GuestOrderOverview/GuestOrder.graphql +2 -2
- package/components/GuestOrderOverview/GuestOrderOverviewForm.tsx +10 -10
- package/components/Invoice/InvoiceCard.tsx +1 -1
- package/components/Invoice/InvoiceDetails.tsx +1 -1
- package/components/Invoice/InvoiceItem.tsx +2 -2
- package/components/Invoice/InvoiceItems.tsx +1 -1
- package/components/Invoice/InvoiceTotals.tsx +1 -1
- package/components/NameFields/NameFields.tsx +8 -8
- package/components/NoOrdersFound/NoOrdersFound.tsx +2 -2
- package/components/Order/OrderCard/OrderCard.tsx +3 -3
- package/components/Order/OrderDetails/OrderDetails.tsx +1 -1
- package/components/Order/OrderItem/OrderItem.tsx +2 -2
- package/components/Order/OrderItems/OrderItems.tsx +2 -2
- package/components/Order/OrderStateLabel/OrderStateLabel.tsx +1 -1
- package/components/Order/OrderTotals/OrderTotals.tsx +7 -5
- package/components/ReorderItems/ReorderItems.tsx +1 -1
- package/components/ResetPasswordForm/ResetPasswordForm.tsx +4 -4
- package/components/Shipment/ShipmentCard.tsx +1 -1
- package/components/Shipment/ShipmentDetails.tsx +1 -1
- package/components/Shipment/ShipmentItem.tsx +2 -2
- package/components/Shipment/ShipmentItems.tsx +1 -1
- package/components/SignInForm/SignInForm.tsx +5 -5
- package/components/SignInForm/SignInFormInline.tsx +4 -4
- package/components/SignUpForm/SignUpForm.tsx +9 -7
- package/components/SignUpForm/SignUpFormInline.tsx +5 -8
- package/components/TrackingLink/TrackingLink.tsx +2 -2
- package/components/UpdateCustomerEmailForm/UpdateCustomerEmailForm.tsx +9 -9
- package/components/UpdateDefaultAddressForm/UpdateDefaultAddressForm.tsx +3 -3
- package/components/ValidatedPasswordElement/ValidatedPasswordElement.tsx +4 -9
- package/components/WaitForCustomer/WaitForCustomer.tsx +6 -6
- package/components/index.ts +1 -0
- package/graphql/index.ts +1 -0
- package/hooks/useAccountSignInUpForm.tsx +2 -1
- package/hooks/useCustomerPermissions.ts +2 -3
- package/package.json +28 -19
- package/utils/customerPermissions.ts +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FieldPath, FieldValues } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { TextFieldElement, useWatch } from '@graphcommerce/ecommerce-ui'
|
|
3
3
|
import type { CountryCodeEnum } from '@graphcommerce/graphql-mesh'
|
|
4
|
-
import { Trans } from '@lingui/react'
|
|
4
|
+
import { Trans } from '@lingui/react/macro'
|
|
5
5
|
import type { CompanyFieldsOptions } from './useCompanyFieldsForm'
|
|
6
6
|
import { useCompanyFieldsForm } from './useCompanyFieldsForm'
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ export function CompanyVAT<
|
|
|
27
27
|
variant='outlined'
|
|
28
28
|
type='text'
|
|
29
29
|
required={required ? !optional?.includes(countryCode) : optional?.includes(countryCode)}
|
|
30
|
-
label={<Trans
|
|
30
|
+
label={<Trans>VAT Number</Trans>}
|
|
31
31
|
showValid
|
|
32
32
|
InputProps={{ readOnly }}
|
|
33
33
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmailElement, useFormGqlMutation } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { Button, FormRow, iconPerson, LayoutTitle } from '@graphcommerce/next-ui'
|
|
3
|
-
import { Trans } from '@lingui/react'
|
|
3
|
+
import { Trans } from '@lingui/react/macro'
|
|
4
4
|
import { Alert, Box, Typography } from '@mui/material'
|
|
5
5
|
import { useRouter } from 'next/router'
|
|
6
6
|
import { ApolloCustomerErrorAlert } from '../ApolloCustomerError'
|
|
@@ -28,25 +28,25 @@ export function ConfirmCustomerForm() {
|
|
|
28
28
|
|
|
29
29
|
const signInButton = (
|
|
30
30
|
<Button variant='text' size='small' href={`/account/signin?email=${submittedVariables?.email}`}>
|
|
31
|
-
<Trans
|
|
31
|
+
<Trans>Sign in</Trans>
|
|
32
32
|
</Button>
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<Box component='form' onSubmit={submitHandler}>
|
|
37
37
|
<LayoutTitle icon={iconPerson}>
|
|
38
|
-
<Trans
|
|
38
|
+
<Trans>Account confirmation</Trans>
|
|
39
39
|
</LayoutTitle>
|
|
40
40
|
|
|
41
41
|
{!key && (
|
|
42
42
|
<Alert severity='error' sx={(theme) => ({ my: theme.spacings.xxs })}>
|
|
43
|
-
<Trans
|
|
43
|
+
<Trans>You can only confirm you account by clicking on the link in your email.</Trans>
|
|
44
44
|
</Alert>
|
|
45
45
|
)}
|
|
46
46
|
{key && (
|
|
47
47
|
<>
|
|
48
48
|
<Typography variant='h6' textAlign='center'>
|
|
49
|
-
<Trans
|
|
49
|
+
<Trans>Fill in your email to confirm registration</Trans>
|
|
50
50
|
</Typography>
|
|
51
51
|
|
|
52
52
|
<FormRow>
|
|
@@ -69,7 +69,7 @@ export function ConfirmCustomerForm() {
|
|
|
69
69
|
size='large'
|
|
70
70
|
disabled={isSubmitSuccessful}
|
|
71
71
|
>
|
|
72
|
-
<Trans
|
|
72
|
+
<Trans>Confirm registration</Trans>
|
|
73
73
|
</Button>
|
|
74
74
|
</FormRow>
|
|
75
75
|
|
|
@@ -85,7 +85,7 @@ export function ConfirmCustomerForm() {
|
|
|
85
85
|
sx={(theme) => ({ my: theme.spacings.xxs })}
|
|
86
86
|
action={signInButton}
|
|
87
87
|
>
|
|
88
|
-
<Trans
|
|
88
|
+
<Trans>Account confirmed. You can now proceed to sign in.</Trans>
|
|
89
89
|
</Alert>
|
|
90
90
|
)}
|
|
91
91
|
</>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from '@graphcommerce/ecommerce-ui'
|
|
7
7
|
import { Button, Form, FormRow, MessageSnackbar } from '@graphcommerce/next-ui'
|
|
8
8
|
import { FormPersist, useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
9
|
-
import { Trans } from '@lingui/macro'
|
|
9
|
+
import { Trans } from '@lingui/react/macro'
|
|
10
10
|
import type { CustomerQuery } from '../../hooks'
|
|
11
11
|
import { CustomerDocument, useCustomerQuery } from '../../hooks'
|
|
12
12
|
import type { ContactUsMutationVariables } from './ContactUsMutation.gql'
|
|
@@ -4,7 +4,7 @@ import type { CountryCodeEnum } from '@graphcommerce/graphql-mesh'
|
|
|
4
4
|
import { CountryRegionsDocument, StoreConfigDocument } from '@graphcommerce/magento-store'
|
|
5
5
|
import { Button, Form, FormActions, FormRow, MessageSnackbar } from '@graphcommerce/next-ui'
|
|
6
6
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
7
|
-
import { Trans } from '@lingui/react'
|
|
7
|
+
import { Trans } from '@lingui/react/macro'
|
|
8
8
|
import { useRouter } from 'next/router'
|
|
9
9
|
import { AddressFields } from '../AddressFields/AddressFields'
|
|
10
10
|
import { CompanyFields } from '../CompanyFields'
|
|
@@ -88,12 +88,12 @@ export function CreateCustomerAddressForm() {
|
|
|
88
88
|
size='large'
|
|
89
89
|
loading={formState.isSubmitting}
|
|
90
90
|
>
|
|
91
|
-
<Trans
|
|
91
|
+
<Trans>Save changes</Trans>
|
|
92
92
|
</Button>
|
|
93
93
|
</FormActions>
|
|
94
94
|
</Form>
|
|
95
95
|
<MessageSnackbar open={Boolean(data) && !error} variant='pill' severity='success'>
|
|
96
|
-
<Trans
|
|
96
|
+
<Trans>Your address has been added</Trans>
|
|
97
97
|
</MessageSnackbar>
|
|
98
98
|
|
|
99
99
|
<ApolloErrorSnackbar error={error} />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
2
|
import { breakpointVal, iconChevronRight, IconSvg, NextLink, sxx } from '@graphcommerce/next-ui'
|
|
3
|
-
import { Trans } from '@lingui/macro'
|
|
3
|
+
import { Trans } from '@lingui/react/macro'
|
|
4
4
|
import type { SxProps, Theme } from '@mui/material'
|
|
5
5
|
import { Box, lighten } from '@mui/material'
|
|
6
6
|
import type { CreditMemoCardFragment } from './CreditMemoCard.gql'
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
extendableComponent,
|
|
5
5
|
SectionContainer,
|
|
6
6
|
} from '@graphcommerce/next-ui'
|
|
7
|
-
import { Trans } from '@lingui/macro'
|
|
7
|
+
import { Trans } from '@lingui/react/macro'
|
|
8
8
|
import type { SxProps, Theme } from '@mui/material'
|
|
9
9
|
import { Box, lighten, Typography } from '@mui/material'
|
|
10
10
|
import type { CreditMemoFragment } from './CreditMemo.gql'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Image } from '@graphcommerce/image'
|
|
2
2
|
import { Money, PriceModifiersList, type PriceModifier } from '@graphcommerce/magento-store'
|
|
3
3
|
import { ActionCard, actionCardImageSizes, type ActionCardProps } from '@graphcommerce/next-ui'
|
|
4
|
-
import { Trans } from '@lingui/react'
|
|
4
|
+
import { Trans } from '@lingui/react/macro'
|
|
5
5
|
import { Box } from '@mui/material'
|
|
6
6
|
import type { CreditMemoItemFragment } from './CreditMemoItem.gql'
|
|
7
7
|
|
|
@@ -111,7 +111,7 @@ export function CreditMemoItem(props: CreditMemoItemProps) {
|
|
|
111
111
|
<>
|
|
112
112
|
{priceModifiers && priceModifiers.length > 0 && (
|
|
113
113
|
<PriceModifiersList
|
|
114
|
-
label={<Trans
|
|
114
|
+
label={<Trans>Base price</Trans>}
|
|
115
115
|
modifiers={[...priceModifiers]}
|
|
116
116
|
total={product_sale_price.value ?? 0}
|
|
117
117
|
currency={product_sale_price.currency}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
nonNullable,
|
|
6
6
|
SectionContainer,
|
|
7
7
|
} from '@graphcommerce/next-ui'
|
|
8
|
-
import { Trans } from '@lingui/macro'
|
|
8
|
+
import { Trans } from '@lingui/react/macro'
|
|
9
9
|
import type { SxProps, Theme } from '@mui/material'
|
|
10
10
|
import { Box } from '@mui/material'
|
|
11
11
|
import type { CreditMemoFragment } from './CreditMemo.gql'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
2
|
import { breakpointVal, extendableComponent, sxx } from '@graphcommerce/next-ui'
|
|
3
|
-
import { Trans } from '@lingui/macro'
|
|
3
|
+
import { Trans } from '@lingui/react/macro'
|
|
4
4
|
import type { SxProps, Theme } from '@mui/material'
|
|
5
5
|
import { Box, Divider, lighten, Typography } from '@mui/material'
|
|
6
6
|
import type { CreditMemoFragment } from './CreditMemo.gql'
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
iconPerson,
|
|
5
5
|
IconSvg,
|
|
6
6
|
} from '@graphcommerce/next-ui'
|
|
7
|
-
import {
|
|
7
|
+
import { t } from '@lingui/core/macro'
|
|
8
8
|
import type { BadgeProps, FabProps as FabPropsType, SxProps, Theme } from '@mui/material'
|
|
9
9
|
import { Fab } from '@mui/material'
|
|
10
10
|
import React from 'react'
|
|
@@ -33,7 +33,7 @@ function CustomerFabContent(props: CustomerFabContentProps) {
|
|
|
33
33
|
href={session?.loggedIn ? authHref : guestHref}
|
|
34
34
|
color='inherit'
|
|
35
35
|
id='account'
|
|
36
|
-
aria-label={
|
|
36
|
+
aria-label={t`Account`}
|
|
37
37
|
size='large'
|
|
38
38
|
className={classes.root}
|
|
39
39
|
{...FabProps}
|
|
@@ -3,7 +3,7 @@ import type { CustomAttributeMetadata } from '@graphcommerce/magento-store'
|
|
|
3
3
|
import type { ActionCardProps } from '@graphcommerce/next-ui'
|
|
4
4
|
import { ActionCard, filterNonNullableKeys, sxx } from '@graphcommerce/next-ui'
|
|
5
5
|
import type { Control, FieldPath, FieldValues } from '@graphcommerce/react-hook-form'
|
|
6
|
-
import { t } from '@lingui/macro'
|
|
6
|
+
import { t } from '@lingui/core/macro'
|
|
7
7
|
import { MenuItem, type SxProps, type Theme } from '@mui/material'
|
|
8
8
|
import {
|
|
9
9
|
customerAttributeInputType,
|
|
@@ -54,7 +54,7 @@ export function CustomerAttributeField<TFieldValues extends FieldValues = FieldV
|
|
|
54
54
|
shrink: frontendInput === 'DATE' || frontendInput === 'DATETIME',
|
|
55
55
|
}}
|
|
56
56
|
disabled={disabled}
|
|
57
|
-
helperText={is_unique ? t`${label} must be unique` : helperText}
|
|
57
|
+
helperText={is_unique && label ? t`${label} must be unique` : helperText}
|
|
58
58
|
sx={sxx(sx, { gridArea })}
|
|
59
59
|
data-field={gridArea}
|
|
60
60
|
>
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type AttributeFormAutoLayoutProps,
|
|
5
5
|
} from '@graphcommerce/magento-store'
|
|
6
6
|
import { Button, FormActions, type ButtonProps } from '@graphcommerce/next-ui'
|
|
7
|
-
import { Trans } from '@lingui/react'
|
|
7
|
+
import { Trans } from '@lingui/react/macro'
|
|
8
8
|
import { styled } from '@mui/material'
|
|
9
9
|
import type { ComponentProps } from 'react'
|
|
10
10
|
import { CustomerAttributeField } from './CustomerAttributeField'
|
|
@@ -56,7 +56,7 @@ export function CustomerUpdateForm(props: CustomerUpdateFormProps) {
|
|
|
56
56
|
loading={formState.isSubmitting}
|
|
57
57
|
{...slotProps?.button}
|
|
58
58
|
>
|
|
59
|
-
<Trans
|
|
59
|
+
<Trans>Save changes</Trans>
|
|
60
60
|
</Button>
|
|
61
61
|
</FormActions>
|
|
62
62
|
<ApolloErrorSnackbar error={error} />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CustomAttributeMetadata } from '@graphcommerce/magento-store'
|
|
2
2
|
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
|
3
3
|
import type { ControllerProps, FieldPath, FieldValues } from '@graphcommerce/react-hook-form'
|
|
4
|
-
import { t } from '@lingui/macro'
|
|
4
|
+
import { t } from '@lingui/core/macro'
|
|
5
5
|
import type { HTMLInputTypeAttribute } from 'react'
|
|
6
6
|
|
|
7
7
|
export type InputValidationValue =
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type AttributeFormAutoLayoutFieldset,
|
|
4
4
|
type CustomAttributeMetadata,
|
|
5
5
|
} from '@graphcommerce/magento-store'
|
|
6
|
-
import { Trans } from '@lingui/macro'
|
|
6
|
+
import { Trans } from '@lingui/react/macro'
|
|
7
7
|
|
|
8
8
|
export function nameFieldset(
|
|
9
9
|
attributes: CustomAttributeMetadata[],
|
|
@@ -20,7 +20,7 @@ export function nameFieldset(
|
|
|
20
20
|
const additional = extractAttributes(attributes, ['dob', 'gender'])[0].map((f) => f.code)
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
|
-
label: withLabel ? <Trans
|
|
23
|
+
label: withLabel ? <Trans>Name</Trans> : undefined,
|
|
24
24
|
gridAreas: [...nameFields, ...additional],
|
|
25
25
|
// xs is shown in one column by default
|
|
26
26
|
sx: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApolloErrorSnackbar } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
3
|
-
import { Trans } from '@lingui/react'
|
|
3
|
+
import { Trans } from '@lingui/react/macro'
|
|
4
4
|
import { Button } from '@mui/material'
|
|
5
5
|
import { DeleteCustomerAddressFormDocument } from './DeleteCustomerAddressForm.gql'
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ export function DeleteCustomerAddressForm(props: DeleteCustomerAddressFormProps)
|
|
|
22
22
|
return (
|
|
23
23
|
<form onSubmit={submitHandler} noValidate>
|
|
24
24
|
<Button type='submit' variant='text' color='primary'>
|
|
25
|
-
<Trans
|
|
25
|
+
<Trans>Delete this address</Trans>
|
|
26
26
|
</Button>
|
|
27
27
|
<ApolloErrorSnackbar error={error} />
|
|
28
28
|
</form>
|
|
@@ -3,7 +3,7 @@ import { useQuery } from '@graphcommerce/graphql'
|
|
|
3
3
|
import { CountryRegionsDocument } from '@graphcommerce/magento-store'
|
|
4
4
|
import { Button, Form, FormActions, FormRow } from '@graphcommerce/next-ui'
|
|
5
5
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
6
|
-
import { Trans } from '@lingui/react'
|
|
6
|
+
import { Trans } from '@lingui/react/macro'
|
|
7
7
|
import type { SxProps, Theme } from '@mui/material'
|
|
8
8
|
import { useRouter } from 'next/router'
|
|
9
9
|
import type { AccountAddressFragment } from '../AccountAddress/AccountAddress.gql'
|
|
@@ -105,7 +105,7 @@ export function EditAddressForm(props: EditAddressFormProps) {
|
|
|
105
105
|
size='large'
|
|
106
106
|
loading={formState.isSubmitting}
|
|
107
107
|
>
|
|
108
|
-
<Trans
|
|
108
|
+
<Trans>Save changes</Trans>
|
|
109
109
|
</Button>
|
|
110
110
|
</FormActions>
|
|
111
111
|
</Form>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TextFieldElement } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { Button, Form, FormActions, FormRow } from '@graphcommerce/next-ui'
|
|
3
3
|
import { emailPattern, useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
4
|
-
import {
|
|
5
|
-
import { Trans } from '@lingui/react'
|
|
4
|
+
import { t } from '@lingui/core/macro'
|
|
5
|
+
import { Trans } from '@lingui/react/macro'
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
7
7
|
import type { SxProps, Theme } from '@mui/material'
|
|
8
8
|
import { Alert } from '@mui/material'
|
|
@@ -32,7 +32,7 @@ export function ForgotPasswordForm(props: ForgotPasswordFormProps) {
|
|
|
32
32
|
marginBottom: theme.spacings.sm,
|
|
33
33
|
})}
|
|
34
34
|
>
|
|
35
|
-
<Trans
|
|
35
|
+
<Trans>We’ve send a password reset link to your email address!</Trans>
|
|
36
36
|
</Alert>
|
|
37
37
|
)
|
|
38
38
|
}
|
|
@@ -44,12 +44,12 @@ export function ForgotPasswordForm(props: ForgotPasswordFormProps) {
|
|
|
44
44
|
variant='outlined'
|
|
45
45
|
type='text'
|
|
46
46
|
error={!!formState.errors.email}
|
|
47
|
-
label={<Trans
|
|
47
|
+
label={<Trans>Email</Trans>}
|
|
48
48
|
required={required.email}
|
|
49
49
|
name='email'
|
|
50
50
|
control={control}
|
|
51
51
|
rules={{
|
|
52
|
-
pattern: { value: emailPattern, message:
|
|
52
|
+
pattern: { value: emailPattern, message: t`Invalid email address` },
|
|
53
53
|
}}
|
|
54
54
|
helperText={formState.errors.email?.message}
|
|
55
55
|
disabled={formState.isSubmitting}
|
|
@@ -68,7 +68,7 @@ export function ForgotPasswordForm(props: ForgotPasswordFormProps) {
|
|
|
68
68
|
size='large'
|
|
69
69
|
{...buttonProps}
|
|
70
70
|
>
|
|
71
|
-
<Trans
|
|
71
|
+
<Trans>Send password reset email</Trans>
|
|
72
72
|
</Button>
|
|
73
73
|
</FormActions>
|
|
74
74
|
</Form>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
query GuestOrder($
|
|
2
|
-
guestOrder(input:
|
|
1
|
+
query GuestOrder($input: OrderInformationInput!) {
|
|
2
|
+
guestOrder(input: $input) {
|
|
3
3
|
...OrderDetails
|
|
4
4
|
...OrderItems
|
|
5
5
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
useUrlQuery,
|
|
10
10
|
} from '@graphcommerce/next-ui'
|
|
11
11
|
import { useFormGqlQuery } from '@graphcommerce/react-hook-form'
|
|
12
|
-
import { Trans } from '@lingui/macro'
|
|
12
|
+
import { Trans } from '@lingui/react/macro'
|
|
13
13
|
import { Box, Typography } from '@mui/material'
|
|
14
14
|
import { useMemo } from 'react'
|
|
15
15
|
import { ApolloCustomerErrorAlert } from '../ApolloCustomerError'
|
|
@@ -18,16 +18,16 @@ import type { GuestOrderQueryVariables } from './GuestOrder.gql'
|
|
|
18
18
|
import { GuestOrderDocument } from './GuestOrder.gql'
|
|
19
19
|
|
|
20
20
|
export function GuestOrderOverviewForm() {
|
|
21
|
-
const [urlQuery, setUrlQuery] = useUrlQuery<Partial<GuestOrderQueryVariables>>(true)
|
|
21
|
+
const [urlQuery, setUrlQuery] = useUrlQuery<Partial<GuestOrderQueryVariables['input']>>(true)
|
|
22
22
|
|
|
23
23
|
const form = useFormGqlQuery(GuestOrderDocument, {
|
|
24
|
-
defaultValues: urlQuery,
|
|
24
|
+
defaultValues: { input: urlQuery },
|
|
25
25
|
onBeforeSubmit: (variables) => {
|
|
26
|
-
variables.
|
|
26
|
+
variables.input.number = variables.input.number.replace(/^#/, '')
|
|
27
27
|
return variables
|
|
28
28
|
},
|
|
29
29
|
onComplete: async (data, variables) => {
|
|
30
|
-
await setUrlQuery(variables)
|
|
30
|
+
await setUrlQuery(variables.input)
|
|
31
31
|
},
|
|
32
32
|
})
|
|
33
33
|
|
|
@@ -57,17 +57,17 @@ export function GuestOrderOverviewForm() {
|
|
|
57
57
|
<FormRow>
|
|
58
58
|
<TextFieldElement
|
|
59
59
|
control={control}
|
|
60
|
-
name='
|
|
61
|
-
required
|
|
60
|
+
name='input.number'
|
|
61
|
+
required
|
|
62
62
|
label={<Trans>Order number</Trans>}
|
|
63
63
|
/>
|
|
64
64
|
</FormRow>
|
|
65
65
|
<FormRow>
|
|
66
|
-
<EmailElement control={control} name='email' required
|
|
66
|
+
<EmailElement control={control} name='input.email' required />
|
|
67
67
|
<TextFieldElement
|
|
68
68
|
control={control}
|
|
69
|
-
name='postcode'
|
|
70
|
-
required
|
|
69
|
+
name='input.postcode'
|
|
70
|
+
required
|
|
71
71
|
label={<Trans>Postcode</Trans>}
|
|
72
72
|
autoComplete='postal_code'
|
|
73
73
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
2
|
import { breakpointVal, iconChevronRight, IconSvg, NextLink, sxx } from '@graphcommerce/next-ui'
|
|
3
|
-
import { Trans } from '@lingui/macro'
|
|
3
|
+
import { Trans } from '@lingui/react/macro'
|
|
4
4
|
import type { SxProps, Theme } from '@mui/material'
|
|
5
5
|
import { Box, lighten } from '@mui/material'
|
|
6
6
|
import type { InvoiceCardFragment } from './InvoiceCard.gql'
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
extendableComponent,
|
|
5
5
|
SectionContainer,
|
|
6
6
|
} from '@graphcommerce/next-ui'
|
|
7
|
-
import { Trans } from '@lingui/macro'
|
|
7
|
+
import { Trans } from '@lingui/react/macro'
|
|
8
8
|
import type { SxProps, Theme } from '@mui/material'
|
|
9
9
|
import { Box, lighten, Typography } from '@mui/material'
|
|
10
10
|
import type { InvoiceFragment } from './Invoice.gql'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Image } from '@graphcommerce/image'
|
|
2
2
|
import { Money, PriceModifiersList, type PriceModifier } from '@graphcommerce/magento-store'
|
|
3
3
|
import { ActionCard, actionCardImageSizes, type ActionCardProps } from '@graphcommerce/next-ui'
|
|
4
|
-
import { Trans } from '@lingui/react'
|
|
4
|
+
import { Trans } from '@lingui/react/macro'
|
|
5
5
|
import { Box } from '@mui/material'
|
|
6
6
|
import type { InvoiceItemFragment } from './InvoiceItem.gql'
|
|
7
7
|
|
|
@@ -111,7 +111,7 @@ export function InvoiceItem(props: InvoiceItemProps) {
|
|
|
111
111
|
<>
|
|
112
112
|
{priceModifiers && priceModifiers.length > 0 && (
|
|
113
113
|
<PriceModifiersList
|
|
114
|
-
label={<Trans
|
|
114
|
+
label={<Trans>Base price</Trans>}
|
|
115
115
|
modifiers={[...priceModifiers]}
|
|
116
116
|
total={product_sale_price.value ?? 0}
|
|
117
117
|
currency={product_sale_price.currency}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
nonNullable,
|
|
6
6
|
SectionContainer,
|
|
7
7
|
} from '@graphcommerce/next-ui'
|
|
8
|
-
import { Trans } from '@lingui/macro'
|
|
8
|
+
import { Trans } from '@lingui/react/macro'
|
|
9
9
|
import type { SxProps, Theme } from '@mui/material'
|
|
10
10
|
import { Box } from '@mui/material'
|
|
11
11
|
import type { InvoiceFragment } from './Invoice.gql'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
2
|
import { breakpointVal, extendableComponent, sxx } from '@graphcommerce/next-ui'
|
|
3
|
-
import { Trans } from '@lingui/macro'
|
|
3
|
+
import { Trans } from '@lingui/react/macro'
|
|
4
4
|
import type { SxProps, Theme } from '@mui/material'
|
|
5
5
|
import { Box, Divider, lighten, Typography } from '@mui/material'
|
|
6
6
|
import type { InvoiceFragment } from './Invoice.gql'
|
|
@@ -7,8 +7,8 @@ import type {
|
|
|
7
7
|
UseFormReturn,
|
|
8
8
|
} from '@graphcommerce/react-hook-form'
|
|
9
9
|
import { assertFormGqlOperation } from '@graphcommerce/react-hook-form'
|
|
10
|
-
import {
|
|
11
|
-
import { Trans } from '@lingui/react'
|
|
10
|
+
import { t } from '@lingui/core/macro'
|
|
11
|
+
import { Trans } from '@lingui/react/macro'
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
14
14
|
|
|
@@ -27,9 +27,9 @@ export type NameFieldProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
|
27
27
|
export function NameFields<TFieldValues extends FieldValues = FieldValues>(
|
|
28
28
|
props: NameFieldProps<TFieldValues>,
|
|
29
29
|
) {
|
|
30
|
-
const mr =
|
|
31
|
-
const mrs =
|
|
32
|
-
const other =
|
|
30
|
+
const mr = t`Mr`
|
|
31
|
+
const mrs = t`Mrs`
|
|
32
|
+
const other = t`Other`
|
|
33
33
|
|
|
34
34
|
const {
|
|
35
35
|
form,
|
|
@@ -56,7 +56,7 @@ export function NameFields<TFieldValues extends FieldValues = FieldValues>(
|
|
|
56
56
|
control={control}
|
|
57
57
|
required={required.prefix}
|
|
58
58
|
name={names.prefix}
|
|
59
|
-
label={<Trans
|
|
59
|
+
label={<Trans>Prefix</Trans>}
|
|
60
60
|
showValid
|
|
61
61
|
InputProps={{ readOnly }}
|
|
62
62
|
options={prefixes.map((option) => ({ id: option, label: option }))}
|
|
@@ -70,7 +70,7 @@ export function NameFields<TFieldValues extends FieldValues = FieldValues>(
|
|
|
70
70
|
required={required.firstname}
|
|
71
71
|
variant='outlined'
|
|
72
72
|
type='text'
|
|
73
|
-
label={<Trans
|
|
73
|
+
label={<Trans>First Name</Trans>}
|
|
74
74
|
InputProps={{ readOnly }}
|
|
75
75
|
showValid
|
|
76
76
|
/>
|
|
@@ -80,7 +80,7 @@ export function NameFields<TFieldValues extends FieldValues = FieldValues>(
|
|
|
80
80
|
required={required.lastname}
|
|
81
81
|
variant='outlined'
|
|
82
82
|
type='text'
|
|
83
|
-
label={<Trans
|
|
83
|
+
label={<Trans>Last Name</Trans>}
|
|
84
84
|
InputProps={{ readOnly }}
|
|
85
85
|
showValid
|
|
86
86
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extendableComponent, iconBox, IconHeader } from '@graphcommerce/next-ui'
|
|
2
|
-
import { Trans } from '@lingui/react'
|
|
2
|
+
import { Trans } from '@lingui/react/macro'
|
|
3
3
|
import type { SxProps, Theme } from '@mui/material'
|
|
4
4
|
import { Box } from '@mui/material'
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export function NoOrdersFound(props: NoOrdersFoundProps) {
|
|
|
16
16
|
sx={[(theme) => ({ marginTop: theme.spacings.sm }), ...(Array.isArray(sx) ? sx : [sx])]}
|
|
17
17
|
>
|
|
18
18
|
<IconHeader src={iconBox} size='small'>
|
|
19
|
-
<Trans
|
|
19
|
+
<Trans>No orders found</Trans>
|
|
20
20
|
</IconHeader>
|
|
21
21
|
</Box>
|
|
22
22
|
)
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
NextLink,
|
|
11
11
|
sxx,
|
|
12
12
|
} from '@graphcommerce/next-ui'
|
|
13
|
-
import { Trans } from '@lingui/macro'
|
|
13
|
+
import { Trans } from '@lingui/react/macro'
|
|
14
14
|
import type { SxProps, Theme } from '@mui/material'
|
|
15
15
|
import { Avatar, Box, lighten, Paper, Skeleton } from '@mui/material'
|
|
16
16
|
import { OrderStateLabel } from '../OrderStateLabel/OrderStateLabel'
|
|
@@ -140,11 +140,11 @@ export function OrderCard(props: OrderCardProps) {
|
|
|
140
140
|
</Box>
|
|
141
141
|
<Box sx={{ typography: 'body1', color: 'text.secondary' }}>#{number}</Box>
|
|
142
142
|
<Box>
|
|
143
|
-
<Trans
|
|
143
|
+
<Trans>Grand Total</Trans>: <Money {...total?.grand_total} />
|
|
144
144
|
</Box>
|
|
145
145
|
|
|
146
146
|
<Box>
|
|
147
|
-
<Trans
|
|
147
|
+
<Trans>Status</Trans>:{' '}
|
|
148
148
|
<OrderStateLabel {...props} status={status} sx={{ typography: 'body1' }} short />
|
|
149
149
|
</Box>
|
|
150
150
|
</Box>
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
extendableComponent,
|
|
5
5
|
SectionContainer,
|
|
6
6
|
} from '@graphcommerce/next-ui'
|
|
7
|
-
import { Trans } from '@lingui/macro'
|
|
7
|
+
import { Trans } from '@lingui/react/macro'
|
|
8
8
|
import type { SxProps, Theme } from '@mui/material'
|
|
9
9
|
import { Box, lighten, Typography } from '@mui/material'
|
|
10
10
|
import { AddressMultiLine } from '../../AddressMultiLine/AddressMultiLine'
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
filterNonNullableKeys,
|
|
7
7
|
type ActionCardProps,
|
|
8
8
|
} from '@graphcommerce/next-ui'
|
|
9
|
-
import { Trans } from '@lingui/react'
|
|
9
|
+
import { Trans } from '@lingui/react/macro'
|
|
10
10
|
import { Box } from '@mui/material'
|
|
11
11
|
import type { OrderItemFragment } from './OrderItem.gql'
|
|
12
12
|
|
|
@@ -130,7 +130,7 @@ export function OrderItem(props: OrderItemProps) {
|
|
|
130
130
|
<>
|
|
131
131
|
{priceModifiers && priceModifiers.length > 0 && (
|
|
132
132
|
<PriceModifiersList
|
|
133
|
-
label={<Trans
|
|
133
|
+
label={<Trans>Base price</Trans>}
|
|
134
134
|
modifiers={priceModifiers}
|
|
135
135
|
total={product_sale_price.value ?? 0}
|
|
136
136
|
currency={product_sale_price.currency}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
nonNullable,
|
|
6
6
|
SectionContainer,
|
|
7
7
|
} from '@graphcommerce/next-ui'
|
|
8
|
-
import { Trans } from '@lingui/react'
|
|
8
|
+
import { Trans } from '@lingui/react/macro'
|
|
9
9
|
import type { SxProps, Theme } from '@mui/material'
|
|
10
10
|
import { Box } from '@mui/material'
|
|
11
11
|
import type { OrderItemProps } from '../OrderItem/OrderItem'
|
|
@@ -50,7 +50,7 @@ export function OrderItems(props: OrderItemsProps) {
|
|
|
50
50
|
>
|
|
51
51
|
<SectionContainer
|
|
52
52
|
sx={{ '& .SectionHeader-root': { mt: 0 } }}
|
|
53
|
-
labelLeft={<Trans
|
|
53
|
+
labelLeft={<Trans>Ordered items</Trans>}
|
|
54
54
|
variantLeft='h6'
|
|
55
55
|
className={classes.items}
|
|
56
56
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extendableComponent } from '@graphcommerce/next-ui'
|
|
2
|
-
import { Trans } from '@lingui/macro'
|
|
2
|
+
import { Trans } from '@lingui/react/macro'
|
|
3
3
|
import type { SxProps, Theme } from '@mui/material'
|
|
4
4
|
import { Box } from '@mui/material'
|
|
5
5
|
import type { OrderState, OrderStateProps } from '../../../utils'
|