* Init header + login modal component * Add calendar settings for authed user * Local storage and using query params for toggle * Toggle connect screen if query param present and no session * Local storage + store + way more than that should be in single commit * Display busy events on weekly view * Confirm booking slot of overlap exists * use chevron right when on column view * Show hover card - overlapping date times * Invalidate on switch * FIx clearing local storage when you login to another account * Force re-render on url state (atom quirks) * Add loading screen * Add dialog close * Remove extra grid config * Translations * [WIP] - tests * fix: google calendar busy times (#11696) Co-authored-by: CarinaWolli <wollencarina@gmail.com> * New Crowdin translations by Github Action * fix: rescheduled value DB update on reschedule and insights view cancelleds (#11474) * v3.3.5 * fix minutes string (#11703) Co-authored-by: CarinaWolli <wollencarina@gmail.com> * Regenerated yarn.lock * Add error component + loader * await tests * disable tests - add note * Refactor to include selected time * use no-scrollbar * Fix i18n * Fix tablet toolbar * overflow + i18n * Export empty object as test is TODO * Uses booker timezone * Fix hiding switch too early * Handle selected timezone * Fix timezone issues * Fix timezone issues --------- Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: alannnc <alannnc@gmail.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peer@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
84 lines
2.8 KiB
TypeScript
84 lines
2.8 KiB
TypeScript
import authedProcedure from "../../../procedures/authedProcedure";
|
|
import { router } from "../../../trpc";
|
|
import { ZCalendarOverlayInputSchema } from "./calendarOverlay.schema";
|
|
import { scheduleRouter } from "./schedule/_router";
|
|
import { ZListTeamAvailaiblityScheme } from "./team/listTeamAvailability.schema";
|
|
import { ZUserInputSchema } from "./user.schema";
|
|
|
|
type AvailabilityRouterHandlerCache = {
|
|
list?: typeof import("./list.handler").listHandler;
|
|
user?: typeof import("./user.handler").userHandler;
|
|
calendarOverlay?: typeof import("./calendarOverlay.handler").calendarOverlayHandler;
|
|
listTeamAvailability?: typeof import("./team/listTeamAvailability.handler").listTeamAvailabilityHandler;
|
|
};
|
|
|
|
const UNSTABLE_HANDLER_CACHE: AvailabilityRouterHandlerCache = {};
|
|
|
|
export const availabilityRouter = router({
|
|
list: authedProcedure.query(async ({ ctx }) => {
|
|
if (!UNSTABLE_HANDLER_CACHE.list) {
|
|
UNSTABLE_HANDLER_CACHE.list = await import("./list.handler").then((mod) => mod.listHandler);
|
|
}
|
|
|
|
// Unreachable code but required for type safety
|
|
if (!UNSTABLE_HANDLER_CACHE.list) {
|
|
throw new Error("Failed to load handler");
|
|
}
|
|
|
|
return UNSTABLE_HANDLER_CACHE.list({
|
|
ctx,
|
|
});
|
|
}),
|
|
|
|
user: authedProcedure.input(ZUserInputSchema).query(async ({ ctx, input }) => {
|
|
if (!UNSTABLE_HANDLER_CACHE.user) {
|
|
UNSTABLE_HANDLER_CACHE.user = await import("./user.handler").then((mod) => mod.userHandler);
|
|
}
|
|
|
|
// Unreachable code but required for type safety
|
|
if (!UNSTABLE_HANDLER_CACHE.user) {
|
|
throw new Error("Failed to load handler");
|
|
}
|
|
|
|
return UNSTABLE_HANDLER_CACHE.user({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
listTeam: authedProcedure.input(ZListTeamAvailaiblityScheme).query(async ({ ctx, input }) => {
|
|
if (!UNSTABLE_HANDLER_CACHE.listTeamAvailability) {
|
|
UNSTABLE_HANDLER_CACHE.listTeamAvailability = await import("./team/listTeamAvailability.handler").then(
|
|
(mod) => mod.listTeamAvailabilityHandler
|
|
);
|
|
}
|
|
|
|
// Unreachable code but required for type safety
|
|
if (!UNSTABLE_HANDLER_CACHE.listTeamAvailability) {
|
|
throw new Error("Failed to load handler");
|
|
}
|
|
|
|
return UNSTABLE_HANDLER_CACHE.listTeamAvailability({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
schedule: scheduleRouter,
|
|
calendarOverlay: authedProcedure.input(ZCalendarOverlayInputSchema).query(async ({ ctx, input }) => {
|
|
if (!UNSTABLE_HANDLER_CACHE.calendarOverlay) {
|
|
UNSTABLE_HANDLER_CACHE.calendarOverlay = await import("./calendarOverlay.handler").then(
|
|
(mod) => mod.calendarOverlayHandler
|
|
);
|
|
}
|
|
|
|
// Unreachable code but required for type safety
|
|
if (!UNSTABLE_HANDLER_CACHE.calendarOverlay) {
|
|
throw new Error("Failed to load handler");
|
|
}
|
|
|
|
return UNSTABLE_HANDLER_CACHE.calendarOverlay({
|
|
ctx,
|
|
input,
|
|
});
|
|
}),
|
|
});
|