@autobusal/routes-order 1.11.3 → 1.13.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 CHANGED
@@ -6,6 +6,25 @@ All notable changes to this package are documented here. This project follows
6
6
  > Note: 1.8.0 was published without a changelog entry. The gap is left as-is
7
7
  > rather than reconstructed after the fact.
8
8
 
9
+ ## 1.13.0
10
+
11
+ The operator's rating on each result card. The operator's rather than the
12
+ route's: a single route rarely has enough published reviews to clear the
13
+ display threshold, and a card with a rating beats one without.
14
+
15
+ ## [1.12.0] - 2026-08-01
16
+
17
+ ### Removed
18
+
19
+ - **The Booking.com hotel banner.** It was unmounted from `Found` earlier on
20
+ 2026-08-01 for sitting between the date strip and the trips - advertising a
21
+ hotel to somebody still deciding whether they can travel at all - and the
22
+ component is now deleted rather than kept dormant. It was never an
23
+ integration, only a hand-built `searchresults.xu.html` link built from
24
+ `city.booking_id`; leaving the component, the column and its admin field in
25
+ place made it look like one. The `routes_order.step2.booking` strings and
26
+ the `s-ec.bstatic.com` CSP entry go with it.
27
+
9
28
  ## [1.11.1] - 2026-08-01
10
29
 
11
30
  ### Changed
