@djb25/digit-ui-module-ekyc 1.0.35 → 1.0.36
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 +78 -43
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +79 -44
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4933,42 +4933,41 @@ const AssignEkycModal = _ref => {
|
|
|
4933
4933
|
}),
|
|
4934
4934
|
applicationData = _Digit$Hooks$ekyc$use.data,
|
|
4935
4935
|
isLoading = _Digit$Hooks$ekyc$use.isFetching;
|
|
4936
|
+
const handleAssignmentError = (errMsg, variables) => {
|
|
4937
|
+
const isAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("active assignment") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key") || errMsg.toLowerCase().includes("kno") || errMsg.toLowerCase().includes("already exists");
|
|
4938
|
+
if (isAlreadyAssigned) {
|
|
4939
|
+
const isMrKeyType = (variables === null || variables === void 0 ? void 0 : variables.assignmentType) === "MRKEY";
|
|
4940
|
+
if (isMrKeyType) {
|
|
4941
|
+
setToastData({
|
|
4942
|
+
error: true,
|
|
4943
|
+
label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
|
|
4944
|
+
});
|
|
4945
|
+
} else {
|
|
4946
|
+
setToastData({
|
|
4947
|
+
error: true,
|
|
4948
|
+
label: t("EKYC_KNO_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "kno is already assign with another surveyor"
|
|
4949
|
+
});
|
|
4950
|
+
}
|
|
4951
|
+
} else {
|
|
4952
|
+
setToastData({
|
|
4953
|
+
error: true,
|
|
4954
|
+
label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
|
|
4955
|
+
});
|
|
4956
|
+
}
|
|
4957
|
+
setShowToast(true);
|
|
4958
|
+
};
|
|
4936
4959
|
const assignmentMutation = Digit.Hooks.ekyc.useEkycAssignmentCreate({
|
|
4937
|
-
onSuccess: response => {
|
|
4960
|
+
onSuccess: (response, variables) => {
|
|
4938
4961
|
if (response !== null && response !== void 0 && response.error) {
|
|
4939
4962
|
var _response$data;
|
|
4940
4963
|
const errMsg = (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.message) || "";
|
|
4941
|
-
|
|
4942
|
-
if (isMrKeyAlreadyAssigned) {
|
|
4943
|
-
setToastData({
|
|
4944
|
-
error: true,
|
|
4945
|
-
label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
|
|
4946
|
-
});
|
|
4947
|
-
} else {
|
|
4948
|
-
setToastData({
|
|
4949
|
-
error: true,
|
|
4950
|
-
label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
|
|
4951
|
-
});
|
|
4952
|
-
}
|
|
4953
|
-
setShowToast(true);
|
|
4964
|
+
handleAssignmentError(errMsg, variables);
|
|
4954
4965
|
return;
|
|
4955
4966
|
}
|
|
4956
4967
|
if (response !== null && response !== void 0 && response.skipped && response.skipped.length > 0) {
|
|
4957
4968
|
var _response$skipped$;
|
|
4958
4969
|
const reason = ((_response$skipped$ = response.skipped[0]) === null || _response$skipped$ === void 0 ? void 0 : _response$skipped$.reason) || "";
|
|
4959
|
-
|
|
4960
|
-
if (isMrKeyAlreadyAssigned) {
|
|
4961
|
-
setToastData({
|
|
4962
|
-
error: true,
|
|
4963
|
-
label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
|
|
4964
|
-
});
|
|
4965
|
-
} else {
|
|
4966
|
-
setToastData({
|
|
4967
|
-
error: true,
|
|
4968
|
-
label: t(reason) || reason || t("EKYC_ASSIGNMENT_SKIPPED") || "Assignment skipped"
|
|
4969
|
-
});
|
|
4970
|
-
}
|
|
4971
|
-
setShowToast(true);
|
|
4970
|
+
handleAssignmentError(reason, variables);
|
|
4972
4971
|
return;
|
|
4973
4972
|
}
|
|
4974
4973
|
setToastData({
|
|
@@ -4986,22 +4985,10 @@ const AssignEkycModal = _ref => {
|
|
|
4986
4985
|
}
|
|
4987
4986
|
}, 1000);
|
|
4988
4987
|
},
|
|
4989
|
-
onError: error => {
|
|
4988
|
+
onError: (error, variables) => {
|
|
4990
4989
|
var _error$data, _error$response, _error$response$data;
|
|
4991
4990
|
const errMsg = (error === null || error === void 0 ? void 0 : (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.message) || (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message) || "";
|
|
4992
|
-
|
|
4993
|
-
if (isMrKeyAlreadyAssigned) {
|
|
4994
|
-
setToastData({
|
|
4995
|
-
error: true,
|
|
4996
|
-
label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
|
|
4997
|
-
});
|
|
4998
|
-
} else {
|
|
4999
|
-
setToastData({
|
|
5000
|
-
error: true,
|
|
5001
|
-
label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
|
|
5002
|
-
});
|
|
5003
|
-
}
|
|
5004
|
-
setShowToast(true);
|
|
4991
|
+
handleAssignmentError(errMsg, variables);
|
|
5005
4992
|
}
|
|
5006
4993
|
});
|
|
5007
4994
|
const tableData = (applicationData === null || applicationData === void 0 ? void 0 : applicationData.consumerList) || [];
|
|
@@ -7486,14 +7473,35 @@ const Home = () => {
|
|
|
7486
7473
|
link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
|
|
7487
7474
|
});
|
|
7488
7475
|
}
|
|
7476
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
7477
|
+
propsForModuleCard.links.push({
|
|
7478
|
+
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
7479
|
+
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
7480
|
+
});
|
|
7481
|
+
}
|
|
7489
7482
|
if (roles.length === 1 && roles.includes("CITIZEN")) {
|
|
7490
7483
|
propsForModuleCard.links.push({
|
|
7484
|
+
label: t("EKYC_CREATE_KYC"),
|
|
7485
|
+
link: "/digit-ui/citizen/ekyc/create-kyc"
|
|
7486
|
+
}, {
|
|
7487
|
+
label: t("EKYC_UPDATE_KYC"),
|
|
7488
|
+
link: "/digit-ui/citizen/ekyc/update-kyc"
|
|
7489
|
+
}, {
|
|
7491
7490
|
label: t("EKYC_STATUS"),
|
|
7492
7491
|
link: "/digit-ui/citizen/ekyc/:id"
|
|
7493
7492
|
});
|
|
7494
7493
|
}
|
|
7495
|
-
|
|
7496
|
-
|
|
7494
|
+
const formattedLinks = propsForModuleCard.links.map(l => ({
|
|
7495
|
+
i18nKey: l.label,
|
|
7496
|
+
link: l.link,
|
|
7497
|
+
count: l.count
|
|
7498
|
+
}));
|
|
7499
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
|
|
7500
|
+
header: t("EKYC_MODULE_NAME"),
|
|
7501
|
+
links: formattedLinks,
|
|
7502
|
+
Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
|
|
7503
|
+
className: "fill-path-primary-main"
|
|
7504
|
+
})
|
|
7497
7505
|
});
|
|
7498
7506
|
};
|
|
7499
7507
|
|
|
@@ -8603,6 +8611,10 @@ const CitizenApp = () => {
|
|
|
8603
8611
|
const location = reactRouterDom.useLocation();
|
|
8604
8612
|
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
8605
8613
|
path = _useRouteMatch.path;
|
|
8614
|
+
const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
|
|
8615
|
+
_Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
|
|
8616
|
+
_Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
|
|
8617
|
+
stateInfo = _Digit$Hooks$useStore3.stateInfo;
|
|
8606
8618
|
sessionStorage.removeItem("revalidateddone");
|
|
8607
8619
|
const getDynamicBreadcrumbs = () => {
|
|
8608
8620
|
const pathname = location.pathname;
|
|
@@ -8677,6 +8689,29 @@ const CitizenApp = () => {
|
|
|
8677
8689
|
}
|
|
8678
8690
|
return crumbs;
|
|
8679
8691
|
};
|
|
8692
|
+
const isEkycHome = location.pathname === "/digit-ui/citizen/ekyc" || location.pathname === "/digit-ui/citizen/ekyc/";
|
|
8693
|
+
if (isEkycHome) {
|
|
8694
|
+
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
8695
|
+
return (
|
|
8696
|
+
/*#__PURE__*/
|
|
8697
|
+
React__default.createElement("div", {
|
|
8698
|
+
className: "moduleLinkHomePage"
|
|
8699
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8700
|
+
style: {
|
|
8701
|
+
position: "relative"
|
|
8702
|
+
}
|
|
8703
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
8704
|
+
src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
|
|
8705
|
+
alt: "noimagefound"
|
|
8706
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, {
|
|
8707
|
+
className: "moduleLinkHomePageBackButton"
|
|
8708
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
8709
|
+
className: "moduleTitle"
|
|
8710
|
+
}, isMobile ? /*#__PURE__*/React__default.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React__default.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React__default.createElement("div", {
|
|
8711
|
+
className: "moduleLinkHomePageModuleLinks"
|
|
8712
|
+
}, /*#__PURE__*/React__default.createElement(Home, null)))
|
|
8713
|
+
);
|
|
8714
|
+
}
|
|
8680
8715
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
8681
8716
|
className: "ground-container form-container"
|
|
8682
8717
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleHeader, {
|