@bjsdistribution/dms-client-return 0.1.20-dev → 0.1.21-dev

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 (156) hide show
  1. package/dist/components/client-portal/DateFilterStore.d.ts +15 -0
  2. package/dist/components/order-view/DynamicTable.d.ts +2 -1
  3. package/dist/components/order-view/general-information/Status.d.ts +1 -1
  4. package/dist/components/order-view/general-information/index.d.ts +1 -1
  5. package/dist/components/order-view/index.d.ts +1 -1
  6. package/dist/components/order-view/notes/AddNote.d.ts +1 -0
  7. package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
  8. package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +4 -1
  9. package/dist/components/order-view/order-actions/actions/confirm-order/index.d.ts +4 -1
  10. package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
  11. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
  12. package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
  13. package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
  14. package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
  15. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
  16. package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
  17. package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
  18. package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
  19. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
  20. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
  21. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
  22. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
  23. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
  24. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
  25. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
  26. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
  27. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
  28. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
  29. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
  30. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
  31. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
  32. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
  33. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
  34. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
  35. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
  36. package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
  37. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +1 -0
  38. package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +1 -1
  39. package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +1 -0
  40. package/dist/components/order-view/order-actions/types.d.ts +3 -3
  41. package/dist/components/order-view/order-details/expanded-content/index.d.ts +1 -1
  42. package/dist/components/order-view/order-details/index.d.ts +1 -1
  43. package/dist/components/order-view/order-resources/expanded-content/index.d.ts +1 -1
  44. package/dist/components/order-view/products-info/expanded-content/index.d.ts +6 -1
  45. package/dist/components/order-view/products-info/index.d.ts +1 -1
  46. package/dist/components/order-view/return-client-products/ProductTable.d.ts +6 -1
  47. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +6 -1
  48. package/dist/components/order-view/store.d.ts +15 -3
  49. package/dist/components/order-view/system-event-logs/expanded-content/index.d.ts +1 -1
  50. package/dist/components/order-view/types.d.ts +49 -1
  51. package/dist/components/order-view/utils.d.ts +3 -0
  52. package/dist/components/order-view/view-reminder/ViewReminder.d.ts +2 -0
  53. package/dist/dms-client-return.cjs.development.js +4364 -1614
  54. package/dist/dms-client-return.cjs.development.js.map +1 -1
  55. package/dist/dms-client-return.cjs.production.min.js +1 -1
  56. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  57. package/dist/dms-client-return.esm.js +4429 -1679
  58. package/dist/dms-client-return.esm.js.map +1 -1
  59. package/package.json +6 -4
  60. package/src/assets/icons/ActionIcon.tsx +1 -1
  61. package/src/assets/icons/ArrowDownIcon.tsx +2 -2
  62. package/src/components/client-portal/DateFilterStore.ts +94 -0
  63. package/src/components/client-portal/OutstandingTable.tsx +15 -72
  64. package/src/components/client-portal/ReturnAfterSearchBar.tsx +41 -87
  65. package/src/components/client-portal/ReturnRTFilters.tsx +0 -2
  66. package/src/components/client-portal/ReturnSearchBar.tsx +41 -152
  67. package/src/components/client-portal/ReturnStatus.tsx +33 -84
  68. package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +12 -23
  69. package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +8 -85
  70. package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +11 -18
  71. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -15
  72. package/src/components/order-daily-overview/index.tsx +23 -4
  73. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +6 -1
  74. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +3 -0
  75. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +36 -36
  76. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
  77. package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +16 -0
  78. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +25 -11
  79. package/src/components/order-daily-overview/table/ReturnTable.tsx +8 -4
  80. package/src/components/order-view/DynamicTable.tsx +21 -8
  81. package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +1 -1
  82. package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +9 -0
  83. package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
  84. package/src/components/order-view/flags-action-modal/Dropdowns.tsx +2 -0
  85. package/src/components/order-view/general-information/Status.tsx +92 -18
  86. package/src/components/order-view/general-information/index.tsx +2 -2
  87. package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
  88. package/src/components/order-view/index.tsx +50 -8
  89. package/src/components/order-view/modalsPopup/ModalManager.tsx +1 -1
  90. package/src/components/order-view/notes/AddNote.tsx +95 -65
  91. package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
  92. package/src/components/order-view/notification/FlagTemplate.tsx +21 -10
  93. package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
  94. package/src/components/order-view/notification/ReminderTemplate.tsx +28 -13
  95. package/src/components/order-view/notification/index.tsx +100 -55
  96. package/src/components/order-view/order-actions/actions/add-resources/DocFileUpload.tsx +92 -72
  97. package/src/components/order-view/order-actions/actions/add-resources/index.tsx +27 -10
  98. package/src/components/order-view/order-actions/actions/cancel-order/ReturnAction.tsx +25 -4
  99. package/src/components/order-view/order-actions/actions/cancel-order/ReturnReason.tsx +24 -4
  100. package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +9 -2
  101. package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +12 -6
  102. package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +1 -0
  103. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +88 -30
  104. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +5 -3
  105. package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +2 -2
  106. package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
  107. package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +620 -0
  108. package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
  109. package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
  110. package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
  111. package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
  112. package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
  113. package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
  114. package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
  115. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
  116. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
  117. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
  118. package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
  119. package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
  120. package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
  121. package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
  122. package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
  123. package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +201 -0
  124. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
  125. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
  126. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
  127. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
  128. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
  129. package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
  130. package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
  131. package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
  132. package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
  133. package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +2 -0
  134. package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +7 -2
  135. package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +2 -0
  136. package/src/components/order-view/order-actions/index.tsx +18 -5
  137. package/src/components/order-view/order-actions/store.ts +1 -1
  138. package/src/components/order-view/order-actions/types.ts +3 -3
  139. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +7 -1
  140. package/src/components/order-view/order-details/expanded-content/index.tsx +37 -16
  141. package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
  142. package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +3 -4
  143. package/src/components/order-view/order-details/index.tsx +5 -2
  144. package/src/components/order-view/order-resources/expanded-content/index.tsx +2 -2
  145. package/src/components/order-view/products-info/expanded-content/index.tsx +33 -11
  146. package/src/components/order-view/products-info/index.tsx +10 -6
  147. package/src/components/order-view/return-client-products/ProductTable.tsx +12 -2
  148. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +73 -23
  149. package/src/components/order-view/store.ts +107 -1
  150. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -2
  151. package/src/components/order-view/types.ts +54 -1
  152. package/src/components/order-view/utils.ts +37 -0
  153. package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +85 -26
  154. package/src/components/order-view/view-reminder/ViewReminder.tsx +33 -14
  155. package/src/components/store.ts +1 -1
  156. package/src/index.tsx +6 -3
