diff --git a/packages/features/calendars/weeklyview/components/event/Empty.tsx b/packages/features/calendars/weeklyview/components/event/Empty.tsx
index e67f99c9b0..66f753c386 100644
--- a/packages/features/calendars/weeklyview/components/event/Empty.tsx
+++ b/packages/features/calendars/weeklyview/components/event/Empty.tsx
@@ -78,7 +78,7 @@ export function AvailableCellsForDay({ timezone, availableSlots, day, startHour
const lastSlot = slotsForToday[lastSlotIndex];
startEndTimeDuration = dayjs(lastSlot.end).diff(dayjs(firstSlot.start), "minutes");
- if (firstSlot.toUser == null) {
+ if (firstSlot.toUser == null && !firstSlot.showNotePublicly) {
return null;
}
@@ -108,6 +108,8 @@ export function AvailableCellsForDay({ timezone, availableSlots, day, startHour
toUser={firstSlot?.toUser}
reason={firstSlot?.reason}
emoji={firstSlot?.emoji}
+ notes={firstSlot?.notes}
+ showNotePublicly={firstSlot?.showNotePublicly}
borderDashed={false}
date={dateFormatted}
className="pb-0"
diff --git a/packages/features/calendars/weeklyview/types/state.ts b/packages/features/calendars/weeklyview/types/state.ts
index edd5f33d19..572f038d71 100644
--- a/packages/features/calendars/weeklyview/types/state.ts
+++ b/packages/features/calendars/weeklyview/types/state.ts
@@ -58,6 +58,8 @@ type TimeRangeExtended = TimeRange & {
toUser?: IToUser;
reason?: string;
emoji?: string;
+ notes?: string | null;
+ showNotePublicly?: boolean;
};
export type CalendarAvailableTimeslots = {
diff --git a/packages/features/schedules/lib/use-schedule/useNonEmptyScheduleDays.ts b/packages/features/schedules/lib/use-schedule/useNonEmptyScheduleDays.ts
index c256946c96..883dab758a 100644
--- a/packages/features/schedules/lib/use-schedule/useNonEmptyScheduleDays.ts
+++ b/packages/features/schedules/lib/use-schedule/useNonEmptyScheduleDays.ts
@@ -8,7 +8,7 @@ export const getNonEmptyScheduleDays = (slots?: Slots) => {
const nonEmptyDays: string[] = [];
Object.keys(slots).forEach((date) => {
- if (slots[date].some((slot) => !(slot?.away && !slot.toUser) && slots[date].length > 0)) {
+ if (slots[date].some((slot) => !(slot?.away && !slot.toUser && !slot.showNotePublicly) && slots[date].length > 0)) {
nonEmptyDays.push(date);
}
});
diff --git a/packages/features/settings/outOfOffice/CreateOrEditOutOfOfficeModal.tsx b/packages/features/settings/outOfOffice/CreateOrEditOutOfOfficeModal.tsx
index 7772f36ebd..2f13c9226c 100644
--- a/packages/features/settings/outOfOffice/CreateOrEditOutOfOfficeModal.tsx
+++ b/packages/features/settings/outOfOffice/CreateOrEditOutOfOfficeModal.tsx
@@ -162,6 +162,8 @@ export const CreateOrEditOutOfOfficeEntryModal = ({
const watchedTeamUserId = watch("toTeamUserId");
const watchForUserId = watch("forUserId");
+ const watchedNotes = watch("notes");
+ const hasValidNotes = Boolean(watchedNotes?.trim());
const createOrEditOutOfOfficeEntry = trpc.viewer.ooo.outOfOfficeCreateOrUpdate.useMutation({
onSuccess: () => {
@@ -345,7 +347,11 @@ export const CreateOrEditOutOfOfficeEntryModal = ({
placeholder={t("additional_notes")}
{...register("notes")}
onChange={(e) => {
- setValue("notes", e?.target.value);
+ const newNotes = e?.target.value;
+ setValue("notes", newNotes);
+ if (!newNotes?.trim()) {
+ setValue("showNotePublicly", false);
+ }
}}
/>
-