Skip to content

Commit 4d51873

Browse files
feat: remove Cal.ai tab from navigation while preserving URL access (calcom#23894)
Co-authored-by: peer@cal.com <peer@cal.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 3c0fc2e commit 4d51873

2 files changed

Lines changed: 29 additions & 17 deletions

File tree

packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ export const useTabsNavigations = ({
7171

7272
const enabledWorkflowsNumber = allActiveWorkflows ? allActiveWorkflows.length : 0;
7373

74+
const eventTypeId = formMethods.getValues("id");
75+
7476
const EventTypeTabs = useMemo(() => {
7577
const navigation: VerticalTabItemProps[] = getNavigation({
7678
t,
7779
length,
7880
multipleDuration,
79-
id: formMethods.getValues("id"),
81+
id: eventTypeId,
8082
enabledAppsNumber,
8183
installedAppsNumber,
8284
enabledWorkflowsNumber,
@@ -87,15 +89,15 @@ export const useTabsNavigations = ({
8789
if (!requirePayment) {
8890
navigation.splice(3, 0, {
8991
name: t("recurring"),
90-
href: `/event-types/${formMethods.getValues("id")}?tabName=recurring`,
92+
href: `/event-types/${eventTypeId}?tabName=recurring`,
9193
icon: "repeat",
9294
info: t(`recurring_event_tab_description`),
9395
"data-testid": "recurring",
9496
});
9597
}
9698
navigation.splice(1, 0, {
9799
name: t("availability"),
98-
href: `/event-types/${formMethods.getValues("id")}?tabName=availability`,
100+
href: `/event-types/${eventTypeId}?tabName=availability`,
99101
icon: "calendar",
100102
info:
101103
isManagedEventType || isChildrenManagedEventType
@@ -115,7 +117,7 @@ export const useTabsNavigations = ({
115117
if (team) {
116118
navigation.splice(2, 0, {
117119
name: t("assignment"),
118-
href: `/event-types/${formMethods.getValues("id")}?tabName=team`,
120+
href: `/event-types/${eventTypeId}?tabName=team`,
119121
icon: "users",
120122
info: `${t(watchSchedulingType?.toLowerCase() ?? "")}${
121123
isManagedEventType ? ` - ${t("number_member", { count: watchChildrenCount || 0 })}` : ""
@@ -137,21 +139,11 @@ export const useTabsNavigations = ({
137139
}
138140
navigation.push({
139141
name: t("webhooks"),
140-
href: `/event-types/${formMethods.getValues("id")}?tabName=webhooks`,
142+
href: `/event-types/${eventTypeId}?tabName=webhooks`,
141143
icon: "webhook",
142144
info: `${activeWebhooksNumber} ${t("active")}`,
143145
"data-testid": "webhooks",
144146
});
145-
const hidden = true; // hidden while in alpha trial. you can access it with tabName=ai
146-
if (team && hidden) {
147-
navigation.push({
148-
name: "Cal.ai",
149-
href: `/event-types/${eventType.id}?tabName=ai`,
150-
icon: "sparkles",
151-
info: t("cal_ai_event_tab_description"), // todo `cal_ai_event_tab_description`,
152-
"data-testid": "Cal.ai",
153-
});
154-
}
155147
return navigation;
156148
}, [
157149
t,
@@ -165,11 +157,13 @@ export const useTabsNavigations = ({
165157
length,
166158
requirePayment,
167159
multipleDuration,
168-
formMethods.getValues("id"),
160+
eventTypeId,
169161
watchSchedulingType,
170162
watchChildrenCount,
171163
activeWebhooksNumber,
172164
canReadWorkflows,
165+
eventType.id,
166+
formMethods,
173167
]);
174168

175169
return { tabsNavigation: EventTypeTabs };

yarn.lock

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3409,6 +3409,24 @@ __metadata:
34093409
languageName: unknown
34103410
linkType: soft
34113411

3412+
"@calcom/fonio-ai@workspace:packages/app-store/fonio-ai":
3413+
version: 0.0.0-use.local
3414+
resolution: "@calcom/fonio-ai@workspace:packages/app-store/fonio-ai"
3415+
dependencies:
3416+
"@calcom/lib": "*"
3417+
"@calcom/types": "*"
3418+
languageName: unknown
3419+
linkType: soft
3420+
3421+
"@calcom/framer@workspace:packages/app-store/framer":
3422+
version: 0.0.0-use.local
3423+
resolution: "@calcom/framer@workspace:packages/app-store/framer"
3424+
dependencies:
3425+
"@calcom/lib": "workspace:*"
3426+
"@calcom/types": "workspace:*"
3427+
languageName: unknown
3428+
linkType: soft
3429+
34123430
"@calcom/ga4@workspace:packages/app-store/ga4":
34133431
version: 0.0.0-use.local
34143432
resolution: "@calcom/ga4@workspace:packages/app-store/ga4"
@@ -4117,7 +4135,7 @@ __metadata:
41174135
languageName: unknown
41184136
linkType: soft
41194137

4120-
"@calcom/types@workspace:*, @calcom/types@workspace:packages/types":
4138+
"@calcom/types@*, @calcom/types@workspace:*, @calcom/types@workspace:packages/types":
41214139
version: 0.0.0-use.local
41224140
resolution: "@calcom/types@workspace:packages/types"
41234141
dependencies:

0 commit comments

Comments
 (0)