@djb25/digit-ui-module-ekyc 1.0.49 → 1.0.51
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/index.js +109 -27
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +109 -27
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1689,12 +1689,6 @@ const VendorDetailsCard = () => {
|
|
|
1689
1689
|
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
1690
1690
|
const _useParams = reactRouterDom.useParams(),
|
|
1691
1691
|
vendorId = _useParams.vendorId;
|
|
1692
|
-
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
1693
|
-
enabled: !!tenantId,
|
|
1694
|
-
keepPreviousData: true
|
|
1695
|
-
}),
|
|
1696
|
-
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
1697
|
-
progressData = _Digit$Hooks$ekyc$use.data;
|
|
1698
1692
|
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
1699
1693
|
status: "ACTIVE"
|
|
1700
1694
|
}, {
|
|
@@ -1744,6 +1738,16 @@ const VendorDetailsCard = () => {
|
|
|
1744
1738
|
return matchedMock || ekycMockData.vendors[0];
|
|
1745
1739
|
}
|
|
1746
1740
|
}, [vendorSearchResponse, vendorId, loggedInUser]);
|
|
1741
|
+
const targetVendorId = vendorId || (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId);
|
|
1742
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
|
|
1743
|
+
vendorId: targetVendorId,
|
|
1744
|
+
vendorIds: [targetVendorId]
|
|
1745
|
+
} : {}, {
|
|
1746
|
+
enabled: !!tenantId,
|
|
1747
|
+
keepPreviousData: true
|
|
1748
|
+
}),
|
|
1749
|
+
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
1750
|
+
progressData = _Digit$Hooks$ekyc$use.data;
|
|
1747
1751
|
const vendorSupervisors = React.useMemo(() => {
|
|
1748
1752
|
if (!(supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors)) {
|
|
1749
1753
|
if (vendor && Array.isArray(ekycMockData.vendors)) {
|
|
@@ -2856,7 +2860,63 @@ const Inbox = _ref2 => {
|
|
|
2856
2860
|
isListLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
2857
2861
|
_Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
|
|
2858
2862
|
listData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2;
|
|
2859
|
-
const _Digit$Hooks$
|
|
2863
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
2864
|
+
status: "ACTIVE"
|
|
2865
|
+
}, {
|
|
2866
|
+
enabled: !!tenantId,
|
|
2867
|
+
staleTime: 300000
|
|
2868
|
+
}),
|
|
2869
|
+
vendorSearchResponse = _Digit$Hooks$fsm$useD.data;
|
|
2870
|
+
const _useMemo = React.useMemo(() => {
|
|
2871
|
+
var _Digit$SessionStorage;
|
|
2872
|
+
if (!vendorSearchResponse || vendorSearchResponse.length === 0) {
|
|
2873
|
+
return {
|
|
2874
|
+
targetVendorId: null,
|
|
2875
|
+
allVendorIds: []
|
|
2876
|
+
};
|
|
2877
|
+
}
|
|
2878
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
2879
|
+
const userUuid = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
|
|
2880
|
+
const userMobile = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber;
|
|
2881
|
+
const matchesUser = v => {
|
|
2882
|
+
var _v$owner, _v$owner2, _v$owner3;
|
|
2883
|
+
const ownerUuid = ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.uuid) || ((_v$owner2 = v.owner) === null || _v$owner2 === void 0 ? void 0 : _v$owner2.id);
|
|
2884
|
+
const ownerMobile = ((_v$owner3 = v.owner) === null || _v$owner3 === void 0 ? void 0 : _v$owner3.mobileNumber) || v.mobileNumber;
|
|
2885
|
+
return userUuid && ownerUuid === userUuid || userMobile && ownerMobile === userMobile;
|
|
2886
|
+
};
|
|
2887
|
+
const allIds = vendorSearchResponse.map(v => {
|
|
2888
|
+
const dso = v.dsoDetails || v;
|
|
2889
|
+
return dso.id || dso.vendorId || v.id || v.vendorId;
|
|
2890
|
+
}).filter(Boolean);
|
|
2891
|
+
const matched = vendorSearchResponse.find(v => matchesUser(v.dsoDetails || v));
|
|
2892
|
+
let matchedId = null;
|
|
2893
|
+
if (matched) {
|
|
2894
|
+
const dso = matched.dsoDetails || matched;
|
|
2895
|
+
matchedId = dso.id || dso.vendorId || matched.id || matched.vendorId;
|
|
2896
|
+
}
|
|
2897
|
+
return {
|
|
2898
|
+
targetVendorId: matchedId,
|
|
2899
|
+
allVendorIds: allIds
|
|
2900
|
+
};
|
|
2901
|
+
}, [vendorSearchResponse]),
|
|
2902
|
+
targetVendorId = _useMemo.targetVendorId,
|
|
2903
|
+
allVendorIds = _useMemo.allVendorIds;
|
|
2904
|
+
const progressParams = React.useMemo(() => {
|
|
2905
|
+
if (targetVendorId) {
|
|
2906
|
+
return {
|
|
2907
|
+
vendorId: targetVendorId,
|
|
2908
|
+
vendorIds: [targetVendorId]
|
|
2909
|
+
};
|
|
2910
|
+
}
|
|
2911
|
+
if (allVendorIds && allVendorIds.length > 0) {
|
|
2912
|
+
return {
|
|
2913
|
+
vendorId: allVendorIds[0],
|
|
2914
|
+
vendorIds: allVendorIds
|
|
2915
|
+
};
|
|
2916
|
+
}
|
|
2917
|
+
return {};
|
|
2918
|
+
}, [targetVendorId, allVendorIds]);
|
|
2919
|
+
const _Digit$Hooks$ekyc$use3 = Digit.Hooks.ekyc.useEkycAssignmentProgress(progressParams, {
|
|
2860
2920
|
enabled: !!tenantId,
|
|
2861
2921
|
keepPreviousData: true
|
|
2862
2922
|
}),
|
|
@@ -2919,8 +2979,8 @@ const Inbox = _ref2 => {
|
|
|
2919
2979
|
const _useTranslation = reactI18next.useTranslation(),
|
|
2920
2980
|
t = _useTranslation.t;
|
|
2921
2981
|
const supervisor = React.useMemo(() => {
|
|
2922
|
-
var _Digit$
|
|
2923
|
-
const loggedInUser = (_Digit$
|
|
2982
|
+
var _Digit$SessionStorage2, _loggedInUser$roles;
|
|
2983
|
+
const loggedInUser = (_Digit$SessionStorage2 = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.info;
|
|
2924
2984
|
const roles = (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$roles = loggedInUser.roles) === null || _loggedInUser$roles === void 0 ? void 0 : _loggedInUser$roles.map(ele => ele.code)) || [];
|
|
2925
2985
|
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
2926
2986
|
const targetId = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
|
|
@@ -4801,8 +4861,18 @@ const AdminDashboard = () => {
|
|
|
4801
4861
|
}),
|
|
4802
4862
|
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
4803
4863
|
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
4804
|
-
const
|
|
4805
|
-
|
|
4864
|
+
const allVendorIds = React.useMemo(() => {
|
|
4865
|
+
if (!vendorSearchResponse) return [];
|
|
4866
|
+
return vendorSearchResponse.map(v => {
|
|
4867
|
+
const dso = v.dsoDetails || v;
|
|
4868
|
+
return dso.id || dso.vendorId || v.id || v.vendorId;
|
|
4869
|
+
}).filter(Boolean);
|
|
4870
|
+
}, [vendorSearchResponse]);
|
|
4871
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(allVendorIds.length > 0 ? {
|
|
4872
|
+
vendorId: allVendorIds[0],
|
|
4873
|
+
vendorIds: allVendorIds
|
|
4874
|
+
} : {}, {
|
|
4875
|
+
enabled: !!tenantId && allVendorIds.length > 0,
|
|
4806
4876
|
keepPreviousData: true
|
|
4807
4877
|
}),
|
|
4808
4878
|
progressData = _Digit$Hooks$ekyc$use.data,
|
|
@@ -4914,12 +4984,6 @@ const SupervisorDetailsCard = () => {
|
|
|
4914
4984
|
const _useState = React.useState(false),
|
|
4915
4985
|
ekycDownloadLoading = _useState[0],
|
|
4916
4986
|
setEkycDownloadLoading = _useState[1];
|
|
4917
|
-
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
4918
|
-
enabled: !!tenantId,
|
|
4919
|
-
keepPreviousData: true
|
|
4920
|
-
}),
|
|
4921
|
-
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
4922
|
-
progressData = _Digit$Hooks$ekyc$use.data;
|
|
4923
4987
|
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
|
|
4924
4988
|
status: "ACTIVE"
|
|
4925
4989
|
}, {
|
|
@@ -4928,6 +4992,24 @@ const SupervisorDetailsCard = () => {
|
|
|
4928
4992
|
}),
|
|
4929
4993
|
supervisorSearchResponse = _Digit$Hooks$fsm$useS.data,
|
|
4930
4994
|
isSupervisorSearchLoading = _Digit$Hooks$fsm$useS.isLoading;
|
|
4995
|
+
const targetVendorId = React.useMemo(() => {
|
|
4996
|
+
const targetId = supervisorId || (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid);
|
|
4997
|
+
if (!targetId || !(supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors)) return null;
|
|
4998
|
+
const matchedSup = supervisorSearchResponse.supervisors.find(s => {
|
|
4999
|
+
var _s$id, _s$owner, _s$owner$uuid;
|
|
5000
|
+
return ((_s$id = s.id) === null || _s$id === void 0 ? void 0 : _s$id.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase()) || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : (_s$owner$uuid = _s$owner.uuid) === null || _s$owner$uuid === void 0 ? void 0 : _s$owner$uuid.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase());
|
|
5001
|
+
});
|
|
5002
|
+
return (matchedSup === null || matchedSup === void 0 ? void 0 : matchedSup.vendorId) || null;
|
|
5003
|
+
}, [supervisorId, loggedInUser, supervisorSearchResponse]);
|
|
5004
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
|
|
5005
|
+
vendorId: targetVendorId,
|
|
5006
|
+
vendorIds: [targetVendorId]
|
|
5007
|
+
} : {}, {
|
|
5008
|
+
enabled: !!tenantId,
|
|
5009
|
+
keepPreviousData: true
|
|
5010
|
+
}),
|
|
5011
|
+
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
5012
|
+
progressData = _Digit$Hooks$ekyc$use.data;
|
|
4931
5013
|
const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorSearch(tenantId, {
|
|
4932
5014
|
status: "ACTIVE"
|
|
4933
5015
|
}, {
|
|
@@ -4950,8 +5032,8 @@ const SupervisorDetailsCard = () => {
|
|
|
4950
5032
|
let resolvedSupervisorId = supervisorId;
|
|
4951
5033
|
if (!resolvedSupervisorId && supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors && targetOwnerOrId) {
|
|
4952
5034
|
const selfSup = supervisorSearchResponse.supervisors.find(s => {
|
|
4953
|
-
var _s$
|
|
4954
|
-
return ((_s$
|
|
5035
|
+
var _s$owner2, _s$owner2$uuid, _s$id2;
|
|
5036
|
+
return ((_s$owner2 = s.owner) === null || _s$owner2 === void 0 ? void 0 : (_s$owner2$uuid = _s$owner2.uuid) === null || _s$owner2$uuid === void 0 ? void 0 : _s$owner2$uuid.toLowerCase()) === (targetOwnerOrId === null || targetOwnerOrId === void 0 ? void 0 : targetOwnerOrId.toLowerCase()) || ((_s$id2 = s.id) === null || _s$id2 === void 0 ? void 0 : _s$id2.toLowerCase()) === (targetOwnerOrId === null || targetOwnerOrId === void 0 ? void 0 : targetOwnerOrId.toLowerCase());
|
|
4955
5037
|
});
|
|
4956
5038
|
resolvedSupervisorId = selfSup === null || selfSup === void 0 ? void 0 : selfSup.id;
|
|
4957
5039
|
}
|
|
@@ -4959,15 +5041,15 @@ const SupervisorDetailsCard = () => {
|
|
|
4959
5041
|
let matchedSup = null;
|
|
4960
5042
|
if (supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors) {
|
|
4961
5043
|
matchedSup = supervisorSearchResponse.supervisors.find(s => {
|
|
4962
|
-
var _s$
|
|
4963
|
-
return ((_s$
|
|
5044
|
+
var _s$id3, _s$owner3, _s$owner3$uuid;
|
|
5045
|
+
return ((_s$id3 = s.id) === null || _s$id3 === void 0 ? void 0 : _s$id3.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase()) || ((_s$owner3 = s.owner) === null || _s$owner3 === void 0 ? void 0 : (_s$owner3$uuid = _s$owner3.uuid) === null || _s$owner3$uuid === void 0 ? void 0 : _s$owner3$uuid.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase());
|
|
4964
5046
|
});
|
|
4965
5047
|
}
|
|
4966
5048
|
let progressReport = null;
|
|
4967
5049
|
if (progressData !== null && progressData !== void 0 && progressData.supervisorReport && targetId) {
|
|
4968
5050
|
progressReport = progressData.supervisorReport.find(s => {
|
|
4969
|
-
var _s$supervisorId, _s$
|
|
4970
|
-
return ((_s$supervisorId = s.supervisorId) === null || _s$supervisorId === void 0 ? void 0 : _s$supervisorId.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase()) || ((_s$
|
|
5051
|
+
var _s$supervisorId, _s$id4;
|
|
5052
|
+
return ((_s$supervisorId = s.supervisorId) === null || _s$supervisorId === void 0 ? void 0 : _s$supervisorId.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase()) || ((_s$id4 = s.id) === null || _s$id4 === void 0 ? void 0 : _s$id4.toLowerCase()) === (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase());
|
|
4971
5053
|
});
|
|
4972
5054
|
}
|
|
4973
5055
|
if (matchedSup) {
|
|
@@ -4983,8 +5065,8 @@ const SupervisorDetailsCard = () => {
|
|
|
4983
5065
|
var _report$supervisorId, _matchedSup$id, _report$id, _matchedSup$id2, _report$surveyors;
|
|
4984
5066
|
if (((_report$supervisorId = report.supervisorId) === null || _report$supervisorId === void 0 ? void 0 : _report$supervisorId.toLowerCase()) !== ((_matchedSup$id = matchedSup.id) === null || _matchedSup$id === void 0 ? void 0 : _matchedSup$id.toLowerCase()) && ((_report$id = report.id) === null || _report$id === void 0 ? void 0 : _report$id.toLowerCase()) !== ((_matchedSup$id2 = matchedSup.id) === null || _matchedSup$id2 === void 0 ? void 0 : _matchedSup$id2.toLowerCase())) continue;
|
|
4985
5067
|
const matchedSurv = (_report$surveyors = report.surveyors) === null || _report$surveyors === void 0 ? void 0 : _report$surveyors.find(s => {
|
|
4986
|
-
var _s$surveyorId, _surv$id, _s$surveyorId2, _surv$owner, _surv$owner$uuid, _s$
|
|
4987
|
-
return s.surveyorId && (((_s$surveyorId = s.surveyorId) === null || _s$surveyorId === void 0 ? void 0 : _s$surveyorId.toLowerCase()) === ((_surv$id = surv.id) === null || _surv$id === void 0 ? void 0 : _surv$id.toLowerCase()) || ((_s$surveyorId2 = s.surveyorId) === null || _s$surveyorId2 === void 0 ? void 0 : _s$surveyorId2.toLowerCase()) === ((_surv$owner = surv.owner) === null || _surv$owner === void 0 ? void 0 : (_surv$owner$uuid = _surv$owner.uuid) === null || _surv$owner$uuid === void 0 ? void 0 : _surv$owner$uuid.toLowerCase())) || s.id && (((_s$
|
|
5068
|
+
var _s$surveyorId, _surv$id, _s$surveyorId2, _surv$owner, _surv$owner$uuid, _s$id5, _surv$id2, _s$id6, _surv$owner2, _surv$owner2$uuid;
|
|
5069
|
+
return s.surveyorId && (((_s$surveyorId = s.surveyorId) === null || _s$surveyorId === void 0 ? void 0 : _s$surveyorId.toLowerCase()) === ((_surv$id = surv.id) === null || _surv$id === void 0 ? void 0 : _surv$id.toLowerCase()) || ((_s$surveyorId2 = s.surveyorId) === null || _s$surveyorId2 === void 0 ? void 0 : _s$surveyorId2.toLowerCase()) === ((_surv$owner = surv.owner) === null || _surv$owner === void 0 ? void 0 : (_surv$owner$uuid = _surv$owner.uuid) === null || _surv$owner$uuid === void 0 ? void 0 : _surv$owner$uuid.toLowerCase())) || s.id && (((_s$id5 = s.id) === null || _s$id5 === void 0 ? void 0 : _s$id5.toLowerCase()) === ((_surv$id2 = surv.id) === null || _surv$id2 === void 0 ? void 0 : _surv$id2.toLowerCase()) || ((_s$id6 = s.id) === null || _s$id6 === void 0 ? void 0 : _s$id6.toLowerCase()) === ((_surv$owner2 = surv.owner) === null || _surv$owner2 === void 0 ? void 0 : (_surv$owner2$uuid = _surv$owner2.uuid) === null || _surv$owner2$uuid === void 0 ? void 0 : _surv$owner2$uuid.toLowerCase()));
|
|
4988
5070
|
});
|
|
4989
5071
|
if (matchedSurv) {
|
|
4990
5072
|
realStats = matchedSurv;
|
|
@@ -5029,8 +5111,8 @@ const SupervisorDetailsCard = () => {
|
|
|
5029
5111
|
const surveyorsMapped = progressReport.surveyors ? progressReport.surveyors.map(surv => {
|
|
5030
5112
|
var _surveyorSearchRespon, _matchedSurv$owner, _matchedSurv$owner2;
|
|
5031
5113
|
const matchedSurv = surveyorSearchResponse === null || surveyorSearchResponse === void 0 ? void 0 : (_surveyorSearchRespon = surveyorSearchResponse.surveyors) === null || _surveyorSearchRespon === void 0 ? void 0 : _surveyorSearchRespon.find(s => {
|
|
5032
|
-
var _s$
|
|
5033
|
-
return ((_s$
|
|
5114
|
+
var _s$id7, _surv$surveyorId, _s$owner4, _s$owner4$uuid, _surv$surveyorId2;
|
|
5115
|
+
return ((_s$id7 = s.id) === null || _s$id7 === void 0 ? void 0 : _s$id7.toLowerCase()) === ((_surv$surveyorId = surv.surveyorId) === null || _surv$surveyorId === void 0 ? void 0 : _surv$surveyorId.toLowerCase()) || ((_s$owner4 = s.owner) === null || _s$owner4 === void 0 ? void 0 : (_s$owner4$uuid = _s$owner4.uuid) === null || _s$owner4$uuid === void 0 ? void 0 : _s$owner4$uuid.toLowerCase()) === ((_surv$surveyorId2 = surv.surveyorId) === null || _surv$surveyorId2 === void 0 ? void 0 : _surv$surveyorId2.toLowerCase());
|
|
5034
5116
|
});
|
|
5035
5117
|
return {
|
|
5036
5118
|
surveyorId: surv.surveyorId || surv.id,
|