@graphcommerce/magento-customer 3.6.3 → 3.6.7
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/components/AccountAddresses/index.tsx +11 -13
- package/components/AddressFields/index.tsx +1 -0
- package/components/AddressMultiLine/index.tsx +2 -12
- package/components/ApolloCustomerError/ApolloCustomerErrorAlert.tsx +5 -7
- package/components/ChangeNameForm/index.tsx +1 -9
- package/components/SignInForm/SignInForm.tsx +4 -4
- package/components/SignInForm/SignInFormInline.tsx +2 -2
- package/components/SignUpForm/SignUpForm.tsx +1 -1
- package/components/SignUpForm/SignUpFormInline.tsx +1 -1
- package/link/createAuthLink.ts +3 -5
- package/package.json +9 -9
- package/typePolicies.ts +2 -8
|
@@ -63,19 +63,17 @@ export default function AccountAddresses(props: AccountAddressesProps) {
|
|
|
63
63
|
return (
|
|
64
64
|
<>
|
|
65
65
|
{((addresses && addresses.length === 0) || !addresses) && (
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/>
|
|
78
|
-
</>
|
|
66
|
+
<FullPageMessage
|
|
67
|
+
title={<Trans>You have no addresses saved yet</Trans>}
|
|
68
|
+
icon={<SvgImageSimple src={iconHome} size='xxl' />}
|
|
69
|
+
button={
|
|
70
|
+
<Link href='/account/addresses/add' passHref>
|
|
71
|
+
<Button size='large' variant='contained' color='primary'>
|
|
72
|
+
<Trans>Add new address</Trans>
|
|
73
|
+
</Button>
|
|
74
|
+
</Link>
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
79
77
|
)}
|
|
80
78
|
|
|
81
79
|
{addresses && addresses.length >= 1 && (
|
|
@@ -173,6 +173,7 @@ export default function AddressFields(props: AddressFieldsProps) {
|
|
|
173
173
|
endAdornment: <InputCheckmark show={valid.regionId} select />,
|
|
174
174
|
}}
|
|
175
175
|
>
|
|
176
|
+
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
|
|
176
177
|
<option value='' />
|
|
177
178
|
{regionList.map((r) => {
|
|
178
179
|
if (!r?.id) return null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useFindCountry } from '@graphcommerce/magento-store'
|
|
2
2
|
import { UseStyles } from '@graphcommerce/next-ui'
|
|
3
|
-
import { makeStyles,
|
|
3
|
+
import { makeStyles, Typography } from '@material-ui/core'
|
|
4
4
|
import { CustomerAddressFragment } from '../CreateCustomerAddressForm/CustomerAddress.gql'
|
|
5
5
|
|
|
6
6
|
// exports.getEuMembers = function()
|
|
@@ -12,17 +12,7 @@ import { CustomerAddressFragment } from '../CreateCustomerAddressForm/CustomerAd
|
|
|
12
12
|
// return exports.getEuMembers().indexOf(code.toUpperCase()) != -1;
|
|
13
13
|
// };
|
|
14
14
|
|
|
15
|
-
const useStyles = makeStyles(
|
|
16
|
-
(theme: Theme) => ({
|
|
17
|
-
title: {
|
|
18
|
-
// fontWeight: 'bold',
|
|
19
|
-
// paddingBottom: theme.spacings.xxs,
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
{
|
|
23
|
-
name: 'AddressMultiLine',
|
|
24
|
-
},
|
|
25
|
-
)
|
|
15
|
+
const useStyles = makeStyles({ title: {} }, { name: 'AddressMultiLine' })
|
|
26
16
|
|
|
27
17
|
type AddressMultiLineProps = CustomerAddressFragment & UseStyles<typeof useStyles>
|
|
28
18
|
|
|
@@ -11,13 +11,11 @@ export default function ApolloCustomerErrorAlert(props: MagentoErrorAlertProps)
|
|
|
11
11
|
const { error, unauthorized } = useExtractCustomerErrors(props)
|
|
12
12
|
|
|
13
13
|
const action = unauthorized && (
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</NextLink>
|
|
20
|
-
</>
|
|
14
|
+
<NextLink href='/account/signin' passHref>
|
|
15
|
+
<Link>
|
|
16
|
+
<Trans>Create Account</Trans> / <Trans>Sign In</Trans>
|
|
17
|
+
</Link>
|
|
18
|
+
</NextLink>
|
|
21
19
|
)
|
|
22
20
|
|
|
23
21
|
return <ApolloErrorAlert error={error} graphqlErrorAlertProps={{ action }} />
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button,
|
|
3
|
-
Form,
|
|
4
|
-
FormActions,
|
|
5
|
-
FormDivider,
|
|
6
|
-
MessageSnackbar,
|
|
7
|
-
iconCheckmark,
|
|
8
|
-
SvgImageSimple,
|
|
9
|
-
} from '@graphcommerce/next-ui'
|
|
1
|
+
import { Button, Form, FormActions, FormDivider, MessageSnackbar } from '@graphcommerce/next-ui'
|
|
10
2
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
11
3
|
import { Trans } from '@lingui/macro'
|
|
12
4
|
import React from 'react'
|
|
@@ -2,8 +2,8 @@ import { useQuery } from '@apollo/client'
|
|
|
2
2
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
3
3
|
import { FormRow, Button, FormActions } from '@graphcommerce/next-ui'
|
|
4
4
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
5
|
-
import {
|
|
6
|
-
import { FormControl, Link, makeStyles, TextField
|
|
5
|
+
import { Trans } from '@lingui/macro'
|
|
6
|
+
import { FormControl, Link, makeStyles, TextField } from '@material-ui/core'
|
|
7
7
|
import { Alert } from '@material-ui/lab'
|
|
8
8
|
import PageLink from 'next/link'
|
|
9
9
|
import React from 'react'
|
|
@@ -12,11 +12,11 @@ import ApolloCustomerErrorAlert from '../ApolloCustomerError/ApolloCustomerError
|
|
|
12
12
|
import { SignInDocument } from './SignIn.gql'
|
|
13
13
|
|
|
14
14
|
const useStyles = makeStyles(
|
|
15
|
-
|
|
15
|
+
{
|
|
16
16
|
forgotPass: {
|
|
17
17
|
whiteSpace: 'nowrap',
|
|
18
18
|
},
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
20
|
{ name: 'SignIn' },
|
|
21
21
|
)
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button
|
|
1
|
+
import { Button } from '@graphcommerce/next-ui'
|
|
2
2
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
3
|
-
import {
|
|
3
|
+
import { Trans } from '@lingui/macro'
|
|
4
4
|
import { makeStyles, TextField, Theme } from '@material-ui/core'
|
|
5
5
|
import PageLink from 'next/link'
|
|
6
6
|
import React, { PropsWithChildren } from 'react'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
2
2
|
import { Button, FormActions, FormRow } from '@graphcommerce/next-ui'
|
|
3
3
|
import { useFormGqlMutation, useFormPersist } from '@graphcommerce/react-hook-form'
|
|
4
|
-
import {
|
|
4
|
+
import { Trans } from '@lingui/macro'
|
|
5
5
|
import { FormControlLabel, Switch, TextField } from '@material-ui/core'
|
|
6
6
|
import React from 'react'
|
|
7
7
|
import ApolloCustomerErrorAlert from '../ApolloCustomerError/ApolloCustomerErrorAlert'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button, Form, FormRow } from '@graphcommerce/next-ui'
|
|
2
2
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
3
|
-
import {
|
|
3
|
+
import { Trans } from '@lingui/macro'
|
|
4
4
|
import { makeStyles, TextField, Theme } from '@material-ui/core'
|
|
5
5
|
import React, { PropsWithChildren } from 'react'
|
|
6
6
|
import { SignUpMutationVariables, SignUpMutation, SignUpDocument } from './SignUp.gql'
|
package/link/createAuthLink.ts
CHANGED
|
@@ -2,19 +2,17 @@ import { ApolloCache, NormalizedCacheObject } from '@apollo/client'
|
|
|
2
2
|
import { setContext } from '@apollo/client/link/context'
|
|
3
3
|
import { CustomerTokenDocument } from '../hooks/CustomerToken.gql'
|
|
4
4
|
|
|
5
|
-
export const createAuthLink = (cache: ApolloCache<NormalizedCacheObject>) =>
|
|
6
|
-
|
|
5
|
+
export const createAuthLink = (cache: ApolloCache<NormalizedCacheObject>) =>
|
|
6
|
+
setContext((_, context) => {
|
|
7
7
|
if (!context.headers) context.headers = {}
|
|
8
8
|
try {
|
|
9
9
|
const query = cache.readQuery({ query: CustomerTokenDocument })
|
|
10
10
|
if (query?.customerToken?.token) {
|
|
11
11
|
context.headers.authorization = `Bearer ${query?.customerToken?.token}`
|
|
12
12
|
return context
|
|
13
|
-
} else {
|
|
14
|
-
return context
|
|
15
13
|
}
|
|
14
|
+
return context
|
|
16
15
|
} catch (error) {
|
|
17
16
|
return context
|
|
18
17
|
}
|
|
19
18
|
})
|
|
20
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-customer",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.7",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.6",
|
|
18
18
|
"@graphcommerce/prettier-config-pwa": "^3.0.4",
|
|
19
19
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
20
20
|
"@playwright/test": "^1.16.2"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apollo/client": "^3.4.16",
|
|
24
|
-
"@graphcommerce/graphql": "^2.105.
|
|
25
|
-
"@graphcommerce/image": "^2.105.
|
|
26
|
-
"@graphcommerce/magento-graphql": "^2.104.
|
|
27
|
-
"@graphcommerce/magento-store": "^3.3.
|
|
28
|
-
"@graphcommerce/next-ui": "^3.
|
|
29
|
-
"@graphcommerce/react-hook-form": "^2.104.
|
|
24
|
+
"@graphcommerce/graphql": "^2.105.6",
|
|
25
|
+
"@graphcommerce/image": "^2.105.5",
|
|
26
|
+
"@graphcommerce/magento-graphql": "^2.104.6",
|
|
27
|
+
"@graphcommerce/magento-store": "^3.3.7",
|
|
28
|
+
"@graphcommerce/next-ui": "^3.20.0",
|
|
29
|
+
"@graphcommerce/react-hook-form": "^2.104.1",
|
|
30
30
|
"@lingui/macro": "^3.12.1",
|
|
31
31
|
"@material-ui/core": "^4.12.3",
|
|
32
32
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"react": "^17.0.2",
|
|
37
37
|
"react-dom": "^17.0.2"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8f156415c7f5a963e363f0d6d18fe5d6bbd5dba2"
|
|
40
40
|
}
|
package/typePolicies.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { FieldPolicy
|
|
2
|
-
import {
|
|
3
|
-
CustomerToken,
|
|
4
|
-
MigrateCache,
|
|
5
|
-
Mutation,
|
|
6
|
-
Query,
|
|
7
|
-
TypedTypePolicies,
|
|
8
|
-
} from '@graphcommerce/graphql'
|
|
1
|
+
import { FieldPolicy } from '@apollo/client'
|
|
2
|
+
import { CustomerToken, MigrateCache, Mutation, TypedTypePolicies } from '@graphcommerce/graphql'
|
|
9
3
|
import { CustomerTokenDocument } from './hooks/CustomerToken.gql'
|
|
10
4
|
import { IsEmailAvailableDocument } from './hooks/IsEmailAvailable.gql'
|
|
11
5
|
|