IO-1574 Add ignore blocked days to scoreboard.
This commit is contained in:
@@ -43,19 +43,28 @@ export function ScoreboardDisplayComponent({
|
||||
useEffect(() => {
|
||||
//Update the locals.
|
||||
async function setMomentSettings() {
|
||||
const {
|
||||
data: { appointments },
|
||||
} = await client.query({
|
||||
query: GET_BLOCKED_DAYS,
|
||||
variables: {
|
||||
start: moment().startOf("month"),
|
||||
end: moment().endOf("month"),
|
||||
},
|
||||
});
|
||||
let appointments;
|
||||
|
||||
if (!bodyshop.scoreboard_target.ignoreblockeddays) {
|
||||
const { data } = await client.query({
|
||||
query: GET_BLOCKED_DAYS,
|
||||
variables: {
|
||||
start: moment().startOf("month"),
|
||||
end: moment().endOf("month"),
|
||||
},
|
||||
});
|
||||
appointments = data.appointments;
|
||||
}
|
||||
|
||||
moment.updateLocale("ca", {
|
||||
workingWeekdays: translateSettingsToWorkingDays(bodyshop.workingdays),
|
||||
holidays: appointments.map((h) => moment(h.start).format("MM-DD-YYYY")),
|
||||
...(appointments
|
||||
? {
|
||||
holidays: appointments.map((h) =>
|
||||
moment(h.start).format("MM-DD-YYYY")
|
||||
),
|
||||
}
|
||||
: {}),
|
||||
holidayFormat: "MM-DD-YYYY",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -354,6 +354,13 @@ export default function ShopInfoGeneral({ form }) {
|
||||
>
|
||||
<InputNumber min={0} max={12} precision={0} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.ignoreblockeddays")}
|
||||
name={["scoreboard_target", "ignoreblockeddays"]}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.prodtargethrs")}
|
||||
name={["prodtargethrs"]}
|
||||
@@ -472,7 +479,6 @@ export default function ShopInfoGeneral({ form }) {
|
||||
label={t("bodyshop.fields.md_email_cc", { template: "parts_order" })}
|
||||
rules={[
|
||||
{
|
||||
|
||||
//message: t("general.validation.required"),
|
||||
type: "array",
|
||||
},
|
||||
@@ -492,7 +498,6 @@ export default function ShopInfoGeneral({ form }) {
|
||||
label={t("bodyshop.fields.md_ded_notes")}
|
||||
rules={[
|
||||
{
|
||||
|
||||
//message: t("general.validation.required"),
|
||||
type: "array",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user