Skip to content

Commit

Permalink
Merge pull request #395 from visualize-admin/fix/no-se-in-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne authored Feb 21, 2022
2 parents aa247f1 + a71f47e commit 5e082a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/configurator/components/chart-configurator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import { getFieldComponentIris } from "../../charts";
import { chartConfigOptionsUISpec } from "../../charts/chart-config-ui-options";
import { Loading } from "../../components/hint";
import { isStandardErrorDimension } from "../../domain/data";
import {
DataCubeMetadataWithComponentValuesQuery,
PossibleFiltersDocument,
Expand Down Expand Up @@ -291,7 +292,10 @@ export const ChartConfigurator = ({
[(x) => keysOrder[x.iri] ?? Infinity]
);
const addableDimensions = data?.dataCubeByIri.dimensions.filter(
(dim) => !mappedIris.has(dim.iri) && keysOrder[dim.iri] === undefined
(dim) =>
!mappedIris.has(dim.iri) &&
keysOrder[dim.iri] === undefined &&
!isStandardErrorDimension(dim)
);

const handleDragEnd: OnDragEndResponder = (result) => {
Expand Down
4 changes: 4 additions & 0 deletions app/domain/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ export const isStandardErrorResolvedDimension = (dim: ResolvedDimension) => {
return dim.data?.related.some((x) => x.type === "StandardError");
};

export const isStandardErrorDimension = (dim: DimensionMetaDataFragment) => {
return dim?.related?.some((r) => r.type === "StandardError");
};

export const shouldValuesBeLoadedForResolvedDimension = (
dim: ResolvedDimension
) => {
Expand Down

0 comments on commit 5e082a7

Please sign in to comment.