From bf1fc85681dbb3e70ace204d464ae40c2316fa22 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 19 Apr 2024 16:14:20 +0200 Subject: [PATCH 1/4] fix: use displayName and displayShortName to get correct name --- src/components/UserSettingsProvider.js | 4 +++- src/modules/useDimensions.js | 6 +++--- src/pages/view/TitleBar/FilterDialog.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/UserSettingsProvider.js b/src/components/UserSettingsProvider.js index 393a9eb31..bf451a501 100644 --- a/src/components/UserSettingsProvider.js +++ b/src/components/UserSettingsProvider.js @@ -17,7 +17,9 @@ const UserSettingsProvider = ({ children }) => { setSettings({ ...userSettings, - displayProperty: userSettings.keyAnalysisDisplayProperty, + displayProperty: userSettings.keyAnalysisDisplayProperty === 'name' + ? 'displayName' + : 'displayShortName', }) } fetchData() diff --git a/src/modules/useDimensions.js b/src/modules/useDimensions.js index ad81b7400..f0efb0558 100644 --- a/src/modules/useDimensions.js +++ b/src/modules/useDimensions.js @@ -17,7 +17,7 @@ const useDimensions = (doFetch) => { try { const unfilteredDimensions = await apiFetchDimensions( dataEngine, - userSettings.keyAnalysisDisplayProperty + userSettings.displayProperty ) dispatch( @@ -31,11 +31,11 @@ const useDimensions = (doFetch) => { if ( !dimensions.length && doFetch && - userSettings.keyAnalysisDisplayProperty + userSettings.displayProperty ) { fetchDimensions() } - }, [dimensions, doFetch, userSettings.keyAnalysisDisplayProperty]) + }, [dimensions, doFetch, userSettings.displayProperty, dispatch, dataEngine]) return dimensions } diff --git a/src/pages/view/TitleBar/FilterDialog.js b/src/pages/view/TitleBar/FilterDialog.js index 0cb807089..8ea09b116 100644 --- a/src/pages/view/TitleBar/FilterDialog.js +++ b/src/pages/view/TitleBar/FilterDialog.js @@ -120,7 +120,7 @@ const FilterDialog = ({ onSelect={onSelectItems} dimensionTitle={dimension.name} displayNameProp={ - userSettings.keyAnalysisDisplayProperty + userSettings.displayProperty } /> ) From 7bab7151927d634071e9d9f8492e178a0cd097d6 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 22 Apr 2024 11:29:04 +0200 Subject: [PATCH 2/4] fix: lint error --- src/components/UserSettingsProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserSettingsProvider.js b/src/components/UserSettingsProvider.js index bf451a501..8b90e373d 100644 --- a/src/components/UserSettingsProvider.js +++ b/src/components/UserSettingsProvider.js @@ -23,7 +23,7 @@ const UserSettingsProvider = ({ children }) => { }) } fetchData() - }, []) + }, [engine]) return ( Date: Mon, 22 Apr 2024 11:37:24 +0200 Subject: [PATCH 3/4] fix: lint --- src/components/UserSettingsProvider.js | 7 ++++--- src/modules/useDimensions.js | 14 ++++++++------ src/pages/view/TitleBar/FilterDialog.js | 4 +--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/UserSettingsProvider.js b/src/components/UserSettingsProvider.js index 8b90e373d..1be994286 100644 --- a/src/components/UserSettingsProvider.js +++ b/src/components/UserSettingsProvider.js @@ -17,9 +17,10 @@ const UserSettingsProvider = ({ children }) => { setSettings({ ...userSettings, - displayProperty: userSettings.keyAnalysisDisplayProperty === 'name' - ? 'displayName' - : 'displayShortName', + displayProperty: + userSettings.keyAnalysisDisplayProperty === 'name' + ? 'displayName' + : 'displayShortName', }) } fetchData() diff --git a/src/modules/useDimensions.js b/src/modules/useDimensions.js index f0efb0558..53de07779 100644 --- a/src/modules/useDimensions.js +++ b/src/modules/useDimensions.js @@ -28,14 +28,16 @@ const useDimensions = (doFetch) => { } } - if ( - !dimensions.length && - doFetch && - userSettings.displayProperty - ) { + if (!dimensions.length && doFetch && userSettings.displayProperty) { fetchDimensions() } - }, [dimensions, doFetch, userSettings.displayProperty, dispatch, dataEngine]) + }, [ + dimensions, + doFetch, + userSettings.displayProperty, + dispatch, + dataEngine, + ]) return dimensions } diff --git a/src/pages/view/TitleBar/FilterDialog.js b/src/pages/view/TitleBar/FilterDialog.js index 8ea09b116..10e15b1aa 100644 --- a/src/pages/view/TitleBar/FilterDialog.js +++ b/src/pages/view/TitleBar/FilterDialog.js @@ -119,9 +119,7 @@ const FilterDialog = ({ dimensionId={dimension.id} onSelect={onSelectItems} dimensionTitle={dimension.name} - displayNameProp={ - userSettings.displayProperty - } + displayNameProp={userSettings.displayProperty} /> ) } From 9a0b46f91a5f4ef34309681d82e712e6bf734aa3 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 23 Apr 2024 13:05:02 +0200 Subject: [PATCH 4/4] fix: analytics request requires name or shortName --- .../Item/VisualizationItem/Visualization/IframePlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Item/VisualizationItem/Visualization/IframePlugin.js b/src/components/Item/VisualizationItem/Visualization/IframePlugin.js index 79ba21c38..545cf3af2 100644 --- a/src/components/Item/VisualizationItem/Visualization/IframePlugin.js +++ b/src/components/Item/VisualizationItem/Visualization/IframePlugin.js @@ -66,7 +66,7 @@ const IframePlugin = ({ () => ({ isVisualizationLoaded: true, forDashboard: true, - displayProperty: userSettings.displayProperty, + displayProperty: userSettings.keyAnalysisDisplayProperty, visualization, onError,