Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment: Attendance Approval Flow #2097

Open
wants to merge 115 commits into
base: console
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 102 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
0c5c504
removed hcm from store
Dec 19, 2024
38373ae
added view attendance screen
Dec 19, 2024
a616ef8
added alert pop up, table for view and edit attendance
Dec 19, 2024
e26bb39
updated module.js file
Dec 19, 2024
7fbbf53
added success screen and updated breadcrumbs
Dec 19, 2024
d12482d
fixing table component
Dec 20, 2024
8c988e3
Merge branch 'console' into payment_view_attendance
Dec 20, 2024
817ad5e
HCMPRE-1717:: Load and store project details on Payments module initi…
Ramkrishna-egov Dec 20, 2024
51b2ae1
added input component in table for editing attendance
Dec 20, 2024
3d92fce
Merge branch 'payment_view_attendance' of https://github.com/egovernm…
Dec 20, 2024
7460527
HCM-1646::Payment inbox attendance (#2067)
pitabash-eGov Dec 20, 2024
6860809
updated table with static data and fields with attendance data
Dec 20, 2024
bc08be1
updated breadcrumbs
Dec 20, 2024
a5dcdcd
fixed edit attendance calls
Dec 24, 2024
bd357c7
updated css
Dec 24, 2024
4753623
fixed nevigation issue
Dec 24, 2024
87ebbfe
Merge branch 'console' into payment_view_attendance
Dec 24, 2024
c49fce8
updated css version
Dec 24, 2024
fa96bc1
Payment inbox attendance (#2072)
pitabash-eGov Dec 24, 2024
ccc8c62
updated api calls for create and update flow and added disabled actio…
Dec 24, 2024
b3183df
Merge branch 'payment_view_attendance' of https://github.com/egovernm…
Dec 24, 2024
ceef537
fixed back button in view screen
Dec 24, 2024
322030a
Payment inbox attendance (#2073)
pitabash-eGov Dec 24, 2024
1a77329
added workflow in api calls
Dec 24, 2024
4184080
removed comments
Dec 24, 2024
ed322b8
updated api base point
Dec 26, 2024
275854d
Payment inbox attendance (#2074)
pitabash-eGov Dec 26, 2024
68dfb09
Payment inbox attendance (#2075)
pitabash-eGov Dec 26, 2024
6ca1ccc
Payment inbox attendance (#2076)
pitabash-eGov Dec 26, 2024
7fc944a
inbox css fix
Dec 26, 2024
28a99d2
added module for boundary localization
Dec 26, 2024
391a0d0
added session storage for individual
Dec 26, 2024
c6c8855
added individual in session storage
Dec 26, 2024
0144d47
fixed project search issue
Dec 26, 2024
302df9a
Payment inbox attendance (#2080)
pitabash-eGov Dec 26, 2024
42818c0
Payment inbox attendance (#2082)
pitabash-eGov Dec 26, 2024
86b87ed
Updated hierarchy type for Payments Testing
Ramkrishna-egov Dec 26, 2024
459e7be
integrated with apis
Dec 27, 2024
bd5af59
added create api
Dec 27, 2024
ad0cb84
added validation for APPROVAL
Dec 27, 2024
9a87660
fixed extra call issue
Dec 27, 2024
0be1940
fixed issue
Dec 27, 2024
f92ec48
Payment inbox attendance (#2084)
pitabash-eGov Dec 27, 2024
4ebea8c
added loading for mutation
Dec 27, 2024
3329e13
translator funtion added
pitabash-eGov Dec 27, 2024
6077b9c
started with static screens for bills
Dec 31, 2024
3d26e04
Payment inbox attendance (#2090)
pitabash-eGov Dec 31, 2024
a8e1144
updated default pagination
Dec 31, 2024
ccaf400
fixed small css issues
Dec 31, 2024
1c26a4e
Payment inbox attendance (#2094)
pitabash-eGov Jan 3, 2025
ade4d3d
updated view attendance screen
Jan 3, 2025
7cb9d3d
Merge branch 'payment_view_attendance' of https://github.com/egovernm…
Jan 3, 2025
4a12d65
removed other links
Jan 3, 2025
db267f0
Payment inbox attendance (#2095)
pitabash-eGov Jan 3, 2025
821bcb6
removed logs
Jan 3, 2025
c858a3f
Merge branch 'console' into payment_view_attendance
rachana-egov Jan 3, 2025
f24b600
code comment added and status put in the constant file
pitabash-eGov Jan 3, 2025
92b31c3
Updated Payments Module Initialization to a single hook
Ramkrishna-egov Jan 4, 2025
ca816f0
added bill search api
Jan 4, 2025
7567c72
Merge branch 'payment_view_attendance' of https://github.com/egovernm…
Jan 4, 2025
b4009a9
updated search bill params
Jan 4, 2025
0c78039
Payment inbox attendance (#2099)
pitabash-eGov Jan 4, 2025
2cc84cb
added condition to boundary filter
Jan 4, 2025
2b30b94
updated bill inbox
Jan 4, 2025
2ea6c8b
fixed my bills screen
Jan 4, 2025
696aec9
Payment inbox attendance (#2100)
pitabash-eGov Jan 4, 2025
3b4bde7
Updated paymentStatus to review Status
Ramkrishna-egov Jan 5, 2025
576c2cd
Localization fixes
Ramkrishna-egov Jan 5, 2025
e18e422
Localization fixes
Ramkrishna-egov Jan 5, 2025
bba873a
Localization fixes
Ramkrishna-egov Jan 5, 2025
9156ae0
Localization fixes
Ramkrishna-egov Jan 5, 2025
416f422
fixed bill screen
Jan 6, 2025
314ff43
Payment inbox attendance (#2103)
pitabash-eGov Jan 6, 2025
36801c5
fixed table css
Jan 6, 2025
c4b498c
Merge branch 'payment_view_attendance' of https://github.com/egovernm…
Jan 6, 2025
66b907e
fixed api not being called again issue
Jan 6, 2025
67b30b2
added pdf and excel download options
Jan 6, 2025
8bf196c
HCMPRE-1816, HCMPRE-1774::Demo Feedbacks and Bug fixes (#2107)
pitabash-eGov Jan 6, 2025
db0e070
updated billinbox
Jan 6, 2025
54279bf
updating session storage for billl inbox
Jan 7, 2025
0779649
added session storage for bill screens
Jan 7, 2025
0c80699
fixed bill inbox screen issues
Jan 7, 2025
ce025e3
fixed my bills session issue
Jan 7, 2025
a8c3413
updated breadcrumbs
Jan 7, 2025
efe93e9
fixed date range picker component
Jan 7, 2025
8e4c472
added loader on edit screens
Jan 7, 2025
0ae9a2a
Ticket: HCMPRE-1822 (#2112)
pitabash-eGov Jan 7, 2025
5afe320
updated table data refresh
Jan 7, 2025
5c1ae6c
Merge branch 'payment_view_attendance' of https://github.com/egovernm…
Jan 7, 2025
375792b
fixed filter issue
Jan 7, 2025
5668822
fixed validation issue
Jan 7, 2025
54fe437
fixed breadcrumbs issue
Jan 7, 2025
47a8732
fixed demo issues
Jan 7, 2025
4fbb011
ticketNo: HCMPRE-1822,bug fixes and edge cases fixed
pitabash-eGov Jan 7, 2025
40700e6
fixed date going nulls
Jan 7, 2025
74c3e13
updated attendance duration to ceil value of dates
Jan 7, 2025
a65ff03
added session storage for selected boundary
Jan 8, 2025
2d20a68
fixed boundary filter issue
Jan 8, 2025
a2a7910
fixed locality code not going in bill search
Jan 8, 2025
d17ade5
updated render to one time only
Jan 8, 2025
7a9cccd
bill search updated
Jan 8, 2025
12b115b
fixed bill page issue
Jan 8, 2025
a619132
TICKET: HCMPRE-1822 (#2118)
pitabash-eGov Jan 8, 2025
ba199a4
session storage fix
Jan 8, 2025
45b6177
fixed boundary filter issue
Jan 8, 2025
a4b50c7
fixed pagination issue
Jan 8, 2025
30ffe96
fixed name for approver and staff
Jan 8, 2025
b095cba
fixed view attendance screen
Jan 8, 2025
1d9f532
added toast for bill generation
Jan 9, 2025
bdbf2dc
fixed owner name
Jan 9, 2025
71114b0
fixed isRequired label
Jan 9, 2025
bb0cd71
updated my bills table
Jan 9, 2025
88b56f0
reworking on the table component in view attendance screen (#2121)
pitabash-eGov Jan 9, 2025
677fae4
demo fixes
Jan 9, 2025
dcb20d9
fixed issue
Jan 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ module.exports = function (app) {
"/plan-service",
"/health-project",
"/service-request",
"/census-service"
"/census-service",
"/health-attendance/v1/_search",
"/health-individual/v1/_search",
"/health-muster-roll",
"/health-expense/bill/v1/_search",
"/health-expense-calculator/v1/_calculate",
"/filestore/v1/files/id"
].forEach((location) => app.use(location, createProxy));
["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy));
["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0"
"react-router-dom": "5.3.0",
"react-data-table-component": "7.6.2"

},
"author": "Ramkrishna <[email protected]>",
"license": "MIT"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import { Loader } from "@egovernments/digit-ui-react-components";
import React,{useState} from "react";
import React, { useState } from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Remove unused import
useState is not used anywhere in this component. Consider removing it to keep your imports concise.

import { useRouteMatch } from "react-router-dom";
import { default as EmployeeApp } from "./pages/employee";
import PaymentsCard from "./components/PaymentsCard";
import { overrideHooks, updateCustomConfigs } from "./utils";
import { ProviderContext } from "./utils/context";
import BoundaryComponent from "./components/sample";
import CampaignNameSelection from "./components/campaign_dropdown";
import CustomInboxSearchComposer from "./components/custom_inbox_composer";
import CustomInboxSearchLinks from "./components/custom_comp/link_section";
import CustomSearchComponent from "./components/custom_comp/search_section";
import CustomFilter from "./components/custom_comp/filter_section";
import CustomInboxTable from "./components/custom_comp/table_inbox";

export const PaymentsModule = ({ stateCode, userType, tenants }) => {
const { path, url } = useRouteMatch();
const tenantId = Digit.ULBService.getCurrentTenantId();

const moduleCode = ["payments"];
const hierarchyType = "MICROPLAN";

// const hierarchyType = window?.globalConfigs?.getConfig("HIERARCHY_TYPE") || "ADMIN";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Remove stale commented-out code
If not needed, consider removing the line for clarity and ease of maintenance.

const moduleCode = ["payments", `boundary-${hierarchyType}`];
Comment on lines +20 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Avoid hardcoding hierarchyType

Hardcoding hierarchyType to "MICROPLAN" may reduce flexibility. Consider retrieving it from configuration or global settings to allow dynamic adjustments in different environments.

const modulePrefix = "hcm";
const language = Digit.StoreData.getCurrentLanguage();
const { isLoading, data: store } = Digit.Services.useStore({
Expand All @@ -19,18 +29,49 @@ export const PaymentsModule = ({ stateCode, userType, tenants }) => {
language,
modulePrefix,
});
let user = Digit?.SessionStorage.get("User");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Use const instead of let
user is never reassigned. This improves immutability and readability.

- let user = Digit?.SessionStorage.get("User");
+ const user = Digit?.SessionStorage.get("User");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let user = Digit?.SessionStorage.get("User");
const user = Digit?.SessionStorage.get("User");
🧰 Tools
🪛 Biome (1.9.4)

[error] 32-32: This let declares a variable that is only assigned once.

'user' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

const { isLoading: isPaymentsModuleInitializing } = Digit.Hooks.payments.usePaymentsInitialization({
tenantId: tenantId,
});


return (
<ProviderContext>
<EmployeeApp path={path} stateCode={stateCode} userType={userType} tenants={tenants}/>
</ProviderContext>
const { isLoading: isMDMSLoading, data: mdmsData } = Digit.Hooks.useCustomMDMS(
Digit.ULBService.getCurrentTenantId(),
"HCM",
[{ name: "BOUNDARYTYPES" }, { name: "paymentsConfig" }],
{
cacheTime: Infinity,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Use Number.POSITIVE_INFINITY instead of Infinity

For consistency and clarity, replace Infinity with Number.POSITIVE_INFINITY. This practice aligns with modern JavaScript standards.

🧰 Tools
🪛 Biome (1.9.4)

[error] 42-42: Use Number.POSITIVE_INFINITY instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.POSITIVE_INFINITY instead.

(lint/style/useNumberNamespace)

},
{ schemaCode: "PAYMENTS_MASTER_DATA" } //mdmsv2
);

const sortedBoundaryData = mdmsData?.MdmsRes?.HCM?.BOUNDARYTYPES?.sort((a, b) => a.order - b.order);
const paymentsConfig = mdmsData?.MdmsRes?.HCM?.paymentsConfig?.[0];

Digit.SessionStorage.set("boundaryHierarchyOrder", sortedBoundaryData);
Digit.SessionStorage.set("paymentsConfig", paymentsConfig);

if (isPaymentsModuleInitializing || isMDMSLoading) {
return <Loader />;
} else {
return (
<ProviderContext>
<EmployeeApp path={path} stateCode={stateCode} userType={userType} tenants={tenants} />
</ProviderContext>
);
}
};

const componentsToRegister = {
PaymentsModule,
PaymentsCard
PaymentsCard,
BoundaryComponent,
CampaignNameSelection,
//
CustomInboxSearchComposer,
CustomInboxSearchLinks,
CustomSearchComponent,
CustomFilter,
CustomInboxTable,
};

export const initPaymentComponents = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import React, { useEffect, useState, Fragment } from "react";
import PropTypes from "prop-types";
import { Link } from "react-router-dom";

const BreadCrumbs = (props) => {
const [expanded, setExpanded] = useState(false);
const [crumbsToDisplay, setCrumbsToDisplay] = useState([...props?.crumbs]);

useEffect(() => {
if (props?.maxItems && props?.crumbs.length > props?.maxItems && !expanded) {
const startCrumbs = props.crumbs.slice(0, props?.itemsBeforeCollapse || Math.ceil(props.maxItems / 2));
const endCrumbs = props.crumbs.slice(
-1 * (props?.itemsAfterCollapse || Math.floor(props.maxItems / 2))
);

let updatedCrumbs = startCrumbs.concat(
[{ show: true, content: props?.expandText || "..." }],
endCrumbs
);
setCrumbsToDisplay(updatedCrumbs);
Comment on lines +16 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Use const instead of let for variables that are never reassigned.
The variable updatedCrumbs remains constant after assignment.

- let updatedCrumbs = startCrumbs.concat(
+ const updatedCrumbs = startCrumbs.concat(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let updatedCrumbs = startCrumbs.concat(
[{ show: true, content: props?.expandText || "..." }],
endCrumbs
);
setCrumbsToDisplay(updatedCrumbs);
const updatedCrumbs = startCrumbs.concat(
[{ show: true, content: props?.expandText || "..." }],
endCrumbs
);
setCrumbsToDisplay(updatedCrumbs);
🧰 Tools
🪛 Biome (1.9.4)

[error] 16-16: This let declares a variable that is only assigned once.

'updatedCrumbs' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

} else {
setCrumbsToDisplay([...props.crumbs]);
}
}, [props.crumbs, props.maxItems, expanded, props.itemsBeforeCollapse, props.itemsAfterCollapse, props?.expandText]);

function handleRedirect(path) {
const host = window.location.origin; // Dynamically get the base URL
window.location.href = `${host}${path}`;
}

function isLast(index) {
// Filter crumbs to only include those that are displayed
let validCrumbs = crumbsToDisplay?.filter((crumb) => crumb?.show === true);

Comment on lines +33 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Prefer const for variables that remain unchanged.
The variable validCrumbs is only assigned once.

- let validCrumbs = crumbsToDisplay?.filter((crumb) => crumb?.show === true);
+ const validCrumbs = crumbsToDisplay?.filter((crumb) => crumb?.show === true);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let validCrumbs = crumbsToDisplay?.filter((crumb) => crumb?.show === true);
const validCrumbs = crumbsToDisplay?.filter((crumb) => crumb?.show === true);
🧰 Tools
🪛 Biome (1.9.4)

[error] 33-33: This let declares a variable that is only assigned once.

'validCrumbs' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

// Check if all crumbs have the same `internalLink` or `externalLink`
const allHaveSameInternalLink = validCrumbs.every((crumb) => crumb.internalLink === validCrumbs[0].internalLink);
const allHaveSameExternalLink = validCrumbs.every((crumb) => crumb.externalLink === validCrumbs[0].externalLink);

// If all visible crumbs have the same link, determine last crumb by index
if (allHaveSameInternalLink || allHaveSameExternalLink) {
return index === validCrumbs.length - 1;
}

// Check if the current crumb is the last one in the validCrumbs list
return (
validCrumbs?.findIndex((ob) => {
const linkToCheck = ob?.externalLink || ob?.internalLink; // Use externalLink if it exists, else internalLink
const currentLink = crumbsToDisplay?.[index]?.externalLink || crumbsToDisplay?.[index]?.internalLink;

return linkToCheck === currentLink;
}) ===
validCrumbs?.length - 1
);
}

const handleCrumbClick = () => {
setExpanded(!expanded);
};

const validCrumbsMain = crumbsToDisplay?.filter((crumb) => crumb?.show === true);

return (
<ol
className={`digit-bread-crumb ${props?.className ? props?.className : ""}`}
style={props?.style}
>
{validCrumbsMain?.map((crumb, ci) => {
if (!crumb?.show) return null;
if (crumb?.isBack)
return (
<li
key={ci}
style={props?.itemStyle}
className="digit-bread-crumb--item back-crumb-item"
>
<span onClick={() => window.history.back()}>{crumb.content}</span>
</li>
Comment on lines +76 to +77
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add keyboard event handlers for accessibility.
The span element has an onClick handler without corresponding keyboard event handling, preventing keyboard-only users from activating it. In compliance with WCAG, add onKeyDown or related events.

- <span onClick={() => window.history.back()}>{crumb.content}</span>
+ <span
+   onClick={() => window.history.back()}
+   onKeyDown={(e) => { if (e.key === "Enter") window.history.back(); }}
+   tabIndex={0}
+ >
+   {crumb.content}
+ </span>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<span onClick={() => window.history.back()}>{crumb.content}</span>
</li>
<span
onClick={() => window.history.back()}
onKeyDown={(e) => { if (e.key === "Enter") window.history.back(); }}
tabIndex={0}
>
{crumb.content}
</span>
</li>
🧰 Tools
🪛 Biome (1.9.4)

[error] 76-76: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

);

return (
<Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure proper keys for iterable fragments.
Every sibling element in a map must have a unique key prop to help React optimize rendering.

- <Fragment>
+ <Fragment key={ci}>

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 81-81: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

<li
key={ci}
style={props?.itemStyle}
className="digit-bread-crumb--item"
>
{isLast(ci) || (!crumb?.internalLink && !crumb?.externalLink) ? (
<span
className={`digit-bread-crumb-content ${isLast(ci) ? "current" : "default"}`}
style={props?.spanStyle}
onClick={(crumb.content === "..." || crumb.content === props?.expandText) ? handleCrumbClick : null}
>
{crumb?.icon && crumb.icon}
{crumb.content}
</span>
Comment on lines +88 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Handle keyboard events for the click action.
Actions triggered by mouse should also support keyboard interactions (Enter/Space).

- <span
-   className={`digit-bread-crumb-content ${isLast(ci) ? "current" : "default"}`}
-   style={props?.spanStyle}
-   onClick={(crumb.content === "..." || crumb.content === props?.expandText) ? handleCrumbClick : null}
- >
+ <span
+   className={`digit-bread-crumb-content ${isLast(ci) ? "current" : "default"}`}
+   style={props?.spanStyle}
+   onClick={(crumb.content === "..." || crumb.content === props?.expandText) ? handleCrumbClick : null}
+   onKeyDown={(e) => {
+     if ((crumb.content === "..." || crumb.content === props?.expandText) && e.key === "Enter") {
+       handleCrumbClick();
+     }
+   }}
+   role="button"
+   tabIndex={0}
+ >

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 88-92: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.

Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.

(lint/a11y/useKeyWithClickEvents)

) : crumb?.externalLink ? (
<Link
className="digit-bread-crumb-content"
onClick={() => handleRedirect(crumb?.externalLink)}
>
{crumb?.icon && crumb.icon}
{crumb.content}
</Link>
) : (
<Link
to={{ pathname: crumb.internalLink, state: { count: crumb?.count }, search: crumb?.query }}
className={`digit-bread-crumb-content ${isLast(ci) ? "current" : "default"}`}
>
{crumb?.icon && crumb.icon}
{crumb.content}
</Link>
)}
{!isLast(ci) && (
<div className="digit-bread-crumb-seperator">
{props?.customSeparator ? props?.customSeparator : "/"}
</div>
)}
</li>
</Fragment>
);
})}
</ol>
);
};

BreadCrumbs.propTypes = {
crumbs: PropTypes.array,
className: PropTypes.string,
style: PropTypes.object,
spanStyle: PropTypes.object,
customSeparator: PropTypes.element,
maxItems: PropTypes.number,
itemsAfterCollapse: PropTypes.number,
itemsBeforeCollapse: PropTypes.number,
expandText: PropTypes.string
};

BreadCrumbs.defaultProps = {
successful: true,
};

export default BreadCrumbs;
Loading