Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 06549bf9bb | |||
| 2cd7ce9392 | |||
| 835b583056 | |||
| b72d9ccc35 | |||
| 225166a8be | |||
| b54a6fbee2 |
@@ -40,6 +40,7 @@ import ManageActiveJobs from "./views/ManageActiveJobs";
|
|||||||
import FamilyManagePage from "./views/FamilyManagePage";
|
import FamilyManagePage from "./views/FamilyManagePage";
|
||||||
import MyCouponPage from "./views/MyCouponPage";
|
import MyCouponPage from "./views/MyCouponPage";
|
||||||
import AuthRedirect from "./views/AuthRedirect";
|
import AuthRedirect from "./views/AuthRedirect";
|
||||||
|
import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
|
||||||
|
|
||||||
export default function Routers() {
|
export default function Routers() {
|
||||||
return (
|
return (
|
||||||
@@ -86,6 +87,7 @@ export default function Routers() {
|
|||||||
<Route exact path="/myjobs" element={<MyJobsPage />} />
|
<Route exact path="/myjobs" element={<MyJobsPage />} />
|
||||||
<Route exact path="/add-job" element={<AddJobPage />} />
|
<Route exact path="/add-job" element={<AddJobPage />} />
|
||||||
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
|
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
|
||||||
|
<Route exact path="/my-pastdue-jobs" element={<MyPastDueJobsPage />} />
|
||||||
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
|
<Route exact path="/my-pending-jobs" element={<MyPendingJobsPage />} />
|
||||||
<Route exact path="/acc-family" element={<FamilyAccPage />} />
|
<Route exact path="/acc-family" element={<FamilyAccPage />} />
|
||||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
@@ -32,7 +32,7 @@ export default function HomeBannerOffersCard(props) {
|
|||||||
{props.itemData.description}
|
{props.itemData.description}
|
||||||
</div>
|
</div>
|
||||||
<div className="siderCardButton">
|
<div className="siderCardButton">
|
||||||
[BUTTON HERE]
|
[ {props.itemData.button_text} ]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,17 @@ import Layout from "../Partials/Layout";
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import ActiveJobMessage from "./ActiveJobMessage";
|
import ActiveJobMessage from "./ActiveJobMessage";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
import CountDown from "../Helpers/CountDown";
|
import CountDown from "../Helpers/CountDown";
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
|
||||||
function ActiveJobs(props) {
|
function ActiveJobs(props) {
|
||||||
const ApiCall = new usersService()
|
const ApiCall = new usersService()
|
||||||
|
let navigate = useNavigate()
|
||||||
|
|
||||||
let { userDetails } = useSelector((state) => state.userDetails);
|
let { userDetails } = useSelector((state) => state.userDetails);
|
||||||
let navigate = useNavigate()
|
|
||||||
|
let [passDue, setPassDue] = useState(new Date() > new Date(props.details?.delivery_date)) // STATE TO KNOW IF TASK IS PASSED DUE TIME
|
||||||
|
|
||||||
let [messageToSend, setMessageToSend] = useState('') // State to hold the value of message to be sent
|
let [messageToSend, setMessageToSend] = useState('') // State to hold the value of message to be sent
|
||||||
|
|
||||||
@@ -147,10 +148,33 @@ function ActiveJobs(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FUNCTION TO CHECK IF TASK PASS DUE IS REACHED
|
||||||
|
let isPassedDue = () => {
|
||||||
|
// console.log('TESTING',new Date() > new Date(props.details?.delivery_date) )
|
||||||
|
if(new Date() > new Date(props.details?.delivery_date)){
|
||||||
|
setPassDue(true)
|
||||||
|
}else{
|
||||||
|
setPassDue(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!passDue){
|
||||||
|
let passDueInterval = setInterval(()=>{
|
||||||
|
isPassedDue()
|
||||||
|
},1000)
|
||||||
|
return ()=>{
|
||||||
|
clearInterval(passDueInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},[passDue])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|
||||||
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-8">
|
<div className="py-[20px] bg-white px-4 rounded-2xl shadow-md md:flex justify-between items-start gap-16">
|
||||||
{/* job title */}
|
{/* job title */}
|
||||||
<div className="w-full md:w-8/12">
|
<div className="w-full md:w-8/12">
|
||||||
<div className="w-full flex justify-start space-x-3 items-start">
|
<div className="w-full flex justify-start space-x-3 items-start">
|
||||||
@@ -175,9 +199,9 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full my-2">
|
<div className="w-full my-2">
|
||||||
<p className="w-full text-base text-right text-sky-blue">
|
<p className="w-full text-base text-right text-sky-blue">
|
||||||
{userDetails.firstname && userDetails.firstname}
|
{userDetails.firstname && userDetails.firstname}
|
||||||
</p>
|
</p>
|
||||||
<div className="text-base text-slate-700 dark:text-black tracking-wide">
|
<div className="text-base text-slate-700 dark:text-black tracking-wide">
|
||||||
<p className="font-semibold text-black">Description: </p>
|
<p className="font-semibold text-black">Description: </p>
|
||||||
<p className="p-2 border border-sky-blue">{props.details?.description && props.details.description}</p>
|
<p className="p-2 border border-sky-blue">{props.details?.description && props.details.description}</p>
|
||||||
@@ -189,19 +213,37 @@ function ActiveJobs(props) {
|
|||||||
{/* job details */}
|
{/* job details */}
|
||||||
<div className="w-full md:w-4/12">
|
<div className="w-full md:w-4/12">
|
||||||
<p className="text-base text-sky-blue">Delivery Detail</p>
|
<p className="text-base text-sky-blue">Delivery Detail</p>
|
||||||
<div className="my-1 flex items-start gap-3">
|
{passDue ?
|
||||||
<p className="font-semibold">Due: </p>
|
(
|
||||||
<div className="flex flex-col justify-between">
|
<div className="my-1">
|
||||||
<p className="text-base text-slate-700 dark:text-black tracking-wide">
|
<p className="text-base text-slate-700 dark:text-black">
|
||||||
<CountDown lastDate={props.details.delivery_date} />
|
<span className="font-semibold">Due: </span>
|
||||||
|
{props.details?.delivery_date &&
|
||||||
|
props.details.delivery_date.split(" ")[0]}
|
||||||
</p>
|
</p>
|
||||||
<div className="text-base text-slate-700 dark:text-black tracking-wide flex gap-[5px]">
|
<p className="py-2 text-base text-slate-700 dark:text-black">
|
||||||
<span>Hrs</span>
|
{props.details?.delivery_date &&
|
||||||
<span>Min</span>
|
props.details.delivery_date.split(" ")[1]}
|
||||||
<span>Sec</span>
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<div className="my-1 flex items-start gap-3">
|
||||||
|
<p className="font-semibold">Due: </p>
|
||||||
|
<div className="flex flex-col justify-between">
|
||||||
|
<p className="text-base text-slate-700 dark:text-black tracking-wide">
|
||||||
|
<CountDown lastDate={props.details.delivery_date} />
|
||||||
|
</p>
|
||||||
|
<div className="text-base text-slate-700 dark:text-black tracking-wide flex gap-[5px]">
|
||||||
|
<span>Hrs</span>
|
||||||
|
<span>Min</span>
|
||||||
|
<span>Sec</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
|
}
|
||||||
|
|
||||||
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
|
<div className="my-1 text-base text-slate-700 dark:text-black tracking-wide flex items-center gap-3">
|
||||||
<span className="font-semibold text-black">Duration: </span>
|
<span className="font-semibold text-black">Duration: </span>
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import Layout from "../Partials/Layout";
|
||||||
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
|
import MyActiveJobTable from "./MyActiveJobTable";
|
||||||
|
|
||||||
|
export default function MyPastDueJobs(props) {
|
||||||
|
const [selectTab, setValue] = useState("today");
|
||||||
|
const filterHandler = (value) => {
|
||||||
|
setValue(value);
|
||||||
|
};
|
||||||
|
console.log("AMEYE LOC1", props.MyJobList);
|
||||||
|
return (
|
||||||
|
<Layout>
|
||||||
|
<CommonHead
|
||||||
|
commonHeadData={props.commonHeadData}
|
||||||
|
/>
|
||||||
|
<div className="notification-page w-full mb-10">
|
||||||
|
<div className="notification-wrapper w-full">
|
||||||
|
{/* heading */}
|
||||||
|
<div className="sm:flex justify-between items-center mb-6">
|
||||||
|
<div className="mb-5 sm:mb-0">
|
||||||
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
|
<span
|
||||||
|
className={`${selectTab === "today" ? "block" : "hidden"}`}
|
||||||
|
>
|
||||||
|
Pass Due Job(s)
|
||||||
|
</span>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<div className="slider-btns flex space-x-4">
|
||||||
|
<div
|
||||||
|
onClick={() => filterHandler("today")}
|
||||||
|
className="relative"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<MyActiveJobTable MyJobList={props.MyJobList} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -219,6 +219,7 @@ class usersService {
|
|||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
job_mode: "ACTIVE",
|
||||||
limit: 30,
|
limit: 30,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
action: 13008,
|
action: 13008,
|
||||||
@@ -244,6 +245,7 @@ class usersService {
|
|||||||
uuid: localStorage.getItem("uid"),
|
uuid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
job_mode: "ACTIVE",
|
||||||
page: 0,
|
page: 0,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
limit: 100,
|
limit: 100,
|
||||||
@@ -251,6 +253,18 @@ class usersService {
|
|||||||
return this.postAuxEnd("/jobmanageractive", postData);
|
return this.postAuxEnd("/jobmanageractive", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMyPastDueJobList() {
|
||||||
|
var postData = {
|
||||||
|
uuid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
job_mode: "PASTDUE",
|
||||||
|
page: 0,
|
||||||
|
offset: 0,
|
||||||
|
limit: 100,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/jobmanageractive", postData);
|
||||||
|
}
|
||||||
getMyPendingJobList() {
|
getMyPendingJobList() {
|
||||||
var postData = {
|
var postData = {
|
||||||
uuid: localStorage.getItem("uid"),
|
uuid: localStorage.getItem("uid"),
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import React, { useContext,useState, useEffect } from "react";
|
||||||
|
import usersService from "../services/UsersService";
|
||||||
|
//import MyJobs from "../components/MyJobs";
|
||||||
|
//import MyActiveJobs from "../components/MyActiveJobs";
|
||||||
|
import MyPastDueJobs from "../components/MyActiveJobs/MyPastDueJobs";
|
||||||
|
|
||||||
|
export default function MyPastDueJobsPage() {
|
||||||
|
const commonHeadData =()=>{
|
||||||
|
console.log("COMMON HEAD DATA ----------------=====---------------------");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const [MyJobList, setMyJobList] = useState([]);
|
||||||
|
const api = new usersService();
|
||||||
|
//TARGET ENDPOINT[POST]http://10.204.5.100:9083/en/wrench/api/v1/jobmanageractive
|
||||||
|
const getMyJobList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await api.getMyPastDueJobList();
|
||||||
|
setMyJobList(res.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Error getting mode");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
getMyJobList();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// debugger;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<MyPastDueJobs
|
||||||
|
MyJobList={MyJobList}
|
||||||
|
commonHeadData={commonHeadData}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user