Skip to content

Commit

Permalink
fix: switch department elk variable to home_department
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNumericite committed Feb 2, 2024
1 parent 2517e11 commit 5637b8b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions webapp-next/components/charts/doughnut/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Field =
| 'sex'
| 'age'
| 'death_location'
| 'department'
| 'home_department'
| 'years'
| 'categories_level_1'
| 'categories_level_2';
Expand All @@ -48,7 +48,7 @@ export function ChartDoughnutHeader() {
{ label: 'Sexe', value: 'sex' },
{ label: 'Age', value: 'age' },
{ label: 'Lieu de décès', value: 'death_location' },
{ label: 'Département', value: 'department' },
{ label: 'Département', value: 'home_department' },
{ label: 'Année', value: 'years' }
];

Expand Down
4 changes: 2 additions & 2 deletions webapp-next/components/charts/histogram/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Field =
| 'sex'
| 'age'
| 'death_location'
| 'department'
| 'home_department'
| 'years'
| 'categories_level_1'
| 'categories_level_2';
Expand All @@ -48,7 +48,7 @@ export function ChartHistogramHeader() {
{ label: 'Sexe', value: 'sex' },
{ label: 'Age', value: 'age' },
{ label: 'Lieu de décès', value: 'death_location' },
{ label: 'Département', value: 'department' },
{ label: 'Département', value: 'home_department' },
{ label: 'Année', value: 'years' }
];

Expand Down
8 changes: 5 additions & 3 deletions webapp-next/components/charts/line/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Field =
| 'sex'
| 'age'
| 'death_location'
| 'department'
| 'home_department'
| 'years'
| 'categories_level_1'
| 'categories_level_2';
Expand All @@ -43,7 +43,7 @@ export function ChartLineHeader() {
{ label: 'Sexe', value: 'sex' },
{ label: 'Age', value: 'age' },
{ label: 'Lieu de décès', value: 'death_location' },
{ label: 'Département', value: 'department' },
{ label: 'Département', value: 'home_department' },
{ label: 'Année', value: 'years' }
];

Expand All @@ -65,7 +65,9 @@ export function ChartLineHeader() {
if (isAggregated) {
aggregation = baseAggregation;
} else {
if (['sex', 'death_location', 'department'].includes(aggregateField)) {
if (
['sex', 'death_location', 'home_department'].includes(aggregateField)
) {
aggregation = {
aggregated_parent: {
terms: {
Expand Down
2 changes: 1 addition & 1 deletion webapp-next/components/charts/map/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function ChartMapHeader() {
const xAgg: any = {
aggregated_x: {
terms: {
field: 'department'
field: 'home_department'
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions webapp-next/components/charts/table/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Field =
| 'sex'
| 'age'
| 'death_location'
| 'department'
| 'home_department'
| 'months'
| 'categories_level_1'
| 'categories_level_2';
Expand All @@ -50,7 +50,7 @@ export function ChartTableHeader() {
{ label: 'Sexe', value: 'sex' },
{ label: 'Age', value: 'age' },
{ label: 'Lieu de décès', value: 'death_location' },
{ label: 'Département', value: 'department' },
{ label: 'Département', value: 'home_department' },
{ label: 'Mois', value: 'months' }
];

Expand Down
2 changes: 1 addition & 1 deletion webapp-next/utils/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function transformFilters(filters: Filters): any[] {

transformed.push({
terms: {
department:
home_department:
filters.department.length > 0
? filters.department
: filters.region_departments
Expand Down

0 comments on commit 5637b8b

Please sign in to comment.