Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ooo-v2 #13621

Merged
merged 76 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
6b68712
first commit, changes in getSlots endpoint to deliver ooo data
alannnc Feb 9, 2024
63ef710
Removing old features handle type and user
alannnc Feb 9, 2024
0237870
merge with main
alannnc Feb 9, 2024
618aea8
remove unnecesary import
alannnc Feb 9, 2024
167c0d7
Remove old files from away or booking redirection
alannnc Feb 9, 2024
1d4847e
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Feb 10, 2024
8e5f50f
wip
alannnc Feb 10, 2024
87658f7
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Feb 15, 2024
748b20f
merge with remote
alannnc Feb 19, 2024
6972b48
wip
alannnc Feb 21, 2024
093b73a
changed trpc response type and removing no forward ooo days from avai…
alannnc Feb 23, 2024
ee59e90
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Feb 23, 2024
e0edd25
redo of out of office page, still wip
alannnc Feb 26, 2024
def3134
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Feb 26, 2024
9ad098d
reasons in ooo entry
alannnc Feb 27, 2024
edea4ed
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Feb 27, 2024
2dd017e
clean up and add missing translations
alannnc Feb 27, 2024
16aee20
fix text translation components
alannnc Mar 4, 2024
69c421c
solve merge with remote
alannnc Mar 4, 2024
2f8cd2f
Add reasons table and default options and implement it on booker
alannnc Mar 5, 2024
0e5f300
fixes
alannnc Mar 6, 2024
2bef090
Merge branch 'main' into ooo-v2
alannnc Mar 6, 2024
f08ea69
return away from ssr
alannnc Mar 6, 2024
2514e83
Merge branch 'ooo-v2' of github.com:alannnc/cal.com into ooo-v2
alannnc Mar 6, 2024
5bbfb67
return away from ssr
alannnc Mar 6, 2024
90209d8
fix type in test
alannnc Mar 6, 2024
9f6ad2f
Merge branch 'main' into pr/13621
zomars Mar 7, 2024
59860d6
Merge branch 'ooo-v2' of github.com:alannnc/cal.com into ooo-v2
alannnc Mar 8, 2024
fddda72
bg-muted + new field notes ooo + query param to open modal
alannnc Mar 9, 2024
1356213
minor text fixes anc tw class
alannnc Mar 13, 2024
107367d
Fix styles and tw classes
alannnc Mar 13, 2024
43fca31
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Mar 13, 2024
ba9616e
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Mar 13, 2024
927d9e5
fix orgs getting url params in app router
alannnc Mar 14, 2024
7b4199d
remove org from booker store as not needed
alannnc Mar 14, 2024
77f0ff2
redo test for ooo
alannnc Mar 14, 2024
1d835b6
Merge branch 'main' into ooo-v2
alannnc Mar 14, 2024
ceb81b5
Update apps/web/pages/settings/my-account/out-of-office/index.tsx
PeerRich Mar 16, 2024
fe04a87
merge with remote
alannnc Mar 16, 2024
8863b41
attack review changes, styles for ooo
alannnc Mar 16, 2024
bc775b1
Merge branch 'ooo-v2' of github.com:alannnc/cal.com into ooo-v2
alannnc Mar 16, 2024
0a7408b
merge with remote
alannnc Mar 21, 2024
cae9969
fixing timezone issues with ooo slots
alannnc Mar 22, 2024
5d49954
merge with main
alannnc Mar 22, 2024
426235d
improve performance to calculate slots for empty column_view
alannnc Mar 22, 2024
9144bd0
fix types
alannnc Mar 22, 2024
a830cda
fix types
alannnc Mar 22, 2024
613c1a0
fix types
alannnc Mar 22, 2024
a78eb53
Merge branch 'main' into ooo-v2
Mar 22, 2024
12876e8
Merge branch 'main' into ooo-v2
alannnc Mar 22, 2024
31cbbed
Merge branch 'main' into ooo-v2
alannnc Mar 22, 2024
6730173
Merge branch 'ooo-v2' of github.com:alannnc/cal.com into ooo-v2
alannnc Mar 22, 2024
005c84f
fix ooo without to user
alannnc Mar 22, 2024
9ae3619
fix ooo in slots component render conditionals
alannnc Mar 22, 2024
9ee16c8
fix offset top for ooo in slots
alannnc Mar 23, 2024
a5b7caf
filter out ooo days in column view with no forwarding
alannnc Mar 23, 2024
09ffa74
add more margin to ooo in slots
alannnc Mar 24, 2024
c04f8ec
fix flatten function on irregular availability
alannnc Mar 25, 2024
981c497
Merge branch 'main' of github.com:calcom/cal.com into ooo-v2
alannnc Mar 25, 2024
ff98d89
Merge branch 'main' into ooo-v2
emrysal Mar 26, 2024
286394e
fix types
alannnc Mar 27, 2024
a15edb6
Merge branch 'ooo-v2' of github.com:alannnc/cal.com into ooo-v2
alannnc Mar 27, 2024
ed386ca
Merge branch 'main' into ooo-v2
alannnc Mar 28, 2024
9c5e177
Merge branch 'main' into ooo-v2
alannnc Apr 2, 2024
df5833f
Merge branch 'main' into pr/13621
zomars Apr 5, 2024
9384c45
Update index.tsx
zomars Apr 5, 2024
394b802
Merge branch 'main' into ooo-v2
alannnc Apr 8, 2024
142bb2c
Merge branch 'main' into ooo-v2
PeerRich Apr 8, 2024
1cf4ff3
Merge branch 'main' into ooo-v2
PeerRich Apr 8, 2024
3653255
Merge branch 'main' into ooo-v2
CarinaWolli Apr 8, 2024
5ec48e7
Merge branch 'main' into ooo-v2
CarinaWolli Apr 9, 2024
fedf00b
Merge branch 'main' into ooo-v2
CarinaWolli Apr 9, 2024
a2fca52
Merge branch 'main' into ooo-v2
PeerRich Apr 9, 2024
5e5bd1f
Merge branch 'main' into ooo-v2
zomars Apr 9, 2024
edf8380
Update OutOfOfficeInSlots.tsx
zomars Apr 9, 2024
e4a12ae
Merge branch 'main' into ooo-v2
alannnc Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { GetServerSideProps } from "next";
import { encode } from "querystring";
import type { z } from "zod";

