@@ -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 } ;
0 commit comments