From ed3e15910a1485b4426b49b13a72c8e4fe1dbda3 Mon Sep 17 00:00:00 2001 From: Nicolas Merlis Date: Wed, 17 Jul 2024 10:39:01 -0300 Subject: [PATCH 1/7] fix: extra validation added to cascader selectedDisplayValue state --- src/components/data-entry/QueryItem/Cascader.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/data-entry/QueryItem/Cascader.tsx b/src/components/data-entry/QueryItem/Cascader.tsx index 821937982..61a9b61b2 100644 --- a/src/components/data-entry/QueryItem/Cascader.tsx +++ b/src/components/data-entry/QueryItem/Cascader.tsx @@ -38,7 +38,7 @@ const Cascader = (props: ICascaderProps) => { const [searchValue, setSearchValue] = useState('') const [selectedValue, setSelectedValue] = useState>(props.value ?? []) const [selectedDisplayValue, setSelectedDisplayValue] = useState( - props.value ? (props.value.slice(-1)[0] as any).label : '', + props.value && props.value.length > 0 ? (props.value.slice(-1)[0] as any).label : '', ) const [isOpen, setIsOpen] = useState(false) @@ -179,4 +179,4 @@ const Cascader = (props: ICascaderProps) => { } } -export default Cascader \ No newline at end of file +export default Cascader From 84d4d51de2711b15f4977cc6d4165040e92a077a Mon Sep 17 00:00:00 2001 From: mparticle-automation Date: Wed, 17 Jul 2024 13:44:43 +0000 Subject: [PATCH 2/7] chore(release): 1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1 [skip ci] ## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-17) ### Bug Fixes * extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6c570b2..af0fb5497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-17) + +### Bug Fixes + +- extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) + # [1.21.0](https://github.com/mParticle/aquarium/compare/v1.20.0...v1.21.0) (2024-07-16) ### Features diff --git a/package-lock.json b/package-lock.json index 346c87413..5ab7849c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mparticle/aquarium", - "version": "1.21.0", + "version": "1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mparticle/aquarium", - "version": "1.21.0", + "version": "1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1", "license": "Apache-2.0", "dependencies": { "lodash.clonedeep": "4.5.0" diff --git a/package.json b/package.json index d41b88957..3274f93ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mparticle/aquarium", - "version": "1.21.0", + "version": "1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1", "description": "mParticle Component Library", "license": "Apache-2.0", "keywords": [ From d8c6f10b7ed3df7e742b0fb23a0657bf0102e843 Mon Sep 17 00:00:00 2001 From: Nicolas Merlis Date: Wed, 17 Jul 2024 11:36:09 -0300 Subject: [PATCH 3/7] fix: a useEffect Hook has been added to detect if the value received from parameter changed --- src/components/data-entry/QueryItem/Cascader.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/data-entry/QueryItem/Cascader.tsx b/src/components/data-entry/QueryItem/Cascader.tsx index 61a9b61b2..d904fd4f8 100644 --- a/src/components/data-entry/QueryItem/Cascader.tsx +++ b/src/components/data-entry/QueryItem/Cascader.tsx @@ -46,6 +46,12 @@ const Cascader = (props: ICascaderProps) => { setItems(props.options) }, [props.options]) + useEffect(() => { + if (props.value && props.value.length > 0) { + setSelectedValue(props.value) + } + }, [props.value]) + const onSearch = ({ target: { value } }: { target: { value: string } }) => { if (debouncedLoadData) { if (value.length > 3) { From 5ce73b73eff49f407d98c89d6b8c3f592a277aeb Mon Sep 17 00:00:00 2001 From: mparticle-automation Date: Wed, 17 Jul 2024 14:39:22 +0000 Subject: [PATCH 4/7] chore(release): 1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1 [skip ci] ## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-17) ### Bug Fixes * a useEffect Hook has been added to detect if the value received from parameter changed ([d8c6f10](https://github.com/mParticle/aquarium/commit/d8c6f10b7ed3df7e742b0fb23a0657bf0102e843)) * extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af0fb5497..029b254c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ### Bug Fixes +- a useEffect Hook has been added to detect if the value received from parameter changed ([d8c6f10](https://github.com/mParticle/aquarium/commit/d8c6f10b7ed3df7e742b0fb23a0657bf0102e843)) +- extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) + +## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-17) + +### Bug Fixes + - extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) # [1.21.0](https://github.com/mParticle/aquarium/compare/v1.20.0...v1.21.0) (2024-07-16) From 6d5e9447047b2c7075b064a11eca30fac0931eea Mon Sep 17 00:00:00 2001 From: Nicolas Merlis Date: Fri, 19 Jul 2024 13:10:18 -0300 Subject: [PATCH 5/7] chore: classNameInput property added to component Query Input Cascarder --- src/components/data-entry/QueryItem/Cascader.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/data-entry/QueryItem/Cascader.tsx b/src/components/data-entry/QueryItem/Cascader.tsx index d904fd4f8..b96fcd61f 100644 --- a/src/components/data-entry/QueryItem/Cascader.tsx +++ b/src/components/data-entry/QueryItem/Cascader.tsx @@ -28,6 +28,7 @@ export interface ICascaderProps { onChange?: (values: Array, selectedOptions: any) => Promise loadData?: (value: string) => void value?: Array + classNameInput?: string } const Cascader = (props: ICascaderProps) => { @@ -123,6 +124,8 @@ const Cascader = (props: ICascaderProps) => { if (isOpen) inputClasses += ' query-item--open' if (selectedValue && selectedValue.length !== 0) inputClasses += ' query-item--selected' if (props.errorMessage) inputClasses += ' query-item--error' + if (props.classNameInput) inputClasses += ` ${props.classNameInput}` + const displayValue = selectedDisplayValue ?? selectedValue.slice(-1) return ( From 8b63ea031a5983b546ae1f813b98a596d466a43c Mon Sep 17 00:00:00 2001 From: mparticle-automation Date: Fri, 19 Jul 2024 16:44:01 +0000 Subject: [PATCH 6/7] chore(release): 1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1 [skip ci] ## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-19) ### Bug Fixes * a useEffect Hook has been added to detect if the value received from parameter changed ([d8c6f10](https://github.com/mParticle/aquarium/commit/d8c6f10b7ed3df7e742b0fb23a0657bf0102e843)) * extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 029b254c8..327dbabf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-19) + +### Bug Fixes + +- a useEffect Hook has been added to detect if the value received from parameter changed ([d8c6f10](https://github.com/mParticle/aquarium/commit/d8c6f10b7ed3df7e742b0fb23a0657bf0102e843)) +- extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) + ## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-17) ### Bug Fixes From 9b3a03cfee248babe2f4fa98e41b923c8b748c41 Mon Sep 17 00:00:00 2001 From: mparticle-automation Date: Fri, 19 Jul 2024 17:06:23 +0000 Subject: [PATCH 7/7] chore(release): 1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1 [skip ci] ## [1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1) (2024-07-19) ### Bug Fixes * a useEffect Hook has been added to detect if the value received from parameter changed ([d8c6f10](https://github.com/mParticle/aquarium/commit/d8c6f10b7ed3df7e742b0fb23a0657bf0102e843)) * extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 327dbabf5..c0c021c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1) (2024-07-19) + +### Bug Fixes + +- a useEffect Hook has been added to detect if the value received from parameter changed ([d8c6f10](https://github.com/mParticle/aquarium/commit/d8c6f10b7ed3df7e742b0fb23a0657bf0102e843)) +- extra validation added to cascader selectedDisplayValue state ([ed3e159](https://github.com/mParticle/aquarium/commit/ed3e15910a1485b4426b49b13a72c8e4fe1dbda3)) + ## [1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1](https://github.com/mParticle/aquarium/compare/v1.21.0...v1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1) (2024-07-19) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index 5ab7849c1..3c68d13ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mparticle/aquarium", - "version": "1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1", + "version": "1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mparticle/aquarium", - "version": "1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1", + "version": "1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1", "license": "Apache-2.0", "dependencies": { "lodash.clonedeep": "4.5.0" diff --git a/package.json b/package.json index 3274f93ab..758273aeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mparticle/aquarium", - "version": "1.21.1-fix-queryitem.valueselector.cascader-intial-value-validation.1", + "version": "1.21.1-fix-queryitem.valueselector.cascader-various-fixes.1", "description": "mParticle Component Library", "license": "Apache-2.0", "keywords": [