Skip to content

Commit

Permalink
Merge branch 'main' into chore/migrate-api-cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj authored Feb 4, 2025
2 parents 08d0d09 + 935e4c5 commit 382d40f
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 34 deletions.
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/apps/api/**/* @calcom/Platform
/deploy/**/* @calcom/Foundation
/infra/**/* @calcom/Foundation
/packages/app-store/applecalendar/**/* @calcom/Foundation
/packages/app-store/caldavcalendar/**/* @calcom/Foundation
/packages/app-store/exchange2013calendar/**/* @calcom/Foundation
Expand All @@ -9,3 +12,9 @@
/packages/app-store/larkcalendar/**/* @calcom/Foundation
/packages/app-store/office365calendar/**/* @calcom/Foundation
/packages/app-store/zohocalendar/**/* @calcom/Foundation
/packages/core/getUserAvailability.ts @calcom/Foundation
/packages/features/bookings/lib/handleNewBooking/**/* @calcom/Foundation
/packages/lib/slots.ts @calcom/Foundation
/packages/platform/**/* @calcom/Platform
/packages/prisma/**/* @calcom/Foundation
/packages/trpc/server/routers/viewer/slots/**/* @calcom/Foundation
4 changes: 2 additions & 2 deletions .github/workflows/cron-webhooks-triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
# "Scheduled workflows run on the latest commit on the default or base branch."
# — https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#schedule
schedule:
# Runs “every 5 minutes” (see https://crontab.guru)
- cron: "*/5 * * * *"
# Runs “every minute” (see https://crontab.guru)
- cron: "* * * * *"
jobs:
cron-webhookTriggers:
env:
Expand Down
Empty file added .yarn/versions/c950a729.yml
Empty file.
2 changes: 1 addition & 1 deletion apps/api/v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@axiomhq/winston": "^1.2.0",
"@calcom/platform-constants": "*",
"@calcom/platform-enums": "*",
"@calcom/platform-libraries": "npm:@calcom/[email protected].93",
"@calcom/platform-libraries": "npm:@calcom/[email protected].94",
"@calcom/platform-libraries-0.0.2": "npm:@calcom/[email protected]",
"@calcom/platform-types": "*",
"@calcom/platform-utils": "*",
Expand Down
18 changes: 12 additions & 6 deletions apps/web/modules/event-types/views/event-types-listing-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ export const InfiniteEventTypeList = ({
if (isPending) return <InfiniteSkeletonLoader />;

return group.teamId ? (
<EmptyEventTypeList group={group} />
<EmptyEventTypeList group={group} searchTerm={debouncedSearchTerm} />
) : !group.profile.eventTypesLockedByOrg ? (
<CreateFirstEventTypeView slug={group.profile.slug ?? ""} />
<CreateFirstEventTypeView slug={group.profile.slug ?? ""} searchTerm={debouncedSearchTerm} />
) : (
<></>
);
Expand Down Expand Up @@ -818,13 +818,13 @@ export const InfiniteEventTypeList = ({
);
};

const CreateFirstEventTypeView = ({ slug }: { slug: string }) => {
const CreateFirstEventTypeView = ({ slug, searchTerm }: { slug: string; searchTerm?: string }) => {
const { t } = useLocale();

return (
<EmptyScreen
Icon="link"
headline={t("new_event_type_heading")}
headline={searchTerm ? t("no_result_found_for", { searchTerm }) : t("new_event_type_heading")}
description={t("new_event_type_description")}
className="mb-16"
buttonRaw={
Expand Down Expand Up @@ -863,12 +863,18 @@ const CTA = ({
);
};

const EmptyEventTypeList = ({ group }: { group: EventTypeGroup | InfiniteEventTypeGroup }) => {
const EmptyEventTypeList = ({
group,
searchTerm,
}: {
group: EventTypeGroup | InfiniteEventTypeGroup;
searchTerm?: string;
}) => {
const { t } = useLocale();
return (
<>
<EmptyScreen
headline={t("team_no_event_types")}
headline={searchTerm ? t("no_result_found_for", { searchTerm }) : t("team_no_event_types")}
buttonRaw={
<Button
href={`?dialog=new&eventPage=${group.profile.slug}&teamId=${group.teamId}`}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcom/web",
"version": "4.9.5",
"version": "4.9.6",
"private": true,
"scripts": {
"analyze": "ANALYZE=true next build",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"accept_license": "Accept License",
"still_waiting_for_approval": "An event is still waiting for approval",
"event_is_still_waiting": "Event request is still waiting: {{attendeeName}} - {{date}} - {{eventType}}",
"no_result_found_for": "No result found for \"{{searchTerm}}\"",
"no_more_results": "No more results",
"no_results": "No results",
"load_more_results": "Load more results",
Expand Down
7 changes: 6 additions & 1 deletion packages/features/bookings/Booker/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
setVerifiedEmail: (email: string | null) => {
set({ verifiedEmail: email });
},
month: getQueryParam("month") || getQueryParam("date") || dayjs().format("YYYY-MM"),
month:
getQueryParam("month") ||
(getQueryParam("date") && dayjs(getQueryParam("date")).isValid()
? dayjs(getQueryParam("date")).format("YYYY-MM")
: null) ||
dayjs().format("YYYY-MM"),
setMonth: (month: string | null) => {
if (!month) {
removeQueryParam("month");
Expand Down
2 changes: 1 addition & 1 deletion packages/features/bookings/lib/handleCancelBooking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async function handler(req: CustomRequest) {
throw new HttpError({ statusCode: 400, message: "User not found" });
}

if (!cancellationReason && req.bookingToDelete.userId == userId) {
if (!platformClientId && !cancellationReason && req.bookingToDelete.userId == userId) {
throw new HttpError({
statusCode: 400,
message: "Cancellation reason is required when you are the host",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { Dayjs } from "@calcom/dayjs";
import { checkForConflicts } from "@calcom/features/bookings/lib/conflictChecker/checkForConflicts";
import { parseBookingLimit, parseDurationLimit } from "@calcom/lib";
import { ErrorCode } from "@calcom/lib/errorCodes";
import { getPiiFreeUser } from "@calcom/lib/piiFreeData";
import { safeStringify } from "@calcom/lib/safeStringify";

import type { getEventTypeResponse } from "./getEventTypesFromDB";
Expand Down Expand Up @@ -101,6 +102,22 @@ export async function ensureAvailableUsers(
},
});

const piiFreeInputDataForLogging = safeStringify({
startDateTimeUtc,
endDateTimeUtc,
...{
...input,
originalRescheduledBooking: input.originalRescheduledBooking
? {
...input.originalRescheduledBooking,
user: input.originalRescheduledBooking?.user
? getPiiFreeUser(input.originalRescheduledBooking.user)
: null,
}
: undefined,
},
});

usersAvailability.forEach(({ oooExcludedDateRanges: dateRanges, busy: bufferedBusyTimes }, index) => {
const user = eventType.users[index];

Expand All @@ -112,25 +129,14 @@ export async function ensureAvailableUsers(
if (!dateRanges.length) {
loggerWithEventDetails.error(
`User does not have availability at this time.`,
safeStringify({
startDateTimeUtc,
endDateTimeUtc,
input,
})
piiFreeInputDataForLogging
);
return;
}

//check if event time is within the date range
if (!hasDateRangeForBooking(dateRanges, startDateTimeUtc, endDateTimeUtc)) {
loggerWithEventDetails.error(
`No date range for booking.`,
safeStringify({
startDateTimeUtc,
endDateTimeUtc,
input,
})
);
loggerWithEventDetails.error(`No date range for booking.`, piiFreeInputDataForLogging);
return;
}

Expand All @@ -149,14 +155,7 @@ export async function ensureAvailableUsers(
});

if (availableUsers.length === 0) {
loggerWithEventDetails.error(
`No available users found.`,
safeStringify({
startDateTimeUtc,
endDateTimeUtc,
input,
})
);
loggerWithEventDetails.error(`No available users found.`, piiFreeInputDataForLogging);
throw new Error(ErrorCode.NoAvailableUsersFound);
}
// make sure TypeScript understands availableUsers is at least one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export function RoutingFormResponsesTable() {
filter: { type: filterType },
},
filterFn: (row, id, filterValue) => {
const cellValue = row.original.response[id].value;
const cellValue = row.original.response[id]?.value;
return dataTableFilter(cellValue, filterValue);
},
});
Expand Down

0 comments on commit 382d40f

Please sign in to comment.