Skip to content

Commit

Permalink
Add note about editing entries to unconfuse users
Browse files Browse the repository at this point in the history
  • Loading branch information
joonashak committed Mar 26, 2024
1 parent 9572bbc commit d6506e7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
16 changes: 15 additions & 1 deletion web/src/components/entry-dialog/EntryForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { Box, Button, Divider, Grid, TextField, useMediaQuery, useTheme } from "@mui/material";
import {
Alert,
Box,
Button,
Divider,
Grid,
TextField,
useMediaQuery,
useTheme,
} from "@mui/material";
import { Dayjs } from "dayjs";
import { Control, Controller } from "react-hook-form";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -54,6 +63,11 @@ const EntryForm = ({ control, reset, onSubmit, editEntry, originalDate }: EntryF
<DimensionComboBox control={control} name="issue" title={t("entryDialog.issue")} />
<DimensionComboBox control={control} name="client" title={t("entryDialog.client")} />
</Grid>
{editEntry && (
<Grid item xs={12}>
<Alert severity="info">{t("entryDialog.editingNote")}</Alert>
</Grid>
)}
{mobile ? (
<>
<Grid item xs={12}>
Expand Down
2 changes: 2 additions & 0 deletions web/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const en = {
noSelection: "No selection",
clear: "Clear",
delete: "Delete",
editingNote:
"You are editing an existing entry. Note that this entry will move to the end of the list. This is due to Netvisor API not supporting actually editing entries, rather the old entry will be deleted and a new one created in its place.",
},
entryTable: {
accepted: "Accepted",
Expand Down
2 changes: 2 additions & 0 deletions web/src/i18n/fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const fi = {
noSelection: "Ei valintaa",
clear: "Tyhjennä",
delete: "Poista",
editingNote:
"Olet muokkaamassa olemassa olevaa kirjausta. Huomaa, että muokattu kirjaus tulee siirtymään listan viimeiseksi. Tämä johtuu siitä, että Netvisor API ei tue kirjauksen muokkaamista, vaan pellin alla vanha poistetaan ja sen tilalle luodaan uusi kirjaus.",
},
entryTable: {
accepted: "Hyväksytty",
Expand Down

0 comments on commit d6506e7

Please sign in to comment.