diff --git a/src/Components/MyFormInputs/index.js b/src/Components/MyFormInputs/index.js index 12cd186..311acd6 100644 --- a/src/Components/MyFormInputs/index.js +++ b/src/Components/MyFormInputs/index.js @@ -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 ( - ); -} */ - 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 ( ({ validator(_, value) { + if (inputNotRequired && !value) { + return Promise.resolve(); + } + if ( !value || !isValid(value) || diff --git a/src/Components/SideMenu/index.js b/src/Components/SideMenu/index.js index b63b051..13acd00 100644 --- a/src/Components/SideMenu/index.js +++ b/src/Components/SideMenu/index.js @@ -32,8 +32,6 @@ export function SideMenuContent({ const navigate = useNavigate(); - console.log("selectedKeys", selectedKeys); - const getFirstMenuItems = () => { let items = [ { diff --git a/src/Pages/Store/Employees/index.js b/src/Pages/Store/Employees/index.js index ef84f91..0c39e75 100644 --- a/src/Pages/Store/Employees/index.js +++ b/src/Pages/Store/Employees/index.js @@ -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({ > - + {modalOptions.mode === "add" && ( <>