@geops/rvf-mobility-web-component 0.1.40 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/index.js +153 -277
  3. package/package.json +1 -1
  4. package/src/NotificationLayer/NotificationLayer.tsx +1 -0
  5. package/src/NotificationLayer/notificationUtils.ts +234 -160
  6. package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +172 -131
  7. package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +200 -42
  8. package/src/icons/disruption-type-banner.xcf +0 -0
  9. package/src/icons/sbb_add_stop.png +0 -0
  10. package/src/icons/sbb_add_stop.svg +6 -0
  11. package/src/icons/sbb_alternative.png +0 -0
  12. package/src/icons/sbb_alternative.svg +6 -0
  13. package/src/icons/sbb_cancellation.png +0 -0
  14. package/src/icons/sbb_cancellation.svg +7 -0
  15. package/src/icons/sbb_construction.png +0 -0
  16. package/src/icons/sbb_construction.svg +6 -0
  17. package/src/icons/sbb_construction_banner.png +0 -0
  18. package/src/icons/sbb_delay.png +0 -0
  19. package/src/icons/sbb_delay.svg +6 -0
  20. package/src/icons/sbb_disruption.png +0 -0
  21. package/src/icons/sbb_disruption.svg +6 -0
  22. package/src/icons/sbb_disruption_banner.png +0 -0
  23. package/src/icons/sbb_info.png +0 -0
  24. package/src/icons/sbb_info.svg +6 -0
  25. package/src/icons/sbb_missed_connection.png +0 -0
  26. package/src/icons/sbb_missed_connection.svg +6 -0
  27. package/src/icons/sbb_missed_connection_banner.png +0 -0
  28. package/src/icons/sbb_platform_change.png +0 -0
  29. package/src/icons/sbb_platform_change.svg +7 -0
  30. package/src/icons/sbb_replacementbus.png +0 -0
  31. package/src/icons/sbb_replacementbus.svg +6 -0
  32. package/src/icons/sbb_replacementbus_banner.png +0 -0
  33. package/src/icons/sbb_reroute.png +0 -0
  34. package/src/icons/sbb_reroute.svg +7 -0
  35. package/src/icons/warning-banner.xcf +0 -0
  36. package/src/utils/addSourceAndLayers.ts +51 -5
  37. package/src/utils/{getFeatureInformationTitle.ts → getFeatureInformationTitle.tsx} +14 -2
  38. package/src/utils/i18n.ts +6 -5
  39. package/src/utils/sharingGraphqlUtils.ts +16 -9
  40. package/src/utils/translations.ts +16 -0
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <path fill="#EB0000" d="M0,1.9941 C0,0.8931 0.895,0.0001 1.994,0.0001 L14.006,0.0001 C15.107,0.0001 16,0.8941 16,1.9941 L16,14.0061 C16,15.1071 15.105,16.0001 14.006,16.0001 L1.994,16.0001 C0.893,16.0001 0,15.1051 0,14.0061 L0,1.9941 Z"/>
4
+ <polygon fill="#FFF" points="10.391 2 8.891 2 8.891 10.317 5.782 10.317 7.506 8.592 6.445 7.532 2.909 11.069 6.445 14.606 7.506 13.545 5.778 11.817 10.391 11.817"/>
5
+ </g>
6
+ </svg>
Binary file
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <polygon fill="#FFF" points="10.4 11.265 8 8.865 5.6 11.265 4.735 10.399 7.135 8 4.735 5.6 5.6 4.735 8 7.134 10.4 4.735 11.265 5.6 8.866 8 11.265 10.399"/>
5
+ <path fill="#FFF" d="M7.994,2 C4.682,2 2,4.688 2,8 C2,11.312 4.682,14 7.994,14 C11.312,14 14,11.312 14,8 C14,4.688 11.312,2 7.994,2 L7.994,2 Z M8,12.8 C5.348,12.8 3.2,10.652 3.2,8 C3.2,5.348 5.348,3.2 8,3.2 C10.652,3.2 12.8,5.348 12.8,8 C12.8,10.652 10.652,12.8 8,12.8 L8,12.8 Z"/>
6
+ </g>
7
+ </svg>
Binary file
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M8.5945019,5.20619518 C8.00282982,5.20619518 7.52479044,4.71302851 7.52474333,4.10360812 C7.52474333,3.49462531 8.00278271,3 8.5945019,3 C9.18358286,3 9.66364803,3.49462531 9.66360092,4.10360812 C9.66360092,4.71302851 9.18358286,5.20619518 8.5945019,5.20619518 Z M8.3341643,12.5836633 C8.49024437,12.4752862 8.93266754,12.2858087 8.93266754,12.2858087 L9.14349106,11.9813416 L6.00436421,9.34032538 L6.76530755,10.268702 L4.86737767,13.8867163 C4.75393341,14.1028383 4.53863431,14.2249266 4.31636272,14.2249266 C4.21455499,14.2249266 4.11274725,14.2005187 4.017912,14.1467434 C3.71286568,13.977152 3.60163566,13.5851178 3.76497089,13.2700513 L5.2580254,10.4274022 L3.65793379,8.47821967 L3.5352557,10.8047041 L2.73087565,13.8817569 C2.65512051,14.1698872 2.40199096,14.3591702 2.12497592,14.3591702 C2.07287071,14.3591702 2.01614859,14.3519743 1.96182914,14.3370475 C1.62832754,14.2443752 1.43168455,13.8890015 1.52190288,13.5447621 L2.28157422,10.647025 L2.22423964,7.66181805 L2.99201414,6.80593587 L1.77286531,5.78021921 C1.63774982,5.66790382 1.61631413,5.46515266 1.72514146,5.32594965 C1.83655993,5.18674663 2.03282602,5.16729808 2.16770596,5.27961347 L2.79584227,5.80798202 L3.2207871,3.56536942 L6.45526742,3.56536942 L7.99340754,5.8536375 L6.47114397,8.89947532 L9.62350912,11.551091 C9.68710951,11.5172991 9.75466726,11.483021 9.82019922,11.452973 C10.0544842,11.3443042 10.2885808,11.2369482 10.3950525,11.1014891 C10.4968603,10.9672454 10.7592237,10.9403578 10.7592237,10.9403578 L11.1757355,11.0220903 L11.5144665,11.5069914 L11.8549877,11.9366585 L12.4797791,11.9097223 C12.4797791,11.9097223 12.7421896,12.071048 12.820159,12.1260874 C12.8986937,12.1782096 12.8464,12.4752862 12.8464,12.5557546 C12.8464,12.6374871 13.0807321,13.0404611 13.0807321,13.0404611 L13.3930336,13.3896599 L13.8614152,13.3627236 L14.1502552,13.6595572 L14.5146618,14.0369077 L6.45526742,14.0369077 L7.26440573,13.4164989 L7.6031367,13.4164989 L7.78512804,13.2017869 L7.91520262,12.8792813 C7.91520262,12.8792813 8.17803712,12.6912624 8.3341643,12.5836633 Z M5.58295273,8.15240779 L4.93540653,7.60770245 L6.14315439,7.06465025 L5.58295273,8.15240779 L5.58295273,8.15240779 Z M3.97763175,4.74964041 L4.75892722,4.85699642 L3.7435352,5.9339114 L3.97763175,4.74964041 L3.97763175,4.74964041 Z"/>
5
+ </g>
6
+ </svg>
Binary file
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M7.994,2 C4.682,2 2,4.688 2,8 C2,11.312 4.682,14 7.994,14 C11.312,14 14,11.312 14,8 C14,4.688 11.312,2 7.994,2 L7.994,2 Z M8,12.8 C5.348,12.8 3.2,10.652 3.2,8 C3.2,5.348 5.348,3.2 8,3.2 C10.652,3.2 12.8,5.348 12.8,8 C12.8,10.652 10.652,12.8 8,12.8 Z M8.3,5 L7.4,5 L7.4,8.54098361 L10.55,10.4 L11,9.67409836 L8.3,8.09836066 L8.3,5 Z"/>
5
+ </g>
6
+ </svg>
Binary file
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <polygon fill="#FFF" points="3.35 1.503 3.83 4.947 4.995 3.652 8.517 8.038 3 9.292 7.243 14.5 12.264 14.5 6.097 9.763 12.5 8.312 5.928 2.789 7.106 1.5 3.35 1.503" transform="matrix(1 0 0 -1 0 16)"/>
5
+ </g>
6
+ </svg>
Binary file
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M6.60081848,3.47990828 C6.60081848,2.66274442 7.26356289,2 8.0813895,2 C8.89855337,2 9.56129779,2.66274442 9.56129779,3.47990828 C9.56129779,4.29773489 8.89855337,4.95981657 8.0813895,4.95981657 C7.26356289,4.95981657 6.60081848,4.29773489 6.60081848,3.47990828 Z M5.79425852,12.6648832 L6.72342619,12.6648832 L6.72342619,6.27602698 L5.79425852,6.27602698 C5.63188614,6.27602698 5.5,6.14480358 5.5,5.9824312 C5.5,5.82005882 5.63188614,5.68883542 5.79425852,5.68883542 L9.39030973,5.68883542 L9.39030973,12.6648832 L10.2949559,12.6648832 C10.4573282,12.6648832 10.5885516,12.7967693 10.5885516,12.9584789 C10.5885516,13.1208513 10.4573282,13.2520747 10.2949559,13.2520747 L9.39030973,13.2520747 L6.72342619,13.2534002 L5.79425852,13.2520747 C5.63188614,13.2520747 5.5,13.1208513 5.5,12.9584789 C5.5,12.7967693 5.63188614,12.6648832 5.79425852,12.6648832 Z"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M8.77850454,9.2 C8.77850454,9.65 8.44841,10.01 8.02828968,10.01 C7.60816935,10.01 7.27807481,9.65 7.27807481,9.2 L7.27807481,6.02 C7.27807481,5.57 7.60816935,5.21 8.02828968,5.21 C8.44841,5.21 8.77850454,5.57 8.77850454,6.02 L8.77850454,9.2 Z M7.99828108,12.41 C7.57816076,12.41 7.24806622,12.05 7.24806622,11.6 C7.24806622,11.15 7.57816076,10.79 7.99828108,10.79 C8.41840141,10.79 8.74849595,11.15 8.74849595,11.6 C8.74849595,12.05 8.41840141,12.41 7.99828108,12.41 L7.99828108,12.41 Z M13.9099742,12.83 L8.68847876,2.42 C8.53843578,2.15 8.29836703,2 7.99828108,2 C7.72820373,2 7.45812638,2.15 7.338092,2.42 L2.08658795,12.83 C1.96655357,13.07 1.96655357,13.37 2.11659654,13.61 C2.23663092,13.85 2.47669967,14 2.74677703,14 L13.2497851,14 C13.5198625,14 13.7599312,13.85 13.9099742,13.61 C14.0300086,13.37 14.0300086,13.07 13.9099742,12.83 L13.9099742,12.83 Z"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M11.2884 5.2783L10.7464 6.1713 12.0274 6.9493 13.9694 3.7523 10.7704 1.7993 9.9894 3.0793 11.1424 3.7833C10.1794 3.8683 9.2404 4.1673 8.4474 5.0903 8.7664 5.4493 9.0634 5.8803 9.3324 6.4013 9.8644 5.5903 10.4924 5.3433 11.2884 5.2783M4 9.7494L2 9.7494 2 11.2494 4 11.2494C4.96 11.2494 5.932 11.1664 6.798 10.5894 6.568 10.1804 6.355 9.7144 6.166 9.1804 5.58 9.6794 4.883 9.7494 4 9.7494"/>
5
+ <path fill="#FFF" d="M12.0273,8.9286 L10.7463,9.7066 L11.2883,10.6006 C10.1593,10.5086 9.3633,10.0756 8.7113,8.1386 C7.6173,4.8996 5.7843,4.6286 4.0003,4.6286 L2.0003,4.6286 L2.0003,6.1286 L4.0003,6.1286 C5.5243,6.1286 6.5063,6.2966 7.2893,8.6186 C8.2063,11.3396 9.6473,11.9636 11.1433,12.0946 L9.9893,12.7996 L10.7703,14.0786 L13.9693,12.1256 L12.0273,8.9286 Z"/>
6
+ </g>
7
+ </svg>
Binary file
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M6.82247619,10.361625 C5.52647619,10.361625 4.47580952,11.386125 4.47580952,12.649875 C4.47580952,13.913625 5.52647619,14.93775 6.82247619,14.93775 C8.11847619,14.93775 9.16914286,13.913625 9.16914286,12.649875 C9.16914286,11.386125 8.11847619,10.361625 6.82247619,10.361625 L6.82247619,10.361625 Z M6.82247619,13.725375 C6.21752381,13.725375 5.72685714,13.24725 5.72685714,12.657375 C5.72685714,12.0675 6.21752381,11.589 6.82247619,11.589 C7.42780952,11.589 7.91809524,12.0675 7.91809524,12.657375 C7.91809524,13.24725 7.42780952,13.725375 6.82247619,13.725375 L6.82247619,13.725375 Z M12.2011429,4.13925 C12.0887619,3.51 11.5253333,3 10.9584762,3 L0.00342857143,3 L0.00304761905,4.227375 L1.61828571,4.227375 L1.61828571,8.498625 L0.00114285714,8.498625 L0.000380952381,10.165125 L0.000380952381,10.1655 L0,12.657375 L3.71009524,12.657375 C3.71009524,10.9815 5.10361905,9.622875 6.82247619,9.622875 C8.54133333,9.622875 9.93485714,10.9815 9.93485714,12.657375 L12.1512381,12.657375 C12.7230476,12.657375 13.1866667,12.144375 13.1866667,11.499375 L13.1866667,8.652375 L12.2011429,4.13925 L12.2011429,4.13925 Z M2.35085714,4.227375 L5.58057143,4.227375 L5.58057143,8.498625 L2.35085714,8.498625 L2.35085714,4.227375 Z M6.38895238,4.231125 L7.25638095,4.231125 L7.25638095,8.51325 L6.38895238,8.51325 L6.38895238,4.231125 Z M8.0952381,4.227375 L8.96266667,4.227375 L8.96266667,8.5095 L8.0952381,8.5095 L8.0952381,4.227375 Z M9.81180952,8.5095 L9.81180952,4.227375 L11.2773333,4.227375 L12.2342857,8.5095 L9.81180952,8.5095 L9.81180952,8.5095 Z"/>
5
+ </g>
6
+ </svg>
Binary file
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <rect width="16" height="16" fill="#EB0000" rx="2"/>
4
+ <path fill="#FFF" d="M8.6798,10.6548 C8.4608,10.7108 8.2358,10.7498 7.9998,10.7498 C7.7228,10.7498 7.4608,10.6968 7.2088,10.6198 C6.0798,10.2778 5.2498,9.2398 5.2498,7.9998 C5.2498,7.7638 5.2888,7.5388 5.3448,7.3198 L7.2088,9.1838 L8.6798,10.6548 C8.6898,10.6518 8.6988,10.6488 8.7088,10.6458 L8.7088,10.6838 L8.6798,10.6548 Z M11.0698,10.9238 L10.0098,9.8638 L8.7088,8.5628 L7.2088,7.0628 L6.1368,5.9898 L5.0768,4.9298 L2.6658,2.5198 L1.6058,3.5808 L4.1858,6.1608 C3.9148,6.7198 3.7498,7.3388 3.7498,7.9998 C3.7498,10.0728 5.2428,11.7978 7.2088,12.1698 L7.2088,15.9998 L8.7088,15.9998 L8.7088,12.1788 C9.1088,12.1108 9.4858,11.9858 9.8388,11.8138 L12.9198,14.8948 L13.9798,13.8338 L11.0698,10.9238 Z"/>
5
+ <path fill="#FFF" d="M8.6798 10.6548L8.7088 10.6838 8.7088 10.6458C8.6988 10.6488 8.6898 10.6518 8.6798 10.6548M8 5.25C8.247 5.25 8.481 5.293 8.709 5.354 9.881 5.669 10.75 6.73 10.75 8 10.75 8.152 10.731 8.3 10.706 8.445L11.908 9.647C12.125 9.14 12.25 8.586 12.25 8 12.25 5.899 10.715 4.162 8.709 3.822L8.709 0 7.209 0 7.209 3.83C6.912 3.886 6.631 3.983 6.36 4.098L7.557 5.296C7.701 5.268 7.848 5.25 8 5.25"/>
6
+ </g>
7
+ </svg>
Binary file
@@ -1,9 +1,55 @@
1
- import warningbanner from "../icons/warning-banner.png";
2
- import warning from "../icons/warning.png";
1
+ import sbbConstructionBanner from "../icons/sbb_construction_banner.png";
2
+ // import sbbAddStop from "../icons/sbb_add_stop.png";
3
+ // import sbbAlternative from "../icons/sbb_alternative.png";
4
+ // import sbbCancellation from "../icons/sbb_cancellation.png";
5
+ import sbbConstruction from "../icons/sbb_construction.png";
6
+ // import sbbDelay from "../icons/sbb_delay.png";
7
+ import sbbDisruptionBanner from "../icons/sbb_disruption_banner.png";
8
+ import sbbDisruption from "../icons/sbb_disruption.png";
9
+ // import sbbInfo from "../icons/sbb_info.png";
10
+ import sbbMissedConnectionBanner from "../icons/sbb_missed_connection_banner.png";
11
+ import sbbMissedConnection from "../icons/sbb_missed_connection.png";
12
+ import sbbReplacementBusBanner from "../icons/sbb_replacementbus_banner.png";
13
+ // import sbbPlatformChange from "../icons/sbb_platform_change.png";
14
+ import sbbReplacementBus from "../icons/sbb_replacementbus.png";
15
+ // import sbbReRoute from "../icons/sbb_reroute.png";
16
+ // import warningbanner from "../icons/warning-banner.png";
17
+ // import warning from "../icons/warning.png";
3
18
 
