From e663bc00a13b3b205252aece18d2a06f9d46505f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20Lo=CC=81pez=20Luna?= Date: Wed, 22 May 2024 13:07:03 -0600 Subject: [PATCH 1/3] Fix [customData] Extra validation --- CHANGELOG.md | 4 ++++ react/components/B2BQuotesLockingModal.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d5ebc..956d4ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed that if there is another custom application in the custom data, the "B2BQuotesLockingModal.tsx" component would break on its own. + ## [1.6.0] - 2023-08-10 + ### Added diff --git a/react/components/B2BQuotesLockingModal.tsx b/react/components/B2BQuotesLockingModal.tsx index 9dd84d9..86dd4d8 100644 --- a/react/components/B2BQuotesLockingModal.tsx +++ b/react/components/B2BQuotesLockingModal.tsx @@ -100,7 +100,7 @@ const B2BQuotesLockingModal = () => { const { orderForm } = orderFormData const { customData, items } = orderForm - if (!customData?.customApps) { + if (!customData?.customApps || customData?.customApps.findIndex( (item: any) => item.id === 'b2b-quotes-graphql' ) === -1) { return } From 9d293125d020544b23d97641f1dbaf99ff5ddba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20Lo=CC=81pez=20Luna?= Date: Wed, 19 Jun 2024 09:58:31 -0600 Subject: [PATCH 2/3] customData [Refactor] Syntax code --- react/components/B2BQuotesLockingModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/components/B2BQuotesLockingModal.tsx b/react/components/B2BQuotesLockingModal.tsx index 86dd4d8..044cc72 100644 --- a/react/components/B2BQuotesLockingModal.tsx +++ b/react/components/B2BQuotesLockingModal.tsx @@ -100,7 +100,7 @@ const B2BQuotesLockingModal = () => { const { orderForm } = orderFormData const { customData, items } = orderForm - if (!customData?.customApps || customData?.customApps.findIndex( (item: any) => item.id === 'b2b-quotes-graphql' ) === -1) { + if (!customData?.customApps || !customData?.customApps.some( (item: any) => item.id === 'b2b-quotes-graphql' )) { return } From 47411a01f515a5e54a8b447c442050d43adf5c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20Lo=CC=81pez=20Luna?= Date: Wed, 19 Jun 2024 11:27:00 -0600 Subject: [PATCH 3/3] Lint [Refactor] --- react/components/B2BQuotesLockingModal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/react/components/B2BQuotesLockingModal.tsx b/react/components/B2BQuotesLockingModal.tsx index 044cc72..436b3d1 100644 --- a/react/components/B2BQuotesLockingModal.tsx +++ b/react/components/B2BQuotesLockingModal.tsx @@ -100,7 +100,12 @@ const B2BQuotesLockingModal = () => { const { orderForm } = orderFormData const { customData, items } = orderForm - if (!customData?.customApps || !customData?.customApps.some( (item: any) => item.id === 'b2b-quotes-graphql' )) { + if ( + !customData?.customApps || + !customData?.customApps.some( + (item: any) => item.id === 'b2b-quotes-graphql' + ) + ) { return }