fix: initialized flags on event-types page (#13469)

* fix: initialized flags on event-types page

* changes

* chore: removed `managed-event-types` flag as no longer needed

* revert: `20230404202721_add_feature_flag_managed_event_types` migration
This commit is contained in:
Somay Chauhan authored and GitHub committed 2024-02-02 15:35:00 +00:00
1 parent 0421dd401a
commit a45d77de51
6 files changed
+31 -9

No files matched your search

@@ -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";
@@ -145,7 +144,6 @@ export default function CreateEventTypeDialog({
},
});
const flags = useFlagMap();
const urlPrefix = orgBranding?.fullDomain ?? process.env.NEXT_PUBLIC_WEBSITE_URL;
return (
@@ -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}
@@ -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}
-1
View File
@@ -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;
+1 -1
View File
@@ -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, {
@@ -0,0 +1,3 @@
-- revert 20230404202721_add_feature_flag_managed_event_types
DELETE FROM "Feature" WHERE slug = 'managed-event-types';