@autobusal/operator-routes 1.1.2 → 1.2.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 +9 -0
- package/Manage.tsx +15 -0
- package/package.json +1 -1
- package/services.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented here. This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [1.2.0] - 2026-07-25
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **"Required Passenger Details" checkbox list on the route form** (sex /
|
|
10
|
+
passport / phone / WhatsApp / Telegram), stored as
|
|
11
|
+
`routes_trip.passenger_fields`. A checked detail is shown AND required at
|
|
12
|
+
checkout; unchecked ones are hidden entirely.
|
|
13
|
+
|
|
5
14
|
## [1.1.2] - 2026-07-19
|
|
6
15
|
|
|
7
16
|
### Fixed
|
package/Manage.tsx
CHANGED
|
@@ -123,6 +123,21 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
123
123
|
type: 'checkbox-list',
|
|
124
124
|
selected: data?.trip?.features ?? [],
|
|
125
125
|
values: features
|
|
126
|
+
}, {}, {
|
|
127
|
+
// Edited: Ferjolt Ozuni - Date: 2026-07-25
|
|
128
|
+
// which passenger details this route requires at checkout: a
|
|
129
|
+
// checked detail is shown AND required on the booking form, an
|
|
130
|
+
// unchecked one is hidden entirely (name + date of birth are
|
|
131
|
+
// always collected). Unsaved legacy routes default to
|
|
132
|
+
// sex + passport - the pre-feature behavior.
|
|
133
|
+
label: t('operator_routes.manage.passenger_fields.title', { ns: 'common' }),
|
|
134
|
+
name: 'passenger_fields',
|
|
135
|
+
type: 'checkbox-list',
|
|
136
|
+
selected: data?.trip?.passenger_fields ?? ['sex', 'passport'],
|
|
137
|
+
values: ['sex', 'passport', 'phone', 'whatsapp', 'telegram'].map(id => ({
|
|
138
|
+
id,
|
|
139
|
+
name: t(`operator_routes.manage.passenger_fields.${ id }`, { ns: 'common' })
|
|
140
|
+
}))
|
|
126
141
|
}, {}, {
|
|
127
142
|
label: t('operator_routes.manage.bags_no', { ns: 'common' }),
|
|
128
143
|
name: 'bags_no',
|
package/package.json
CHANGED
package/services.ts
CHANGED
|
@@ -47,6 +47,7 @@ export const usePostRoute = (id: number, seating?: SeatingOptionsData): UseMutat
|
|
|
47
47
|
id,
|
|
48
48
|
...seating,
|
|
49
49
|
features: JSON.stringify(data.features),
|
|
50
|
+
passenger_fields: JSON.stringify(data.passenger_fields),
|
|
50
51
|
drivers: JSON.stringify(data.drivers)
|
|
51
52
|
})
|
|
52
53
|
.then(response => (
|