refactor: update contact page message description and improve email logging

This commit is contained in:
2026-02-07 17:33:16 +01:00
parent 7221ee1843
commit 2e98fa50de
7 changed files with 23 additions and 18 deletions

View File

@@ -1,4 +1,11 @@
import { Field, Textarea, Button, Alert, Container } from "@chakra-ui/react"; import {
Field,
Textarea,
Button,
Alert,
Container,
Text,
} from "@chakra-ui/react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useState } from "react"; import { useState } from "react";
import { API_BASE } from "@/config/api.config"; import { API_BASE } from "@/config/api.config";
@@ -49,7 +56,7 @@ export const ContactPage = () => {
<Header /> <Header />
<Field.Root invalid={message === ""}> <Field.Root invalid={message === ""}>
<Field.Label> <Field.Label>
{t("contactPage_messageLabel")} <Text>{t("contactPage_messageDescription")}</Text>
<Field.RequiredIndicator /> <Field.RequiredIndicator />
</Field.Label> </Field.Label>
<Textarea <Textarea

View File

@@ -86,5 +86,6 @@
"return": "Zurückgeben", "return": "Zurückgeben",
"take-loan-success": "Ausleihe erfolgreich abgeholt", "take-loan-success": "Ausleihe erfolgreich abgeholt",
"return-loan-success": "Ausleihe erfolgreich zurückgegeben", "return-loan-success": "Ausleihe erfolgreich zurückgegeben",
"network-error": "Netzwerkfehler. Kontaktieren Sie den Administrator." "network-error": "Netzwerkfehler. Kontaktieren Sie den Administrator.",
"contactPage_messageDescription": "Bitte geben Sie hier Ihre Nachricht ein. Der Systemadministrator (Theis Gaedigk) wird sich so schnell wie möglich bei Ihnen melden."
} }

View File

@@ -86,5 +86,6 @@
"return": "Return", "return": "Return",
"take-loan-success": "Loan taken successfully", "take-loan-success": "Loan taken successfully",
"return-loan-success": "Loan returned successfully", "return-loan-success": "Loan returned successfully",
"network-error": "Network error. Please contact the administrator." "network-error": "Network error. Please contact the administrator.",
"contactPage_messageDescription": "Please enter your message here. The system administrator (Theis Gaedigk) will get back to you as soon as possible."
} }

View File

@@ -30,7 +30,7 @@
}, },
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"ignoreDeprecations": "5.0" "ignoreDeprecations": "6.0"
}, },
"include": ["src"] "include": ["src"]
} }

View File

@@ -1,11 +1,11 @@
{ {
"backend-info": { "backend-info": {
"version": "v2.0.1 (dev)" "version": "v2.1 (dev)"
}, },
"frontend-info": { "frontend-info": {
"version": "v2.0 (dev)" "version": "v2.1 (dev)"
}, },
"admin-panel-info": { "admin-panel-info": {
"version": "v1.3 (dev)" "version": "v1.3.2 (dev)"
} }
} }

View File

@@ -41,7 +41,7 @@ function buildLoanEmail({ user, items, startDate, endDate, createdDate }) {
? `<ul style="margin:4px 0 0 18px; padding:0;">${items ? `<ul style="margin:4px 0 0 18px; padding:0;">${items
.map( .map(
(i) => (i) =>
`<li style="margin:2px 0; color:#111827; line-height:1.3;">${i}</li>` `<li style="margin:2px 0; color:#111827; line-height:1.3;">${i}</li>`,
) )
.join("")}</ul>` .join("")}</ul>`
: "<span style='color:#111827;'>N/A</span>"; : "<span style='color:#111827;'>N/A</span>";
@@ -101,19 +101,19 @@ function buildLoanEmail({ user, items, startDate, endDate, createdDate }) {
<tr> <tr>
<td style="padding:10px 14px; color:#6b7280; border-bottom:1px solid #ececec;">Startdatum</td> <td style="padding:10px 14px; color:#6b7280; border-bottom:1px solid #ececec;">Startdatum</td>
<td style="padding:10px 14px; font-weight:600; border-bottom:1px solid #ececec; color:#111827;">${formatDateTime( <td style="padding:10px 14px; font-weight:600; border-bottom:1px solid #ececec; color:#111827;">${formatDateTime(
startDate startDate,
)}</td> )}</td>
</tr> </tr>
<tr> <tr>
<td style="padding:10px 14px; color:#6b7280; border-bottom:1px solid #ececec;">Enddatum</td> <td style="padding:10px 14px; color:#6b7280; border-bottom:1px solid #ececec;">Enddatum</td>
<td style="padding:10px 14px; font-weight:600; border-bottom:1px solid #ececec; color:#111827;">${formatDateTime( <td style="padding:10px 14px; font-weight:600; border-bottom:1px solid #ececec; color:#111827;">${formatDateTime(
endDate endDate,
)}</td> )}</td>
</tr> </tr>
<tr> <tr>
<td style="padding:10px 14px; color:#6b7280;">Erstellt am</td> <td style="padding:10px 14px; color:#6b7280;">Erstellt am</td>
<td style="padding:10px 14px; font-weight:600; color:#111827;">${formatDateTime( <td style="padding:10px 14px; font-weight:600; color:#111827;">${formatDateTime(
createdDate createdDate,
)}</td> )}</td>
</tr> </tr>
</tbody> </tbody>
@@ -174,8 +174,6 @@ export function sendMailLoan(user, items, startDate, endDate, createdDate) {
html: buildLoanEmail({ user, items, startDate, endDate, createdDate }), html: buildLoanEmail({ user, items, startDate, endDate, createdDate }),
}); });
// debugging logs console.log("Loan message sent:", info.messageId);
// console.log("Message sent:", info.messageId);
})(); })();
// console.log("sendMailLoan called");
} }

View File

@@ -38,8 +38,6 @@ export function sendMail(username, message) {
html: mailHtml, html: mailHtml,
}); });
// debugging logs console.log("Contact message sent: %s", info.messageId);
// console.log("Message sent:", info.messageId);
})(); })();
// console.log("sendMailLoan called");
} }