@bjsdistribution/dms-client-return 0.1.12-prod → 0.1.13-prod
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/dms-client-return.cjs.development.js +9 -18
- 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 +10 -19
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/client-portal/ReturnStatus.tsx +12 -25
|
@@ -1698,14 +1698,13 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1698
1698
|
endDate = _useEndDate[0];
|
|
1699
1699
|
var _useClientPortal = useClientPortal(),
|
|
1700
1700
|
clientPortal = _useClientPortal[0];
|
|
1701
|
-
var _useState = React.useState([]),
|
|
1702
|
-
modifiedFilters = _useState[0],
|
|
1703
|
-
setModifiedFilters = _useState[1];
|
|
1704
1701
|
var _useSearchText = useSearchText(),
|
|
1705
1702
|
debouncedSearchText = _useSearchText[0];
|
|
1706
1703
|
var _useSearchAfterText = useSearchAfterText(),
|
|
1707
1704
|
debouncedSearchAfterText = _useSearchAfterText[0];
|
|
1708
|
-
|
|
1705
|
+
//stats API
|
|
1706
|
+
var filters = React.useMemo(function () {
|
|
1707
|
+
if (!clientPortal) return [];
|
|
1709
1708
|
var stored = JSON.parse(localStorage.getItem('returnDate') || '{}');
|
|
1710
1709
|
var sDate = startDate != null && startDate.isValid != null && startDate.isValid() ? startDate : dayjs(stored == null ? void 0 : stored.startDate);
|
|
1711
1710
|
var eDate = endDate != null && endDate.isValid != null && endDate.isValid() ? endDate : stored != null && stored.endDate ? dayjs(stored == null ? void 0 : stored.endDate) : null;
|
|
@@ -1728,14 +1727,8 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1728
1727
|
value: sDate.format('YYYY-MM-DD')
|
|
1729
1728
|
}];
|
|
1730
1729
|
}
|
|
1731
|
-
return dateFilters;
|
|
1732
|
-
};
|
|
1733
|
-
React.useEffect(function () {
|
|
1734
|
-
if (!clientPortal) return;
|
|
1735
|
-
var dateFilters = getDateFilters(startDate, endDate);
|
|
1736
|
-
setModifiedFilters(dateFilters);
|
|
1737
|
-
}, [startDate, endDate]);
|
|
1738
|
-
//stats API
|
|
1730
|
+
return [].concat(dateFilters);
|
|
1731
|
+
}, [startDate, endDate, status]);
|
|
1739
1732
|
var _useAxios = dmsComponentLibrary.useAxios({
|
|
1740
1733
|
endpoint: "v1/portal/return/stats/",
|
|
1741
1734
|
method: 'GET',
|
|
@@ -1743,7 +1736,7 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1743
1736
|
pagination: {
|
|
1744
1737
|
is_pagination: false
|
|
1745
1738
|
},
|
|
1746
|
-
filters:
|
|
1739
|
+
filters: filters
|
|
1747
1740
|
}),
|
|
1748
1741
|
statsData = _useAxios.data,
|
|
1749
1742
|
apiLoading = _useAxios.loading,
|
|
@@ -1764,8 +1757,6 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1764
1757
|
}
|
|
1765
1758
|
prevSearchAfterTextRef.current = debouncedSearchAfterText;
|
|
1766
1759
|
}, [debouncedSearchAfterText, startDate, endDate]);
|
|
1767
|
-
console.log(debouncedSearchText, 'debouncedSearchText');
|
|
1768
|
-
console.log(debouncedSearchAfterText, 'debouncedSearchAfterText');
|
|
1769
1760
|
React.useEffect(function () {
|
|
1770
1761
|
fetchData();
|
|
1771
1762
|
}, [startDate, endDate]);
|
|
@@ -1779,19 +1770,19 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1779
1770
|
id: 1,
|
|
1780
1771
|
icon: 'outstanding_return',
|
|
1781
1772
|
status: 'outstanding_return',
|
|
1782
|
-
count:
|
|
1773
|
+
count: count == null ? void 0 : count.outstanding_count,
|
|
1783
1774
|
label: 'Outstanding Return'
|
|
1784
1775
|
}, {
|
|
1785
1776
|
id: 2,
|
|
1786
1777
|
icon: 'scheduled_for_return',
|
|
1787
1778
|
status: 'scheduled_for_return',
|
|
1788
|
-
count:
|
|
1779
|
+
count: count == null ? void 0 : count.scheduled_count,
|
|
1789
1780
|
label: 'Scheduled For Return'
|
|
1790
1781
|
}, {
|
|
1791
1782
|
id: 3,
|
|
1792
1783
|
icon: 'return_completed',
|
|
1793
1784
|
status: 'return_completed',
|
|
1794
|
-
count:
|
|
1785
|
+
count: count == null ? void 0 : count.completed_count,
|
|
1795
1786
|
label: 'Return Completed'
|
|
1796
1787
|
}];
|
|
1797
1788
|
var navigate = reactRouterDom.useNavigate();
|