From df139c4570a6dff59bdb7abfea11276a66e9f986 Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Sun, 11 Oct 2020 08:26:04 -0400 Subject: [PATCH] UIDATIMP-690 prevent ESLint from dying Due to a [bug in jsx-exlint](https://github.com/jsx-eslint/jsx-ast-utils/issues/103), the changed line causes ESLint to die. The bug [has been fixed](https://github.com/jsx-eslint/jsx-ast-utils/pull/102) but hasn't made it's way into a release yet, and it would be really nice to have lint working again! Refs UIDATIMP-690 --- CHANGELOG.md | 2 ++ .../edit/ItemDetailSection/LoanAndAvailability.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1db5663c8..abad4fb75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,8 @@ * Fix `SyntaxError: Unexpected token 'export'` error when running tests (UIDATIMP-667) * Fix "Position" in MCL View is not left justified (UIDATIMP-657) * An error message appears when linking a match profile with Existing record field = "Identifier: ..." to a job profile (UIDATIMP-687) +* Only import MatchingFieldsManager once (UIDATIMP-689) +* Tweak syntax that caused ESLint to die early, allowing it complete, and find bugs like UIDATIMP-689 (UIDATIMP-690) ## [2.1.4](https://github.com/folio-org/ui-data-import/tree/v2.1.4) (2020-08-13) diff --git a/src/settings/MappingProfiles/detailsSections/edit/ItemDetailSection/LoanAndAvailability.js b/src/settings/MappingProfiles/detailsSections/edit/ItemDetailSection/LoanAndAvailability.js index 945616d64..9db6de0ea 100644 --- a/src/settings/MappingProfiles/detailsSections/edit/ItemDetailSection/LoanAndAvailability.js +++ b/src/settings/MappingProfiles/detailsSections/edit/ItemDetailSection/LoanAndAvailability.js @@ -56,8 +56,9 @@ export const LoanAndAvailability = ({ const currentValue = circulationNotes[index]?.fields.find(item => item.name === 'noteType').value; const isDirty = currentValue !== initialValue; - const updatedValue = circulationNotesList.find(item => `"${item.value}"` === currentValue)?.label; - const value = updatedValue ? `"${updatedValue}"` : currentValue; + const updatedValue = circulationNotesList.find(item => `"${item.value}"` === currentValue); + const updatedValueLabel = updatedValue?.label; + const value = updatedValueLabel ? `"${updatedValueLabel}"` : currentValue; return { value,