diff --git a/frontend/src/components/AbsencePlanner/AbsenceExtentInput.tsx b/frontend/src/components/AbsencePlanner/AbsenceExtentInput.tsx deleted file mode 100644 index da1f78dc..00000000 --- a/frontend/src/components/AbsencePlanner/AbsenceExtentInput.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; - -interface AbsenceExtentInputProps { - onChange: React.ChangeEventHandler; - value: number; - className?: string; -} - -export function AbsenceExtentInput({ - onChange, - value, - className = "", -}: AbsenceExtentInputProps) { - return ( - - ); -} - -export default AbsenceExtentInput; diff --git a/frontend/src/pages/AbsencePlanner.tsx b/frontend/src/pages/AbsencePlanner.tsx index d71743f8..c3ef924d 100644 --- a/frontend/src/pages/AbsencePlanner.tsx +++ b/frontend/src/pages/AbsencePlanner.tsx @@ -41,7 +41,6 @@ import floppy from "../icons/floppy.svg"; import { useConfirm } from "../components/ConfirmDialogProvider"; import calender from "../icons/calendar-week-white.svg"; -import AbsenceExtentInput from "../components/AbsencePlanner/AbsenceExtentInput"; import AbsenceIssuesSelector from "../components/AbsencePlanner/AbsenceIssuesSelector"; export const AbsencePlanner = () => { @@ -58,7 +57,7 @@ export const AbsencePlanner = () => { id: number; subject: string; }>(absenceIssueOptions[0]); - const [selectedExtent, setSelectedExtent] = useState(8); + const extentOfAbsence = 8; const [isLoading, setIsLoading] = useState(false); const [tableData, setTableData] = useState([]); @@ -480,7 +479,7 @@ export const AbsencePlanner = () => { const allReported = await reportAbsenceTime( reportable_days, selectedIssue.id, - selectedExtent + extentOfAbsence ); toggleLoadingPage(false); setStartDate(undefined); @@ -535,7 +534,7 @@ export const AbsencePlanner = () => { 0 ); const expectedNewAmountOfHoursForWeek = - reportedHours + selectedExtent * numberOfEntries; + reportedHours + extentOfAbsence * numberOfEntries; numberOfReportedHoursPerWeek.push(expectedNewAmountOfHoursForWeek); }); @@ -572,7 +571,7 @@ export const AbsencePlanner = () => { }; const onAddAbsenceButton = async () => { const areDatesValid: boolean = validateDates(); - const isExtentValid: boolean = validateExtent(selectedExtent); + const isExtentValid: boolean = validateExtent(extentOfAbsence); if (areDatesValid) { if (isExtentValid) { @@ -667,11 +666,6 @@ export const AbsencePlanner = () => { setSelectedIssue(selectedIssue); }; - const onSelectAbsenceExtent = (e: React.ChangeEvent) => { - const extent = Number(e.target.value); - setSelectedExtent(extent); - }; - return ( <> { Start End Reason - Extent {tableData.map((element, index) => { return ( @@ -750,7 +743,6 @@ export const AbsencePlanner = () => { )?.subject } - {element.extent ? element.extent : "NA"} ); })} @@ -810,15 +802,6 @@ export const AbsencePlanner = () => { defaultOption={absenceIssueOptions[0].id} /> -
- - -