@@ -8,14 +8,19 @@ import React, { useMemo } from 'react';
8
8
  import styled from 'styled-components';
9
9
  import CustomScrollBar from '../../common/scrollbar';
10
10
  import { atom, useAtom } from 'jotai';
11
+ import { Skeleton } from 'antd';
11
12
  export const selectedID = atom<any>([]);
12
13
 
13
14
  interface DynamicTableProps {
14
15
  columns: any;
15
16
  data: any[];
17
+ loading: boolean;
16
18
  }
17
19
 
18
- function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
20
+ function DynamicTable(
21
+ { columns, data, loading }: DynamicTableProps,
22
+ props: any
23
+ ) {
19
24
  const tableColumns = useMemo(() => columns, [columns]);
20
25
  const tableData = useMemo(() => data, [data]);
21
26
 
@@ -44,6 +49,8 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
44
49
  const largeColumns = ['details', 'datetime'];
45
50
  const noFlexColumns = ['id'];
46
51
 
52
+ console.log(rows, '<===========rows');
53
+ console.log(props, 'props');
47
54
  return (
48
55
  <MainContainer>
49
56
  <Container>
@@ -78,7 +85,19 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
78
85
  ))}
79
86
  </TableHead>
80
87
  <TableBody>
81
- {rows?.length > 0 ? (
88
+ {loading ? (
89
+ <tr>
90
+ <td colSpan={5}>
91
+ <Skeleton active />
92
+ </td>
93
+ </tr>
94
+ ) : rows?.length === 0 ? (
95
+ <TableRow>
96
+ <TableData colSpan={columns.length}>
97
+ No entries found.
98
+ </TableData>
99
+ </TableRow>
100
+ ) : (
82
101
  rows?.map(row => (
83
102
  <TableRow
84
103
  key={row.id}
@@ -115,12 +134,6 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
115
134
  ))}
116
135
  </TableRow>
117
136
  ))
118
- ) : (
119
- <TableRow>
120
- <TableData colSpan={columns.length}>
121
- No entries found.
122
- </TableData>
123
- </TableRow>
124
137
  )}