4
- const icons = {
5
- warning: warning,
6
- warningbanner: warningbanner,
19
+ // export const AffectedLineStyleCategoryChoices = {
20
+ // Construction: "CONSTRUCTION",
21
+ // Disruption: "DISRUPTION",
22
+ // IndustrialAction: "INDUSTRIAL_ACTION",
23
+ // LiftFailure: "LIFT_FAILURE",
24
+ // Other: "OTHER",
25
+ // RailReplacement: "RAIL_REPLACEMENT",
26
+ // SpecialEvent: "SPECIAL_EVENT",
27
+ // VehicleFaulure: "VEHICLE_FAULURE",
28
+ // Warning: "WARNING",
29
+ // } as const;
30
+ const defaultIcon = sbbMissedConnection;
31
+ const defaultIconBanner = sbbMissedConnectionBanner;
32
+ export const icons = {
33
+ CONSTRUCTION: sbbConstruction,
34
+ CONSTRUCTION_BANNER: sbbConstructionBanner,
35
+ DISRUPTION: sbbDisruption,
36
+ DISRUPTION_BANNER: sbbDisruptionBanner,
37
+ INDUSTRIAL_ACTION: defaultIcon,
38
+ INDUSTRIAL_ACTION_BANNER: defaultIconBanner,
39
+ LIFT_FAILURE: defaultIcon,
40
+ LIFT_FAILURE_BANNER: defaultIconBanner,
41
+ OTHER: defaultIcon,
42
+ OTHER_BANNER: defaultIconBanner,
43
+ RAIL_REPLACEMENT: sbbReplacementBus,
44
+
45
+ RAIL_REPLACEMENT_BANNER: sbbReplacementBusBanner,
46
+ SPECIAL_EVENT: defaultIcon,
47
+ SPECIAL_EVENT_BANNER: defaultIconBanner,
48
+ VEHICLE_FAULURE: defaultIcon,
49
+ VEHICLE_FAULURE_BANNER: defaultIconBanner,
50
+ warning: defaultIcon,
51
+ WARNING: defaultIcon,
52
+ warningBanner: defaultIconBanner,
7
53
  };
8
54
 
9
55
  // Add a source and styleLayer using the id in parameter.
@@ -1,5 +1,6 @@
1
1
  import { Feature } from "ol";
2
2
 
3
+ import { icons } from "./addSourceAndLayers";
3
4
  import {
4
5
  RVF_LAYERS_TITLES,
5
6
  TITLE_BY_CATEGORY,
@@ -17,11 +18,22 @@ const getFeatureInformationTitle = (feature: Feature) => {
17
18
  feed_id: feedId,
18
19
  line_id: lineId,
19
20
  tickets,
21
+ title,
20
22
  } = selectedFeature.getProperties();
21
- console.log(selectedFeature.getProperties());
22
23
 
23
24
  if (disruptionType) {
24
- return "MOCO Meldung";
25
+ return (
26
+ <div className={"flex items-center gap-2 text-sm"}>
27
+ <div className="min-w-8 shrink-0 grow-0">
28
+ <img
29
+ alt={disruptionType}
30
+ className={"w-8"}
31
+ src={icons[disruptionType]}
32
+ ></img>
33
+ </div>
34
+ <div className={"flex flex-col gap-2 text-base font-bold"}>{title}</div>
35
+ </div>
36
+ );
25
37
  }
26
38
  if (category) {
27
39
  return TITLE_BY_CATEGORY[category] || defaultTitle;
package/src/utils/i18n.ts CHANGED
@@ -6,11 +6,12 @@ const i18n = rosetta(translations);
6
6
 
7
7
  // Set current language to preferred browser language with fallback to english
8
8
  i18n.locale(
9
- navigator.languages // @ts-expect-error bad type definition
10
- .find((l) => {
11
- return i18n.table(l.split("-")[0]) !== undefined;
12
- })
13
- ?.split("-")[0] || "en",
9
+ "de",
10
+ // navigator.languages // @ts-expect-error bad type definition
11
+ // .find((l) => {
12
+ // return i18n.table(l.split("-")[0]) !== undefined;
13
+ // })
14
+ // ?.split("-")[0] || "de",
14
15
  );
15
16
 
16
17
  export default i18n;
@@ -250,10 +250,15 @@ export const fetchSharingStation = async (id: string) => {
250
250
  const client = new GraphQLClient(GQL_URL, {
251
251
  method: "GET",
252
252
  });
253
- const { station }: { station: unknown } = await client.request(queryStation, {
254
- __operation: "station",
255
- id: id,
256
- });
253
+ const { station }: { station: unknown } = await client
254
+ .request(queryStation, {
255
+ __operation: "station",
256
+ id: id,
257
+ })
258
+ .catch((error) => {
259
+ console.error("Error fetching sharing station:", error);
260
+ return { station: null };
261
+ });
257
262
  return station;
258
263
  };
259
264
 
@@ -270,9 +275,8 @@ export const fetchSharingStations = async (
270
275
  signal: abortController.signal,
271
276
  },
272
277
  );
273
- const { stations }: { stations: SharingStation[] } = await client.request(
274
- queryStations,
275
- {
278
+ const { stations }: { stations: SharingStation[] } = await client
279
+ .request(queryStations, {
276
280
  // availableFormFactors: ["BICYCLE"],
277
281
  // id: "NBK:Station:33269707",
278
282
  ids: ids,
@@ -281,8 +285,11 @@ export const fetchSharingStations = async (
281
285
  minimumLatitude: extent?.[1],
282
286
  minimumLongitude: extent?.[0],
283
287
  operators: operators, //["BK:Operator:nextbike"],
284
- },
285
- );
288
+ })
289
+ .catch((error) => {
290
+ console.error("Error fetching sharing stations:", error);
291
+ return { stations: [] };
292
+ });
286
293
  const featureCollection: FeatureCollection<Point, SharingStation> = {
287
294
  features: stations.map((station: SharingStation) => {
288
295
  return {
@@ -1,30 +1,46 @@
1
1
  const translations = {
2
2
  de: {
3
+ consequence: "konsequenz",
4
+ duration_text: "Dauer",
3
5
  no_stops_found: "Keine Haltestellen gefunden",
4
6
  platform_ferry: "St.",
5
7
  platform_other: "Kan.",
6
8
  platform_rail: "Gl.",
9
+ reason: "Grund",
10
+ recommendation: "Empfehlung",
7
11
  stops_search_placeholder: "Haltestellen suchen",
8
12
  },
9
13
  en: {
14
+ consequence: "Consequence",
15
+ duration_text: "Duration",
10
16
  no_stops_found: "No stops found",
11
17
  platform_ferry: "Pier", // pier
12
18
  platform_other: "Std.", // stand
13
19
  platform_rail: "Pl.",
20
+ reason: "Reason",
21
+ recommendation: "Recommendation",
14
22
  stops_search_placeholder: "Search for stop",
15
23
  },
16
24
  fr: {
25
+ consequence: "Conséquence",
26
+ duration_text: "Durée",
17
27
  no_stops_found: "Aucun arrêt trouvé",
18
28
  platform_ferry: "Quai",
19
29
  platform_other: "Quai",
20
30
  platform_rail: "Voie",
31
+ reason: "Raison",
32
+ recommendation: "Recommandation",
21
33
  stops_search_placeholder: "Chercher un arrêt",
22
34
  },
23
35
  it: {
36
+ consequence: "Conseguenza",
37
+ duration_text: "Durata",
24
38
  no_stops_found: "Nessuna fermata trovata",
25
39
  platform_ferry: "Imb.", // imbarcadero
26
40
  platform_other: "Cor.", // corsia
27
41
  platform_rail: "Bin.",
42
+ reason: "Motivo",
43
+ recommendation: "Raccomandazione",
28
44
  stops_search_placeholder: "Ricerca delle fermate",
29
45
  },
30
46
  };