Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Do not show standard error in possible filters #395

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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