Issues_Aug_2W #371
@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useEmployeeAttendacesLog } from "../../hooks/useAttendance";
|
import { useEmployeeAttendacesLog } from "../../hooks/useAttendance";
|
||||||
import { convertShortTime } from "../../utils/dateUtils";
|
import { convertShortTime, formatUTCToLocalTime } from "../../utils/dateUtils";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { THRESH_HOLD } from "../../utils/constants";
|
import { THRESH_HOLD } from "../../utils/constants";
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ const AttendLogs = ({ Id }) => {
|
|||||||
<p>
|
<p>
|
||||||
Attendance logs for{" "}
|
Attendance logs for{" "}
|
||||||
{logs[0]?.employee?.firstName + " " + logs[0]?.employee?.lastName}{" "}
|
{logs[0]?.employee?.firstName + " " + logs[0]?.employee?.lastName}{" "}
|
||||||
on {logs[0]?.activityTime.slice(0, 10)}{" "}
|
on {formatUTCToLocalTime(logs[0]?.activityTime)}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -156,7 +156,7 @@ const AttendLogs = ({ Id }) => {
|
|||||||
.sort((a, b) => b.id - a.id)
|
.sort((a, b) => b.id - a.id)
|
||||||
.map((log, index) => (
|
.map((log, index) => (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{log.activityTime.slice(0, 10)}</td>
|
<td>{formatUTCToLocalTime(log.activityTime)}</td>
|
||||||
<td>{convertShortTime(log.activityTime)}</td>
|
<td>{convertShortTime(log.activityTime)}</td>
|
||||||
<td>
|
<td>
|
||||||
{whichActivityPerform(log.activity, log.activityTime)}
|
{whichActivityPerform(log.activity, log.activityTime)}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import Avatar from "../common/Avatar";
|
import Avatar from "../common/Avatar";
|
||||||
import { convertShortTime } from "../../utils/dateUtils";
|
import { convertShortTime, formatUTCToLocalTime } from "../../utils/dateUtils";
|
||||||
import RenderAttendanceStatus from "./RenderAttendanceStatus";
|
import RenderAttendanceStatus from "./RenderAttendanceStatus";
|
||||||
import usePagination from "../../hooks/usePagination";
|
import usePagination from "../../hooks/usePagination";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
@ -116,7 +116,7 @@ const Attendance = ({ getRole, handleModalData, searchTerm }) => {
|
|||||||
<>
|
<>
|
||||||
<div className="table-responsive text-nowrap h-100" >
|
<div className="table-responsive text-nowrap h-100" >
|
||||||
<div className="d-flex text-start align-items-center py-2">
|
<div className="d-flex text-start align-items-center py-2">
|
||||||
<strong>Date : {todayDate.toLocaleDateString("en-GB")}</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">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import eventBus from "../../services/eventBus";
|
|||||||
import AttendanceRepository from "../../repositories/AttendanceRepository";
|
import AttendanceRepository from "../../repositories/AttendanceRepository";
|
||||||
import { useAttendancesLogs } from "../../hooks/useAttendance";
|
import { useAttendancesLogs } from "../../hooks/useAttendance";
|
||||||
import { queryClient } from "../../layouts/AuthLayout";
|
import { queryClient } from "../../layouts/AuthLayout";
|
||||||
|
import { ITEMS_PER_PAGE } from "../../utils/constants";
|
||||||
|
|
||||||
const usePagination = (data, itemsPerPage) => {
|
const usePagination = (data, itemsPerPage) => {
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
@ -353,7 +354,7 @@ const AttendanceLog = ({ handleModalData, searchTerm }) => {
|
|||||||
<span className="text-secondary">No Pending Record Available !</span>
|
<span className="text-secondary">No Pending Record Available !</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{filteredSearchData.length > 10 && (
|
{filteredSearchData.length > ITEMS_PER_PAGE && (
|
||||||
<nav aria-label="Page ">
|
<nav aria-label="Page ">
|
||||||
<ul className="pagination pagination-sm justify-content-end py-1">
|
<ul className="pagination pagination-sm justify-content-end py-1">
|
||||||
<li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
|
<li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
import React, { useEffect, useState, useMemo } from "react";
|
import React, { useEffect, useState, useMemo } from "react";
|
||||||
import { DirectoryRepository } from "../../repositories/DirectoryRepository";
|
import { DirectoryRepository } from "../../repositories/DirectoryRepository";
|
||||||
import NoteCardDirectoryEditable from "./NoteCardDirectoryEditable";
|
import NoteCardDirectoryEditable from "./NoteCardDirectoryEditable";
|
||||||
|
import { useSelectedproject } from "../../slices/apiDataManager";
|
||||||
|
|
||||||
|
const NotesCardViewDirectory = ({
|
||||||
|
notes,
|
||||||
|
setNotesForFilter,
|
||||||
|
searchText,
|
||||||
|
filterAppliedNotes,
|
||||||
|
}) => {
|
||||||
|
const projectId = useSelectedproject(); // ✅ get projectId from Redux
|
||||||
|
|
||||||
const NotesCardViewDirectory = ({ notes, setNotesForFilter, searchText, filterAppliedNotes }) => {
|
|
||||||
const [allNotes, setAllNotes] = useState([]);
|
const [allNotes, setAllNotes] = useState([]);
|
||||||
const [filteredNotes, setFilteredNotes] = useState([]);
|
const [filteredNotes, setFilteredNotes] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
@ -13,13 +21,15 @@ const NotesCardViewDirectory = ({ notes, setNotesForFilter, searchText, filterAp
|
|||||||
const pageSize = 20;
|
const pageSize = 20;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchNotes();
|
if (projectId) {
|
||||||
}, []);
|
fetchNotes(projectId);
|
||||||
|
}
|
||||||
|
}, [projectId]);
|
||||||
|
|
||||||
const fetchNotes = async () => {
|
const fetchNotes = async (projId) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await DirectoryRepository.GetNotes(1000, 1);
|
const response = await DirectoryRepository.GetNotes(1000, 1, projId); // ✅ pass projectId
|
||||||
const fetchedNotes = response.data?.data || [];
|
const fetchedNotes = response.data?.data || [];
|
||||||
setAllNotes(fetchedNotes);
|
setAllNotes(fetchedNotes);
|
||||||
setNotesForFilter(fetchedNotes)
|
setNotesForFilter(fetchedNotes)
|
||||||
@ -122,7 +132,7 @@ const NotesCardViewDirectory = ({ notes, setNotesForFilter, searchText, filterAp
|
|||||||
prevNotes.map((n) => (n.id === updatedNote.id ? updatedNote : n))
|
prevNotes.map((n) => (n.id === updatedNote.id ? updatedNote : n))
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
onNoteDelete={() => fetchNotes()}
|
onNoteDelete={() => fetchNotes(projectId)} // ✅ reload with projectId
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -126,7 +126,7 @@ const EmpAttendance = ({ employee }) => {
|
|||||||
className="dataTables_length text-start py-2 d-flex justify-content-between "
|
className="dataTables_length text-start py-2 d-flex justify-content-between "
|
||||||
id="DataTables_Table_0_length"
|
id="DataTables_Table_0_length"
|
||||||
>
|
>
|
||||||
<div className="col-md-3 my-0 ">
|
<div className="col-md-4 my-0 ">
|
||||||
<DateRangePicker
|
<DateRangePicker
|
||||||
DateDifference="30"
|
DateDifference="30"
|
||||||
onRangeChange={setDateRange}
|
onRangeChange={setDateRange}
|
||||||
|
|||||||
@ -59,20 +59,20 @@ const EmpBanner = ({ profile, loggedInUser }) => {
|
|||||||
</h4>
|
</h4>
|
||||||
<ul className="list-inline mb-0 d-flex align-items-center flex-wrap justify-content-sm-start justify-content-center gap-4 mt-4">
|
<ul className="list-inline mb-0 d-flex align-items-center flex-wrap justify-content-sm-start justify-content-center gap-4 mt-4">
|
||||||
<li className="list-inline-item">
|
<li className="list-inline-item">
|
||||||
<i className="icon-base bx bx-crown me-2 align-top"></i>
|
<i className="icon-base bx bx-crown me-1 align-top"></i>
|
||||||
<span className="fw-medium">
|
<span className="fw-medium">
|
||||||
{profile?.jobRole || <em>NA</em>}
|
{profile?.jobRole || <em>NA</em>}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="list-inline-item">
|
<li className="list-inline-item">
|
||||||
<i className="icon-base bx bx-phone me-2 align-top"></i>
|
<i className="icon-base bx bx-phone me-0 align-top"></i>
|
||||||
<span className="fw-medium">
|
<span className="fw-medium">
|
||||||
{" "}
|
{" "}
|
||||||
{profile?.phoneNumber || <em>NA</em>}
|
{profile?.phoneNumber || <em>NA</em>}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="list-inline-item">
|
<li className="list-inline-item">
|
||||||
<i className="icon-base bx bx-calendar me-2 align-top"></i>
|
<i className="icon-base bx bx-calendar me-0 align-top"></i>
|
||||||
<span className="fw-medium">
|
<span className="fw-medium">
|
||||||
{" "}
|
{" "}
|
||||||
Joined on{" "}
|
Joined on{" "}
|
||||||
@ -85,6 +85,7 @@ const EmpBanner = ({ profile, loggedInUser }) => {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="list-inline mb-0 d-flex align-items-center flex-wrap justify-content-sm-start justify-content-center mt-4">
|
<ul className="list-inline mb-0 d-flex align-items-center flex-wrap justify-content-sm-start justify-content-center mt-4">
|
||||||
|
{profile?.isActive && ( // ✅ show only if active
|
||||||
<li className="list-inline-item">
|
<li className="list-inline-item">
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-primary btn-block"
|
className="btn btn-sm btn-primary btn-block"
|
||||||
@ -93,8 +94,10 @@ const EmpBanner = ({ profile, loggedInUser }) => {
|
|||||||
Edit Profile
|
Edit Profile
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
)}
|
||||||
|
|
||||||
<li className="list-inline-item">
|
<li className="list-inline-item">
|
||||||
{profile?.id == loggedInUser?.employeeInfo?.id && (
|
{profile?.id === loggedInUser?.employeeInfo?.id && (
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm btn-outline-primary btn-block"
|
className="btn btn-sm btn-outline-primary btn-block"
|
||||||
onClick={() => openChangePassword()}
|
onClick={() => openChangePassword()}
|
||||||
|
|||||||
@ -105,6 +105,7 @@ const ExpenseFilterPanel = ({ onApply, handleGroupBy }) => {
|
|||||||
startField="startDate"
|
startField="startDate"
|
||||||
endField="endDate"
|
endField="endDate"
|
||||||
resetSignal={resetKey}
|
resetSignal={resetKey}
|
||||||
|
defaultRange={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -96,19 +96,19 @@ const EditProfile = ({ TenantId,onClose }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-6 mt-1">
|
<div className="col-sm-6 mt-1">
|
||||||
<Label htmlFor="domainName" required>Domain Name</Label>
|
<Label htmlFor="domainName" >Domain Name</Label>
|
||||||
<input id="domainName" type="text" className="form-control form-control-sm" {...register("domainName")} />
|
<input id="domainName" type="text" className="form-control form-control-sm" {...register("domainName")} />
|
||||||
{errors.domainName && <div className="danger-text">{errors.domainName.message}</div>}
|
{errors.domainName && <div className="danger-text">{errors.domainName.message}</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-6 mt-1">
|
<div className="col-sm-6 mt-1">
|
||||||
<Label htmlFor="taxId" required>Tax ID</Label>
|
<Label htmlFor="taxId" >Tax ID</Label>
|
||||||
<input id="taxId" type="text" className="form-control form-control-sm" {...register("taxId")} />
|
<input id="taxId" type="text" className="form-control form-control-sm" {...register("taxId")} />
|
||||||
{errors.taxId && <div className="danger-text">{errors.taxId.message}</div>}
|
{errors.taxId && <div className="danger-text">{errors.taxId.message}</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-6 mt-1">
|
<div className="col-sm-6 mt-1">
|
||||||
<Label htmlFor="officeNumber" required>Office Number</Label>
|
<Label htmlFor="officeNumber" >Office Number</Label>
|
||||||
<input id="officeNumber" type="text" className="form-control form-control-sm" {...register("officeNumber")} />
|
<input id="officeNumber" type="text" className="form-control form-control-sm" {...register("officeNumber")} />
|
||||||
{errors.officeNumber && <div className="danger-text">{errors.officeNumber.message}</div>}
|
{errors.officeNumber && <div className="danger-text">{errors.officeNumber.message}</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -73,7 +73,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="officeNumber" required>
|
<Label htmlFor="officeNumber" >
|
||||||
Office Number
|
Office Number
|
||||||
</Label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
@ -87,7 +87,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="domainName" required>
|
<Label htmlFor="domainName" >
|
||||||
Domain Name
|
Domain Name
|
||||||
</Label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
@ -101,7 +101,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="taxId" required>
|
<Label htmlFor="taxId" >
|
||||||
Tax ID
|
Tax ID
|
||||||
</Label>
|
</Label>
|
||||||
<input
|
<input
|
||||||
@ -138,8 +138,10 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
id="organizationSize"
|
||||||
{...register("organizationSize")}
|
className="form-select shadow-none border py-1 px-2"
|
||||||
|
style={{ fontSize: "0.875rem" }} // Bootstrap's small text size
|
||||||
|
{...register("organizationSize", { required: "Organization size is required" })}
|
||||||
>
|
>
|
||||||
{orgSize.map((org) => (
|
{orgSize.map((org) => (
|
||||||
<option key={org.val} value={org.val}>
|
<option key={org.val} value={org.val}>
|
||||||
@ -147,17 +149,20 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
{errors.organizationSize && (
|
{errors.organizationSize && (
|
||||||
<div className="danger-text">{errors.organizationSize.message}</div>
|
<div className="danger-text">{errors.organizationSize.message}</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="industryId" required>
|
<Label htmlFor="industryId" required>
|
||||||
Industry
|
Industry
|
||||||
</Label>
|
</Label>
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
id="industryId"
|
||||||
|
className="form-select shadow-none border py-1 px-2 small"
|
||||||
{...register("industryId")}
|
{...register("industryId")}
|
||||||
>
|
>
|
||||||
{industryLoading ? (
|
{industryLoading ? (
|
||||||
@ -177,9 +182,9 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
|
|
||||||
<div className="col-sm-6">
|
<div className="col-sm-6">
|
||||||
<Label htmlFor="reference">Reference</Label>
|
<Label htmlFor="reference">Reference</Label>
|
||||||
|
|
||||||
<select
|
<select
|
||||||
className="form-select form-select-sm"
|
id="reference"
|
||||||
|
className="form-select shadow-none border py-1 px-2 small"
|
||||||
{...register("reference")}
|
{...register("reference")}
|
||||||
>
|
>
|
||||||
{reference.map((org) => (
|
{reference.map((org) => (
|
||||||
@ -193,6 +198,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="col-sm-12">
|
<div className="col-sm-12">
|
||||||
<Label htmlFor="description">Description</Label>
|
<Label htmlFor="description">Description</Label>
|
||||||
<textarea
|
<textarea
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import React, { useState,useCallback } from "react";
|
import React, { useState, useCallback, useEffect } from "react";
|
||||||
import { FormProvider, useForm, useFormContext } from "react-hook-form";
|
import { FormProvider, useForm, useFormContext } from "react-hook-form";
|
||||||
import { defaultFilterValues, filterSchema } from "./TenantSchema";
|
import { defaultFilterValues, filterSchema } from "./TenantSchema";
|
||||||
import Label from "../common/Label";
|
import Label from "../common/Label";
|
||||||
@ -8,6 +8,7 @@ import { useIndustries } from "../../hooks/useTenant";
|
|||||||
import { reference, TENANT_STATUS } from "../../utils/constants";
|
import { reference, TENANT_STATUS } from "../../utils/constants";
|
||||||
import { DateRangePicker1 } from "../common/DateRangePicker";
|
import { DateRangePicker1 } from "../common/DateRangePicker";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
|
||||||
const TenantFilterPanel = ({ onApply }) => {
|
const TenantFilterPanel = ({ onApply }) => {
|
||||||
const [resetKey, setResetKey] = useState(0);
|
const [resetKey, setResetKey] = useState(0);
|
||||||
@ -36,6 +37,13 @@ const [resetKey, setResetKey] = useState(0);
|
|||||||
[onApply, handleClosePanel]
|
[onApply, handleClosePanel]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ✅ Close popup when navigating to another component
|
||||||
|
const location = useLocation();
|
||||||
|
useEffect(() => {
|
||||||
|
handleClosePanel();
|
||||||
|
}, [location]);
|
||||||
|
|
||||||
const onClear = useCallback(() => {
|
const onClear = useCallback(() => {
|
||||||
reset(defaultFilterValues);
|
reset(defaultFilterValues);
|
||||||
setResetKey((prev) => prev + 1); // triggers DateRangePicker reset
|
setResetKey((prev) => prev + 1); // triggers DateRangePicker reset
|
||||||
|
|||||||
@ -11,12 +11,12 @@ export const newTenantSchema = z.object({
|
|||||||
.regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }),
|
.regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }),
|
||||||
email: z.string().trim().email("Invalid email address"),
|
email: z.string().trim().email("Invalid email address"),
|
||||||
description: z.string().trim().optional(),
|
description: z.string().trim().optional(),
|
||||||
domainName: z.string().trim().nonempty("Domain name is required"),
|
domainName: z.string().trim().optional(),
|
||||||
billingAddress: z.string().trim().nonempty("Billing address is required"),
|
billingAddress: z.string().trim().nonempty("Billing address is required"),
|
||||||
taxId: z.string().trim().nonempty("Tax ID is required"),
|
taxId: z.string().trim().optional(),
|
||||||
logoImage: z.string().trim().optional(),
|
logoImage: z.string().trim().optional(),
|
||||||
organizationName: z.string().trim().nonempty("Organization name is required"),
|
organizationName: z.string().trim().nonempty("Organization name is required"),
|
||||||
officeNumber: z.string().trim().nonempty("Office number is required"),
|
officeNumber: z.string().trim().optional(),
|
||||||
contactNumber: z.string().trim()
|
contactNumber: z.string().trim()
|
||||||
.nonempty("Contact number is required")
|
.nonempty("Contact number is required")
|
||||||
.regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"),
|
.regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"),
|
||||||
@ -141,11 +141,11 @@ lastName: z
|
|||||||
.min(1, { message: "Last Name is required!" })
|
.min(1, { message: "Last Name is required!" })
|
||||||
.regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }),
|
.regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }),
|
||||||
description: z.string().trim().optional(),
|
description: z.string().trim().optional(),
|
||||||
domainName: z.string().trim().min(1, { message: "Domain Name is required!" }),
|
domainName: z.string().trim().optional(),
|
||||||
billingAddress: z.string().trim().min(1, { message: "Billing Address is required!" }),
|
billingAddress: z.string().trim().min(1, { message: "Billing Address is required!" }),
|
||||||
taxId: z.string().trim().min(1, { message: "Tax ID is required!" }),
|
taxId: z.string().trim().optional(),
|
||||||
logoImage: z.string().optional(),
|
logoImage: z.string().optional(),
|
||||||
officeNumber: z.string().trim().min(1, { message: "Office Number is required!" }),
|
officeNumber: z.string().trim().optional(),
|
||||||
contactNumber: z.string().trim()
|
contactNumber: z.string().trim()
|
||||||
.nonempty("Contact number is required")
|
.nonempty("Contact number is required")
|
||||||
.regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"),
|
.regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"),
|
||||||
|
|||||||
@ -46,6 +46,12 @@ const DateRangePicker = ({
|
|||||||
};
|
};
|
||||||
}, [onRangeChange, DateDifference, endDateMode]);
|
}, [onRangeChange, DateDifference, endDateMode]);
|
||||||
|
|
||||||
|
const handleIconClick = () => {
|
||||||
|
if (inputRef.current) {
|
||||||
|
inputRef.current._flatpickr.open(); // directly opens flatpickr
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`col-${sm} col-sm-${md} px-1`}>
|
<div className={`col-${sm} col-sm-${md} px-1`}>
|
||||||
<input
|
<input
|
||||||
@ -57,7 +63,7 @@ const DateRangePicker = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<i
|
<i
|
||||||
className="bx bx-calendar calendar-icon cursor-pointer position-relative top-50 translate-middle-y "
|
className="bx bx-calendar calendar-icon cursor-pointer position-relative top-50 translate-middle-y " onClick={handleIconClick}
|
||||||
style={{ right: "22px", bottom: "-8px" }}
|
style={{ right: "22px", bottom: "-8px" }}
|
||||||
></i>
|
></i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
const FilterIcon = ({
|
const FilterIcon = ({
|
||||||
taskListData,
|
taskListData,
|
||||||
@ -7,15 +8,26 @@ const FilterIcon = ({
|
|||||||
currentSelectedFloors,
|
currentSelectedFloors,
|
||||||
currentSelectedActivities,
|
currentSelectedActivities,
|
||||||
}) => {
|
}) => {
|
||||||
|
const selectedProject = useSelector((store) => store.localVariables.projectId);
|
||||||
|
|
||||||
const [selectedBuilding, setSelectedBuilding] = useState(currentSelectedBuilding || "");
|
const [selectedBuilding, setSelectedBuilding] = useState(currentSelectedBuilding || "");
|
||||||
const [selectedFloors, setSelectedFloors] = useState(currentSelectedFloors || []);
|
const [selectedFloors, setSelectedFloors] = useState(currentSelectedFloors || []);
|
||||||
const [selectedActivities, setSelectedActivities] = useState(currentSelectedActivities || []);
|
const [selectedActivities, setSelectedActivities] = useState(currentSelectedActivities || []);
|
||||||
|
|
||||||
|
const [appliedBuilding, setAppliedBuilding] = useState(currentSelectedBuilding || "");
|
||||||
|
const [appliedFloors, setAppliedFloors] = useState(currentSelectedFloors || []);
|
||||||
|
const [appliedActivities, setAppliedActivities] = useState(currentSelectedActivities || []);
|
||||||
|
|
||||||
|
// Reset filters whenever inputs OR projectId changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSelectedBuilding(currentSelectedBuilding || "");
|
setSelectedBuilding(currentSelectedBuilding || "");
|
||||||
setSelectedFloors(currentSelectedFloors || []);
|
setSelectedFloors(currentSelectedFloors || []);
|
||||||
setSelectedActivities(currentSelectedActivities || []);
|
setSelectedActivities(currentSelectedActivities || []);
|
||||||
}, [currentSelectedBuilding, currentSelectedFloors, currentSelectedActivities]);
|
|
||||||
|
setAppliedBuilding(currentSelectedBuilding || "");
|
||||||
|
setAppliedFloors(currentSelectedFloors || []);
|
||||||
|
setAppliedActivities(currentSelectedActivities || []);
|
||||||
|
}, [currentSelectedBuilding, currentSelectedFloors, currentSelectedActivities, selectedProject]);
|
||||||
|
|
||||||
const getUniqueFilterValues = (key, overrideBuilding, overrideFloors) => {
|
const getUniqueFilterValues = (key, overrideBuilding, overrideFloors) => {
|
||||||
if (!taskListData) return [];
|
if (!taskListData) return [];
|
||||||
@ -61,12 +73,11 @@ const FilterIcon = ({
|
|||||||
} else if (filterType === "floor") {
|
} else if (filterType === "floor") {
|
||||||
if (updatedFloors.includes(value)) {
|
if (updatedFloors.includes(value)) {
|
||||||
updatedFloors = updatedFloors.filter((floor) => floor !== value);
|
updatedFloors = updatedFloors.filter((floor) => floor !== value);
|
||||||
|
const validActivities = getUniqueFilterValues("activity", updatedBuilding, updatedFloors);
|
||||||
|
updatedActivities = updatedActivities.filter((act) => validActivities.includes(act));
|
||||||
} else {
|
} else {
|
||||||
updatedFloors.push(value);
|
updatedFloors.push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const validActivities = getUniqueFilterValues("activity", updatedBuilding, updatedFloors);
|
|
||||||
updatedActivities = updatedActivities.filter((act) => validActivities.includes(act));
|
|
||||||
} else if (filterType === "activity") {
|
} else if (filterType === "activity") {
|
||||||
if (updatedActivities.includes(value)) {
|
if (updatedActivities.includes(value)) {
|
||||||
updatedActivities = updatedActivities.filter((act) => act !== value);
|
updatedActivities = updatedActivities.filter((act) => act !== value);
|
||||||
@ -78,12 +89,20 @@ const FilterIcon = ({
|
|||||||
setSelectedBuilding(updatedBuilding);
|
setSelectedBuilding(updatedBuilding);
|
||||||
setSelectedFloors(updatedFloors);
|
setSelectedFloors(updatedFloors);
|
||||||
setSelectedActivities(updatedActivities);
|
setSelectedActivities(updatedActivities);
|
||||||
|
};
|
||||||
|
|
||||||
|
const applyFilters = () => {
|
||||||
|
setAppliedBuilding(selectedBuilding);
|
||||||
|
setAppliedFloors(selectedFloors);
|
||||||
|
setAppliedActivities(selectedActivities);
|
||||||
|
|
||||||
onApplyFilters({
|
onApplyFilters({
|
||||||
selectedBuilding: updatedBuilding,
|
selectedBuilding,
|
||||||
selectedFloors: updatedFloors,
|
selectedFloors,
|
||||||
selectedActivities: updatedActivities,
|
selectedActivities,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById("filterDropdown").click();
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearAllFilters = () => {
|
const clearAllFilters = () => {
|
||||||
@ -91,6 +110,10 @@ const FilterIcon = ({
|
|||||||
setSelectedFloors([]);
|
setSelectedFloors([]);
|
||||||
setSelectedActivities([]);
|
setSelectedActivities([]);
|
||||||
|
|
||||||
|
setAppliedBuilding("");
|
||||||
|
setAppliedFloors([]);
|
||||||
|
setAppliedActivities([]);
|
||||||
|
|
||||||
onApplyFilters({
|
onApplyFilters({
|
||||||
selectedBuilding: "",
|
selectedBuilding: "",
|
||||||
selectedFloors: [],
|
selectedFloors: [],
|
||||||
@ -98,21 +121,51 @@ const FilterIcon = ({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Count applied filters
|
||||||
|
const appliedFilterCount =
|
||||||
|
(appliedBuilding ? 1 : 0) + appliedFloors.length + appliedActivities.length;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="dropdown" style={{marginLeft:"-14px"}}>
|
<div className="dropdown" style={{ marginLeft: "-14px", position: "relative" }}>
|
||||||
<a
|
<a
|
||||||
className="dropdown-toggle hide-arrow cursor-pointer"
|
className="dropdown-toggle hide-arrow cursor-pointer"
|
||||||
id="filterDropdown"
|
id="filterDropdown"
|
||||||
data-bs-toggle="dropdown"
|
data-bs-toggle="dropdown"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
>
|
>
|
||||||
{/* <i className="bx bx-slider-alt ms-1" /> */}
|
<div style={{ position: "relative", display: "inline-block" }}>
|
||||||
<i
|
<i
|
||||||
className="bx bx-slider-alt"
|
className="bx bx-slider-alt"
|
||||||
style={{ color: selectedBuilding || selectedFloors.length > 0 || selectedActivities.length > 0 ? "#7161EF" : "gray" }}
|
style={{
|
||||||
|
color: appliedFilterCount > 0 ? "#7161EF" : "gray",
|
||||||
|
fontSize: "20px",
|
||||||
|
}}
|
||||||
></i>
|
></i>
|
||||||
|
{appliedFilterCount > 0 && (
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: "-11px",
|
||||||
|
right: "-6px",
|
||||||
|
backgroundColor: "#FFC107", // yellow
|
||||||
|
color: "white",
|
||||||
|
fontSize: "10px",
|
||||||
|
fontWeight: "bold",
|
||||||
|
borderRadius: "50%",
|
||||||
|
width: "18px",
|
||||||
|
height: "18px",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
border: "1px solid white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{appliedFilterCount}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<ul
|
<ul
|
||||||
className="dropdown-menu p-2 mt-2"
|
className="dropdown-menu p-2 mt-2"
|
||||||
aria-labelledby="filterDropdown"
|
aria-labelledby="filterDropdown"
|
||||||
@ -205,45 +258,30 @@ const FilterIcon = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
<li><hr className="my-1" /></li>
|
<li>
|
||||||
{(selectedBuilding || selectedFloors.length > 0 || selectedActivities.length > 0) && (
|
<hr className="my-1" />
|
||||||
<li className="d-flex justify-content-end gap-2 px-2">
|
</li>
|
||||||
|
{(appliedFilterCount > 0 ||
|
||||||
|
selectedBuilding ||
|
||||||
|
selectedFloors.length > 0 ||
|
||||||
|
selectedActivities.length > 0) && (
|
||||||
|
<li className="d-flex justify-content-end gap-2 px-2 mt-2 mb-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm"
|
className="btn btn-secondary btn-sm py-0 px-2"
|
||||||
style={{
|
|
||||||
backgroundColor: "#7161EF",
|
|
||||||
color: "white",
|
|
||||||
fontSize: "13px",
|
|
||||||
padding: "4px 16px",
|
|
||||||
borderRadius: "8px",
|
|
||||||
boxShadow: "0 1px 4px rgba(0,0,0,0.1)"
|
|
||||||
}}
|
|
||||||
onClick={clearAllFilters}
|
onClick={clearAllFilters}
|
||||||
>
|
>
|
||||||
Clear
|
Clear
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm"
|
className="btn btn-primary btn-sm py-0 px-2"
|
||||||
style={{
|
onClick={applyFilters}
|
||||||
backgroundColor: "#7161EF",
|
|
||||||
color: "white",
|
|
||||||
fontSize: "13px",
|
|
||||||
padding: "4px 16px",
|
|
||||||
borderRadius: "8px",
|
|
||||||
boxShadow: "0 1px 4px rgba(0,0,0,0.1)"
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
document.getElementById("filterDropdown").click();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Apply
|
Apply
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -123,8 +123,7 @@ useEffect(() => {
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("activityName")}
|
{...register("activityName")}
|
||||||
className={`form-control form-control-sm ${
|
className={`form-control form-control-sm ${errors.activityName ? "is-invalid" : ""
|
||||||
errors.activityName ? "is-invalid" : ""
|
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
{errors.activityName && (
|
{errors.activityName && (
|
||||||
@ -137,8 +136,7 @@ useEffect(() => {
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
{...register("unitOfMeasurement")}
|
{...register("unitOfMeasurement")}
|
||||||
className={`form-control form-control-sm ${
|
className={`form-control form-control-sm ${errors.unitOfMeasurement ? "is-invalid" : ""
|
||||||
errors.unitOfMeasurement ? "is-invalid" : ""
|
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
{errors.unitOfMeasurement && (
|
{errors.unitOfMeasurement && (
|
||||||
@ -226,12 +224,13 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait" : "Submit"}
|
{isLoading ? "Please Wait" : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button" // ✅ change to button
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -97,13 +97,16 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
resetForm(); // clear inputs
|
||||||
|
onClose?.(); // close modal from parent
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -97,13 +97,16 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
resetForm(); // clear inputs
|
||||||
|
onClose?.(); // close modal from parent
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -123,13 +123,16 @@ const CreateJobRole = ({onClose}) => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button" // ✅ change from reset → button
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
resetForm(); // optional: clears form
|
||||||
|
onClose?.(); // ✅ close modal via parent
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -233,13 +233,13 @@ const CreateRole = ({ modalType, onClose }) => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={onClose}
|
||||||
aria-label="Close"
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -77,9 +77,9 @@ useEffect(() => {
|
|||||||
|
|
||||||
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">
|
||||||
<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">
|
||||||
<label className="form-label">Category Name</label>
|
<label className="form-label">Category Name</label>
|
||||||
@ -113,10 +113,12 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
resetForm(); // clear inputs
|
||||||
|
onClose?.(); // close modal from parent
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -34,13 +34,15 @@ const DeleteMaster = ({ master, onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button" // ✅ not reset
|
||||||
className="btn btn-label-secondary"
|
className="btn btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
onClose?.(); // properly close modal
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -241,7 +241,7 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait" : "Submit"}
|
{isLoading ? "Please Wait" : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button" // ✅ change to button
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -116,10 +116,12 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
resetForm(); // clear inputs
|
||||||
|
onClose?.(); // close modal from parent
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -116,10 +116,12 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button" // ✅ not reset
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={() => {
|
||||||
aria-label="Close"
|
resetForm(); // clear inputs
|
||||||
|
onClose?.(); // close modal from parent
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -134,13 +134,13 @@ const [descriptionLength, setDescriptionLength] = useState(data?.description?.le
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={onClose} // 👈 This will now close the popup
|
||||||
aria-label="Close"
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -280,11 +280,11 @@ const EditMaster = ({ master, onClose }) => {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={onClose}
|
||||||
aria-label="Close"
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -121,13 +121,13 @@ useEffect(() => {
|
|||||||
{isLoading ? "Please Wait..." : "Submit"}
|
{isLoading ? "Please Wait..." : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={onClose}
|
||||||
aria-label="Close"
|
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -79,14 +79,14 @@ const ManagePaymentMode = ({ data = null, onClose }) => {
|
|||||||
{isPending || Updating ? "Please Wait..." : Updating ? "Update" : "Submit"}
|
{isPending || Updating ? "Please Wait..." : Updating ? "Update" : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="reset"
|
type="button"
|
||||||
className="btn btn-sm btn-label-secondary"
|
className="btn btn-sm btn-label-secondary"
|
||||||
data-bs-dismiss="modal"
|
onClick={onClose} // ✅ call onClose here
|
||||||
aria-label="Close"
|
|
||||||
disabled={isPending || Updating}
|
disabled={isPending || Updating}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -17,13 +17,13 @@ const cleanFilter = (filter) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// moment.utc() to get consistent UTC ISO strings
|
// moment.utc() to get consistent UTC ISO strings
|
||||||
if (!cleaned.startDate) {
|
// if (!cleaned.startDate) {
|
||||||
cleaned.startDate = moment.utc().subtract(7, "days").startOf("day").toISOString();
|
// cleaned.startDate = moment.utc().subtract(7, "days").startOf("day").toISOString();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!cleaned.endDate) {
|
// if (!cleaned.endDate) {
|
||||||
cleaned.endDate = moment.utc().startOf("day").toISOString();
|
// cleaned.endDate = moment.utc().startOf("day").toISOString();
|
||||||
}
|
// }
|
||||||
|
|
||||||
return cleaned;
|
return cleaned;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useMemo, useRef, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { useTaskList } from "../../hooks/useTasks";
|
import { useTaskList } from "../../hooks/useTasks";
|
||||||
import { useProjectName } from "../../hooks/useProjects";
|
import { useProjectName } from "../../hooks/useProjects";
|
||||||
@ -46,6 +46,15 @@ const DailyTask = () => {
|
|||||||
}
|
}
|
||||||
}, [selectedProject, projectNames, dispatch]);
|
}, [selectedProject, projectNames, dispatch]);
|
||||||
|
|
||||||
|
// 🔹 Reset filters when project changes
|
||||||
|
useEffect(() => {
|
||||||
|
setFilters({
|
||||||
|
selectedBuilding: "",
|
||||||
|
selectedFloors: [],
|
||||||
|
selectedActivities: [],
|
||||||
|
});
|
||||||
|
}, [selectedProject]);
|
||||||
|
|
||||||
// Memoized filtering
|
// Memoized filtering
|
||||||
const filteredTasks = useMemo(() => {
|
const filteredTasks = useMemo(() => {
|
||||||
if (!TaskList) return [];
|
if (!TaskList) return [];
|
||||||
@ -164,6 +173,7 @@ const DailyTask = () => {
|
|||||||
currentSelectedBuilding={filters.selectedBuilding}
|
currentSelectedBuilding={filters.selectedBuilding}
|
||||||
currentSelectedFloors={filters.selectedFloors}
|
currentSelectedFloors={filters.selectedFloors}
|
||||||
currentSelectedActivities={filters.selectedActivities}
|
currentSelectedActivities={filters.selectedActivities}
|
||||||
|
selectedProject={selectedProject}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,7 @@ const LoginPage = () => {
|
|||||||
Login With Password
|
Login With Password
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
<Link to="/auth/reqest/demo" className="registration-link">
|
<Link to="/market/enquire" className="registration-link">
|
||||||
Request a Demo
|
Request a Demo
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -122,13 +122,16 @@ const MasterPage = () => {
|
|||||||
onChange={(e) => dispatch(changeMaster(e.target.value))}
|
onChange={(e) => dispatch(changeMaster(e.target.value))}
|
||||||
name="DataTables_Table_0_length"
|
name="DataTables_Table_0_length"
|
||||||
aria-controls="DataTables_Table_0"
|
aria-controls="DataTables_Table_0"
|
||||||
className="form-select form-select-sm"
|
className="form-select py-1 px-2"
|
||||||
|
style={{ fontSize: "0.875rem", height: "32px", width: "150px" }}
|
||||||
value={selectedMaster}
|
value={selectedMaster}
|
||||||
>
|
>
|
||||||
{isLoading && (<option value={null}>Loading...</option>)}
|
{isLoading && <option value="">Loading...</option>}
|
||||||
{(!isLoading && data) && data?.map((item) => (
|
{!isLoading &&
|
||||||
|
data?.map((item) => (
|
||||||
<option key={item.id} value={item.name}>{item.name}</option>
|
<option key={item.id} value={item.name}>
|
||||||
|
{item.name}
|
||||||
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@ -34,6 +34,8 @@ export const DirectoryRepository = {
|
|||||||
DeleteNote: (id, isActive) =>
|
DeleteNote: (id, isActive) =>
|
||||||
api.delete(`/api/directory/note/${id}?active=${isActive}`),
|
api.delete(`/api/directory/note/${id}?active=${isActive}`),
|
||||||
|
|
||||||
GetNotes: (pageSize, pageNumber) =>
|
GetNotes: (pageSize, pageNumber, projectId) =>
|
||||||
api.get(`/api/directory/notes?pageSize=${pageSize}&pageNumber=${pageNumber}`),
|
api.get(
|
||||||
|
`/api/directory/notes?pageSize=${pageSize}&pageNumber=${pageNumber}&projectId=${projectId}`
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { api } from "../utils/axiosClient";
|
import { api } from "../utils/axiosClient";
|
||||||
|
|
||||||
export const MarketRepository = {
|
export const MarketRepository = {
|
||||||
requestDemo: (data) => api.post("/api/market/inquiry", data),
|
requestDemo: (data) => api.post("/api/market/enquire", data),
|
||||||
getIndustries: () => api.get("api/market/industries"),
|
getIndustries: () => api.get("api/market/industries"),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const router = createBrowserRouter(
|
|||||||
children: [
|
children: [
|
||||||
{ path: "/auth/login", element: <LoginPage /> },
|
{ path: "/auth/login", element: <LoginPage /> },
|
||||||
{ path: "/auth/login-otp", element: <LoginWithOtp /> },
|
{ path: "/auth/login-otp", element: <LoginWithOtp /> },
|
||||||
{ path: "/auth/reqest/demo", element: <RegisterPage /> },
|
{ path: "/market/enquire", element: <RegisterPage /> },
|
||||||
{ path: "/auth/forgot-password", element: <ForgotPasswordPage /> },
|
{ path: "/auth/forgot-password", element: <ForgotPasswordPage /> },
|
||||||
{ path: "/reset-password", element: <ResetPasswordPage /> },
|
{ path: "/reset-password", element: <ResetPasswordPage /> },
|
||||||
{ path: "/legal-info", element: <LegalInfoCard /> },
|
{ path: "/legal-info", element: <LegalInfoCard /> },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user