From 167dbc4939d2157d40eeab29fe663944051364e0 Mon Sep 17 00:00:00 2001 From: Valentin Serra Date: Wed, 3 Jan 2024 14:27:24 +0100 Subject: [PATCH] chore(label correlation): fix naming Related to #960 --- .../src/render/components/form-fields/Checklist.js | 10 +++++----- .../src/render/components/form-fields/Radio.js | 4 ++-- .../src/render/components/form-fields/Taglist.js | 14 +++++++------- .../form-fields/parts/SearchableSelect.js | 6 +++--- .../components/form-fields/parts/SimpleSelect.js | 6 +++--- .../src/render/components/util/sanitizerUtil.js | 10 +++++----- .../render/hooks/useCleanupMultiSelectValues.js | 6 +++--- .../render/hooks/useCleanupSingleSelectValue.js | 4 ++-- ...belCorrelation.js => useGetLabelCorrelation.js} | 2 +- 9 files changed, 31 insertions(+), 31 deletions(-) rename packages/form-js-viewer/src/render/hooks/{useLabelCorrelation.js => useGetLabelCorrelation.js} (92%) diff --git a/packages/form-js-viewer/src/render/components/form-fields/Checklist.js b/packages/form-js-viewer/src/render/components/form-fields/Checklist.js index c736dfecb..d6eea2435 100644 --- a/packages/form-js-viewer/src/render/components/form-fields/Checklist.js +++ b/packages/form-js-viewer/src/render/components/form-fields/Checklist.js @@ -2,13 +2,13 @@ import { useRef } from 'preact/hooks'; import useOptionsAsync, { LOAD_STATES } from '../../hooks/useOptionsAsync'; import useCleanupMultiSelectValues from '../../hooks/useCleanupMultiSelectValues'; import classNames from 'classnames'; -import isDeepEqual from 'lodash/isEqual'; +import isEqual from 'lodash/isEqual'; import Description from '../Description'; import Errors from '../Errors'; import Label from '../Label'; -import { sanitizeMultiSelectValue, isDeepIncluded } from '../util/sanitizerUtil'; +import { sanitizeMultiSelectValue, hasEqualValue } from '../util/sanitizerUtil'; import { createEmptyOptions } from '../util/optionsUtil'; @@ -44,8 +44,8 @@ export default function Checklist(props) { const toggleCheckbox = (toggledValue) => { - const newValues = isDeepIncluded(toggledValue, values) - ? values.filter(value => !isDeepEqual(value, toggledValue)) + const newValues = hasEqualValue(toggledValue, values) + ? values.filter(value => !isEqual(value, toggledValue)) : [ ...values, toggledValue ]; props.onChange({ @@ -93,7 +93,7 @@ export default function Checklist(props) { loadState == LOAD_STATES.LOADED && options.map((o, index) => { const itemDomId = `${domId}-${index}`; - const isChecked = isDeepIncluded(o.value, values); + const isChecked = hasEqualValue(o.value, values); return (