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

Dashboard filters #1545

Merged
merged 37 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
737f540
feat: WIP Add shared filters configurator panel
ptbrowne May 14, 2024
0e09000
feat: Add dashboard interactive filters (time)
ptbrowne May 10, 2024
01659ab
feat: Hide brushes if we find a dashboard shared filter
ptbrowne May 14, 2024
71e58ef
feat: Show dashboard interactive filters in chart panel layout
ptbrowne May 22, 2024
7ed0b55
docs: Add comment on what to do
ptbrowne May 22, 2024
408f3d0
feat: Connect dimension time unit to slider
ptbrowne May 30, 2024
8a92505
refactor: Remove unnecessary property
ptbrowne May 30, 2024
220bad3
refactor: Extract logic to show brush
ptbrowne May 30, 2024
c45ea82
feat: Show correctly shared filters, not when configuring
ptbrowne May 30, 2024
3b24ace
feat: Add dashboard filters
ptbrowne May 30, 2024
f787f93
refactor: Move configurator-state and add dashboardFilters in mock data
ptbrowne May 30, 2024
52d73b5
refactor: Auto format
ptbrowne May 30, 2024
1cdbc13
refactor: Explode the configurator-state giant file
ptbrowne May 30, 2024
794db0b
feat: Saving state in chart config as dashboardFilters
ptbrowne May 30, 2024
b18d702
fix: Use correct attributes
ptbrowne May 31, 2024
e41a8f3
fix: Errors in console
ptbrowne May 31, 2024
dec193c
feat: Dashboard filters can be toggled on/off and are not tied to int…
ptbrowne May 31, 2024
1c6b2fa
feat: Only 1 type of shared filter right now
ptbrowne May 31, 2024
64f7579
feat: Only show dashboard interactive filters on dashboard layout
ptbrowne May 31, 2024
b41626b
refactor: Rename file
ptbrowne May 31, 2024
d423a78
fix: Make sure the default version is the latest one
ptbrowne May 31, 2024
811b63e
fix: Correctly mock
ptbrowne May 31, 2024
34ee5d2
refactor: Extract helper
ptbrowne Jun 3, 2024
030c3c3
fix: Adjust mocks and providers for test
ptbrowne Jun 3, 2024
00f4fab
feat: Ability to update temporal shared filter
ptbrowne Jun 3, 2024
452be97
docs: Add comment
ptbrowne Jun 3, 2024
f681d03
fix: Our tooltip have arrows
ptbrowne Jun 3, 2024
04c2611
refactor: Remove unnecessary
ptbrowne Jun 3, 2024
5a3cc6b
refactor: Rename for clarity
ptbrowne Jun 3, 2024
ac6c54f
refactor: Simplify time formatters and parsers definition
ptbrowne Jun 3, 2024
4e2fce5
fix: Can add a new chart when cube is joined
ptbrowne Jun 3, 2024
dffc190
fix: Hide information icon when on second page of add dataset dialog
ptbrowne Jun 4, 2024
63c935b
fix: Dashboard interactive filters do not crash when there are merged…
ptbrowne Jun 4, 2024
fb4614e
fix: Support charts with merged data and not merged data for dashboar…
ptbrowne Jun 4, 2024
374fa09
fix: Shared filter layout configurator collapses correctly
ptbrowne Jun 4, 2024
ec0ef5f
fix: Dashboard shared filter can work on merged cubes
ptbrowne Jun 4, 2024
910bf8a
fix: Add translations
ptbrowne Jun 4, 2024
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
270 changes: 270 additions & 0 deletions app/configurator/configurator-state/actions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
import { EncodingFieldType } from "@/charts/chart-config-ui-options";
import {
ChartConfig,
ChartType,
ConfiguratorState,
DataSource,
Filters,
ImputationType,
InteractiveFiltersConfig,
Layout,
} from "@/config-types";
import { DataCubeComponents, Dimension, DimensionValue } from "@/domain/data";
import { Locale } from "@/locales/locales";

