@autobusal/routes-order 1.24.0 → 1.25.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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.25.0
4
+
5
+ **Reviews on the route-pair page.** A new section between the timetable and the internal links, with its own nav anchor.
6
+
7
+ Renders nothing below the display threshold, so a pair without enough reviews does not gain an empty box.
8
+
3
9
  ## 1.24.0
4
10
 
5
11
  **The booking wizard has real URLs.** The step now lives in the URL and `current` is derived from it, rather than the reverse.
@@ -2,6 +2,7 @@ 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';
5
6
  import Schema from './Schema';
6
7
  import { useGetFacts } from '../Facts/services';
7
8
  import { Nav, Anchor, Anchored } from './styles';
@@ -16,6 +17,7 @@ const TRIPS = 'trips';
16
17
  const FACTS = 'facts';
17
18
  const SCHEDULE = 'schedule';
18
19
  const LINKS = 'links';
20
+ const REVIEWS = 'reviews';
19
21
 
20
22
  /**
21
23
  * Everything on a route-pair page that is not the booking wizard.
@@ -63,6 +65,8 @@ const Sections = ({ from, to, t }: Props): (JSX.Element | null) => {
63
65
  { schedule.length > 0 && (
64
66
  <Anchor href={ `#${ SCHEDULE }` }>{ t('routes_order.sections.schedule') }</Anchor>
65
67
  ) }
68
+
69
+ <Anchor href={ `#${ REVIEWS }` }>{ t('routes_order.sections.reviews') }</Anchor>
66
70
  </Nav>
67
71
 
68
72
  { /* Edited: Ferjolt Ozuni - Date: 2026-08-03
@@ -78,6 +82,23 @@ const Sections = ({ from, to, t }: Props): (JSX.Element | null) => {
78
82
  <Schedule id={ SCHEDULE } from={ facts.from } to={ facts.to } rows={ schedule } t={ t } />
79
83
  </Anchored>
80
84
 
85
+ { /* Edited: Ferjolt Ozuni - Date: 2026-08-03
86
+ Reviews for the PAIR, not for one coach on it. A review belongs to
87
+ a route, but a single route rarely has enough published reviews to
88
+ clear the display threshold - the pair it runs on often does, so
89
+ aggregating across the routes that sell this leg is what makes the
90
+ block appear at all rather than a nicety.
91
+
92
+ Renders nothing below the threshold, so a pair without enough
93
+ reviews does not gain an empty box. */ }
94
+ <Anchored>
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>
101
+
81
102
  <Links
82
103
  id={ LINKS }
83
104
  from={ links.from }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.24.0",
3
+ "version": "1.25.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"