125
138
  </TableBody>
126
139
  </Table>
@@ -41,7 +41,7 @@ function DropDowns() {
41
41
  onClick={action.onClick}
42
42
  style={{ cursor: 'pointer' }}
43
43
  >
44
- {action.label}
44
+ {action?.label}
45
45
  </FontContainer>
46
46
  ))}
47
47
  </DashBoardWrapper>
@@ -40,6 +40,7 @@ function Options() {
40
40
  };
41
41
 
42
42
  const isReleased = orderStatus[0]?.released;
43
+ // const routedValue = orderStatus[0]?.routed;
43
44
  const isRouted = orderStatus[0]?.routed && orderDetails?.order_routes?.id;
44
45
  const isOrderOnHold = orderDetails?.status === 'OO';
45
46
  const isOrderCancelled = orderDetails?.status === 'CO';
@@ -73,6 +74,14 @@ function Options() {
73
74
  shouldExclude = true;
74
75
  }
75
76
 
77
+ if (isRouted && option.value === 'clear-date') {
78
+ shouldExclude = true;
79
+ }
80
+
81
+ // if (routedValue && option.value === 'remove-from-route') {
82
+ // shouldExclude = true;
83
+ // }
84
+
76
85
  return !shouldExclude;
77
86
  });
78
87
 
@@ -1,17 +1,23 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { useCustomerInfo } from '../../store';
3
+ import { useCustomerInfo, useGlobalEscData } from '../../store';
4
4
 
5
5
  const Details = () => {
6
6
  // const [orderDetails] = useOrderDetails();
7
7
  const [customerInfo] = useCustomerInfo();
8
8
  const recipient = customerInfo?.recipient_name || '';
9
9
  const postcodeShow = customerInfo?.postcode || '';
10
+ const [globalEscData] = useGlobalEscData();
10
11
 
11
12
  return (
12
13
  <DetailsContainer>
13
14
  <Typo>
14
- CUSTOMER RETURN - {recipient} , {postcodeShow}
15
+ CUSTOMER RETURN - {recipient} , {postcodeShow} {}
16
+ {globalEscData?.length > 0 && (
17
+ <EscInfo>
18
+ {`${globalEscData[0]?.escalation_type?.level} (${globalEscData[0]?.escalation_type?.name})`}
19
+ </EscInfo>
20
+ )}
15
21
  </Typo>
16
22
  </DetailsContainer>
17
23
  );
@@ -27,10 +33,14 @@ const DetailsContainer = styled.div`
27
33
  `;
28
34
 
29
35
  const Typo = styled.div`
36
+ display: flex;
37
+ flex-direction: row;
38
+ gap: 15px;
39
+ align-items: center;
30
40
  font-size: 20px;
31
41
  font-style: normal;
32
42
  font-weight: 600;
33
- line-height: 32px; /* 160% */
43
+ line-height: 32px;
34
44
  text-transform: uppercase;
35
45
  margin: 0;
36
46
  padding: 0;
@@ -40,4 +50,19 @@ const Typo = styled.div`
40
50
  }
