Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions apps/web/lib/event-types/getServerSideProps.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { GetServerSidePropsContext } from "next";

import { getServerSession } from "@calcom/features/auth/lib/getServerSession";

import { ssrInit } from "@server/lib/ssr";

export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);
const session = await getServerSession({ req: context.req, res: context.res });

if (!session) {
return {
redirect: {
redirect: {
permanent: false,
destination: "/auth/login",
},
},
};
}

return { props: { trpcState: ssr.dehydrate() } };
};
Comment on lines +1 to +23
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we even need this if we remove the feature flag for managed event types?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think we should still include this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok.

btw. end to end tests failing, not sure if its related to this PR @keithwillcode ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It’s not unfortunately. We have E2E test suite issues at the moment. Hoping to resolve by tomorrow and will get this merged.

2 changes: 2 additions & 0 deletions apps/web/pages/event-types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import PageWrapper from "@components/PageWrapper";

import EventTypesPage from "~/event-types/views/event-types-listing-view";

export { getServerSideProps } from "@lib/event-types/getServerSideProps";

EventTypesPage.getLayout = getLayout;
EventTypesPage.PageWrapper = PageWrapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useForm } from "react-hook-form";
import { z } from "zod";

import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";
import { useFlagMap } from "@calcom/features/flags/context/provider";
import { classNames } from "@calcom/lib";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
Expand Down Expand Up @@ -145,7 +144,6 @@ export default function CreateEventTypeDialog({
},
});

const flags = useFlagMap();
const urlPrefix = orgBranding?.fullDomain ?? process.env.NEXT_PUBLIC_WEBSITE_URL;

return (
Expand Down Expand Up @@ -268,10 +266,7 @@ export default function CreateEventTypeDialog({
onValueChange={(val: SchedulingType) => {
form.setValue("schedulingType", val);
}}
className={classNames(
"mt-1 flex gap-4",
isAdmin && flags["managed-event-types"] && "flex-col"
)}>
className={classNames("mt-1 flex gap-4", isAdmin && "flex-col")}>
<RadioArea.Item
{...register("schedulingType")}
value={SchedulingType.COLLECTIVE}
Expand All @@ -289,7 +284,7 @@ export default function CreateEventTypeDialog({
<p>{t("round_robin_description")}</p>
</RadioArea.Item>
<>
{isAdmin && flags["managed-event-types"] && (
{isAdmin && (
<RadioArea.Item
{...register("schedulingType")}
value={SchedulingType.MANAGED}
Expand Down
1 change: 0 additions & 1 deletion packages/features/flags/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type AppFlags = {
teams: boolean;
webhooks: boolean;
workflows: boolean;
"managed-event-types": boolean;
organizations: boolean;
"email-verification": boolean;
"google-workspace-directory": boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/features/flags/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { AppFlags } from "@calcom/features/flags/config";
import { trpc } from "@calcom/trpc/react";

const initialData: Partial<AppFlags> = process.env.NEXT_PUBLIC_IS_E2E
? { "managed-event-types": true, organizations: true, teams: true }
? { organizations: true, teams: true }
: {};
export function useFlags(): Partial<AppFlags> {
const query = trpc.viewer.features.map.useQuery(undefined, {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- revert 20230404202721_add_feature_flag_managed_event_types

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we deleting this feature flag?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can we also remove the feature flag for managed event types? its not needed anymore

i thought @PeerRich meant its not need anymore, so removed it
otherwise the toggle is showing up in settings/admin/flags

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, i am ok removing this. this was used to roll it out slowly but now managed event types is a core part of our offering and doenst need a feature flag imo

DELETE FROM "Feature" WHERE slug = 'managed-event-types';