diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json
index d6bfc4f..16873c1 100644
--- a/public/locales/de/translation.json
+++ b/public/locales/de/translation.json
@@ -33,6 +33,7 @@
"email": "E-Mail",
"emailPlaceholder": "Geben Sie Ihre E-Mail ein",
"emailPlaceholderThirdPerson": "Geben Sie die E-Mail ein",
+ "emailPlaceholderNew": "Geben Sie Ihre neue E-Mail ein",
"password": "Passwort",
"passwordPlaceholder": "Geben Sie Ihr Passwort ein",
"noDataFound": "Keine Einträge gefunden",
@@ -313,6 +314,16 @@
"analytics": "Analytik",
"analyticsDescription": "Dazu gehören Informationen über die Nutzung unseres Dashboards, wie die besuchten Seiten, die Verweildauer auf den Seiten und die allgemeine Interaktion mit den Seiten. Dies hilft uns, unser Dashboard zu verbessern und es benutzerfreundlicher zu gestalten."
},
+ "changeEmailModal": {
+ "title": "E-Mail-Adresse ändern",
+ "info": "Nachdem Sie Ihre neue E-Mail-Adresse angegeben haben, erhalten Sie eine E-Mail mit einem Bestätigungslink. Bitte klicken Sie auf diesen Link, um Ihre neue E-Mail-Adresse zu bestätigen. Ihre alte E-Mail-Adresse bleibt so lange aktiv, bis die neue E-Mail-Adresse verifiziert ist. Nach der Verifizierung werden alle Ihre Sitzungen abgemeldet und Sie müssen sich erneut anmelden.",
+ "request": {
+ "200": {
+ "title": "Anfrage zur E-Mail-Änderung gesendet",
+ "description": "Wir haben einen Bestätigungslink an Ihre neue E-Mail-Adresse gesendet. Bitte klicken Sie auf den Link, um Ihre neue E-Mail-Adresse zu bestätigen."
+ }
+ }
+ },
"changePassword": {
"cardTitle": "Passwort ändern",
"currentPassword": "Aktuelles Passwort",
@@ -378,6 +389,7 @@
"title": "Verifizierung fehlgeschlagen",
"description": "Keine ausstehende Überprüfung gefunden"
},
+ "buttonToLogin": "Jetzt anmelden",
"content": [
{
"requesting": {
@@ -387,6 +399,18 @@
"title": "E-Mail-Überprüfung erfolgreich",
"button": "Jetzt anmelden"
}
+ },
+ {
+ "init": {
+ "title": "Bestätigen Sie die E-Mail Änderung",
+ "subTitle": "Bestätigen Sie Ihre neue E-Mail Adresse, indem Sie Ihr Passwort eingeben"
+ },
+ "requesting": {
+ "title": "Bestätigung der E-Mail Änderung"
+ },
+ "success": {
+ "title": "E-Mail-Änderung erfolgreich"
+ }
}
]
},
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json
index 6eedffd..020568b 100644
--- a/public/locales/en/translation.json
+++ b/public/locales/en/translation.json
@@ -33,6 +33,7 @@
"email": "Email",
"emailPlaceholder": "Enter your email",
"emailPlaceholderThirdPerson": "Enter the email",
+ "emailPlaceholderNew": "Enter your new email",
"password": "Password",
"passwordPlaceholder": "Enter your password",
"noDataFound": "No data found",
@@ -316,6 +317,16 @@
"analytics": "Analytics",
"analyticsDescription": "This includes information about the use of our dashboard, such as the visited pages, the length of stay on the pages and the general interaction with the pages. This helps us to improve our dashboard and make it more user-friendly."
},
+ "changeEmailModal": {
+ "title": "Change email",
+ "info": "After submitting your new email, you will receive an email with a verification link. Please click on the link to verify your new email address. Your old email address will remain active until the new email address is verified. After verification all your sessions will be logged out and you have to log in again.",
+ "request": {
+ "200": {
+ "title": "Email change request sent",
+ "description": "We have sent an verification link to your new email address. Please click on the link to verify your new email address."
+ }
+ }
+ },
"changePassword": {
"cardTitle": "Change password",
"currentPassword": "Current password",
@@ -381,6 +392,7 @@
"title": "Verification failed",
"description": "No pending verification found."
},
+ "buttonToLogin": "Login now",
"content": [
{
"requesting": {
@@ -390,6 +402,18 @@
"title": "Email verification successful",
"button": "Login now"
}
+ },
+ {
+ "init": {
+ "title": "Confirm the email change",
+ "subTitle": "Confirm your new email address by entering your password"
+ },
+ "requesting": {
+ "title": "Validating email change"
+ },
+ "success": {
+ "title": "Email change successful"
+ }
}
]
},
diff --git a/src/Components/MyFormInputs/index.js b/src/Components/MyFormInputs/index.js
index d804892..98c4e2a 100644
--- a/src/Components/MyFormInputs/index.js
+++ b/src/Components/MyFormInputs/index.js
@@ -1,8 +1,9 @@
-import { Form, Input, InputNumber, Skeleton } from "antd";
+import { Button, Form, Input, InputNumber, Skeleton, Space } from "antd";
import { Constants, isEmailValid, myFetch } from "../../utils";
-import { useRef } from "react";
+import { createElement, useRef } from "react";
import { useTranslation } from "react-i18next";
import { useAppContext } from "../../Contexts/AppContext";
+import { EditOutlined } from "@ant-design/icons";
export function MyUsernameFormInput({
propsFormItem,
@@ -76,6 +77,7 @@ export function MyEmailFormInput({
hasFeedback,
showSkeleton,
thirdPerson,
+ newEmail,
}) {
const { t } = useTranslation();
@@ -94,6 +96,8 @@ export function MyEmailFormInput({
inputPlaceholder={
thirdPerson
? t("common.emailPlaceholderThirdPerson")
+ : newEmail
+ ? t("common.emailPlaceholderNew")
: t("common.emailPlaceholder")
}
ruleMessageValueMinLengthRequired={t("common.inputRules.emailMinLength", {
@@ -307,6 +311,7 @@ export function MyFormInput({
inputType,
inputNotRequired,
showSkeleton,
+ InputFatherElement,
}) {
const commonProps = {
...propsInput,
@@ -359,6 +364,8 @@ export function MyFormInput({
),
};
+ const inputComponent = inputComponents[inputType] || inputComponents.default;
+
return (