Added colors to appointments BOD-393

This commit is contained in:
Patrick Fic
2020-09-23 11:35:14 -07:00
parent 6c2e0dad45
commit 1a89d683d7
30 changed files with 826 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { Button, Col, Form, Row, Switch } from "antd";
import { Button, Col, Form, Row, Select, Switch } from "antd";
import axios from "axios";
import moment from "moment";
import React, { useState } from "react";
@@ -120,6 +120,20 @@ export function ScheduleJobModalComponent({
<Form.Item name={"email"} label={t("jobs.fields.ownr_ea")}>
<EmailInput />
</Form.Item>
<Form.Item name={"color"} label={t("appointments.fields.color")}>
<Select>
{bodyshop.appt_colors &&
bodyshop.appt_colors.map((color) => (
<Select.Option
style={{ color: color.color.hex }}
key={color.color.hex}
value={color.color.hex}
>
{color.label}
</Select.Option>
))}
</Select>
</Form.Item>
</LayoutFormRow>
{t("appointments.labels.history")}
<ScheduleExistingAppointmentsList

View File

@@ -92,6 +92,7 @@ export function ScheduleJobModalContainer({
bodyshopid: bodyshop.id,
start: moment(values.start),
end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
color: values.color,
},
},
});