From ab38e43c20faa4429056b5417361adfc66484d58 Mon Sep 17 00:00:00 2001 From: Dragana Trajkovic Date: Wed, 9 Oct 2024 13:37:16 +0200 Subject: [PATCH 1/7] MWPW-160143 - arbitrary fix --- edsdme/components/PartnerCards.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index bba0ed8..65fd0c7 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -521,12 +521,12 @@ export default class PartnerCards extends LitElement { } // eslint-disable-next-line consistent-return return selectedFiltersKeys.every((key) => cardArbitraryArr.some((arbitraryTag) => { - if (!arbitraryTag.value || !arbitraryTag.key) return false; - const arbitraryTagKeyStr = arbitraryTag.key.trim().toLowerCase().replaceAll(' ', '-'); - const arbitraryTagValueStr = arbitraryTag.value.trim().toLowerCase().replaceAll(' ', '-'); - if (key === arbitraryTagKeyStr) { - // eslint-disable-next-line max-len - return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValueStr); + const arbitraryTagKey = Object.keys(arbitraryTag)[0] && Object.keys(arbitraryTag)[0].replaceAll(' ', '-'); + if (arbitraryTagKey !== key) return false; + + const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-'); + if (arbitraryTagValue) { + return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValue); } return false; })); From ab4268057f4ed153b70dd6f1b46391fbf3326ab6 Mon Sep 17 00:00:00 2001 From: Dragana Trajkovic Date: Wed, 9 Oct 2024 13:46:14 +0200 Subject: [PATCH 2/7] MWPW-160143 - lint fix --- edsdme/components/PartnerCards.js | 1 + 1 file changed, 1 insertion(+) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index 65fd0c7..74aaa29 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -526,6 +526,7 @@ export default class PartnerCards extends LitElement { const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-'); if (arbitraryTagValue) { + // eslint-disable-next-line consistent-return return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValue); } return false; From b3d27a11625b7a5b837dfe9a38a8de66332449d5 Mon Sep 17 00:00:00 2001 From: Dragana Trajkovic Date: Wed, 9 Oct 2024 13:48:52 +0200 Subject: [PATCH 3/7] MWPW-160143 - lint fix --- edsdme/components/PartnerCards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index 74aaa29..77c5fc4 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -521,12 +521,12 @@ export default class PartnerCards extends LitElement { } // eslint-disable-next-line consistent-return return selectedFiltersKeys.every((key) => cardArbitraryArr.some((arbitraryTag) => { + // eslint-disable-next-line consistent-return const arbitraryTagKey = Object.keys(arbitraryTag)[0] && Object.keys(arbitraryTag)[0].replaceAll(' ', '-'); if (arbitraryTagKey !== key) return false; const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-'); if (arbitraryTagValue) { - // eslint-disable-next-line consistent-return return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValue); } return false; From 95d7437060fef8c5d2603a6eec6a717f63bf9733 Mon Sep 17 00:00:00 2001 From: Dragana Trajkovic Date: Wed, 9 Oct 2024 14:10:38 +0200 Subject: [PATCH 4/7] MWPW-160143 - lint fix --- edsdme/components/PartnerCards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index 77c5fc4..04c4fd2 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -521,7 +521,7 @@ export default class PartnerCards extends LitElement { } // eslint-disable-next-line consistent-return return selectedFiltersKeys.every((key) => cardArbitraryArr.some((arbitraryTag) => { - // eslint-disable-next-line consistent-return + // eslint-disable-next-line max-len const arbitraryTagKey = Object.keys(arbitraryTag)[0] && Object.keys(arbitraryTag)[0].replaceAll(' ', '-'); if (arbitraryTagKey !== key) return false; From 789f576c114307d3d7a3091dba61bceacdbae549 Mon Sep 17 00:00:00 2001 From: Dragana Trajkovic Date: Wed, 9 Oct 2024 14:17:01 +0200 Subject: [PATCH 5/7] MWPW-160143 - lint fix --- edsdme/components/PartnerCards.js | 1 + 1 file changed, 1 insertion(+) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index 04c4fd2..3db68a6 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -527,6 +527,7 @@ export default class PartnerCards extends LitElement { const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-'); if (arbitraryTagValue) { + // eslint-disable-next-line max-len return this.selectedFilters[key].some((selectedTag) => selectedTag.key === arbitraryTagValue); } return false; From 778336571dd8639b95f356f50c0d908f8b38d83c Mon Sep 17 00:00:00 2001 From: Dragana Trajkovic Date: Wed, 9 Oct 2024 14:29:26 +0200 Subject: [PATCH 6/7] MWPW-160143 - small update --- edsdme/components/PartnerCards.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index 3db68a6..00dfccc 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -521,8 +521,7 @@ export default class PartnerCards extends LitElement { } // eslint-disable-next-line consistent-return return selectedFiltersKeys.every((key) => cardArbitraryArr.some((arbitraryTag) => { - // eslint-disable-next-line max-len - const arbitraryTagKey = Object.keys(arbitraryTag)[0] && Object.keys(arbitraryTag)[0].replaceAll(' ', '-'); + const arbitraryTagKey = Object.keys(arbitraryTag)[0]?.replaceAll(' ', '-') if (arbitraryTagKey !== key) return false; const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-'); From 194e06473d1d6b8d337400491b08fe47e86451c7 Mon Sep 17 00:00:00 2001 From: draganatrajkovic <65951679+draganatrajkovic@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:32:07 +0200 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- edsdme/components/PartnerCards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edsdme/components/PartnerCards.js b/edsdme/components/PartnerCards.js index 00dfccc..6b529ca 100644 --- a/edsdme/components/PartnerCards.js +++ b/edsdme/components/PartnerCards.js @@ -521,7 +521,7 @@ export default class PartnerCards extends LitElement { } // eslint-disable-next-line consistent-return return selectedFiltersKeys.every((key) => cardArbitraryArr.some((arbitraryTag) => { - const arbitraryTagKey = Object.keys(arbitraryTag)[0]?.replaceAll(' ', '-') + const arbitraryTagKey = Object.keys(arbitraryTag)[0]?.replaceAll(' ', '-'); if (arbitraryTagKey !== key) return false; const arbitraryTagValue = arbitraryTag[key].replaceAll(' ', '-');