* refactor: replace isTeamAdminOrOwner with PBAC team.listMembers permission
- Add canListMembers prop to BookingsProps interface
- Implement server-side permission check using PermissionCheckService
- Handle organization vs team context as specified
- Use ADMIN/OWNER fallback roles for backward compatibility
- Replace user?.isTeamAdminOrOwner check in bookings column filter
- Fix React Hook dependency arrays for ESLint compliance
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: wrap canListMembers in permissions object and simplify server logic
- Wrap canListMembers in permissions object for future extensibility
- Simplify server-side logic to only use getTeamIdsWithPermission
- Remove unused imports (prisma, MembershipRole)
- Address user feedback on PR #24006
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* docs: add comment explaining canListMembers UI logic
- Clarify that teamIdsWithPermission.length > 0 check is for UI purposes
- Actual accurate filtering happens server-side for filter values
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* feat: add e2e test for member filter visibility
- Verify that users with the MEMBER role cannot see the member filter
- Test creates team with ADMIN and MEMBER users
- Confirms UI correctly reflects PBAC permissions
- Address user feedback on PR #24006
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: correct e2e test team member creation pattern
- Replace invalid teamId property with hasTeam and teammates pattern
- Fix TypeScript error in booking-filters.e2e.ts
- Resolve CI type check failure
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix e2e test
* remove booking.read permission from member
* add guide
* update
* resource scope
* fix markdown
* update usage
* update guide
---------
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>
* fix: check if team is platform or not when sending billingPortalUrl
* update team repository
* fix: pass teamId explicitely for platform team
* fix: coderabbit feedback
* fix: merge conflicts
* fix: merge conflicts
* fix: make sure we pass in the correct subsciption id
* fix: implement PR feedback
2025-09-24 20:07:46 +00:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: replace isTeamAdminOrOwner with PBAC permissions
- Remove isTeamAdminOrOwner from team-members-view.tsx, rely on server-side permissions
- Replace role checks in addMembersToEventTypes.handler.ts with eventType.update permission
- Follow PBAC refactoring guide patterns for consistent permission checking
- Fix TypeScript any type usage and unused variable warnings
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* use enum
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* manage billing section
* wip billing credits
* WIP
* WIP
* Download expense log
* credit worth
* skeleton fixes
* add org tip
* add teams tip
* restore service
* type check
* type check
* fix types
* additional credits
* fix progress bar
* add dashed prop
* match new designs
* hide area with no monthly credits
* fix i18n
* show current balance label
* Update apps/web/modules/settings/billing/billing-view.tsx
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
* spacing + monthly credits not showing additional
* Remove additional credits from monthly calculations
* feat: replace add members redirect with invite modal in billing settings
- Replace Button href with onClick handler to open MemberInvitationModal
- Add MemberInvitationModalWithoutMembers import and state management
- Maintain existing team/org context support
- Follow established modal usage patterns from other components
- Fix lint error by using undefined instead of empty arrow function
Co-Authored-By: sean@cal.com <Sean@brydon.io>
* Remove redudant vars from method
* fix type check
---------
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: allow to choose dateTarget for /insights (startTime by default)
* feat: add timestamp selector for insights date filtering
- Add TimestampFilter component with Start Time/Created At options
- Extend useInsightsBookingParameters hook with timestamp selection
- Update all insight components to use dateTarget parameter
- Add i18n translations for new UI strings
- Position selector next to DateRangeFilter as requested
Addresses user request to add select box next to date range filter
allowing users to choose between startTime (default) and createdAt
for displaying booking metrics on the Insights page.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: rename TimestampFilter to DateTargetSelector with nuqs URL state
- Rename TimestampFilter component to DateTargetSelector
- Implement nuqs hook in InsightsPageContent for URL state management
- Update useInsightsBookingParameters to return dateTarget from URL state
- Add dateTarget field to insightsRoutingServiceInputSchema and related types
- Simplify individual insight components to use insightsBookingParams directly
- Remove manual timestampTarget destructuring from all components
- Update all tRPC routing service calls to include dateTarget parameter
- All TypeScript checks now pass successfully
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* update styles
* fix inconsistency
* feat: replace Select with Command component and rename filter ID
- Replace Select with Command + Popover for compact width and wider dropdown
- Add descriptive option labels with translations
- Change filter ID from 'createdAt' to 'timestamp' across all components
- Maintain URL state management with nuqs
- Fix ESLint warning for missing dependency in useEffect
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: revert routing components to use createdAt filter ID
- Keep timestamp filter ID change scoped only to main insights page
- Routing components should continue using createdAt as filter ID
- Only insights-view.tsx and related booking hooks use timestamp
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* update styles
* fix trpc router
* refactor timestamp column for insights booking service
* fix
* update text
* rename and clean up
* fix endDate in DateRangeFilter
* fix type errors
* fix startTime filter and type errors
* provide default date range
* add completed to getMembersStatsWithCount
* add unit tests
* fix type error
* address feedback
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* mv team queries to features from lib
* update imports
* same
* wip
* move event manager test
* calendar manager to features from lib
* update imports
* update imports
* fix
* mv getEventTypeById
* fix
* fix
* remove
* fix type check error
* fix tests
* fix tests
* fix
2025-09-18 01:42:40 +01:00
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>
* 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>
2025-09-14 12:51:05 +00:00
Joe Au-YeungGitHubDevin 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>
* refactor: remove circular dependency between prisma and app-store packages
- Replace EventTypeAppMetadataSchema with z.record(z.any()).optional() pattern
- Remove appDataSchemas import from packages/prisma/zod-utils.ts
- Add null checks in consuming packages for flexible validation
- Fix test file that no longer needs @ts-expect-error directive
This breaks the circular dependency while maintaining all functionality
by moving strict validation to the business logic layer where operations
actually happen, following existing patterns in the codebase.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* refactor: remove EventTypeAppMetadataSchema exports from prisma package
- Remove EventTypeAppMetadataSchema and eventTypeAppMetadataOptionalSchema exports from prisma/zod-utils.ts
- Update all importing files to use local z.record(z.any()).optional() schemas
- Replace type annotations with Record<string, any> where appropriate
- Maintain validation functionality while breaking circular dependency
- All TypeScript compilation now passes without errors
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* refactor: complete removal of EventTypeAppMetadataSchema from remaining files
- Update handleSeats/createNewSeat.ts to use local schema
- Update payment handlers to use local schemas
- Update eventTypes update handler to use local schema
- All files now define their own validation instead of importing from prisma
- Circular dependency completely eliminated
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: resolve TypeScript compilation errors
- Remove duplicate z import from handleConfirmation.ts
- Remove duplicate appDataSchemas import from update.handler.ts
- Fix index signature errors in handlePayment.ts by using appData variable consistently
- All type checks now pass successfully
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add type casting for appSlug in eventTypeService
- Cast appSlug as keyof typeof apps to resolve index signature error
- Maintains type safety while allowing dynamic property access
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix
* remove
* make zod-utils.ts in app-store
* update imports
* fix
* fix
* fix
* revert unrelated change
* update imports
* fix
* fix
* revert
* fix
* fix
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: hbjORbj <sldisek783@gmail.com>
* chore: Upgrade prisma to 6.7.0
* Build fixes
* type fixes
Signed-off-by: Omar López <zomars@me.com>
* Update schema.prisma
* Patching
* Revert "Update schema.prisma"
This reverts commit 47d8618bf89ef4d007b30084df766f17281e21a1.
* Revert "Patching"
This reverts commit a1d2e3040e71690a44d4324db95d73b4d68c6adb.
* Revert schema changes
Signed-off-by: Omar López <zomars@me.com>
* WIP
Signed-off-by: Omar López <zomars@me.com>
* Update getPublicEvent.ts
* Update imports
Signed-off-by: Omar López <zomars@me.com>
* Update gitignore
Signed-off-by: Omar López <zomars@me.com>
* update remaining imports
Signed-off-by: Omar López <zomars@me.com>
* Delete .cursor/config.json
* Discard changes to packages/features/eventtypes/lib/getPublicEvent.ts
* Update _get.ts
* Update user.ts
* Update .gitignore
* update
* Update WorkflowStepContainer.tsx
* Update next-auth-custom-adapter.ts
* Update getPublicEvent.ts
* Update workflow.ts
* Update next-auth-custom-adapter.ts
* Update next-auth-options.ts
* Update bookingScenario.ts
* fix missing imports
* upgrades prismock
Signed-off-by: Omar López <zomars@me.com>
* patches prismock
Signed-off-by: Omar López <zomars@me.com>
* Update reschedule.test.ts
* Update prisma.ts
* patch prismock
Signed-off-by: Omar López <zomars@me.com>
* fix enums imports
Signed-off-by: Omar López <zomars@me.com>
* Revert "Update prisma.ts"
This reverts commit 64edcf8db54171ff4456c209d563b5d431d99619.
* Revert "patch prismock"
This reverts commit e95819113dc9d88e7130947aa120cd42710977c8.
* fix patch
* Fix test that overrun the boundary, it shouldn't test too much
* Move prisma import to changeSMSLockState
* Bring back broken test without illegal imports
* Merge with main and fix filter hosts by same round robin host
* Fixed buildDryRunBooking fn tests
* Fix and move ooo create or update handler test
* Fix packages/features/eventtypes/lib/isCurrentlyAvailable.test.ts
* Fix packages/trpc/server/routers/viewer/organizations/listMembers.handler.test.ts
* Mock @calcom/prisma
* Fix: verify-email.test.ts
* fix: Moved WebhookService test and fixed default import mock
* Fix: Added missing prisma mock, handleNewBooking uses that of course
* We're not testing createContext here
* fix: Prisma mock fix for listMembers.test.ts
* More fixes to broken testcases
* Forgot to remove borked test
* Prevent the need to mock a lot of dependencies by moving out buildBaseWhereCondition to its own file
* Temporarily skip getCalendarEvents, needs a rewrite
* Fix: turns out you can access protected in testcases
* fix further mocks
* Added packages/features/insights/server/buildBaseWhereCondition.ts, types
* Always great to have a mock and then not use it
* And one less again.
* fix: confirm.handler.test, didn't mock prisma
* fix: Address minor nit by @eunjae & fix ImpersonationProvider test
* Updated isPrismaAvailableCheck that doesn't crash on import
* fix: Get Prisma directly from the client, it usually involves the Validator and does not need 'local' inclusion
* Add zod-prisma-types without the generator enabled (commented out)
* Uncomment and see what happens
* Change method of import as imports did not work in Input Schemas
* Remove custom 'zod' booking model, it does not belong with Prisma
* Fix all other global Model imports
* Rewrite most schema includes AND remove barrel file
* Add bookingCreateBodySchema to features/bookings
* Flurry of type fixes for compatibility with new zod gen
* Refactor out the custom prisma type createEventTypeInput
* Work around nullable eventTypeLocations
* HandlePayment type fix
* More fixes, final fix remaining is CompleteEventType
* Should fix a bunch more booking related type errors
* Missed one
* Some props missing from BookingCreateBodySchema
* Fix location type in handleChildrenEventTypes
* Little bit hacky imo but it works
* Final type error \o/
* Forgot to include Prisma
* Do not include zod-utils in booker/types
* Oops, was already including Booker/types
* Fix membership type, also disallow updating createdAt/updatedAt, make part of patch/post
* Fix api v1 type errors
* Fix EventTypeDescription typings
* Remove getParserWithGeneric, use userBodySchema with UserSchema
* use centralized timeZoneSchema
* Implement feedback by @zomars
* Couple of WIP pushes
* Fix tests
* Type fixes in `handleChildrenEventTypes` test
* Try and parse metadata before use
* Change zod-prisma-types configuration for optimal performance
* Fix prisma validator error in `prisma/selects/credential`
* Disable seperate relations model, hits a bug
* Import absolute - this makes rollup work in @platform/libraries
* Attempt at removing resolutions override
* Refactor using `Prisma.validator` to `satisfies`
* Build atoms using @calcom/prisma/client
* Build atoms using @calcom/prisma/client
* fixes
* Update eventTypeSelect.ts
* Adjust `eventTypeMetaDataSchemaWithUntypedApps` from `unknown` to `record(any)`
* `EventTypeDescription` rely on `descriptionAsSafeHTML` instead of `description`
* Add `seatsPerTimeSlot` to event type public select
* Fix typing in `users-public-view` getServerSide props
* Add missing `schedulingType` to prop
* chore: bump platform libraries
* Function return type is illegal, not sure how this passed eslint (#21567)
* Merged with main
* Update updateTokenObject.ts
* Update handleResponse.ts
* Update index.ts
* Update handleChildrenEventTypes.ts
* Update booking-idempotency-key.ts
* Update WebhookService.test.ts
* Update events.test.ts
* Update queued-response.test.ts
* Update events.test.ts
* Update getRoutedUrl.test.ts
* fix: type checks
Signed-off-by: Omar López <zomars@me.com>
* fixes
Signed-off-by: Omar López <zomars@me.com>
* chore: bump platform libraries
* Update yarn.lock
* more fixes
Signed-off-by: Omar López <zomars@me.com>
* fixes
Signed-off-by: Omar López <zomars@me.com>
* biuld fixes
* chore: bump platform libraries
* Update conferencing.repository.ts
* Update conferencing.repository.ts
* Update getCalendarsEvents.test.ts
* Update vite.config.js
* chore: bump platform libraries
* Update users.ts
* Discard changes to docs/api-reference/v2/openapi.json
* Update vite.config.ts
* updated platform libraries
* Update get.handler.test.ts
* Update get.handler.test.ts
* Update schema.prisma
* Discard changes to docs/api-reference/v2/openapi.json
* Update next-auth-custom-adapter.ts
* Update team.ts
* Flurry of type fixes
* Fix majority of insight related type errors
* Type fixes for unlink of account
* Make user nullable again
* Fixed a bunch of unit tests and one type error
* Attempted mock fix
* Attempted fix for Attribute type
* Ensure default import becomes prisma, but not direct usage
* Import default as prisma in prisma.module
* Add attributeOption to attribute type
* Fix calcom/prisma mock
* Refactor Prisma client imports to @calcom/prisma/client
Updated all imports from '@prisma/client' to '@calcom/prisma/client' across tests and repository files for consistency and to use the correct Prisma client package. This change improves maintainability and ensures the correct client is referenced throughout the codebase.
* Undo removal of max-warnings=0 to get main to merge
* Remove unit tests for e2e fixtures, provide new prisma mock
* Mock @calcom/prisma in event manager
* Mock @calcom/prisma in event manager
* Add correct format even with --no-verify
* Mock prisma in CalendarManager
* Add mock for permission-check.service
* Better injection in PrismaApiKeyRepository imports
* More mock fixes :)
* Fix listMembers.handler.test
* Fix User import
* Appropriately adjust all types to be imported as types, there were a lot of types imported as normal deps
* Why was this a thing?
* Strictly speaking; Not using prismock anymore
* Ditched patch file for prismock
* Fix output.service.ts platform type imports, need concrete for plainToClass
* Better typing and tests for unlinkConnectedAccount.handler
* Small type fix
* Disable calendar cache tests as they are dependent on prismock
* chore: bump platform lib
* getRoutedUrl test remove of unused import
* Extract select to external const on getEventTypesFromDB
* Direct select of userSelect from selects/user
* fix type error from merging 23653
* Fixed integration tests by removing hardcoded values that were possible due to mocking, but as its now directly hitting the db no longer
* fix: vite config atoms prisma client type location
* revert: example app prisma client
* revert: example app prisma client
* bump platform libs
* fix: use class instead of type for DI of PlatformBookingsService
* update platform libs
* remove unused variable
* chore: generate prisma client for api v2
* fix: api v2 e2e
* fix: atoms e2e
* fix: atoms e2e
* fix: atoms e2e
* fix: api v2 e2e
* fix: tsconfig apiv2 enums
* publish libraries
* Simplify check for existence teamId
---------
Signed-off-by: Omar López <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
Co-authored-by: supalarry <laurisskraucis@gmail.com>
Co-authored-by: cal.com <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
sean-brydonGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: implement recent impersonations list with localStorage storage
- Add RecentImpersonationsList component with quick action buttons
- Store up to 5 recent impersonations in localStorage using existing webstorage utility
- Integrate component into admin impersonation page above existing form
- Add translation keys for recent impersonations UI elements
- Update impersonation flow to save successful impersonations locally
- Follow existing List component patterns and button styling
Co-Authored-By: sean@cal.com <Sean@brydon.io>
* refactor: optimize RecentImpersonationsList to use lazy initial state
- Replace useEffect with useState lazy initializer for better performance
- Removes unnecessary re-render on component mount
- Remove unused setRecentImpersonations variable to fix ESLint warning
- Follows React best practices for initial state computation
Co-Authored-By: sean@cal.com <Sean@brydon.io>
* Add styling to match v3 and newer designs
* Update packages/lib/recentImpersonations.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: add time-based cancellation fees for no-show fee events
- Add configurable time threshold (minutes/hours/days) for cancellation fees
- Show warnings during booking submission and cancellation
- Automatically charge fees when bookings cancelled within threshold
- Exempt organizer/admin cancellations from fees
- Extend existing no-show fee infrastructure
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* fix: replace any type with proper type guards for metadata
- Use Record<string, unknown> instead of any for metadata type
- Add proper type assertions for nested metadata properties
- Maintain type safety while avoiding ESLint no-explicit-any warning
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* fix: handle JsonValue type compatibility in shouldChargeCancellationFee
- Add proper type guard for metadata JsonValue from Prisma
- Ensure metadata is object before casting to Record<string, unknown>
- Fixes TypeScript error on line 390 in handleCancelBooking.ts
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Refactor Devin changes to Stripe options
* Undo Devin changes to advanced tab
* Add translations
* Pass props to CancelBooking
* Display no show fee charge for attendee
* WIP
* Anstract shouldChargeNoSHowCancellationFee
* Abstract `handleNoShowFee`
* Add to
* Refactor `chargeCard.handler`
* Remove Devin code
* Type fix in `shouldChargeNoShowCancellationFee`
* Create `processNoSHowFeeOnCancellation`
* Process no show fee on cancellation
* Type fix
* Skip processing no show fee if organizer or admin is cancelling
* Add translation
* Dynamically get and in
* Remove unused translations
* Undo dev change
* Refactor logic
* Type fix
* remove any
* revert WEBAPP_URL_FOR_OAUTH
* Clean up console.log remnants
* test: add comprehensive tests for time-based cancellation fees
- Add unit tests for shouldChargeCancellationFee function with time thresholds and role exemptions
- Add handleCancelBooking integration tests for organizer/team admin exemptions
- Add handleCancelBooking test for attendee fee charging within time threshold
- Add UI component tests for cancellation fee warning display
- Add E2E test for cancellation fee warning during booking flow
All 23 new tests pass successfully, covering:
- Time-based logic with different units (minutes, hours, days)
- Role-based exemptions (organizer, team admin vs regular attendee)
- Payment charging integration with HOLD payment option
- UI warning display during booking submission and cancellation
- Edge cases like invalid metadata and past bookings
Fixed lint issues:
- Replaced 'any' types with proper Record<string, unknown>
- Fixed Playwright test.skip() usage with ESLint disable comments
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* test: add comprehensive tests for time-based cancellation fees
- Add unit tests for shouldChargeCancellationFee function with time thresholds and role exemptions
- Add handleCancelBooking integration tests for organizer/team admin exemptions
- Add handleCancelBooking test for attendee fee charging within time threshold
- Add UI component tests for cancellation fee warning display
- Add E2E test for cancellation fee warning during booking flow
All unit and integration tests pass successfully. E2E test implementation complete.
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* test: add comprehensive tests for time-based cancellation fees
- Add unit tests for shouldChargeCancellationFee function with time thresholds and role exemptions
- Add handleCancelBooking integration tests for organizer/team admin exemptions
- Add handleCancelBooking test for attendee fee charging within time threshold
- Add UI component tests for cancellation fee warning display
- Add E2E test for cancellation fee warning during booking flow
- Fix TypeScript issues and prettier formatting
- All tests follow existing Cal.com patterns and pass locally
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* test: add comprehensive unit and E2E tests for time-based cancellation fees
- Add unit tests for shouldChargeCancellationFee function with time thresholds and role exemptions
- Add handleCancelBooking integration tests for organizer/team admin exemptions and attendee fee charging
- Add UI component tests for cancellation fee warning display in CancelBooking component
- Add E2E test for cancellation fee warning during booking flow
- Fix TypeScript errors in CancelBooking.tsx with proper type annotations
- All tests follow existing Cal.com patterns and use proper mocking/test utilities
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Revert dev change
* Add missing translation
* Remove Devin code
* Revert Devin changes
* test: fix attendee cancellation test logic and ensure comprehensive test coverage
- Fix userId in attendee cancellation test to properly test fee charging
- Ensure all test files follow Cal.com patterns with proper mocking
- Add comprehensive coverage for time thresholds, role exemptions, and UI warnings
- All tests pass locally with proper timezone handling
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Fix tests
* Remove reverted PR translations
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
2025-09-05 21:46:54 +04:00
Anik Dhabal BabuGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: add zod schema for app metadata in config.json files
- Create AppMetaSchema in packages/types/ that validates config.json structure against App interface
- Integrate schema validation into build system's forEachAppDir function
- Add support for all app variants including messaging, analytics, etc.
- Validation failures show as warnings to maintain backward compatibility
- Export schema from packages/types/index.ts for reuse
- All existing config.json files now validate successfully
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: remove validation logs and throw errors for invalid config.json files
- Remove success log for validated config.json files
- Throw validation errors instead of warnings with fallback
- Addresses PR feedback on #23568
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: restore try-catch block with error throwing for config validation
- Keep try-catch structure for proper error handling
- Remove success console.log as originally requested
- Throw descriptive errors instead of console.warn
- Addresses PR feedback to maintain error handling while stopping build on validation failures
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: address CodeRabbit feedback - add passthrough and improve error handling
- Add .passthrough() to AppMetaSchema and nested objects for backward compatibility
- Wrap JSON.parse in try-catch with better error messages including file paths
- Preserve unknown keys in config.json files to avoid breaking existing functionality
- Addresses CodeRabbit review comments on #23568
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* refactor: remove index.ts and use direct import for AppMetaSchema
- Remove packages/types/index.ts file as requested
- Import AppMetaSchema directly from AppMetaSchema.ts file
- Simplifies import structure while maintaining functionality
- All config.json validation still works correctly
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: clicking on previous step navigates to correct step instead of next
* fix: implement step navigation in WizardForm and disable navigation in WizardLayout
* fix: adjust step navigation logic in WizardForm and useWizardState
* fix: add clarification comment in goToStep function
---------
Co-authored-by: Kartik Saini <41051387+kart1ka@users.noreply.github.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
* PBAC on team members page + org members page to use specific permissions with fallbacks
* Implement checks on edit sheet fetch to check for permisisons
* WIP permission fixes
* fix tests
* WIP
* fix edit mode perms
* fix remove and list view permissions
* fix add
* feat: add pbac permissions for impersonation (#23035)
* registery + migration + i18n
* UI for can impersonate
* impersonation backend
* remove permission from db query
* add missing prisma import
* add resend invitation and edit mode checks for delete/changeRole
* fix canChangeRole
* canChangeRole gate
* fix permission logic
* fix depends on
* push migration
* fix migration
* fix scoped advanced permissions
* use listMembers instead of invite proxy
* remove isOrgAdmin check to rely on pbac
* wait for session to load before navigating
* use event-types testId to ensure session loaded
* use profile page instead of eventTypes
* use correct roles
* fix wait for session
* correct orgs private isFallBackRoles
* set a timeout on waiting for session
* remove adminOrOwner check since its in fallpack
---------
Co-authored-by: Volnei Munhoz <volnei.munhoz@gmail.com>
Co-authored-by: Eunjae Lee <hey@eunjae.dev>
* feat: allow organization owners access to shared billing portal
- Modify stripepayment portal endpoint to accept teamId parameter
- Use team's subscription ID to get customer ID from Stripe subscription
- Validate user permissions before allowing team billing access
- Update platform and regular billing views to pass teamId
- Maintain backward compatibility with individual user billing
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Add `getTeamByIdIfUserIsAdmin` to `TeamRepository`
* Add `getSubscriptionFromId` function
* Generate portal URL via the team's subscription not the requesting
user's customerId
* Pass teamId to `/portal` endpoint
* Undo Devin change to platform billing
* Address coderabbit comments
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Remove '@calcom/ui/*': ['../../packages/ui/components/*'] path mapping from apps/web/tsconfig.json
- Fix imports from '@calcom/ui/componentName' to '@calcom/ui/components/componentName' format
- Preserve direct exports like '@calcom/ui/classNames' and '@calcom/ui/styles'
- Update 200+ files across apps/web, packages/features, packages/app-store, and packages/ui
- Fix localStorage usage to use safe webstorage import
- Remove forbidden 'as any' type casting in favor of proper TypeScript types
- All changes verified to pass TypeScript compilation
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* refactor: improve most booked & least booked
* add 2 new charts and trpc handlers
* update arg
* update comment
* completed booking filter
* update
* add change in component level and remove unused translations
* current time and accepted status logic handler
* resize some charts
* restore some i18n
* restore i18n
* restore i18n
---------
Co-authored-by: Eunjae Lee <hey@eunjae.dev>
2025-08-25 11:17:07 +00:00
Bailey PumfleetGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>amit@cal.com <samit91848@gmail.com>Alex van Andel
* Various fixes
* Remove tooltip
* another string change
* Fix width of custom event name modal to prevent overflow
* Booking questions fixes
* minor string fix
* checkbox alignment
* padding in reassign dialog
* fix: update FormBuilder tests for checkbox UI changes
- Updated test utilities to work with CheckboxField instead of BooleanToggleGroupField
- Fixed badge expectations to check for 'optional' instead of 'required'
- Updated dialog interaction methods to use checkbox.checked instead of button text
- All 13 FormBuilder tests now pass successfully
Fixes failing tests in PR #22727 caused by UI changes from toggle buttons to checkboxes for required field selection.
Co-Authored-By: amit@cal.com <samit91848@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: amit@cal.com <samit91848@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* feat: implement default filter segments for data tables
- Add defaultSegmentId column to UserFilterSegmentPreference table
- Support mixed segment ID types (number for user segments, string for default segments)
- Add DefaultFilterSegment and CombinedFilterSegment types
- Update useSegments hook to handle default segments with date range recalculation
- Modify FilterSegmentSelect to group and display default segments separately
- Add default segments to bookings view (My Bookings, Upcoming Bookings)
- Prevent editing/deleting of default segments in SaveFilterSegmentButton
- Update DataTableProvider to support defaultSegments prop
- Update parsers and repository to handle mixed segment ID types
Implements frontend-only default segments as specified in the requirements.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* chore: update ESLint dependencies to resolve configuration issues
- Update eslint-config-next and @typescript-eslint packages to latest versions
- Fix dependency compatibility issues that were blocking pre-commit hooks
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* revert eslint change
* some changes
* refactor: implement discriminated union for segment types
- Update SegmentIdentifier to use discriminated union with 'custom' vs 'default' types
- Refactor setSegmentId to accept object parameters: { id: string; type: 'default' } | { id: number; type: 'custom' }
- Update type definitions with DefaultFilterSegment, CustomFilterSegment, and CombinedFilterSegment
- Modify useSegments hook to handle new segment type structure
- Update FilterSegmentSelect component to work with discriminated unions
- Refactor database preference handling to store segment type alongside ID
- Add proper type safety throughout the data flow
- Remove description property from DefaultFilterSegment type
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: update unit test to expect discriminated union format for preferredSegmentId
The test was expecting preferredSegmentId to be a number, but after the discriminated union refactor it now returns { id: number, type: 'custom' } for custom segments. Updated the assertion to use toEqual() for deep object comparison.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: correct SegmentIdentifier type to exclude undefined
- Remove null from SegmentIdentifier type definition since null/undefined indicate absence of identifier
- Update DataTableProvider and useSegments to handle SegmentIdentifier | null properly
- Fix type safety while maintaining discriminated union functionality
- Ensure setAndPersistSegmentId accepts null values for clearing segments
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* remove unused segment
* a little update
* feat: add default- prefix to default segment IDs for clearer type identification
- Update 'my_bookings' to 'default-my_bookings'
- Update 'upcoming-bookings' to 'default-upcoming-bookings'
- Makes it easier to verify segment type by looking at the ID string
- Maintains all existing discriminated union functionality
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: rename segment types from default/custom to system/user for better semantics
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: update unit test to expect 'user' type instead of 'custom' in discriminated union
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: complete type renaming from default/custom to system/user across all component files
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: update segment ID prefix from default- to system- to match type naming
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* remove unused segment
* some fixes
* revert schema change
* rename defaultSegmentId to systemSegmentId
* renaming
* fix save button
* remove as any
* clean up prisma migrations
* type fixes
* many fixes
* remove icon property
* fix infinite rendering
* fix race condition
* re-visiting useSegments implementation WIP
* extract useElementByClassName
* add e2e tests
* fix a bug that the created segment was not selected automatically
* add useSegments to /insights and fix e2e test
* fix type error
* fix type error
* apply feedback
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Fix switch component thumb appearing all white when ON
- Add --cal-brand-accent CSS variable definitions for light and dark modes
- Ensures proper contrast: white accent on dark bg, black accent on light bg
- Resolves UI issue on /getting-started/connected-calendar and /getting-started/setup-availability pages
Fixes switch components using bg-brand-accent class that maps to var(--cal-brand-accent,white)
When CSS variable was undefined, it defaulted to white causing invisible thumbs.
Co-authored-by: Kartik Saini <41051387+kart1ka@users.noreply.github.com>
- Conditionally disable userId column filter based on isTeamAdminOrOwner flag
- Prevents MEMBER-only users from encountering backend permission errors
- Users with ADMIN/OWNER role in any team can still access the filter
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* use server fetched user for all sub pages
* Wrap setAnyInstalledVideoApps call in useEffect
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* Automatically enable migration of a team that conflicts with Orgs slug
* Allow changing the orgs slug and name if user goes back and changes it
* avoid crashing on some scenarios
* Revert "Allow changing the orgs slug and name if user goes back and changes it"
This reverts commit f8872b0116868d59757ef911c4940df79f93c6e0.
* fix: handle unpublished teams gracefully in org migration
- Change 'No oldSlug for team' from error to warning for unpublished teams
- Keep 'No slug for team' as error since org onboarding ensures teams have names
- Add test for migrating unpublished teams without oldSlug
- Add clarifying comments about when each condition can occur