Skip to content

Commit

Permalink
fixed usermanagement toast issue (#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swathi-eGov authored Dec 5, 2024
1 parent 6b6d101 commit 97a5d00
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<title>DIGIT</title>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.58/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.59/dist/index.css" />


<!-- added below css for hcm-workbench module inclusion-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
"version": "0.1.58",
"version": "0.1.59",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <jagan.kumar@egov.org.in>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,5 @@
}
}
.digit-toast-success {
margin-bottom: -0.5rem;
margin-bottom: -1.25rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ function RoleTableComposer({ nationalRoles }) {
label={t(showToast?.label)}
transitionTime={showToast.transitionTime}
onClose={closeToast}
style={{marginBottom:"0.75rem"}}
/>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ function UserAccess({ category, setData, nationalRoles }) {
// Handle search logic, such as filtering or API calls
};

useEffect(()=>{
setShowToast(null);
},[category])

return (
<>
Expand Down Expand Up @@ -377,7 +380,7 @@ function UserAccess({ category, setData, nationalRoles }) {
<Toast
type={showToast.key === "error" ? "error" : "success"} // Adjust based on your needs
label={t(showToast.label)}
transitionTime={5000}
transitionTime={showToast?.transitionTime || 5000}
onClose={() => {
setShowToast(false);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ const UserAccessWrapper = ({ onSelect, props: customProps, setupCompleted }) =>
});
return prevKey; // Keep the same value if condition is true
} else {
setShowErrorToast(null);
setShowToast(null);
return prevKey + 1; // Increment internalKey if condition is false
}
});
};

const handleBack = () => {
if (internalKey > 1) {
setShowErrorToast(null);
setShowToast(null);
setInternalKey((prevKey) => prevKey - 1); // Update key in URL
} else {
setShowErrorToast(null);
setShowToast(null);
window.dispatchEvent(new Event("moveToPrevious"));
}
};
Expand Down Expand Up @@ -180,6 +186,7 @@ const UserAccessWrapper = ({ onSelect, props: customProps, setupCompleted }) =>
onClose={() => {
setShowErrorToast(false);
}}
style={{zIndex:10001}}
isDleteBtn={true}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion health/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.58/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.59/dist/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT HCM</title>
Expand Down

0 comments on commit 97a5d00

Please sign in to comment.