diff --git a/src/components/Timelog/TimeEntry.jsx b/src/components/Timelog/TimeEntry.jsx index b7da17073a..61fbb16ad5 100644 --- a/src/components/Timelog/TimeEntry.jsx +++ b/src/components/Timelog/TimeEntry.jsx @@ -41,49 +41,15 @@ const TimeEntry = (props) => { isTangible, hours, minutes, - projectId, + projectName, + taskName, taskId, notes, } = data; - const projectDetailsSetup = () => { - try { - if (from === 'TaskTab' && data) { - return { - projectName: data?.projectName || "", - projectCategory: data?.projectCategory || "", - taskName: data?.taskName || "", - taskClassification: data?.taskClassification || "" - } - } else { - const timeEntryProject = displayUserProjects.find(project => project.projectId === projectId); - let returnObj = {} - if (timeEntryProject !== undefined) { - returnObj = { - projectName: timeEntryProject?.projectName || "", - projectCategory: timeEntryProject?.projectCategory || "", - } - } - if (taskId) { - const timeEntryTask = displayUserTasks.find(task => task._id === taskId); - if (timeEntryTask) { - returnObj = { - ...returnObj, - taskName: timeEntryTask?.taskName || "", - taskClassification: "" - } - } - } - return returnObj; - } - } catch (error) { - console.log(error); - } - } const [timeEntryFormModal, setTimeEntryFormModal] = useState(false); const [isProcessing, setIsProcessing] = useState(false); const [filteredColor,setFilteredColor] = useState(hrsFilterBtnColorMap[7]); - const [projectDetails,setProjectDetails] = useState(projectDetailsSetup()) const dispatch = useDispatch(); const cantEditJaeRelatedRecord = cantUpdateDevAdminDetails(timeEntryUserProfile?.email ? timeEntryUserProfile.email : '', authUser.email); @@ -159,10 +125,6 @@ const TimeEntry = (props) => { editFilteredColor(); }, []) - useEffect(() => { - setProjectDetails(projectDetailsSetup()); - }, [from]) - return (
{
Project/Task:

- {projectDetails?.projectName} + {projectName}
- {projectDetails?.taskName && `\u2003 ↳ ${projectDetails?.taskName}`} + {taskName && `\u2003 ↳ ${taskName}`}

{ diff --git a/src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx b/src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx index baa2aa8679..20673a4d78 100644 --- a/src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx +++ b/src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx @@ -141,7 +141,6 @@ const TimeEntryForm = props => { const canPutUserProfileImportantInfo = props.hasPermission('putUserProfileImportantInfo'); // Administrator/Owner can add time entries for any dates, and other roles can only edit their own time entry in the same day. - const canUserEditDate = canEditTimeEntry && canPutUserProfileImportantInfo; const canChangeTime = from !== 'Timer' && (from === 'TimeLog' || canEditTimeEntry || isSameDayAuthUserEdit) ; /*---------------- methods -------------- */