@graphcommerce/mollie-magento-payment 8.1.0-canary.3 → 8.1.0-canary.6

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 CHANGED
@@ -1,8 +1,65 @@
1
1
  # Change Log
2
2
 
3
- ## 8.1.0-canary.3
3
+ ## 8.1.0-canary.6
4
4
 
5
- ## 8.1.0-canary.2
5
+ ## 8.1.0-canary.5
6
+
7
+ ## 8.0.6-canary.4
8
+
9
+ ## 8.0.6-canary.3
10
+
11
+ ## 8.0.6-canary.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`530076e`](https://github.com/graphcommerce-org/graphcommerce/commit/530076e3664703cb8b577b7fcf1998a420819f60) - Moved all usages of useFormPersist to the <FormPersist/> component to prevent rerenders.
16
+ ([@FrankHarland](https://github.com/FrankHarland))
17
+
18
+ ## 8.0.6-canary.1
19
+
20
+ ## 8.0.6-canary.0
21
+
22
+ ## 8.0.5
23
+
24
+ ## 8.0.5-canary.10
25
+
26
+ ## 8.0.5-canary.9
27
+
28
+ ## 8.0.5-canary.8
29
+
30
+ ## 8.0.5-canary.7
31
+
32
+ ## 8.0.5-canary.6
33
+
34
+ ## 8.0.5-canary.5
35
+
36
+ ## 8.0.5-canary.4
37
+
38
+ ## 8.0.5-canary.3
39
+
40
+ ## 8.0.5-canary.2
41
+
42
+ ## 8.0.5-canary.1
43
+
44
+ ## 8.0.5-canary.0
45
+
46
+ ## 8.0.4
47
+
48
+ ## 8.0.4-canary.1
49
+
50
+ ## 8.0.4-canary.0
51
+
52
+ ## 8.0.3
53
+
54
+ ## 8.0.3-canary.6
55
+
56
+ ## 8.0.3-canary.5
57
+
58
+ ## 8.0.3-canary.4
59
+
60
+ ## 8.0.3-canary.3
61
+
62
+ ## 8.0.3-canary.2
6
63
 
7
64
  ## 8.0.3-canary.1
8
65
 
@@ -1,8 +1,8 @@
1
1
  import { SelectElement } from '@graphcommerce/ecommerce-ui'
2
2
  import { useFormGqlMutationCart } from '@graphcommerce/magento-cart'
3
3
  import { PaymentOptionsProps } from '@graphcommerce/magento-cart-payment-method'
4
- import { FormRow, InputCheckmark, filterNonNullableKeys } from '@graphcommerce/next-ui'
5
- import { useFormCompose, useFormPersist, useFormValidFields } from '@graphcommerce/react-hook-form'
4
+ import { FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui'
5
+ import { FormPersist, useFormCompose } from '@graphcommerce/react-hook-form'
6
6
  import { SetMolliePaymentMethodIssuerOnCartDocument } from './SetMolliePaymentMethodIssuerOnCart.gql'
7
7
 
8
8
  type MollieIssuerOptionsProps = PaymentOptionsProps & {
@@ -20,20 +20,19 @@ export function MollieIssuerOptions(props: MollieIssuerOptionsProps) {
20
20
 
21
21
  const { handleSubmit, formState, required, control } = form
22
22
  const submit = handleSubmit(() => {})
23
- const valid = useFormValidFields(form, required)
24
23
 
25
- // Since the issuer isn't retrievable from Magento we persist this value.
26
- useFormPersist({
27
- form,
28
- name: `PaymentMethodOptions_${code}`,
29
- persist: ['issuer'],
30
- storage: 'localStorage',
31
- })
32
24
  useFormCompose({ form, step, submit, key: `PaymentMethodOptions_${code}` })
33
25
 
34
26
  return (
35
27
  <>
36
28
  <form onSubmit={submit} noValidate>
29
+ <FormPersist
30
+ // Since the issuer isn't retrievable from Magento we persist this value.
31
+ form={form}
32
+ name={`PaymentMethodOptions_${code}`}
33
+ persist={['issuer']}
34
+ storage='localStorage'
35
+ />
37
36
  <FormRow>
38
37
  <SelectElement
39
38
  control={control}
@@ -43,9 +42,7 @@ export function MollieIssuerOptions(props: MollieIssuerOptionsProps) {
43
42
  helperText={formState.isSubmitted && formState.errors.issuer?.message}
44
43
  label={label}
45
44
  required={required.issuer}
46
- InputProps={{
47
- endAdornment: <InputCheckmark show={valid.issuer} select />,
48
- }}
45
+ showValid
49
46
  options={filterNonNullableKeys(mollie_available_issuers, ['code', 'name']).map(
50
47
  (option) => ({
51
48
  id: option.code,
@@ -12,6 +12,12 @@ import { MollieField } from './MollieField'
12
12
  import { SetMolliePaymentMethodTokenOnCartDocument } from './SetMolliePaymentMethodTokenOnCart.gql'
13
13
  import { mollieContext, MollieContext } from './mollieContext'
14
14
 
15
+ declare global {
16
+ interface Window {
17
+ Mollie?: Mollie
18
+ }
19
+ }
20
+
15
21
  export function MollieCreditCardOptions(props: PaymentOptionsProps) {
16
22
  const { code, step, Container } = props
17
23
  const [loaded, setLoaded] = useState<boolean>(false)
@@ -38,11 +44,9 @@ export function MollieCreditCardOptions(props: PaymentOptionsProps) {
38
44
  useFormCompose({ form, step, submit, key: `PaymentMethodOptions_${code}` })
39
45
 
40
46
  useEffect(() => {
41
- // @ts-expect-error window.Mollie is not defined in TS
42
47
  if (!window.Mollie || mollie) return
43
48
 
44
- // @ts-expect-error window.Mollie is not defined in TS
45
- const mollieInstance = (window.Mollie as Mollie)('pfl_Ah5xUV4c6z', {
49
+ const mollieInstance = window.Mollie('pfl_Ah5xUV4c6z', {
46
50
  locale: conf.data?.storeConfig?.locale ?? 'en_US',
47
51
  testmode: true,
48
52
  })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/mollie-magento-payment",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.3",
5
+ "version": "8.1.0-canary.6",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,21 +12,21 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^8.1.0-canary.3",
16
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.3",
17
- "@graphcommerce/graphql": "^8.1.0-canary.3",
18
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.3",
19
- "@graphcommerce/image": "^8.1.0-canary.3",
20
- "@graphcommerce/magento-cart": "^8.1.0-canary.3",
21
- "@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.3",
22
- "@graphcommerce/magento-cart-shipping-address": "^8.1.0-canary.3",
23
- "@graphcommerce/magento-product": "^8.1.0-canary.3",
24
- "@graphcommerce/magento-product-configurable": "^8.1.0-canary.3",
25
- "@graphcommerce/magento-store": "^8.1.0-canary.3",
26
- "@graphcommerce/next-ui": "^8.1.0-canary.3",
27
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.3",
28
- "@graphcommerce/react-hook-form": "^8.1.0-canary.3",
29
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.3",
15
+ "@graphcommerce/ecommerce-ui": "^8.1.0-canary.6",
16
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.6",
17
+ "@graphcommerce/graphql": "^8.1.0-canary.6",
18
+ "@graphcommerce/graphql-mesh": "^8.1.0-canary.6",
19
+ "@graphcommerce/image": "^8.1.0-canary.6",
20
+ "@graphcommerce/magento-cart": "^8.1.0-canary.6",
21
+ "@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.6",
22
+ "@graphcommerce/magento-cart-shipping-address": "^8.1.0-canary.6",
23
+ "@graphcommerce/magento-product": "^8.1.0-canary.6",
24
+ "@graphcommerce/magento-product-configurable": "^8.1.0-canary.6",
25
+ "@graphcommerce/magento-store": "^8.1.0-canary.6",
26
+ "@graphcommerce/next-ui": "^8.1.0-canary.6",
27
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.6",
28
+ "@graphcommerce/react-hook-form": "^8.1.0-canary.6",
29
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.6",
30
30
  "@lingui/core": "^4.2.1",
31
31
  "@lingui/macro": "^4.2.1",
32
32
  "@lingui/react": "^4.2.1",