@bjsdistribution/dms-client-return 0.0.2 → 0.0.3

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.
Files changed (75) hide show
  1. package/dist/components/order-daily-overview/common/interface.d.ts +22 -0
  2. package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
  3. package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
  4. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
  5. package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
  6. package/dist/components/order-daily-overview/store/store.d.ts +4 -0
  7. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
  8. package/dist/components/order-view/store.d.ts +5 -1
  9. package/dist/components/store.d.ts +5 -2
  10. package/dist/components/types.d.ts +1 -1
  11. package/dist/dms-client-return.cjs.development.js +1065 -964
  12. package/dist/dms-client-return.cjs.development.js.map +1 -1
  13. package/dist/dms-client-return.cjs.production.min.js +1 -1
  14. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  15. package/dist/dms-client-return.esm.js +1067 -966
  16. package/dist/dms-client-return.esm.js.map +1 -1
  17. package/package.json +2 -2
  18. package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
  19. package/src/components/order-daily-overview/common/interface.ts +120 -97
  20. package/src/components/order-daily-overview/filters/Filters.tsx +1 -8
  21. package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
  22. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +160 -223
  23. package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +19 -7
  24. package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
  25. package/src/components/order-daily-overview/index.tsx +59 -6
  26. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +24 -1
  27. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +177 -234
  28. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +63 -6
  29. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +5 -47
  30. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +51 -185
  31. package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +62 -0
  32. package/src/components/order-daily-overview/store/store.ts +23 -12
  33. package/src/components/order-daily-overview/table/ReturnTable.tsx +193 -205
  34. package/src/components/order-view/details-filters/DetailsFilters.tsx +3 -2
  35. package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +57 -46
  36. package/src/components/order-view/general-information/Status.tsx +1 -1
  37. package/src/components/order-view/index.tsx +6 -4
  38. package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
  39. package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
  40. package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
  41. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
  42. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
  43. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
  44. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
  45. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
  46. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
  47. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
  48. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
  49. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
  50. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
  51. package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
  52. package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
  53. package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
  54. package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
  55. package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
  56. package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
  57. package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
  58. package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
  59. package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
  60. package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
  61. package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
  62. package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
  63. package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
  64. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +2 -2
  65. package/src/components/order-view/store.ts +40 -12
  66. package/src/components/store.ts +26 -4
  67. package/src/components/types.ts +2 -6
  68. package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
  69. package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
  70. package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
  71. package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
  72. package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
  73. package/src/components/order-daily-overview/table/Return.tsx +0 -156
  74. package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
  75. package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.2",
2
+ "version": "0.0.3",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "testEnvironment": "jest-environment-jsdom-sixteen"
60
60
  },
