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, diff --git a/src/components/UserSettingsProvider.js b/src/components/UserSettingsProvider.js index 393a9eb31..1be994286 100644 --- a/src/components/UserSettingsProvider.js +++ b/src/components/UserSettingsProvider.js @@ -17,11 +17,14 @@ const UserSettingsProvider = ({ children }) => { setSettings({ ...userSettings, - displayProperty: userSettings.keyAnalysisDisplayProperty, + displayProperty: + userSettings.keyAnalysisDisplayProperty === 'name' + ? 'displayName' + : 'displayShortName', }) } fetchData() - }, []) + }, [engine]) return ( { try { const unfilteredDimensions = await apiFetchDimensions( dataEngine, - userSettings.keyAnalysisDisplayProperty + userSettings.displayProperty ) dispatch( @@ -28,14 +28,16 @@ const useDimensions = (doFetch) => { } } - if ( - !dimensions.length && - doFetch && - userSettings.keyAnalysisDisplayProperty - ) { + if (!dimensions.length && doFetch && 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..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.keyAnalysisDisplayProperty - } + displayNameProp={userSettings.displayProperty} /> ) }