From 1544df966b37c83bb9212bfcc6dd6f3feba5833d Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Thu, 4 Dec 2025 12:59:59 +0530 Subject: [PATCH 01/19] Adding Weidget to the dashboard for jobs. --- public/assets/css/core-extend.css | 31 ++ src/components/Dashboard/Dashboard.jsx | 11 +- src/components/Dashboard/ServiceJobs.jsx | 323 +++++++----------- .../ServiceProject/ServiceProjectProfile.jsx | 6 +- src/hooks/useDashboard_Data.jsx | 9 + src/repositories/GlobalRepository.jsx | 2 + 6 files changed, 168 insertions(+), 214 deletions(-) diff --git a/public/assets/css/core-extend.css b/public/assets/css/core-extend.css index 3a8406cb..3783f2e7 100644 --- a/public/assets/css/core-extend.css +++ b/public/assets/css/core-extend.css @@ -470,3 +470,34 @@ font-weight: normal; .fs-md-xlarge { font-size: 170% !important; } .fs-md-xxlarge { font-size: calc(1.725rem + 5.7vw) !important; } } +/* ====================== Thin Scrollbar (Global) ====================== */ + +.job-scroll-wrapper { + max-height: 350px; + overflow-y: auto; + padding-right: 8px; + + /* Firefox thin scrollbar */ + scrollbar-width: thin; + scrollbar-color: #c8c8c8 transparent; +} + +/* Chrome, Edge, Safari */ +.job-scroll-wrapper::-webkit-scrollbar { + width: 4px; +} + +.job-scroll-wrapper::-webkit-scrollbar-track { + background: transparent; +} + +.job-scroll-wrapper::-webkit-scrollbar-thumb { + background-color: #c8c8c8; + border-radius: 20px; +} + +.job-scroll-wrapper::-webkit-scrollbar-thumb:hover { + background-color: #a0a0a0; +} + + diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index e918629d..2de8d444 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -72,7 +72,7 @@ const Dashboard = () => { {!isAllProjectsSelected && (canRegularize || canTeamAttendance || canSelfAttendance) && (
- +
)} @@ -83,10 +83,11 @@ const Dashboard = () => { )} - - {/*
- -
*/} + {isAllProjectsSelected && ( +
+ +
+ )} ); diff --git a/src/components/Dashboard/ServiceJobs.jsx b/src/components/Dashboard/ServiceJobs.jsx index 987addda..5b2f572a 100644 --- a/src/components/Dashboard/ServiceJobs.jsx +++ b/src/components/Dashboard/ServiceJobs.jsx @@ -1,9 +1,24 @@ import React from "react"; +import { useParams } from "react-router-dom"; +import { useJobsProgression } from "../../hooks/useDashboard_Data"; +import { SpinnerLoader } from "../common/Loader"; +import { formatUTCToLocalTime } from "../../utils/dateUtils"; const ServiceJobs = () => { + const { projectId } = useParams(); + const { data, isLoading, isError } = useJobsProgression(projectId); + + const jobs = data || {}; + + const tabMapping = [ + { id: "tab-new", label: "My Jobs", key: "allJobs" }, + { id: "tab-preparing", label: "Assigned", key: "assignedJobs" }, + { id: "tab-shipping", label: "In Progress", key: "inProgressJobs" }, + ]; + return ( -
-
+
+
Service Jobs
@@ -14,221 +29,113 @@ const ServiceJobs = () => {
- {/* Tabs */} + {/* ---------------- Tabs ---------------- */}
    -
  • - -
  • -
  • - -
  • -
  • - -
  • + {tabMapping.map((t, index) => ( +
  • + +
  • + ))}
- {/* Tab Content */} + {/* ---------------- Tab Content ---------------- */}
- {/* ---------------------- NEW TAB ---------------------- */} -
- {/* Entry 1 */} -
    -
  • - - - -
    -
    - Sender -
    -
    Myrtle Ullrich
    -

    101 Boulder, California(CA), 95959

    + {isLoading && ( +
    + +
    + )} + + + {isError && ( +

    Failed to load jobs

    + )} + + {!isLoading && + !isError && + tabMapping.map((t, index) => { + const list = jobs[t.key] || []; + + return ( +
    + {list.length === 0 ? ( +

    + No jobs found +

    + + ) : ( +
    + {list.map((job, i) => ( + +
      + + {/* Assigned By */} +
    • + + + +
      +
      + + Assigned By + +
      +
      {job.assignedBy}
      +

      + {formatUTCToLocalTime(job.assignedAt)} +

      +
      +
    • + + {/* Project */} +
    • + + + +
      +
      + Project +
      +
      {job.project}
      +

      {job.title}

      +
      +
    • +
    + + {/* Divider */} + {i < list.length - 1 && ( +
    + )} +
    + ))} +
    + )}
    -
  • -
  • - - - -
    -
    - Receiver -
    -
    Barry Schowalter
    -

    939 Orange, California(CA), 92118

    -
    -
  • -
- -
- - {/* Entry 2 */} -
    -
  • - - - -
    -
    - Sender -
    -
    Veronica Herman
    -

    162 Windsor, California(CA), 95492

    -
    -
  • -
  • - - - -
    -
    - Receiver -
    -
    Helen Jacobs
    -

    487 Sunset, California(CA), 94043

    -
    -
  • -
-
- - {/* ---------------------- PREPARING TAB ---------------------- */} -
- - {/* Entry 1 */} -
    -
  • - - - -
    -
    - Sender -
    -
    Oliver Grant
    -

    220 Pine St, California(CA), 95765

    -
    -
  • - -
  • - - - -
    -
    - Receiver -
    -
    Samantha Lee
    -

    744 Bay Area, California(CA), 94016

    -
    -
  • -
- -
- - {/* Entry 2 */} -
    -
  • - - - -
    -
    - Sender -
    -
    Marcus Howard
    -

    58 Avenue, California(CA), 95376

    -
    -
  • - -
  • - - - -
    -
    - Receiver -
    -
    Daniel Foster
    -

    312 Marina, California(CA), 94109

    -
    -
  • -
-
- - {/* ---------------------- SHIPPING TAB ---------------------- */} -
- - {/* Entry 1 */} -
    -
  • - - - -
    -
    - Sender -
    -
    James Carter
    -

    441 Market St, California(CA), 94111

    -
    -
  • - -
  • - - - -
    -
    - Receiver -
    -
    Linda Moore
    -

    990 Willow Road, California(CA), 94025

    -
    -
  • -
- -
- - {/* Entry 2 */} -
    -
  • - - - -
    -
    - Sender -
    -
    Sarah Bennett
    -

    882 Canyon Rd, California(CA), 94704

    -
    -
  • - -
  • - - - -
    -
    - Receiver -
    -
    George Simmons
    -

    19 Palm St, California(CA), 93001

    -
    -
  • -
-
- + ); + })}
-
); diff --git a/src/components/ServiceProject/ServiceProjectProfile.jsx b/src/components/ServiceProject/ServiceProjectProfile.jsx index 6ef359ff..689c2ae9 100644 --- a/src/components/ServiceProject/ServiceProjectProfile.jsx +++ b/src/components/ServiceProject/ServiceProjectProfile.jsx @@ -7,6 +7,7 @@ import GlobalModel from "../common/GlobalModel"; import { SpinnerLoader } from "../common/Loader"; import ServiceBranch from "./ServiceProjectBranch/ServiceBranch"; import ServiceProfile from "./ServiceProfile"; +import ServiceJobs from "../Dashboard/ServiceJobs"; const ServiceProjectProfile = () => { const { projectId } = useParams(); @@ -34,12 +35,15 @@ const ServiceProjectProfile = () => {
- +
+
+ +
); diff --git a/src/hooks/useDashboard_Data.jsx b/src/hooks/useDashboard_Data.jsx index 1a9d724a..af024331 100644 --- a/src/hooks/useDashboard_Data.jsx +++ b/src/hooks/useDashboard_Data.jsx @@ -178,6 +178,15 @@ export const useExpenseStatus = (projectId) => { }, }); }; +export const useJobsProgression = (projectId) => { + return useQuery({ + queryKey: ["jobs_Progression", projectId], + queryFn: async () => { + const resp = await GlobalRepository.getJobsProgression(projectId); + return resp.data; + }, + }); +}; export const useExpenseDataByProject = (projectId, categoryId, months) => { return useQuery({ diff --git a/src/repositories/GlobalRepository.jsx b/src/repositories/GlobalRepository.jsx index 2516020a..7bee2d1c 100644 --- a/src/repositories/GlobalRepository.jsx +++ b/src/repositories/GlobalRepository.jsx @@ -64,6 +64,8 @@ const GlobalRepository = { getExpenseStatus: (projectId) => api.get(`/api/Dashboard/expense/pendings${projectId ? `?projectId=${projectId}` : ""}`), + getJobsProgression: (projectId) => api.get(`/api/Dashboard/job/progression${projectId ? `?projectId=${projectId}` : ""}`), + getExpenseDataByProject: (projectId, categoryId, months) => { let url = `api/Dashboard/expense/monthly` const queryParams = []; From 976d03d16e295a16fa00e86f5f98c15a4d6ade89 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Thu, 4 Dec 2025 13:02:10 +0530 Subject: [PATCH 02/19] Changes in services. --- src/components/Dashboard/ServiceJobs.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Dashboard/ServiceJobs.jsx b/src/components/Dashboard/ServiceJobs.jsx index 5b2f572a..c9c54285 100644 --- a/src/components/Dashboard/ServiceJobs.jsx +++ b/src/components/Dashboard/ServiceJobs.jsx @@ -21,9 +21,9 @@ const ServiceJobs = () => {
-
Service Jobs
+
Service Jobs

All Projects

-
+
From 64ad8e25ae3d25002d58fabb53fa53c367e00064 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Thu, 4 Dec 2025 14:44:11 +0530 Subject: [PATCH 03/19] Adding Project name in Jobs Weidget. --- src/components/Dashboard/ServiceJobs.jsx | 7 +++++-- src/hooks/useDashboard_Data.jsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard/ServiceJobs.jsx b/src/components/Dashboard/ServiceJobs.jsx index c9c54285..94261790 100644 --- a/src/components/Dashboard/ServiceJobs.jsx +++ b/src/components/Dashboard/ServiceJobs.jsx @@ -3,13 +3,14 @@ import { useParams } from "react-router-dom"; import { useJobsProgression } from "../../hooks/useDashboard_Data"; import { SpinnerLoader } from "../common/Loader"; import { formatUTCToLocalTime } from "../../utils/dateUtils"; +import { useServiceProject } from "../../hooks/useServiceProject"; const ServiceJobs = () => { const { projectId } = useParams(); const { data, isLoading, isError } = useJobsProgression(projectId); const jobs = data || {}; - + const { data: projectData, isLoading: projectLoading } = useServiceProject(projectId); const tabMapping = [ { id: "tab-new", label: "My Jobs", key: "allJobs" }, { id: "tab-preparing", label: "Assigned", key: "assignedJobs" }, @@ -22,7 +23,9 @@ const ServiceJobs = () => {
Service Jobs
-

All Projects

+

+ {projectLoading ? "Loading..." : projectData?.name || "All Projects"} +

diff --git a/src/hooks/useDashboard_Data.jsx b/src/hooks/useDashboard_Data.jsx index af024331..68b914d7 100644 --- a/src/hooks/useDashboard_Data.jsx +++ b/src/hooks/useDashboard_Data.jsx @@ -180,7 +180,7 @@ export const useExpenseStatus = (projectId) => { }; export const useJobsProgression = (projectId) => { return useQuery({ - queryKey: ["jobs_Progression", projectId], + queryKey: ["serviceProjectJobs", projectId], queryFn: async () => { const resp = await GlobalRepository.getJobsProgression(projectId); return resp.data; From 8e68b5d4877ccd0b1b8f0b68e330c3c7ad10bb62 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Sat, 6 Dec 2025 15:16:08 +0530 Subject: [PATCH 04/19] Correction in Weidget. --- src/components/Dashboard/ServiceJobs.jsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard/ServiceJobs.jsx b/src/components/Dashboard/ServiceJobs.jsx index 94261790..e073a424 100644 --- a/src/components/Dashboard/ServiceJobs.jsx +++ b/src/components/Dashboard/ServiceJobs.jsx @@ -23,10 +23,10 @@ const ServiceJobs = () => {
Service Jobs
-

+

{projectLoading ? "Loading..." : projectData?.name || "All Projects"}

-
+
@@ -58,7 +58,19 @@ const ServiceJobs = () => { {isError && ( -

Failed to load jobs

+

+ No data found +

+ )} {!isLoading && From b6bce04160172b3bc1f484e76011999592a7c149 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Sat, 6 Dec 2025 15:43:12 +0530 Subject: [PATCH 05/19] Adding rupees symbol at hover effect. --- src/components/Dashboard/ExpenseAnalysis.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Dashboard/ExpenseAnalysis.jsx b/src/components/Dashboard/ExpenseAnalysis.jsx index 3c6b0d08..b45177fb 100644 --- a/src/components/Dashboard/ExpenseAnalysis.jsx +++ b/src/components/Dashboard/ExpenseAnalysis.jsx @@ -50,6 +50,11 @@ const ExpenseAnalysis = () => { chart: { type: "donut" }, labels, legend: { show: false }, + tooltip: { + y: { + formatter: (value) => formatCurrency(value), + }, + }, dataLabels: { enabled: true, formatter: (val) => `${val.toFixed(0)}%` }, colors: flatColors, plotOptions: { @@ -127,7 +132,7 @@ const ExpenseAnalysis = () => { options={donutOptions} series={series} type="donut" - width="70%" + width="75%" height={320} />
From 66c23adc74ae0376ecfd22f5e7be3b746076f600 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Mon, 8 Dec 2025 10:25:15 +0530 Subject: [PATCH 06/19] Adding sizing in ManageOrg --- src/components/Organization/ManagOrg.jsx | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/Organization/ManagOrg.jsx b/src/components/Organization/ManagOrg.jsx index d994b8b5..bd38cd9c 100644 --- a/src/components/Organization/ManagOrg.jsx +++ b/src/components/Organization/ManagOrg.jsx @@ -96,12 +96,12 @@ const ManagOrg = () => { return (
-
+
{errors.name && ( @@ -109,12 +109,12 @@ const ManagOrg = () => { )}
-
+
{errors.contactPerson && ( @@ -122,12 +122,12 @@ const ManagOrg = () => { )}
-
+
{errors.contactNumber && ( @@ -135,12 +135,12 @@ const ManagOrg = () => { )}
-
+
{errors.gstNumber && ( @@ -148,12 +148,12 @@ const ManagOrg = () => { )}
-
+
{errors.email && ( @@ -161,7 +161,7 @@ const ManagOrg = () => { )}
-
+
{ )}
-
+