Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66bd8cf6ec | |||
| 3d7ad25517 |
@@ -10,7 +10,7 @@ import { Form, Formik } from "formik";
|
|||||||
|
|
||||||
// To get the validation schema
|
// To get the validation schema
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
country: Yup.string()
|
currency: Yup.string()
|
||||||
.min(1, "Minimum 3 characters")
|
.min(1, "Minimum 3 characters")
|
||||||
.max(25, "Maximum 25 characters")
|
.max(25, "Maximum 25 characters")
|
||||||
.required("required"),
|
.required("required"),
|
||||||
@@ -28,7 +28,7 @@ const validationSchema = Yup.object().shape({
|
|||||||
.min(3, "Minimum 3 characters")
|
.min(3, "Minimum 3 characters")
|
||||||
.max(499, "Maximum 499 characters")
|
.max(499, "Maximum 499 characters")
|
||||||
.required("required"),
|
.required("required"),
|
||||||
timeline: Yup.number()
|
timeline_days: Yup.number()
|
||||||
.typeError("you must specify a number")
|
.typeError("you must specify a number")
|
||||||
.min(1, "Must be greater than 0")
|
.min(1, "Must be greater than 0")
|
||||||
.required("required"),
|
.required("required"),
|
||||||
@@ -52,10 +52,10 @@ export default function AssignMediaTask({
|
|||||||
// For form initial values
|
// For form initial values
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
// initial values for formik
|
// initial values for formik
|
||||||
country: "",
|
currency: "",
|
||||||
amount: "",
|
amount: "",
|
||||||
job_description: "",
|
job_description: "",
|
||||||
timeline: "",
|
timeline_days: "",
|
||||||
media_uid: activeMedia.uid,
|
media_uid: activeMedia.uid,
|
||||||
family_uid: family_uid,
|
family_uid: family_uid,
|
||||||
media_type: "COMMON"
|
media_type: "COMMON"
|
||||||
@@ -66,8 +66,8 @@ export default function AssignMediaTask({
|
|||||||
|
|
||||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
|
|
||||||
let imageSrc = (localStorage.getItem("session_token")
|
// let imageSrc = (localStorage.getItem("session_token")
|
||||||
? `${userDetails?.session_image_server}${localStorage.getItem("session_token")}/job/${activeMedia.uid}` : ""); // FOR GETTING JOB IMAGE
|
// ? `${userDetails?.session_image_server}${localStorage.getItem("session_token")}/job/${activeMedia.uid}` : ""); // FOR GETTING JOB IMAGE
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -164,16 +164,16 @@ export default function AssignMediaTask({
|
|||||||
{/* Currency */}
|
{/* Currency */}
|
||||||
<div className="field w-full">
|
<div className="field w-full">
|
||||||
<label
|
<label
|
||||||
htmlFor="country"
|
htmlFor="currency"
|
||||||
className="job-label flex gap-1"
|
className="job-label flex gap-1"
|
||||||
>
|
>
|
||||||
Currency
|
Currency
|
||||||
{props.errors.country && props.touched.country && <span className="text-[10px] text-red-500">{props.errors.country}</span>}
|
{props.errors.currency && props.touched.currency && <span className="text-[10px] text-red-500">{props.errors.currency}</span>}
|
||||||
</label>
|
</label>
|
||||||
<select
|
<select
|
||||||
id="country"
|
id="currency"
|
||||||
name="country"
|
name="currency"
|
||||||
value={props.values.country}
|
value={props.values.currency}
|
||||||
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
|
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
|
||||||
onChange={props.handleChange}
|
onChange={props.handleChange}
|
||||||
>
|
>
|
||||||
@@ -198,7 +198,7 @@ export default function AssignMediaTask({
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
No Options Found! Try Again
|
No Options Found!
|
||||||
</option>
|
</option>
|
||||||
)}
|
)}
|
||||||
</select>
|
</select>
|
||||||
@@ -212,12 +212,12 @@ export default function AssignMediaTask({
|
|||||||
className="job-label flex gap-1"
|
className="job-label flex gap-1"
|
||||||
>
|
>
|
||||||
Timeline
|
Timeline
|
||||||
{props.errors.timeline && props.touched.timeline && <span className="text-[12px] text-red-500">{props.errors.timeline}</span>}
|
{props.errors.timeline_days && props.touched.timeline_days && <span className="text-[12px] text-red-500">{props.errors.timeline_days}</span>}
|
||||||
</label>
|
</label>
|
||||||
<select
|
<select
|
||||||
id="timeline_days"
|
id="timeline_days"
|
||||||
name="timeline"
|
name="timeline_days"
|
||||||
value={props.values.timeline}
|
value={props.values.timeline_days}
|
||||||
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
|
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
|
||||||
onChange={props.handleChange}
|
onChange={props.handleChange}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -258,14 +258,27 @@ const AssignTaskPopout = ({
|
|||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
// values.family_uid = selectedFamilyUid
|
|
||||||
// values.media_uid = activeMedia.uid
|
|
||||||
// values.amount = values.amount * 100
|
|
||||||
let reqData = {...values, assign_mode:'110012', family_uid:selectedFamilyUid, media_uid:activeMedia.uid, amount:values.amount * 100}
|
let reqData = {...values, assign_mode:'110012', family_uid:selectedFamilyUid, media_uid:activeMedia.uid, amount:values.amount * 100}
|
||||||
console.log(reqData)
|
|
||||||
return setTimeout(()=>{
|
apiCall.parentAssignMediaTask(reqData).then(res => { // API CALL TO ASSIGN MEDIA TASK
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
},2000)
|
setRequestStatus({ loading: false, status: false, message: "Failed to Assign Task" });
|
||||||
|
return setTimeout(()=>{
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
setRequestStatus({ loading: false, status: true, message: "Task Assigned Successfully" });
|
||||||
|
return setTimeout(()=>{
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
closeModal() // FOR CLOSING ASSIGN MODAL
|
||||||
|
}, 3000)
|
||||||
|
}).catch(err => {
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "Failed, something went wrong. Try Again" });
|
||||||
|
return setTimeout(()=>{
|
||||||
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
|
}, 3000)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(()=>{ // effect to update family UID when components mounts
|
useEffect(()=>{ // effect to update family UID when components mounts
|
||||||
@@ -280,7 +293,7 @@ const AssignTaskPopout = ({
|
|||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
apiCall.getParentCommonMedia().then((res)=>{
|
apiCall.getParentCommonMedia().then((res)=>{
|
||||||
console.log('RESPONSE', res)
|
// console.log('RESPONSE', res)
|
||||||
setCommonMedia({loading: false, data: res?.data?.result, image: ''})
|
setCommonMedia({loading: false, data: res?.data?.result, image: ''})
|
||||||
setActiveMedia(res?.data?.result[0])
|
setActiveMedia(res?.data?.result[0])
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default function VideoElement({videoId}) {
|
|||||||
},[videoId])
|
},[videoId])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<video ref={videoRef} className='w-full h-full' controls autoPlay>
|
<video ref={videoRef} className='w-full h-full' controls>
|
||||||
<source src={`https://dev-media.wrenchboard.com/videos/${videoId}`} type='video/mp4'></source>
|
<source src={`https://dev-media.wrenchboard.com/videos/${videoId}`} type='video/mp4'></source>
|
||||||
Your browser does not support the video tag.
|
Your browser does not support the video tag.
|
||||||
</video>
|
</video>
|
||||||
|
|||||||
Reference in New Issue
Block a user