export type ConfiguratorStateAction =
| {
type: "INITIALIZED";
value: ConfiguratorState;
}
| {
type: "STEP_NEXT";
dataCubesComponents: DataCubeComponents;
}
| {
type: "STEP_PREVIOUS";
to?: Exclude<
ConfiguratorState["state"],
"INITIAL" | "PUBLISHING" | "PUBLISHED"
>;
}
| {
type: "DATASOURCE_CHANGED";
value: DataSource;
}
| {
type: "DATASET_ADD";
value: {
iri: string;
joinBy: {
left: string[];
right: string[];
};
};
}
| {
type: "DATASET_REMOVE";
value: {
iri: string;
locale: Locale;
};
}
| {
type: "CHART_TYPE_CHANGED";
value: {
locale: Locale;
chartKey: string;
chartType: ChartType;
};
}
| {
type: "CHART_ACTIVE_FIELD_CHANGED";
value: string | undefined;
}
| {
type: "CHART_FIELD_CHANGED";
value: {
locale: Locale;
field: EncodingFieldType;
componentIri: string;
selectedValues?: $FixMe[];
};
}
| {
type: "CHART_OPTION_CHANGED";
value: {
locale: Locale;
path: string;
field: EncodingFieldType | null;
value:
| string
| number
| boolean
| Record<string, string | number | boolean>
| (string | number | boolean)[]
| (string | number | boolean)[][]
| undefined;
};
}
| {
type: "CHART_PALETTE_CHANGED";
value: {
field: string;
colorConfigPath?: string;
palette: string;
colorMapping: Record<string, string>;
};
}
| {
type: "CHART_PALETTE_RESET";
value: {
field: string;
colorConfigPath?: string;
colorMapping: Record<string, string>;
};
}
| {
type: "CHART_COLOR_CHANGED";
value: {
field: string;
colorConfigPath?: string;
value: string;
color: string;
};
}
| {
type: "CHART_FIELD_DELETED";
value: {
locale: Locale;
field: string;
};
}
| {
type: "CHART_ANNOTATION_CHANGED";
value: {
path: string | string[];
value: string;
};
}
| {
type: "INTERACTIVE_FILTER_CHANGED";
value: InteractiveFiltersConfig;
}
| {
type: "CHART_CONFIG_REPLACED";
value: {
chartConfig: ChartConfig;
dataCubesComponents: DataCubeComponents;
};
}
| {
type: "CHART_CONFIG_FILTER_SET_SINGLE";
value: {
filters: {
cubeIri: string;
dimensionIri: string;
}[];
value: string;
};
}
| {
type: "CHART_CONFIG_FILTER_REMOVE_SINGLE";
value: {
filters: {
cubeIri: string;
dimensionIri: string;
}[];
};
}
| {
type: "CHART_CONFIG_FILTERS_UPDATE";
value: {
cubeIri: string;
filters: Filters;
};
}
| {
type: "CHART_CONFIG_FILTER_SET_MULTI";
value: {
cubeIri: string;
dimensionIri: string;
values: string[];
};
}
| {
type: "CHART_CONFIG_UPDATE_COLOR_MAPPING";
value: {
field: string;
colorConfigPath: string | undefined;
dimensionIri: string;
values: DimensionValue[];
random: boolean;
};
}
| {
type: "CHART_CONFIG_FILTER_SET_RANGE";
value: {
dimension: Dimension;
from: string;
to: string;
};
}
| {
type: "CHART_CONFIG_FILTER_RESET_RANGE";
value: {
cubeIri: string;
dimensionIri: string;
};
}
| {
type: "IMPUTATION_TYPE_CHANGED";
value: {
type: ImputationType;
};
}
| {
type: "PUBLISH_FAILED";
}
| {
type: "PUBLISHED";
value: string;
}
| {
type: "CHART_CONFIG_ADD";
value: {
chartConfig: ChartConfig;
locale: Locale;
};
}
| {
type: "CHART_CONFIG_ADD_NEW_DATASET";
value: {
chartConfig: ChartConfig;
locale: Locale;
};
}
| {
type: "CHART_CONFIG_REMOVE";
value: {
chartKey: string;
};
}
| {
type: "CHART_CONFIG_REORDER";
value: {
oldIndex: number;
newIndex: number;
};
}
| {
type: "CHART_CONFIG_SWAP";
value: {
oldIndex: number;
newIndex: number;
};
}
| {
type: "SWITCH_ACTIVE_CHART";
value: string;
}
| {
type: "LAYOUT_CHANGED";
value: Layout;
}
| {
type: "LAYOUT_ACTIVE_FIELD_CHANGED";
value: string | undefined;
}
| {
type: "LAYOUT_ANNOTATION_CHANGED";
value: {
path: string | string[];
value: string;
};
}
| {
type: "CONFIGURE_CHART";
value: {
chartKey: string;
};
};
Loading