Skip to content

Commit f95b804

Browse files
committed
feat: adapt to new statistical districts schema
Refs: PL-75
1 parent adc6f28 commit f95b804

7 files changed

Lines changed: 31 additions & 19 deletions

File tree

src/i18n/en.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,17 @@ export default {
144144
'area.list.heavy_traffic': 'Heavy Traffic',
145145
'area.list.statistic.byAge': 'Age',
146146
'area.list.statistic.forecast': 'Population forecast',
147-
'area.list.statistic.total': 'All population',
147+
'area.list.statistic.ALL': 'All population',
148148
'area.list.statistic.0-6': 'Age 0-6 years',
149+
'area.list.statistic.7-15': 'Age 7-15 years',
149150
'area.list.statistic.7-17': 'Age 7-17 years',
151+
'area.list.statistic.16-18': 'Age 16-18 years',
152+
'area.list.statistic.19-34': 'Age 19-34 years',
153+
'area.list.statistic.35-64': 'Age 35-64 years',
150154
'area.list.statistic.18-29': 'Age 18-29 years',
151155
'area.list.statistic.30-49': 'Age 30-49 years',
152156
'area.list.statistic.50-64': 'Age 50-64 years',
153-
'area.list.statistic.65+': 'Age over 64 years',
157+
'area.list.statistic.65-': 'Age over 65 years',
154158
'area.list.hgv_no_parking_area': 'Prohibited street parking',
155159
'area.list.park_and_ride_area': 'Park & Ride',
156160
'area.parking.tooltip.park_and_ride_area': 'Park & Ride',

src/i18n/fi.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,17 @@ export default {
144144
'area.list.heavy_traffic': 'Raskas liikenne',
145145
'area.list.statistic.byAge': 'Ikä',
146146
'area.list.statistic.forecast': 'Väestöennuste',
147-
'area.list.statistic.total': 'Koko väestö',
147+
'area.list.statistic.ALL': 'Koko väestö',
148148
'area.list.statistic.0-6': 'Ikä 0-6 vuotta',
149+
'area.list.statistic.7-15': 'Ikä 7-15 vuotta',
149150
'area.list.statistic.7-17': 'Ikä 7-17 vuotta',
151+
'area.list.statistic.16-18': 'Ikä 16-18 vuotta',
152+
'area.list.statistic.19-34': 'Ikä 19-34 vuotta',
153+
'area.list.statistic.35-64': 'Ikä 35-64 vuotta',
150154
'area.list.statistic.18-29': 'Ikä 18-29 vuotta',
151155
'area.list.statistic.30-49': 'Ikä 30-49 vuotta',
152156
'area.list.statistic.50-64': 'Ikä 50-64 vuotta',
153-
'area.list.statistic.65+': 'Ikä yli 65 vuotta',
157+
'area.list.statistic.65-': 'Ikä yli 65 vuotta',
154158
'area.list.hgv_no_parking_area': 'Kielletyt kadunvarret',
155159
'area.list.park_and_ride_area': 'Liityntäpysäköinti',
156160
'area.parking.tooltip.park_and_ride_area': 'Liityntäpysäköinti',

src/i18n/sv.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,17 @@ export default {
144144
'area.list.heavy_traffic': 'Tung trafik',
145145
'area.list.statistic.byAge': 'Ålder',
146146
'area.list.statistic.forecast': 'Befolkningsprognos',
147-
'area.list.statistic.total': 'Alla invånare',
147+
'area.list.statistic.ALL': 'Alla invånare',
148148
'area.list.statistic.0-6': 'Ålder 0-6 år',
149+
'area.list.statistic.7-15': 'Ålder 7-15 år',
149150
'area.list.statistic.7-17': 'Ålder 7-17 år',
151+
'area.list.statistic.16-18': 'Ålder 16-18 år',
152+
'area.list.statistic.19-34': 'Ålder 19-34 år',
153+
'area.list.statistic.35-64': 'Ålder 35-64 år',
150154
'area.list.statistic.18-29': 'Ålder 18-29 år',
151155
'area.list.statistic.30-49': 'Ålder 30-49 år',
152156
'area.list.statistic.50-64': 'Ålder 50-64 år',
153-
'area.list.statistic.65+': 'Ålder över 65 år',
157+
'area.list.statistic.65-': 'Ålder över 65 år',
154158
'area.list.hgv_no_parking_area': 'Förbjudna gatuparkeringsplatser',
155159
'area.list.park_and_ride_area': 'Pendelparkering',
156160
'area.parking.tooltip.park_and_ride_area': 'Pendelparkering',

src/redux/actions/statisticalDistrict.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ const normalizeItem = (item) => {
5656
// Format statistical data to include proportions
5757
if (categories) {
5858
const categoryKeys = Object.keys(categories);
59-
categoryKeys.forEach((key) => {
59+
categoryKeys.forEach(key => {
6060
const dataKeys = Object.keys(categories[key]);
6161
const dataValues = {};
62-
const { total } = categories[key];
62+
const total = categories[key].ALL;
6363
dataKeys
6464
.forEach((k) => {
6565
const dataPoint = categories[key][k];

src/utils/dataVisualization.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11

22
class DataVisualization {
33
STATISTICS_DATASETS = {
4-
total: 'väestö_yhteensä',
4+
ALL: 'väestö_yhteensä',
55
'0-6': '06vuotiaat',
6-
'7-17': '717vuotiaat',
7-
'18-29': '1829vuotiaat',
8-
'30-49': '3049vuotiaat',
9-
'50-64': '5064vuotiaat',
10-
'65+': '65vuotiaat',
6+
'7-15': '715vuotiaat',
7+
'16-18': '1618vuotiaat',
8+
'19-34': '1934vuotiaat',
9+
'35-64': '3564vuotiaat',
10+
'65-': '65vuotiaat',
1111
};
1212

1313
FORECAST_DATASETS = {
14-
total: 'väestö_yhteensä',
14+
ALL: 'väestö_yhteensä',
1515
'0-6': '06vuotiaat',
1616
'7-17': '717vuotiaat',
1717
'18-29': '1829vuotiaat',
1818
'30-49': '3049vuotiaat',
1919
'50-64': '5064vuotiaat',
20-
'65+': '65vuotiaat',
20+
'65-': '65vuotiaat',
2121
};
2222

2323
STATISTICS_TYPES = {
@@ -80,7 +80,7 @@ class DataVisualization {
8080

8181
getForecastsLayers = () => Object.keys(this.FORECAST_DATASETS);
8282

83-
isTotal = value => value === 'total'
83+
isTotal = value => value === 'ALL';
8484

8585
isForecast = category => typeof category === 'string' && category.indexOf(this.POPULATION_FORECAST_STRING) > -1;
8686

src/views/AreaView/components/StatisticalDistrictList/StatisticalDistrictListContent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const StatisticalDistrictListContent = () => {
8080
};
8181

8282
const getDistrictDataInfo = (district) => {
83-
const isTotal = selection?.section === 'total';
83+
const isTotal = selection?.section === 'ALL';
8484
const hasValue = typeof district.selectedValue === 'number';
8585
let id;
8686

src/views/MapView/components/StatisticalDistricts/StatisticalDistrictsComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const StatisticalDistrictTooltip = ({
9292
const getLocaleText = useLocaleText();
9393
const { formatMessage } = useIntl();
9494
const category = useSelector(getStatisticalDistrictSelectedCategory);
95-
const isTotal = section === 'total';
95+
const isTotal = section === 'ALL';
9696
const hasValue = typeof district?.selectedValue === 'number';
9797
const values = {
9898
count: district.selectedValue,

0 commit comments

Comments
 (0)