update
parent
d7930f9f78
commit
2245fad297
|
@ -1,9 +1,8 @@
|
|||
import { Button, Form, Input, InputNumber, Skeleton, Space } from "antd";
|
||||
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";
|
||||
import { EditOutlined } from "@ant-design/icons";
|
||||
|
||||
export function MyUsernameFormInput({
|
||||
propsFormItem,
|
||||
|
@ -76,6 +75,7 @@ export function MyPasswordFormInput({
|
|||
}
|
||||
|
||||
export function MyEmailFormInput({
|
||||
inputNotRequired,
|
||||
propsFormItem,
|
||||
propsInput,
|
||||
disableEmailCheck,
|
||||
|
@ -88,6 +88,7 @@ export function MyEmailFormInput({
|
|||
|
||||
return (
|
||||
<MyAvailableCheckFormInput
|
||||
inputNotRequired={inputNotRequired}
|
||||
propsFormItem={propsFormItem}
|
||||
propsInput={propsInput}
|
||||
hasFeedback={hasFeedback}
|
||||
|
@ -123,29 +124,6 @@ export function MyEmailFormInput({
|
|||
);
|
||||
}
|
||||
|
||||
/*
|
||||
export function MyEmailFormInput() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<MyFormInput
|
||||
formItemName="email"
|
||||
minLength={0}
|
||||
maxLength={64}
|
||||
label={t("common.email")}
|
||||
ruleMessageValueRequired={t("common.inputRules.emailRequired")}
|
||||
inputPlaceholder={t("common.emailPlaceholder")}
|
||||
inputType="email"
|
||||
formItemRules={[
|
||||
{
|
||||
type: "email",
|
||||
message: t("common.inputRules.emailInvalid"),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
} */
|
||||
|
||||
export function MyCalendarMaxFutureBookingDaysFormInput({
|
||||
formItemName = "calendarMaxFutureBookingDays",
|
||||
}) {
|
||||
|
@ -219,6 +197,7 @@ export function MyCompanyNameFormInput({ showSkeleton }) {
|
|||
}
|
||||
|
||||
export function MyAvailableCheckFormInput({
|
||||
inputNotRequired,
|
||||
propsFormItem,
|
||||
propsInput,
|
||||
formItemName,
|
||||
|
@ -246,6 +225,7 @@ export function MyAvailableCheckFormInput({
|
|||
|
||||
return (
|
||||
<MyFormInput
|
||||
inputNotRequired={inputNotRequired}
|
||||
propsFormItem={{
|
||||
...propsFormItem,
|
||||
hasFeedback: hasFeedback,
|
||||
|
@ -264,6 +244,10 @@ export function MyAvailableCheckFormInput({
|
|||
...formItemRules,
|
||||
() => ({
|
||||
validator(_, value) {
|
||||
if (inputNotRequired && !value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (
|
||||
!value ||
|
||||
!isValid(value) ||
|
||||
|
|
|
@ -32,8 +32,6 @@ export function SideMenuContent({
|
|||
|
||||
const navigate = useNavigate();
|
||||
|
||||
console.log("selectedKeys", selectedKeys);
|
||||
|
||||
const getFirstMenuItems = () => {
|
||||
let items = [
|
||||
{
|
||||
|
|
|
@ -364,9 +364,10 @@ function ModalAddEditEmployee({
|
|||
formUsername === modalOptions.selectedEmployee.username &&
|
||||
formEmail === modalOptions.selectedEmployee.email &&
|
||||
formCalendarMaxFutureBookingDays ===
|
||||
modalOptions.selectedEmployee.maxFutureBookingDays &&
|
||||
modalOptions.selectedEmployee
|
||||
.calendarMaxFutureBookingDays &&
|
||||
formCalendarMinEarliestBookingTime ===
|
||||
modalOptions.selectedEmployee.minEarliestBookingTime
|
||||
modalOptions.selectedEmployee.calendarMinEarliestBookingTime
|
||||
) {
|
||||
handleModalClose();
|
||||
return;
|
||||
|
@ -382,20 +383,21 @@ function ModalAddEditEmployee({
|
|||
body.username = formUsername;
|
||||
}
|
||||
|
||||
console.log(
|
||||
"email",
|
||||
formEmail,
|
||||
modalOptions.selectedEmployee.email,
|
||||
formEmail !== modalOptions.selectedEmployee.email
|
||||
);
|
||||
|
||||
if (formEmail !== modalOptions.selectedEmployee.email) {
|
||||
validateFields.push("email");
|
||||
body.email = formEmail;
|
||||
}
|
||||
|
||||
console.log(
|
||||
"max",
|
||||
formCalendarMaxFutureBookingDays,
|
||||
modalOptions.selectedEmployee.maxFutureBookingDays
|
||||
);
|
||||
|
||||
if (
|
||||
formCalendarMaxFutureBookingDays !==
|
||||
modalOptions.selectedEmployee.maxFutureBookingDays
|
||||
modalOptions.selectedEmployee.calendarMaxFutureBookingDays
|
||||
) {
|
||||
validateFields.push("calendarMaxFutureBookingDays");
|
||||
body.calendarMaxFutureBookingDays =
|
||||
|
@ -404,7 +406,7 @@ function ModalAddEditEmployee({
|
|||
|
||||
if (
|
||||
formCalendarMinEarliestBookingTime !==
|
||||
modalOptions.selectedEmployee.minEarliestBookingTime
|
||||
modalOptions.selectedEmployee.calendarMinEarliestBookingTime
|
||||
) {
|
||||
validateFields.push("calendarMinEarliestBookingTime");
|
||||
body.calendarMinEarliestBookingTime =
|
||||
|
@ -449,7 +451,7 @@ function ModalAddEditEmployee({
|
|||
>
|
||||
<MyUsernameFormInput thirdPerson />
|
||||
|
||||
<MyEmailFormInput hasFeedback thirdPerson />
|
||||
<MyEmailFormInput inputNotRequired={true} hasFeedback thirdPerson />
|
||||
|
||||
{modalOptions.mode === "add" && (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue