diff --git a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx index 8d57812f8..669c5c7b9 100644 --- a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx +++ b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx @@ -462,7 +462,7 @@ interface ISearchTaskInputProps { * * @returns The Search input component */ -function SearchTaskInput(props: ISearchTaskInputProps) { +export function SearchTaskInput(props: ISearchTaskInputProps) { const { selectedPlan, setShowSearchInput, defaultTask, setDefaultTask } = props; const { tasks: teamTasks, createTask } = useTeamTasks(); const { taskStatus } = useTaskStatus(); diff --git a/apps/web/lib/features/daily-plan/all-plans-modal.tsx b/apps/web/lib/features/daily-plan/all-plans-modal.tsx index 1744d094b..5f851fe19 100644 --- a/apps/web/lib/features/daily-plan/all-plans-modal.tsx +++ b/apps/web/lib/features/daily-plan/all-plans-modal.tsx @@ -1,15 +1,16 @@ -import { Card, Modal, NoData, Tooltip, VerticalSeparator } from 'lib/components'; +import { Card, InputField, Modal, NoData, Tooltip, VerticalSeparator } from 'lib/components'; import { Dispatch, memo, SetStateAction, useCallback, useMemo, useState } from 'react'; import { clsxm } from '@app/utils'; import { Text } from 'lib/components'; -import { ChevronRightIcon } from 'assets/svg'; -import { AddTasksEstimationHoursModal } from './add-task-estimation-hours-modal'; +import { AddIcon, ChevronRightIcon } from 'assets/svg'; +import { AddTasksEstimationHoursModal, SearchTaskInput } from './add-task-estimation-hours-modal'; import { useDailyPlan } from '@app/hooks'; import { Button } from '@components/ui/button'; import { Calendar } from '@components/ui/calendar'; -import { IDailyPlan } from '@app/interfaces'; +import { IDailyPlan, ITeamTask } from '@app/interfaces'; import moment from 'moment'; import { ValueNoneIcon } from '@radix-ui/react-icons'; +import { useTranslations } from 'next-intl'; interface IAllPlansModal { closeModal: () => void; @@ -90,6 +91,12 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal) } }, [selectedTab, todayPlan, tomorrowPlan, selectedFuturePlan]); + const [showSearchInput, setShowSearchInput] = useState(false); + const [defaultTask, setDefaultTask] = useState(null); + const [workTimePlanned, setWorkTimePlanned] = useState(0); + const [isWorkingTimeInputFocused, setWorkingTimeInputFocused] = useState(false); + const t = useTranslations(); + // Set the related tab for today and tomorrow dates const handleCalendarSelect = useCallback(() => { if (customDate) { @@ -154,7 +161,7 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal) -
+
{selectedTab === 'Calendar' && showCalendar ? (
@@ -202,7 +209,63 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal) closeModal={handleCloseModal} /> ) : ( - } text="Plan not found " /> + <> + {showSearchInput ? ( + + ) : ( +
+ + {t('timer.todayPlanSettings.WORK_TIME_PLANNED')}{' '} + * + +
+ { + !isNaN(parseInt(e.target.value)) + ? setWorkTimePlanned(parseInt(e.target.value)) + : setWorkTimePlanned(0); + }} + required + noWrapper + min={0} + value={ + !isNaN(workTimePlanned) && + workTimePlanned.toString() !== '0' + ? workTimePlanned.toString().replace(/^0+/, '') + : isWorkingTimeInputFocused + ? '' + : 0 + } + onFocus={() => setWorkingTimeInputFocused(true)} + onBlur={() => setWorkingTimeInputFocused(false)} + defaultValue={0} + /> + +
+
+ )} +
+ } text="Plan not found " /> +
+ )} )}