diff --git a/media_commons_booking_app/src/client/routes/booking/components/Calendars.tsx b/media_commons_booking_app/src/client/routes/booking/components/Calendars.tsx index db872a36..e2029ea1 100644 --- a/media_commons_booking_app/src/client/routes/booking/components/Calendars.tsx +++ b/media_commons_booking_app/src/client/routes/booking/components/Calendars.tsx @@ -5,6 +5,7 @@ import { DateSelectArg } from '@fullcalendar/core'; import { RoomCalendar } from './RoomCalendar'; import { RoomSetting } from '../../../../types'; import { formatDate } from '../../../utils/date'; +import { HIDING_STATUS } from '../../../../policy'; type CalendarProps = { allRooms: RoomSetting[]; @@ -29,6 +30,9 @@ export const Calendars = ({ const allEvents = calendarApi.getEvents(); return allEvents.some((event) => { if (event.title.includes(TITLE_TAG)) return false; + if (HIDING_STATUS.some((status) => event.title.includes(status))) + return false; + return ( (event.start >= info.start && event.start < info.end) || (event.end > info.start && event.end <= info.end) || diff --git a/media_commons_booking_app/src/policy.ts b/media_commons_booking_app/src/policy.ts index e00c26e3..044575f1 100644 --- a/media_commons_booking_app/src/policy.ts +++ b/media_commons_booking_app/src/policy.ts @@ -1,6 +1,6 @@ /********** GOOGLE SHEETS ************/ -import { DevBranch } from './types'; +import { BookingStatusLabel, DevBranch } from './types'; /** ACTIVE master Google Sheet */ export const ACTIVE_SHEET_ID = '1MnWbn6bvNyMiawddtYYx0tRW4NMgvugl0I8zBO3sy68'; @@ -79,3 +79,9 @@ export const SAFETY_TRAINING_REQUIRED_ROOM = [ ]; export const INSTANT_APPROVAL_ROOMS = ['221', '222', '223', '224', '233']; + +export const HIDING_STATUS = [ + BookingStatusLabel.NO_SHOW, + BookingStatusLabel.CANCELED, + BookingStatusLabel.REJECTED, +];