package/Found/Found.tsx CHANGED
@@ -90,12 +90,14 @@ const Found = ({ type, loading, data, step1, preferredStop, t, onSearch, onSave
90
90
  <Dates type={ type } step1={ step1 } t={ t } onSearch={ onSearch } />
91
91
 
92
92
  { /* Edited: Ferjolt Ozuni - Date: 2026-08-01
93
- The Booking.com banner is gone from the results. It sat between
94
- the date strip and the trips, pushing the actual results below
95
- it and advertising a hotel to somebody still deciding whether
96
- they can travel at all. The component is kept, unused, so the
97
- affiliate placement can be reinstated somewhere it does not
98
- interrupt the search. */ }
93
+ The Booking.com banner used to sit here, between the date strip
94
+ and the trips, pushing the actual results below it to advertise a
95
+ hotel to somebody still deciding whether they can travel at all.
96
+ It was unmounted earlier today and the component is now removed
97
+ outright, along with cities.booking_id - it was never really an
98
+ integration, just a hand-built searchresults.xu.html link, and
99
+ leaving the column and its admin field behind made it look like
100
+ one. */ }
99
101
 
100
102
  { showControls && (
101
103
  <>
@@ -4,7 +4,7 @@ import { HiOutlineArrowNarrowRight, HiOutlineDocumentText } from 'react-icons/hi
4
4
  import { BiHourglass } from 'react-icons/bi';
5
5
  import { RiBus2Line } from 'react-icons/ri';
6
6
  import { formatDuration, splitPrice } from '../refine';
7
- import { Button, RouteFeature, Policy } from '@autobusal/common';
7
+ import { Button, RouteFeature, Policy, Rating } from '@autobusal/common';
8
8
  import { Container, SpecialOffer, FavoriteStop, Trip, Company, Location, Stop, Iso, Time, Price, Amount, Decimals, Currency, PriceNotice, LinkCompany, Details, Detail, ButtonPolicy, TitleDetail, LinkRoute, FeaturesItems } from './styles';
9
9
  import { FoundData } from '@autobusal/providers/types/routes';
10
10
 
@@ -55,6 +55,14 @@ const Route = ({ data, type, passengers, t, onSave, children }: Props): JSX.Elem
55
55
  <Trip>
56
56
  <Company>
57
57
  <LinkCompany to={ bookOnUrl ?? data.operator.link } target="_blank" rel="noopener noreferrer" title={ data.operator.company }><img src={ data.operator.logo_url || LOGO_FALLBACK } onError={ (e) => { e.currentTarget.onerror = null; e.currentTarget.src = LOGO_FALLBACK; } } alt={ data.operator.company } /></LinkCompany>
58
+
59
+ { /* Edited: Ferjolt Ozuni - Date: 2026-08-03
60
+ The OPERATOR's rating rather than this route's: a single route
61
+ rarely has enough published reviews to clear the display
62
+ threshold, and a card with a rating beats one without. Renders
63
+ nothing when there is no rating yet, which is why a brand-new
64
+ operator does not look like a badly rated one. */ }
65
+ <Rating rating={ data.operator.rating } size="small" t={ t } />
58
66
  </Company>
59
67
 
60
68
  <Location>
@@ -63,6 +63,17 @@ export const Trip = styled.div`
63
63
  export const Company = styled.div`
64
64
  flex-basis: 100%;
65
65
 
66
+ /**
67
+ * Edited: Ferjolt Ozuni - Date: 2026-08-03
68
+ * A column now, because the operator's rating sits under the logo. Left
69
+ * as a bare block it would have laid the stars out beside the logo and
70
+ * eaten the 185px this cell gets on desktop.
71
+ */
72
+ display: flex;
73
+ flex-direction: column;
74
+ gap: 6px;
75
+ align-items: flex-start;
76
+
66
77
  @media (min-width: 1024px) {
67
78
  flex: 0 0 185px;
68
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.11.3",
3
+ "version": "1.13.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
@@ -1,61 +0,0 @@
1
- import { TFunction } from 'i18next';
2
- import { createDate } from '@autobusal/utilities';
3
- import { Container, About, LinkBooking } from './styles';
4
- import { RoutesSearchForm } from '@autobusal/routes-search/types';
5
- import { FoundData } from '@autobusal/providers/types/routes';
6
- import { useGetSettings } from '@autobusal/providers/services';
7
-
8
- interface Props {
9
- data?: FoundData[]
10
- step1: RoutesSearchForm
11
- t: TFunction<'public'>
12
- }
13
-
14
- const Booking = ({ data, step1, t }: Props): (JSX.Element | null) => {
15
- const { data: settings } = useGetSettings();
16
-
17
- if (data === undefined || data?.length === 0) {
18
- return null;
19
- }
20
-
21
- const destination = data[0].locations.to;
22
-
23
- // stop if no booking city
24
- if (destination.city.booking_id === undefined) {
25
- return null;
26
- }
27
-
28
- // stop if no booking id
29
- if (settings.preferences.bookingID === undefined) {
30
- return null;
31
- }
32
-
33
- const from = createDate(step1.departure);
34
- const to = getReturnDate(step1._return, from);
35
-
36
- const location = `https://www.booking.com/searchresults.xu.html?city=${ destination.city.booking_id }&aid=&checkin_monthday=${ from.getDate() }&checkin_month=${ from.getMonth() + 1 }&checkin_year=${ from.getFullYear() }&checkout_monthday=${ to.getDate() }&checkout_month=${ to.getMonth() + 1 }&checkout_year=${ to.getFullYear() }&no_rooms=1&group_adults=2&room1=A%2CA`;
37
-
38
- return (
39
- <Container>
40
- <About>
41
- { t('routes_order.step2.booking.title', { location: destination.city.name }) }
42
- <img src="https://s-ec.bstatic.com/static/img/b26logo/booking_logo_retina/22615963add19ac6b6d715a97c8d477e8b95b7ea.png" alt="Booking.com" />
43
- </About>
44
-
45
- <LinkBooking to={ location } target="_blank" rel="noopener noreferrer">{ t('routes_order.step2.booking.search') }</LinkBooking>
46
- </Container>
47
- );
48
- };
49
-
50
- const getReturnDate = (_return: (string | undefined), from: Date): Date => {
51
- if (_return !== undefined) {
52
- return createDate(_return);
53
- }
54
-
55
- const to = new Date(from);
56
- to.setDate(to.getDate() + 2);
57
-
58
- return to;
59
- };
60
-
61
- export default Booking;
@@ -1,50 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import styled from 'styled-components';
3
-
4
- export const Container = styled.div`
5
- display: flex;
6
- flex-direction: column;
7
- gap: 15px;
8
- margin-bottom: 15px;
9
- padding: 15px;
10
- background: #003580;
11
- border-radius: ${ props => props.theme.borderRadius };
12
-
13
- @media (min-width: 480px) {
14
- flex-direction: row;
15
- align-items: center;
16
- }
17
- `;
18
-
19
- export const About = styled.div`
20
- color: #FFFFFF;
21
- font-weight: 700;
22
-
23
- > img {
24
- display: block;
25
- width: 110px;
26
- margin-top: 6px;
27
- }
28
- `;
29
-
30
- export const LinkBooking = styled(Link)`
31
- display: inline-block;
32
- max-width: 150px;
33
- padding: 6px 0;
34
- text-align: center;
35
- font-weight: 700;
36
- color: #333333;
37
- background: #FFFFFF;
38
- border-radius: 100px;
39
- transition: all 0.3s ease;
40
-
41
- &:hover {
42
- text-decoration: none;
43
- box-shadow: 0 4px 24px 0 rgba(255, 255, 255, 0.5);
44
- }
45
-
46
- @media (min-width: 480px) {
47
- flex-basis: 150px;
48
- margin-left: auto;
49
- }
50
- `;