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
26 changes: 10 additions & 16 deletions packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ export const useTabsNavigations = ({

const enabledWorkflowsNumber = allActiveWorkflows ? allActiveWorkflows.length : 0;

const eventTypeId = formMethods.getValues("id");

const EventTypeTabs = useMemo(() => {
const navigation: VerticalTabItemProps[] = getNavigation({
t,
length,
multipleDuration,
id: formMethods.getValues("id"),
id: eventTypeId,
enabledAppsNumber,
installedAppsNumber,
enabledWorkflowsNumber,
Expand All @@ -87,15 +89,15 @@ export const useTabsNavigations = ({
if (!requirePayment) {
navigation.splice(3, 0, {
name: t("recurring"),
href: `/event-types/${formMethods.getValues("id")}?tabName=recurring`,
href: `/event-types/${eventTypeId}?tabName=recurring`,
icon: "repeat",
info: t(`recurring_event_tab_description`),
"data-testid": "recurring",
});
}
navigation.splice(1, 0, {
name: t("availability"),
href: `/event-types/${formMethods.getValues("id")}?tabName=availability`,
href: `/event-types/${eventTypeId}?tabName=availability`,
icon: "calendar",
info:
isManagedEventType || isChildrenManagedEventType
Expand All @@ -115,7 +117,7 @@ export const useTabsNavigations = ({
if (team) {
navigation.splice(2, 0, {
name: t("assignment"),
href: `/event-types/${formMethods.getValues("id")}?tabName=team`,
href: `/event-types/${eventTypeId}?tabName=team`,
icon: "users",
info: `${t(watchSchedulingType?.toLowerCase() ?? "")}${
isManagedEventType ? ` - ${t("number_member", { count: watchChildrenCount || 0 })}` : ""
Expand All @@ -137,21 +139,11 @@ export const useTabsNavigations = ({
}
navigation.push({
name: t("webhooks"),
href: `/event-types/${formMethods.getValues("id")}?tabName=webhooks`,
href: `/event-types/${eventTypeId}?tabName=webhooks`,
icon: "webhook",
info: `${activeWebhooksNumber} ${t("active")}`,
"data-testid": "webhooks",
});
const hidden = true; // hidden while in alpha trial. you can access it with tabName=ai
if (team && hidden) {
navigation.push({
name: "Cal.ai",
href: `/event-types/${eventType.id}?tabName=ai`,
icon: "sparkles",
info: t("cal_ai_event_tab_description"), // todo `cal_ai_event_tab_description`,
"data-testid": "Cal.ai",
});
}
return navigation;
}, [
t,
Expand All @@ -165,11 +157,13 @@ export const useTabsNavigations = ({
length,
requirePayment,
multipleDuration,
formMethods.getValues("id"),
eventTypeId,
watchSchedulingType,
watchChildrenCount,
activeWebhooksNumber,
canReadWorkflows,
eventType.id,
formMethods,
]);

return { tabsNavigation: EventTypeTabs };
Expand Down
20 changes: 19 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3409,6 +3409,24 @@ __metadata:
languageName: unknown
linkType: soft

"@calcom/fonio-ai@workspace:packages/app-store/fonio-ai":
version: 0.0.0-use.local
resolution: "@calcom/fonio-ai@workspace:packages/app-store/fonio-ai"
dependencies:
"@calcom/lib": "*"
"@calcom/types": "*"
languageName: unknown
linkType: soft

"@calcom/framer@workspace:packages/app-store/framer":
version: 0.0.0-use.local
resolution: "@calcom/framer@workspace:packages/app-store/framer"
dependencies:
"@calcom/lib": "workspace:*"
"@calcom/types": "workspace:*"
languageName: unknown
linkType: soft

"@calcom/ga4@workspace:packages/app-store/ga4":
version: 0.0.0-use.local
resolution: "@calcom/ga4@workspace:packages/app-store/ga4"
Expand Down Expand Up @@ -4117,7 +4135,7 @@ __metadata:
languageName: unknown
linkType: soft

"@calcom/types@workspace:*, @calcom/types@workspace:packages/types":
"@calcom/types@*, @calcom/types@workspace:*, @calcom/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@calcom/types@workspace:packages/types"
dependencies:
Expand Down
Loading