From fb30fc32258dd2d92ed5b85601806f71c85013ec Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Fri, 11 Feb 2022 16:57:48 +0100 Subject: [PATCH 1/2] fix(migration): variable typo Signed-off-by: Rajesh Rajendran --- scripts/helmcharts/openreplay/files/dbops.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/helmcharts/openreplay/files/dbops.sh b/scripts/helmcharts/openreplay/files/dbops.sh index b69d21db4..fddde5b84 100644 --- a/scripts/helmcharts/openreplay/files/dbops.sh +++ b/scripts/helmcharts/openreplay/files/dbops.sh @@ -17,7 +17,7 @@ function migration() { exit 100 fi - if [[ $FORCE_MIGRRATION == "true" ]]; then + if [[ $FORCE_MIGRATION == "true" ]]; then echo "Forcing db migration from $PREVIOUS_APP_VERSION to $CHART_APP_VERSION" elif [[ $PREVIOUS_APP_VERSION == $CHART_APP_VERSION ]]; then echo "No application version change. Not upgrading." @@ -73,7 +73,7 @@ function init(){ esac } -if [[ $FORCE_MIGRRATION == "true" ]]; then +if [[ $FORCE_MIGRATION == "true" ]]; then is_migrate=true fi From 30ed8a4a923cf53ba1950f2962e2d002eb1243c9 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 11 Feb 2022 17:12:56 +0100 Subject: [PATCH 2/2] fix(ui) - filter value duplicate key issue --- .../FilterAutoComplete/FilterAutoComplete.tsx | 44 +++++++------------ 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx b/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx index aaa19e245..e5336a353 100644 --- a/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx +++ b/frontend/app/components/shared/Filters/FilterAutoComplete/FilterAutoComplete.tsx @@ -10,8 +10,6 @@ const hiddenStyle = { opacity: 0, position: 'fixed', left: '-3000px' }; -let debouncedRequestValues = (value) => null; - interface Props { showOrButton?: boolean; showCloseButton?: boolean; @@ -41,30 +39,26 @@ function FilterAutoComplete(props: Props) { value = '', icon = null, } = props; - const [showModal, setShowModal] = useState(false) + const [showModal, setShowModal] = useState(false); const [loading, setLoading] = useState(false) const [options, setOptions] = useState([]); const [query, setQuery] = useState(value); + const requestValues = (q) => { + setLoading(true); - useEffect(() => { - const requestValues = (q) => { - setLoading(true); - - return new APIClient()[method?.toLowerCase()](endpoint, { ...params, q }) - .then(response => response.json()) - .then(({ errors, data }) => { - if (errors) { - // this.setError(); - } else { - setOptions(data); - } - }).finally(() => setLoading(false)); - - } - - debouncedRequestValues = debounce(requestValues, 1000) - }, []) + return new APIClient()[method?.toLowerCase()](endpoint, { ...params, q }) + .then(response => response.json()) + .then(({ errors, data }) => { + if (errors) { + // this.setError(); + } else { + setOptions(data); + } + }).finally(() => setLoading(false)); + } + + const debouncedRequestValues = React.useCallback(debounce(requestValues, 500), []); const onInputChange = ({ target: { value } }) => { setQuery(value); @@ -78,14 +72,6 @@ function FilterAutoComplete(props: Props) { debouncedRequestValues(value); } - // useEffect(() => { - // if (query === '' || query === ' ') { - // return - // } - - // debouncedRequestValues(query) - // }, [query]) - useEffect(() => { setQuery(value); }, [value])