@bjsdistribution/dms-client-return 0.0.2 → 0.0.4

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 (119) hide show
  1. package/README.md +1 -1
  2. package/dist/components/order-daily-overview/common/interface.d.ts +22 -0
  3. package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
  4. package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
  5. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
  6. package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
  7. package/dist/components/order-daily-overview/store/store.d.ts +4 -0
  8. package/dist/components/order-daily-overview/table/table-data/styles.d.ts +2 -0
  9. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
  10. package/dist/components/order-view/generic-table/AuditLogs.d.ts +4 -0
  11. package/dist/components/order-view/hooks/useGetEventNotes.d.ts +2 -0
  12. package/dist/components/order-view/hooks/useGetSystemLogs.d.ts +2 -0
  13. package/dist/components/order-view/modalsPopup/CreateReturnModal.d.ts +4 -0
  14. package/dist/components/order-view/notes/logs/fakeData.d.ts +7 -7
  15. package/dist/components/order-view/store.d.ts +23 -1
  16. package/dist/components/order-view/system-event-logs/columns/Code.d.ts +3 -0
  17. package/dist/components/order-view/system-event-logs/columns/Date.d.ts +3 -0
  18. package/dist/components/order-view/system-event-logs/columns/Event.d.ts +3 -0
  19. package/dist/components/order-view/system-event-logs/columns/Note.d.ts +3 -0
  20. package/dist/components/order-view/system-event-logs/columns/index.d.ts +4 -0
  21. package/dist/components/order-view/system-event-logs/helper.d.ts +7 -0
  22. package/dist/components/store.d.ts +5 -2
  23. package/dist/components/types.d.ts +1 -1
  24. package/dist/dms-client-return.cjs.development.js +3553 -2396
  25. package/dist/dms-client-return.cjs.development.js.map +1 -1
  26. package/dist/dms-client-return.cjs.production.min.js +1 -1
  27. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  28. package/dist/dms-client-return.esm.js +3557 -2400
  29. package/dist/dms-client-return.esm.js.map +1 -1
  30. package/package.json +2 -2
  31. package/src/common/expand-collapse/index.tsx +3 -3
  32. package/src/components/fakeData.ts +14 -23
  33. package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
  34. package/src/components/order-daily-overview/common/interface.ts +120 -97
  35. package/src/components/order-daily-overview/filters/Filters.tsx +6 -13
  36. package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
  37. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +170 -224
  38. package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +20 -7
  39. package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
  40. package/src/components/order-daily-overview/index.tsx +77 -20
  41. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +32 -4
  42. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +184 -235
  43. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +69 -10
  44. package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +10 -3
  45. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +9 -47
  46. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +106 -190
  47. package/src/components/order-daily-overview/return-order-table/return-orders-filters/RightFilters.tsx +35 -38
  48. package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +69 -1
  49. package/src/components/order-daily-overview/store/store.ts +23 -12
  50. package/src/components/order-daily-overview/table/ReturnTable.tsx +133 -207
  51. package/src/components/order-daily-overview/table/table-data/styles.ts +15 -0
  52. package/src/components/order-view/details-filters/DetailsFilters.tsx +5 -4
  53. package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +0 -2
  54. package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +54 -46
  55. package/src/components/order-view/general-information/Status.tsx +1 -1
  56. package/src/components/order-view/generic-table/AuditLogs.tsx +96 -0
  57. package/src/components/order-view/hooks/useGetEventNotes.tsx +47 -0
  58. package/src/components/order-view/hooks/useGetSystemLogs.tsx +60 -0
  59. package/src/components/order-view/index.tsx +25 -4
  60. package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +83 -0
  61. package/src/components/order-view/modalsPopup/ModalManager.tsx +49 -49
  62. package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
  63. package/src/components/order-view/notes/AddNote.tsx +127 -13
  64. package/src/components/order-view/notes/index.tsx +100 -3
  65. package/src/components/order-view/notes/logs/fakeData.ts +8 -48
  66. package/src/components/order-view/notes/logs/index.tsx +6 -45
  67. package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
  68. package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
  69. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
  70. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
  71. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
  72. package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
  73. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
  74. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
  75. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
  76. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
  77. package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
  78. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
  79. package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
  80. package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
  81. package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
  82. package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
  83. package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
  84. package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
  85. package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
  86. package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
  87. package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
  88. package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
  89. package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
  90. package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
  91. package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
  92. package/src/components/order-view/order-resources/collapsed-content/index.tsx +1 -1
  93. package/src/components/order-view/products-info/expanded-content/index.tsx +2 -2
  94. package/src/components/order-view/products-info/index.tsx +3 -2
  95. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +30 -34
  96. package/src/components/order-view/store.ts +80 -14
  97. package/src/components/order-view/system-event-logs/collapsed-content/index.tsx +1 -1
  98. package/src/components/order-view/system-event-logs/columns/Code.tsx +17 -0
  99. package/src/components/order-view/system-event-logs/columns/Date.tsx +18 -0
  100. package/src/components/order-view/system-event-logs/columns/Event.tsx +26 -0
  101. package/src/components/order-view/system-event-logs/columns/Note.tsx +24 -0
  102. package/src/components/order-view/system-event-logs/columns/index.tsx +6 -0
  103. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +34 -6
  104. package/src/components/order-view/system-event-logs/helper.ts +29 -0
  105. package/src/components/store.ts +26 -4
  106. package/src/components/types.ts +2 -6
  107. package/src/index.tsx +32 -5
  108. package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
  109. package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
  110. package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
  111. package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
  112. package/dist/components/order-view/system-event-logs/system-logs-table/SystemLogsTables.d.ts +0 -3
  113. package/dist/components/order-view/system-event-logs/system-logs-table/SytemLogsStyles.d.ts +0 -3
  114. package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
  115. package/src/components/order-daily-overview/table/Return.tsx +0 -156
  116. package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
  117. package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
  118. package/src/components/order-view/system-event-logs/system-logs-table/SystemLogsTables.tsx +0 -59
  119. package/src/components/order-view/system-event-logs/system-logs-table/SytemLogsStyles.tsx +0 -239
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.2",
2
+ "version": "0.0.4",
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.1.3",
63
63
  "@size-limit/preset-small-lib": "^11.0.1",
