@autobusal/operator-routes 1.2.0 → 1.3.1
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 +17 -0
- package/Manage.tsx +54 -7
- package/Transiting/Manage.tsx +9 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.1] - 2026-08-07
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Transiting country select no longer defaults to Afghanistan.** `value`
|
|
8
|
+
was `0`, so submitting without touching the field added the first country
|
|
9
|
+
in the list to the route's transit list.
|
|
10
|
+
|
|
11
|
+
## 1.3.0
|
|
12
|
+
|
|
13
|
+
**The operator's own notice windows.**
|
|
14
|
+
|
|
15
|
+
- `information_en|sq` replaces `policies_en|sq` on the route form.
|
|
16
|
+
- Two new fields: cancellation notice and reschedule notice, in hours before departure, with a note saying the two things an operator cannot guess from the labels — that **empty means "not offered on this line"** (not zero, which would be offering it right up until the coach pulls away), and that these numbers are **never shown to passengers**.
|
|
17
|
+
|
|
18
|
+
They decide whether Flexible Ticket may be sold on the line and what window it grants. A passenger only ever sees the resolved consequence.
|
|
19
|
+
|
|
3
20
|
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
21
|
|
|
5
22
|
## [1.2.0] - 2026-07-25
|
package/Manage.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
2
3
|
import { TFunction } from 'i18next';
|
|
3
4
|
import { useParams, useNavigate } from 'react-router-dom';
|
|
4
5
|
import { RiMoneyEuroCircleLine } from 'react-icons/ri';
|
|
@@ -209,15 +210,45 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
209
210
|
type: 'checkbox',
|
|
210
211
|
value: data?.searchable
|
|
211
212
|
}, {}, {
|
|
212
|
-
label: t('operator_routes.manage.
|
|
213
|
-
name: '
|
|
213
|
+
label: t('operator_routes.manage.information_en', { ns: 'common' }),
|
|
214
|
+
name: 'information_en',
|
|
214
215
|
type: 'textarea-html',
|
|
215
|
-
value: data?.
|
|
216
|
+
value: data?.information_en
|
|
216
217
|
}, {}, {
|
|
217
|
-
label: t('operator_routes.manage.
|
|
218
|
-
name: '
|
|
218
|
+
label: t('operator_routes.manage.information_sq', { ns: 'common' }),
|
|
219
|
+
name: 'information_sq',
|
|
219
220
|
type: 'textarea-html',
|
|
220
|
-
value: data?.
|
|
221
|
+
value: data?.information_sq
|
|
222
|
+
}, {}, {
|
|
223
|
+
/*
|
|
224
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
225
|
+
*
|
|
226
|
+
* How much notice this operator needs on THIS line, in hours. Not
|
|
227
|
+
* published anywhere: it decides whether Flexible Ticket may be
|
|
228
|
+
* sold on the line and what window it grants, and a passenger only
|
|
229
|
+
* ever sees the consequence ("cancel up to 24 hours before
|
|
230
|
+
* departure").
|
|
231
|
+
*
|
|
232
|
+
* EMPTY MEANS "we do not offer it here", not zero - zero would be
|
|
233
|
+
* offering cancellation right up until the coach pulls away. That
|
|
234
|
+
* is why there is no `required` rule and no default of 0.
|
|
235
|
+
*/
|
|
236
|
+
label: t('operator_routes.manage.refund_hours', { ns: 'common' }),
|
|
237
|
+
name: 'refund_hours',
|
|
238
|
+
type: 'number',
|
|
239
|
+
value: data?.refund_hours ?? '',
|
|
240
|
+
rules: 'min:0|max:720'
|
|
241
|
+
}, {
|
|
242
|
+
label: t('operator_routes.manage.reschedule_hours', { ns: 'common' }),
|
|
243
|
+
name: 'reschedule_hours',
|
|
244
|
+
type: 'number',
|
|
245
|
+
value: data?.reschedule_hours ?? '',
|
|
246
|
+
rules: 'min:0|max:720'
|
|
247
|
+
}, {
|
|
248
|
+
label: '',
|
|
249
|
+
type: 'component',
|
|
250
|
+
name: 'hours_help',
|
|
251
|
+
value: <Help>{ t('operator_routes.manage.hours_help', { ns: 'common' }) }</Help>
|
|
221
252
|
}, {}, {
|
|
222
253
|
label: t('operator_routes.manage.ticket.template', { ns: 'common' }),
|
|
223
254
|
type: 'component',
|
|
@@ -244,4 +275,20 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
244
275
|
);
|
|
245
276
|
};
|
|
246
277
|
|
|
247
|
-
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* The note under the two notice-window fields.
|
|
281
|
+
*
|
|
282
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
283
|
+
* Says the two things an operator has to know and cannot guess from the
|
|
284
|
+
* labels: that empty means "not offered", and that these numbers are never
|
|
285
|
+
* shown to passengers.
|
|
286
|
+
*/
|
|
287
|
+
const Help = styled.p`
|
|
288
|
+
margin: -10px 0 0;
|
|
289
|
+
font-size: 13px;
|
|
290
|
+
line-height: 1.5;
|
|
291
|
+
color: #6b7280;
|
|
292
|
+
`;
|
|
293
|
+
|
|
294
|
+
export default Manage;
|
package/Transiting/Manage.tsx
CHANGED
|
@@ -85,7 +85,15 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
85
85
|
name: 'country_id',
|
|
86
86
|
type: 'select',
|
|
87
87
|
values: filterCountries(data?.transiting ?? [], CountriesData),
|
|
88
|
-
|
|
88
|
+
/*
|
|
89
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-07
|
|
90
|
+
* `value: 0` matches no country, so this opened showing the first
|
|
91
|
+
* one - and submitting without touching it added THAT country to
|
|
92
|
+
* the route's transit list. An empty value plus a placeholder
|
|
93
|
+
* makes the operator pick.
|
|
94
|
+
*/
|
|
95
|
+
placeholder: t('routes_order.step5.billing.country_choose', { ns: 'common' }),
|
|
96
|
+
value: '',
|
|
89
97
|
rules: 'required'
|
|
90
98
|
}] }
|
|
91
99
|
fetching={ isFetching }
|