Skip to content

Commit

Permalink
Exclude datasets and layers that should not be explored and analysed
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfdsilva committed Oct 27, 2023
1 parent 52a1252 commit 949a61b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,15 @@ export function DatasetSelectorModal(props: DatasetSelectorModalProps) {
// dataset layers since those are shown on the map.
const displayDatasetLayers = useMemo(
() =>
// TODO: Move function from data-catalog once that page is removed.
prepareDatasets(allDatasets, {
search,
taxonomies,
sortField,
sortDir
}).flatMap((dataset) => dataset.layers),
})
.flatMap((dataset) => dataset.layers)
.filter((d) => d.type !== 'vector' && !d.analysis?.exclude),
[search, taxonomies, sortField, sortDir]
);

Expand Down
10 changes: 6 additions & 4 deletions app/scripts/components/exploration/data-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export const findParentDataset = (layerId: string) => {
return parentDataset?.data;
};

export const allDatasets = Object.values(datasets).map((d) => d!.data);
export const allDatasets = Object.values(datasets)
.map((d) => d!.data)
.filter((d) => !d.disableExplore);

export const datasetLayers = Object.values(datasets).flatMap(
(dataset) => dataset!.data.layers
);
export const datasetLayers = Object.values(datasets)
.flatMap((dataset) => dataset!.data.layers)
.filter((d) => d.type !== 'vector' && !d.analysis?.exclude);

/**
* Returns an array of metrics based on the given Dataset Layer configuration.
Expand Down

0 comments on commit 949a61b

Please sign in to comment.