41
51
  `;
42
52
 
53
+ const Name = styled.div`
54
+ /* heading/h3-subHeader */
55
+ font-family: 'Roboto', sans-serif;
56
+ font-size: 20px;
57
+ font-style: normal;
58
+ font-weight: 900;
59
+ line-height: 32px; /* 160% */
60
+ text-transform: uppercase;
61
+ `;
62
+
63
+ const EscInfo = styled(Name)`
64
+ color: #6396e5;
65
+ font-size: 16px;
66
+ `;
67
+
43
68
  export default Details;
@@ -75,6 +75,7 @@ function ButtonsSection() {
75
75
  placeholder="Select Type"
76
76
  onChange={handleTaskTypeChange}
77
77
  value={selectedTypeId}
78
+ style={{ minWidth: '200px', width: 'auto' }}
78
79
  />
79
80
  </Flex>
80
81
  <Flex>
@@ -84,6 +85,7 @@ function ButtonsSection() {
84
85
  placeholder="Select Type"
85
86
  onChange={handlePriorityChange}
86
87
  value={taskPayload?.priority || flagById?.priority}
88
+ style={{ minWidth: '100px', width: 'auto' }}
87
89
  />
88
90
  </Flex>
89
91
  <Flex>
@@ -1,34 +1,66 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { StatusOptions } from '../helper';
4
- import Divider from '../../../assets/icons/Divider';
5
4
  // Import icon
6
5
  import RouteIcon from '../../../assets/icons/RoutedIcon';
7
6
  import SuccessIcon from '../../../assets/icons/SuccessIcon';
8
7
  import DeliveredIcon from '../../../assets/icons/DeliveredIcon';
9
8
  import ConfirmedIcon from '../../../assets/icons/ConfirmedIcon';
10
9
  import { useStatusDetails } from '../store';
10
+ import { Skeleton } from 'antd';
11
+ import Divider from '../../../assets/icons/Divider';
11
12
 
12
- function Status() {
13
+ function Status({ statusDataLoading }: any) {
13
14
  const [orderStatus] = useStatusDetails();
14
-
15
15
  return (
16
- <Container>
17
- <BoxContainer>
18
- {StatusOptions.map((option, index) => (
19
- <React.Fragment key={index}>
20
- <TextContainer>
21
- {renderIcon(option.value, orderStatus)}
22
- <Heading>{option.label}</Heading>
23
- </TextContainer>
24
- {index < StatusOptions.length - 1 && <Divider />}
25
- </React.Fragment>
26
- ))}
27
- </BoxContainer>
28
- </Container>
16
+ <>
17
+ <Container>
18
+ <BoxContainer>
19
+ {statusDataLoading ? (
20
+ <>
21
+ <StatusSkeletonRow />
22
+ </>
23
+ ) : (
24
+ StatusOptions?.map((option, index) => (
25
+ <React.Fragment key={index}>
26
+ <TextContainer>
27
+ {renderIcon(option.value, orderStatus)}
28
+ <Heading>{option.label}</Heading>
29
+ </TextContainer>
30
+ {index < StatusOptions.length - 1 && <Divider />}
31
+ </React.Fragment>
32
+ ))
33
+ )}
34
+ </BoxContainer>
35
+ </Container>
36
+ </>
29
37
  );
30
38
  }
31
-
39
+ const StatusSkeletonItem = () => (
40
+ <SkeletonItemContainer>
41
+ <Skeleton.Avatar size="small" style={{ marginRight: 12 }} />
42
+ <Skeleton.Input
43
+ active
44
+ size="small"
45
+ style={{ width: 150, borderRadius: 8 }}
46
+ />
47
+ </SkeletonItemContainer>
48
+ );
49
+ const StatusSkeletonRow = () => (
50
+ <StatusBox>
51
+ <StatusSkeletonItem />
52
+ <SkeletonDivider />
53
+ <StatusSkeletonItem />
54
+ <SkeletonDivider />
55
+ <StatusSkeletonItem />
56
+ <SkeletonDivider />
57
+ <StatusSkeletonItem />
58
+ <SkeletonDivider />
59
+ <StatusSkeletonItem />
60
+ <SkeletonDivider />
61
+ <StatusSkeletonItem />
62
+ </StatusBox>
63
+ );
32
64
  const renderIcon = (value: any, orderStatus: any) => {
33
65
  const status = orderStatus && orderStatus.length > 0 ? orderStatus[0] : null;
34
66
 
@@ -72,11 +104,53 @@ const renderIcon = (value: any, orderStatus: any) => {
72
104
  }
73
105
  };
74
106
 
107
+ // const RowWrapper = styled.div`
108
+ // display: flex;
109
+ // flex-direction: column;
110
+ // background: #fff;
111
+ // border-radius: 12px;
112
+ // box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
113
+ // padding: 16px;
114
+ // `;
115
+
116
+ // const HeaderPlaceholder = styled.div`
117
+ // display: flex;
118
+ // align-items: center;
119
+ // padding: 8px 0;
120
+ // gap: 12px;
121
+ // `;
122
+
123
+ const StatusBox = styled.div`
124
+ display: flex;
125
+ align-items: center;
126
+ background: #fcfcfc;
127
+ border: 1px solid #eee;
128
+ border-radius: 20px;
129
+ justify-content: space-between;
130
+ flex-wrap: wrap;
131
+ padding: 5px;
132
+ width: -webkit-fill-available;
133
+ `;
134
+
135
+ const SkeletonItemContainer = styled.div`
136
+ display: flex;
137
+ align-items: center;
138
+ gap: 8px;
139
+ `;
140
+
141
+ const SkeletonDivider = styled.div`
142
+ width: 12px;
143
+ height: 2px;
144
+ background-color: #e0e0e0;
145
+ margin: 0 4px;
146
+ border-radius: 2px;
147
+ `;
148
+
75
149
  const BoxContainer = styled.div`
76
150
  border: 1px solid #e3e3e3;
77
151
  display: flex;
78
152
  justify-content: space-evenly;
79
- border-radius: 8px;
153
+ border-radius: 20px;
80
154
  background: #f8fafc;
81
155
  align-items: center;
82
156
  height: 5%;
@@ -3,10 +3,10 @@ import Status from './Status';
3
3
  import styled from 'styled-components';
4
4
  // import DropDownOptions from './dropdowns';
5
5
 
6
- function GeneralHeader() {
6
+ function GeneralHeader({ statusDataLoading }: any) {
7
7
  return (
8
8
  <Section>
9
- <Status />
9
+ <Status statusDataLoading={statusDataLoading} />
10
10
  {/* <DropDownOptions /> */}
11
11
  </Section>
12
12
  );
@@ -1,12 +1,16 @@
1
1
  import styled from 'styled-components';
2
2
  import React from 'react';
3
+
3
4
  import { Skeleton } from 'antd';
4
- import { formatUtcToLocal } from '@bjsdistribution/dms-component-library';
5
- import { useAuditLogLoadingState, usegetNotes } from '../store';
5
+ import {
6
+ PrivateIcon,
7
+ formatUtcToLocal,
8
+ } from '@bjsdistribution/dms-component-library';
6
9
  import { NotesTableData } from '../notes/logs/fakeData';
10
+ import { useAuditLogLoadingState, usegetNotes } from '../store';
7
11
 
8
12
  const GenericAuditLogsTable = () => {
9
- const tableHeadData = NotesTableData[0].tableHead; // Assuming NotesTableData contains table header information
13
+ const tableHeadData = NotesTableData[0]?.tableHead; // Assuming NotesTableData contains table header information
10
14
  const [getNotes] = usegetNotes();
11
15
  const [auditLogLoadingStatus] = useAuditLogLoadingState();
12
16
 
@@ -35,9 +39,23 @@ const GenericAuditLogsTable = () => {
35
39
  <div className="bold" title={note?.created_by}>
36
40
  {note?.created_by}
37
41
  </div>
38
- <div>{`${formatUtcToLocal(note?.created_at).date} @ ${
39
- formatUtcToLocal(note?.created_at).time
40
- }`}</div>
42
+ <div className="notesIcon">
43
+ {note?.is_private ? (
44
+ <>
45
+ <PrivateIcon />{' '}
46
+ <span className="datetime">{`${
47
+ formatUtcToLocal(note?.created_at).date
48
+ } @ ${
49
+ formatUtcToLocal(note?.created_at).time
50
+ }`}</span>
51
+ </>
52
+ ) : (
53
+ <span className="datetime">{`${
54
+ formatUtcToLocal(note?.created_at).date
55
+ } @ ${formatUtcToLocal(note?.created_at).time}`}</span>
56
+ )}
57
+ </div>
58
+ <div>{note?.note_type || 'N/A'}</div>
41
59
  </td>
42
60
  <td
43
61
  dangerouslySetInnerHTML={{ __html: note?.description }}
@@ -56,6 +74,8 @@ const GenericAuditLogsTable = () => {
56
74
  );
57
75
  };
58
76
 
77
+ const ScrollableTableWrapper = styled.div``;
78
+
59
79
  export const AuditTableWrapper = styled.div`
