@autobusal/operator-routes 1.9.0 → 1.10.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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.0 (2026-08-29)
4
+
5
+ - Editors offer Save & Close alongside Save & Stay, so correcting a record no longer bounces you back to its list every time (opt-in per page, editing only).
6
+
3
7
  ## 1.9.0 (2026-08-29)
4
8
 
5
9
  - Route schedules and unavailability periods can be planned five years ahead, not one - the picker's ceiling was the only limit.
package/Manage.tsx CHANGED
@@ -46,12 +46,14 @@ const Manage = ({ url, t }: Props): JSX.Element => {
46
46
 
47
47
  const drivers = useOperatorDrivers('id');
48
48
 
49
- const onSave = (data: RouteData): void => {
49
+ const onSave = (data: RouteData, stay?: boolean): void => {
50
50
  Update(data, {
51
51
  onSuccess: () => {
52
52
  success(t('operator_routes.manage.messages.saved', { ns: 'common' }));
53
53
 
54
- navigate(url);
54
+ if (!stay) {
55
+ navigate(url);
56
+ }
55
57
  }
56
58
  });
57
59
  };
@@ -282,7 +284,7 @@ const Manage = ({ url, t }: Props): JSX.Element => {
282
284
  pending={ isPendingSave || isPendingDelete }
283
285
  t={ t }
284
286
  actions={ [
285
- 'save', 'delete'
287
+ 'save', 'save_stay', 'delete'
286
288
  ]}
287
289
  onSave={ onSave }
288
290
  onDelete={ onDelete }
@@ -56,12 +56,14 @@ const Manage = ({ url, t }: Props): JSX.Element => {
56
56
  return <Navigate to={ url } />;
57
57
  }
58
58
 
59
- const onSave = (data: AvailableData): void => {
59
+ const onSave = (data: AvailableData, stay?: boolean): void => {
60
60
  Update(data, {
61
61
  onSuccess: () => {
62
62
  success(t('schedules_manage.messages.saved', { ns: 'common' }));
63
63
 
64
- navigate(url);
64
+ if (!stay) {
65
+ navigate(url);
66
+ }
65
67
  }
66
68
  });
67
69
  };
@@ -100,7 +102,7 @@ const Manage = ({ url, t }: Props): JSX.Element => {
100
102
  pending={ isPending }
101
103
  t={ t }
102
104
  actions={ [
103
- 'update'
105
+ 'update', 'save_stay'
104
106
  ]}
105
107
  onSave={ onSave }
106
108
  />
@@ -47,12 +47,14 @@ const Manage = ({ url, t }: Props): JSX.Element => {
47
47
  return <Navigate to={ url } />;
48
48
  }
49
49
 
50
- const onSave = (data: UnavailableData): void => {
50
+ const onSave = (data: UnavailableData, stay?: boolean): void => {
51
51
  Update(data, {
52
52
  onSuccess: () => {
53
53
  success(t('unavailable.manage.messages.saved', { ns: 'common' }));
54
54
 
55
- navigate(url);
55
+ if (!stay) {
56
+ navigate(url);
57
+ }
56
58
  }
57
59
  });
58
60
  };
@@ -97,7 +99,7 @@ const Manage = ({ url, t }: Props): JSX.Element => {
97
99
  pending={ isPendingSave || isPendingDelete }
98
100
  t={ t }
99
101
  actions={ [
100
- 'save', 'delete'
102
+ 'save', 'save_stay', 'delete'
101
103
  ]}
102
104
  onSave={ onSave }
103
105
  onDelete={ onDelete }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/operator-routes",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"