61
61
  "devDependencies": {
62
- "@bjsdistribution/dms-component-library": "^0.0.87",
62
+ "@bjsdistribution/dms-component-library": "^0.0.94",
63
63
  "@size-limit/preset-small-lib": "^11.0.1",
64
64
  "@tippyjs/react": "^4.2.6",
65
65
  "@types/react": "^18.2.47",
@@ -94,12 +94,11 @@ export const TableData = [
94
94
  ];
95
95
 
96
96
  export const optionsPrint = [
97
- // { icon: 'runSheet', label: 'Proof Of Delivery' },
98
- // { icon: 'loadSheet', label: 'Proof Of Delivery (DOC)' },
99
- { icon: 'deliveryLables', label: 'Order Delivery Labels' },
100
- { icon: 'customerLables', label: 'Order Collection Labels' },
101
- { icon: 'collectionLables', label: 'Order Return Labels' },
102
- // { icon: 'collectionLables', label: 'Returns Cover Note' },
97
+ { icon: 'runSheet', label: 'Print Runsheet' },
98
+ { icon: 'loadSheet', label: 'Print Loadsheet' },
99
+ { icon: 'deliveryLables', label: 'Print Delivery Labels' },
100
+ { icon: 'customerLables', label: 'Print Customer Labels' },
101
+ { icon: 'collectionLables', label: 'Print Collection Labels' },
103
102
  ];
104
103
 
105
104
  export const Depots = [
@@ -1,98 +1,121 @@
1
1
  export interface TableColumn {
2
- key: string;
3
- label: string;
4
- alwaysVisible?: boolean;
5
- }
6
-
7
- export interface TableBodyItem {
8
- startFinish: {
9
- status: string;
10
- startTime: string;
11
- endTime: string;
12
- };
13
- routeDetails: {
14
- name: string;
15
- lockRoute: boolean;
16
- overnight: boolean;
17
- };
18
- tomtom: {
19
- id: string;
20
- allEventCompleted: boolean;
21
- };
22
- vehicle: {
23
- name: string;
24
- };
25
- driver: {
26
- pdaId: string;
27
- name: string;
28
- };
29
- mate: {
30
- pdaId: string;
31
- name: string;
32
- };
33
- asset: {
34
- id: string;
35
- };
36
- orders: {
37
- countOrdersInRoute: number;
38
- collection: boolean;
39
- assembly: boolean;
40
- };
41
- weight: {
42
- totalWeight: string;
43
- overweighted: string;
44
- overweightedIcon: boolean;
45
- heavyItems: boolean;
46
- };
47
- distance: {
48
- totalDistance: number;
49
- };
50
- duration: {
51
- totalDuration: string;
52
- };
53
- escalations: {
54
- numberOfEscalations: number;
55
- };
56
- crewInstructions: {
57
- deliveryTeamMessage: string;
58
- };
59
- action: {
60
- print: boolean;
61
- trackerPage: boolean;
62
- deBriefing: boolean;
63
- };
64
- }
65
-
66
- export interface TableDataInterface {
67
- tableHead: TableColumn[];
68
- tableBody: TableBodyItem[];
69
- }
70
- export interface FilterRoute {
71
- icon: string;
72
- label: string;
73
- }
74
-
75
- // types
76
-
77
- export type PrintData = {
78
- icon: string;
79
- label: string;
80
- };
81
-
82
- //route details
83
- export interface TableBodyVal {
84
- created: {
85
- auditid: string;
86
- date: string;
87
- };
88
- notesDetails: {
89
- info: string;
90
- IP: string;
91
- };
92
- }
93
-
94
- export interface NotesDataInterface {
95
- tableHead: TableColumn[];
96
- tableBody: TableBodyVal[];
97
- }
98
-
2
+ key: string;
3
+ label: string;
4
+ alwaysVisible?: boolean;
5
+ }
6
+
7
+ export interface TableBodyItem {
8
+ startFinish: {
9
+ status: string;
10
+ startTime: string;
11
+ endTime: string;
12
+ };
13
+ routeDetails: {
14
+ name: string;
15
+ lockRoute: boolean;
16
+ overnight: boolean;
17
+ };
18
+ tomtom: {
19
+ id: string;
20
+ allEventCompleted: boolean;
21
+ };
22
+ vehicle: {
23
+ name: string;
24
+ };
25
+ driver: {
26
+ pdaId: string;
27
+ name: string;
28
+ };
29
+ mate: {
30
+ pdaId: string;
31
+ name: string;
32
+ };
33
+ asset: {
34
+ id: string;
35
+ };
36
+ orders: {
37
+ countOrdersInRoute: number;
38
+ collection: boolean;
39
+ assembly: boolean;
40
+ };
41
+ weight: {
42
+ totalWeight: string;
43
+ overweighted: string;
44
+ overweightedIcon: boolean;
45
+ heavyItems: boolean;
46
+ };
47
+ distance: {
48
+ totalDistance: number;
49
+ };
50
+ duration: {
51
+ totalDuration: string;
52
+ };
53
+ escalations: {
54
+ numberOfEscalations: number;
55
+ };
56
+ crewInstructions: {
57
+ deliveryTeamMessage: string;
58
+ };
59
+ action: {
60
+ print: boolean;
61
+ trackerPage: boolean;
62
+ deBriefing: boolean;
63
+ };
64
+ }
65
+
66
+ export interface TableDataInterface {
67
+ tableHead: TableColumn[];
68
+ tableBody: TableBodyItem[];
69
+ }
70
+ export interface FilterRoute {
71
+ icon: string;
72
+ label: string;
73
+ }
74
+
75
+ // types
76
+
77
+ export type PrintData = {
78
+ icon: string;
79
+ label: string;
80
+ };
81
+
82
+ //route details
83
+ export interface TableBodyVal {
84
+ created: {
85
+ auditid: string;
86
+ date: string;
87
+ };
88
+ notesDetails: {
89
+ info: string;
90
+ IP: string;
91
+ };
92
+ }
93
+
94
+ export interface NotesDataInterface {
95
+ tableHead: TableColumn[];
96
+ tableBody: TableBodyVal[];
97
+ }
98
+
99
+ export interface ClientData {
100
+ trading_as: string;
101
+ customer_name: string;
102
+ return_orders: number;
103
+ return_order_products: number;
104
+ DISPOSE: number;
105
+ 'RE-DEL': number;
106
+ CLAIMS_PAID: number;
107
+ 'RE-ALLOCATE': number;
108
+ RTS: number;
109
+ RECYCLE: number;
110
+ PENDING: number;
111
+ UNKNOWN: number;
112
+ [key: string]: any;
113
+ }
114
+
115
+ export interface ApiResponse {
116
+ message: string;
117
+ code: number;
118
+ error: string | null;
119
+ error_traceback: string | null;
120
+ data: any[];
121
+ }
@@ -3,13 +3,10 @@ import {
3
3
  StyledFIlterELements,
4
4
  StyledFiter,
5
5
  StyledTableFilter,
6
- Text,
7
6
  } from './FilterStyle';
8
-
9
7
  import BulkFilter from './BulkFilter';
10
8
  import { TableRowType } from '../shared/interface';
11
- import { filtersReducerAtom } from '../store/filterStore';
12
-
9
+ import { filtersReducerAtom } from '../header-filters/filterStore';
13
10
  import { useApiHook } from '@bjsdistribution/dms-component-library';
14
11
 
15
12
  import {
@@ -20,10 +17,7 @@ import {
20
17
  import { useAtom } from 'jotai';
21
18
 
22
19
  const Filters = () => {
23
- // const [apiData, setApiData] = useState<TableRowType[] | undefined>(undefined);
24
- // Stats and variables
25
20
  const [, setData] = useRoutesTable();
26
- // const [loading, setLoading] = useLoading();
27
21
  const [state] = useAtom(filtersReducerAtom);
28
22
  const [, setPaginationObject] = UsePaginationData();
29
23
  const [, setCount] = useCountData();
@@ -67,7 +61,6 @@ const Filters = () => {
67
61
  <>
68
62
  <StyledFiter>
69
63
  <StyledFIlterELements>
70
- <Text>Client Return</Text>
71
64
  <StyledTableFilter />
72
65
  </StyledFIlterELements>
73
66
  <BulkFilter />
@@ -1,79 +1,68 @@
1
- import React from 'react';
2
- // import styled from 'styled-components';
3
- // import { CoverPage, StatusPanel } from '../invoice-header/InvoiceStyles';
4
-
1
+ import React, { useEffect } from 'react';
5
2
  import { CoverPage } from './Styledfilters';
6
3
  import SelectionFilter from './SelectionFilter';
4
+ import { ApiResponse } from '../../types';
5
+ import { useApiHook } from '@bjsdistribution/dms-component-library';
6
+ import { useActionType, useCustomerData, useLocationData } from '../../store';
7
7
 
8
8
  function HeaderFilter() {
9
+ const [, setCustomers] = useCustomerData();
10
+ const [, setActionType] = useActionType();
11
+ const [, setLocationData] = useLocationData();
12
+
13
+ //API for client data
14
+ const { data: fetchedCustomerData, loading: loading } = useApiHook<
15
+ ApiResponse
16
+ >({
17
+ endpoint: `/customers/`,
18
+ method: 'GET',
19
+ pagination: { page: 1, per_page: 50 },
20
+ });
21
+
22
+ //API for action type
23
+ const { data: fetchedStaticData, loading: actionLoading } = useApiHook<
24
+ ApiResponse
25
+ >({
26
+ endpoint: `/orders/getStaticData/all/`,
27
+ method: 'GET',
28
+ pagination: { page: 1, per_page: 50 },
29
+ });
30
+
31
+ //API for return locations
32
+ const { data: fetchedLocationData, loading: locationloading } = useApiHook<
33
+ ApiResponse
34
+ >({
35
+ endpoint: `/return_locations/`,
36
+ method: 'GET',
37
+ pagination: { page: 1, per_page: 50 },
38
+ });
39
+
40
+ useEffect(() => {
41
+ if (fetchedCustomerData && fetchedCustomerData?.data) {
42
+ setCustomers(fetchedCustomerData?.data);
43
+ }
44
+ }, [loading, fetchedCustomerData]);
9
45
 
46
+ useEffect(() => {
47
+ if (fetchedStaticData && fetchedStaticData?.data) {
48
+ setActionType(
49
+ fetchedStaticData?.data?.flatMap(
50
+ (i: any) => i.order_contact_action_type
51
+ )
52
+ );
53
+ }
54
+ }, [actionLoading, fetchedStaticData]);
55
+
56
+ useEffect(() => {
57
+ if (fetchedLocationData && fetchedLocationData?.data) {
58
+ setLocationData(fetchedLocationData?.data);
59
+ }
60
+ }, [locationloading, fetchedLocationData]);
10
61
 
11
62
  return (
12
63
  <CoverPage>
13
-
14
- <SelectionFilter />
64
+ <SelectionFilter />
15
65
  </CoverPage>
16
66
  );
17
67
  }
18
-
19
- // const Row = styled.div`
20
- // display: flex;
21
- // flex-direction: row;
22
- // gap: 15px;
23
- // align-items: center;
24
- // `;
25
-
26
- // const ExportButton = styled.button`
27
- // display: flex;
28
- // align-items: center;
29
- // background-color: #f0f2f2;
30
- // border-radius: 25px;
31
- // border: 1px solid #cdcdcd !important;
32
- // color: #3a3630;
33
- // padding: 4px 10px;
34
- // gap: 8px;
35
- // height: 34px;
36
-
37
- // > svg {
38
- // height: 20px;
39
- // width: 20px;
40
- // }
41
- // `;
42
- // const FilterList = styled.li`
43
- // color: #6a7378;
44
- // text-align: center;
45
- // font-size: 14px;
46
- // font-style: normal;
47
- // font-weight: 400;
48
- // line-height: 18px;
49
- // &:first-child {
50
- // border-radius: 13px 0 0 13px;
51
- // overflow: hidden;
52
- // }
53
- // &:last-child {
54
- // border-radius: 0 13px 13px 0;
55
- // overflow: hidden;
56
- // }
57
- // `;
58
- // const StyledFilterList = styled(FilterList)<{ $isActive: boolean }>`
59
- // cursor: pointer;
60
- // list-style: none;
61
- // border-radius: 0;
62
- // background: ${props =>
63
- // props.$isActive ? 'rgba(117, 133, 136, 0.12)' : 'transparent'};
64
- // color: ${props => (props.$isActive ? '#3a3630' : '#6A7378')};
65
- // &:hover {
66
- // color: #3a3630;
67
- // }
68
- // a {
69
- // display: block;
70
- // padding: 8px 16px;
71
- // color: inherit;
72
- // text-decoration: none;
73
- // &.active {
74
- // background-color: rgba(117, 133, 136, 0.12);
75
- // color: #3a3630;
76
- // }
77
- // }
78
- // `;
79
68
  export default HeaderFilter;