From b13034a995dae823c3b454bdaf0d75bb223082d6 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Thu, 13 Nov 2025 15:14:07 +0530 Subject: [PATCH 1/5] Expense widget - Layout change --- src/components/Project/ProjectOverview.jsx | 138 ++++++++++----------- src/components/collections/AddPayment.jsx | 2 +- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/components/Project/ProjectOverview.jsx b/src/components/Project/ProjectOverview.jsx index ee665144..7a8bd59e 100644 --- a/src/components/Project/ProjectOverview.jsx +++ b/src/components/Project/ProjectOverview.jsx @@ -133,10 +133,10 @@ const ProjectOverview = ({ project }) => { }, }, stroke: { - lineCap: "round", + lineCap: "round", }, - labels: ["Progress"], - series: [percentage], + labels: ["Progress"], + series: [percentage], }; }; const [radialPercentage, setRadialPercentage] = useState(75); // Initial percentage @@ -165,7 +165,7 @@ const ProjectOverview = ({ project }) => { }, [selectedProject]); return ( -
+
{" "} @@ -173,75 +173,75 @@ const ProjectOverview = ({ project }) => { Project Statistics
-
-
    -
  • -
    - {/* Centered Chart */} -
    -
    - -
    -
    - - {/* Info Section */} -
    -
    - {/* Tasks Planned */} -
    -
    - - - +
    +
      +
    • +
      + {/* Centered Chart */} +
      +
      + +
      -
      - Tasks Planned -
      - {FormattedNumber(current_project?.plannedWork)} -
      + + {/* Info Section */} +
      +
      + {/* Tasks Planned */} +
      +
      + + + +
      +
      + Tasks Planned +
      + {FormattedNumber(current_project?.plannedWork)} +
      +
      +
      + + {/* Tasks Completed */} +
      +
      + + + +
      +
      + Tasks Completed +
      + {FormattedNumber(current_project?.completedWork)} +
      +
      +
      + + {/* Team Size */} +
      +
      + + + +
      +
      + Current Team Size +
      + {FormattedNumber(current_project?.teamSize)} +
      +
      +
      +
      - - {/* Tasks Completed */} -
      -
      - - - -
      -
      - Tasks Completed -
      - {FormattedNumber(current_project?.completedWork)} -
      -
      -
      - - {/* Team Size */} -
      -
      - - - -
      -
      - Current Team Size -
      - {FormattedNumber(current_project?.teamSize)} -
      -
      -
      -
      -
    +
  • +
- - -
); diff --git a/src/components/collections/AddPayment.jsx b/src/components/collections/AddPayment.jsx index a47200ee..1ad641b8 100644 --- a/src/components/collections/AddPayment.jsx +++ b/src/components/collections/AddPayment.jsx @@ -72,7 +72,7 @@ const AddPayment = ({ onClose }) => {
- Date: Thu, 13 Nov 2025 17:22:54 +0530 Subject: [PATCH 2/5] UI implementation has been done in Expense --- src/components/Dashboard/Dashboard.jsx | 2 +- src/components/Dashboard/ExpenseAnalysis.jsx | 96 +++++++++++--------- src/components/Dashboard/ExpenseStatus.jsx | 4 +- 3 files changed, 54 insertions(+), 48 deletions(-) diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index 3d0f0a66..84e97fd6 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -57,7 +57,7 @@ const Dashboard = () => {
-
+
diff --git a/src/components/Dashboard/ExpenseAnalysis.jsx b/src/components/Dashboard/ExpenseAnalysis.jsx index 1fe27fae..6026ba20 100644 --- a/src/components/Dashboard/ExpenseAnalysis.jsx +++ b/src/components/Dashboard/ExpenseAnalysis.jsx @@ -7,11 +7,12 @@ import { FormProvider, useForm } from "react-hook-form"; import { formatCurrency, localToUtc } from "../../utils/appUtils"; import { useProjectName } from "../../hooks/useProjects"; import { SpinnerLoader } from "../common/Loader"; +import flatColors from "../Charts/flatColor"; const ExpenseAnalysis = () => { const projectId = useSelectedProject(); const [projectName, setProjectName] = useState("All Project"); - const { projectNames, loading } = useProjectName(); + const { projectNames } = useProjectName(); const methods = useForm({ defaultValues: { startDate: "", endDate: "" }, @@ -50,7 +51,7 @@ const ExpenseAnalysis = () => { labels, legend: { show: false }, dataLabels: { enabled: true, formatter: (val) => `${val.toFixed(0)}%` }, - colors: ["#7367F0", "#28C76F", "#FF9F43", "#EA5455", "#00CFE8", "#FF78B8"], + colors: flatColors, plotOptions: { pie: { donut: { @@ -79,22 +80,19 @@ const ExpenseAnalysis = () => { return ( <> -
-
+
Expense Breakdown
- {/*

Category Wise Expense Breakdown

*/}

{projectName}

-
+
- {/* Card body */}
{isLoading && (
{
)} - {!isLoading && report.length > 0 && ( <> {isFetching && ( @@ -123,50 +120,59 @@ const ExpenseAnalysis = () => {
)} -
- -
+
+ {/* Chart Column */} +
+ +
-
-
- {report.map((item, idx) => ( -
-
- - - + {/* Data/Legend Column */} +
+
+ {report.map((item, idx) => ( +
+
+ + {item.projectName} + + + {formatCurrency(item.totalApprovedAmount)} + +
-
- {item.projectName} - - {formatCurrency(item.totalApprovedAmount)} - -
-
- ))} + + ))} +
)}
- - {/* Header */} - ); }; diff --git a/src/components/Dashboard/ExpenseStatus.jsx b/src/components/Dashboard/ExpenseStatus.jsx index d6fefe7d..86a4fd8d 100644 --- a/src/components/Dashboard/ExpenseStatus.jsx +++ b/src/components/Dashboard/ExpenseStatus.jsx @@ -103,7 +103,7 @@ const ExpenseStatus = () => {
= 3 ? "text-xl" : "text-2xl" + className={`text-royalblue ${countDigit(item?.count || 0) >= 3 ? "text-xl" : "text-xl" } text-gray-500`} > {item?.count || 0} @@ -137,7 +137,7 @@ const ExpenseStatus = () => {
3 ? "text-" : "text-3xl" + className={`text-end text-royalblue ${countDigit(data?.totalAmount || 0) > 3 ? "text-xl" : "text-3xl" } text-md`} > {formatCurrency(data?.totalAmount || 0)} From 64d96d46d041d532130315afe7a44f38bb0d4c51 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 14 Nov 2025 12:58:47 +0530 Subject: [PATCH 3/5] Correction in UI in Dashboard weidget. --- ...ndanceChart.jsx => AttendanceOverview.jsx} | 4 +- src/components/Dashboard/Dashboard.jsx | 45 +++++++++---------- src/components/Dashboard/ExpenseAnalysis.jsx | 6 +-- src/components/Dashboard/ExpenseByProject.jsx | 2 +- .../Dashboard/ProjectCompletionChart.jsx | 7 ++- ...jectOverview.jsx => ProjectStatistics.jsx} | 4 +- src/hooks/useProjects.js | 8 ++-- src/pages/project/ProjectDetails.jsx | 4 +- src/repositories/ProjectRepository.jsx | 2 +- 9 files changed, 42 insertions(+), 40 deletions(-) rename src/components/Dashboard/{AttendanceChart.jsx => AttendanceOverview.jsx} (97%) rename src/components/Project/{ProjectOverview.jsx => ProjectStatistics.jsx} (99%) diff --git a/src/components/Dashboard/AttendanceChart.jsx b/src/components/Dashboard/AttendanceOverview.jsx similarity index 97% rename from src/components/Dashboard/AttendanceChart.jsx rename to src/components/Dashboard/AttendanceOverview.jsx index 71d14e48..77fbee51 100644 --- a/src/components/Dashboard/AttendanceChart.jsx +++ b/src/components/Dashboard/AttendanceOverview.jsx @@ -100,9 +100,9 @@ const AttendanceOverview = () => { }; return ( -
+
{/* Header */} -
+
Attendance Overview

Role-wise present count

diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index 84e97fd6..ad5ead8c 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -12,11 +12,11 @@ import Teams from "./Teams"; import TasksCard from "./Tasks"; import ProjectCompletionChart from "./ProjectCompletionChart"; import ProjectProgressChart from "./ProjectProgressChart"; -import ProjectOverview from "../Project/ProjectOverview"; -import AttendanceOverview from "./AttendanceChart"; +import AttendanceOverview from "./AttendanceOverview"; import ExpenseAnalysis from "./ExpenseAnalysis"; import ExpenseStatus from "./ExpenseStatus"; import ExpenseByProject from "./ExpenseByProject"; +import ProjectStatistics from "../Project/ProjectStatistics"; const Dashboard = () => { @@ -29,16 +29,16 @@ const Dashboard = () => {
{isAllProjectsSelected && (
- +
)}
- +
- +
{isAllProjectsSelected && ( @@ -46,32 +46,31 @@ const Dashboard = () => {
)} - - {!isAllProjectsSelected && ( -
- -
- )} -
-
-
- -
-
- -
-
- -
-
{!isAllProjectsSelected && (
)} + + {!isAllProjectsSelected && ( +
+ +
+ )} +
+
+ +
+
+ +
+
+ +
+
diff --git a/src/components/Dashboard/ExpenseAnalysis.jsx b/src/components/Dashboard/ExpenseAnalysis.jsx index 6026ba20..3c6b0d08 100644 --- a/src/components/Dashboard/ExpenseAnalysis.jsx +++ b/src/components/Dashboard/ExpenseAnalysis.jsx @@ -122,18 +122,18 @@ const ExpenseAnalysis = () => {
{/* Chart Column */} -
+
{/* Data/Legend Column */} -
+
{report.map((item, idx) => (
{
{/* Header */}
-
+
Monthly Expense -

{projectName}

diff --git a/src/components/Dashboard/ProjectCompletionChart.jsx b/src/components/Dashboard/ProjectCompletionChart.jsx index 98ee1d3b..7cc4a092 100644 --- a/src/components/Dashboard/ProjectCompletionChart.jsx +++ b/src/components/Dashboard/ProjectCompletionChart.jsx @@ -1,11 +1,14 @@ -import React from "react"; +import React, { useState } from "react"; import HorizontalBarChart from "../Charts/HorizontalBarChart"; import { useProjects } from "../../hooks/useProjects"; +import { ITEMS_PER_PAGE } from "../../utils/constants"; const ProjectCompletionChart = () => { - const { data: projects = [], isLoading: loading, isError, error } = useProjects(); + const [currentPage, setCurrentPage] = useState(1); + const { data: projects, isLoading: loading, isError, error } = useProjects(currentPage, ITEMS_PER_PAGE); + console.log("Kartik", projects) // Bar chart logic const projectNames = projects?.map((p) => p.name) || []; const projectProgress = diff --git a/src/components/Project/ProjectOverview.jsx b/src/components/Project/ProjectStatistics.jsx similarity index 99% rename from src/components/Project/ProjectOverview.jsx rename to src/components/Project/ProjectStatistics.jsx index 7a8bd59e..7ec5dbd3 100644 --- a/src/components/Project/ProjectOverview.jsx +++ b/src/components/Project/ProjectStatistics.jsx @@ -9,7 +9,7 @@ import { import ReactApexChart from "react-apexcharts"; import Chart from "react-apexcharts"; -const ProjectOverview = ({ project }) => { +const ProjectStatistics = ({ project }) => { const { data } = useProjects(); const [current_project, setCurrentProject] = useState( data?.find((pro) => pro.id == project) @@ -247,4 +247,4 @@ const ProjectOverview = ({ project }) => { ); }; -export default ProjectOverview; \ No newline at end of file +export default ProjectStatistics; \ No newline at end of file diff --git a/src/hooks/useProjects.js b/src/hooks/useProjects.js index b958ff32..b73f3db9 100644 --- a/src/hooks/useProjects.js +++ b/src/hooks/useProjects.js @@ -20,13 +20,13 @@ export const useCurrentService = () => { // ------------------------------Query------------------- -export const useProjects = (pageSize,pageNumber) => { +export const useProjects = (pageNumber,pageSize) => { const loggedUser = useSelector((store) => store.globalVariables.loginUser); return useQuery({ - queryKey: ["ProjectsList",pageSize,pageNumber], + queryKey: ["ProjectsList",pageNumber,pageSize], queryFn: async () => { - const response = await ProjectRepository.getProjectList(pageSize,pageNumber); - return response.data; + const response = await ProjectRepository.getProjectList(pageNumber,pageSize); + return response?.data?.data; }, enabled: !!loggedUser, }); diff --git a/src/pages/project/ProjectDetails.jsx b/src/pages/project/ProjectDetails.jsx index 011d1e9b..298e95fb 100644 --- a/src/pages/project/ProjectDetails.jsx +++ b/src/pages/project/ProjectDetails.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback } from "react"; import { useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; -import ProjectOverview from "../../components/Project/ProjectOverview"; +import ProjectOverview from "../../components/Project/ProjectStatistics"; import AboutProject from "../../components/Project/AboutProject"; import ProjectNav from "../../components/Project/ProjectNav"; import Teams from "../../components/Project/Team/Teams"; @@ -15,7 +15,7 @@ import { useProjectDetails, useProjectName } from "../../hooks/useProjects"; import { ComingSoonPage } from "../Misc/ComingSoonPage"; import eventBus from "../../services/eventBus"; import ProjectProgressChart from "../../components/Dashboard/ProjectProgressChart"; -import AttendanceOverview from "../../components/Dashboard/AttendanceChart"; +import AttendanceOverview from "../../components/Dashboard/AttendanceOverview"; import { setProjectId } from "../../slices/localVariablesSlice"; import ProjectDocuments from "../../components/Project/ProjectDocuments"; import ProjectSetting from "../../components/Project/ProjectSetting"; diff --git a/src/repositories/ProjectRepository.jsx b/src/repositories/ProjectRepository.jsx index 1220d085..1de7d87e 100644 --- a/src/repositories/ProjectRepository.jsx +++ b/src/repositories/ProjectRepository.jsx @@ -1,7 +1,7 @@ import { api } from "../utils/axiosClient"; const ProjectRepository = { - getProjectList: (pageSize,pageNumber) => api.get(`/api/project/list?pageSize=${pageSize}&pageNumber=${pageNumber}`), + getProjectList: (pageNumber,pageSize) => api.get(`/api/project/list?&pageNumber=${pageNumber}&pageSize=${pageSize}`), getProjectByprojectId: (projetid) => api.get(`/api/project/details/${projetid}`), From b39997794650000191646c4cda157f6b275b0b3a Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 14 Nov 2025 15:39:40 +0530 Subject: [PATCH 4/5] Invoice list should display according to the selected date range in Collection module. --- src/components/collections/CollectionList.jsx | 160 +++++++++--------- src/hooks/useCollections.jsx | 90 +++++++--- src/pages/collections/CollectionPage.jsx | 3 +- src/repositories/ColllectionRepository.jsx | 46 +++-- 4 files changed, 180 insertions(+), 119 deletions(-) diff --git a/src/components/collections/CollectionList.jsx b/src/components/collections/CollectionList.jsx index 7ef961c3..bb94130e 100644 --- a/src/components/collections/CollectionList.jsx +++ b/src/components/collections/CollectionList.jsx @@ -27,16 +27,16 @@ const CollectionList = ({ fromDate, toDate, isPending, searchString }) => { const selectedProject = useSelectedProject(); const searchDebounce = useDebounce(searchString, 500); - + const { data, isLoading, isError, error } = useCollections( - ITEMS_PER_PAGE, - currentPage, + selectedProject, + searchDebounce, localToUtc(fromDate), localToUtc(toDate), - isPending, + ITEMS_PER_PAGE, + currentPage, true, - selectedProject, - searchDebounce + isPending ); const { setProcessedPayment, setAddPayment, setViewCollection } = useCollectionContext(); @@ -186,84 +186,84 @@ const CollectionList = ({ fromDate, toDate, isPending, searchString }) => { canViewCollection || canEditCollection || canCreate) && ( - -
- + +
+ -
- - )} + {/* Mark Payment */} + {isAdmin && ( +
  • + + setProcessedPayment({ + isOpen: true, + invoiceId: row.id, + }) + } + > + + Mark Payment + +
  • + )} + + )} + +
    + + )} )) ) : ( diff --git a/src/hooks/useCollections.jsx b/src/hooks/useCollections.jsx index c300462d..324c678a 100644 --- a/src/hooks/useCollections.jsx +++ b/src/hooks/useCollections.jsx @@ -2,39 +2,80 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { CollectionRepository } from "../repositories/ColllectionRepository"; import showToast from "../services/toastService"; +// export const useCollections = ( +// pageSize, +// pageNumber, +// fromDate, +// toDate, +// isPending, +// isActive, +// projectId, +// searchString +// ) => { +// return useQuery({ +// queryKey: [ +// "collections", +// pageSize, +// pageNumber, +// fromDate, +// toDate, +// isPending, +// isActive, +// projectId, +// searchString, +// ], + +// queryFn: async () => { +// const response = await CollectionRepository.getCollections( +// pageSize, +// pageNumber, +// fromDate, +// toDate, +// isPending, +// isActive, +// projectId, +// searchString +// ); +// return response.data; +// }, + +// keepPreviousData: true, +// staleTime: 1000 * 60 * 1, +// }); +// }; export const useCollections = ( - pageSize, - pageNumber, + projectId, + searchString, fromDate, toDate, - isPending, + pageSize, + pageNumber, isActive, - projectId, - searchString + isPending ) => { return useQuery({ queryKey: [ "collections", - pageSize, - pageNumber, - fromDate, - toDate, - isPending, - isActive, projectId, searchString, + fromDate, + toDate, + pageSize, + pageNumber, + isActive, + isPending, ], queryFn: async () => { const response = await CollectionRepository.getCollections( - pageSize, - pageNumber, + projectId, + searchString, fromDate, toDate, - isPending, + pageSize, + pageNumber, isActive, - projectId, - searchString + isPending ); return response.data; }, @@ -44,15 +85,14 @@ export const useCollections = ( }); }; - -export const useCollection =(collectionId)=>{ +export const useCollection = (collectionId) => { return useQuery({ - queryKey:["collection",collectionId], - queryFn:async()=> { + queryKey: ["collection", collectionId], + queryFn: async () => { const resp = await CollectionRepository.getCollection(collectionId); return resp.data }, - enabled:!!collectionId + enabled: !!collectionId }) } @@ -133,11 +173,11 @@ export const useAddComment = (onSuccessCallBack) => { }); }; -export const useUpdateCollection =(onSuccessCallBack)=>{ - const client = useQueryClient(); +export const useUpdateCollection = (onSuccessCallBack) => { + const client = useQueryClient(); return useMutation({ - mutationFn:async({collectionId,payload})=> await CollectionRepository.updateCollection(collectionId,payload), - onSuccess: () => { + mutationFn: async ({ collectionId, payload }) => await CollectionRepository.updateCollection(collectionId, payload), + onSuccess: () => { client.invalidateQueries({ queryKey: ["collections"] }); client.invalidateQueries({ queryKey: ["collection"] }); showToast("Collection Updated Successfully", "success"); diff --git a/src/pages/collections/CollectionPage.jsx b/src/pages/collections/CollectionPage.jsx index fbac9564..3a67d94c 100644 --- a/src/pages/collections/CollectionPage.jsx +++ b/src/pages/collections/CollectionPage.jsx @@ -117,7 +117,8 @@ const CollectionPage = () => { {/* Left side: Date Picker + Show Pending (stacked on mobile) */}
    - +
    diff --git a/src/repositories/ColllectionRepository.jsx b/src/repositories/ColllectionRepository.jsx index 8eb512da..04db4369 100644 --- a/src/repositories/ColllectionRepository.jsx +++ b/src/repositories/ColllectionRepository.jsx @@ -4,26 +4,46 @@ import { DirectoryRepository } from "./DirectoryRepository"; export const CollectionRepository = { createNewCollection: (data) => api.post(`/api/Collection/invoice/create`, data), - updateCollection:(id,data)=>{ - api.put(`/api/Collection/invoice/edit/${id}`,data) + updateCollection: (id, data) => { + api.put(`/api/Collection/invoice/edit/${id}`, data) }, - getCollections: (pageSize, pageNumber,fromDate,toDate, isPending,isActive,projectId, searchString) => { - let url = `/api/Collection/invoice/list?pageSize=${pageSize}&pageNumber=${pageNumber}&isPending=${isPending}&isActive=${isActive}&searchString=${searchString}`; + // getCollections: (pageSize, pageNumber,fromDate,toDate, isPending,isActive,projectId, searchString) => { + // let url = `/api/Collection/invoice/list?pageSize=${pageSize}&pageNumber=${pageNumber}&isPending=${isPending}&isActive=${isActive}&searchString=${searchString}`; + // const params = []; + // if (fromDate) params.push(`fromDate=${fromDate}`); + // if (toDate) params.push(`toDate=${toDate}`); + // if(projectId) params.push(`projectId=${projectId}`) + + // if (params.length > 0) { + // url += `&${params.join("&")}`; + // } + // return api.get(url); + // }, + + getCollections: (projectId, searchString, fromDate, toDate, pageSize, pageNumber, isActive, isPending) => { + let url = `/api/Collection/invoice/list`; const params = []; - if (fromDate) params.push(`fromDate=${fromDate}`); - if (toDate) params.push(`toDate=${toDate}`); - if(projectId) params.push(`projectId=${projectId}`) + + if (projectId) params.push(`projectId=${projectId}`); + if (searchString) params.push(`search=${searchString}`); + if (fromDate) params.push(`dateFrom=${fromDate}`); + if (toDate) params.push(`dateTo=${toDate}`); + if (pageSize) params.push(`pageSize=${pageSize}`); + if (pageNumber) params.push(`pageNumber=${pageNumber}`); + if (isActive) params.push(`isActive=${isActive}`); + if (isPending) params.push(`isPending=${isPending}`); if (params.length > 0) { - url += `&${params.join("&")}`; + url += "?" + params.join("&"); } - return api.get(url); + + return api.get(url); }, - makeReceivePayment:(data)=> api.post(`/api/Collection/invoice/payment/received`,data), - markPaymentReceived:(invoiceId)=>api.put(`/api/Collection/invoice/marked/completed/${invoiceId}`), - getCollection:(id)=>api.get(`/api/Collection/invoice/details/${id}`), - addComment:(data)=>api.post(`/api/Collection/invoice/add/comment`,data) + makeReceivePayment: (data) => api.post(`/api/Collection/invoice/payment/received`, data), + markPaymentReceived: (invoiceId) => api.put(`/api/Collection/invoice/marked/completed/${invoiceId}`), + getCollection: (id) => api.get(`/api/Collection/invoice/details/${id}`), + addComment: (data) => api.post(`/api/Collection/invoice/add/comment`, data) }; From 0bd1cea70305348890b938de8ee3cbb2d8f6cd24 Mon Sep 17 00:00:00 2001 From: Vikas Nale Date: Mon, 17 Nov 2025 18:30:13 +0530 Subject: [PATCH 5/5] 1) Handle blank space in menu bar 2) Breadcrum "Home" link to "Dashboard" on pages where it was missing --- src/components/Layout/Sidebar.jsx | 2 +- .../AdvancePayment/AdvancePaymentPage.jsx | 14 +++-- src/pages/Expense/ExpensePage.jsx | 20 ++++--- src/pages/Gallary/ImageGallaryPage.jsx | 27 +++++---- src/pages/Organization/OrganizationPage.jsx | 22 +++---- .../PaymentRequest/PaymentRequestPage.jsx | 59 +++++++++++-------- src/pages/collections/CollectionPage.jsx | 17 ++++-- 7 files changed, 93 insertions(+), 68 deletions(-) diff --git a/src/components/Layout/Sidebar.jsx b/src/components/Layout/Sidebar.jsx index b41cb654..1f4b63b8 100644 --- a/src/components/Layout/Sidebar.jsx +++ b/src/components/Layout/Sidebar.jsx @@ -99,7 +99,7 @@ const MenuItem = (item) => { className={`menu-link ${hasSubmenu ? "menu-toggle" : ""}`} target={item.link?.includes("http") ? "_blank" : undefined} > - + {item.icon && }
    {item.name}
    {item.available === false && (
    diff --git a/src/pages/AdvancePayment/AdvancePaymentPage.jsx b/src/pages/AdvancePayment/AdvancePaymentPage.jsx index e81c69a5..9af4a6c9 100644 --- a/src/pages/AdvancePayment/AdvancePaymentPage.jsx +++ b/src/pages/AdvancePayment/AdvancePaymentPage.jsx @@ -26,7 +26,7 @@ export const useAdvancePaymentContext = () => { }; const AdvancePaymentPage = () => { const [balance, setBalance] = useState(null); - const {control, reset, watch } = useForm({ + const { control, reset, watch } = useForm({ defaultValues: { employeeId: "", }, @@ -39,14 +39,13 @@ const AdvancePaymentPage = () => { employeeId: selectedEmpoyee || "", }); }, [reset]); - return (
    { balance > 0 ? "text-success" : "text-danger" } fs-5 fw-bold ms-1`} > - { balance > 0 ? : } {formatFigure(balance, { + {balance > 0 ? ( + + ) : ( + + )}{" "} + {formatFigure(balance, { type: "currency", currency: "INR", })} @@ -85,8 +89,6 @@ const AdvancePaymentPage = () => {
    - -
    diff --git a/src/pages/Expense/ExpensePage.jsx b/src/pages/Expense/ExpensePage.jsx index 034651c2..e7ac3638 100644 --- a/src/pages/Expense/ExpensePage.jsx +++ b/src/pages/Expense/ExpensePage.jsx @@ -1,4 +1,10 @@ -import React, { createContext, useContext, useState, useEffect, useRef } from "react"; +import React, { + createContext, + useContext, + useState, + useEffect, + useRef, +} from "react"; import { useForm, useFormContext } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { useSelector } from "react-redux"; @@ -19,7 +25,10 @@ import { VIEW_SELF_EXPENSE, } from "../../utils/constants"; -import { defaultFilter, SearchSchema } from "../../components/Expenses/ExpenseSchema"; +import { + defaultFilter, + SearchSchema, +} from "../../components/Expenses/ExpenseSchema"; import PreviewDocument from "../../components/Expenses/PreviewDocument"; // Context @@ -102,14 +111,14 @@ const ExpensePage = () => { setManageExpenseModal, setDocumentView, filterData, - removeFilterChip + removeFilterChip, }; return (
    {IsViewAll || IsViewSelf || IsCreatedAble ? ( @@ -128,7 +137,6 @@ const ExpensePage = () => {
    - {IsCreatedAble && (
    - - { }; const ImageGalleryPage = () => { - const [filter,setFilter] = useState() + const [filter, setFilter] = useState(); const selectedProjectId = useSelectedProject(); const { projectNames } = useProjectName(); - const [openGallery, setOpenGallery] = useState({ isOpen: false, data: null }); @@ -56,24 +55,26 @@ const ImageGalleryPage = () => { setOpenGallery, }; - const { setOffcanvasContent, setShowTrigger } = useFab(); + const { setOffcanvasContent, setShowTrigger } = useFab(); - useEffect(()=>{ + useEffect(() => { setShowTrigger(true); - setOffcanvasContent("Gallery Filter",); - - return ()=>{ - setOffcanvasContent("",null) - setShowTrigger(false); - } - },[]) + setOffcanvasContent( + "Gallery Filter", + + ); + return () => { + setOffcanvasContent("", null); + setShowTrigger(false); + }; + }, []); return (
    @@ -104,7 +105,7 @@ const ImageGalleryPage = () => {
    )} */} - +
    {openGallery?.isOpen && ( diff --git a/src/pages/Organization/OrganizationPage.jsx b/src/pages/Organization/OrganizationPage.jsx index 95629d87..017245e9 100644 --- a/src/pages/Organization/OrganizationPage.jsx +++ b/src/pages/Organization/OrganizationPage.jsx @@ -6,12 +6,15 @@ import OrganizationsList from "../../components/Organization/OrganizationsList"; const OrganizationPage = () => { const { isOpen, orgData, startStep, onOpen, flowType } = useOrganizationModal(); - const [searchText, setSearchText] = useState("") + const [searchText, setSearchText] = useState(""); return (
    @@ -29,27 +32,24 @@ const OrganizationPage = () => {
    -
    +
    - -
    - +
    -
    ); }; diff --git a/src/pages/PaymentRequest/PaymentRequestPage.jsx b/src/pages/PaymentRequest/PaymentRequestPage.jsx index d19b8250..286e99bb 100644 --- a/src/pages/PaymentRequest/PaymentRequestPage.jsx +++ b/src/pages/PaymentRequest/PaymentRequestPage.jsx @@ -6,7 +6,10 @@ import ExpenseFilterPanel from "../../components/Expenses/ExpenseFilterPanel"; import { useFab } from "../../Context/FabContext"; import PaymentRequestList from "../../components/PaymentRequest/PaymentRequestList"; import PaymentRequestFilterPanel from "../../components/PaymentRequest/PaymentRequestFilterPanel"; -import { defaultPaymentRequestFilter,SearchPaymentRequestSchema } from "../../components/PaymentRequest/PaymentRequestSchema"; +import { + defaultPaymentRequestFilter, + SearchPaymentRequestSchema, +} from "../../components/PaymentRequest/PaymentRequestSchema"; import ViewPaymentRequest from "../../components/PaymentRequest/ViewPaymentRequest"; import PreviewDocument from "../../components/Expenses/PreviewDocument"; import MakeExpense from "../../components/PaymentRequest/MakeExpense"; @@ -15,7 +18,9 @@ export const PaymentRequestContext = createContext(); export const usePaymentRequestContext = () => { const context = useContext(PaymentRequestContext); if (!context) { - throw new Error("usePaymentRequestContext must be used within an ExpenseProvider"); + throw new Error( + "usePaymentRequestContext must be used within an ExpenseProvider" + ); } return context; }; @@ -24,16 +29,21 @@ const PaymentRequestPage = () => { IsOpen: null, RequestId: null, }); - const [ViewRequest,setVieRequest] = useState({view:false,requestId:null}) + const [ViewRequest, setVieRequest] = useState({ + view: false, + requestId: null, + }); const { setOffcanvasContent, setShowTrigger } = useFab(); const [filters, setFilters] = useState(defaultPaymentRequestFilter); - const [ViewDocument, setDocumentView] = useState({ - IsOpen: false, - Image: null, - }); - const [isExpenseGenerate,setIsExpenseGenerate] = useState({IsOpen: null, - RequestId: null,}) - const [modalSize,setModalSize] = useState("md") + const [ViewDocument, setDocumentView] = useState({ + IsOpen: false, + Image: null, + }); + const [isExpenseGenerate, setIsExpenseGenerate] = useState({ + IsOpen: null, + RequestId: null, + }); + const [modalSize, setModalSize] = useState("md"); const [search, setSearch] = useState(""); const contextValue = { @@ -42,11 +52,10 @@ const PaymentRequestPage = () => { setDocumentView, setModalSize, setIsExpenseGenerate, - isExpenseGenerate + isExpenseGenerate, }; useEffect(() => { - setShowTrigger(true); setOffcanvasContent( "Payment Request Filters", @@ -65,7 +74,7 @@ const PaymentRequestPage = () => { {/* Breadcrumb */} { className="form-control form-control-sm w-auto" placeholder="Search Payment Request" value={search} - style={{minWidth:"200px"}} + style={{ minWidth: "200px" }} onChange={(e) => setSearch(e.target.value)} />
    @@ -106,10 +115,7 @@ const PaymentRequestPage = () => {
    - + {/* Add/Edit Modal */} {ManageRequest.IsOpen && ( @@ -129,7 +135,7 @@ const PaymentRequestPage = () => { /> )} - + {ViewRequest.view && ( { modalType="top" closeModal={() => setVieRequest({ requestId: null, view: false })} > - + )} - {isExpenseGenerate.IsOpen && ( + {isExpenseGenerate.IsOpen && ( setIsExpenseGenerate({IsOpen:false, requestId: null})} + closeModal={() => + setIsExpenseGenerate({ IsOpen: false, requestId: null }) + } > setIsExpenseGenerate({IsOpen:false, requestId: null})} /> + nse + onClose={() => + setIsExpenseGenerate({ IsOpen: false, requestId: null }) + } + /> )} @@ -161,7 +173,6 @@ const PaymentRequestPage = () => { )} -
    ); diff --git a/src/pages/collections/CollectionPage.jsx b/src/pages/collections/CollectionPage.jsx index fbac9564..998d469b 100644 --- a/src/pages/collections/CollectionPage.jsx +++ b/src/pages/collections/CollectionPage.jsx @@ -101,7 +101,7 @@ const CollectionPage = () => { ) { return ( ); } @@ -109,7 +109,10 @@ const CollectionPage = () => {
    @@ -152,16 +155,18 @@ const CollectionPage = () => { )}
    -
    -