Compare commits
11 Commits
f9fe987a94
...
e216ac16ef
Author | SHA1 | Date | |
---|---|---|---|
e216ac16ef | |||
0194c4427a | |||
ea022d37c8 | |||
768f810465 | |||
7ed6a7e5b9 | |||
5c59ac3115 | |||
e39355c6fd | |||
8f8cbf27ef | |||
0db0edec1a | |||
f56fd23cbf | |||
f3913c2824 |
@ -114,7 +114,10 @@ const Attendance = ({ getRole, handleModalData, searchTerm }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="table-responsive text-nowrap h-100" >
|
<div
|
||||||
|
className="table-responsive text-nowrap h-100"
|
||||||
|
style={{ minHeight: "200px" }} // 🔹 Ensures fixed height
|
||||||
|
>
|
||||||
<div className="d-flex text-start align-items-center py-2">
|
<div className="d-flex text-start align-items-center py-2">
|
||||||
<strong>Date : {formatUTCToLocalTime(todayDate)}</strong>
|
<strong>Date : {formatUTCToLocalTime(todayDate)}</strong>
|
||||||
<div className="form-check form-switch text-start m-0 ms-5">
|
<div className="form-check form-switch text-start m-0 ms-5">
|
||||||
@ -209,7 +212,11 @@ const Attendance = ({ getRole, handleModalData, searchTerm }) => {
|
|||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
{!attendance && (
|
{!attendance && (
|
||||||
<span className="text-secondary m-4">No employees assigned to the project!</span>
|
<tr>
|
||||||
|
<td colSpan={6} className="text-center text-secondary" style={{ height: "200px" }}>
|
||||||
|
No employees assigned to the project!
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -258,7 +265,10 @@ const Attendance = ({ getRole, handleModalData, searchTerm }) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-muted my-4">
|
<div
|
||||||
|
className="d-flex justify-content-center align-items-center text-muted"
|
||||||
|
style={{ height: "200px" }}
|
||||||
|
>
|
||||||
{searchTerm
|
{searchTerm
|
||||||
? "No results found for your search."
|
? "No results found for your search."
|
||||||
: attendanceList.length === 0
|
: attendanceList.length === 0
|
||||||
|
@ -245,17 +245,16 @@ const AttendanceLog = ({ handleModalData, searchTerm }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="col-md-2 m-0 text-end">
|
<div className="col-md-2 m-0 text-end">
|
||||||
<i
|
<i
|
||||||
className={`bx bx-refresh cursor-pointer fs-4 ${
|
className={`bx bx-refresh cursor-pointer fs-4 ${isFetching ? "spin" : ""
|
||||||
isFetching ? "spin" : ""
|
|
||||||
}`}
|
}`}
|
||||||
title="Refresh"
|
title="Refresh"
|
||||||
onClick={() => refetch()}
|
onClick={() => refetch()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="table-responsive text-nowrap">
|
<div className="table-responsive text-nowrap" style={{ minHeight: "200px" }}>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div>
|
<div className="d-flex justify-content-center align-items-center" style={{ height: "200px" }}>
|
||||||
<p className="text-secondary">Loading...</p>
|
<p className="text-secondary">Loading...</p>
|
||||||
</div>
|
</div>
|
||||||
) : filteredSearchData?.length > 0 ? (
|
) : filteredSearchData?.length > 0 ? (
|
||||||
@ -350,8 +349,11 @@ const AttendanceLog = ({ handleModalData, searchTerm }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{paginatedAttendances?.length == 0 && filteredSearchData?.length > 0 && (
|
{paginatedAttendances?.length == 0 && filteredSearchData?.length > 0 && (
|
||||||
<div className="my-4">
|
<div
|
||||||
<span className="text-secondary">No Pending Record Available !</span>
|
className="d-flex justify-content-center align-items-center text-secondary"
|
||||||
|
style={{ height: "200px" }}
|
||||||
|
>
|
||||||
|
No Record Available !
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{filteredSearchData.length > ITEMS_PER_PAGE && (
|
{filteredSearchData.length > ITEMS_PER_PAGE && (
|
||||||
@ -369,8 +371,7 @@ const AttendanceLog = ({ handleModalData, searchTerm }) => {
|
|||||||
(pageNumber) => (
|
(pageNumber) => (
|
||||||
<li
|
<li
|
||||||
key={pageNumber}
|
key={pageNumber}
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === pageNumber ? "active" : ""
|
||||||
currentPage === pageNumber ? "active" : ""
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@ -383,8 +384,7 @@ const AttendanceLog = ({ handleModalData, searchTerm }) => {
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
<li
|
<li
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === totalPages ? "disabled" : ""
|
||||||
currentPage === totalPages ? "disabled" : ""
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
|
@ -98,15 +98,16 @@ const CheckInCheckOut = ({ modeldata, closeModal, handleSubmitForm }) => {
|
|||||||
|
|
||||||
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 d-flex justify-content-center">
|
||||||
<label className="fs-5 text-dark text-center d-flex align-items-center flex-wrap">
|
<label className="fs-5 text-dark text-center">
|
||||||
{modeldata?.checkInTime && !modeldata?.checkOutTime
|
{modeldata?.checkInTime && !modeldata?.checkOutTime
|
||||||
? "Check-out :"
|
? "Check-out :"
|
||||||
: "Check-in :"}
|
: "Check-in :"}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-6 col-md-6 ">
|
|
||||||
|
<div className="col-6 col-md-6 text-start">
|
||||||
<label className="form-label" htmlFor="checkInDate">
|
<label className="form-label" htmlFor="checkInDate">
|
||||||
{modeldata?.checkInTime && !modeldata?.checkOutTime
|
{modeldata?.checkInTime && !modeldata?.checkOutTime
|
||||||
? "Check-out Date"
|
? "Check-out Date"
|
||||||
@ -125,7 +126,7 @@ const CheckInCheckOut = ({ modeldata, closeModal, handleSubmitForm }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-6 col-md-6">
|
<div className="col-6 col-md-6 text-start">
|
||||||
<TimePicker
|
<TimePicker
|
||||||
label="Choose a time"
|
label="Choose a time"
|
||||||
onChange={(e) => setValue("markTime", e)}
|
onChange={(e) => setValue("markTime", e)}
|
||||||
@ -138,7 +139,7 @@ const CheckInCheckOut = ({ modeldata, closeModal, handleSubmitForm }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12 text-start">
|
||||||
<label className="form-label" htmlFor="description">
|
<label className="form-label" htmlFor="description">
|
||||||
Description
|
Description
|
||||||
</label>
|
</label>
|
||||||
@ -154,19 +155,19 @@ const CheckInCheckOut = ({ modeldata, closeModal, handleSubmitForm }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-4">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-2"
|
||||||
data-bs-dismiss="modal"
|
data-bs-dismiss="modal"
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
onClick={() => closeModal()}
|
onClick={() => closeModal()}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -87,9 +87,9 @@ const Regularization = ({ handleRequest, searchTerm }) => {
|
|||||||
}, [employeeHandler]);
|
}, [employeeHandler]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="table-responsive text-nowrap pb-4">
|
<div className="table-responsive text-nowrap pb-4" style={{ minHeight: "200px" }}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="my-2">
|
<div className="d-flex justify-content-center align-items-center" style={{ height: "200px" }}>
|
||||||
<p className="text-secondary">Loading...</p>
|
<p className="text-secondary">Loading...</p>
|
||||||
</div>
|
</div>
|
||||||
) : currentItems?.length > 0 ? (
|
) : currentItems?.length > 0 ? (
|
||||||
@ -143,9 +143,14 @@ const Regularization = ({ handleRequest, searchTerm }) => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
) : (
|
) : (
|
||||||
<div className="my-4">
|
<div
|
||||||
|
className="d-flex justify-content-center align-items-center"
|
||||||
|
style={{ height: "200px" }}
|
||||||
|
>
|
||||||
<span className="text-secondary">
|
<span className="text-secondary">
|
||||||
{searchTerm ? "No results found for your search." : "No Requests Found !"}
|
{searchTerm
|
||||||
|
? "No results found for your search."
|
||||||
|
: "No Requests Found !"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -163,8 +168,7 @@ const Regularization = ({ handleRequest, searchTerm }) => {
|
|||||||
{[...Array(totalPages)].map((_, index) => (
|
{[...Array(totalPages)].map((_, index) => (
|
||||||
<li
|
<li
|
||||||
key={index}
|
key={index}
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === index + 1 ? "active" : ""
|
||||||
currentPage === index + 1 ? "active" : ""
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@ -176,8 +180,7 @@ const Regularization = ({ handleRequest, searchTerm }) => {
|
|||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
<li
|
<li
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === totalPages ? "disabled" : ""
|
||||||
currentPage === totalPages ? "disabled" : ""
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
|
@ -185,18 +185,19 @@ export const ReportTask = ({ report, closeModal }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 text-center my-2">
|
<div className="col-12 text-end my-2 mt-4">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3" disabled={isPending}>
|
|
||||||
{isPending ? "Please wait" : "Submit Report"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary" disabled={isPending}>
|
||||||
|
{isPending ? "Please wait" : "Submit Report"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,6 +10,7 @@ import { getBgClassFromHash } from "../../utils/projectStatus";
|
|||||||
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
||||||
import ImagePreview from "../common/ImagePreview";
|
import ImagePreview from "../common/ImagePreview";
|
||||||
import { useAuditStatus, useSubmitTaskComment } from "../../hooks/useTasks";
|
import { useAuditStatus, useSubmitTaskComment } from "../../hooks/useTasks";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const ReportTaskComments = ({
|
const ReportTaskComments = ({
|
||||||
commentsData,
|
commentsData,
|
||||||
@ -291,10 +292,10 @@ const ReportTaskComments = ({
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6 col-sm-4 text-center align-items-end m-0">
|
<div className="col-6 col-sm-4 text-start align-items-end m-0">
|
||||||
<label htmlFor="workStatus" className="form-label">
|
<Label htmlFor="workStatus" className="form-label" required>
|
||||||
Audit Status
|
Audit Status
|
||||||
</label>
|
</Label>
|
||||||
<select
|
<select
|
||||||
id="workStatus"
|
id="workStatus"
|
||||||
className={`form-select form-select-sm`}
|
className={`form-select form-select-sm`}
|
||||||
@ -361,7 +362,7 @@ const ReportTaskComments = ({
|
|||||||
<span>
|
<span>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-secondary"
|
className="btn btn-sm btn-label-secondary mt-5"
|
||||||
onClick={closeModal}
|
onClick={closeModal}
|
||||||
data-bs-dismiss="modal"
|
data-bs-dismiss="modal"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
@ -370,7 +371,7 @@ const ReportTaskComments = ({
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-primary ms-2"
|
className="btn btn-sm btn-primary ms-2 mt-5"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
{isPending
|
{isPending
|
||||||
|
@ -105,7 +105,7 @@ const AttendanceOverview = () => {
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="d-flex justify-content-between align-items-center mb-3">
|
<div className="d-flex justify-content-between align-items-center mb-3">
|
||||||
<div className="card-title mb-0 text-start">
|
<div className="card-title mb-0 text-start">
|
||||||
<h5 className="mb-1">Attendance Overview</h5>
|
<h5 className="mb-1 fw-bold">Attendance Overview</h5>
|
||||||
<p className="card-subtitle">Role-wise present count</p>
|
<p className="card-subtitle">Role-wise present count</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="d-flex gap-2">
|
<div className="d-flex gap-2">
|
||||||
|
@ -19,7 +19,7 @@ const ProjectCompletionChart = () => {
|
|||||||
<div className="card h-100">
|
<div className="card h-100">
|
||||||
<div className="card-header d-flex align-items-start justify-content-between">
|
<div className="card-header d-flex align-items-start justify-content-between">
|
||||||
<div className="card-title mb-0 text-start">
|
<div className="card-title mb-0 text-start">
|
||||||
<h5 className="mb-1">Projects</h5>
|
<h5 className="mb-1 fw-bold ">Projects</h5>
|
||||||
<p className="card-subtitle">Projects Completion Status</p>
|
<p className="card-subtitle">Projects Completion Status</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -90,7 +90,7 @@ const ProjectProgressChart = ({
|
|||||||
<div className="d-flex flex-wrap justify-content-between align-items-start mb-2">
|
<div className="d-flex flex-wrap justify-content-between align-items-start mb-2">
|
||||||
{/* Left: Title */}
|
{/* Left: Title */}
|
||||||
<div className="card-title text-start">
|
<div className="card-title text-start">
|
||||||
<h5 className="mb-1">Project Progress</h5>
|
<h5 className="mb-1 fw-bold">Project Progress</h5>
|
||||||
<p className="card-subtitle">Progress Overview by Project</p>
|
<p className="card-subtitle">Progress Overview by Project</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,6 +23,7 @@ import { useProjects } from "../../hooks/useProjects";
|
|||||||
import SelectMultiple from "../common/SelectMultiple";
|
import SelectMultiple from "../common/SelectMultiple";
|
||||||
import { ContactSchema } from "./DirectorySchema";
|
import { ContactSchema } from "./DirectorySchema";
|
||||||
import InputSuggestions from "../common/InputSuggestion";
|
import InputSuggestions from "../common/InputSuggestion";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const ManageDirectory = ({ submitContact, onCLosed }) => {
|
const ManageDirectory = ({ submitContact, onCLosed }) => {
|
||||||
const selectedMaster = useSelector(
|
const selectedMaster = useSelector(
|
||||||
@ -171,11 +172,11 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
<FormProvider {...methods}>
|
<FormProvider {...methods}>
|
||||||
<form className="p-2 p-sm-0" onSubmit={handleSubmit(onSubmit)}>
|
<form className="p-2 p-sm-0" onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div className="d-flex justify-content-center align-items-center">
|
<div className="d-flex justify-content-center align-items-center">
|
||||||
<h6 className="m-0 fw-18"> Create New Contact</h6>
|
<h5 className="m-0 fw-18"> Create New Contact</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-6 text-start">
|
<div className="col-md-6 text-start">
|
||||||
<label className="form-label">Name</label>
|
<Label className="form-label" required>Name</Label>
|
||||||
<input
|
<input
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
{...register("name")}
|
{...register("name")}
|
||||||
@ -186,7 +187,7 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-md-6 text-start">
|
<div className="col-md-6 text-start">
|
||||||
<label className="form-label">Organization</label>
|
<Label className="form-label" required>Organization</Label>
|
||||||
<InputSuggestions
|
<InputSuggestions
|
||||||
organizationList={organizationList}
|
organizationList={organizationList}
|
||||||
value={getValues("organization") || ""}
|
value={getValues("organization") || ""}
|
||||||
@ -197,7 +198,7 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="row mt-1">
|
<div className="row mt-1">
|
||||||
<div className="col-md-6 text-start">
|
<div className="col-md-6 text-start">
|
||||||
<label className="form-label">Designation</label>
|
<Label className="form-label" required>Designation</Label>
|
||||||
<input
|
<input
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
{...register("designation")}
|
{...register("designation")}
|
||||||
@ -431,7 +432,7 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-12 mt-1 text-start">
|
<div className="col-md-12 mt-1 text-start">
|
||||||
<label className="form-label ">Select Bucket</label>
|
<Label className="form-label" required>Select Bucket</Label>
|
||||||
|
|
||||||
<ul className="d-flex flex-wrap px-1 list-unstyled mb-0">
|
<ul className="d-flex flex-wrap px-1 list-unstyled mb-0">
|
||||||
{bucketsLoaging && <p>Loading...</p>}
|
{bucketsLoaging && <p>Loading...</p>}
|
||||||
@ -475,8 +476,8 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-start">
|
<div className="col-12 text-start mt-1">
|
||||||
<label className="form-label">Description</label>
|
<Label className="form-label" required>Description</Label>
|
||||||
<textarea
|
<textarea
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
rows="2"
|
rows="2"
|
||||||
@ -487,10 +488,7 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="d-flex justify-content-center gap-1 py-2">
|
<div className="d-flex justify-content-end gap-2 py-2 mt-3">
|
||||||
<button className="btn btn-sm btn-primary" type="submit">
|
|
||||||
{IsSubmitting ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-secondary"
|
className="btn btn-sm btn-secondary"
|
||||||
type="button"
|
type="button"
|
||||||
@ -498,6 +496,10 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button className="btn btn-sm btn-primary" type="submit">
|
||||||
|
{IsSubmitting ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
|
@ -23,6 +23,7 @@ import { useProjects } from "../../hooks/useProjects";
|
|||||||
import SelectMultiple from "../common/SelectMultiple";
|
import SelectMultiple from "../common/SelectMultiple";
|
||||||
import { ContactSchema } from "./DirectorySchema";
|
import { ContactSchema } from "./DirectorySchema";
|
||||||
import InputSuggestions from "../common/InputSuggestion";
|
import InputSuggestions from "../common/InputSuggestion";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const UpdateContact = ({ submitContact, existingContact, onCLosed }) => {
|
const UpdateContact = ({ submitContact, existingContact, onCLosed }) => {
|
||||||
const selectedMaster = useSelector(
|
const selectedMaster = useSelector(
|
||||||
@ -208,7 +209,7 @@ const UpdateContact = ({ submitContact, existingContact, onCLosed }) => {
|
|||||||
<FormProvider {...methods}>
|
<FormProvider {...methods}>
|
||||||
<form className="p-2 p-sm-0" onSubmit={handleSubmit(onSubmit)}>
|
<form className="p-2 p-sm-0" onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div className="d-flex justify-content-center align-items-center">
|
<div className="d-flex justify-content-center align-items-center">
|
||||||
<h6 className="m-0 fw-18"> Update Contact</h6>
|
<h5 className="m-0 fw-18"> Update Contact</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-6 text-start">
|
<div className="col-md-6 text-start">
|
||||||
@ -239,7 +240,7 @@ const UpdateContact = ({ submitContact, existingContact, onCLosed }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="row mt-1">
|
<div className="row mt-1">
|
||||||
<div className="col-md-6 text-start">
|
<div className="col-md-6 text-start">
|
||||||
<label className="form-label">Designation</label>
|
<Label className="form-label" required>Designation</Label>
|
||||||
<input
|
<input
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
{...register("designation")}
|
{...register("designation")}
|
||||||
@ -529,7 +530,15 @@ const UpdateContact = ({ submitContact, existingContact, onCLosed }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="d-flex justify-content-center gap-1 py-2">
|
<div className="d-flex justify-content-end gap-2 py-0 mt-4">
|
||||||
|
<button
|
||||||
|
className="btn btn-sm btn-label-secondary"
|
||||||
|
type="button"
|
||||||
|
onClick={handleClosed}
|
||||||
|
disabled={IsSubmitting}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-primary"
|
className="btn btn-sm btn-primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
@ -537,14 +546,6 @@ const UpdateContact = ({ submitContact, existingContact, onCLosed }) => {
|
|||||||
>
|
>
|
||||||
{IsSubmitting ? "Please Wait..." : "Update"}
|
{IsSubmitting ? "Please Wait..." : "Update"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
className="btn btn-sm btn-secondary"
|
|
||||||
type="button"
|
|
||||||
onClick={handleClosed}
|
|
||||||
disabled={IsSubmitting}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
|
@ -17,6 +17,8 @@ import {
|
|||||||
} from "../../slices/apiDataManager";
|
} from "../../slices/apiDataManager";
|
||||||
import { clearApiCacheKey } from "../../slices/apiCacheSlice";
|
import { clearApiCacheKey } from "../../slices/apiCacheSlice";
|
||||||
import { useMutation } from "@tanstack/react-query";
|
import { useMutation } from "@tanstack/react-query";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
import DatePicker from "../common/DatePicker";
|
||||||
|
|
||||||
const mobileNumberRegex = /^[0-9]\d{9}$/;
|
const mobileNumberRegex = /^[0-9]\d{9}$/;
|
||||||
|
|
||||||
@ -220,10 +222,10 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<form onSubmit={handleSubmit(onSubmit)} className="p-sm-0 p-2">
|
<form onSubmit={handleSubmit(onSubmit)} className="p-sm-0 p-2">
|
||||||
<div className="text-center"><p className="fs-6 fw-semibold"> {employee ? "Update Employee" : "Create Employee"}</p> </div>
|
<div className="text-center"><p className="fs-5 fw-semibold"> {employee ? "Update Employee" : "Create Employee"}</p> </div>
|
||||||
<div className="row mb-3">
|
<div className="row mb-3">
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">First Name</div>
|
<Label className="form-text text-start" required>First Name</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="firstName"
|
name="firstName"
|
||||||
@ -272,7 +274,7 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">Last Name</div>
|
<Label className="form-text text-start" required>Last Name</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("lastName", {
|
{...register("lastName", {
|
||||||
@ -319,7 +321,7 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<div className="form-text text-start">Phone Number</div>
|
<Label className="form-text text-start" required>Phone Number</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
@ -343,7 +345,7 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
<div className="row mb-3"></div>
|
<div className="row mb-3"></div>
|
||||||
<div className="row mb-3">
|
<div className="row mb-3">
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">Gender</div>
|
<Label className="form-text text-start" required>Gender</Label>
|
||||||
|
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<select
|
<select
|
||||||
@ -370,41 +372,43 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">Birth Date</div>
|
<Label className="form-text text-start" required>
|
||||||
|
Birth Date
|
||||||
|
</Label>
|
||||||
|
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<input
|
<DatePicker
|
||||||
className="form-control form-control-sm"
|
name="birthDate"
|
||||||
type="date"
|
control={control} // from useForm()
|
||||||
{...register("birthDate")}
|
placeholder="DD-MM-YYYY"
|
||||||
id="birthDate"
|
maxDate={new Date()} // restrict future dates (e.g., birth date must be today or past)
|
||||||
|
className="w-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{errors.birthDate && (
|
{errors.birthDate && (
|
||||||
<div
|
<div className="danger-text text-start" style={{ fontSize: "12px" }}>
|
||||||
className="danger-text text-start"
|
|
||||||
style={{ fontSize: "12px" }}
|
|
||||||
>
|
|
||||||
{errors.birthDate.message}
|
{errors.birthDate.message}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">Joining Date</div>
|
<Label className="form-text text-start" required>
|
||||||
|
Joining Date
|
||||||
|
</Label>
|
||||||
|
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<input
|
<DatePicker
|
||||||
className="form-control form-control-sm"
|
name="joiningDate"
|
||||||
type="date"
|
control={control} // from useForm()
|
||||||
{...register("joiningDate")}
|
placeholder="DD-MM-YYYY"
|
||||||
id="joiningDate"
|
// For joining date, we don’t block future dates
|
||||||
|
className="w-100"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{errors.joiningDate && (
|
{errors.joiningDate && (
|
||||||
<div
|
<div className="danger-text text-start" style={{ fontSize: "12px" }}>
|
||||||
className="danger-text text-start"
|
|
||||||
style={{ fontSize: "12px" }}
|
|
||||||
>
|
|
||||||
{errors.joiningDate.message}
|
{errors.joiningDate.message}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -412,7 +416,7 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="row mb-3">
|
<div className="row mb-3">
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<div className="form-text text-start">Current Address</div>
|
<Label className="form-text text-start" required>Current Address</Label>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
id="currentAddress"
|
id="currentAddress"
|
||||||
@ -444,9 +448,9 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<div className="form-text text-start">
|
<Label className="form-text text-start" required>
|
||||||
Permanent Address
|
Permanent Address
|
||||||
</div>
|
</Label>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
id="permanentAddress"
|
id="permanentAddress"
|
||||||
@ -484,7 +488,7 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="row mb-3">
|
<div className="row mb-3">
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">Official Designation</div>
|
<Label className="form-text text-start" required>Official Designation</Label>
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
@ -514,9 +518,9 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">
|
<Label className="form-text text-start" required>
|
||||||
Emergency Contact Person
|
Emergency Contact Person
|
||||||
</div>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("emergencyContactPerson")}
|
{...register("emergencyContactPerson")}
|
||||||
@ -535,9 +539,9 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-4">
|
<div className="col-sm-4">
|
||||||
<div className="form-text text-start">
|
<Label className="form-text text-start" required>
|
||||||
Emergency Phone Number
|
Emergency Phone Number
|
||||||
</div>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("emergencyPhoneNumber")}
|
{...register("emergencyPhoneNumber")}
|
||||||
@ -606,8 +610,16 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="row justify-content-start">
|
<div className="row text-end">
|
||||||
<div className="col-sm-12">
|
<div className="col-sm-12">
|
||||||
|
<button
|
||||||
|
aria-label="manage employee"
|
||||||
|
type="reset"
|
||||||
|
className="btn btn-sm btn-label-secondary me-2"
|
||||||
|
disabled={isPending}
|
||||||
|
>
|
||||||
|
Clear
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-label="manage employee"
|
aria-label="manage employee"
|
||||||
type="submit"
|
type="submit"
|
||||||
@ -621,14 +633,7 @@ const ManageEmployee = ({ employeeId, onClosed, IsAllEmployee }) => {
|
|||||||
: "Create"}
|
: "Create"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
|
||||||
aria-label="manage employee"
|
|
||||||
type="reset"
|
|
||||||
className="btn btn-sm btn-secondary ms-2"
|
|
||||||
disabled={isPending}
|
|
||||||
>
|
|
||||||
Clear
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -114,7 +114,7 @@ const ManageRole = ( {employeeId, onClosed} ) =>
|
|||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit(onSubmit)}>
|
<form onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div className="text-start mb-3">
|
<div className="text-start mb-3">
|
||||||
<p className="lead">Select Roles</p>
|
<h5 className="lead">Select Roles :</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isLoadingData ? (
|
{isLoadingData ? (
|
||||||
@ -148,18 +148,18 @@ const ManageRole = ( {employeeId, onClosed} ) =>
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="text-center mt-3">
|
<div className="text-end mt-1">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3" disabled={isLoading}>
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-2"
|
||||||
data-bs-dismiss="modal"
|
data-bs-dismiss="modal"
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary" disabled={isLoading}>
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -27,6 +27,7 @@ import ExpenseSkeleton from "./ExpenseSkeleton";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import DatePicker from "../common/DatePicker";
|
import DatePicker from "../common/DatePicker";
|
||||||
import ErrorPage from "../../pages/ErrorPage";
|
import ErrorPage from "../../pages/ErrorPage";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
||||||
const {
|
const {
|
||||||
@ -213,9 +214,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
{expenseToEdit ? "Update Expense " : "Create New Expense"}
|
{expenseToEdit ? "Update Expense " : "Create New Expense"}
|
||||||
</h5>
|
</h5>
|
||||||
<form id="expenseForm" onSubmit={handleSubmit(onSubmit)}>
|
<form id="expenseForm" onSubmit={handleSubmit(onSubmit)}>
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label className="form-label">Select Project</label>
|
<Label className="form-label" required>Select Project</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
{...register("projectId")}
|
{...register("projectId")}
|
||||||
@ -237,9 +238,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="expensesTypeId" className="form-label">
|
<Label htmlFor="expensesTypeId" className="form-label" required>
|
||||||
Expense Type
|
Expense Type
|
||||||
</label>
|
</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
id="expensesTypeId"
|
id="expensesTypeId"
|
||||||
@ -266,11 +267,11 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="paymentModeId" className="form-label">
|
<Label htmlFor="paymentModeId" className="form-label" required>
|
||||||
Payment Mode
|
Payment Mode
|
||||||
</label>
|
</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
id="paymentModeId"
|
id="paymentModeId"
|
||||||
@ -297,9 +298,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="paidById" className="form-label ">
|
<Label htmlFor="paidById" className="form-label" required>
|
||||||
Paid By
|
Paid By
|
||||||
</label>
|
</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
id="paymentModeId"
|
id="paymentModeId"
|
||||||
@ -325,11 +326,11 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="transactionDate" className="form-label ">
|
<Label htmlFor="transactionDate" className="form-label" required>
|
||||||
Transaction Date
|
Transaction Date
|
||||||
</label>
|
</Label>
|
||||||
<DatePicker name="transactionDate" control={control} />
|
<DatePicker name="transactionDate" control={control} />
|
||||||
|
|
||||||
{errors.transactionDate && (
|
{errors.transactionDate && (
|
||||||
@ -340,9 +341,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="amount" className="form-label ">
|
<Label htmlFor="amount" className="form-label" required>
|
||||||
Amount
|
Amount
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
id="amount"
|
id="amount"
|
||||||
@ -358,11 +359,11 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="supplerName" className="form-label ">
|
<Label htmlFor="supplerName" className="form-label" required>
|
||||||
Supplier Name/Transporter Name/Other
|
Supplier Name/Transporter Name/Other
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="supplerName"
|
id="supplerName"
|
||||||
@ -377,9 +378,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="location" className="form-label ">
|
<Label htmlFor="location" className="form-label" required>
|
||||||
Location
|
Location
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="location"
|
id="location"
|
||||||
@ -391,7 +392,7 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<label htmlFor="statusId" className="form-label ">
|
<label htmlFor="statusId" className="form-label ">
|
||||||
Transaction ID
|
Transaction ID
|
||||||
@ -428,7 +429,7 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{ExpenseType?.noOfPersonsRequired && (
|
{ExpenseType?.noOfPersonsRequired && (
|
||||||
<div className="col-md-6 mt-2">
|
<div className="col-md-6 mt-2 text-start">
|
||||||
<label className="form-label ">No. of Persons</label>
|
<label className="form-label ">No. of Persons</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@ -446,9 +447,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-12">
|
<div className="col-md-12">
|
||||||
<label htmlFor="description" className="form-label ">Description</label>
|
<Label htmlFor="description" className="form-label" required>Description</Label>
|
||||||
<textarea
|
<textarea
|
||||||
id="description"
|
id="description"
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -463,9 +464,9 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row my-2">
|
<div className="row my-2 text-start">
|
||||||
<div className="col-md-12">
|
<div className="col-md-12">
|
||||||
<label className="form-label ">Upload Bill </label>
|
<Label className="form-label" required>Upload Bill </Label>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="border border-secondary border-dashed rounded p-4 text-center bg-textMuted position-relative"
|
className="border border-secondary border-dashed rounded p-4 text-center bg-textMuted position-relative"
|
||||||
@ -547,8 +548,16 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="d-flex justify-content-center gap-3">
|
<div className="d-flex justify-content-end gap-3">
|
||||||
{" "}
|
{" "}
|
||||||
|
<button
|
||||||
|
type="reset"
|
||||||
|
disabled={isPending || createPending}
|
||||||
|
onClick={handleClose}
|
||||||
|
className="btn btn-label-secondary btn-sm mt-3"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-primary btn-sm mt-3"
|
className="btn btn-primary btn-sm mt-3"
|
||||||
@ -560,14 +569,7 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
|
|||||||
? "Update"
|
? "Update"
|
||||||
: "Submit"}
|
: "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="reset"
|
|
||||||
disabled={isPending || createPending}
|
|
||||||
onClick={handleClose}
|
|
||||||
className="btn btn-secondary btn-sm mt-3"
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,6 +28,7 @@ import EmployeeSearchInput from "../common/EmployeeSearchInput";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import ExpenseStatusLogs from "./ExpenseStatusLogs";
|
import ExpenseStatusLogs from "./ExpenseStatusLogs";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const ViewExpense = ({ ExpenseId }) => {
|
const ViewExpense = ({ ExpenseId }) => {
|
||||||
const { data, isLoading, isError, error, isFetching } = useExpense(ExpenseId);
|
const { data, isLoading, isError, error, isFetching } = useExpense(ExpenseId);
|
||||||
@ -418,7 +419,7 @@ const ViewExpense = ({ ExpenseId }) => {
|
|||||||
{((nextStatusWithPermission.length > 0 && !IsRejectedExpense) ||
|
{((nextStatusWithPermission.length > 0 && !IsRejectedExpense) ||
|
||||||
(IsRejectedExpense && isCreatedBy)) && (
|
(IsRejectedExpense && isCreatedBy)) && (
|
||||||
<>
|
<>
|
||||||
<label className="form-label me-2 mb-0">Comment:</label>
|
<Label className="form-label me-2 mb-0" required>Comment</Label>
|
||||||
<textarea
|
<textarea
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
{...register("comment")}
|
{...register("comment")}
|
||||||
@ -434,7 +435,7 @@ const ViewExpense = ({ ExpenseId }) => {
|
|||||||
|
|
||||||
{nextStatusWithPermission?.length > 0 &&
|
{nextStatusWithPermission?.length > 0 &&
|
||||||
(!IsRejectedExpense || isCreatedBy) && (
|
(!IsRejectedExpense || isCreatedBy) && (
|
||||||
<div className="text-center flex-wrap gap-2 my-2">
|
<div className="text-end flex-wrap gap-2 my-2 mt-3">
|
||||||
{nextStatusWithPermission.map((status, index) => (
|
{nextStatusWithPermission.map((status, index) => (
|
||||||
<button
|
<button
|
||||||
key={status.id || index}
|
key={status.id || index}
|
||||||
|
@ -51,13 +51,13 @@ const AboutProject = () => {
|
|||||||
)}
|
)}
|
||||||
{projects_Details && (
|
{projects_Details && (
|
||||||
<>
|
<>
|
||||||
<div className="card mb-6">
|
<div className="card mb-4">
|
||||||
<div className="card-header text-start">
|
<div className="card-header text-start">
|
||||||
<h6 className="card-action-title mb-0 ps-1">
|
<h5 className="card-action-title mb-0 ps-1">
|
||||||
{" "}
|
{" "}
|
||||||
<i className="fa fa-building rounded-circle text-primary"></i>
|
<i className="fa fa-building rounded-circle text-primary"></i>
|
||||||
<span className="ms-2">Project Profile</span>
|
<span className="ms-2 fw-bold">Project Profile</span>
|
||||||
</h6>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<ul className="list-unstyled my-3 ps-0">
|
<ul className="list-unstyled my-3 ps-0">
|
||||||
|
@ -12,6 +12,7 @@ import showToast from "../../services/toastService";
|
|||||||
import { useProjectDetails } from "../../hooks/useProjects";
|
import { useProjectDetails } from "../../hooks/useProjects";
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
import { useCreateTask } from "../../hooks/useTasks";
|
import { useCreateTask } from "../../hooks/useTasks";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
||||||
const maxPlanned =
|
const maxPlanned =
|
||||||
@ -502,8 +503,11 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
|||||||
<div className="col-md text-start mx-0 px-0">
|
<div className="col-md text-start mx-0 px-0">
|
||||||
<div className="form-check form-check-inline mt-2 px-1 mb-2 text-start">
|
<div className="form-check form-check-inline mt-2 px-1 mb-2 text-start">
|
||||||
<label className="text-dark d-flex align-items-center flex-wrap form-text">
|
<label className="text-dark d-flex align-items-center flex-wrap form-text">
|
||||||
<span>Target for Today</span>
|
<Label htmlFor="targetToday" required className="me-1">
|
||||||
<span style={{ marginLeft: "46px" }}>:</span>
|
Target for Today
|
||||||
|
</Label>
|
||||||
|
|
||||||
|
<span style={{ marginLeft: "37px" }}>:</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@ -533,12 +537,16 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label
|
{/* <label
|
||||||
className="form-text fs-7 m-1 text-lg text-dark"
|
className="form-text fs-7 m-1 text-lg text-dark"
|
||||||
htmlFor="descriptionTextarea" // Changed htmlFor for better accessibility
|
htmlFor="descriptionTextarea" // Changed htmlFor for better accessibility
|
||||||
>
|
>
|
||||||
Description
|
Description
|
||||||
</label>
|
</label> */}
|
||||||
|
<Label className="form-text fs-7 m-1 text-lg text-dark"
|
||||||
|
htmlFor="descriptionTextarea" required>
|
||||||
|
Description
|
||||||
|
</Label>
|
||||||
<Controller
|
<Controller
|
||||||
name="description"
|
name="description"
|
||||||
control={control}
|
control={control}
|
||||||
@ -552,14 +560,7 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Submit and Cancel buttons */}
|
{/* Submit and Cancel buttons */}
|
||||||
<div className="col-12 d-flex justify-content-center align-items-center gap-sm-6 gap-8 text-center mt-1">
|
<div className="col-12 d-flex justify-content-end align-items-center gap-2 mt-6">
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="btn btn-sm btn-primary "
|
|
||||||
disabled={isSubmitting || loading}
|
|
||||||
>
|
|
||||||
{isSubmitting ? "Please Wait" : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
@ -570,7 +571,15 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-sm btn-primary"
|
||||||
|
disabled={isSubmitting || loading}
|
||||||
|
>
|
||||||
|
{isSubmitting ? "Please Wait" : "Submit"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,7 @@ import { getCachedData } from "../../../slices/apiDataManager";
|
|||||||
import showToast from "../../../services/toastService";
|
import showToast from "../../../services/toastService";
|
||||||
import { useManageProjectInfra } from "../../../hooks/useProjects";
|
import { useManageProjectInfra } from "../../../hooks/useProjects";
|
||||||
import useSelect from "../../common/useSelect";
|
import useSelect from "../../common/useSelect";
|
||||||
|
import Label from "../../common/Label";
|
||||||
|
|
||||||
const buildingSchema = z.object({
|
const buildingSchema = z.object({
|
||||||
Id: z.string().optional(),
|
Id: z.string().optional(),
|
||||||
@ -100,7 +101,7 @@ const BuildingModel = ({ project, onClose, editingBuilding = null }) => {
|
|||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit(onSubmitHandler)} className="row g-2">
|
<form onSubmit={handleSubmit(onSubmitHandler)} className="row g-2">
|
||||||
<h5 className="text-center mb-2">Manage Buildings </h5>
|
<h5 className="text-center mb-2">Manage Buildings </h5>
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Building</label>
|
<label className="form-label">Select Building</label>
|
||||||
<select
|
<select
|
||||||
{...register("Id")}
|
{...register("Id")}
|
||||||
@ -121,10 +122,10 @@ const BuildingModel = ({ project, onClose, editingBuilding = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Name */}
|
{/* Name */}
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">
|
<Label className="form-label" required>
|
||||||
{watchedId !== "0" ? "Rename Building Name" : "New Building Name"}
|
{watchedId !== "0" ? "Rename Building Name" : "New Building Name"}
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
{...register("name")}
|
{...register("name")}
|
||||||
type="text"
|
type="text"
|
||||||
@ -136,8 +137,8 @@ const BuildingModel = ({ project, onClose, editingBuilding = null }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Description</label>
|
<Label className="form-label" required>Description</Label>
|
||||||
<textarea
|
<textarea
|
||||||
{...register("description")}
|
{...register("description")}
|
||||||
rows="5"
|
rows="5"
|
||||||
@ -149,10 +150,21 @@ const BuildingModel = ({ project, onClose, editingBuilding = null }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-5">
|
||||||
|
<button
|
||||||
|
type="reset"
|
||||||
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
|
disabled={isPending}
|
||||||
|
onClick={() => {
|
||||||
|
onClose();
|
||||||
|
reset();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-primary me-3"
|
className="btn btn-sm btn-primary"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
{isPending
|
{isPending
|
||||||
@ -162,17 +174,7 @@ const BuildingModel = ({ project, onClose, editingBuilding = null }) => {
|
|||||||
: "Add Building"}
|
: "Add Building"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
|
||||||
type="reset"
|
|
||||||
className="btn btn-sm btn-label-secondary"
|
|
||||||
disabled={isPending}
|
|
||||||
onClick={() => {
|
|
||||||
onClose();
|
|
||||||
reset();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -134,7 +134,7 @@ useEffect(() => {
|
|||||||
<h5 className="mb-1">Manage Task</h5>
|
<h5 className="mb-1">Manage Task</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row g-2">
|
<div className="row g-2 text-start">
|
||||||
<div className="col-12 col-md-6">
|
<div className="col-12 col-md-6">
|
||||||
<label className="form-label">Select Building</label>
|
<label className="form-label">Select Building</label>
|
||||||
<input
|
<input
|
||||||
@ -154,7 +154,7 @@ useEffect(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Work Area</label>
|
<label className="form-label">Select Work Area</label>
|
||||||
<input
|
<input
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -163,7 +163,7 @@ useEffect(() => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Activity</label>
|
<label className="form-label">Select Activity</label>
|
||||||
<select
|
<select
|
||||||
{...register("activityID")}
|
{...register("activityID")}
|
||||||
@ -185,7 +185,7 @@ useEffect(() => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Work Category</label>
|
<label className="form-label">Select Work Category</label>
|
||||||
<select
|
<select
|
||||||
{...register("workCategoryId")}
|
{...register("workCategoryId")}
|
||||||
@ -207,7 +207,7 @@ useEffect(() => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-5">
|
<div className="col-5 text-start">
|
||||||
<label className="form-label">Planned Work</label>
|
<label className="form-label">Planned Work</label>
|
||||||
<input
|
<input
|
||||||
{...register("plannedWork", { valueAsNumber: true })}
|
{...register("plannedWork", { valueAsNumber: true })}
|
||||||
@ -219,7 +219,7 @@ useEffect(() => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-5">
|
<div className="col-5 text-start">
|
||||||
<label className="form-label">Completed Work</label>
|
<label className="form-label">Completed Work</label>
|
||||||
<input
|
<input
|
||||||
{...register("completedWork", { valueAsNumber: true })}
|
{...register("completedWork", { valueAsNumber: true })}
|
||||||
@ -232,7 +232,7 @@ useEffect(() => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-2">
|
<div className="col-2 text-start">
|
||||||
<label className="form-label">Unit</label>
|
<label className="form-label">Unit</label>
|
||||||
<input
|
<input
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -241,7 +241,7 @@ useEffect(() => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Comment</label>
|
<label className="form-label">Comment</label>
|
||||||
<textarea {...register("comment")} rows="2" className="form-control" />
|
<textarea {...register("comment")} rows="2" className="form-control" />
|
||||||
{errors.comment && (
|
{errors.comment && (
|
||||||
@ -249,22 +249,22 @@ useEffect(() => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-5">
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="btn btn-sm btn-primary me-2"
|
|
||||||
disabled={isPending}
|
|
||||||
>
|
|
||||||
{isPending ? "Please Wait..." : "Edit Task"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-2"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-sm btn-primary"
|
||||||
|
disabled={isPending}
|
||||||
|
>
|
||||||
|
{isPending ? "Please Wait..." : "Edit Task"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -5,6 +5,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import showToast from "../../../services/toastService";
|
import showToast from "../../../services/toastService";
|
||||||
import { useManageProjectInfra } from "../../../hooks/useProjects";
|
import { useManageProjectInfra } from "../../../hooks/useProjects";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import Label from "../../common/Label";
|
||||||
|
|
||||||
// Schema
|
// Schema
|
||||||
const floorSchema = z.object({
|
const floorSchema = z.object({
|
||||||
@ -101,8 +102,8 @@ const FloorModel = ({ project, onClose, onSubmit }) => {
|
|||||||
<div className="text-center mb-1">
|
<div className="text-center mb-1">
|
||||||
<h5 className="mb-1">Manage Floor</h5>
|
<h5 className="mb-1">Manage Floor</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Building</label>
|
<Label className="form-label" required>Select Building</Label>
|
||||||
<select
|
<select
|
||||||
{...register("buildingId")}
|
{...register("buildingId")}
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
@ -126,7 +127,7 @@ const FloorModel = ({ project, onClose, onSubmit }) => {
|
|||||||
|
|
||||||
{watchBuildingId !== "0" && (
|
{watchBuildingId !== "0" && (
|
||||||
<>
|
<>
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Floor</label>
|
<label className="form-label">Select Floor</label>
|
||||||
<select
|
<select
|
||||||
{...register("id")}
|
{...register("id")}
|
||||||
@ -146,10 +147,10 @@ const FloorModel = ({ project, onClose, onSubmit }) => {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">
|
<Label className="form-label" required>
|
||||||
{watchId !== "0" ? "Edit Floor Name" : "New Floor Name"}
|
{watchId !== "0" ? "Edit Floor Name" : "New Floor Name"}
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
{...register("floorName")}
|
{...register("floorName")}
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -162,10 +163,18 @@ const FloorModel = ({ project, onClose, onSubmit }) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-5">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
|
disabled={isPending}
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-primary me-3"
|
className="btn btn-sm btn-primary"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
{isPending
|
{isPending
|
||||||
@ -174,14 +183,7 @@ const FloorModel = ({ project, onClose, onSubmit }) => {
|
|||||||
? "Edit Floor"
|
? "Edit Floor"
|
||||||
: "Add Floor"}
|
: "Add Floor"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-sm btn-label-secondary"
|
|
||||||
disabled={isPending}
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
} from "../../../hooks/masterHook/useMaster";
|
} from "../../../hooks/masterHook/useMaster";
|
||||||
import { useManageTask } from "../../../hooks/useProjects";
|
import { useManageTask } from "../../../hooks/useProjects";
|
||||||
import showToast from "../../../services/toastService";
|
import showToast from "../../../services/toastService";
|
||||||
|
import Label from "../../common/Label";
|
||||||
|
|
||||||
const taskSchema = z.object({
|
const taskSchema = z.object({
|
||||||
buildingID: z.string().min(1, "Building is required"),
|
buildingID: z.string().min(1, "Building is required"),
|
||||||
@ -106,8 +107,8 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
<div className="text-center mb-1">
|
<div className="text-center mb-1">
|
||||||
<h5 className="mb-1">Manage Task</h5>
|
<h5 className="mb-1">Manage Task</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-6">
|
<div className="col-6 text-start">
|
||||||
<label className="form-label">Select Building</label>
|
<Label className="form-label" required>Select Building</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
{...register("buildingID")}
|
{...register("buildingID")}
|
||||||
@ -128,8 +129,8 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{selectedBuilding && (
|
{selectedBuilding && (
|
||||||
<div className="col-6">
|
<div className="col-6 text-start">
|
||||||
<label className="form-label">Select Floor</label>
|
<Label className="form-label" required>Select Floor</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
{...register("floorId")}
|
{...register("floorId")}
|
||||||
@ -150,8 +151,8 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{selectedFloor && (
|
{selectedFloor && (
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Work Area</label>
|
<Label className="form-label" required>Select Work Area</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
{...register("workAreaId")}
|
{...register("workAreaId")}
|
||||||
@ -172,8 +173,8 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{selectedWorkArea && (
|
{selectedWorkArea && (
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Activity</label>
|
<Label className="form-label" required>Select Activity</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
{...register("activityID")}
|
{...register("activityID")}
|
||||||
@ -192,7 +193,7 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{selectedWorkArea && (
|
{selectedWorkArea && (
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Work Category</label>
|
<label className="form-label">Select Work Category</label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
@ -212,8 +213,8 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
|
|
||||||
{selectedActivity && selectedCategory && (
|
{selectedActivity && selectedCategory && (
|
||||||
<>
|
<>
|
||||||
<div className="col-5">
|
<div className="col-5 text-start">
|
||||||
<label className="form-label">Planned Work</label>
|
<Label className="form-label" required>Planned Work</Label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -223,7 +224,7 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
<p className="danger-text">{errors.plannedWork.message}</p>
|
<p className="danger-text">{errors.plannedWork.message}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-5">
|
<div className="col-5 text-start">
|
||||||
<label className="form-label">Completed Work</label>
|
<label className="form-label">Completed Work</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
@ -234,7 +235,7 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
<p className="danger-text">{errors.completedWork.message}</p>
|
<p className="danger-text">{errors.completedWork.message}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-2">
|
<div className="col-2 text-start">
|
||||||
<label className="form-label">Unit</label>
|
<label className="form-label">Unit</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@ -247,7 +248,7 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{selectedActivity && selectedCategory && (
|
{selectedActivity && selectedCategory && (
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Comment</label>
|
<label className="form-label">Comment</label>
|
||||||
<textarea
|
<textarea
|
||||||
className="form-control"
|
className="form-control"
|
||||||
@ -260,21 +261,21 @@ const TaskModel = ({ project, onSubmit, onClose }) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-5">
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="btn btn-sm btn-primary me-3"
|
|
||||||
disabled={isSubmitting}
|
|
||||||
>
|
|
||||||
{isSubmitting ? "Please Wait..." : "Add Task"}
|
|
||||||
</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"
|
||||||
|
disabled={isSubmitting}
|
||||||
|
>
|
||||||
|
{isSubmitting ? "Please Wait..." : "Add Task"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -5,6 +5,7 @@ import { z } from "zod";
|
|||||||
import showToast from "../../../services/toastService";
|
import showToast from "../../../services/toastService";
|
||||||
import { useManageProjectInfra } from "../../../hooks/useProjects";
|
import { useManageProjectInfra } from "../../../hooks/useProjects";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import Label from "../../common/Label";
|
||||||
|
|
||||||
const workAreaSchema = z.object({
|
const workAreaSchema = z.object({
|
||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
@ -84,8 +85,7 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
|||||||
reset(defaultModel);
|
reset(defaultModel);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onSubmitForm = ( data ) =>
|
const onSubmitForm = (data) => {
|
||||||
{
|
|
||||||
const payload = {
|
const payload = {
|
||||||
id: data.id === "0" ? null : data.id,
|
id: data.id === "0" ? null : data.id,
|
||||||
areaName: data.areaName,
|
areaName: data.areaName,
|
||||||
@ -108,8 +108,8 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
|||||||
<div className="text-center mb-1">
|
<div className="text-center mb-1">
|
||||||
<h5 className="mb-1">Manage Work Area</h5>
|
<h5 className="mb-1">Manage Work Area</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 col-sm-6">
|
<div className="col-12 col-sm-6 text-start">
|
||||||
<label className="form-label">Select Building</label>
|
<Label className="form-label" required>Select Building</Label>
|
||||||
<select
|
<select
|
||||||
{...register("buildingId")}
|
{...register("buildingId")}
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
@ -127,8 +127,8 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{watchBuildingId !== "0" && (
|
{watchBuildingId !== "0" && (
|
||||||
<div className="col-12 col-sm-6">
|
<div className="col-12 col-sm-6 text-start">
|
||||||
<label className="form-label">Select Floor</label>
|
<Label className="form-label" required>Select Floor</Label>
|
||||||
<select
|
<select
|
||||||
{...register("floorId")}
|
{...register("floorId")}
|
||||||
className="form-select form-select-sm"
|
className="form-select form-select-sm"
|
||||||
@ -152,7 +152,7 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
{watchFloorId !== "0" && (
|
{watchFloorId !== "0" && (
|
||||||
<>
|
<>
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">Select Work Area</label>
|
<label className="form-label">Select Work Area</label>
|
||||||
<select
|
<select
|
||||||
{...register("id")}
|
{...register("id")}
|
||||||
@ -169,12 +169,12 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label">
|
<Label className="form-label" required>
|
||||||
{watchWorkAreaId === "0"
|
{watchWorkAreaId === "0"
|
||||||
? "Enter Work Area Name"
|
? "Enter Work Area Name"
|
||||||
: "Edit Work Area Name"}
|
: "Edit Work Area Name"}
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="form-control form-control-sm"
|
className="form-control form-control-sm"
|
||||||
@ -187,13 +187,14 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-5">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3" disabled={isPending}>
|
<button type="button" className="btn btn-sm btn-label-secondary me-3" disabled={isPending} onClick={onClose}>
|
||||||
{isPending ? "Please Wait.." : watchWorkAreaId === "0" ? "Add Work Area" : "Update Work Area"}
|
|
||||||
</button>
|
|
||||||
<button type="button" className="btn btn-sm btn-label-secondary" disabled={isPending} onClick={onClose}>
|
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary" disabled={isPending}>
|
||||||
|
{isPending ? "Please Wait.." : watchWorkAreaId === "0" ? "Add Work Area" : "Update Work Area"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -2,6 +2,8 @@ import React, { useEffect, useState } from "react";
|
|||||||
import { useForm, Controller } from "react-hook-form";
|
import { useForm, Controller } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
import DatePicker from "../common/DatePicker";
|
||||||
|
|
||||||
const currentDate = new Date().toLocaleDateString('en-CA');
|
const currentDate = new Date().toLocaleDateString('en-CA');
|
||||||
const formatDate = (date) => {
|
const formatDate = (date) => {
|
||||||
@ -115,8 +117,7 @@ const DEFAULT_EMPTY_STATUS_ID = "00000000-0000-0000-0000-000000000000";
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const onSubmitForm = ( updatedProject ) =>
|
const onSubmitForm = (updatedProject) => {
|
||||||
{
|
|
||||||
|
|
||||||
handleSubmitForm(updatedProject);
|
handleSubmitForm(updatedProject);
|
||||||
};
|
};
|
||||||
@ -144,11 +145,11 @@ const DEFAULT_EMPTY_STATUS_ID = "00000000-0000-0000-0000-000000000000";
|
|||||||
{project?.id ? "Edit Project" : "Create Project"}
|
{project?.id ? "Edit Project" : "Create Project"}
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<form className="row g-2" onSubmit={handleSubmit(onSubmitForm)}>
|
<form className="row g-2 text-start" onSubmit={handleSubmit(onSubmitForm)}>
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12">
|
||||||
<label className="form-label" htmlFor="name">
|
<Label htmlFor="name" required>
|
||||||
Project Name
|
Project Name
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="name"
|
id="name"
|
||||||
@ -188,9 +189,9 @@ const DEFAULT_EMPTY_STATUS_ID = "00000000-0000-0000-0000-000000000000";
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12">
|
||||||
<label className="form-label" htmlFor="contactPerson">
|
<Label htmlFor="contactPerson" required>
|
||||||
Contact Person
|
Contact Person
|
||||||
</label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="contactPerson"
|
id="contactPerson"
|
||||||
@ -214,42 +215,42 @@ const DEFAULT_EMPTY_STATUS_ID = "00000000-0000-0000-0000-000000000000";
|
|||||||
<label className="form-label" htmlFor="startDate">
|
<label className="form-label" htmlFor="startDate">
|
||||||
Start Date
|
Start Date
|
||||||
</label>
|
</label>
|
||||||
<input
|
|
||||||
className="form-control form-control-sm"
|
<DatePicker
|
||||||
type="date"
|
|
||||||
name="startDate"
|
name="startDate"
|
||||||
{...register("startDate")}
|
control={control}
|
||||||
id="startDate"
|
placeholder="DD-MM-YYYY"
|
||||||
|
maxDate={new Date()} // optional: restrict future dates
|
||||||
|
className="w-100"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{errors.startDate && (
|
{errors.startDate && (
|
||||||
<div
|
<div className="danger-text text-start" style={{ fontSize: "12px" }}>
|
||||||
className="danger-text text-start"
|
|
||||||
style={{ fontSize: "12px" }}
|
|
||||||
>
|
|
||||||
{errors.startDate.message}
|
{errors.startDate.message}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 col-md-6">
|
<div className="col-12 col-md-6">
|
||||||
<label className="form-label" htmlFor="endDate">
|
<label className="form-label" htmlFor="endDate">
|
||||||
End Date
|
End Date
|
||||||
</label>
|
</label>
|
||||||
<input
|
|
||||||
className="form-control form-control-sm"
|
<DatePicker
|
||||||
type="date"
|
|
||||||
name="endDate"
|
name="endDate"
|
||||||
{...register("endDate")}
|
control={control}
|
||||||
id="endDate"
|
placeholder="DD-MM-YYYY"
|
||||||
|
minDate={getValues("startDate")} // optional: restrict future dates
|
||||||
|
className="w-100"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{errors.endDate && (
|
{errors.endDate && (
|
||||||
<div
|
<div className="danger-text text-start" style={{ fontSize: "12px" }}>
|
||||||
className="danger-text text-start"
|
|
||||||
style={{ fontSize: "12px" }}
|
|
||||||
>
|
|
||||||
{errors.endDate.message}
|
{errors.endDate.message}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 col-md-6">
|
<div className="col-12 col-md-6">
|
||||||
<label className="form-label" htmlFor="modalEditUserStatus">
|
<label className="form-label" htmlFor="modalEditUserStatus">
|
||||||
Status
|
Status
|
||||||
@ -285,9 +286,9 @@ const DEFAULT_EMPTY_STATUS_ID = "00000000-0000-0000-0000-000000000000";
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12">
|
||||||
<label className="form-label" htmlFor="projectAddress">
|
<Label htmlFor="projectAddress" required>
|
||||||
Project Address
|
Project Address
|
||||||
</label>
|
</Label>
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<textarea
|
<textarea
|
||||||
id="projectAddress"
|
id="projectAddress"
|
||||||
@ -312,20 +313,25 @@ const DEFAULT_EMPTY_STATUS_ID = "00000000-0000-0000-0000-000000000000";
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end mt-4">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3" disabled={isPending}>
|
|
||||||
{isPending ? "Please Wait..." : project?.id ? "Update" : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-label-secondary btn-sm me-2"
|
||||||
onClick={handleCancel}
|
onClick={handleCancel}
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-primary btn-sm"
|
||||||
|
disabled={isPending}
|
||||||
|
>
|
||||||
|
{isPending ? "Please Wait..." : project?.id ? "Update" : "Submit"}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
19
src/components/Project/MapUser.css
Normal file
19
src/components/Project/MapUser.css
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/* For Webkit browsers (Chrome, Edge, Safari) */
|
||||||
|
.modal-dialog-scrollable::-webkit-scrollbar {
|
||||||
|
width: 6px; /* smaller width */
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-dialog-scrollable::-webkit-scrollbar-thumb {
|
||||||
|
background-color: rgba(0, 0, 0, 0.3); /* scrollbar color */
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-dialog-scrollable::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For Firefox */
|
||||||
|
.modal-dialog-scrollable {
|
||||||
|
scrollbar-width: thin; /* shrinks scrollbar */
|
||||||
|
scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
|
||||||
|
}
|
@ -4,6 +4,7 @@ import { useAllEmployees } from "../../hooks/useEmployees";
|
|||||||
import useSearch from "../../hooks/useSearch";
|
import useSearch from "../../hooks/useSearch";
|
||||||
import AssignEmployeeTable from "./AssignEmployeeTable";
|
import AssignEmployeeTable from "./AssignEmployeeTable";
|
||||||
import showToast from "../../services/toastService";
|
import showToast from "../../services/toastService";
|
||||||
|
import "./MapUser.css";
|
||||||
|
|
||||||
const MapUsers = ({
|
const MapUsers = ({
|
||||||
projectId,
|
projectId,
|
||||||
@ -183,24 +184,24 @@ const MapUsers = ({
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-footer">
|
<div className="modal-footer mt-5 d-flex justify-content-end gap-0">
|
||||||
{(filteredData.length > 0 ||
|
|
||||||
allocationEmployeesData.length > 0) && (
|
|
||||||
<button className="btn btn-sm btn-success" onClick={handleSubmit}>
|
|
||||||
{assignedLoading ? "Please Wait..." : "Assign to Project"}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-dismiss="modal"
|
data-dismiss="modal"
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{(filteredData.length > 0 || allocationEmployeesData.length > 0) && (
|
||||||
|
<button className="btn btn-sm btn-primary" onClick={handleSubmit}>
|
||||||
|
{assignedLoading ? "Please Wait..." : "Assign to Project"}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
@ -93,7 +93,7 @@ const ProjectInfra = ( {data, onDataChange, eachSiteEngineer} ) =>
|
|||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="link-button link-button-sm m-1 "
|
className="link-button link-button-sm m-1 btn-primary"
|
||||||
onClick={()=>setshowModalBuilding(true)}
|
onClick={()=>setshowModalBuilding(true)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-plus-circle me-2"></i>
|
<i className="bx bx-plus-circle me-2"></i>
|
||||||
@ -101,7 +101,7 @@ const ProjectInfra = ( {data, onDataChange, eachSiteEngineer} ) =>
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="link-button m-1"
|
className="link-button m-1 btn-primary"
|
||||||
onClick={()=>setshowModalFloor(true)}
|
onClick={()=>setshowModalFloor(true)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-plus-circle me-2"></i>
|
<i className="bx bx-plus-circle me-2"></i>
|
||||||
@ -109,7 +109,7 @@ const ProjectInfra = ( {data, onDataChange, eachSiteEngineer} ) =>
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="link-button m-1"
|
className="link-button m-1 btn-primary"
|
||||||
onClick={() => setshowModalWorkArea(true)}
|
onClick={() => setshowModalWorkArea(true)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-plus-circle me-2"></i>
|
<i className="bx bx-plus-circle me-2"></i>
|
||||||
@ -117,7 +117,7 @@ const ProjectInfra = ( {data, onDataChange, eachSiteEngineer} ) =>
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="link-button m-1"
|
className="link-button m-1 btn-primary"
|
||||||
onClick={()=>setshowModalTask(true)}
|
onClick={()=>setshowModalTask(true)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-plus-circle me-2"></i>
|
<i className="bx bx-plus-circle me-2"></i>
|
||||||
|
@ -167,11 +167,11 @@ const ProjectOverview = ({ project }) => {
|
|||||||
return (
|
return (
|
||||||
<div className="card" style={{ minHeight: "490px" }}>
|
<div className="card" style={{ minHeight: "490px" }}>
|
||||||
<div className="card-header text-start">
|
<div className="card-header text-start">
|
||||||
<h6 className="card-action-title mb-0">
|
<h5 className="card-action-title mb-0">
|
||||||
{" "}
|
{" "}
|
||||||
<i className="fa fa-line-chart rounded-circle text-primary"></i>
|
<i className="fa fa-line-chart rounded-circle text-primary"></i>
|
||||||
<span className="ms-2">Project Statistics</span>
|
<span className="ms-2 fw-bold">Project Statistics</span>
|
||||||
</h6>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<ul className="list-unstyled m-0 p-0">
|
<ul className="list-unstyled m-0 p-0">
|
||||||
|
@ -24,7 +24,7 @@ const ContactInfro = ({ onNext }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className="row g-6">
|
<div className="row g-6 text-start">
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="firstName" required>
|
<Label htmlFor="firstName" required>
|
||||||
First Name
|
First Name
|
||||||
|
@ -56,7 +56,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="row g-2">
|
<div className="row g-2 text-start">
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="organizationName" required>
|
<Label htmlFor="organizationName" required>
|
||||||
Organization Name
|
Organization Name
|
||||||
@ -223,10 +223,10 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="d-flex justify-content-between mt-3">
|
<div className="d-flex justify-content-end mt-3">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-secondary"
|
className="btn btn-sm btn-secondary me-3"
|
||||||
onClick={onPrev}
|
onClick={onPrev}
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
>
|
>
|
||||||
|
@ -233,7 +233,7 @@ const SubScription = ({ onSubmitSubScription, onNext }) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="d-flex text-center mt-4">
|
<div className="d-flex text-end mt-4">
|
||||||
<button
|
<button
|
||||||
onClick={handleSubscriptionSubmit}
|
onClick={handleSubscriptionSubmit}
|
||||||
className="btn btn-sm btn-primary"
|
className="btn btn-sm btn-primary"
|
||||||
|
@ -8,7 +8,7 @@ const DatePicker = ({
|
|||||||
placeholder = "DD-MM-YYYY",
|
placeholder = "DD-MM-YYYY",
|
||||||
className = "",
|
className = "",
|
||||||
allowText = false,
|
allowText = false,
|
||||||
maxDate=new Date(),
|
maxDate, // removed default new Date()
|
||||||
minDate,
|
minDate,
|
||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
@ -29,15 +29,21 @@ const DatePicker = ({
|
|||||||
defaultDate: value
|
defaultDate: value
|
||||||
? flatpickr.parseDate(value, "Y-m-d")
|
? flatpickr.parseDate(value, "Y-m-d")
|
||||||
: null,
|
: null,
|
||||||
maxDate:maxDate,
|
maxDate: maxDate ?? undefined, // only applied if passed
|
||||||
minDate:new Date(minDate?.split("T")[0]) ?? undefined,
|
minDate: minDate ? new Date(minDate.split("T")[0]) : undefined,
|
||||||
onChange: function (selectedDates, dateStr) {
|
onChange: function (selectedDates) {
|
||||||
onChange(dateStr);
|
if (selectedDates.length > 0) {
|
||||||
|
// store in YYYY-MM-DD
|
||||||
|
const formatted = flatpickr.formatDate(selectedDates[0], "Y-m-d");
|
||||||
|
onChange(formatted);
|
||||||
|
} else {
|
||||||
|
onChange("");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
...rest
|
...rest
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [inputRef]);
|
}, [inputRef, value, allowText, maxDate, minDate, rest, onChange]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={` position-relative ${className}`}>
|
<div className={` position-relative ${className}`}>
|
||||||
@ -46,7 +52,12 @@ const DatePicker = ({
|
|||||||
className="form-control form-control-sm "
|
className="form-control form-control-sm "
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
defaultValue={
|
defaultValue={
|
||||||
value ? flatpickr.formatDate(flatpickr.parseDate(value, "Y-m-d"), "d-m-Y") : ""
|
value
|
||||||
|
? flatpickr.formatDate(
|
||||||
|
flatpickr.parseDate(value, "Y-m-d"),
|
||||||
|
"d-m-Y"
|
||||||
|
)
|
||||||
|
: ""
|
||||||
}
|
}
|
||||||
ref={(el) => {
|
ref={(el) => {
|
||||||
inputRef.current = el;
|
inputRef.current = el;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import { useFormContext, useWatch } from "react-hook-form";
|
||||||
import { useFormContext } from "react-hook-form";
|
import React, { useEffect, useState } from "react";
|
||||||
|
import Label from "./Label";
|
||||||
|
|
||||||
const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [] }) => {
|
const TagInput = ({ label, name, placeholder, color = "#e9ecef", options = [] }) => {
|
||||||
const { setValue, watch } = useFormContext();
|
const { setValue, watch } = useFormContext();
|
||||||
@ -64,9 +65,9 @@ const handleChange = (e) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<label htmlFor={name} className="form-label">
|
<Label htmlFor={name} className="form-label" required>
|
||||||
{label}
|
{label}
|
||||||
</label>
|
</Label>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="form-control form-control-sm p-1"
|
className="form-control form-control-sm p-1"
|
||||||
|
@ -8,6 +8,7 @@ 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 { useCreateActivity } from "../../hooks/masterHook/useMaster";
|
import { useCreateActivity } from "../../hooks/masterHook/useMaster";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
activityName: z.string().min(1, { message: "Activity Name is required" }),
|
activityName: z.string().min(1, { message: "Activity Name is required" }),
|
||||||
@ -118,8 +119,8 @@ const CreateActivity = ({ onClose }) => {
|
|||||||
<form onSubmit={handleSubmit(onSubmit)}>
|
<form onSubmit={handleSubmit(onSubmit)}>
|
||||||
{/* <h6>Create Activity</h6> */}
|
{/* <h6>Create Activity</h6> */}
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-6">
|
<div className="col-6 text-start">
|
||||||
<label className="form-label">Activity</label>
|
<Label className="form-label" required>Activity</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("activityName")}
|
{...register("activityName")}
|
||||||
@ -131,8 +132,8 @@ const CreateActivity = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-6">
|
<div className="col-6 text-start">
|
||||||
<label className="form-label">Measurement</label>
|
<Label className="form-label" required>Measurement</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("unitOfMeasurement")}
|
{...register("unitOfMeasurement")}
|
||||||
@ -219,17 +220,17 @@ const CreateActivity = ({ onClose }) => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center mt-3">
|
<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 to button
|
type="reset"
|
||||||
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>
|
||||||
|
@ -7,6 +7,7 @@ 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';
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -65,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")}
|
||||||
@ -92,20 +93,18 @@ const CreateContactCategory = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
data-bs-dismiss="modal"
|
||||||
resetForm(); // clear inputs
|
aria-label="Close"
|
||||||
onClose?.(); // close modal from parent
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ 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 {useCreateContactTag} from '../../hooks/masterHook/useMaster';
|
import {useCreateContactTag} from '../../hooks/masterHook/useMaster';
|
||||||
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -65,16 +66,16 @@ const CreateContactTag = ({ 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">Tag Name</label>
|
<Label className="form-label" required>Tag 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")}
|
||||||
@ -92,20 +93,18 @@ const CreateContactTag = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
data-bs-dismiss="modal"
|
||||||
resetForm(); // clear inputs
|
aria-label="Close"
|
||||||
onClose?.(); // close modal from parent
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ 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 {useCreateJobRole} from '../../hooks/masterHook/useMaster';
|
import {useCreateJobRole} from '../../hooks/masterHook/useMaster';
|
||||||
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -91,16 +92,16 @@ const CreateJobRole = ({ onClose }) => {
|
|||||||
{/* <div className="col-12 col-md-12">
|
{/* <div className="col-12 col-md-12">
|
||||||
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Create Job Role</label>
|
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Create Job Role</label>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12 text-start">
|
||||||
<label className="form-label">Role</label>
|
<Label className="form-label" required>Role</Label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
{...register("role")}
|
{...register("role")}
|
||||||
className={`form-control ${errors.role ? 'is-invalids' : ''}`}
|
className={`form-control ${errors.role ? 'is-invalids' : ''}`}
|
||||||
/>
|
/>
|
||||||
{errors.role && <p className="text-danger">{errors.role.message}</p>}
|
{errors.role && <p className="text-danger">{errors.role.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")}
|
||||||
@ -118,20 +119,18 @@ const CreateJobRole = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<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="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
data-bs-dismiss="modal"
|
||||||
resetForm(); // optional: clears form
|
aria-label="Close"
|
||||||
onClose?.(); // ✅ close modal via parent
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import { MasterRespository } from "../../repositories/MastersRepository";
|
|||||||
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
||||||
import showToast from "../../services/toastService";
|
import showToast from "../../services/toastService";
|
||||||
import { useCreateApplicationRole } from "../../hooks/masterHook/useMaster";
|
import { useCreateApplicationRole } from "../../hooks/masterHook/useMaster";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
role: z.string().min(1, { message: "Role is required" }),
|
role: z.string().min(1, { message: "Role is required" }),
|
||||||
@ -109,8 +110,8 @@ const CreateRole = ({ modalType, onClose }) => {
|
|||||||
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Create Application Role</label>
|
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Create Application Role</label>
|
||||||
|
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12 text-start">
|
||||||
<label className="form-label">Role</label>
|
<Label className="form-label" required>Role</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("role")}
|
{...register("role")}
|
||||||
@ -119,10 +120,10 @@ const CreateRole = ({ modalType, onClose }) => {
|
|||||||
{errors.role && <p className="text-danger">{errors.role.message}</p>}
|
{errors.role && <p className="text-danger">{errors.role.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">
|
<Label className="form-label" htmlFor="description" required>
|
||||||
Description
|
Description
|
||||||
</label>
|
</Label>
|
||||||
<textarea
|
<textarea
|
||||||
rows="3"
|
rows="3"
|
||||||
{...register("description")}
|
{...register("description")}
|
||||||
@ -228,17 +229,18 @@ const CreateRole = ({ modalType, onClose }) => {
|
|||||||
|
|
||||||
|
|
||||||
{masterFeatures && (
|
{masterFeatures && (
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={onClose}
|
data-bs-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -7,6 +7,7 @@ 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 {useCreateWorkCategory} from '../../hooks/masterHook/useMaster';
|
import {useCreateWorkCategory} from '../../hooks/masterHook/useMaster';
|
||||||
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -81,16 +82,16 @@ const CreateWorkCategory = ({ onClose }) => {
|
|||||||
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Create Work Category</label>
|
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Create Work Category</label>
|
||||||
</div> */}
|
</div> */}
|
||||||
|
|
||||||
<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")}
|
||||||
@ -108,20 +109,19 @@ const CreateWorkCategory = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="reset"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
data-bs-dismiss="modal"
|
||||||
resetForm(); // clear inputs
|
aria-label="Close"
|
||||||
onClose?.(); // close modal from parent
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -6,6 +6,7 @@ import {MasterRespository} from "../../repositories/MastersRepository";
|
|||||||
import showToast from "../../services/toastService";
|
import showToast from "../../services/toastService";
|
||||||
import { getCachedData, cacheData } from "../../slices/apiDataManager";
|
import { getCachedData, cacheData } from "../../slices/apiDataManager";
|
||||||
import { useUpdateActivity } from "../../hooks/masterHook/useMaster";
|
import { useUpdateActivity } from "../../hooks/masterHook/useMaster";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -131,8 +132,8 @@ useEffect(() => {
|
|||||||
{/* <h6>Update Activity</h6> */}
|
{/* <h6>Update Activity</h6> */}
|
||||||
<div className="row">
|
<div className="row">
|
||||||
{/* Activity Name */}
|
{/* Activity Name */}
|
||||||
<div className="col-md-6">
|
<div className="col-md-6 text-start">
|
||||||
<label className="form-label">Activity Name</label>
|
<Label className="form-label" required>Activity Name</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("activityName")}
|
{...register("activityName")}
|
||||||
@ -144,8 +145,8 @@ useEffect(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Unit of Measurement */}
|
{/* Unit of Measurement */}
|
||||||
<div className="col-md-6">
|
<div className="col-md-6 text-start">
|
||||||
<label className="form-label">Measurement</label>
|
<Label className="form-label" required>Measurement</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("unitOfMeasurement")}
|
{...register("unitOfMeasurement")}
|
||||||
@ -236,17 +237,18 @@ useEffect(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Submit / Cancel */}
|
{/* Submit / Cancel */}
|
||||||
<div className="col-12 text-center mt-3">
|
<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 to 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>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -7,6 +7,7 @@ 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 {useUpdateContactCategory} from '../../hooks/masterHook/useMaster';
|
import {useUpdateContactCategory} from '../../hooks/masterHook/useMaster';
|
||||||
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -84,16 +85,16 @@ const EditContactCategory = ({ data, 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")}
|
||||||
@ -111,20 +112,19 @@ const EditContactCategory = ({ data, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
data-bs-dismiss="modal"
|
||||||
resetForm(); // clear inputs
|
aria-label="Close"
|
||||||
onClose?.(); // close modal from parent
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -7,6 +7,7 @@ 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 {useUpdateContactTag} from '../../hooks/masterHook/useMaster';
|
import {useUpdateContactTag} from '../../hooks/masterHook/useMaster';
|
||||||
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
@ -84,16 +85,16 @@ const EditContactTag = ({ data, 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">Tag Name</label>
|
<Label className="form-label" required>Tag 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")}
|
||||||
@ -111,20 +112,19 @@ const EditContactTag = ({ data, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button type="submit" className="btn btn-sm btn-primary me-3">
|
|
||||||
{isLoading ? "Please Wait..." : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button" // ✅ not reset
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
onClick={() => {
|
data-bs-dismiss="modal"
|
||||||
resetForm(); // clear inputs
|
aria-label="Close"
|
||||||
onClose?.(); // close modal from parent
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary ">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -6,6 +6,7 @@ import { MasterRespository } from '../../repositories/MastersRepository';
|
|||||||
import { cacheData, getCachedData } from '../../slices/apiDataManager';
|
import { cacheData, getCachedData } from '../../slices/apiDataManager';
|
||||||
import showToast from '../../services/toastService';
|
import showToast from '../../services/toastService';
|
||||||
import {useUpdateJobRole} from '../../hooks/masterHook/useMaster';
|
import {useUpdateJobRole} from '../../hooks/masterHook/useMaster';
|
||||||
|
import Label from '../common/Label';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -99,16 +100,16 @@ const EditJobRole = ({ data, onClose }) => {
|
|||||||
{/* <div className="col-12 col-md-12">
|
{/* <div className="col-12 col-md-12">
|
||||||
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Edit Job Role</label>
|
<label className="fs-5 text-dark text-center d-flex align-items-center justify-content-center flex-wrap">Edit Job Role</label>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="col-12 col-md-12">
|
<div className="col-12 col-md-12 text-start">
|
||||||
<label className="form-label">Role</label>
|
<Label className="form-label" required>Role</Label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
{...register("role")}
|
{...register("role")}
|
||||||
className={`form-control ${errors.role ? 'is-invalids' : ''}`}
|
className={`form-control ${errors.role ? 'is-invalids' : ''}`}
|
||||||
/>
|
/>
|
||||||
{errors.role && <p className="text-danger">{errors.role.message}</p>}
|
{errors.role && <p className="text-danger">{errors.role.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")}
|
||||||
@ -127,17 +128,19 @@ const EditJobRole = ({ data, onClose }) => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<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
|
data-bs-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button type="submit" className="btn btn-sm btn-primary">
|
||||||
|
{isLoading? "Please Wait...":"Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import { MasterRespository } from "../../repositories/MastersRepository";
|
|||||||
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
import { cacheData, getCachedData } from "../../slices/apiDataManager";
|
||||||
import showToast from "../../services/toastService";
|
import showToast from "../../services/toastService";
|
||||||
import { useUpdateApplicationRole } from "../../hooks/masterHook/useMaster";
|
import { useUpdateApplicationRole } from "../../hooks/masterHook/useMaster";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const updateSchema = z.object({
|
const updateSchema = z.object({
|
||||||
role: z.string().min(1, { message: "Role is required" }),
|
role: z.string().min(1, { message: "Role is required" }),
|
||||||
@ -162,8 +163,8 @@ const EditMaster = ({ master, 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">Role</label>
|
<Label className="form-label" required>Role</Label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
{...register("role")}
|
{...register("role")}
|
||||||
className={`form-control ${errors.role ? 'is-invalid' : ''}`}
|
className={`form-control ${errors.role ? 'is-invalid' : ''}`}
|
||||||
@ -171,8 +172,8 @@ const EditMaster = ({ master, onClose }) => {
|
|||||||
{errors.role && <p className="text-danger">{errors.role.message}</p>}
|
{errors.role && <p className="text-danger">{errors.role.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")}
|
||||||
@ -275,15 +276,17 @@ const EditMaster = ({ master, onClose }) => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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"
|
||||||
|
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>
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
useCreateExpenseType,
|
useCreateExpenseType,
|
||||||
useUpdateExpenseType,
|
useUpdateExpenseType,
|
||||||
} from "../../hooks/masterHook/useMaster";
|
} from "../../hooks/masterHook/useMaster";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const ExpnseSchema = z.object({
|
const ExpnseSchema = z.object({
|
||||||
name: z.string().min(1, { message: "Name is required" }),
|
name: z.string().min(1, { message: "Name is required" }),
|
||||||
@ -52,8 +53,8 @@ const ManageExpenseType = ({ data = null, onClose }) => {
|
|||||||
}, [data]);
|
}, [data]);
|
||||||
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">Expesne Type Name</label>
|
<Label className="form-label" required>Expesne Type Name</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("name")}
|
{...register("name")}
|
||||||
@ -61,10 +62,10 @@ const ManageExpenseType = ({ data = null, onClose }) => {
|
|||||||
/>
|
/>
|
||||||
{errors.name && <p className="danger-text">{errors.name.message}</p>}
|
{errors.name && <p className="danger-text">{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">
|
<Label className="form-label" htmlFor="description" required>
|
||||||
Description
|
Description
|
||||||
</label>
|
</Label>
|
||||||
<textarea
|
<textarea
|
||||||
rows="3"
|
rows="3"
|
||||||
{...register("description")}
|
{...register("description")}
|
||||||
@ -83,10 +84,20 @@ const ManageExpenseType = ({ data = null, onClose }) => {
|
|||||||
{...register("noOfPersonsRequired")}
|
{...register("noOfPersonsRequired")}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
|
<button
|
||||||
|
type="reset"
|
||||||
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
disabled={isPending || isPendingUpdate}
|
||||||
|
onClick={()=>onClose()}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-sm btn-primary me-3"
|
className="btn btn-sm btn-primary"
|
||||||
disabled={isPending || isPendingUpdate}
|
disabled={isPending || isPendingUpdate}
|
||||||
>
|
>
|
||||||
{isPending || isPendingUpdate
|
{isPending || isPendingUpdate
|
||||||
@ -95,16 +106,7 @@ const ManageExpenseType = ({ data = null, onClose }) => {
|
|||||||
? "Update"
|
? "Update"
|
||||||
: "Submit"}
|
: "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="reset"
|
|
||||||
className="btn btn-sm btn-label-secondary "
|
|
||||||
data-bs-dismiss="modal"
|
|
||||||
aria-label="Close"
|
|
||||||
disabled={isPending || isPendingUpdate}
|
|
||||||
onClick={()=>onClose()}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
@ -3,6 +3,7 @@ import { useForm } from "react-hook-form";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { useCreatePaymentMode, useUpdatePaymentMode } from "../../hooks/masterHook/useMaster";
|
import { useCreatePaymentMode, useUpdatePaymentMode } from "../../hooks/masterHook/useMaster";
|
||||||
|
import Label from "../common/Label";
|
||||||
|
|
||||||
const ExpnseSchema = z.object({
|
const ExpnseSchema = z.object({
|
||||||
name: z.string().min(1, { message: "Name is required" }),
|
name: z.string().min(1, { message: "Name is required" }),
|
||||||
@ -46,8 +47,8 @@ const ManagePaymentMode = ({ data = null, 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">Payment Mode Name</label>
|
<Label className="form-label" required>Payment Mode Name</Label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("name")}
|
{...register("name")}
|
||||||
@ -55,10 +56,10 @@ const ManagePaymentMode = ({ data = null, onClose }) => {
|
|||||||
/>
|
/>
|
||||||
{errors.name && <p className="danger-text">{errors.name.message}</p>}
|
{errors.name && <p className="danger-text">{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">
|
<Label className="form-label" htmlFor="description" required>
|
||||||
Description
|
Description
|
||||||
</label>
|
</Label>
|
||||||
<textarea
|
<textarea
|
||||||
rows="3"
|
rows="3"
|
||||||
{...register("description")}
|
{...register("description")}
|
||||||
@ -70,22 +71,23 @@ const ManagePaymentMode = ({ data = null, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-center">
|
<div className="col-12 text-end">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="reset"
|
||||||
className="btn btn-sm btn-primary me-3"
|
className="btn btn-sm btn-label-secondary me-3"
|
||||||
disabled={isPending || Updating}
|
data-bs-dismiss="modal"
|
||||||
>
|
aria-label="Close"
|
||||||
{isPending || Updating ? "Please Wait..." : Updating ? "Update" : "Submit"}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-sm btn-label-secondary"
|
|
||||||
onClick={onClose} // ✅ call onClose here
|
|
||||||
disabled={isPending || Updating}
|
disabled={isPending || Updating}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-sm btn-primary"
|
||||||
|
disabled={isPending || Updating}
|
||||||
|
>
|
||||||
|
{isPending || Updating ? "Please Wait..." : Updating ? "Update" : "Submit"}
|
||||||
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect, useCallback } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
cacheData,
|
cacheData,
|
||||||
clearCacheKey,
|
clearCacheKey,
|
||||||
@ -117,7 +117,13 @@ const AttendancePage = () => {
|
|||||||
{ label: "Attendance", link: null },
|
{ label: "Attendance", link: null },
|
||||||
]}
|
]}
|
||||||
></Breadcrumb>
|
></Breadcrumb>
|
||||||
|
|
||||||
<div className="nav-align-top nav-tabs-shadow">
|
<div className="nav-align-top nav-tabs-shadow">
|
||||||
|
{/* Tabs */}
|
||||||
|
<div className="nav-align-top nav-tabs-shadow bg-white border-bottom">
|
||||||
|
<div className="row align-items-center g-0 mb-3 mb-md-0">
|
||||||
|
{/* Tabs */}
|
||||||
|
<div className="col-12 col-md">
|
||||||
<ul className="nav nav-tabs" role="tablist">
|
<ul className="nav nav-tabs" role="tablist">
|
||||||
<li className="nav-item">
|
<li className="nav-item">
|
||||||
<button
|
<button
|
||||||
@ -145,7 +151,8 @@ const AttendancePage = () => {
|
|||||||
Logs
|
Logs
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li className={`nav-item ${!DoRegularized && "d-none"}`}>
|
|
||||||
|
<li className={`nav-item ${!DoRegularized ? "d-none" : ""}`}>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={`nav-link ${
|
className={`nav-link ${
|
||||||
@ -158,19 +165,22 @@ const AttendancePage = () => {
|
|||||||
Regularization
|
Regularization
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* 🔹 Search box placed after Regularization tab */}
|
{/* Single search input that moves */}
|
||||||
<li className="nav-item ms-auto me-3">
|
<div className="col-12 col-md-auto mt-2 mt-md-0 ms-md-auto px-2">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="form-control form-control-sm mt-1"
|
className="form-control form-control-sm"
|
||||||
placeholder="Search Employee..."
|
placeholder="Search Employee..."
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={(e) => setSearchTerm(e.target.value)}
|
onChange={(e) => setSearchTerm(e.target.value)}
|
||||||
style={{ minWidth: "200px" }}
|
style={{ minWidth: "200px" }}
|
||||||
/>
|
/>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="tab-content attedanceTabs py-0 px-1 px-sm-3">
|
<div className="tab-content attedanceTabs py-0 px-1 px-sm-3">
|
||||||
{selectedProject ? (
|
{selectedProject ? (
|
||||||
|
@ -178,7 +178,7 @@ const DailyTask = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- Table --- */}
|
{/* --- Table --- */}
|
||||||
<div className="table-responsive text-nowrap mt-3">
|
<div className="table-responsive text-nowrap mt-3" style={{ minHeight: "200px" }}>
|
||||||
<table className="table">
|
<table className="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -193,14 +193,16 @@ const DailyTask = () => {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{taskLoading && (
|
{taskLoading && (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={6} className="text-center">
|
<td colSpan={6} className="text-center align-middle" style={{ height: "200px" }}>
|
||||||
<Loader />
|
<Loader />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
{!taskLoading && groupedTasks.length === 0 && (
|
{!taskLoading && groupedTasks.length === 0 && (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={6} className="text-center">No Reports Found</td>
|
<td colSpan={6} className="text-center align-middle" style={{ height: "200px" }}>
|
||||||
|
No Reports Found
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
{!taskLoading &&
|
{!taskLoading &&
|
||||||
@ -239,6 +241,7 @@ const DailyTask = () => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -414,14 +414,11 @@ const EmployeeList = () => {
|
|||||||
{/* Add Employee Button */}
|
{/* Add Employee Button */}
|
||||||
{Manage_Employee && (
|
{Manage_Employee && (
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-primary"
|
className="p-1 me-1 m-sm-0 bg-primary rounded-circle"
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleEmployeeModel(null)}
|
onClick={() => handleEmployeeModel(null)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-plus-circle me-2"></i>
|
<i className="bx bx-plus fs-4 text-white"></i>
|
||||||
<span className="d-none d-md-inline-block">
|
|
||||||
Add New Employee
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -636,7 +633,7 @@ const EmployeeList = () => {
|
|||||||
}
|
}
|
||||||
className="dropdown-item py-1"
|
className="dropdown-item py-1"
|
||||||
>
|
>
|
||||||
<i className="bx bx-detail bx-sm"></i> View
|
<i className="bx bx-show text-primary bx-sm"></i> View
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* If ACTIVE employee */}
|
{/* If ACTIVE employee */}
|
||||||
@ -648,8 +645,7 @@ const EmployeeList = () => {
|
|||||||
handleEmployeeModel(item.id)
|
handleEmployeeModel(item.id)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<i className="bx bx-edit bx-sm"></i>{" "}
|
<i className="bx bx-edit text-secondary bx-sm"></i> Edit
|
||||||
Edit
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Suspend only when active */}
|
{/* Suspend only when active */}
|
||||||
@ -658,8 +654,7 @@ const EmployeeList = () => {
|
|||||||
className="dropdown-item py-1"
|
className="dropdown-item py-1"
|
||||||
onClick={() => handleOpenDelete(item)}
|
onClick={() => handleOpenDelete(item)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-task-x bx-sm"></i>{" "}
|
<i className="bx bx-task-x text-danger bx-sm"></i> Suspend
|
||||||
Suspend
|
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -684,8 +679,7 @@ const EmployeeList = () => {
|
|||||||
className="dropdown-item py-1"
|
className="dropdown-item py-1"
|
||||||
onClick={() => handleOpenDelete(item)}
|
onClick={() => handleOpenDelete(item)}
|
||||||
>
|
>
|
||||||
<i className="bx bx-refresh bx-sm me-1"></i>{" "}
|
<i className="bx bx-refresh text-danger bx-sm me-0"></i> Re-activate
|
||||||
Re-activate
|
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,7 +163,7 @@ useEffect(() => {
|
|||||||
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 && (
|
{isLoading && (
|
||||||
|
@ -83,7 +83,7 @@ const ProjectDetails = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-lg-4 col-md-5 mt-5">
|
<div className="col-lg-4 col-md-5 mt-2">
|
||||||
<AboutProject></AboutProject>
|
<AboutProject></AboutProject>
|
||||||
<ProjectOverview project={projectId} />
|
<ProjectOverview project={projectId} />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user