@autobusal/account-transactions 1.0.1 → 1.1.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/Browse/Admin.tsx +3 -1
- package/Browse/Simple.tsx +3 -1
- package/Manage/Admin.tsx +7 -4
- package/Manage/Simple.tsx +7 -4
- package/package.json +1 -1
package/Browse/Admin.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSearchParams } from 'react-router-dom';
|
|
2
2
|
import { TFunction } from 'i18next';
|
|
3
3
|
import { Meta, Table, Row } from '@autobusal/common';
|
|
4
|
-
import { usePage } from '@autobusal/hooks';
|
|
4
|
+
import { usePage, useBreadcrumbs } from '@autobusal/hooks';
|
|
5
5
|
import { getParams } from '@autobusal/utilities';
|
|
6
6
|
import Information from '../Information';
|
|
7
7
|
import { useGetTransactions } from '../services';
|
|
@@ -16,6 +16,8 @@ const Admin = ({ url, t }: Props): JSX.Element => {
|
|
|
16
16
|
|
|
17
17
|
usePage('transactions');
|
|
18
18
|
|
|
19
|
+
useBreadcrumbs(t('transactions.browse.title', { ns: 'common' }));
|
|
20
|
+
|
|
19
21
|
const { data, isLoading, isFetching } = useGetTransactions(getParams(searchParams, ['page', 'sort', 'order', 'q', 'id']));
|
|
20
22
|
|
|
21
23
|
const rows = data?.data.map(item => (
|
package/Browse/Simple.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSearchParams } from 'react-router-dom';
|
|
2
2
|
import { TFunction } from 'i18next';
|
|
3
3
|
import { Meta, Table, Row } from '@autobusal/common';
|
|
4
|
-
import { usePage } from '@autobusal/hooks';
|
|
4
|
+
import { usePage, useBreadcrumbs } from '@autobusal/hooks';
|
|
5
5
|
import { getParams } from '@autobusal/utilities';
|
|
6
6
|
import Information from '../Information';
|
|
7
7
|
import { useGetTransactions } from '../services';
|
|
@@ -16,6 +16,8 @@ const Simple = ({ url, t }: Props): JSX.Element => {
|
|
|
16
16
|
|
|
17
17
|
usePage('transactions');
|
|
18
18
|
|
|
19
|
+
useBreadcrumbs(t('transactions.browse.title', { ns: 'common' }));
|
|
20
|
+
|
|
19
21
|
const { data, isLoading, isFetching } = useGetTransactions(getParams(searchParams, ['page', 'sort', 'order', 'q']));
|
|
20
22
|
|
|
21
23
|
const rows = data?.data.map(item => (
|
package/Manage/Admin.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFunction } from 'i18next';
|
|
2
2
|
import { useNavigate, useParams, Navigate } from 'react-router-dom';
|
|
3
3
|
import { Meta, BackWithTitle, Viewer } from '@autobusal/common';
|
|
4
|
-
import { usePage } from '@autobusal/hooks';
|
|
4
|
+
import { usePage, useBreadcrumbs } from '@autobusal/hooks';
|
|
5
5
|
import { success } from '@autobusal/utilities';
|
|
6
6
|
import { getText, getStatuses } from '../utilities';
|
|
7
7
|
import { TransactionData } from '@autobusal/providers/types/account';
|
|
@@ -21,7 +21,11 @@ const Admin = ({ url, t }: Props): JSX.Element => {
|
|
|
21
21
|
|
|
22
22
|
const navigate = useNavigate();
|
|
23
23
|
|
|
24
|
-
const { data } = useGetTransaction(id);
|
|
24
|
+
const { data, isFetching } = useGetTransaction(id);
|
|
25
|
+
|
|
26
|
+
const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
|
|
27
|
+
|
|
28
|
+
useBreadcrumbs(title, [{ name: t('transactions.browse.title', { ns: 'common' }), url }]);
|
|
25
29
|
|
|
26
30
|
const { mutate: Update, isPending } = usePostTransaction(id);
|
|
27
31
|
|
|
@@ -38,8 +42,6 @@ const Admin = ({ url, t }: Props): JSX.Element => {
|
|
|
38
42
|
}
|
|
39
43
|
});
|
|
40
44
|
};
|
|
41
|
-
|
|
42
|
-
const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
|
|
43
45
|
|
|
44
46
|
return (
|
|
45
47
|
<Meta title={ title }>
|
|
@@ -99,6 +101,7 @@ const Admin = ({ url, t }: Props): JSX.Element => {
|
|
|
99
101
|
type: 'textarea',
|
|
100
102
|
value: data?.comment
|
|
101
103
|
}] }
|
|
104
|
+
fetching={ isFetching }
|
|
102
105
|
pending={ isPending }
|
|
103
106
|
t={ t }
|
|
104
107
|
actions={ [
|
package/Manage/Simple.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFunction } from 'i18next';
|
|
2
2
|
import { useNavigate, useParams, Navigate } from 'react-router-dom';
|
|
3
3
|
import { Meta, BackWithTitle, Viewer } from '@autobusal/common';
|
|
4
|
-
import { usePage } from '@autobusal/hooks';
|
|
4
|
+
import { usePage, useBreadcrumbs } from '@autobusal/hooks';
|
|
5
5
|
import { success } from '@autobusal/utilities';
|
|
6
6
|
import { getText } from '../utilities';
|
|
7
7
|
import { TransactionData } from '@autobusal/providers/types/account';
|
|
@@ -21,7 +21,11 @@ const Simple = ({ url, t }: Props): JSX.Element => {
|
|
|
21
21
|
|
|
22
22
|
const navigate = useNavigate();
|
|
23
23
|
|
|
24
|
-
const { data } = useGetTransaction(id);
|
|
24
|
+
const { data, isFetching } = useGetTransaction(id);
|
|
25
|
+
|
|
26
|
+
const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
|
|
27
|
+
|
|
28
|
+
useBreadcrumbs(title, [{ name: t('transactions.browse.title', { ns: 'common' }), url }]);
|
|
25
29
|
|
|
26
30
|
const { mutate: Update, isPending } = usePostTransaction(id);
|
|
27
31
|
|
|
@@ -38,8 +42,6 @@ const Simple = ({ url, t }: Props): JSX.Element => {
|
|
|
38
42
|
}
|
|
39
43
|
});
|
|
40
44
|
};
|
|
41
|
-
|
|
42
|
-
const title = t('transactions.manage.title', { id: data?.id, ns: 'common' });
|
|
43
45
|
|
|
44
46
|
return (
|
|
45
47
|
<Meta title={ title }>
|
|
@@ -78,6 +80,7 @@ const Simple = ({ url, t }: Props): JSX.Element => {
|
|
|
78
80
|
type: 'display',
|
|
79
81
|
value: t(`data.transaction_status.${ data?.status }`)
|
|
80
82
|
}] }
|
|
83
|
+
fetching={ isFetching }
|
|
81
84
|
pending={ isPending }
|
|
82
85
|
t={ t }
|
|
83
86
|
actions={ [] }
|