-
Notifications
You must be signed in to change notification settings - Fork 42
Payment: Attendance Approval Flow #2097
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
base: console
Are you sure you want to change the base?
Changes from 56 commits
0c5c504
38373ae
a616ef8
e26bb39
7fbbf53
d12482d
8c988e3
817ad5e
51b2ae1
3d92fce
7460527
6860809
bc08be1
a5dcdcd
bd357c7
4753623
87ebbfe
c49fce8
fa96bc1
ccc8c62
b3183df
ceef537
322030a
1a77329
4184080
ed322b8
275854d
68dfb09
6ca1ccc
7fc944a
28a99d2
391a0d0
c6c8855
0144d47
302df9a
42818c0
86b87ed
459e7be
bd5af59
ad0cb84
9a87660
0be1940
f92ec48
4ebea8c
3329e13
6077b9c
3d26e04
a8e1144
ccaf400
1c26a4e
ade4d3d
7cb9d3d
4a12d65
db267f0
821bcb6
c858a3f
f24b600
92b31c3
ca816f0
7567c72
b4009a9
0c78039
2cc84cb
2b30b94
2ea6c8b
696aec9
3b4bde7
576c2cd
e18e422
bba873a
9156ae0
416f422
314ff43
36801c5
c4b498c
66b907e
67b30b2
8bf196c
db0e070
54279bf
0779649
0c80699
ce025e3
a8c3413
efe93e9
8e4c472
0ae9a2a
5afe320
5c1ae6c
375792b
5668822
54fe437
47a8732
4fbb011
40700e6
74c3e13
a65ff03
2d20a68
a2a7910
d17ade5
7a9cccd
12b115b
a619132
ba199a4
45b6177
a4b50c7
30ffe96
b095cba
1d9f532
bdbf2dc
71114b0
bb0cd71
88b56f0
677fae4
dcb20d9
e2001cd
a584bf3
b72304c
029bdb1
e017f7f
0b92139
d17cac4
b17c451
8658973
0707199
0fdc821
ed8615f
488aff3
4b06e06
6fae825
65129c5
6c54b52
07efc08
abcf4a2
4c4e516
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
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"; | ||||||
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("CONTEXT_PATH") || "ADMIN"; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Remove or clarify commented code |
||||||
const moduleCode = ["payments", `boundary-${hierarchyType}`]; | ||||||
const modulePrefix = "hcm"; | ||||||
const language = Digit.StoreData.getCurrentLanguage(); | ||||||
const { isLoading, data: store } = Digit.Services.useStore({ | ||||||
|
@@ -19,18 +29,104 @@ export const PaymentsModule = ({ stateCode, userType, tenants }) => { | |||||
language, | ||||||
modulePrefix, | ||||||
}); | ||||||
let user = Digit?.SessionStorage.get("User"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use - let user = Digit?.SessionStorage.get("User");
+ const user = Digit?.SessionStorage.get("User"); 📝 Committable suggestion
Suggested change
🧰 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 staffs = Digit.Hooks.payments.useProjectStaffSearch({ | ||||||
data: { | ||||||
"ProjectStaff": { | ||||||
"staffId": [user?.info?.uuid] | ||||||
} | ||||||
}, | ||||||
params: { | ||||||
"tenantId": tenantId, | ||||||
"offset": 0, | ||||||
"limit": 100 | ||||||
}, | ||||||
config: { | ||||||
select: (data) => { | ||||||
return data?.map(item => { | ||||||
return { | ||||||
"id": item.projectId, | ||||||
"tenantId": tenantId, | ||||||
"userId": item.userId, | ||||||
}; | ||||||
}) | ||||||
} | ||||||
} | ||||||
}); | ||||||
|
||||||
const staffProjects = staffs?.data; | ||||||
|
||||||
const assignedProjects = Digit.Hooks.payments.useProjectSearch({ | ||||||
data: { | ||||||
"Projects": staffProjects?.map((staff) => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this sequential calls to be created as a custom hook and module should call that custom hook |
||||||
return { | ||||||
"id": staff?.id, | ||||||
"tenantId": tenantId, | ||||||
}; | ||||||
}) | ||||||
}, | ||||||
params: { | ||||||
"tenantId": tenantId, | ||||||
"offset": 0, | ||||||
"limit": 100 | ||||||
}, | ||||||
config: { | ||||||
enabled: staffProjects?.length > 0 ? true : false | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Simplify boolean expression - enabled: staffProjects?.length > 0 ? true : false
+ enabled: !!staffProjects?.length 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 74-74: Unnecessary use of boolean literals in conditional expression. Simplify your code by directly assigning the result without using a ternary operator. (lint/complexity/noUselessTernary) |
||||||
} | ||||||
}); | ||||||
|
||||||
const IndividualRequestCriteria = { | ||||||
url: `/health-individual/v1/_search`, | ||||||
params: { | ||||||
tenantId: tenantId, | ||||||
offset: 0, | ||||||
limit: 100, | ||||||
}, | ||||||
body: { | ||||||
Individual: { | ||||||
userUuid: staffProjects?.map((staff) => { | ||||||
return staff.userId; | ||||||
}) | ||||||
} | ||||||
}, | ||||||
config: { | ||||||
enabled: staffProjects?.length > 0 ? true : false, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Remove unnecessary ternary - enabled: staffProjects?.length > 0 ? true : false
+ enabled: !!staffProjects?.length 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 93-93: Unnecessary use of boolean literals in conditional expression. Simplify your code by directly assigning the result without using a ternary operator. (lint/complexity/noUselessTernary) |
||||||
select: (data) => { | ||||||
return data; | ||||||
}, | ||||||
}, | ||||||
}; | ||||||
|
||||||
return ( | ||||||
<ProviderContext> | ||||||
<EmployeeApp path={path} stateCode={stateCode} userType={userType} tenants={tenants}/> | ||||||
</ProviderContext> | ||||||
); | ||||||
const { isLoading: isIndividualsLoading, data: IndividualData } = Digit.Hooks.useCustomAPIHook(IndividualRequestCriteria); | ||||||
|
||||||
|
||||||
Digit.SessionStorage.set("staffProjects", assignedProjects?.data); | ||||||
Digit.SessionStorage.set("UserIndividual", IndividualData?.Individual); | ||||||
|
||||||
|
||||||
if (isLoading || staffs?.isLoading || assignedProjects?.isLoading || isIndividualsLoading) { | ||||||
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 = () => { | ||||||
|
@@ -39,4 +135,4 @@ export const initPaymentComponents = () => { | |||||
Object.entries(componentsToRegister).forEach(([key, value]) => { | ||||||
Digit.ComponentRegistryService.setComponent(key, value); | ||||||
}); | ||||||
}; | ||||||
}; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,132 @@ | ||||||||||||||||||||||||||||||||||||||||||
import React, { useEffect, useReducer, useState, useMemo, use } from "react"; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
import _ from "lodash"; | ||||||||||||||||||||||||||||||||||||||||||
import CustomInboxSearchLinks from "./custom_comp/link_section"; | ||||||||||||||||||||||||||||||||||||||||||
import CustomSearchComponent from "./custom_comp/search_section"; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
import { useTranslation } from "react-i18next"; | ||||||||||||||||||||||||||||||||||||||||||
import CustomFilter from "./custom_comp/filter_section"; | ||||||||||||||||||||||||||||||||||||||||||
import CustomInboxTable from "./custom_comp/table_inbox"; | ||||||||||||||||||||||||||||||||||||||||||
import { FilterCard, Toast } from "@egovernments/digit-ui-components"; | ||||||||||||||||||||||||||||||||||||||||||
import BillSearchBox from "./BillSearchBox"; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
const CustomBillInbox = () => { | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add the code comments here why inbox composers were not used in this flow ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added the code comments |
||||||||||||||||||||||||||||||||||||||||||
const { t } = useTranslation(); | ||||||||||||||||||||||||||||||||||||||||||
const [showToast, setShowToast] = useState(null); | ||||||||||||||||||||||||||||||||||||||||||
const [filterCriteria, setFilterCriteria] = useState(null); | ||||||||||||||||||||||||||||||||||||||||||
const [selectedProject, setSelectedProject] = useState({}); | ||||||||||||||||||||||||||||||||||||||||||
//-------// | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
const [currentPage, setCurrentPage] = useState(1); | ||||||||||||||||||||||||||||||||||||||||||
const [rowsPerPage, setRowsPerPage] = useState(5); | ||||||||||||||||||||||||||||||||||||||||||
const [selectedStatus, setSelectedStatus] = useState("PENDINGFORAPPROVAL"); | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hardcoded status, might lead to issue, keep them atleast in constants There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in the constant file |
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
const [searchQuery, setSearchQuery] = useState(null); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// useEffect(() => { }, [selectedProject]); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
const handleProjectChange = (selectedProject) => { | ||||||||||||||||||||||||||||||||||||||||||
// setSelectedProject(selectedProject); | ||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
const handleFilterUpdate = (newFilter) => { | ||||||||||||||||||||||||||||||||||||||||||
// setFilterCriteria(newFilter); | ||||||||||||||||||||||||||||||||||||||||||
// triggerMusterRollApprove(newFilter); | ||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||
// // handleCreateRateAnalysis(); | ||||||||||||||||||||||||||||||||||||||||||
// // triggerMusterRollApprove(); | ||||||||||||||||||||||||||||||||||||||||||
// }, [totalRows, currentPage, rowsPerPage, searchQuery]); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||
// setTotalRows(childrenData?.totalCount); | ||||||||||||||||||||||||||||||||||||||||||
// }, [childrenData]); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
const handlePaginationChange = (page) => { | ||||||||||||||||||||||||||||||||||||||||||
setCurrentPage(page); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// triggerMusterRollApprove(filterCriteria, selectedStatus, rowsPerPage, page); | ||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||
const handleRowsPerPageChange = (newPerPage, page) => { | ||||||||||||||||||||||||||||||||||||||||||
setRowsPerPage(newPerPage); // Update the rows per page state | ||||||||||||||||||||||||||||||||||||||||||
setCurrentPage(page); // Optionally reset the current page or maintain it | ||||||||||||||||||||||||||||||||||||||||||
// refetchPlanEmployee(); | ||||||||||||||||||||||||||||||||||||||||||
// handleCreateRateAnalysis(); | ||||||||||||||||||||||||||||||||||||||||||
// triggerMusterRollApprove(filterCriteria, selectedStatus, newPerPage, page); | ||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||
const callServiceOnTap = (status) => { | ||||||||||||||||||||||||||||||||||||||||||
if (status.code == "HCM_AM_PENDING_FOR_APPROVAL") { | ||||||||||||||||||||||||||||||||||||||||||
// setRowsPerPage(5); // Update the rows per page state | ||||||||||||||||||||||||||||||||||||||||||
// setCurrentPage(1); | ||||||||||||||||||||||||||||||||||||||||||
// setSelectedStatus("PENDINGFORAPPROVAL"); | ||||||||||||||||||||||||||||||||||||||||||
// triggerMusterRollApprove(filterCriteria, "PENDINGFORAPPROVAL", 5, 1); | ||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||
// setRowsPerPage(5); // Update the rows per page state | ||||||||||||||||||||||||||||||||||||||||||
// setCurrentPage(1); | ||||||||||||||||||||||||||||||||||||||||||
// setSelectedStatus("APPROVED"); | ||||||||||||||||||||||||||||||||||||||||||
// triggerMusterRollApprove(filterCriteria, "APPROVED", 5, 1); | ||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||
<React.Fragment> | ||||||||||||||||||||||||||||||||||||||||||
<div style={{ display: "flex", flexDirection: "column", gap: "24px" }}> | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we had many different wrapper cards from new component library, why direct html tags are been used? |
||||||||||||||||||||||||||||||||||||||||||
<div style={{ width: "100%", display: "flex", flexDirection: "row", gap: "24px" }}> | ||||||||||||||||||||||||||||||||||||||||||
<div style={{ width: "20%", display: "flex", flexDirection: "row" }}> | ||||||||||||||||||||||||||||||||||||||||||
<CustomInboxSearchLinks | ||||||||||||||||||||||||||||||||||||||||||
headerText={"HCM_AM_BILL_INBOX"} | ||||||||||||||||||||||||||||||||||||||||||
links={[ | ||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||
url: "/employee/payments/my-bills", | ||||||||||||||||||||||||||||||||||||||||||
text: "HCM_AM_MY_BILLS_LINK", | ||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||
]} | ||||||||||||||||||||||||||||||||||||||||||
></CustomInboxSearchLinks> | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use a self-closing tag for childless component. -<CustomInboxSearchLinks
- headerText={"HCM_AM_BILL_INBOX"}
- links={[{ url: "...", text: "..."}]}
-></CustomInboxSearchLinks>
+<CustomInboxSearchLinks
+ headerText={"HCM_AM_BILL_INBOX"}
+ links={[{ url: "...", text: "..." }]}
+/>
🧰 Tools🪛 Biome (1.9.4)[error] 77-85: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. Unsafe fix: Use a SelfClosingElement instead (lint/style/useSelfClosingElements) |
||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
<div style={{ width: "80%", display: "flex", flexDirection: "row" }}> | ||||||||||||||||||||||||||||||||||||||||||
<BillSearchBox onProjectSelect={handleProjectChange}></BillSearchBox> | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use a self-closing tag for childless component. -<BillSearchBox onProjectSelect={handleProjectChange}></BillSearchBox>
+<BillSearchBox onProjectSelect={handleProjectChange} /> 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 88-88: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. Unsafe fix: Use a SelfClosingElement instead (lint/style/useSelfClosingElements) |
||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
<div style={{ width: "100%", display: "flex", flexDirection: "row", gap: "24px" }}> | ||||||||||||||||||||||||||||||||||||||||||
<div | ||||||||||||||||||||||||||||||||||||||||||
style={{ | ||||||||||||||||||||||||||||||||||||||||||
width: "20%", | ||||||||||||||||||||||||||||||||||||||||||
display: "flex", | ||||||||||||||||||||||||||||||||||||||||||
flexDirection: "row", | ||||||||||||||||||||||||||||||||||||||||||
height: "60vh", | ||||||||||||||||||||||||||||||||||||||||||
overflowY: "auto", | ||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||
<CustomFilter projectData={selectedProject} onFilterChange={handleFilterUpdate}></CustomFilter> | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use a self-closing tag for childless component. -<CustomFilter projectData={selectedProject} onFilterChange={handleFilterUpdate}></CustomFilter>
+<CustomFilter projectData={selectedProject} onFilterChange={handleFilterUpdate}/> 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 102-102: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. Unsafe fix: Use a SelfClosingElement instead (lint/style/useSelfClosingElements) |
||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
<div style={{ width: "80%", display: "flex", flexDirection: "row", height: "60vh", minHeight: "60vh" }}> | ||||||||||||||||||||||||||||||||||||||||||
<CustomInboxTable | ||||||||||||||||||||||||||||||||||||||||||
// statusCount={childrenData?.statusCount} | ||||||||||||||||||||||||||||||||||||||||||
handleTabChange={callServiceOnTap} | ||||||||||||||||||||||||||||||||||||||||||
rowsPerPage={rowsPerPage} | ||||||||||||||||||||||||||||||||||||||||||
customHandleRowsPerPageChange={handleRowsPerPageChange} | ||||||||||||||||||||||||||||||||||||||||||
// customHandlePaginationChange={handlePaginationChange} | ||||||||||||||||||||||||||||||||||||||||||
// isLoading={childrenDataLoading} | ||||||||||||||||||||||||||||||||||||||||||
// tableData={childrenData?.data} | ||||||||||||||||||||||||||||||||||||||||||
// totalCount={childrenData?.totalCount} | ||||||||||||||||||||||||||||||||||||||||||
></CustomInboxTable> | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use a self-closing tag for childless component. -<CustomInboxTable
- handleTabChange={callServiceOnTap}
- rowsPerPage={rowsPerPage}
- ...
-></CustomInboxTable>
+<CustomInboxTable
+ handleTabChange={callServiceOnTap}
+ rowsPerPage={rowsPerPage}
+ ...
+/> 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 105-114: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. Unsafe fix: Use a SelfClosingElement instead (lint/style/useSelfClosingElements) |
||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||||||||||||||||||
{showToast && ( | ||||||||||||||||||||||||||||||||||||||||||
<Toast | ||||||||||||||||||||||||||||||||||||||||||
style={{ zIndex: 10001 }} | ||||||||||||||||||||||||||||||||||||||||||
label={showToast.label} | ||||||||||||||||||||||||||||||||||||||||||
type={showToast.key} | ||||||||||||||||||||||||||||||||||||||||||
// error={showToast.key === "error"} | ||||||||||||||||||||||||||||||||||||||||||
transitionTime={showToast.transitionTime} | ||||||||||||||||||||||||||||||||||||||||||
onClose={() => setShowToast(null)} | ||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||
</React.Fragment> | ||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
export default CustomBillInbox; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,66 @@ | ||||||||||||||||||||||||||
import { SubmitBar, LinkLabel, Label } from "@egovernments/digit-ui-react-components"; | ||||||||||||||||||||||||||
import React, { useContext, useEffect, useState } from "react"; | ||||||||||||||||||||||||||
import { useTranslation } from "react-i18next"; | ||||||||||||||||||||||||||
import { Card, Dropdown, TextBlock, TextInput, ButtonGroup, Button } from "@egovernments/digit-ui-components"; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const BillSearchBox = ({ onLevelSelect }) => { | ||||||||||||||||||||||||||
const { t } = useTranslation(); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const onSubmit = (data, e) => { | ||||||||||||||||||||||||||
onLevelSelect(); | ||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const clearSearch = () => { | ||||||||||||||||||||||||||
onLevelSelect(); | ||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Refine function naming and usage. |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const closeToast = () => { | ||||||||||||||||||||||||||
setShowToast(null); | ||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove unused state. - const closeToast = () => {
- setShowToast(null);
- }; |
||||||||||||||||||||||||||
const handleFilterRefresh = () => { }; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||
<React.Fragment> | ||||||||||||||||||||||||||
<Card variant="search"> | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Placeholder function detection. |
||||||||||||||||||||||||||
{/*<div style={{ maxWidth: "100%", width: "100%" }}> | ||||||||||||||||||||||||||
<TextBlock body={t("HCM_AM_ATTENDANCE_ID")}></TextBlock> | ||||||||||||||||||||||||||
<TextInput type="text"></TextInput> | ||||||||||||||||||||||||||
</div>*/} | ||||||||||||||||||||||||||
<div style={{ maxWidth: "100%", width: "100%" }}> | ||||||||||||||||||||||||||
<TextBlock body={`${t("HCM_AM_BILL_AGGREGATION_FOR_EMPLOYEE_MAPPED_AT")}`}></TextBlock> | ||||||||||||||||||||||||||
<Dropdown | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use self-closing tags where possible. - <TextBlock body=...></TextBlock>
+ <TextBlock body=.../> Also applies to: 47-53 🧰 Tools🪛 Biome (1.9.4)[error] 32-32: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. Unsafe fix: Use a SelfClosingElement instead (lint/style/useSelfClosingElements) |
||||||||||||||||||||||||||
t={t} | ||||||||||||||||||||||||||
option={[ | ||||||||||||||||||||||||||
{ "name": "HCM_AM_DISTRICT_LEVEL", "code": 'HCM_AM_DISTRICT_LEVEL' }, | ||||||||||||||||||||||||||
{ "name": "HCM_AM_PROVIENCE_LEVEL", "code": "HCM_AM_PROVIENCE_LEVEL" } | ||||||||||||||||||||||||||
]} | ||||||||||||||||||||||||||
name={"code"} | ||||||||||||||||||||||||||
optionKey={"name"} | ||||||||||||||||||||||||||
select={(value) => { | ||||||||||||||||||||||||||
// handleProjectChange(value); | ||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
<ButtonGroup | ||||||||||||||||||||||||||
buttonsArray={[ | ||||||||||||||||||||||||||
<Button variation="teritiary" label={t(`HCM_AM_CLEAR`)} type="button" onClick={() => { }} size="large" />, | ||||||||||||||||||||||||||
<Button variation="primary" label={t(`HCM_AM_SEARCH`)} type="button" onClick={() => { }} size="large" />, | ||||||||||||||||||||||||||
]} | ||||||||||||||||||||||||||
></ButtonGroup> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add key props within arrays to avoid React warnings. <ButtonGroup
buttonsArray={[
- <Button ... />,
- <Button ... />,
+ <Button key="clearBtn" ... />,
+ <Button key="searchBtn" ... />,
]}
/> 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 47-52: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. Unsafe fix: Use a SelfClosingElement instead (lint/style/useSelfClosingElements) [error] 49-49: 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. (lint/correctness/useJsxKeyInIterable) [error] 50-50: 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. (lint/correctness/useJsxKeyInIterable) |
||||||||||||||||||||||||||
{/*showToast && <Toast | ||||||||||||||||||||||||||
error={showToast.error} | ||||||||||||||||||||||||||
warning={showToast.warning} | ||||||||||||||||||||||||||
label={t(showToast.label)} | ||||||||||||||||||||||||||
isDleteBtn={true} | ||||||||||||||||||||||||||
onClose={closeToast} /> | ||||||||||||||||||||||||||
*/} | ||||||||||||||||||||||||||
</Card> | ||||||||||||||||||||||||||
</React.Fragment> | ||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export default BillSearchBox; |
There was a problem hiding this comment.
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.