@bjsdistribution/dms-client-return 0.0.10 → 0.0.11

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.10",
2
+ "version": "0.0.11",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -7,9 +7,9 @@ import {
7
7
  import TableFilters from './TableFilters';
8
8
  import FilterIcon from '../../../../assets/icons/FilterIcon';
9
9
  import DateIcon from '../../../../assets/icons/DateIcon';
10
- import StatusIcon from '../../../../assets/icons/StatusIcon';
10
+ // import StatusIcon from '../../../../assets/icons/StatusIcon';
11
11
  import ClientIcon from '../../../../assets/icons/ClientIcon';
12
- import AssigneIcon from '../../../../assets/icons/AssigneIcon';
12
+ // import AssigneIcon from '../../../../assets/icons/AssigneIcon';
13
13
  import { DatePicker, Select, Tooltip } from 'antd';
14
14
  import { useAtom } from '../../../order-view/store';
15
15
  import styled from 'styled-components';
@@ -21,13 +21,13 @@ const ReturnOrderFilter = () => {
21
21
  const [, dispatch] = useAtom(filtersReducerAtom);
22
22
  const [customers] = useCustomerData();
23
23
  const [selectedDate, setSelectedDate] = useState();
24
- const zoneOptions = [
25
- { label: 'Zone 1', value: 'zone1' },
26
- { label: 'Zone 2', value: 'zone2' },
27
- { label: 'Zone 3', value: 'zone3' },
28
- { label: 'Zone 4', value: 'zone4' },
29
- { label: 'Zone 5', value: 'zone5' },
30
- ];
24
+ // const zoneOptions = [
25
+ // { label: 'Zone 1', value: 'zone1' },
26
+ // { label: 'Zone 2', value: 'zone2' },
27
+ // { label: 'Zone 3', value: 'zone3' },
28
+ // { label: 'Zone 4', value: 'zone4' },
29
+ // { label: 'Zone 5', value: 'zone5' },
30
+ // ];
31
31
 
32
32
  // date change here
33
33
  const handleDateChange = (date: any | null) => {
@@ -88,7 +88,7 @@ const ReturnOrderFilter = () => {
88
88
  </StyledDatePicker>
89
89
  </div>
90
90
 
91
- <div className="datefilter">
91
+ {/* <div className="datefilter">
92
92
  <div className="dateiconcontainer">
93
93
  <StatusIcon />
94
94
  </div>
@@ -112,7 +112,7 @@ const ReturnOrderFilter = () => {
112
112
  )}
113
113
  />
114
114
  </StyledAntSelect>
115
- </div>
115
+ </div> */}
116
116
  <div className="datefilter">
117
117
  <div className="dateiconcontainer">
118
118
  <ClientIcon />
@@ -123,7 +123,7 @@ const ReturnOrderFilter = () => {
123
123
  className="custom-select"
124
124
  placeholder="Client"
125
125
  onChange={handleClientChange}
126
- style={{ width: '125px' }}
126
+ style={{ width: '125px', border: 'none' }}
127
127
  maxTagCount={0}
128
128
  maxTagPlaceholder={(omittedValues: any) => (
129
129
  <Tooltip
@@ -138,7 +138,7 @@ const ReturnOrderFilter = () => {
138
138
  />
139
139
  </StyledAntSelect>
140
140
  </div>
141
- <div className="datefilter">
141
+ {/* <div className="datefilter">
142
142
  <div className="dateiconcontainer">
143
143
  <AssigneIcon />
144
144
  </div>
@@ -162,7 +162,7 @@ const ReturnOrderFilter = () => {
162
162
  )}
163
163
  />
164
164
  </StyledAntSelect>
165
- </div>
165
+ </div> */}
166
166
  </LeftSideConatiner>
167
167
  </StyledFIlterELements>
168
168
  <TableFilters />
@@ -184,6 +184,9 @@ export const StyledAntSelect = styled.div`
184
184
  border: none;
185
185
  width: 80px;
186
186
  }
187
+ .ant-select-selector {
188
+ border: 1px solid #ffffff !important;
189
+ }
187
190
  :where(.css-dev-only-do-not-override-m4timi).ant-select-single:not(.ant-select-customize-input)
188
191
  .ant-select-selector {
189
192
  padding: 0 5px;
@@ -1,8 +1,4 @@
1
- import {
2
- Checkbox,
3
- displayValueOrNA,
4
- useApiHook,
5
- } from '@bjsdistribution/dms-component-library';
1
+ import { Checkbox, useApiHook } from '@bjsdistribution/dms-component-library';
6
2
  import { Empty } from 'antd';
7
3
  import { useAtom } from 'jotai';
8
4
  import React, { useEffect, useRef, useState } from 'react';
@@ -22,6 +18,7 @@ import { useLoading, usePrintOptionTOggle } from '../../store/store';
22
18
  import { ApiResponse } from '../../../types';
23
19
  import { filtersReducerAtom } from '../../header-filters/filterStore';
24
20
  import PrintDropDown from '../../../order-view/details-filters/left-side-filters/dropdowns/PrintDropDown';
21
+ import { displayValueOrNA } from '../../shared/utlis';
25
22
  const ReturnOrderTable = ({ loadingskeleton }: any) => {
26
23
  const [state] = useAtom(filtersReducerAtom);
27
24
 
@@ -209,10 +206,10 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
209
206
  <th>Return Location</th>
210
207
  <th>Recipient</th>
211
208
  <th>Code</th>
212
- <th> Description</th>
209
+ <th>Description</th>
213
210
  <th>Part</th>
214
211
  <th>Weight</th>
215
- <th> CBM</th>
212
+ <th>CBM</th>
216
213
  <th>Return Reason</th>
217
214
  <th>Collected</th>
218
215
  <th>Collection Reason</th>
@@ -256,7 +253,9 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
256
253
  </td>
257
254
 
258
255
  <td>
259
- {displayValueOrNA(item?.orders_products_stock?.location)}
256
+ {item?.orders_products_stock?.location ? null : (
257
+ <div className="awaiting">Awating</div>
258
+ )}
260
259
  </td>
261
260
 
262
261
  <td> {displayValueOrNA(item?.return_location)}</td>
@@ -283,7 +282,7 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
283
282
  </td>
284
283
  <td>{displayValueOrNA(item?.code)}</td>
285
284
  <td>{displayValueOrNA(item?.description)}</td>
286
- <td>N/A</td>
285
+ <td>{displayValueOrNA(item?.parts_count)}</td>
287
286
  <td>{displayValueOrNA(item?.weight)}KG</td>
288
287
  <td>{displayValueOrNA(item?.cube)}</td>
289
288
  <td>{displayValueOrNA(item?.return_reasons?.reason)}</td>
@@ -386,6 +386,20 @@ export const StyledTable = styled.table`
386
386
  border-radius: 22px;
387
387
  background: rgba(41, 204, 106, 0.15);
388
388
  }
389
+ .awaiting {
390
+ display: flex;
391
+ min-width: 85px;
392
+ padding: 6px 10px;
393
+ justify-content: center;
394
+ align-items: center;
395
+ gap: 5px;
396
+ border-radius: 22px;
397
+ background: rgba(233, 82, 82, 0.15);
398
+ color: #e95252;
399
+ font-family: 'Open Sans';
400
+ font-size: 12px;
401
+ font-weight: 600;
402
+ }
389
403
  ul > li > a {
390
404
  text-decoration: none !important;
391
405
  color: #0099ff;
@@ -74,5 +74,11 @@ export const formatDate = (date: any) => {
74
74
 
75
75
  export const displayValueOrNA = (value: any) => {
76
76
  const isBlankArray = Array.isArray(value) && value.length === 0;
77
- return value && !isBlankArray ? value : '--';
77
+ if (value === 0) {
78
+ return 0;
79
+ }
80
+ if (value === 'NA' || value === undefined || value === null || isBlankArray) {
81
+ return 'NA';
82
+ }
83
+ return value;
78
84
  };