Compare commits

...

9 Commits

7 changed files with 198 additions and 86 deletions
+3
View File
@@ -45,6 +45,9 @@ REACT_APP_FACEBOOK_CLIENT_ID=390204307987009
REACT_APP_FACEBOOK_CLIENT_SECRET=19f778e312f2ab96d147bacb612910c2 REACT_APP_FACEBOOK_CLIENT_SECRET=19f778e312f2ab96d147bacb612910c2
REACT_APP_FACEBOOK_CLIENT_SCOPE="email, public_profile" REACT_APP_FACEBOOK_CLIENT_SCOPE="email, public_profile"
REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4
#apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.lotus.g1.wrenchboard.com:76.209.103.227
#apigate.orion.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227
+4 -1
View File
@@ -37,4 +37,7 @@ REACT_APP_ITEM_PER_PAGE=5
REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com
REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile" REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/ REACT_APP_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/
REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4
+7 -1
View File
@@ -37,4 +37,10 @@ REACT_APP_ITEM_PER_PAGE=5
REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com
REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile" REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
REACT_APP_GOOGLE_REDIRECT_URL=https://users.wrenchboard.com/login/auth/ REACT_APP_GOOGLE_REDIRECT_URL=https://users.wrenchboard.com/login/auth/
DISABLE_ESLINT_PLUGIN=true
REACT_APP_MAX_FILE_SIZE=1000000
REACT_APP_TOTAL_NUM_FILE=4
+20 -5
View File
@@ -26,8 +26,24 @@ function ActiveJobs(props) {
setMessageToSend(value) setMessageToSend(value)
} }
// FUNCTION TO HANDLE FILE UplOAD CHANGE // FUNCTION TO HANDLE FILE UPlOAD CHANGE
const handleFileChange = ({target:{files}}) => { const handleFileChange = ({target:{files}}) => {
setRequestStatus({loading: false, status: false, message: ''}) // State to determine error state
if(files[0].size > Number(process.env.REACT_APP_MAX_FILE_SIZE)){
setRequestStatus({loading: false, status: false, message: 'File must be <= 1mb'})
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
return
}
if(filesToSend.length >= Number(process.env.REACT_APP_TOTAL_NUM_FILE)){
setRequestStatus({loading: false, status: false, message: `Total number of attachment is ${Number(process.env.REACT_APP_TOTAL_NUM_FILE)}`})
setTimeout(()=>{
setRequestStatus({loading: false, status: false, message: ''})
}, 5000)
return
}
// INCLUDE FILE IF NO ERROR
setFilesToSend(prev => ([...prev, files[0]])) setFilesToSend(prev => ([...prev, files[0]]))
} }
@@ -45,7 +61,6 @@ function ActiveJobs(props) {
// FUNCTION TO REMOVE AND IMAGE // FUNCTION TO REMOVE AND IMAGE
const handleRemoveImage = (imageToDelete) => { const handleRemoveImage = (imageToDelete) => {
setFilesToSend(prev => prev.filter(item => item.name != imageToDelete.name)) setFilesToSend(prev => prev.filter(item => item.name != imageToDelete.name))
console.log(id)
} }
// FUNCTION TO SEND TASK MESSAGE // FUNCTION TO SEND TASK MESSAGE
@@ -171,8 +186,8 @@ function ActiveJobs(props) {
{tab == 'message' ? {tab == 'message' ?
( (
<textarea <textarea
className="p-4 w-full text-base text-slate-600 border border-slate-300 outline-none" className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300 outline-none"
rows="10" // rows="10"
style={{ resize: "none" }} style={{ resize: "none" }}
name='message' name='message'
onChange={handleMessageChange} onChange={handleMessageChange}
@@ -180,7 +195,7 @@ function ActiveJobs(props) {
/> />
) )
: :
<div className="p-4 w-full text-base text-slate-600 border border-slate-300"> <div className="p-4 w-full h-[300px] text-base text-slate-600 border border-slate-300">
<div className="files"> <div className="files">
<label htmlFor="file" className="h-20 btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer">Select Files to Upload</label> <label htmlFor="file" className="h-20 btn-gradient text-base tracking-wide px-4 py-2 rounded-full text-white cursor-pointer">Select Files to Upload</label>
<input type="file" id='file' style={{display: 'none'}} onChange={handleFileChange}/> <input type="file" id='file' style={{display: 'none'}} onChange={handleFileChange}/>
+3 -3
View File
@@ -51,9 +51,9 @@ export default function MyOffersTable({ className, MyActiveOffersList}) {
// } // }
}; };
// if ( !MyActiveOffersList || MyActiveOffersList?.result_list?.length == 0 ){ if ( !MyActiveOffersList || MyActiveOffersList?.result_list?.length == 0 ){
// return(''); // want blank or no appear when no items return(''); // want blank or no appear when no items
// } }
return ( return (
<> <>
+137 -76
View File
@@ -1,12 +1,47 @@
import React from 'react' import React, { useMemo, useState } from "react";
import Detail from './popoutcomponent/Detail' import Detail from "./popoutcomponent/Detail";
import ModalCom from '../Helpers/ModalCom' import ModalCom from "../Helpers/ModalCom";
import usersService from "../../services/UsersService";
function PendingJobsPopout({ details, onClose, situation }) {
const [pendingJobLoader, setPendingJobLoader] = useState(false)
const apiCall = useMemo(() => new usersService(), []);
const handlePendingJobsBtn = async ({ target: { name } }) => {
setPendingJobLoader(true)
let { job_uid, offer_code } = details;
function PendingJobsPopout({details, onClose, situation}) { let reqData;
let pendingData = { job_uid, offer_code };
if (name === "extend") {
try {
reqData = { ...pendingData };
let { data } = await apiCall.pendingJobExtend(reqData);
console.log("This is for extend", data);
setPendingJobLoader(false)
} catch (error) {
setPendingJobLoader(false)
throw new Error(error);
}
} else if (name === "offer") {
try {
reqData = { ...pendingData };
let { data } = await apiCall.pendingJobSendTome(reqData);
console.log("This is for offer", data);
setPendingJobLoader(false)
} catch (error) {
setPendingJobLoader(false)
throw new Error(error);
}
} else return;
onClose();
};
return ( return (
<ModalCom action={onClose} situation={situation}> <ModalCom action={onClose} situation={situation}>
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto"> <div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple"> <div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide"> <h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
Manage Pending Item Manage Pending Item
@@ -37,93 +72,119 @@ function PendingJobsPopout({details, onClose, situation}) {
</svg> </svg>
</button> </button>
</div> </div>
<div className='md:flex bg-white rounded-lg shadow-lg'> <div className="md:flex bg-white rounded-lg shadow-lg">
<div className='p-4 w-full md:w-3/4 md:border-r-2'> <div className="p-4 w-full md:w-3/4 md:border-r-2">
<p className='text-base font-semibold text-slate-900 tracking-wide'>{details.title}</p> <p className="text-base font-semibold text-slate-900 tracking-wide">
<div className='my-2 p-2 flex justify-start items-center space-x-2 bg-red-100 border-2 border-red-300'> {details.title}
<span className='w-8 h-8 text-center text-sm rounded-full flex justify-center items-center text-red-300 bg-yellow-100'>!</span> </p>
<div className=''> <div className="my-2 p-2 flex justify-start items-center space-x-2 bg-red-100 border-2 border-red-300">
<p className='text-sm'>This Job have been sent to public view</p> <span className="w-8 h-8 text-center text-sm rounded-full flex justify-center items-center text-red-300 bg-yellow-100">
<p className='text-sm text-slate-600'>This Job will expire</p> !
</span>
<div className="">
<p className="text-sm">
This Job have been sent to public view
</p>
<p className="text-sm text-slate-600">This Job will expire</p>
</div> </div>
</div> </div>
{/* INPUT SECTION */} {/* INPUT SECTION */}
<div className='my-2 md:flex'> <div className="my-2 md:flex">
<Detail <Detail
label='Date Added' label="Date Added"
value={details.offer_added || 'default'} value={details.offer_added || "default"}
/>
</div>
<div className='my-2 md:flex'>
<Detail
label='Description'
value={details.description}
/>
</div>
<div className='my-2 md:flex'>
<Detail
label='Offer Expire'
value={details.expire && `${details.expire.split(' ')[0]} ${details.expire.split(' ')[1].split('.')[0]}`}
/>
</div>
<div className='my-2 md:flex'>
<Detail
label='Price'
value={`${details.price*0.01} ${details.currency}`}
/>
</div>
<div className='my-2 md:flex'>
<Detail
label='Duration'
value={`${details.timeline_days} day(s)`}
/> />
</div> </div>
<div className='my-2 md:flex'> <div className="my-2 md:flex">
<Detail <Detail label="Description" value={details.description} />
label='Detail' </div>
value={details.job_description || details.description}
<div className="my-2 md:flex">
<Detail
label="Offer Expire"
value={
details.expire &&
`${details.expire.split(" ")[0]} ${
details.expire.split(" ")[1].split(".")[0]
}`
}
/> />
</div> </div>
<div className='my-2 md:flex'> <div className="my-2 md:flex">
<Detail <Detail
label='Public Link' label="Price"
value='https://work.wrenchboard.com/plb/viewjob/218B4BWB83' value={`${details.price * 0.01} ${details.currency}`}
bg='bg-slate-200' />
</div>
<div className="my-2 md:flex">
<Detail
label="Duration"
value={`${details.timeline_days} day(s)`}
/>
</div>
<div className="my-2 md:flex">
<Detail
label="Detail"
value={details.job_description || details.description}
/>
</div>
<div className="my-2 md:flex">
<Detail
label="Public Link"
value="https://work.wrenchboard.com/plb/viewjob/218B4BWB83"
bg="bg-slate-200"
/> />
</div> </div>
</div> </div>
{/* ACTION SECTION */} {/* ACTION SECTION */}
<div className='p-4 w-full md:w-1/4 h-full'> <div className="p-4 w-full md:w-1/4 h-full">
<p className='mb-6 text-sm'>Actions</p> <p className="mb-6 text-sm">Actions</p>
<div className='mb-3'> <div className="mb-3">
<p className='px-2 py-1 text-sm bg-slate-100'>Job sent to public view</p> <p className="px-2 py-1 text-sm bg-slate-100">
Job sent to public view
</p>
</div> </div>
<div className='my-3'> <div className="my-3">
<button className='px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'>Extend by a week</button> <button
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={handlePendingJobsBtn}
name="extend"
>
Extend by a week
</button>
</div> </div>
<div className='my-3'> <div className="my-3">
<button className='px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'>Send to me</button> <button
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={handlePendingJobsBtn}
name="offer"
>
Send to me
</button>
</div> </div>
<div className='mt-10 md:mt-32 md:flex md:justify-center'> <div className="mt-10 md:mt-32 md:flex md:justify-center">
<button className='px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white'>Cancel Offer</button> <button
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
onClick={onClose}
>
Cancel Offer
</button>
</div> </div>
</div> </div>
</div> </div>
{/* close button */} {/* close button */}
<div className="p-6 flex justify-center"> <div className="p-6 flex justify-center">
<button <button
onClick={onClose} onClick={onClose}
@@ -134,9 +195,9 @@ function PendingJobsPopout({details, onClose, situation}) {
</button> </button>
</div> </div>
{/* end of close button */} {/* end of close button */}
</div> </div>
</ModalCom> </ModalCom>
) );
} }
export default PendingJobsPopout export default PendingJobsPopout;
+24
View File
@@ -486,6 +486,30 @@ class usersService {
return this.postAuxEnd("/jobmanagerupdatejob", postData); return this.postAuxEnd("/jobmanagerupdatejob", postData);
} }
pendingJobExtend(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
extend_days: 7,
action: 13041,
...reqData,
};
return this.postAuxEnd("/pendingjobextend", postData);
}
pendingJobSendTome(reqData) {
var postData = {
uid: localStorage.getItem("uid"),
member_id: localStorage.getItem("member_id"),
sessionid: localStorage.getItem("session_token"),
mode: 200,
action: 13042,
...reqData,
};
return this.postAuxEnd("/pendingjobsendtome", postData);
}
// FUNCTION TO GET ACTIVE JOB MESSAGE LIST // FUNCTION TO GET ACTIVE JOB MESSAGE LIST
activeJobMesList(reqData) { activeJobMesList(reqData) {
var postData = { var postData = {