* fix: Past booking redirect
* fix: rename ENV_PAST_BOOKING_RESCHEDULE_CHANGE to ENV_PAST_BOOKING_RESCHEDULE_CHANGE_TEAM_IDS for clarity
- Renamed environment variable to better reflect that it contains comma-separated team IDs
- Updated all references in constants.ts, implementation file, tests, and turbo.json
- Addresses PR comment feedback about misleading variable name
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
sean-brydonGitHubcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>Keith WilliamsDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix members page crash with pbac feature flag
* invite member to org backend
* update org permissions
* feat: org profile update settings
* org general page
* remove redudant me call
* privacy page
* add attributes to pbac
* dync + sso on organization permissions
* add tests for resource-permission util
* pass permissions to attributes\
* restore invite members
* update org update and attribute backends
* fix type errors
* fix orgId
* fix types attempt two
* fix types attempt two
* fix type error
* show/hide team event types based on eventType.read permission
* fix dupe string in i18n
* fix tests
* fix team-dsync
* update session to use profile
* use profile metadata to get orgRolew
* fix dsync
* fix typing
* Event type create pbac check
* fix the readonly permission check. WIP
* refactor getUserEventTypes
* fix test
* add generate util for update
* update router to use new generator function for pbac procedures
* update transform utils
* fix members being able to update on UI
* fix allSettled
* fix fallback permissions
* fix permission logic
* fix compare memebrship type error
* fix unit test error
* fix manage test error
* fix nested permissions
* filter based on canView permission in getUserEventGroups
* Update packages/trpc/server/routers/viewer/eventTypes/utils/EventTypeGroupFilter.test.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix tests
* fix tests
* feat: Adding workflow permission checks inside of eventTypes (#23038)
* add permission checks for workflows
* wip getall active workflows
* check eventType.update permission on activiating workflow on event type
* pass permissions to context and use context in client
* remove local parsePermissionString and use registery
* Use new scoped function
* default scope to orgs
* use object values for workflow permissions
* fix type errors
* Fix permission traversal + fix all state caluclation
* fix eventType group to use permissions.canRead
* fix: update failing PBAC unit tests and resolve ESLint warnings
- Fix getUserEventGroups test: MEMBER role should not have update permissions in fallback scenario
- Fix EventTypeGroupFilter test: add missing canRead property to mock permissions map
- Replace 'as any' type assertions with proper 'as unknown as' type assertions to resolve ESLint warnings
Both tests now pass and align with PBAC permission model where MEMBER role has read-only access to event types.
Co-Authored-By: sean@cal.com <Sean@brydon.io>
* add pbac to _heavy router
* Merge main
* restore versions
* Parallelizable members query
* fix nits
* fix create
* Restore lock file
* Fix import from merge artifact
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* e2e tests for apple connect atom
* update globalEnv for turbo.json
* update pages for tests
* update playwright config so we can use env variables inside tests
* update packages
* update variable names
* update playwright config
* fix: import variables from env instead of separate files
* update env variables for atoms e2e yml
* Change display mode from 'standalone' to 'minimal-ui'
this shows the refresh and back button for easier navigation ux
* Update display settings in site.webmanifest
---------
Co-authored-by: Kartik Saini <41051387+kart1ka@users.noreply.github.com>
* fix
* Update UserForm.tsx
* test: add e2e tests for admin user creation and editing
- Add test for successful user creation via /settings/admin/users/add
- Add test for successful user editing via /settings/admin/users/{id}
- Tests verify form submission, API responses, and database changes
- Follow Cal.com e2e testing patterns with admin authentication
- Use Playwright for end-to-end form interaction testing
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Update admin-users.e2e.ts
* Update admin-users.e2e.ts
* update
* tweak
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: return attendees when fetching all bookings
* refactor: v2 show hidden attendees for authenticated requests
* chore: regenerate docs
* chore: add test
2025-09-16 19:57:42 +05:30
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* chore: use local platform libraries instead of npm package
* chore: use local platform libraries instead of npm package
* chore: use local platform libraries instead of npm package
* chore: use local platform libraries instead of npm package
* chore: use local platform libraries instead of npm package
The allowTypeImports option is only supported by @typescript-eslint/no-restricted-imports,
not the standard ESLint no-restricted-imports rule. This fixes the configuration error:
'Configuration for rule no-restricted-imports is invalid: allowTypeImports should NOT have additional properties'
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: phone number billing bug
* fix: phone number billing bug
* fix: use raw code
* fix: use zod
* chore: update test
* Remove newline.
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* feat: add e2e tests for insights ChartCard components
- Test that all ChartCard components render with expected titles
- Test graceful handling of TRPC call failures
- Test ChartCard rendering for organization users
- Wait for page load and TRPC calls before checking chart presence
- Use text-based selectors to find ChartCard titles in h2 elements
- Remove page.waitForTimeout() calls to comply with ESLint rules
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* clean up e2e tests
* fix titles
* still render charts if no data
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
2025-09-15 11:00:00 +02:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: implement generalized navigation permission system with PBAC
- Create NavigationPermissionsProvider context for server-side permission data
- Add checkNavigationPermissions utility using PermissionCheckService
- Update main navigation layout to check permissions server-side
- Enhance useShouldDisplayNavigationItem for generalized permission filtering
- Support permission mapping for insights, workflows, routing, teams, members
- Use unstable_cache for performance optimization
- Replace insights-specific logic with scalable PBAC-based system
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: correct flag check logic in useShouldDisplayNavigationItem
- Only return false when flag is explicitly false
- Allow navigation permission checks to run when flags are truthy
- Fixes bug where truthy flags would short-circuit permission checks
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: resolve linting errors in embed-core files
- Replace forbidden non-null assertion with null check in embed.ts
- Replace 'any' type with 'unknown' in embed.test.ts
- Replace non-null assertion with proper null check in EmbedElement.test.ts
- Remove unused variable declaration
These are pre-existing linting issues unrelated to navigation permissions feature.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: resolve server-client boundary issue in NavigationPermissionsProvider
- Add 'use client' directive to NavigationPermissionsProvider.ts
- Replace JSX syntax with React.createElement to fix TypeScript compilation
- Create NavigationPermissionsWrapper.tsx as client component bridge
- Update layout.tsx to use wrapper instead of provider directly
- Ensure proper separation between server-side permission checking and client-side context consumption
This fixes the architectural issue where useContext was being used in server components.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* Revert "fix: resolve linting errors in embed-core files"
This reverts commit 4f481bae576376c9f9177215f7872c8bf7132894.
* refactor: simplify NavigationPermissionsProvider approach
- Remove NavigationPermissionsWrapper.tsx (revert to simpler approach)
- Rename NavigationPermissionsProvider.ts to .tsx for JSX support
- Update layout.tsx to use NavigationPermissionsProvider directly
- Keep 'use client' directive for proper server-client boundary handling
- Maintain all navigation permission functionality with cleaner architecture
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* clean up
* return true for no team situation
* fix: prevent hidden navigation items from reappearing via stored expansion state
- Modified usePersistedExpansionState hook to accept shouldDisplay parameter
- Clear stored expansion state for items that shouldn't be displayed
- Prevent state persistence for items without permissions
- Updated both NavigationItem and MobileNavigationMoreItem components
- Use safe sessionStorage import from @calcom/lib/webstorage
Fixes bug where clicking 'Workflows' would restore 'Insights' menu visibility
even when user lacks insights permissions due to sessionStorage state restoration.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: add sessionStorage to webstorage module and export NavigationItemName type
- Added sessionStorage wrapper to @calcom/lib/webstorage with safe error handling
- Export NavigationItemName type from NavigationPermissionsProvider for proper type access
- Resolves TypeScript compilation errors in navigation permission system
These changes enable the collapsible menu state bug fix to compile properly.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: improve separation of concerns in usePersistedExpansionState hook
- Remove shouldDisplay parameter from usePersistedExpansionState hook
- Move state clearing logic for hidden items to NavigationItem component level
- Add setIsExpanded to useEffect dependency arrays to fix ESLint warnings
- Maintain bug fix functionality while improving code design
- Better separation between expansion state management and display permissions
This addresses user feedback about inappropriate coupling between concerns.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix provider
* fix unstable_cache
* refactor: move navigation permission checks to client-side with tRPC
- Replace server-side unstable_cache permission checks with client-side tRPC query
- Add getNavigationPermissions query to PBAC router
- Update NavigationPermissionsProvider to use tRPC with loading states
- Remove server-side checkNavigationPermissions function
- Improve initial page load performance by deferring permission checks
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: centralize navigation item definitions to eliminate repetition
- Create NAVIGATION_ITEMS_CONFIG as single source of truth for navigation items
- Auto-generate NAVIGATION_PERMISSION_MAP from centralized config
- Update Navigation.tsx to use centralized definitions for teams, routing, workflows, insights
- Fix import issues in NavigationPermissionsProvider.tsx
- Eliminate hardcoded repetition of navigation item properties across codebase
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* clean up
* clean up permissions
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-09-15 10:55:51 +02:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: sort bookingUserId options alphabetically in insights routing faceted values
- Add .sort((a, b) => a.label.localeCompare(b.label)) to bookingUserId options
- Makes user dropdown more human-friendly with alphabetical ordering
- Follows existing sorting pattern used in FilterSegmentSelect.tsx
- Fix ESLint warning by replacing Table<any> with Table<unknown>
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: use generic type parameter instead of unknown in Table type
- Replace Table<unknown> with <TData>(_: Table<TData>) to fix CI type errors
- Maintains type safety while avoiding ESLint any type warning
- Allows hook to work with any table type through generic parameter
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* Add `findBookingById` to `BookingRepository`
* Create `generateMetadata` to Stripe `PaymentService`
* `create` method to use `generateMetadata`
* Remove unused trpc endpoint
* Pass booking id to chargeCard method
* Use generateMetadata in chargeCard method
* Remove unused stripeAppKeys
* Add error handling if booking doesn't contain attendee
* Rename to
* Return attendees in a consistent order
---------
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
* getEnabledAppsFromCredentials
* wip
* wip
* mv more
* fix: update test mocking for PrismockClient in processPaymentRefund.test.ts
- Replace prismaMock with prismock for proper PrismockClient usage
- Update mock data structure to include required fields (id, userId, teamId, etc.)
- Create app and credential records separately to handle PrismockClient limitations
- Replace 'as any' type casting with vi.mocked() for proper type safety
- Adjust test expectations to match PrismockClient's actual return structure
- Add proper cleanup in beforeEach hook for both credential and app records
Fixes failing unit tests after migration from packages/lib to packages/features/bookings/lib/payment
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* publish platform libraries
* fix import
* bump version
* fix apiv2
* publish platform-libraries
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-09-14 11:24:16 -03:00
Benny JooGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* mv PaymentPage to web
* mv 2 more components to web
* refactor
* update imports
* mv
* revert
* fix
* fix
* update
* migrate relevant test too
* move setup components to web from appstore
* move wipemycalother
* mv
* fix typechecks
* mv more routing forms components
* fix
* fix
* fix
* fix: resolve type errors in SingleForm.tsx after migration
- Updated SingleFormComponentProps type to include enriched form properties
- Added proper typing for user, team, nonOrgUsername, nonOrgTeamslug, userOrigin, teamOrigin
- Fixes type errors that occurred after migrating SingleForm.tsx from packages/app-store/routing-forms/components/
- Resolves both SingleForm.tsx and TestForm.tsx type errors
Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
* delete
* refactors
* fix
* fix
* fix
* remove usage of trpc client from OmniInstallAppButton.tsx
* fix test
* import only type
* fix test
* remove trpc package from appstore package.json
* remove remaining trpc usage
* update test
* fix type checks
* fix errors
* fix
* make it error
* nit
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: managed event types inherit team hideBranding setting
- Add getParentTeamForBranding helper to query parent team data
- Update shouldHideBrandingForEvent to use parent team when eventType.team is null
- Ensures CTA 'create your own booking link with Cal' respects team branding settings
- Follows existing pattern used by eventType.team?.id ?? eventType.parent?.teamId
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* chore: update yarn.lock dependencies
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Get parent event type team branding
* Use data from getEventTypeFromDB
* Undo yarn.lock changes
* Undo yarn.lock changes from latest main
* Address code commit
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* export const CalendarServiceMap
* fix: resolve linting issues in video and calendar adapter fixes
- Remove unused isCalendarService function
- Fix any type usage in getCalendar
- Add eslint-disable for necessary app-store imports in videoClient
- Maintain architectural separation while fixing core functionality
* revert
---------
Co-authored-by: unknown <adhabal2002@gmail.com>