Adding Project name in Jobs Weidget.
This commit is contained in:
parent
976d03d16e
commit
64ad8e25ae
@ -3,13 +3,14 @@ import { useParams } from "react-router-dom";
|
|||||||
import { useJobsProgression } from "../../hooks/useDashboard_Data";
|
import { useJobsProgression } from "../../hooks/useDashboard_Data";
|
||||||
import { SpinnerLoader } from "../common/Loader";
|
import { SpinnerLoader } from "../common/Loader";
|
||||||
import { formatUTCToLocalTime } from "../../utils/dateUtils";
|
import { formatUTCToLocalTime } from "../../utils/dateUtils";
|
||||||
|
import { useServiceProject } from "../../hooks/useServiceProject";
|
||||||
|
|
||||||
const ServiceJobs = () => {
|
const ServiceJobs = () => {
|
||||||
const { projectId } = useParams();
|
const { projectId } = useParams();
|
||||||
const { data, isLoading, isError } = useJobsProgression(projectId);
|
const { data, isLoading, isError } = useJobsProgression(projectId);
|
||||||
|
|
||||||
const jobs = data || {};
|
const jobs = data || {};
|
||||||
|
const { data: projectData, isLoading: projectLoading } = useServiceProject(projectId);
|
||||||
const tabMapping = [
|
const tabMapping = [
|
||||||
{ id: "tab-new", label: "My Jobs", key: "allJobs" },
|
{ id: "tab-new", label: "My Jobs", key: "allJobs" },
|
||||||
{ id: "tab-preparing", label: "Assigned", key: "assignedJobs" },
|
{ id: "tab-preparing", label: "Assigned", key: "assignedJobs" },
|
||||||
@ -22,7 +23,9 @@ const ServiceJobs = () => {
|
|||||||
<div className="card-header d-flex justify-content-between">
|
<div className="card-header d-flex justify-content-between">
|
||||||
<div className="card-title mb-0 text-start">
|
<div className="card-title mb-0 text-start">
|
||||||
<h5 className="mb-1 fw-bold">Service Jobs</h5>
|
<h5 className="mb-1 fw-bold">Service Jobs</h5>
|
||||||
<p className="card-subtitle">All Projects</p>
|
<p className="card-subtitle">
|
||||||
|
{projectLoading ? "Loading..." : projectData?.name || "All Projects"}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -180,7 +180,7 @@ export const useExpenseStatus = (projectId) => {
|
|||||||
};
|
};
|
||||||
export const useJobsProgression = (projectId) => {
|
export const useJobsProgression = (projectId) => {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ["jobs_Progression", projectId],
|
queryKey: ["serviceProjectJobs", projectId],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const resp = await GlobalRepository.getJobsProgression(projectId);
|
const resp = await GlobalRepository.getJobsProgression(projectId);
|
||||||
return resp.data;
|
return resp.data;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user