Added timeslots from api
This commit is contained in:
parent
ec75fb476f
commit
03ee5d6fa8
@ -23,16 +23,8 @@ const InputValidation = Yup.object().shape({
|
|||||||
.required("Please enter a domain"),
|
.required("Please enter a domain"),
|
||||||
username: Yup.string().min(2, "Too Short!").required("Required"),
|
username: Yup.string().min(2, "Too Short!").required("Required"),
|
||||||
original_server: Yup.string()
|
original_server: Yup.string()
|
||||||
.matches(
|
|
||||||
/^((([1-9]?\d|1\d\d|2[0-5][0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|2[0-5][0-5]|2[0-4]\d))|(((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?[a-zA-Z0-9#]+)*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?)|([a-z0-9]{0,4}-[a-z0-9]{0,2}-[a-z0-9]{0,3})$/i,
|
|
||||||
"Please enter a valid IPv4 Address or domain"
|
|
||||||
)
|
|
||||||
.required("Please enter a valid IPv4 or domain"),
|
.required("Please enter a valid IPv4 or domain"),
|
||||||
new_server: Yup.string()
|
new_server: Yup.string()
|
||||||
.matches(
|
|
||||||
/^((([1-9]?\d|1\d\d|2[0-5][0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|2[0-5][0-5]|2[0-4]\d))|(((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?[a-zA-Z0-9#]+)*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?)|([a-z0-9]{0,4}-[a-z0-9]{0,2}-[a-z0-9]{0,3})$/i,
|
|
||||||
"Please enter a valid IPv4 Address or domain"
|
|
||||||
)
|
|
||||||
.required("Please enter a valid IPv4 or domain"),
|
.required("Please enter a valid IPv4 or domain"),
|
||||||
agent_booked: Yup.string()
|
agent_booked: Yup.string()
|
||||||
.min(2, "Too short!")
|
.min(2, "Too short!")
|
||||||
@ -44,7 +36,7 @@ const InputValidation = Yup.object().shape({
|
|||||||
booked_date: Yup.date().required("Please enter a date!"),
|
booked_date: Yup.date().required("Please enter a date!"),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const CPanelBooking = () => {
|
export const CPanelBooking = (timeslots) => {
|
||||||
const [respID, setRespID] = useState(0);
|
const [respID, setRespID] = useState(0);
|
||||||
const [error, setError] = useState(0);
|
const [error, setError] = useState(0);
|
||||||
|
|
||||||
@ -70,6 +62,7 @@ export const CPanelBooking = () => {
|
|||||||
});
|
});
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
@ -108,12 +101,7 @@ export const CPanelBooking = () => {
|
|||||||
className="has-success"
|
className="has-success"
|
||||||
>
|
>
|
||||||
<option>Select</option>
|
<option>Select</option>
|
||||||
<option>00:00-03:00</option>
|
{timeslots.timeslots.map((slot) => <option>{slot}</option>)}
|
||||||
<option>03:00-06:00</option>
|
|
||||||
<option>06:00-09:00</option>
|
|
||||||
<option>08:00-12:00</option>
|
|
||||||
<option>12:00-18:00</option>
|
|
||||||
<option>18:00-00:00</option>
|
|
||||||
</Input>
|
</Input>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import classnames from "classnames";
|
|||||||
import { CPanelBooking } from "./CPanelBooking";
|
import { CPanelBooking } from "./CPanelBooking";
|
||||||
import EmailBooking from "./EmailBooking";
|
import EmailBooking from "./EmailBooking";
|
||||||
|
|
||||||
const FormPage = ({ item }) => {
|
const FormPage = ({ timeslots, item }) => {
|
||||||
const [activeTab, setActiveTab] = useState("1");
|
const [activeTab, setActiveTab] = useState("1");
|
||||||
|
|
||||||
const toggle = (tab) => {
|
const toggle = (tab) => {
|
||||||
@ -23,7 +23,6 @@ const FormPage = ({ item }) => {
|
|||||||
// Parent page from the Book section,
|
// Parent page from the Book section,
|
||||||
// Can be expanded to offer email migration bookings,
|
// Can be expanded to offer email migration bookings,
|
||||||
// elements below do the POST requests.
|
// elements below do the POST requests.
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Nav tabs>
|
<Nav tabs>
|
||||||
@ -52,7 +51,7 @@ const FormPage = ({ item }) => {
|
|||||||
<TabPane tabId="1">
|
<TabPane tabId="1">
|
||||||
<Row>
|
<Row>
|
||||||
<Col sm="12">
|
<Col sm="12">
|
||||||
<CPanelBooking />
|
<CPanelBooking timeslots={timeslots} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|||||||
Reference in New Issue
Block a user