From c27e8b91949362058c1a14ef1ffd472a565e4b0a Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 28 Dec 2021 10:26:41 -0800
Subject: [PATCH] IO-1574 Add ignore blocked days to scoreboard.
---
bodyshop_translations.babel | 21 ++++++++++++++
.../scoreboard-display.component.jsx | 29 ++++++++++++-------
.../shop-info/shop-info.general.component.jsx | 9 ++++--
client/src/translations/en_us/common.json | 1 +
client/src/translations/es/common.json | 1 +
client/src/translations/fr/common.json | 1 +
6 files changed, 50 insertions(+), 12 deletions(-)
diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 26a1ba3c7..086682e27 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -4000,6 +4000,27 @@
+
+ ignoreblockeddays
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
inhousevendorid
false
diff --git a/client/src/components/scoreboard-display/scoreboard-display.component.jsx b/client/src/components/scoreboard-display/scoreboard-display.component.jsx
index 29b3065cc..e3f3244a4 100644
--- a/client/src/components/scoreboard-display/scoreboard-display.component.jsx
+++ b/client/src/components/scoreboard-display/scoreboard-display.component.jsx
@@ -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",
});
}
diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx
index db379792e..2a167fdb2 100644
--- a/client/src/components/shop-info/shop-info.general.component.jsx
+++ b/client/src/components/shop-info/shop-info.general.component.jsx
@@ -354,6 +354,13 @@ export default function ShopInfoGeneral({ form }) {
>
+
+
+