diff --git a/src/components/MyActiveJobs/ActiveJobs.jsx b/src/components/MyActiveJobs/ActiveJobs.jsx index 7cb2cca..db690aa 100644 --- a/src/components/MyActiveJobs/ActiveJobs.jsx +++ b/src/components/MyActiveJobs/ActiveJobs.jsx @@ -5,6 +5,7 @@ import { useNavigate } from "react-router-dom"; import ActiveJobMessage from "./ActiveJobMessage"; import LoadingSpinner from "../Spinners/LoadingSpinner"; import CountDown from "../Helpers/CountDown"; +import IndexJobActions from "./JobActions/IndexJobActions"; import usersService from "../../services/UsersService"; @@ -261,9 +262,10 @@ function ActiveJobs(props) {

Actions

-

+ {/*

Waiting for the completion message from the client before you can approve. -

+

*/} +
{/* TEXTAREA SECTION */} diff --git a/src/components/MyActiveJobs/JobActions/CurrentJobAction.jsx b/src/components/MyActiveJobs/JobActions/CurrentJobAction.jsx index d2af4e9..1b2174f 100644 --- a/src/components/MyActiveJobs/JobActions/CurrentJobAction.jsx +++ b/src/components/MyActiveJobs/JobActions/CurrentJobAction.jsx @@ -2,7 +2,11 @@ import React from 'react' function CurrentJobAction() { return ( -
CurrentJobAction
+
+

+ Waiting for the completion message from the client before you can approve. Owner True & Active +

+
) } diff --git a/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx b/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx index aeb0fde..7611921 100644 --- a/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx +++ b/src/components/MyActiveJobs/JobActions/CurrentTaskAction.jsx @@ -2,7 +2,11 @@ import React from 'react' function CurrentTaskAction() { return ( -
CurrentTaskAction
+
+

+ Waiting for the completion message from the client before you can approve. Worker True & Active +

+
) } diff --git a/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx b/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx new file mode 100644 index 0000000..d718675 --- /dev/null +++ b/src/components/MyActiveJobs/JobActions/IndexJobActions.jsx @@ -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 + }else if(description == 'PASTDUE'){ + return + }else if(description == 'REVIEW'){ + return + } else { + return null + } + })() + case 'WORKER': + return (()=>{ + if(description == 'ACTIVE'){ + return + }else if(description == 'PASTDUE'){ + return + }else if(description == 'REVIEW'){ + return + } else { + return null + } + })() + default: + return null + } +} + +export default IndexJobActions \ No newline at end of file diff --git a/src/components/MyActiveJobs/JobActions/PassDueJobAction.jsx b/src/components/MyActiveJobs/JobActions/PassDueJobAction.jsx deleted file mode 100644 index bdc1f92..0000000 --- a/src/components/MyActiveJobs/JobActions/PassDueJobAction.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -function PassDueJobAction() { - return ( -
PassDueJobAction
- ) -} - -export default PassDueJobAction \ No newline at end of file diff --git a/src/components/MyActiveJobs/JobActions/PassDueTaskAction.jsx b/src/components/MyActiveJobs/JobActions/PassDueTaskAction.jsx deleted file mode 100644 index 1bde31c..0000000 --- a/src/components/MyActiveJobs/JobActions/PassDueTaskAction.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -function PassDueTaskAction() { - return ( -
PassDueTaskAction
- ) -} - -export default PassDueTaskAction \ No newline at end of file diff --git a/src/components/MyActiveJobs/JobActions/PastDueJobAction.jsx b/src/components/MyActiveJobs/JobActions/PastDueJobAction.jsx new file mode 100644 index 0000000..2d87a31 --- /dev/null +++ b/src/components/MyActiveJobs/JobActions/PastDueJobAction.jsx @@ -0,0 +1,13 @@ +import React from 'react' + +function PastDueJobAction() { + return ( +
+

+ Waiting for the completion message from the client before you can approve. Owner True & PastDue +

+
+ ) +} + +export default PastDueJobAction \ No newline at end of file diff --git a/src/components/MyActiveJobs/JobActions/PastDueTaskAction.jsx b/src/components/MyActiveJobs/JobActions/PastDueTaskAction.jsx new file mode 100644 index 0000000..045c896 --- /dev/null +++ b/src/components/MyActiveJobs/JobActions/PastDueTaskAction.jsx @@ -0,0 +1,13 @@ +import React from 'react' + +function PastDueTaskAction() { + return ( +
+

+ Waiting for the completion message from the client before you can approve. Worker True & PastDue +

+
+ ) +} + +export default PastDueTaskAction \ No newline at end of file diff --git a/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx b/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx index 0e6fe32..a9b5900 100644 --- a/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx +++ b/src/components/MyActiveJobs/JobActions/ReviewJobAction.jsx @@ -2,7 +2,11 @@ import React from 'react' function ReviewJobAction() { return ( -
ReviewJobAction
+
+

+ Waiting for the completion message from the client before you can approve. Owner True & Review Job +

+
) } diff --git a/src/components/MyActiveJobs/JobActions/ReviewTaskAction.jsx b/src/components/MyActiveJobs/JobActions/ReviewTaskAction.jsx index ed5fd1b..d50eb90 100644 --- a/src/components/MyActiveJobs/JobActions/ReviewTaskAction.jsx +++ b/src/components/MyActiveJobs/JobActions/ReviewTaskAction.jsx @@ -2,7 +2,11 @@ import React from 'react' function ReviewTaskAction() { return ( -
ReviewTaskAction
+
+

+ Waiting for the completion message from the client before you can approve. Worker True & Review Job +

+
) }