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 { useState } from "react";
import { API_BASE } from "@/config/api.config";
@@ -49,7 +56,7 @@ export const ContactPage = () => {
<Header />
<Field.Root invalid={message === ""}>
<Field.Label>
{t("contactPage_messageLabel")}
<Text>{t("contactPage_messageDescription")}</Text>
<Field.RequiredIndicator />
</Field.Label>
<Textarea

View File

@@ -86,5 +86,6 @@
"return": "Zurückgeben",
"take-loan-success": "Ausleihe erfolgreich abgeholt",
"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",
"take-loan-success": "Loan taken 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,
"ignoreDeprecations": "5.0"
"ignoreDeprecations": "6.0"
},
"include": ["src"]
}

View File

@@ -1,11 +1,11 @@
{
"backend-info": {
"version": "v2.0.1 (dev)"
"version": "v2.1 (dev)"
},
"frontend-info": {
"version": "v2.0 (dev)"
"version": "v2.1 (dev)"
},
"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
.map(
(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>`
: "<span style='color:#111827;'>N/A</span>";
@@ -101,19 +101,19 @@ function buildLoanEmail({ user, items, startDate, endDate, createdDate }) {
<tr>
<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(
startDate
startDate,
)}</td>
</tr>
<tr>
<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(
endDate
endDate,
)}</td>
</tr>
<tr>
<td style="padding:10px 14px; color:#6b7280;">Erstellt am</td>
<td style="padding:10px 14px; font-weight:600; color:#111827;">${formatDateTime(
createdDate
createdDate,
)}</td>
</tr>
</tbody>
@@ -174,8 +174,6 @@ export function sendMailLoan(user, items, startDate, endDate, createdDate) {
html: buildLoanEmail({ user, items, startDate, endDate, createdDate }),
});
// debugging logs
// console.log("Message sent:", info.messageId);
console.log("Loan message sent:", info.messageId);
})();
// console.log("sendMailLoan called");
}

View File

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