Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 393b4e7b37 | |||
| b2411285bc | |||
| 091faec9bd | |||
| 15fc2e6c9b | |||
| 3ef68adf7e | |||
| 71f987cbff | |||
| e8c3dca731 | |||
| 85d15ac2f1 | |||
| 236dfeae2c | |||
| 734acd9dd5 | |||
| 3f9534b968 | |||
| 13d69efbaf | |||
| 151aa4ba0c | |||
| 4985256c3a |
@@ -77,7 +77,7 @@ export default function FamilyTable({
|
||||
>
|
||||
<td className="py-4">
|
||||
<div className="flex space-x-2 items-center w-full">
|
||||
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center flex-[0.1]">
|
||||
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||
<img
|
||||
// src={profile_picture}
|
||||
src={image || profile_picture || localImgLoad(`images/icons/${banner}`)}
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function ModalCom({ action, children, situation, isOpen, classNam
|
||||
onClick={action || isOpen}
|
||||
className="fixed top-0 left-0 w-full lg:h-[100vh] h-full bg-black bg-opacity-40 backdrop-filter backdrop-blur-sm z-50"
|
||||
></div>
|
||||
<div className={`children-element fixed lg:h-100vh h-full z-[99999999999999] w-full lg:w-auto ${className}`}>
|
||||
<div className={`fixed lg:h-100vh h-full z-[99999999999999] w-full lg:w-auto inset-0 flex flex-col justify-center items-center ${className}`}>
|
||||
{children && children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,38 +30,34 @@ export default function GroupMemberTable({selectedList}) {
|
||||
|
||||
return (
|
||||
<div className={`w-full p-8 bg-white dark:bg-dark-gray overflow-hidden rounded-2xl section-shadow`}>
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[300px]">
|
||||
<table className="table-auto min-w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<div className="relative w-full overflow-x-auto sm:rounded-lg flex flex-col justify-between min-h-[400px]">
|
||||
<table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||
<tbody>
|
||||
<>
|
||||
<tr className='font-bold text-sm text-dark-gray dark:text-white whitespace-nowrap'>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Email</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className='p-[1px] bg-slate-400 dark:bg-white rounded-full' colSpan="4"></td>
|
||||
</tr>
|
||||
{selectedList && selectedList?.length > 0 ? (
|
||||
// currentSelectedList?.length ? (
|
||||
currentSelectedList.map((value, index) => (
|
||||
<tr key={value.uid} className="font-medium text-sm text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-1">{value?.firstname}</td>
|
||||
<tr key={value.uid} className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||
{/* <td className="p-1">{value?.firstname}</td>
|
||||
<td className="p-1">{value?.lastname}</td>
|
||||
<td className="p-1">{value?.email}</td>
|
||||
<td className="p-1 text-right">
|
||||
<button onClick={()=>{handleDeleteMember(value)}} className='rounded-lg text-sm bg-red-500 hover:bg-red-400 text-white font-bold py-1 px-2.5'>X</button>
|
||||
</td> */}
|
||||
<td className='py-2'>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||
{value.firstname && value.firstname} {value.lastname && value.lastname}
|
||||
</h1>
|
||||
<span className="text-sm text-thin-light-gray">
|
||||
{value.email && value.email}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className='py-2 text-right'>
|
||||
<button onClick={()=>{handleDeleteMember(value)}} className='rounded-lg text-sm bg-red-500 hover:bg-red-400 text-white font-bold py-1 px-2.5'>X</button>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
// ) : (
|
||||
// <tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
// <td className="p-2">
|
||||
// No Members Found
|
||||
// </td>
|
||||
// </tr>
|
||||
// )
|
||||
) : (
|
||||
<tr className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
|
||||
<td className="p-2">No Members Found</td>
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function JobGroups() {
|
||||
members: []
|
||||
})
|
||||
|
||||
const [selectedGroup, setSelectedGroup] = useState({id:'', data: []})
|
||||
const [selectedGroup, setSelectedGroup] = useState({id:'', name:'', data: []})
|
||||
|
||||
const changeSelectedGroup = (e) => {
|
||||
let groupID = e.target.value
|
||||
@@ -42,10 +42,15 @@ export default function JobGroups() {
|
||||
return
|
||||
}
|
||||
setGroupList({loading: false, groups: data.result_list, members: data.result_list_member})
|
||||
let activeGroupId = data.result_list[0].group_id
|
||||
let activeGroup = data.result_list[0].group_name
|
||||
let activeMembers = data.result_list_member?.filter(item => item.group_id == activeGroupId)
|
||||
setSelectedGroup({id: activeGroupId, name:activeGroup, data:activeMembers})
|
||||
if(selectedGroup.id == ''){
|
||||
let activeGroupId = data.result_list[0].group_id
|
||||
let activeGroup = data.result_list[0].group_name
|
||||
let activeMembers = data.result_list_member?.filter(item => item.group_id == activeGroupId)
|
||||
setSelectedGroup({id: activeGroupId, name:activeGroup, data:activeMembers})
|
||||
}else{
|
||||
let activeMembers = data.result_list_member?.filter(item => item.group_id == selectedGroup?.id)
|
||||
setSelectedGroup({id: selectedGroup?.id, name:selectedGroup?.name, data:activeMembers})
|
||||
}
|
||||
}).catch(error => {
|
||||
setGroupList({loading: false, groups: [], members: []})
|
||||
console.log(error)
|
||||
|
||||
@@ -20,11 +20,42 @@ export default function MemberList({groupList, selectedGroup, setUpdateList}) {
|
||||
|
||||
const handleFieldsChange = ({target:{name, value}}) => {
|
||||
setFields(prev => ({...prev, [name]:value}))
|
||||
let error = requestState?.errors?.indexOf(name) //// checks if the input field was in error array and removes it when the input changes
|
||||
if(error >= 0){
|
||||
let oldErrorArr = requestState.errors
|
||||
let newErrorArr = oldErrorArr.splice(error, 1)
|
||||
setRequestState(prev => ({...prev, errors:oldErrorArr}))
|
||||
// let error = requestState?.errors?.indexOf(name) //// checks if the input field was in error array and removes it when the input changes
|
||||
// if(error >= 0){
|
||||
// let oldErrorArr = requestState.errors
|
||||
// let newErrorArr = oldErrorArr.splice(error, 1)
|
||||
// setRequestState(prev => ({...prev, errors:oldErrorArr}))
|
||||
// }
|
||||
|
||||
if(value == ''){
|
||||
setRequestState({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: '',
|
||||
data: [],
|
||||
errors: [name]
|
||||
})
|
||||
}else{
|
||||
let error = requestState?.errors?.indexOf(name) //// checks if the input field was in error array and removes it when the input changes
|
||||
if(error >= 0){
|
||||
let oldErrorArr = requestState.errors
|
||||
let newErrorArr = oldErrorArr.splice(error, 1)
|
||||
setRequestState(prev => ({...prev, errors:oldErrorArr}))
|
||||
}
|
||||
}
|
||||
|
||||
if(name == 'email'){
|
||||
//checks if email is a valid email address
|
||||
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
||||
if (!EmailValidator(value)) {
|
||||
setRequestState({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: '',
|
||||
data: [],
|
||||
errors: ['email']
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,26 +64,26 @@ export default function MemberList({groupList, selectedGroup, setUpdateList}) {
|
||||
status: false,
|
||||
message: '',
|
||||
data: [],
|
||||
errors: []
|
||||
errors: ['email', 'firstname', 'lastname']
|
||||
})
|
||||
|
||||
const addMember = () => {
|
||||
let errors = Object.keys(fields).filter((item) => { // CHECKS FOR EMPTY STRINGS
|
||||
if(typeof item == 'string' && fields[item] === ''){
|
||||
return item
|
||||
}
|
||||
})
|
||||
// let errors = Object.keys(fields).filter((item) => { // CHECKS FOR EMPTY STRINGS
|
||||
// if(typeof item == 'string' && fields[item] === ''){
|
||||
// return item
|
||||
// }
|
||||
// })
|
||||
|
||||
if(errors.length){
|
||||
setRequestState({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: '',
|
||||
data: [],
|
||||
errors: [...errors]
|
||||
})
|
||||
return
|
||||
}
|
||||
// if(errors.length){
|
||||
// setRequestState({
|
||||
// loading: false,
|
||||
// status: false,
|
||||
// message: '',
|
||||
// data: [],
|
||||
// errors: [...errors]
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
//checks if email is a valid email address
|
||||
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
||||
@@ -155,54 +186,61 @@ export default function MemberList({groupList, selectedGroup, setUpdateList}) {
|
||||
<>
|
||||
<h1 className='mb-5 text-lg lg:text-2xl tracking-wide font-bold text-slate-900 dark:text-slate-100'>{selectedGroup?.name}</h1>
|
||||
<div className='w-full flex flex-col-reverse lg:flex-col'>
|
||||
<div className='py-3 w-full sm:w-[500px] xl:w-full xxl:w-[500px]'>
|
||||
<div className='relative grid grid-cols-1 sm:grid-cols-2 gap-2'>
|
||||
<div className='h-10 relative'>
|
||||
<input
|
||||
id='firstname'
|
||||
name='firstname'
|
||||
// className={`peer px-5 w-full h-full rounded-full outline-none placeholder:text-transparent transition-all duration-500 text-black dark:text-black bg-gradient-to-br from-slate-50/80 via-slate-200/80 to-slate-100/80 focus:from-slate-100/80 focus:to-slate-50/80`}
|
||||
className={`peer px-5 w-full h-full rounded-full outline-none border placeholder:text-slate-600 transition-all duration-500 text-black dark:text-black bg-gradient-to-br from-slate-50/80 via-slate-200/80 to-slate-100/80 focus:from-slate-100/80 focus:to-slate-50/80 ${requestState.errors.includes('firstname') ? 'border-red-500' : 'border-transparent'}`}
|
||||
type='text'
|
||||
placeholder='First Name'
|
||||
value={fields.firstname}
|
||||
onChange={handleFieldsChange}
|
||||
<div className='py-3 w-full'>
|
||||
<div className='relative grid grid-cols-1 sm:grid-cols-2 gap-2 place-content-center'>
|
||||
<div className="input-item">
|
||||
<InputCom
|
||||
labelClass="tracking-wider"
|
||||
fieldClass="sm:px-6 px-2"
|
||||
value={fields.firstname}
|
||||
inputHandler={handleFieldsChange}
|
||||
placeholder="First Name"
|
||||
// label="Firstname"
|
||||
name="firstname"
|
||||
type="text"
|
||||
// iconName="message"
|
||||
/>
|
||||
{/* <label htmlFor='firstname' className={`text-sm text-black dark:text-slate-500 absolute left-5 -top-4 translate-y-0 peer-focus:-top-3 peer-focus:translate-y-0 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 transition-all duration-500 ${requestState.errors.includes('firstname') ? 'text-red-500' : ''}`}>First Name</label> */}
|
||||
</div>
|
||||
<div className='h-10 relative'>
|
||||
<input
|
||||
id='lastname'
|
||||
name='lastname'
|
||||
// className={`peer px-5 w-full h-full rounded-full outline-none placeholder:text-transparent transition-all duration-500 text-black dark:text-black bg-gradient-to-br from-slate-50/80 via-slate-200/80 to-slate-100/80 focus:from-slate-100/80 focus:to-slate-50/80`}
|
||||
className={`peer px-5 w-full h-full rounded-full outline-none border placeholder:text-slate-600 transition-all duration-500 text-black dark:text-black bg-gradient-to-br from-slate-50/80 via-slate-200/80 to-slate-100/80 focus:from-slate-100/80 focus:to-slate-50/80 ${requestState.errors.includes('lastname') ? 'border-red-500' : 'border-transparent'}`}
|
||||
type='text'
|
||||
placeholder='Last Name'
|
||||
value={fields.lastname}
|
||||
onChange={handleFieldsChange}
|
||||
<div className="input-item">
|
||||
<InputCom
|
||||
labelClass="tracking-wider"
|
||||
fieldClass="sm:px-6 px-2"
|
||||
value={fields.lastname}
|
||||
inputHandler={handleFieldsChange}
|
||||
placeholder="Last Name"
|
||||
// label="Lastname"
|
||||
name="lastname"
|
||||
type="text"
|
||||
// iconName="message"
|
||||
/>
|
||||
{/* <label htmlFor='lastname' className={`text-sm text-black dark:text-slate-500 absolute left-5 -top-4 translate-y-0 peer-focus:-top-3 peer-focus:translate-y-0 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 transition-all duration-500 ${requestState.errors.includes('lastname') ? 'text-red-500' : ''}`}>LastName</label> */}
|
||||
</div>
|
||||
<div className='h-10 relative'>
|
||||
<input
|
||||
id='email'
|
||||
name='email'
|
||||
// className={`peer px-5 w-full h-full rounded-full outline-none placeholder:text-transparent transition-all duration-500 text-black dark:text-black bg-gradient-to-br from-slate-50/80 via-slate-200/80 to-slate-100/80 focus:from-slate-100/80 focus:to-slate-50/80`}
|
||||
className={`peer px-5 w-full h-full rounded-full outline-none border placeholder:text-slate-600 transition-all duration-500 text-black dark:text-black bg-gradient-to-br from-slate-50/80 via-slate-200/80 to-slate-100/80 focus:from-slate-100/80 focus:to-slate-50/80 ${requestState.errors.includes('email') ? 'border-red-500' : 'border-transparent'}`}
|
||||
type='email'
|
||||
placeholder='Email'
|
||||
value={fields.email}
|
||||
onChange={handleFieldsChange}
|
||||
<div className="input-item w-full sm:w-[150%]">
|
||||
<InputCom
|
||||
labelClass="tracking-wider"
|
||||
fieldClass="sm:px-6 px-2"
|
||||
value={fields.email}
|
||||
inputHandler={handleFieldsChange}
|
||||
placeholder="Email"
|
||||
// label="Email"
|
||||
name="email"
|
||||
type="email"
|
||||
// iconName="message"
|
||||
/>
|
||||
{/* <label htmlFor='email' className={`text-sm text-black dark:text-slate-500 absolute left-5 -top-4 translate-y-0 peer-focus:-top-3 peer-focus:translate-y-0 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 transition-all duration-500 ${requestState.errors.includes('email') ? 'text-red-500' : ''}`}>Email</label> */}
|
||||
</div>
|
||||
<div className='flex justify-end items-center'>
|
||||
<div className='flex justify-end items-end'>
|
||||
{requestState.loading ?
|
||||
<LoadingSpinner size='8' color='sky-blue' />
|
||||
:
|
||||
<button onClick={addMember} disabled={requestState.loading || requestState.status} className='py-2 px-4 flex justify-center items-center bg-sky-blue hover:bg-sky-600 text-base rounded-full text-white font-bold'>Add Member</button>
|
||||
<button
|
||||
onClick={addMember}
|
||||
disabled={requestState.loading || requestState.status || requestState.errors.length}
|
||||
className={`py-2 px-4 h-[42px] flex justify-center items-center text-base rounded-full text-white font-bold transition-all duration-500 ${requestState.loading || requestState.status || requestState.errors.length ? 'bg-sky-blue/50' : 'bg-sky-blue hover:bg-sky-600'} `}
|
||||
>
|
||||
Add Member
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
{!requestState.loading && requestState.message &&
|
||||
<p className={`text-lg absolute -bottom-7 left-0 ${requestState.status ? 'text-green-500' : 'text-red-500'}`}>{requestState.message}</p>
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function Layout({ children }) {
|
||||
</div>
|
||||
{logoutModal && (
|
||||
<ModalCom action={logoutModalHandler} situation={logoutModal}>
|
||||
<div className="logout-modal-wrapper lg:w-[460px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-wrapper w-11/12 sm:w-[460px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple dark:border-[#5356fb29] ">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Confirm
|
||||
|
||||
@@ -63,7 +63,7 @@ function DeleteJobPopout({ details, onClose, situation }) {
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation}>
|
||||
<div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-wrapper lg:w-[600px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Delete Job
|
||||
|
||||
@@ -215,8 +215,8 @@ const EditJobPopOut = ({
|
||||
const isWindows = /Windows/.test(navigator.userAgent);
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation} className="edit-popup">
|
||||
<div className="logout-modal-wrapper lg:w-[600px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<ModalCom action={onClose} situation={situation}>
|
||||
<div className="logout-modal-wrapper w-11/12 lg:w-[600px] bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||
<div className="logout-modal-header w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Edit Job
|
||||
|
||||
@@ -23,8 +23,14 @@ const validationSchema = Yup.object().shape({
|
||||
});
|
||||
|
||||
function JobListPopout({ details, onClose, situation }) {
|
||||
|
||||
const [selectedTab, setSelectedTab] = useState('public')
|
||||
const tabs = ['public', 'individual', 'group']
|
||||
|
||||
const dispatch = useDispatch()
|
||||
|
||||
const [requestStatus, setRequestStatus] = useState({message:'', status:false})
|
||||
|
||||
const [familyList, setFamilyList] = useState([]);
|
||||
let [loader, setLoader] = useState({
|
||||
member: false,
|
||||
@@ -96,7 +102,7 @@ const dispatch = useDispatch()
|
||||
else if (name === "individual")
|
||||
setErrMsg({ jobFields: { individual: "please enter email" } });
|
||||
else if (name === "group")
|
||||
setErrMsg({ jobFields: { group: "please select a family member" } });
|
||||
setErrMsg({ jobFields: { group: "please select a group" } });
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
setErrMsg({ jobFields: "" });
|
||||
@@ -150,9 +156,12 @@ const dispatch = useDispatch()
|
||||
// for group input
|
||||
reqData = {
|
||||
...jobReq,
|
||||
email: values?.individual,
|
||||
email: '',
|
||||
group_id: values?.group,
|
||||
action: 13025,
|
||||
assign_mode: 110033,
|
||||
assign_mode: 110044,
|
||||
duration: details?.timeline_days,
|
||||
// duration: 0,
|
||||
};
|
||||
setLoader({ jobFields: { group: true } });
|
||||
} else {
|
||||
@@ -161,21 +170,56 @@ const dispatch = useDispatch()
|
||||
|
||||
try {
|
||||
const res = await apiCall.assignJobTask(reqData);
|
||||
let { data } = await res;
|
||||
setLoader({ jobFields: false });
|
||||
let { status, data } = await res;
|
||||
if(status != 200 || data.internal_return < 0){
|
||||
setRequestStatus({message:'Unable to complete', status:false})
|
||||
return setTimeout(()=>{
|
||||
setLoader({ jobFields: false });
|
||||
setRequestStatus({message:'', status:false})
|
||||
},3000)
|
||||
}
|
||||
dispatch(tableReload({ type: "JOBTABLE" }));
|
||||
onClose();
|
||||
throw new Response(data);
|
||||
setRequestStatus({message:'Successful', status:true})
|
||||
setTimeout(()=>{
|
||||
setLoader({ jobFields: false });
|
||||
onClose();
|
||||
throw new Response(data);
|
||||
},3000)
|
||||
} catch (error) {
|
||||
setLoader({ jobFields: false });
|
||||
throw new Error(error);
|
||||
setRequestStatus({message:'Unable to complete', status:false})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({message:'', status:false})
|
||||
setLoader({ jobFields: false });
|
||||
throw new Error(error);
|
||||
},3000)
|
||||
}
|
||||
};
|
||||
|
||||
const [groupList, setGroupList] = useState({loading: true, groups: [], members: []})
|
||||
|
||||
// FUNCTION TO POPULATE USER GROUP LIST
|
||||
useEffect(()=>{
|
||||
// setGroupList({loading: true, groups: [], members: []})
|
||||
apiCall.jobGroupList({}).then(res => {
|
||||
const {status, data} = res
|
||||
if(status != 200 || data?.internal_return < 0){
|
||||
setGroupList({loading: false, groups: [], members: []})
|
||||
return
|
||||
}
|
||||
if(data.result_list.length < 0){
|
||||
setGroupList({loading: false, groups: [], members: []})
|
||||
return
|
||||
}
|
||||
setGroupList({loading: false, groups: data.result_list, members: data.result_list_member})
|
||||
}).catch(error => {
|
||||
setGroupList({loading: false, groups: [], members: []})
|
||||
})
|
||||
},[])
|
||||
|
||||
// console.log("Job List P >> ", details)
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation} className="job-popup">
|
||||
<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">
|
||||
<ModalCom action={onClose} situation={situation} className="">
|
||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] 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">
|
||||
<h1 className="text-base md:text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
{details.title}
|
||||
@@ -250,6 +294,20 @@ const dispatch = useDispatch()
|
||||
|
||||
{/* ACTION SECTION */}
|
||||
<div className="p-4 w-full md:w-2/4 h-full">
|
||||
<div className="grid grid-cols-3 my-4 border-b-2">
|
||||
{tabs.map(item => (
|
||||
<button
|
||||
className={`px-4 py-1 rounded-t-2xl ${selectedTab == item ? 'btn-gradient border-[2px] text-white' : 'bg-white text-[#000] border-t-[2px]'}`}
|
||||
value={item}
|
||||
name={item}
|
||||
onClick={()=>setSelectedTab(item)}
|
||||
>
|
||||
{item[0].toUpperCase() + item.slice(1)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{selectedTab == 'family' &&
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema.fields.family}
|
||||
@@ -267,20 +325,22 @@ const dispatch = useDispatch()
|
||||
data={familyList}
|
||||
btnText="Assign to family"
|
||||
optionText="Select Family"
|
||||
loader={loader?.jobFields.family}
|
||||
loader={loader?.jobFields?.family}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.family === "" && (
|
||||
<span>{errMsg.jobFields.family}</span>
|
||||
{props?.values?.family === "" && (
|
||||
<span>{errMsg?.jobFields?.family}</span>
|
||||
)}
|
||||
</p>{" "}
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
</Formik>
|
||||
|
||||
}
|
||||
|
||||
{selectedTab == 'public' &&
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema.fields.public}
|
||||
@@ -298,20 +358,22 @@ const dispatch = useDispatch()
|
||||
data={publicArray}
|
||||
btnText="Show Task to Public"
|
||||
optionText="Select Duration"
|
||||
loader={loader?.jobFields.public}
|
||||
loader={loader?.jobFields?.public}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.public === "" && (
|
||||
<span>{errMsg.jobFields.public}</span>
|
||||
<span>{errMsg?.jobFields?.public}</span>
|
||||
)}
|
||||
</p>{" "}
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
</Formik>
|
||||
}
|
||||
|
||||
{selectedTab == 'individual' &&
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema.fields.individual}
|
||||
@@ -329,21 +391,23 @@ const dispatch = useDispatch()
|
||||
placeholder="Enter email of individual"
|
||||
inputHandler={props?.handleChange}
|
||||
btnText="Send Offer to Individual"
|
||||
loader={loader?.jobFields.individual}
|
||||
loader={loader?.jobFields?.individual}
|
||||
errorHandler={errorHandler}
|
||||
/>
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.individual === "" && (
|
||||
<span>{errMsg.jobFields.individual}</span>
|
||||
<span>{errMsg?.jobFields?.individual}</span>
|
||||
)}
|
||||
</p>{" "}
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
</Formik>
|
||||
}
|
||||
|
||||
{ process.env.REACT_APP_SHOW_OFFER_GROUP_JOB != 0 &&
|
||||
{/* { process.env.REACT_APP_SHOW_OFFER_GROUP_JOB != 0 && } */}
|
||||
{selectedTab == 'group' &&
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={validationSchema.fields.group}
|
||||
@@ -359,14 +423,15 @@ const dispatch = useDispatch()
|
||||
inputName="group"
|
||||
value={props?.values.group}
|
||||
btnText="Send Order to Group"
|
||||
optionText="Group"
|
||||
loader={loader?.jobFields.group}
|
||||
optionText="Select Group"
|
||||
loader={loader?.jobFields?.group}
|
||||
errorHandler={errorHandler}
|
||||
data={groupList}
|
||||
/>
|
||||
<p className="h-4 text-[13px] font-light italic text-red-600 tracking-wide">
|
||||
{" "}
|
||||
{props?.values.group === "" && (
|
||||
<span>{errMsg.jobFields.group}</span>
|
||||
<span>{errMsg?.jobFields?.group}</span>
|
||||
)}
|
||||
</p>
|
||||
</Form>
|
||||
@@ -374,6 +439,10 @@ const dispatch = useDispatch()
|
||||
}}
|
||||
</Formik>
|
||||
}
|
||||
|
||||
{requestStatus.message &&
|
||||
<p className={`mt-4 w-full text-lg ${requestStatus.status ? 'text-emerald-600' : 'text-red-600'}`}>{requestStatus.message}</p>
|
||||
}
|
||||
</div>
|
||||
{/* END OF ACTION SECTION */}
|
||||
</div>
|
||||
@@ -427,27 +496,52 @@ const JobFieldInput = ({
|
||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full bg-white outline-none px-2`}
|
||||
value={value}
|
||||
>
|
||||
<option value="">{optionText}</option>
|
||||
{Array.isArray(data) &&
|
||||
data?.map((item, idx) => (
|
||||
<React.Fragment key={idx}>
|
||||
{inputName === "family" && item?.last_login !== "" && (
|
||||
<option value={item?.family_uid} key={idx}>
|
||||
{`${item?.firstname} ${item?.lastname}`}
|
||||
{/* <option value="">{optionText}</option> */}
|
||||
{(inputName == 'family' || inputName == 'public') &&
|
||||
Array.isArray(data) &&
|
||||
<>
|
||||
<option value="">{optionText}</option>
|
||||
{ data?.map((item, idx) => (
|
||||
<React.Fragment key={idx}>
|
||||
{inputName === "family" && item?.last_login !== "" && (
|
||||
<option value={item?.family_uid} key={idx}>
|
||||
{`${item?.firstname} ${item?.lastname}`}
|
||||
</option>
|
||||
)}
|
||||
{inputName === "public" && (
|
||||
<option value={item?.duration} key={idx}>
|
||||
{item?.name}
|
||||
</option>
|
||||
)}
|
||||
{/* {inputName === "group" && (
|
||||
<option value={item?.group_id} key={idx}>
|
||||
{item?.group_name}
|
||||
</option>
|
||||
)} */}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</>
|
||||
}
|
||||
{(inputName == 'group') &&
|
||||
<>
|
||||
{data.loading ?
|
||||
<option value={''}>
|
||||
Loading...
|
||||
</option>
|
||||
: data?.groups?.length > 0 ?
|
||||
<>
|
||||
<option value="">{optionText}</option>
|
||||
{ data?.groups?.map((item, index)=>(
|
||||
<option value={item?.group_id} key={index}>
|
||||
{item?.group_name}
|
||||
</option>
|
||||
)}
|
||||
{inputName === "public" && (
|
||||
<option value={item?.duration} key={idx}>
|
||||
{item?.name}
|
||||
</option>
|
||||
)}
|
||||
{inputName === "group" && (
|
||||
<option value={item?.family_uid} key={idx}>
|
||||
{item?.firstname}
|
||||
</option>
|
||||
)}
|
||||
</React.Fragment>
|
||||
))}
|
||||
))}
|
||||
</>
|
||||
:
|
||||
<option value="">No Group Found</option>
|
||||
}
|
||||
</>
|
||||
}
|
||||
</Field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -133,8 +133,8 @@ function PendingJobsPopout({ details, onClose, situation }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation} className="edit-popup">
|
||||
<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">
|
||||
<ModalCom action={onClose} situation={situation}>
|
||||
<div className="logout-modal-wrapper w-[90%] md:w-[768px] 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">
|
||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Manage Pending Item
|
||||
|
||||
@@ -4,8 +4,8 @@ import ModalCom from "../components/Helpers/ModalCom";
|
||||
|
||||
function AddJobPage({ action, situation, categories }) {
|
||||
return (
|
||||
<ModalCom action={action} situation={situation} className="edit-popup">
|
||||
<div className="lg:w-[600px] w-full lg:overflow-hidden lg:rounded-2xl bg-white dark:bg-dark-white dark:text-white">
|
||||
<ModalCom action={action} situation={situation}>
|
||||
<div className="lg:w-[600px] w-11/12 lg:overflow-hidden lg:rounded-2xl bg-white dark:bg-dark-white dark:text-white">
|
||||
<div className="heading flex justify-between items-center py-6 md:px-[30px] px-[23px] border-b border-light-purple dark:border-[#5356fb29] ">
|
||||
<p className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||
Create New Job
|
||||
|
||||
Reference in New Issue
Block a user