64
64
  "@tippyjs/react": "^4.2.6",
65
65
  "@types/react": "^18.2.47",
@@ -84,9 +84,9 @@ const IconContainer = styled.div<{ isExpanded: boolean }>`
84
84
  align-items: center;
85
85
  justify-content: center;
86
86
  cursor: pointer;
87
- width: 25px;
88
- height: 25px;
89
- padding: 2px;
87
+ width: 20px;
88
+ height: 20px;
89
+ padding: 0px;
90
90
  border-radius: 3px;
91
91
  background: #ffffff;
92
92
  box-shadow: 0px 1px 2px 0px #1018280d;
@@ -32,7 +32,6 @@ export const obtainProductMethodData = [
32
32
  value: 'full_stock_control',
33
33
  },
34
34
  ];
35
-
36
35
  export const options = [
37
36
  {
38
37
  label: 'Task',
@@ -47,7 +46,7 @@ export const options = [
47
46
  selectedFontColor: '#3a3630',
48
47
  },
49
48
  ];
50
- export const ReturnData =[
49
+ export const ReturnData = [
51
50
  {
52
51
  label: 'Return1',
53
52
  value: 'return1',
@@ -60,8 +59,8 @@ export const ReturnData =[
60
59
  label: 'Return3',
61
60
  value: 'return3',
62
61
  },
63
- ]
64
- export const CollectionData =[
62
+ ];
63
+ export const CollectionData = [
65
64
  {
66
65
  label: 'Test1',
67
66
  value: 'test1',
@@ -74,9 +73,8 @@ export const CollectionData =[
74
73
  label: 'Test3',
75
74
  value: 'test3',
76
75
  },
77
- ]
78
-
79
- export const UnReceivedata =[
76
+ ];
77
+ export const UnReceivedata = [
80
78
  {
81
79
  label: 'Test1',
82
80
  value: 'test1',
@@ -89,7 +87,7 @@ export const UnReceivedata =[
89
87
  label: 'Test3',
90
88
  value: 'test3',
91
89
  },
92
- ]
90
+ ];
93
91
  export const ProductType = [
94
92
  {
95
93
  label: 'Delivery',
@@ -102,8 +100,8 @@ export const ProductType = [
102
100
  {
103
101
  label: 'Collection',
104
102
  value: 'collection',
105
- },]
106
-
103
+ },
104
+ ];
107
105
  export const TaskType = [
108
106
  {
109
107
  label: 'Client',
@@ -150,7 +148,6 @@ export const TaskType = [
150
148
  value: 'driver-compliance',
151
149
  },
152
150
  ];
153
-
154
151
  export const CustomOptions = [
155
152
  {
156
153
  label: 'Private',
@@ -161,7 +158,6 @@ export const CustomOptions = [
161
158
  value: 'public',
162
159
  },
163
160
  ];
164
-
165
161
  export const DefectConfirm = [
166
162
  {
167
163
  label: 'Yes',
@@ -172,7 +168,6 @@ export const DefectConfirm = [
172
168
  value: 'no',
173
169
  },
174
170
  ];
175
-
176
171
  export const TomTomColumns = [
177
172
  {
178
173
  header: 'Event Date',
@@ -191,34 +186,34 @@ export const TomTomColumns = [
191
186
  accessorKey: 'type',
192
187
  },
193
188
  ];
194
-
195
189
  export const orderResources = [
196
190
  {
197
191
  types: 'Workflow',
198
192
  category: 'ePOD',
199
193
  datetimes: '2024-06-01 10:30:30',
200
194
  action: 'action',
201
- reference: 'Success Note'
195
+ reference: 'Success Note',
202
196
  },
203
197
  {
204
198
  types: 'Workflow',
205
199
  category: 'ePOD',
206
200
  datetimes: '2024-06-01 10:30:30',
207
201
  action: 'action',
208
- reference: 'Success Note'
202
+ reference: 'Success Note',
209
203
  },
210
204
  {
211
205
  types: 'Workflow',
212
206
  category: 'ePOD',
213
207
  datetimes: '2024-06-01 10:30:30',
214
208
  action: 'action',
215
- reference: 'Success Note'
216
- },{
209
+ reference: 'Success Note',
210
+ },
211
+ {
217
212
  types: 'Workflow',
218
213
  category: 'ePOD',
219
214
  datetimes: '2024-06-01 10:30:30',
220
215
  action: 'action',
221
- reference: 'Success Note'
216
+ reference: 'Success Note',
222
217
  },
223
218
  ];
224
219
  export const orderResourcesColumns = [
@@ -243,7 +238,6 @@ export const orderResourcesColumns = [
243
238
  accessorKey: 'action',
244
239
  },
245
240
  ];
246
-
247
241
  export const tomtomResources = [
248
242
  {
249
243
  route: 'Hammer',
@@ -264,7 +258,6 @@ export const tomtomResources = [
264
258
  type: 'workFlow',
265
259
  },
266
260
  ];
267
-
268
261
  export const toolboxResources = [
269
262
  {
270
263
  resources: 'Hammer',
@@ -303,7 +296,6 @@ export const toolboxColumns = [
303
296
  accessorKey: 'action',
304
297
  },
305
298
  ];
306
-
307
299
  export const SystemEventColumns = [
308
300
  {
309
301
  header: 'Date',
@@ -322,7 +314,6 @@ export const SystemEventColumns = [
322
314
  accessorKey: 'code',
323
315
  },
324
316
  ];
325
-
326
317
  export const systemLgsEvents = [
327
318
  {
328
319
  event: 'Order cretaed via Api',
@@ -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 {
@@ -17,19 +14,16 @@ import {
17
14
  useCountData,
18
15
  useRoutesTable,
19
16
  } from '../store/store';
20
- import { useAtom } from 'jotai';
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
- const [state] = useAtom(filtersReducerAtom);
21
+ // const [state] = useAtom(filtersReducerAtom);
28
22
  const [, setPaginationObject] = UsePaginationData();
29
23
  const [, setCount] = useCountData();
30
24
 
31
25
  // Hooks
32
- const { 'x-filters': filters, 'x-pagination': pagination } = state;
26
+ // const { 'x-filters': filters, 'x-pagination': pagination } = state;
33
27
  const {
34
28
  data: fetchedData,
35
29
  loading: apiLoading,
@@ -39,8 +33,8 @@ const Filters = () => {
39
33
  }>({
40
34
  endpoint: 'orders/',
41
35
  method: 'GET',
42
- pagination: pagination,
43
- filters: filters,
36
+ // pagination: pagination,
37
+ // filters: filters,
44
38
  });
45
39
 
46
40
  useEffect(() => {
@@ -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;