60
80
  height: 250px;
61
81
  min-height: 200px;
@@ -82,22 +102,29 @@ export const AuditTableWrapper = styled.div`
82
102
  color: #667085;
83
103
  font-family: Lato;
84
104
  font-size: 13px;
85
- font-style: normal;
86
105
  font-weight: 400;
87
106
  line-height: 16px;
88
107
  padding: 10px;
108
+ border-bottom: 1px solid #efe8e8;
109
+ word-break: break-word;
110
+ vertical-align: top;
111
+
89
112
  .bold {
90
113
  font-weight: 500;
91
114
  font-size: 14px;
92
115
  }
116
+ .notesIcon {
117
+ display: flex;
118
+ align-items: center;
119
+ gap: 5px;
120
+
121
+ .datetime {
122
+ min-width: 155px;
123
+ }
124
+ }
93
125
  }
94
126
  }
95
127
  }
96
128
  `;
97
129
 
98
- const ScrollableTableWrapper = styled.div`
99
- height: 550px;
100
- overflow: auto;
101
- `;
102
-
103
130
  export default GenericAuditLogsTable;
@@ -6,7 +6,11 @@ import SystemLogs from './system-event-logs/expanded-content';
6
6
  import GeneralHeader from './general-information';
7
7
  import ProductsInfo from './products-info';
