Added Document Managment feature #388
@ -223,11 +223,14 @@ const CreateActivity = ({ onClose }) => {
|
|||||||
<div className="col-12 text-end mt-3">
|
<div className="col-12 text-end mt-3">
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ change to button
|
type="button" // ✅ change to button
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait" : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,7 +6,7 @@ import { MasterRespository } from '../../repositories/MastersRepository';
|
|||||||
import { clearApiCacheKey } from '../../slices/apiCacheSlice';
|
import { clearApiCacheKey } from '../../slices/apiCacheSlice';
|
||||||
import { getCachedData, cacheData } from '../../slices/apiDataManager';
|
import { getCachedData, cacheData } from '../../slices/apiDataManager';
|
||||||
import showToast from '../../services/toastService';
|
import showToast from '../../services/toastService';
|
||||||
import {useCreateContactCategory} from '../../hooks/masterHook/useMaster';
|
import { useCreateContactCategory } from '../../hooks/masterHook/useMaster';
|
||||||
import Label from '../common/Label';
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
@ -66,16 +66,16 @@ const CreateContactCategory = ({ onClose }) => {
|
|||||||
|
|
||||||
return (<>
|
return (<>
|
||||||
<form className="row g-2" onSubmit={handleSubmit(onSubmit)}>
|
<form className="row g-2" onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12 text-start">
|
||||||
<label className="form-label">Category Name</label>
|
<Label className="form-label" required>Category Name</Label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
{...register("name")}
|
{...register("name")}
|
||||||
className={`form-control ${errors.name ? 'is-invalids' : ''}`}
|
className={`form-control ${errors.name ? 'is-invalids' : ''}`}
|
||||||
/>
|
/>
|
||||||
{errors.name && <p className="text-danger">{errors.name.message}</p>}
|
{errors.name && <p className="text-danger">{errors.name.message}</p>}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12 text-start">
|
||||||
<label className="form-label" htmlFor="description">Description</label>
|
<Label className="form-label" htmlFor="description" required>Description</Label>
|
||||||
<textarea
|
<textarea
|
||||||
rows="3"
|
rows="3"
|
||||||
{...register("description")}
|
{...register("description")}
|
||||||
@ -93,13 +93,11 @@ const CreateContactCategory = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
resetForm(); // clear inputs
|
resetForm(); // clear inputs
|
||||||
onClose?.(); // close modal from parent
|
onClose?.(); // close modal from parent
|
||||||
@ -107,7 +105,9 @@ const CreateContactCategory = ({ onClose }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -93,13 +93,11 @@ const CreateContactTag = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
resetForm(); // clear inputs
|
resetForm(); // clear inputs
|
||||||
onClose?.(); // close modal from parent
|
onClose?.(); // close modal from parent
|
||||||
@ -107,6 +105,9 @@ const CreateContactTag = ({ onClose }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -119,13 +119,11 @@ const CreateJobRole = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ change from reset → button
|
type="button" // ✅ change from reset → button
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
resetForm(); // optional: clears form
|
resetForm(); // optional: clears form
|
||||||
onClose?.(); // ✅ close modal via parent
|
onClose?.(); // ✅ close modal via parent
|
||||||
@ -133,6 +131,9 @@ const CreateJobRole = ({ onClose }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -229,17 +229,18 @@ const CreateRole = ({ modalType, onClose }) => {
|
|||||||
|
|
||||||
|
|
||||||
{masterFeatures && (
|
{masterFeatures && (
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -109,13 +109,11 @@ const CreateWorkCategory = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
resetForm(); // clear inputs
|
resetForm(); // clear inputs
|
||||||
onClose?.(); // close modal from parent
|
onClose?.(); // close modal from parent
|
||||||
|
@ -240,7 +240,7 @@ const UpdateActivity = ({ activityData, onClose }) => {
|
|||||||
<div className="col-12 text-end mt-3">
|
<div className="col-12 text-end mt-3">
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ change to button
|
type="button" // ✅ change to button
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
|
@ -112,13 +112,11 @@ const EditContactCategory = ({ data, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
resetForm(); // clear inputs
|
resetForm(); // clear inputs
|
||||||
onClose?.(); // close modal from parent
|
onClose?.(); // close modal from parent
|
||||||
|
@ -112,13 +112,11 @@ const EditContactTag = ({ data, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
resetForm(); // clear inputs
|
resetForm(); // clear inputs
|
||||||
onClose?.(); // close modal from parent
|
onClose?.(); // close modal from parent
|
||||||
|
@ -128,13 +128,11 @@ const EditJobRole = ({ data, onClose }) => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={onClose} // 👈 This will now close the popup
|
onClick={onClose} // 👈 This will now close the popup
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
|
@ -276,14 +276,17 @@ const EditMaster = ({ master, onClose }) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="col-12 text-end">
|
<div className="col-12 text-end mt-3">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary"> {isLoading ? "Please Wait..." : "Submit"}</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -116,17 +116,18 @@ const EditWorkCategory = ({ data, onClose }) => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-center mt-3">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -71,35 +71,23 @@ const ManagePaymentMode = ({ data = null, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-3">
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="btn btn-sm btn-primary me-3"
|
|
||||||
disabled={isPending || Updating}
|
|
||||||
>
|
|
||||||
{isPending || Updating ? "Please Wait..." : Updating ? "Update" : "Submit"}
|
|
||||||
</button>
|
|
||||||
<div className="col-12 text-end">
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
|
||||||
onClick={onClose} // ✅ call onClose here
|
|
||||||
type="reset"
|
|
||||||
className="btn btn-sm btn-label-secondary me-3"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
data-bs-dismiss="modal"
|
onClick={onClose} // ✅ call onClose here
|
||||||
aria-label="Close"
|
|
||||||
disabled={isPending || Updating}
|
disabled={isPending || Updating}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-primary"
|
className="btn btn-sm btn-primary"
|
||||||
disabled={isPending || Updating}
|
disabled={isPending || Updating}
|
||||||
>
|
>
|
||||||
{isPending || Updating? "Please Wait..." : Updating ? "Update" : "Submit"}
|
{isPending || Updating ? "Please Wait..." : Updating ? "Update" : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -123,7 +123,7 @@ const MasterPage = () => {
|
|||||||
name="DataTables_Table_0_length"
|
name="DataTables_Table_0_length"
|
||||||
aria-controls="DataTables_Table_0"
|
aria-controls="DataTables_Table_0"
|
||||||
className="form-select py-1 px-2"
|
className="form-select py-1 px-2"
|
||||||
style={{ fontSize: "0.875rem", height: "32px", width: "150px" }}
|
style={{ fontSize: "0.875rem", height: "32px", width: "170px" }}
|
||||||
value={selectedMaster}
|
value={selectedMaster}
|
||||||
>
|
>
|
||||||
{isLoading && <option value="">Loading...</option>}
|
{isLoading && <option value="">Loading...</option>}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user