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 = [];