8
8
  import OrderActions from './order-actions';
9
- import { useApiHook, useAxios } from '@bjsdistribution/dms-component-library';
9
+ import {
10
+ DocumentTitle,
11
+ useApiHook,
12
+ useAxios,
13
+ } from '@bjsdistribution/dms-component-library';
10
14
  import {
11
15
  useOrderDetails,
12
16
  // useOrderStaticData,
@@ -27,6 +31,7 @@ import {
27
31
  useGlobalStateHitOrder,
28
32
  useAtom,
29
33
  usegetClientData,
34
+ useGlobalEscData,
30
35
  } from './store';
31
36
  import { OrdersType } from './types';
32
37
  import { useLocation } from 'react-router-dom';
@@ -47,7 +52,7 @@ interface ApiResponse {
47
52
  setShouldPerformAction: boolean;
48
53
  }
49
54
 
50
- function OrderView() {
55
+ function OrderView({ locationloading }: any) {
51
56
  notification.config({
52
57
  top: 150,
53
58
  });
@@ -59,7 +64,7 @@ function OrderView() {
59
64
  const [, setLoading] = useState<boolean>(false);
60
65
  const [, setOrderStatus] = useStatusDetails();
61
66
  const [, setDepotOptions] = useDepotOptions();
62
- const [, setCustomerInfo] = useCustomerInfo();
67
+ const [customerInfo, setCustomerInfo] = useCustomerInfo();
63
68
  const [, setLocationOptions] = useLocationOptions();
64
69
  const [orderResources, setOrderResources] = useOrderProductsResources();
65
70
  const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();
@@ -73,6 +78,7 @@ function OrderView() {
73
78
  const order_id = orderDetails?.id;
74
79
  const [getResources] = useAtom(setResourcesCall);
75
80
  const [, setClientData] = usegetClientData();
81
+ const [, setGlobalEscData] = useGlobalEscData();
76
82
 
77
83
  useEffect(() => {
78
84
  setStatusVal(orderDetails?.status_value);
@@ -96,6 +102,7 @@ function OrderView() {
96
102
  value: `${order_id}`,
97
103
  },
98
104
  ],
105
+ showLoader: false,
99
106
  });
100
107
 
101
108
  // query param
@@ -256,6 +263,7 @@ function OrderView() {
256
263
  useEffect(() => {
257
264
  if (orderId) {
258
265
  callCLientApi();
266
+ callEscalationApi();
259
267
  }
260
268
  }, [orderId]);
261
269
 
@@ -288,12 +296,14 @@ function OrderView() {
288
296
  const {
289
297
  data: fetchedResourcesData,
290
298
  setShouldPerformAction: setActions,
299
+ loading: loadingResources,
291
300
  } = useApiHook<{
292
301
  data: ApiResponse[];
293
302
  }>({
294
303
  endpoint: `/orders/${orderId}/order_resources/`,
295
304
  method: 'GET',
296
305
  performAction: false,
306
+ showLoader: false,
297
307
  });
298
308
 
299
309
  useEffect(() => {
@@ -418,21 +428,53 @@ function OrderView() {
418
428
  setSubContracterData(formattedData);
419
429
  }
420
430
  }, [fetchedSubcontractotData, fetchedSubcontractotData, apiLoading]);
431
+
432
+ // ESCALATIONS API
433
+
434
+ const {
435
+ data: fetchedEscalationData,
436
+ fetchData: callEscalationApi,
437
+ loading: escalationDataLoading,
438
+ } = useAxios<{
439
+ data: any;
440
+ }>({
441
+ endpoint: `/orders/escalations/${orderId}`,
442
+ method: 'GET',
443
+ });
444
+
445
+ useEffect(() => {
446
+ if (fetchedEscalationData?.data) {
447
+ const escalationData = fetchedEscalationData?.data;
448
+ const sortedEscData = escalationData?.sort(
449
+ (a: any, b: any) =>
450
+ new Date(b?.created_at).getTime() - new Date(a?.created_at).getTime()
451
+ );
452
+ const showEsc = sortedEscData != null && sortedEscData.length > 0;
453
+ showEsc ? setGlobalEscData(sortedEscData) : setGlobalEscData([]);
454
+ }
455
+ }, [escalationDataLoading]);
456
+
457
+ const docTitle = `${customerInfo?.recipient_name}, ${customerInfo?.postcode}`;
458
+
421
459
  return (
422
460
  <MainContainer>
423
- <GeneralHeader />
461
+ <DocumentTitle title={docTitle} />
462
+ <GeneralHeader statusDataLoading={statusDataLoading} />
424
463
 
425
464
  <DetailsFilters />
426
465
  <Notification />
427
- <OrderDetails />
428
- <ProductsInfo />
466
+ <OrderDetails
467
+ orderLoading={loading}
468
+ depotDataLoading={depotDataLoading}
469
+ />
470
+ <ProductsInfo locationloading={locationloading} />
429
471
  <SplitLayout>
430
472
  <NotesContainer>
431
473
  <Notes />
432
474
  </NotesContainer>
433
475
  <TablesContainer>
434
- <Order />
435
- <SystemLogs />
476
+ <Order loading={loadingResources} />
477
+ <SystemLogs loading={logsLoading} />
436
478
  </TablesContainer>
437
479
  </SplitLayout>
438
480
  <OrderActions />
@@ -74,7 +74,7 @@ const ModalManager = () => {
74
74
 
75
75
  useEffect(() => {
76
76
  // @ts-ignore
77
- if (response && response?.code == 500) {
77
+ if ((response && response?.code == 500) || response?.code == 400) {
78
78
  // @ts-ignore
79
79
  notification.error({
80
80
  message: 'Failure',