import { handleUserRedirection } from "@calcom/features/booking-redirect/handle-user";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes on this file are to remove previous feature of profile forwarding, no longer needed.

import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
import { DEFAULT_DARK_BRAND_COLOR, DEFAULT_LIGHT_BRAND_COLOR } from "@calcom/lib/constants";
import { getUsernameList } from "@calcom/lib/defaultEvents";
Expand Down Expand Up @@ -73,21 +72,12 @@ export type UserPageProps = {
export const getServerSideProps: GetServerSideProps<UserPageProps> = async (context) => {
const ssr = await ssrInit(context);
const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(context.req, context.params?.orgSlug);

const usernameList = getUsernameList(context.query.user as string);
const isARedirectFromNonOrgLink = context.query.orgRedirection === "true";
const isOrgContext = isValidOrgDomain && currentOrgDomain;
const dataFetchStart = Date.now();
let outOfOffice = false;
const isOrgContext = isValidOrgDomain && !!currentOrgDomain;

if (usernameList.length === 1) {
const result = await handleUserRedirection({ username: usernameList[0] });
if (result && result.outOfOffice) {
outOfOffice = true;
}
if (result && result.redirect?.destination) {
return result;
}
}
const dataFetchStart = Date.now();

if (!isOrgContext) {
// If there is no org context, see if some redirect is setup due to org migration
Expand Down Expand Up @@ -176,7 +166,7 @@ export const getServerSideProps: GetServerSideProps<UserPageProps> = async (cont
const eventTypes = await getEventTypesPublic(user.id);

// if profile only has one public event-type, redirect to it
if (eventTypes.length === 1 && context.query.redirect !== "false" && !outOfOffice) {
if (eventTypes.length === 1 && context.query.redirect !== "false") {
// Redirect but don't change the URL
const urlDestination = `/${user.profile.username}/${eventTypes[0].slug}`;
const { query } = context;
Expand All @@ -202,9 +192,9 @@ export const getServerSideProps: GetServerSideProps<UserPageProps> = async (cont
username: user.username,
bio: user.bio,
avatarUrl: user.avatarUrl,
away: usernameList.length === 1 ? outOfOffice : user.away,
verified: user.verified,
profile: user.profile,
away: user.away,
})),
entity: {
considerUnpublished: !isARedirectFromNonOrgLink && org?.slug === null,
Expand Down
19 changes: 0 additions & 19 deletions apps/web/modules/users/views/users-public-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
...query
} = useRouterQuery();

const isRedirect = searchParams?.get("redirected") === "true" || false;

Check warning on line 46 in apps/web/modules/users/views/users-public-view.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

apps/web/modules/users/views/users-public-view.tsx#L46

[@typescript-eslint/no-unused-vars] 'isRedirect' is assigned a value but never used. Allowed unused vars must match /^_/u.
const fromUserNameRedirected = searchParams?.get("username") || "";

Check warning on line 47 in apps/web/modules/users/views/users-public-view.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

apps/web/modules/users/views/users-public-view.tsx#L47

[@typescript-eslint/no-unused-vars] 'fromUserNameRedirected' is assigned a value but never used. Allowed unused vars must match /^_/u.
/*
const telemetry = useTelemetry();
useEffect(() => {
Expand Down Expand Up @@ -87,25 +87,6 @@
isEmbed ? "border-booker border-booker-width bg-default rounded-md border" : "",
"max-w-3xl px-4 py-24"
)}>
{isRedirect && (
<div className="mb-8 rounded-md bg-blue-100 p-4 dark:border dark:bg-transparent">
<h2 className="text-default mb-2 text-sm font-semibold dark:text-white">
{t("user_redirect_title", {
username: fromUserNameRedirected,
})}{" "}
🏝️
</h2>
<p className="text-default text-sm">
{t("user_redirect_description", {
profile: {
username: user.username,
},
username: fromUserNameRedirected,
})}{" "}
😄
</p>
</div>
)}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed.

<div className="mb-8 text-center">
<UserAvatar
size="xl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { type GetServerSidePropsContext } from "next";
import { z } from "zod";

import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import { handleTypeRedirection } from "@calcom/features/booking-redirect/handle-type";
import { getBookingForReschedule, getBookingForSeatedEvent } from "@calcom/features/bookings/lib/get-booking";
import type { GetBookingType } from "@calcom/features/bookings/lib/get-booking";
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
Expand Down Expand Up @@ -105,7 +104,7 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
const username = usernames[0];
const { rescheduleUid, bookingUid } = context.query;
const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(context.req, context.params?.orgSlug);
let outOfOffice = false;

const isOrgContext = currentOrgDomain && isValidOrgDomain;
if (!isOrgContext) {
const redirect = await getTemporaryOrgRedirect({
Expand All @@ -132,18 +131,6 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
notFound: true,
} as const;
}
// If user is found, quickly verify bookingRedirects
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature no longer needed.

const result = await handleTypeRedirection({
userId: user.id,
username,
slug,
});
if (result && result.outOfOffice) {
outOfOffice = true;
}
if (result && result.redirect?.destination) {
return result;
}

let booking: GetBookingType | null = null;
if (rescheduleUid) {
Expand Down Expand Up @@ -176,9 +163,9 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
length: eventData.length,
metadata: eventData.metadata,
},
away: outOfOffice,
user: username,
slug,
away: false,
trpcState: ssr.dehydrate(),
isBrandingHidden: user?.hideBranding,
isSEOIndexable: user?.allowSEOIndexing,
Expand Down