From 3ae7632a56fcc808434a242fe098c03db408eb85 Mon Sep 17 00:00:00 2001 From: alfredorubin96 Date: Fri, 10 May 2024 14:29:14 +0200 Subject: [PATCH 1/2] fixing string edge case at param loading --- src/settings/SettingsThunks.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/settings/SettingsThunks.ts b/src/settings/SettingsThunks.ts index 9a225089d..7d17ba7ce 100644 --- a/src/settings/SettingsThunks.ts +++ b/src/settings/SettingsThunks.ts @@ -61,7 +61,6 @@ export const updateGlobalParametersThunk = (newParameters) => (dispatch: any, ge try { const { settings } = getState().dashboard; const parameters = settings.parameters ? settings.parameters : {}; - // if new parameters are set... if (newParameters) { // iterate over the key value pairs in parameters @@ -91,8 +90,14 @@ export const updateParametersToNeo4jTypeThunk = () => (dispatch: any, getState: // iterate over the key value pairs in parameters Object.keys(parameters).forEach((key) => { if (isCastableToNeo4jDate(parameters[key])) { + console.log(key, 'date'); parameters[key] = castToNeo4jDate(parameters[key]); - } else if (parameters[key] && typeof toNumber(parameters[key]) === 'number') { + } else if ( + parameters[key] && + !isNaN(toNumber(parameters[key])) && + typeof toNumber(parameters[key]) === 'number' + ) { + console.log(key, 'number'); parameters[key] = toNumber(parameters[key]); } else if (parameters[key] == undefined) { delete parameters[key]; From 546b6ae20a4d180cc8e58ca13d93367b01e6769f Mon Sep 17 00:00:00 2001 From: Marius Conjeaud Date: Mon, 13 May 2024 10:46:37 +0200 Subject: [PATCH 2/2] Remove console prints --- src/settings/SettingsThunks.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/settings/SettingsThunks.ts b/src/settings/SettingsThunks.ts index 7d17ba7ce..319993a1a 100644 --- a/src/settings/SettingsThunks.ts +++ b/src/settings/SettingsThunks.ts @@ -90,14 +90,12 @@ export const updateParametersToNeo4jTypeThunk = () => (dispatch: any, getState: // iterate over the key value pairs in parameters Object.keys(parameters).forEach((key) => { if (isCastableToNeo4jDate(parameters[key])) { - console.log(key, 'date'); parameters[key] = castToNeo4jDate(parameters[key]); } else if ( parameters[key] && !isNaN(toNumber(parameters[key])) && typeof toNumber(parameters[key]) === 'number' ) { - console.log(key, 'number'); parameters[key] = toNumber(parameters[key]); } else if (parameters[key] == undefined) { delete parameters[key];