Skip to content

Commit

Permalink
fix: use displayName and displayShortName to get correct name
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Apr 19, 2024
1 parent 794a42b commit d2804a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions src/components/UserSettingsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ const UserSettingsProvider = ({ children }) => {

setSettings({
...userSettings,
displayProperty: userSettings.keyAnalysisDisplayProperty,
displayProperty:
userSettings.keyAnalysisDisplayProperty === 'name'
? 'displayName'
: 'displayShortName',
})
}
fetchData()
}, [])
}, [engine])

return (
<UserSettingsCtx.Provider
Expand Down
16 changes: 9 additions & 7 deletions src/modules/useDimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const useDimensions = doFetch => {
try {
const unfilteredDimensions = await apiFetchDimensions(
dataEngine,
userSettings.keyAnalysisDisplayProperty
userSettings.displayProperty
)

dispatch(
Expand All @@ -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,
dataEngine,
dispatch,
])

return dimensions
}
Expand Down
4 changes: 1 addition & 3 deletions src/pages/view/TitleBar/FilterDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ const FilterDialog = ({
dimensionId={dimension.id}
onSelect={onSelectItems}
dimensionTitle={dimension.name}
displayNameProp={
userSettings.keyAnalysisDisplayProperty
}
displayNameProp={userSettings.displayProperty}
/>
)
}
Expand Down

0 comments on commit d2804a7

Please sign in to comment.