Selaa lähdekoodia

update timesheet

tags/Baseline_30082024_FRONTEND_UAT
cyril.tsui 1 vuosi sitten
vanhempi
commit
43f922df63
3 muutettua tiedostoa jossa 28 lisäystä ja 3 poistoa
  1. +8
    -1
      src/components/LeaveTable/LeaveEditModal.tsx
  2. +12
    -1
      src/components/PastEntryCalendar/PastEntryList.tsx
  3. +8
    -1
      src/components/TimesheetTable/TimesheetEditModal.tsx

+ 8
- 1
src/components/LeaveTable/LeaveEditModal.tsx Näytä tiedosto

@@ -6,7 +6,7 @@ import {
} from "@/app/api/timesheets/utils";
import { shortDateFormatter } from "@/app/utils/formatUtil";
import { roundToNearestQuarter } from "@/app/utils/manhourUtils";
import { Check, Delete } from "@mui/icons-material";
import { Check, Delete, Close } from "@mui/icons-material";
import {
Box,
Button,
@@ -173,6 +173,13 @@ const LeaveEditModal: React.FC<Props> = ({
{t("Delete")}
</Button>
)}
<Button
variant="outlined"
startIcon={<Close />}
onClick={(event) => closeHandler(event, "backdropClick")}
>
{t("Close")}
</Button>
<Button
variant="contained"
startIcon={<Check />}


+ 12
- 1
src/components/PastEntryCalendar/PastEntryList.tsx Näytä tiedosto

@@ -2,7 +2,7 @@ import {
RecordTimesheetInput,
RecordLeaveInput,
} from "@/app/api/timesheets/actions";
import { shortDateFormatter } from "@/app/utils/formatUtil";
import { manhourFormatter, shortDateFormatter } from "@/app/utils/formatUtil";
import { Box, Stack, Typography } from "@mui/material";
import dayjs from "dayjs";
import React, { useMemo } from "react";
@@ -28,6 +28,7 @@ const PastEntryList: React.FC<Props> = ({
allProjects,
}) => {
const {
t,
i18n: { language },
} = useTranslation("home");

@@ -93,6 +94,16 @@ const PastEntryList: React.FC<Props> = ({
leaveTypeMap={leaveTypeMap}
/>
))}
<Typography
variant="overline"
>
{t("Total Work Hours")}: {manhourFormatter.format(timeEntries.map(entry => (entry.inputHours ?? 0) + (entry.otHours ?? 0)).reduce((acc, cur) => { return acc + cur }, 0))}
</Typography>
<Typography
variant="overline"
>
{t("Total Leave Hours")}: {manhourFormatter.format(leaveEntries.map(entry => entry.inputHours).reduce((acc, cur) => { return acc + cur }, 0))}
</Typography>
</Box>
</Stack>
);


+ 8
- 1
src/components/TimesheetTable/TimesheetEditModal.tsx Näytä tiedosto

@@ -1,5 +1,5 @@
import { TimeEntry } from "@/app/api/timesheets/actions";
import { Check, Delete } from "@mui/icons-material";
import { Check, Delete, Close } from "@mui/icons-material";
import {
Box,
Button,
@@ -297,6 +297,13 @@ const TimesheetEditModal: React.FC<Props> = ({
{t("Delete")}
</Button>
)}
<Button
variant="outlined"
startIcon={<Close />}
onClick={(event) => closeHandler(event, "backdropClick")}
>
{t("Close")}
</Button>
<Button
variant="contained"
startIcon={<Check />}


Ladataan…
Peruuta
Tallenna