Skip to content

Commit

Permalink
feat: Indicate that filters are being loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Feb 23, 2024
1 parent a0e4da9 commit 903ea2a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/components/chart-filters-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export const ChartFiltersList = (props: ChartFiltersListProps) => {
measures,
componentIris: extractChartConfigComponentIris(chartConfig),
});
const [{ data }] = useDataCubesComponentsQuery({
// TODO: Refactor to somehow access current filter labels instead of fetching them again
const [{ data, fetching }] = useDataCubesComponentsQuery({
variables: {
sourceType: dataSource.type,
sourceUrl: dataSource.url,
Expand Down Expand Up @@ -143,7 +144,12 @@ export const ChartFiltersList = (props: ChartFiltersListProps) => {
timeSlider.type,
]);

return allFilters.length ? (
return fetching ? (
<Typography component="div" variant="caption" color="grey.600">
<Trans id="controls.section.data.filters">Filters</Trans>:{" "}
<Trans id="hint.loading.data">Loading data...</Trans>
</Typography>
) : allFilters.length ? (
<Typography
component="div"
variant="caption"
Expand Down

0 comments on commit 903ea2a

Please sign in to comment.