updated Master modal
This commit is contained in:
parent
14fba75d19
commit
d4804e4c3f
@ -107,33 +107,9 @@ const MasterModal = ({ modaldata, closeModal }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<>
|
||||||
className="modal fade show"
|
|
||||||
id="master-modal"
|
|
||||||
tabIndex="-1"
|
|
||||||
role="dialog"
|
|
||||||
aria-hidden="true"
|
|
||||||
aria-labelledby="modalToggleLabel"
|
|
||||||
style={{ display: "block" }}
|
|
||||||
>
|
|
||||||
<div className={`modal-dialog mx-sm-auto mx-1 ${isLargeModal ? "modal-lg" : "modal-md"} modal-simple`}>
|
|
||||||
<div className="modal-content">
|
|
||||||
<div className="modal-body p-sm-4 p-0">
|
|
||||||
<div className="d-flex justify-content-between">
|
|
||||||
<h6>{modaldata?.modalType}</h6>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn-close"
|
|
||||||
data-bs-dismiss="modal"
|
|
||||||
aria-label="Close"
|
|
||||||
onClick={closeModal}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{renderModalContent()}
|
{renderModalContent()}
|
||||||
</div>
|
</>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import { getCachedData } from "../../slices/apiDataManager";
|
|||||||
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
||||||
import { MANAGE_MASTER } from "../../utils/constants";
|
import { MANAGE_MASTER } from "../../utils/constants";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
|
import GlobalModel from "../../components/common/GlobalModel";
|
||||||
|
|
||||||
|
|
||||||
const MasterPage = () => {
|
const MasterPage = () => {
|
||||||
@ -32,15 +33,6 @@ const MasterPage = () => {
|
|||||||
setIsCreateModalOpen(false);
|
setIsCreateModalOpen(false);
|
||||||
setModalConfig(null);
|
setModalConfig(null);
|
||||||
|
|
||||||
// Clean up Bootstrap modal manually
|
|
||||||
const modalEl = document.getElementById('master-modal');
|
|
||||||
modalEl?.classList.remove('show');
|
|
||||||
if (modalEl) modalEl.style.display = 'none';
|
|
||||||
|
|
||||||
document.body.classList.remove('modal-open');
|
|
||||||
document.body.style.overflow = 'auto';
|
|
||||||
|
|
||||||
document.querySelectorAll('.modal-backdrop').forEach((el) => el.remove());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleModalData = (modalType, item, masterType = selectedMaster) => {
|
const handleModalData = (modalType, item, masterType = selectedMaster) => {
|
||||||
@ -91,8 +83,9 @@ const MasterPage = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isCreateModalOpen && (
|
{isCreateModalOpen && (
|
||||||
<MasterModal modaldata={modalConfig} closeModal={closeModal} />
|
<GlobalModel isOpen={isCreateModalOpen} closeModal={()=>setIsCreateModalOpen(false)} size={modalConfig.masterType === "Application Role" ? "lg":"md"}>
|
||||||
|
<MasterModal modaldata={modalConfig} closeModal={closeModal} />
|
||||||
|
</GlobalModel>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
|
@ -75,13 +75,8 @@ const MasterTable = ({ data, columns, loading, handleModalData }) => {
|
|||||||
{loading ? (
|
{loading ? (
|
||||||
<p>Loading...</p>
|
<p>Loading...</p>
|
||||||
) : (
|
) : (
|
||||||
<table
|
<table className="datatables-users table border-top dataTable no-footer dtr-column w-100">
|
||||||
className="datatables-users table border-top dataTable no-footer dtr-column"
|
<thead className="shadow-sm">
|
||||||
id="DataTables_Table_0"
|
|
||||||
aria-describedby="DataTables_Table_0_info"
|
|
||||||
style={{ width: "100%" }}
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th className="text-start"> {selectedMaster === "Activity" ? "Activity" : "Name"}</th>
|
<th className="text-start"> {selectedMaster === "Activity" ? "Activity" : "Name"}</th>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user