Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0526fdb572 | |||
| 7352c30969 |
@@ -5,6 +5,7 @@ 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 IndexJobActions from "./JobActions/IndexJobActions";
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
|
||||||
@@ -261,9 +262,10 @@ function ActiveJobs(props) {
|
|||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full lg:w-1/2">
|
||||||
<div className="">
|
<div className="">
|
||||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Actions</h1>
|
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Actions</h1>
|
||||||
<p className="my-3 py-1 text-base">
|
{/* <p className="my-3 py-1 text-base">
|
||||||
Waiting for the completion message from the client before you can approve.
|
Waiting for the completion message from the client before you can approve.
|
||||||
</p>
|
</p> */}
|
||||||
|
<IndexJobActions details={props.details} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* TEXTAREA SECTION */}
|
{/* TEXTAREA SECTION */}
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ import React from 'react'
|
|||||||
|
|
||||||
function CurrentJobAction() {
|
function CurrentJobAction() {
|
||||||
return (
|
return (
|
||||||
<div>CurrentJobAction</div>
|
<div className=''>
|
||||||
|
<p className="my-3 py-1 text-base">
|
||||||
|
Waiting for the completion message from the client before you can approve. Owner True & Active
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ import React from 'react'
|
|||||||
|
|
||||||
function CurrentTaskAction() {
|
function CurrentTaskAction() {
|
||||||
return (
|
return (
|
||||||
<div>CurrentTaskAction</div>
|
<div className=''>
|
||||||
|
<p className="my-3 py-1 text-base">
|
||||||
|
Waiting for the completion message from the client before you can approve. Worker True & Active
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import CurrentJobAction from './CurrentJobAction'
|
||||||
|
import CurrentTaskAction from './CurrentTaskAction'
|
||||||
|
|
||||||
|
import PastDueJobAction from './PastDueJobAction'
|
||||||
|
import PastDueTaskAction from './PastDueTaskAction'
|
||||||
|
|
||||||
|
import ReviewJobAction from './ReviewJobAction'
|
||||||
|
import ReviewTaskAction from './ReviewTaskAction'
|
||||||
|
|
||||||
|
function IndexJobActions({details}) { // FUNCTION TO RENDER SPECIFIC JOB ACTION DEPENDING ON OWNER STATUS & STATUS DESCRIPTION
|
||||||
|
let owner = details.owner_status
|
||||||
|
let description = details.status_description
|
||||||
|
switch(owner) {
|
||||||
|
case 'OWNER':
|
||||||
|
return (()=>{
|
||||||
|
if(description == 'ACTIVE'){
|
||||||
|
return <CurrentJobAction />
|
||||||
|
}else if(description == 'PASTDUE'){
|
||||||
|
return <PastDueJobAction />
|
||||||
|
}else if(description == 'REVIEW'){
|
||||||
|
return <ReviewJobAction />
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
case 'WORKER':
|
||||||
|
return (()=>{
|
||||||
|
if(description == 'ACTIVE'){
|
||||||
|
return <CurrentTaskAction />
|
||||||
|
}else if(description == 'PASTDUE'){
|
||||||
|
return <PastDueTaskAction />
|
||||||
|
}else if(description == 'REVIEW'){
|
||||||
|
return <ReviewTaskAction />
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
default:
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default IndexJobActions
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
|
|
||||||
function PassDueJobAction() {
|
|
||||||
return (
|
|
||||||
<div>PassDueJobAction</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PassDueJobAction
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
|
|
||||||
function PassDueTaskAction() {
|
|
||||||
return (
|
|
||||||
<div>PassDueTaskAction</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PassDueTaskAction
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
function PastDueJobAction() {
|
||||||
|
return (
|
||||||
|
<div className=''>
|
||||||
|
<p className="my-3 py-1 text-base">
|
||||||
|
Waiting for the completion message from the client before you can approve. Owner True & PastDue
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PastDueJobAction
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
function PastDueTaskAction() {
|
||||||
|
return (
|
||||||
|
<div className=''>
|
||||||
|
<p className="my-3 py-1 text-base">
|
||||||
|
Waiting for the completion message from the client before you can approve. Worker True & PastDue
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PastDueTaskAction
|
||||||
@@ -2,7 +2,11 @@ import React from 'react'
|
|||||||
|
|
||||||
function ReviewJobAction() {
|
function ReviewJobAction() {
|
||||||
return (
|
return (
|
||||||
<div>ReviewJobAction</div>
|
<div className=''>
|
||||||
|
<p className="my-3 py-1 text-base">
|
||||||
|
Waiting for the completion message from the client before you can approve. Owner True & Review Job
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ import React from 'react'
|
|||||||
|
|
||||||
function ReviewTaskAction() {
|
function ReviewTaskAction() {
|
||||||
return (
|
return (
|
||||||
<div>ReviewTaskAction</div>
|
<div className=''>
|
||||||
|
<p className="my-3 py-1 text-base">
|
||||||
|
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user