rm init password

master
alex 2024-04-01 15:09:47 +02:00
parent f3322f9166
commit 4891e7b127
4 changed files with 34 additions and 28 deletions

View File

@ -37,6 +37,7 @@
"emailPlaceholderNew": "Geben Sie Ihre neue E-Mail ein", "emailPlaceholderNew": "Geben Sie Ihre neue E-Mail ein",
"password": "Passwort", "password": "Passwort",
"passwordPlaceholder": "Geben Sie Ihr Passwort ein", "passwordPlaceholder": "Geben Sie Ihr Passwort ein",
"passwordPlaceholderThirdPerson": "Geben Sie das Passwort ein",
"passwordPlaceholderNew": "Geben Sie Ihr neues Passwort ein", "passwordPlaceholderNew": "Geben Sie Ihr neues Passwort ein",
"noDataFound": "Keine Einträge gefunden", "noDataFound": "Keine Einträge gefunden",
"calendarMaxFutureBookingDays": "Max. Tage im Voraus", "calendarMaxFutureBookingDays": "Max. Tage im Voraus",

View File

@ -37,6 +37,7 @@
"emailPlaceholderNew": "Enter your new email", "emailPlaceholderNew": "Enter your new email",
"password": "Password", "password": "Password",
"passwordPlaceholder": "Enter your password", "passwordPlaceholder": "Enter your password",
"passwordPlaceholderThirdPerson": "Enter the password",
"passwordPlaceholderNew": "Enter your new password", "passwordPlaceholderNew": "Enter your new password",
"noDataFound": "No data found", "noDataFound": "No data found",
"calendarMaxFutureBookingDays": "Max. future booking days", "calendarMaxFutureBookingDays": "Max. future booking days",

View File

@ -2,7 +2,6 @@ import { Form, Input, InputNumber, Skeleton } from "antd";
import { Constants, isEmailValid, myFetch } from "../../utils"; import { Constants, isEmailValid, myFetch } from "../../utils";
import { createElement, useRef } from "react"; import { createElement, useRef } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useAppContext } from "../../Contexts/AppContext";
export function MyUsernameFormInput({ export function MyUsernameFormInput({
propsFormItem, propsFormItem,
@ -45,6 +44,7 @@ export function MyPasswordFormInput({
inputPlaceholder, inputPlaceholder,
formItemRules, formItemRules,
newPassword, newPassword,
thirdPerson,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
@ -64,7 +64,9 @@ export function MyPasswordFormInput({
} }
)} )}
inputPlaceholder={ inputPlaceholder={
inputPlaceholder || newPassword thirdPerson
? t("common.passwordPlaceholderThirdPerson")
: inputPlaceholder || newPassword
? t("common.passwordPlaceholderNew") ? t("common.passwordPlaceholderNew")
: t("common.passwordPlaceholder") : t("common.passwordPlaceholder")
} }

View File

@ -212,11 +212,11 @@ function ModalAddEditEmployee({
const { storeId } = useParams(); const { storeId } = useParams();
const screenBreakpoint = useBreakpoint(); const screenBreakpoint = useBreakpoint();
const [form] = Form.useForm(); const [form] = Form.useForm();
/*
const checkboxSetPasswordOnLogging = Form.useWatch( const checkboxSetPasswordOnLogging = Form.useWatch(
"checkboxSetPasswordOnLogging", "checkboxSetPasswordOnLogging",
form form
); ); */
const [isRequesting, setIsRequesting] = useState(false); const [isRequesting, setIsRequesting] = useState(false);
@ -294,16 +294,16 @@ function ModalAddEditEmployee({
username: values.username, username: values.username,
email: values.email, email: values.email,
language: i18n.language, language: i18n.language,
passwordSetOnInitLogging: /*passwordSetOnInitLogging:
values.checkboxSetPasswordOnLogging, values.checkboxSetPasswordOnLogging, */
}; };
if ( /*if (
!values.checkboxSetPasswordOnLogging && !values.checkboxSetPasswordOnLogging &&
values.password values.password
) { ) { */
body.password = EncodeStringToBase64(values.password); body.password = EncodeStringToBase64(values.password);
} //}
if ( if (
values.calendarMaxFutureBookingDays !== values.calendarMaxFutureBookingDays !==
@ -443,25 +443,9 @@ function ModalAddEditEmployee({
> >
<MyUsernameFormInput thirdPerson /> <MyUsernameFormInput thirdPerson />
<MyEmailFormInput inputNotRequired={true} hasFeedback thirdPerson /> <MyEmailFormInput hasFeedback thirdPerson />
{modalOptions.mode === "add" && ( {modalOptions.mode === "add" && <MyPasswordFormInput thirdPerson />}
<>
<Form.Item
name="checkboxSetPasswordOnLogging"
valuePropName="checked"
extra={t(
"employees.modalAddEmployee.checkboxSetPasswordOnLoggingInfo"
)}
>
<Checkbox>
{t("employees.modalAddEmployee.checkboxSetPasswordOnLogging")}
</Checkbox>
</Form.Item>
{!checkboxSetPasswordOnLogging && <MyPasswordFormInput />}
</>
)}
<MyCalendarMaxFutureBookingDaysFormInput <MyCalendarMaxFutureBookingDaysFormInput
maxLength={storeSettings.calendar_max_future_booking_days} maxLength={storeSettings.calendar_max_future_booking_days}
@ -475,3 +459,21 @@ function ModalAddEditEmployee({
</> </>
); );
} }
/*
<Form.Item
name="checkboxSetPasswordOnLogging"
valuePropName="checked"
extra={t(
"employees.modalAddEmployee.checkboxSetPasswordOnLoggingInfo"
)}
>
<Checkbox>
{t("employees.modalAddEmployee.checkboxSetPasswordOnLogging")}
</Checkbox>
</Form.Item>
{!checkboxSetPasswordOnLogging && (
<MyPasswordFormInput thirdPerson />
)}
*/