@autobusal/routes-order 1.26.0 → 1.29.0
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.
- package/CHANGELOG.md +44 -0
- package/Facts/types.ts +7 -0
- package/Found/Empty/Empty.tsx +1 -2
- package/Found/Empty/styles.ts +8 -9
- package/Found/Group/Group.tsx +3 -1
- package/Found/Orders/Orders.tsx +12 -0
- package/Found/Route/Route.tsx +64 -2
- package/Found/Route/styles.ts +41 -0
- package/RoutesOrder.tsx +49 -1
- package/Schedule/Schedule.tsx +15 -2
- package/Schedule/styles.ts +18 -0
- package/Sections/Sections.tsx +10 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.29.0
|
|
4
|
+
|
|
5
|
+
### Removed
|
|
6
|
+
|
|
7
|
+
- **The reviews block on the route-pair page.** A review wall sat in the
|
|
8
|
+
middle of a page whose job is to compare departures. What a reader needs
|
|
9
|
+
there about reputation is one number per operator, which the result cards
|
|
10
|
+
already carry; the reviews themselves belong on the operator's own page,
|
|
11
|
+
where somebody who wants to read them has gone looking for them. The `pair`
|
|
12
|
+
mode of the reviews API is untouched — nothing calls it from here now.
|
|
13
|
+
- The "Reviews" entry in the in-page nav, with it.
|
|
14
|
+
|
|
15
|
+
## 1.28.0
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **Overnight trips now say so.** A result card that arrives on a later day
|
|
20
|
+
prints the calendar day under BOTH ends and a `+1` against the arrival
|
|
21
|
+
time; the pair-page timetable carries the same marker. "22:30 → 06:00" is
|
|
22
|
+
the one thing on a result card that can be read as the exact opposite of
|
|
23
|
+
what it means, and the duration beside it does not fix that because nobody
|
|
24
|
+
reads a duration to work out a date.
|
|
25
|
+
- Nothing is added to a same-day card. A date under every arrival would make
|
|
26
|
+
the overnight ones stop standing out, which is the only reason this exists.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- The day comes from the timetable's own midnight markers, computed
|
|
31
|
+
server-side, never from "the arrival looks earlier than the departure" —
|
|
32
|
+
which is wrong for exactly the cross-border journeys whose two ends keep
|
|
33
|
+
different clocks.
|
|
34
|
+
|
|
35
|
+
## 1.27.0
|
|
36
|
+
|
|
37
|
+
**`reloadDocument` is gone — the results follow the URL.**
|
|
38
|
+
|
|
39
|
+
The search lives on `Step1`, which is **not mounted** once results are on screen. So a link that changed the address bar was read by nobody: the URL said one journey and the results underneath still showed another. That is why the empty-search suggestions threw away the whole application on every click.
|
|
40
|
+
|
|
41
|
+
`RoutesOrder` now watches the search spec the URL describes and re-runs when it changes. Keyed on **the spec**, not on a "have we searched yet" flag — a flag can only answer once, a key re-answers whenever the question changes and stays quiet while it does not. It cannot loop either: writing state does not alter the URL the key derives from. The first search is still Step1's, so it does not run twice.
|
|
42
|
+
|
|
43
|
+
Choosing a different search also clears the previously chosen coach. Leaving it set would let the step guards resolve to a checkout for a route the buyer never picked.
|
|
44
|
+
|
|
45
|
+
Verified client-side: navigating from Tirana → Thessaloniki (10 trips) to Durres → Tirana updated the header and the results with the page never reloading.
|
|
46
|
+
|
|
3
47
|
## 1.26.0
|
|
4
48
|
|
|
5
49
|
**Funnel events on every step**: the result list, the coach chosen, checkout reached, the Flexible Ticket ticked or unticked, and the value stashed for the purchase event.
|
package/Facts/types.ts
CHANGED
|
@@ -37,6 +37,13 @@ export interface ScheduleRow {
|
|
|
37
37
|
rating: { average: number, count: number } | null
|
|
38
38
|
departure: string | null
|
|
39
39
|
arrival: string | null
|
|
40
|
+
/**
|
|
41
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
42
|
+
* Days between boarding and arriving - 0 same day, 1 the next morning.
|
|
43
|
+
* A timetable of two clock times per row cannot show an overnight service
|
|
44
|
+
* without it.
|
|
45
|
+
*/
|
|
46
|
+
offset?: number
|
|
40
47
|
minutes: number | null
|
|
41
48
|
// 0 is a direct service
|
|
42
49
|
stops: number
|
package/Found/Empty/Empty.tsx
CHANGED
|
@@ -44,7 +44,6 @@ const Empty = ({ step1, data, loading, t }: Props): JSX.Element => {
|
|
|
44
44
|
const city = (item: NearbyCity, side: 'from' | 'to'): JSX.Element => (
|
|
45
45
|
<Option
|
|
46
46
|
key={ item.city.id }
|
|
47
|
-
reloadDocument
|
|
48
47
|
to={ side === 'from'
|
|
49
48
|
? link(item.city.slug, step1.to, step1.departure)
|
|
50
49
|
: link(step1.from, item.city.slug, step1.departure) }
|
|
@@ -56,7 +55,7 @@ const Empty = ({ step1, data, loading, t }: Props): JSX.Element => {
|
|
|
56
55
|
);
|
|
57
56
|
|
|
58
57
|
const day = (item: FoundDay): JSX.Element => (
|
|
59
|
-
<Option key={ item.id }
|
|
58
|
+
<Option key={ item.id } to={ link(step1.from, step1.to, item.day) }>
|
|
60
59
|
<OptionName>{ item.day }</OptionName>
|
|
61
60
|
<OptionMeta>{ t('routes_order.step2.empty.available') }</OptionMeta>
|
|
62
61
|
{ item.from_price_display && <OptionPrice>{ item.from_price_display }</OptionPrice> }
|
package/Found/Empty/styles.ts
CHANGED
|
@@ -44,17 +44,16 @@ export const Options = styled.div`
|
|
|
44
44
|
`;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Edited: Ferjolt Ozuni - Date: 2026-08-
|
|
47
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
* the search
|
|
51
|
-
*
|
|
52
|
-
*
|
|
49
|
+
* Plain client-side links now. They used to force a full document reload,
|
|
50
|
+
* because the search lived on a Step1 that is not mounted once results are
|
|
51
|
+
* on screen - so a navigation changed the address bar and nothing else, and
|
|
52
|
+
* the old empty result set simply stayed there.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* flow and this is a dead-end page: not worth the risk for the gain.
|
|
54
|
+
* RoutesOrder now follows the URL's search spec, which is the tidier fix
|
|
55
|
+
* the note here previously judged not worth the risk. It became worth it
|
|
56
|
+
* when the same root cause turned up a third time.
|
|
58
57
|
*/
|
|
59
58
|
export const Option = styled(Link)`
|
|
60
59
|
display: flex;
|
package/Found/Group/Group.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { FoundData } from '@autobusal/providers/types/routes';
|
|
|
8
8
|
interface Props {
|
|
9
9
|
items: FoundData[]
|
|
10
10
|
type: 'favorite' | 'normal'
|
|
11
|
+
date?: string
|
|
11
12
|
passengers: number
|
|
12
13
|
t: TFunction<'common'>
|
|
13
14
|
onSave: (data: FoundData) => void
|
|
@@ -23,7 +24,7 @@ interface Props {
|
|
|
23
24
|
* booked, so there is no separate "now choose a time" step to forget: the
|
|
24
25
|
* card always represents a bookable trip, starting with the earliest.
|
|
25
26
|
*/
|
|
26
|
-
const Group = ({ items, type, passengers, t, onSave }: Props): JSX.Element => {
|
|
27
|
+
const Group = ({ items, type, date, passengers, t, onSave }: Props): JSX.Element => {
|
|
27
28
|
// chronological for the picker, regardless of how the list itself is
|
|
28
29
|
// sorted - a row of times out of time order is just confusing
|
|
29
30
|
const departures = useMemo(() => (
|
|
@@ -38,6 +39,7 @@ const Group = ({ items, type, passengers, t, onSave }: Props): JSX.Element => {
|
|
|
38
39
|
<Route
|
|
39
40
|
type={ type }
|
|
40
41
|
data={ current }
|
|
42
|
+
date={ date }
|
|
41
43
|
passengers={ passengers }
|
|
42
44
|
t={ t }
|
|
43
45
|
onSave={ onSave }
|
package/Found/Orders/Orders.tsx
CHANGED
|
@@ -71,6 +71,16 @@ const Orders = ({ loading, data, empty, refined, sort, type, passengers, preferr
|
|
|
71
71
|
* Grouping runs AFTER sorting: groupItems keeps input order, so a
|
|
72
72
|
* collapsed set of shuttles lands wherever its best member sorted to.
|
|
73
73
|
*/
|
|
74
|
+
/**
|
|
75
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
76
|
+
*
|
|
77
|
+
* The day these results board on, for the cards that arrive on a later
|
|
78
|
+
* one. It is the date that was SEARCHED - the same value the strip above
|
|
79
|
+
* highlights - rather than anything the server sends back, so the two can
|
|
80
|
+
* never disagree about which day a card is for.
|
|
81
|
+
*/
|
|
82
|
+
const date = step1[type];
|
|
83
|
+
|
|
74
84
|
const render = (list: FoundData[], kind: 'favorite' | 'normal'): JSX.Element[] => (
|
|
75
85
|
groupItems(sortItems(list, sort)).map(group => (
|
|
76
86
|
group.length > 1
|
|
@@ -79,6 +89,7 @@ const Orders = ({ loading, data, empty, refined, sort, type, passengers, preferr
|
|
|
79
89
|
key={ group[0].id }
|
|
80
90
|
items={ group }
|
|
81
91
|
type={ kind }
|
|
92
|
+
date={ date }
|
|
82
93
|
passengers={ passengers }
|
|
83
94
|
t={ t }
|
|
84
95
|
onSave={ onSave }
|
|
@@ -89,6 +100,7 @@ const Orders = ({ loading, data, empty, refined, sort, type, passengers, preferr
|
|
|
89
100
|
key={ group[0].id }
|
|
90
101
|
type={ kind }
|
|
91
102
|
data={ group[0] }
|
|
103
|
+
date={ date }
|
|
92
104
|
passengers={ passengers }
|
|
93
105
|
t={ t }
|
|
94
106
|
onSave={ onSave }
|
package/Found/Route/Route.tsx
CHANGED
|
@@ -6,7 +6,8 @@ import { RiBus2Line } from 'react-icons/ri';
|
|
|
6
6
|
import { MdOutlineAltRoute } from 'react-icons/md';
|
|
7
7
|
import { formatDuration, splitPrice } from '../refine';
|
|
8
8
|
import { Button, RouteFeature, Information, Rating } from '@autobusal/common';
|
|
9
|
-
import {
|
|
9
|
+
import { createDate, getDayParts } from '@autobusal/utilities';
|
|
10
|
+
import { Container, ButtonDetails, SpecialOffer, FavoriteStop, Trip, Company, Location, Stop, Iso, Time, Price, Amount, Decimals, Currency, PriceNotice, LinkCompany, CodeCompany, Details, Detail, ButtonPolicy, TitleDetail, FeaturesItems, Leaves, Day, NextDay } from './styles';
|
|
10
11
|
import { FoundData } from '@autobusal/providers/types/routes';
|
|
11
12
|
|
|
12
13
|
// neutral placeholder so a missing/broken operator logo doesn't render the
|
|
@@ -16,6 +17,11 @@ const LOGO_FALLBACK = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/s
|
|
|
16
17
|
interface Props {
|
|
17
18
|
data: FoundData
|
|
18
19
|
type: 'favorite' | 'normal'
|
|
20
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
21
|
+
// The searched boarding day, dd/mm/yyyy. Only used to print the two dates
|
|
22
|
+
// on an overnight trip - a card that arrives the same day says nothing
|
|
23
|
+
// about days at all, which is why this can be absent.
|
|
24
|
+
date?: string
|
|
19
25
|
passengers: number
|
|
20
26
|
t: TFunction<'common'>
|
|
21
27
|
onSave: (data: FoundData) => void
|
|
@@ -25,7 +31,7 @@ interface Props {
|
|
|
25
31
|
children?: React.ReactNode
|
|
26
32
|
}
|
|
27
33
|
|
|
28
|
-
const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Element => {
|
|
34
|
+
const Route = ({ data, type, date, passengers, t, onSave, children }: Props): JSX.Element => {
|
|
29
35
|
const [ information, setInformation ] = useState<boolean>(false);
|
|
30
36
|
|
|
31
37
|
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
@@ -63,6 +69,53 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
|
|
|
63
69
|
|
|
64
70
|
const soon = leaves !== null && leaves < 60;
|
|
65
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
74
|
+
*
|
|
75
|
+
* Overnight trips. "22:30 -> 06:00" is the one thing on this card that
|
|
76
|
+
* can be read as the exact opposite of what it means - a seven-and-a-half
|
|
77
|
+
* hour journey looks like a sixteen-hour one run backwards - and the
|
|
78
|
+
* duration beside it does not fix that, because nobody reads a duration
|
|
79
|
+
* to work out a date. So when the coach arrives on a later day, BOTH ends
|
|
80
|
+
* print their day and the arrival carries a +1.
|
|
81
|
+
*
|
|
82
|
+
* Nothing is added to a same-day card: a date under every arrival on a
|
|
83
|
+
* page of same-day results is noise that makes the overnight ones stop
|
|
84
|
+
* standing out, which is the only reason any of this is here.
|
|
85
|
+
*
|
|
86
|
+
* The offset comes from the timetable's own midnight markers, computed
|
|
87
|
+
* server-side (Libraries\Routes\Search\Locations::offset) - it is not
|
|
88
|
+
* inferred from "arrival looks earlier than departure", which is wrong
|
|
89
|
+
* for exactly the cross-border journeys where the two ends keep
|
|
90
|
+
* different clocks.
|
|
91
|
+
*/
|
|
92
|
+
const offset = data.arrival_offset ?? 0;
|
|
93
|
+
|
|
94
|
+
const days = ((): { departure: string, arrival: string } | null => {
|
|
95
|
+
if (offset <= 0 || !date) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const departs = createDate(date);
|
|
100
|
+
|
|
101
|
+
// an invalid or unexpected date string must not print "NaN Invalid" on
|
|
102
|
+
// a result card - showing no day is better than showing a wrong one
|
|
103
|
+
if (Number.isNaN(departs.getTime())) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const arrives = new Date(departs);
|
|
108
|
+
arrives.setUTCDate(arrives.getUTCDate() + offset);
|
|
109
|
+
|
|
110
|
+
const format = (value: Date): string => {
|
|
111
|
+
const parts = getDayParts(value, t as any);
|
|
112
|
+
|
|
113
|
+
return `${ parts.day } ${ parts.month }`;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return { departure: format(departs), arrival: format(arrives) };
|
|
117
|
+
})();
|
|
118
|
+
|
|
66
119
|
return (
|
|
67
120
|
<Container className="box" $type={ type }>
|
|
68
121
|
{ data.price.offer === true && <SpecialOffer>{ t('routes_order.step2.route.offer') }</SpecialOffer> }
|
|
@@ -116,6 +169,8 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
|
|
|
116
169
|
{ data.locations.from.departure }
|
|
117
170
|
</h2>
|
|
118
171
|
|
|
172
|
+
{ days && <Day>{ days.departure }</Day> }
|
|
173
|
+
|
|
119
174
|
<Stop>{ data.locations.from.stop?.name }</Stop>
|
|
120
175
|
</Location>
|
|
121
176
|
|
|
@@ -144,8 +199,15 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
|
|
|
144
199
|
<Iso>({ data.locations.to.city.country?.iso_code })</Iso>
|
|
145
200
|
{ ' ' }
|
|
146
201
|
{ data.locations.to.arrival }
|
|
202
|
+
{ offset > 0 && (
|
|
203
|
+
<NextDay title={ t('routes_order.step2.route.next_day', { count: offset }) }>
|
|
204
|
+
+{ offset }
|
|
205
|
+
</NextDay>
|
|
206
|
+
) }
|
|
147
207
|
</h2>
|
|
148
208
|
|
|
209
|
+
{ days && <Day>{ days.arrival }</Day> }
|
|
210
|
+
|
|
149
211
|
<Stop>{ data.locations.to.stop?.name }</Stop>
|
|
150
212
|
</Location>
|
|
151
213
|
|
package/Found/Route/styles.ts
CHANGED
|
@@ -609,3 +609,44 @@ export const Leaves = styled.div<{ $soon: boolean }>`
|
|
|
609
609
|
background: ${ props => (props.$soon ? props.theme.font.error : props.theme.primary.neutral) };
|
|
610
610
|
`;
|
|
611
611
|
|
|
612
|
+
/**
|
|
613
|
+
* The +1 on an overnight arrival.
|
|
614
|
+
*
|
|
615
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
616
|
+
*
|
|
617
|
+
* Sits INSIDE the h2, right against the clock time it qualifies, because
|
|
618
|
+
* that is the number it changes the meaning of. Raised and shrunk rather
|
|
619
|
+
* than boxed: it reads as an annotation on the time, the way a footnote
|
|
620
|
+
* marker does, and a second pill on a card that already carries an offer
|
|
621
|
+
* badge and a countdown would compete with both.
|
|
622
|
+
*
|
|
623
|
+
* The title attribute carries the sentence - "arrives the next day" - so
|
|
624
|
+
* the meaning is available to anyone for whom "+1" is not self-evident,
|
|
625
|
+
* which on a first visit is most people.
|
|
626
|
+
*/
|
|
627
|
+
export const NextDay = styled.sup`
|
|
628
|
+
margin-left: 4px;
|
|
629
|
+
padding: 1px 4px;
|
|
630
|
+
border-radius: 4px;
|
|
631
|
+
font-size: ${ props => props.theme.size.xs };
|
|
632
|
+
font-weight: 700;
|
|
633
|
+
white-space: nowrap;
|
|
634
|
+
vertical-align: super;
|
|
635
|
+
cursor: help;
|
|
636
|
+
color: ${ props => props.theme.font.normal };
|
|
637
|
+
background: ${ props => props.theme.primary.neutral };
|
|
638
|
+
`;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* The calendar day under one end of an overnight trip.
|
|
642
|
+
*
|
|
643
|
+
* Rendered on BOTH ends or neither: a date shown only over the arrival
|
|
644
|
+
* leaves the reader working out what day the departure was, which is the
|
|
645
|
+
* question the whole thing exists to answer.
|
|
646
|
+
*/
|
|
647
|
+
export const Day = styled.span`
|
|
648
|
+
font-size: ${ props => props.theme.size.xs };
|
|
649
|
+
font-weight: 700;
|
|
650
|
+
white-space: nowrap;
|
|
651
|
+
color: ${ props => props.theme.primary.normal };
|
|
652
|
+
`;
|
package/RoutesOrder.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import { TFunction } from 'i18next';
|
|
4
4
|
import { AiOutlineSearch, AiOutlineCaretDown, AiOutlineCaretUp } from 'react-icons/ai';
|
|
@@ -13,6 +13,7 @@ import { useGetSuggestions } from '@autobusal/routes-search/services';
|
|
|
13
13
|
import { SearchAgain, SearchInner, SearchToggle, SearchSummary, SearchPanel } from './styles';
|
|
14
14
|
import Sections from './Sections/Sections';
|
|
15
15
|
import Step1 from './Step1/Step1';
|
|
16
|
+
import prepare from './Step1/prepare';
|
|
16
17
|
import Step2 from './Step2';
|
|
17
18
|
import Step3 from './Step3';
|
|
18
19
|
import Checkout from './Checkout/Checkout';
|
|
@@ -125,6 +126,53 @@ const RoutesOrder = ({ t }: Props): JSX.Element => {
|
|
|
125
126
|
}, { replace });
|
|
126
127
|
};
|
|
127
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Follow the URL when it describes a different search.
|
|
131
|
+
*
|
|
132
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
133
|
+
*
|
|
134
|
+
* THE SEARCH LIVES ON STEP 1, WHICH IS NOT MOUNTED once results are on
|
|
135
|
+
* screen - `showStep1` is false from step 2 onwards. So a link that
|
|
136
|
+
* changed the address bar was read by nobody: the URL said one journey
|
|
137
|
+
* and the results underneath still showed another. That is why the
|
|
138
|
+
* empty-search suggestions carried `reloadDocument`, throwing away the
|
|
139
|
+
* whole application to do what a route change should have done by itself.
|
|
140
|
+
*
|
|
141
|
+
* Keyed on the SPEC the URL describes rather than on a "have we searched
|
|
142
|
+
* yet" flag. A flag can only ever answer once; a key re-answers whenever
|
|
143
|
+
* the question changes and stays quiet while it does not, which is the
|
|
144
|
+
* behaviour that was actually wanted. It also cannot loop: writing state
|
|
145
|
+
* does not alter the URL the key is derived from.
|
|
146
|
+
*
|
|
147
|
+
* The FIRST search is still Step1's - it owns the empty state a visitor
|
|
148
|
+
* arrives at, and duplicating that here would run it twice.
|
|
149
|
+
*/
|
|
150
|
+
const urlSpec = useMemo(
|
|
151
|
+
() => prepare(undefined, params, searchParams, settings.preferences.defaultLocations),
|
|
152
|
+
[params, searchParams, settings.preferences.defaultLocations]
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
// Only a URL that actually carries a complete search - the bare
|
|
156
|
+
// /bus-lines form describes nothing to follow.
|
|
157
|
+
const urlKey = params.departure !== undefined ? JSON.stringify(urlSpec) : null;
|
|
158
|
+
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (urlKey === null || step1 === undefined || urlKey === JSON.stringify(step1)) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
setStep1(urlSpec);
|
|
165
|
+
|
|
166
|
+
// the previous journey's chosen coach is not on offer for a different
|
|
167
|
+
// search, and leaving it set would let the guards resolve to a checkout
|
|
168
|
+
// for a route the buyer never picked
|
|
169
|
+
setStep2(undefined);
|
|
170
|
+
setStep3(undefined);
|
|
171
|
+
|
|
172
|
+
goto(null, true);
|
|
173
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
174
|
+
}, [urlKey]);
|
|
175
|
+
|
|
128
176
|
const onSearchDate = (type: ('departure' | '_return'), day: string): void => {
|
|
129
177
|
if (step1 !== undefined) {
|
|
130
178
|
setStep1({
|
package/Schedule/Schedule.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TFunction } from 'i18next';
|
|
2
2
|
import { Rating } from '@autobusal/common';
|
|
3
|
-
import { Container, Table, Time, Faded, Price, Operator } from './styles';
|
|
3
|
+
import { Container, Table, Time, Faded, Price, Operator, NextDay } from './styles';
|
|
4
4
|
import { ScheduleRow } from '../Facts/types';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
@@ -69,7 +69,20 @@ const Schedule = ({ id, from, to, rows, t }: Props): (JSX.Element | null) => {
|
|
|
69
69
|
{ rows.map((row, index) => (
|
|
70
70
|
<tr key={ index }>
|
|
71
71
|
<td><Time>{ row.departure ?? '-' }</Time></td>
|
|
72
|
-
|
|
72
|
+
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
73
|
+
The same +1 the result cards carry. A timetable is read
|
|
74
|
+
precisely to plan around a time, so a row whose arrival
|
|
75
|
+
is the following morning and does not say so is the one
|
|
76
|
+
row on the page somebody will actually act on wrongly. */ }
|
|
77
|
+
<td>
|
|
78
|
+
<Time>{ row.arrival ?? '-' }</Time>
|
|
79
|
+
|
|
80
|
+
{ (row.offset ?? 0) > 0 && (
|
|
81
|
+
<NextDay title={ t('routes_order.step2.route.next_day', { count: row.offset }) }>
|
|
82
|
+
+{ row.offset }
|
|
83
|
+
</NextDay>
|
|
84
|
+
) }
|
|
85
|
+
</td>
|
|
73
86
|
<td><Faded>{ duration(row.minutes) }</Faded></td>
|
|
74
87
|
|
|
75
88
|
<td>
|
package/Schedule/styles.ts
CHANGED
|
@@ -51,3 +51,21 @@ export const Operator = styled.div`
|
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
gap: 2px;
|
|
53
53
|
`;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The +1 on an overnight arrival, matching the result cards.
|
|
57
|
+
*
|
|
58
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
59
|
+
*/
|
|
60
|
+
export const NextDay = styled.sup`
|
|
61
|
+
margin-left: 4px;
|
|
62
|
+
padding: 1px 4px;
|
|
63
|
+
border-radius: 4px;
|
|
64
|
+
font-size: ${ props => props.theme.size.xs };
|
|
65
|
+
font-weight: 700;
|
|
66
|
+
white-space: nowrap;
|
|
67
|
+
vertical-align: super;
|
|
68
|
+
cursor: help;
|
|
69
|
+
color: ${ props => props.theme.font.normal };
|
|
70
|
+
background: ${ props => props.theme.primary.neutral };
|
|
71
|
+
`;
|
package/Sections/Sections.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import { TFunction } from 'i18next';
|
|
|
2
2
|
import Facts from '../Facts/Facts';
|
|
3
3
|
import Schedule from '../Schedule/Schedule';
|
|
4
4
|
import Links from '../Links/Links';
|
|
5
|
-
import { Reviews } from '@autobusal/reviews';
|
|
6
5
|
import Schema from './Schema';
|
|
7
6
|
import { useGetFacts } from '../Facts/services';
|
|
8
7
|
import { Nav, Anchor, Anchored } from './styles';
|
|
@@ -17,7 +16,6 @@ const TRIPS = 'trips';
|
|
|
17
16
|
const FACTS = 'facts';
|
|
18
17
|
const SCHEDULE = 'schedule';
|
|
19
18
|
const LINKS = 'links';
|
|
20
|
-
const REVIEWS = 'reviews';
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* Everything on a route-pair page that is not the booking wizard.
|
|
@@ -65,8 +63,6 @@ const Sections = ({ from, to, t }: Props): (JSX.Element | null) => {
|
|
|
65
63
|
{ schedule.length > 0 && (
|
|
66
64
|
<Anchor href={ `#${ SCHEDULE }` }>{ t('routes_order.sections.schedule') }</Anchor>
|
|
67
65
|
) }
|
|
68
|
-
|
|
69
|
-
<Anchor href={ `#${ REVIEWS }` }>{ t('routes_order.sections.reviews') }</Anchor>
|
|
70
66
|
</Nav>
|
|
71
67
|
|
|
72
68
|
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
@@ -82,22 +78,16 @@ const Sections = ({ from, to, t }: Props): (JSX.Element | null) => {
|
|
|
82
78
|
<Schedule id={ SCHEDULE } from={ facts.from } to={ facts.to } rows={ schedule } t={ t } />
|
|
83
79
|
</Anchored>
|
|
84
80
|
|
|
85
|
-
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{ /* the anchor lives on a wrapper: Reviews takes the SUBJECT's id,
|
|
96
|
-
which a pair does not have - it is named by its two ends */ }
|
|
97
|
-
<div id={ REVIEWS }>
|
|
98
|
-
<Reviews type="pair" id={ 0 } pair={ { from: from ?? '', to: to ?? '' } } t={ t } />
|
|
99
|
-
</div>
|
|
100
|
-
</Anchored>
|
|
81
|
+
{ /* Edited: Ferjolt Ozuni - Date: 2026-08-05
|
|
82
|
+
NO reviews block here any more. A pair-level review wall sat in
|
|
83
|
+
the middle of a page whose job is to compare departures, where
|
|
84
|
+
what a reader needs about reputation is one number per operator -
|
|
85
|
+
and the result cards already carry exactly that.
|
|
86
|
+
|
|
87
|
+
The reviews themselves live on the operator's own page, which is
|
|
88
|
+
where somebody who wants to read them has gone looking for them.
|
|
89
|
+
The `pair` mode of Reviews\BrowseController is untouched and
|
|
90
|
+
still works; nothing calls it from here. */ }
|
|
101
91
|
|
|
102
92
|
<Links
|
|
103
93
|
id={ LINKS }
|