@djb25/digit-ui-module-vendor 1.0.24 → 1.0.25
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +16 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -454,16 +454,19 @@ const VENDORCard = () => {
|
|
|
454
454
|
const {
|
|
455
455
|
t
|
|
456
456
|
} = useTranslation();
|
|
457
|
+
const history = useHistory();
|
|
457
458
|
const [total, setTotal] = useState("-");
|
|
458
|
-
|
|
459
|
+
const isCitizen = window.location.pathname.toLowerCase().includes("citizen");
|
|
460
|
+
const hasAccess = Digit.Utils.vendorAccess() || Digit.UserService.hasAccess(["WT_VENDOR", "MT_VENDOR"]);
|
|
461
|
+
if (!hasAccess) {
|
|
459
462
|
return null;
|
|
460
463
|
}
|
|
461
464
|
const links = [{
|
|
462
465
|
label: t("VENDOR_NEW_REGISTERATION"),
|
|
463
|
-
link: `/digit-ui/employee/vendor/registry/new-vendor`
|
|
466
|
+
link: isCitizen ? `/digit-ui/citizen/vendor/registry/new-vendor` : `/digit-ui/employee/vendor/registry/new-vendor`
|
|
464
467
|
}, {
|
|
465
468
|
label: t("SEARCH_VENDOR"),
|
|
466
|
-
link: `/digit-ui/employee/vendor/search-vendor`
|
|
469
|
+
link: isCitizen ? `/digit-ui/citizen/vendor/search-vendor` : `/digit-ui/employee/vendor/search-vendor`
|
|
467
470
|
}];
|
|
468
471
|
const VENDORRole = Digit.UserService.hasAccess(["WT_VENDOR"]);
|
|
469
472
|
const propsForModuleCard = {
|
|
@@ -472,10 +475,18 @@ const VENDORCard = () => {
|
|
|
472
475
|
kpis: [{
|
|
473
476
|
count: total === null || total === void 0 ? void 0 : total.totalCount,
|
|
474
477
|
label: t("Inbox"),
|
|
475
|
-
link: `/digit-ui/employee/
|
|
478
|
+
link: isCitizen ? `/digit-ui/citizen/vendor/search-vendor` : `/digit-ui/employee/vendor/search-vendor`
|
|
476
479
|
}],
|
|
477
|
-
links: links.filter(link => !(link !== null && link !== void 0 && link.role) || VENDORRole)
|
|
480
|
+
links: links.filter(link => !(link !== null && link !== void 0 && link.role) || VENDORRole),
|
|
481
|
+
...(isCitizen ? {
|
|
482
|
+
onDetailsClick: () => history.push("/digit-ui/citizen/vendor/search-vendor")
|
|
483
|
+
} : {})
|
|
478
484
|
};
|
|
485
|
+
if (isCitizen) {
|
|
486
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
487
|
+
className: "wt-citizen-card-premium"
|
|
488
|
+
}, /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard));
|
|
489
|
+
}
|
|
479
490
|
return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
|
|
480
491
|
};
|
|
481
492
|
|