@autobusal/admin-agents 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.tsx +3 -1
- package/Manage.tsx +7 -4
- package/package.json +1 -1
package/Browse.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFunction } from 'i18next';
|
|
2
2
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import { Meta, ContactInfo, Avatar, Table, Row } from '@autobusal/common';
|
|
4
|
-
import { usePage } from '@autobusal/hooks';
|
|
4
|
+
import { usePage, useBreadcrumbs } from '@autobusal/hooks';
|
|
5
5
|
import { DisplayStatus, getParams, success } from '@autobusal/utilities';
|
|
6
6
|
import { useGetAgents, useDeleteAgent } from './services';
|
|
7
7
|
|
|
@@ -15,6 +15,8 @@ const Browse = ({ url, t }: Props): JSX.Element => {
|
|
|
15
15
|
|
|
16
16
|
usePage('agents');
|
|
17
17
|
|
|
18
|
+
useBreadcrumbs(t('admin_agents.browse.title', { ns: 'common' }));
|
|
19
|
+
|
|
18
20
|
const { data, isLoading, isFetching, refetch } = useGetAgents(getParams(searchParams, ['page', 'sort', 'order', 'q']));
|
|
19
21
|
|
|
20
22
|
const { mutate: Delete } = useDeleteAgent();
|
package/Manage.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFunction } from 'i18next';
|
|
2
2
|
import { useParams, useNavigate, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import { Meta, BackWithTitle, Viewer, IpLogs, ApiDetails } from '@autobusal/common';
|
|
4
|
-
import { usePage, useSubscriptions, useOperators } from '@autobusal/hooks';
|
|
4
|
+
import { usePage, useBreadcrumbs, useSubscriptions, useOperators } from '@autobusal/hooks';
|
|
5
5
|
import { GetStatus, getAllowed, success } from '@autobusal/utilities';
|
|
6
6
|
import { AgentData } from '@autobusal/providers/types/agents';
|
|
7
7
|
import { useGetAgent, usePostAgent, useDeleteAgent } from './services';
|
|
@@ -25,7 +25,11 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
25
25
|
const subscriptions = useSubscriptions('agent');
|
|
26
26
|
const operators = useOperators();
|
|
27
27
|
|
|
28
|
-
const { data } = useGetAgent(id);
|
|
28
|
+
const { data, isFetching } = useGetAgent(id);
|
|
29
|
+
|
|
30
|
+
const title = id > 0 ? t('admin_agents.manage.title.update', { company: data?.company, ns: 'common' }) : t('admin_agents.manage.title.new', { ns: 'common' });
|
|
31
|
+
|
|
32
|
+
useBreadcrumbs(title, [{ name: t('admin_agents.browse.title', { ns: 'common' }), url }]);
|
|
29
33
|
|
|
30
34
|
const { mutate: Update, isPending: isPendingSave } = usePostAgent(id);
|
|
31
35
|
|
|
@@ -50,8 +54,6 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
50
54
|
}
|
|
51
55
|
});
|
|
52
56
|
};
|
|
53
|
-
|
|
54
|
-
const title = id > 0 ? t('admin_agents.manage.title.update', { company: data?.company, ns: 'common' }) : t('admin_agents.manage.title.new', { ns: 'common' });
|
|
55
57
|
|
|
56
58
|
return (
|
|
57
59
|
<Meta title={ title }>
|
|
@@ -240,6 +242,7 @@ const Manage = ({ url, t }: Props): JSX.Element => {
|
|
|
240
242
|
/>
|
|
241
243
|
)
|
|
242
244
|
}] }
|
|
245
|
+
fetching={ isFetching }
|
|
243
246
|
pending={ isPendingSave || isPendingDelete }
|
|
244
247
|
t={ t }
|
|
245
248
|
actions={ [
|