@bjsdistribution/dms-client-return 0.0.57 → 0.0.58
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/dist/OrderViewQueryHandler.d.ts +3 -0
- package/dist/dms-client-return.cjs.development.js +10024 -10016
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +10029 -10021
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/OrderViewQueryHandler.tsx +14 -0
- package/src/components/order-view/notes/index.tsx +1 -1
- package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +1 -1
- package/src/components/order-view/store.ts +1 -1
- package/src/index.tsx +4 -3
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSearchParams } from 'react-router-dom';
|
|
3
|
+
import OrderView from './components/order-view';
|
|
4
|
+
import ReturnMainTable from './components/order-daily-overview';
|
|
5
|
+
|
|
6
|
+
const OrderViewQueryHandler = () => {
|
|
7
|
+
const [searchParams] = useSearchParams(); // Access the query params
|
|
8
|
+
const orderId = searchParams.get('order'); // Get the 'order' param
|
|
9
|
+
|
|
10
|
+
// If 'order' query param is present, render OrderViewWrapper, otherwise redirect to home
|
|
11
|
+
return orderId ? <OrderView /> : <ReturnMainTable />;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default OrderViewQueryHandler;
|
package/src/index.tsx
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React, { Suspense, useEffect } from 'react';
|
|
2
2
|
import { Route, Routes, useSearchParams } from 'react-router-dom';
|
|
3
|
-
import OrderView from './components/order-view';
|
|
4
3
|
import ReturnTable from './components/order-daily-overview/return-order-table/ReturnTable';
|
|
5
4
|
import ReturnAfterTable from './components/order-daily-overview/return-after-table/ReturnAfterTable';
|
|
6
5
|
import {
|
|
7
6
|
useSelectedAction,
|
|
8
7
|
useSelectedClient,
|
|
9
8
|
} from './components/order-daily-overview/store/store';
|
|
10
|
-
import ReturnMainTable from './components/order-daily-overview';
|
|
11
9
|
import { notification } from 'antd';
|
|
12
10
|
import RouterHeader from './components/order-daily-overview/header/route-header/RouterHeader';
|
|
13
11
|
import {
|
|
@@ -21,6 +19,8 @@ import {
|
|
|
21
19
|
import { ApiResponse } from './components/types';
|
|
22
20
|
import { useApiHook } from '@bjsdistribution/dms-component-library';
|
|
23
21
|
import { useLocationOptions } from './components/order-view/store';
|
|
22
|
+
import OrderViewQueryHandler from './OrderViewQueryHandler';
|
|
23
|
+
import OrderView from './components/order-view';
|
|
24
24
|
function ReturnClient() {
|
|
25
25
|
notification.config({
|
|
26
26
|
top: 80,
|
|
@@ -111,9 +111,10 @@ function ReturnClient() {
|
|
|
111
111
|
<Routes>
|
|
112
112
|
{/* for local */}
|
|
113
113
|
{/* for dev */}
|
|
114
|
-
<Route path="" element={<
|
|
114
|
+
<Route path="" element={<OrderViewQueryHandler />} />
|
|
115
115
|
<Route path="overview" element={<ReturnAfterTable />} />
|
|
116
116
|
<Route path="/:id" element={<OrderView />} />
|
|
117
|
+
|
|
117
118
|
<Route path="filter" element={<ReturnTable />} />
|
|
118
119
|
{/* <Route
|
|
119
120
|
path=""
|