@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.modern.js
CHANGED
|
@@ -1686,12 +1686,6 @@ const VendorDetailsCard = () => {
|
|
|
1686
1686
|
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
1687
1687
|
const _useParams = useParams(),
|
|
1688
1688
|
vendorId = _useParams.vendorId;
|
|
1689
|
-
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
1690
|
-
enabled: !!tenantId,
|
|
1691
|
-
keepPreviousData: true
|
|
1692
|
-
}),
|
|
1693
|
-
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
1694
|
-
progressData = _Digit$Hooks$ekyc$use.data;
|
|
1695
1689
|
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
1696
1690
|
status: "ACTIVE"
|
|
1697
1691
|
}, {
|
|
@@ -1741,6 +1735,16 @@ const VendorDetailsCard = () => {
|
|
|
1741
1735
|
return matchedMock || ekycMockData.vendors[0];
|
|
1742
1736
|
}
|
|
1743
1737
|
}, [vendorSearchResponse, vendorId, loggedInUser]);
|
|
1738
|
+
const targetVendorId = vendorId || (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId);
|
|
1739
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
|
|
1740
|
+
vendorId: targetVendorId,
|
|
1741
|
+
vendorIds: [targetVendorId]
|
|
1742
|
+
} : {}, {
|
|
1743
|
+
enabled: !!tenantId,
|
|
1744
|
+
keepPreviousData: true
|
|
1745
|
+
}),
|
|
1746
|
+
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
1747
|
+
progressData = _Digit$Hooks$ekyc$use.data;
|
|
1744
1748
|
const vendorSupervisors = useMemo(() => {
|
|
1745
1749
|
if (!(supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors)) {
|
|
1746
1750
|
if (vendor && Array.isArray(ekycMockData.vendors)) {
|
|
@@ -2853,7 +2857,63 @@ const Inbox = _ref2 => {
|
|
|
2853
2857
|
isListLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
2854
2858
|
_Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
|
|
2855
2859
|
listData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2;
|
|
2856
|
-
const _Digit$Hooks$
|
|
2860
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
2861
|
+
status: "ACTIVE"
|
|
2862
|
+
}, {
|
|
2863
|
+
enabled: !!tenantId,
|
|
2864
|
+
staleTime: 300000
|
|
2865
|
+
}),
|
|
2866
|
+
vendorSearchResponse = _Digit$Hooks$fsm$useD.data;
|
|
2867
|
+
const _useMemo = useMemo(() => {
|
|
2868
|
+
var _Digit$SessionStorage;
|
|
2869
|
+
if (!vendorSearchResponse || vendorSearchResponse.length === 0) {
|
|
2870
|
+
return {
|
|
2871
|
+
targetVendorId: null,
|
|
2872
|
+
allVendorIds: []
|
|
2873
|
+
};
|
|
2874
|
+
}
|
|
2875
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
2876
|
+
const userUuid = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
|
|
2877
|
+
const userMobile = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber;
|
|
2878
|
+
const matchesUser = v => {
|
|
2879
|
+
var _v$owner, _v$owner2, _v$owner3;
|
|
2880
|
+
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);
|
|
2881
|
+
const ownerMobile = ((_v$owner3 = v.owner) === null || _v$owner3 === void 0 ? void 0 : _v$owner3.mobileNumber) || v.mobileNumber;
|
|
2882
|
+
return userUuid && ownerUuid === userUuid || userMobile && ownerMobile === userMobile;
|
|
2883
|
+
};
|
|
2884
|
+
const allIds = vendorSearchResponse.map(v => {
|
|
2885
|
+
const dso = v.dsoDetails || v;
|
|
2886
|
+
return dso.id || dso.vendorId || v.id || v.vendorId;
|
|
2887
|
+
}).filter(Boolean);
|
|
2888
|
+
const matched = vendorSearchResponse.find(v => matchesUser(v.dsoDetails || v));
|
|
2889
|
+
let matchedId = null;
|
|
2890
|
+
if (matched) {
|
|
2891
|
+
const dso = matched.dsoDetails || matched;
|
|
2892
|
+
matchedId = dso.id || dso.vendorId || matched.id || matched.vendorId;
|
|
2893
|
+
}
|
|
2894
|
+
return {
|
|
2895
|
+
targetVendorId: matchedId,
|
|
2896
|
+
allVendorIds: allIds
|
|
2897
|
+
};
|
|
2898
|
+
}, [vendorSearchResponse]),
|
|
2899
|
+
targetVendorId = _useMemo.targetVendorId,
|
|
2900
|
+
allVendorIds = _useMemo.allVendorIds;
|
|
2901
|
+
const progressParams = useMemo(() => {
|
|
2902
|
+
if (targetVendorId) {
|
|
2903
|
+
return {
|
|
2904
|
+
vendorId: targetVendorId,
|
|
2905
|
+
vendorIds: [targetVendorId]
|
|
2906
|
+
};
|
|
2907
|
+
}
|
|
2908
|
+
if (allVendorIds && allVendorIds.length > 0) {
|
|
2909
|
+
return {
|
|
2910
|
+
vendorId: allVendorIds[0],
|
|
2911
|
+
vendorIds: allVendorIds
|
|
2912
|
+
};
|
|
2913
|
+
}
|
|
2914
|
+
return {};
|
|
2915
|
+
}, [targetVendorId, allVendorIds]);
|
|
2916
|
+
const _Digit$Hooks$ekyc$use3 = Digit.Hooks.ekyc.useEkycAssignmentProgress(progressParams, {
|
|
2857
2917
|
enabled: !!tenantId,
|
|
2858
2918
|
keepPreviousData: true
|
|
2859
2919
|
}),
|
|
@@ -2916,8 +2976,8 @@ const Inbox = _ref2 => {
|
|
|
2916
2976
|
const _useTranslation = useTranslation(),
|
|
2917
2977
|
t = _useTranslation.t;
|
|
2918
2978
|
const supervisor = useMemo(() => {
|
|
2919
|
-
var _Digit$
|
|
2920
|
-
const loggedInUser = (_Digit$
|
|
2979
|
+
var _Digit$SessionStorage2, _loggedInUser$roles;
|
|
2980
|
+
const loggedInUser = (_Digit$SessionStorage2 = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.info;
|
|
2921
2981
|
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)) || [];
|
|
2922
2982
|
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
2923
2983
|
const targetId = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
|
|
@@ -4798,8 +4858,18 @@ const AdminDashboard = () => {
|
|
|
4798
4858
|
}),
|
|
4799
4859
|
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
4800
4860
|
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
4801
|
-
const
|
|
4802
|
-
|
|
4861
|
+
const allVendorIds = useMemo(() => {
|
|
4862
|
+
if (!vendorSearchResponse) return [];
|
|
4863
|
+
return vendorSearchResponse.map(v => {
|
|
4864
|
+
const dso = v.dsoDetails || v;
|
|
4865
|
+
return dso.id || dso.vendorId || v.id || v.vendorId;
|
|
4866
|
+
}).filter(Boolean);
|
|
4867
|
+
}, [vendorSearchResponse]);
|
|
4868
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(allVendorIds.length > 0 ? {
|
|
4869
|
+
vendorId: allVendorIds[0],
|
|
4870
|
+
vendorIds: allVendorIds
|
|
4871
|
+
} : {}, {
|
|
4872
|
+
enabled: !!tenantId && allVendorIds.length > 0,
|
|
4803
4873
|
keepPreviousData: true
|
|
4804
4874
|
}),
|
|
4805
4875
|
progressData = _Digit$Hooks$ekyc$use.data,
|
|
@@ -4911,12 +4981,6 @@ const SupervisorDetailsCard = () => {
|
|
|
4911
4981
|
const _useState = useState(false),
|
|
4912
4982
|
ekycDownloadLoading = _useState[0],
|
|
4913
4983
|
setEkycDownloadLoading = _useState[1];
|
|
4914
|
-
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
4915
|
-
enabled: !!tenantId,
|
|
4916
|
-
keepPreviousData: true
|
|
4917
|
-
}),
|
|
4918
|
-
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
4919
|
-
progressData = _Digit$Hooks$ekyc$use.data;
|
|
4920
4984
|
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
|
|
4921
4985
|
status: "ACTIVE"
|
|
4922
4986
|
}, {
|
|
@@ -4925,6 +4989,24 @@ const SupervisorDetailsCard = () => {
|
|
|
4925
4989
|
}),
|
|
4926
4990
|
supervisorSearchResponse = _Digit$Hooks$fsm$useS.data,
|
|
4927
4991
|
isSupervisorSearchLoading = _Digit$Hooks$fsm$useS.isLoading;
|
|
4992
|
+
const targetVendorId = useMemo(() => {
|
|
4993
|
+
const targetId = supervisorId || (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid);
|
|
4994
|
+
if (!targetId || !(supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors)) return null;
|
|
4995
|
+
const matchedSup = supervisorSearchResponse.supervisors.find(s => {
|
|
4996
|
+
var _s$id, _s$owner, _s$owner$uuid;
|
|
4997
|
+
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());
|
|
4998
|
+
});
|
|
4999
|
+
return (matchedSup === null || matchedSup === void 0 ? void 0 : matchedSup.vendorId) || null;
|
|
5000
|
+
}, [supervisorId, loggedInUser, supervisorSearchResponse]);
|
|
5001
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
|
|
5002
|
+
vendorId: targetVendorId,
|
|
5003
|
+
vendorIds: [targetVendorId]
|
|
5004
|
+
} : {}, {
|
|
5005
|
+
enabled: !!tenantId,
|
|
5006
|
+
keepPreviousData: true
|
|
5007
|
+
}),
|
|
5008
|
+
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
|
|
5009
|
+
progressData = _Digit$Hooks$ekyc$use.data;
|
|
4928
5010
|
const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorSearch(tenantId, {
|
|
4929
5011
|
status: "ACTIVE"
|
|
4930
5012
|
}, {
|
|
@@ -4947,8 +5029,8 @@ const SupervisorDetailsCard = () => {
|
|
|
4947
5029
|
let resolvedSupervisorId = supervisorId;
|
|
4948
5030
|
if (!resolvedSupervisorId && supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors && targetOwnerOrId) {
|
|
4949
5031
|
const selfSup = supervisorSearchResponse.supervisors.find(s => {
|
|
4950
|
-
var _s$
|
|
4951
|
-
return ((_s$
|
|
5032
|
+
var _s$owner2, _s$owner2$uuid, _s$id2;
|
|
5033
|
+
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());
|
|
4952
5034
|
});
|
|
4953
5035
|
resolvedSupervisorId = selfSup === null || selfSup === void 0 ? void 0 : selfSup.id;
|
|
4954
5036
|
}
|
|
@@ -4956,15 +5038,15 @@ const SupervisorDetailsCard = () => {
|
|
|
4956
5038
|
let matchedSup = null;
|
|
4957
5039
|
if (supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors) {
|
|
4958
5040
|
matchedSup = supervisorSearchResponse.supervisors.find(s => {
|
|
4959
|
-
var _s$
|
|
4960
|
-
return ((_s$
|
|
5041
|
+
var _s$id3, _s$owner3, _s$owner3$uuid;
|
|
5042
|
+
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());
|
|
4961
5043
|
});
|
|
4962
5044
|
}
|
|
4963
5045
|
let progressReport = null;
|
|
4964
5046
|
if (progressData !== null && progressData !== void 0 && progressData.supervisorReport && targetId) {
|
|
4965
5047
|
progressReport = progressData.supervisorReport.find(s => {
|
|
4966
|
-
var _s$supervisorId, _s$
|
|
4967
|
-
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$
|
|
5048
|
+
var _s$supervisorId, _s$id4;
|
|
5049
|
+
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());
|
|
4968
5050
|
});
|
|
4969
5051
|
}
|
|
4970
5052
|
if (matchedSup) {
|
|
@@ -4980,8 +5062,8 @@ const SupervisorDetailsCard = () => {
|
|
|
4980
5062
|
var _report$supervisorId, _matchedSup$id, _report$id, _matchedSup$id2, _report$surveyors;
|
|
4981
5063
|
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;
|
|
4982
5064
|
const matchedSurv = (_report$surveyors = report.surveyors) === null || _report$surveyors === void 0 ? void 0 : _report$surveyors.find(s => {
|
|
4983
|
-
var _s$surveyorId, _surv$id, _s$surveyorId2, _surv$owner, _surv$owner$uuid, _s$
|
|
4984
|
-
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$
|
|
5065
|
+
var _s$surveyorId, _surv$id, _s$surveyorId2, _surv$owner, _surv$owner$uuid, _s$id5, _surv$id2, _s$id6, _surv$owner2, _surv$owner2$uuid;
|
|
5066
|
+
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()));
|
|
4985
5067
|
});
|
|
4986
5068
|
if (matchedSurv) {
|
|
4987
5069
|
realStats = matchedSurv;
|
|
@@ -5026,8 +5108,8 @@ const SupervisorDetailsCard = () => {
|
|
|
5026
5108
|
const surveyorsMapped = progressReport.surveyors ? progressReport.surveyors.map(surv => {
|
|
5027
5109
|
var _surveyorSearchRespon, _matchedSurv$owner, _matchedSurv$owner2;
|
|
5028
5110
|
const matchedSurv = surveyorSearchResponse === null || surveyorSearchResponse === void 0 ? void 0 : (_surveyorSearchRespon = surveyorSearchResponse.surveyors) === null || _surveyorSearchRespon === void 0 ? void 0 : _surveyorSearchRespon.find(s => {
|
|
5029
|
-
var _s$
|
|
5030
|
-
return ((_s$
|
|
5111
|
+
var _s$id7, _surv$surveyorId, _s$owner4, _s$owner4$uuid, _surv$surveyorId2;
|
|
5112
|
+
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());
|
|
5031
5113
|
});
|
|
5032
5114
|
return {
|
|
5033
5115
|
surveyorId: surv.surveyorId || surv.id,
|