From 4891e7b127bc7640ed771cf5fba3cb8426d972dc Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 1 Apr 2024 15:09:47 +0200 Subject: [PATCH] rm init password --- public/locales/de/translation.json | 1 + public/locales/en/translation.json | 1 + src/Components/MyFormInputs/index.js | 6 ++-- src/Pages/Store/Employees/index.js | 54 ++++++++++++++-------------- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 77f6b39..c6a1558 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -37,6 +37,7 @@ "emailPlaceholderNew": "Geben Sie Ihre neue E-Mail ein", "password": "Passwort", "passwordPlaceholder": "Geben Sie Ihr Passwort ein", + "passwordPlaceholderThirdPerson": "Geben Sie das Passwort ein", "passwordPlaceholderNew": "Geben Sie Ihr neues Passwort ein", "noDataFound": "Keine Einträge gefunden", "calendarMaxFutureBookingDays": "Max. Tage im Voraus", diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index c9c7396..8379516 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -37,6 +37,7 @@ "emailPlaceholderNew": "Enter your new email", "password": "Password", "passwordPlaceholder": "Enter your password", + "passwordPlaceholderThirdPerson": "Enter the password", "passwordPlaceholderNew": "Enter your new password", "noDataFound": "No data found", "calendarMaxFutureBookingDays": "Max. future booking days", diff --git a/src/Components/MyFormInputs/index.js b/src/Components/MyFormInputs/index.js index 5e9f625..32a3d1c 100644 --- a/src/Components/MyFormInputs/index.js +++ b/src/Components/MyFormInputs/index.js @@ -2,7 +2,6 @@ import { Form, Input, InputNumber, Skeleton } from "antd"; import { Constants, isEmailValid, myFetch } from "../../utils"; import { createElement, useRef } from "react"; import { useTranslation } from "react-i18next"; -import { useAppContext } from "../../Contexts/AppContext"; export function MyUsernameFormInput({ propsFormItem, @@ -45,6 +44,7 @@ export function MyPasswordFormInput({ inputPlaceholder, formItemRules, newPassword, + thirdPerson, }) { const { t } = useTranslation(); @@ -64,7 +64,9 @@ export function MyPasswordFormInput({ } )} inputPlaceholder={ - inputPlaceholder || newPassword + thirdPerson + ? t("common.passwordPlaceholderThirdPerson") + : inputPlaceholder || newPassword ? t("common.passwordPlaceholderNew") : t("common.passwordPlaceholder") } diff --git a/src/Pages/Store/Employees/index.js b/src/Pages/Store/Employees/index.js index 75de765..ed16bab 100644 --- a/src/Pages/Store/Employees/index.js +++ b/src/Pages/Store/Employees/index.js @@ -212,11 +212,11 @@ function ModalAddEditEmployee({ const { storeId } = useParams(); const screenBreakpoint = useBreakpoint(); const [form] = Form.useForm(); - + /* const checkboxSetPasswordOnLogging = Form.useWatch( "checkboxSetPasswordOnLogging", form - ); + ); */ const [isRequesting, setIsRequesting] = useState(false); @@ -294,16 +294,16 @@ function ModalAddEditEmployee({ username: values.username, email: values.email, language: i18n.language, - passwordSetOnInitLogging: - values.checkboxSetPasswordOnLogging, + /*passwordSetOnInitLogging: + values.checkboxSetPasswordOnLogging, */ }; - if ( + /*if ( !values.checkboxSetPasswordOnLogging && values.password - ) { - body.password = EncodeStringToBase64(values.password); - } + ) { */ + body.password = EncodeStringToBase64(values.password); + //} if ( values.calendarMaxFutureBookingDays !== @@ -443,25 +443,9 @@ function ModalAddEditEmployee({ > - + - {modalOptions.mode === "add" && ( - <> - - - {t("employees.modalAddEmployee.checkboxSetPasswordOnLogging")} - - - - {!checkboxSetPasswordOnLogging && } - - )} + {modalOptions.mode === "add" && } ); } + +/* + + + {t("employees.modalAddEmployee.checkboxSetPasswordOnLogging")} + + + + {!checkboxSetPasswordOnLogging && ( + + )} +*/