fix(event-types): hide hidden team event types for members and propagate hidden lock(#15873)#28471
Open
nourzakhama2003 wants to merge 3 commits intocalcom:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/i18n/locales/en/common.json">
<violation number="1" location="packages/i18n/locales/en/common.json:2">
P3: New locale keys were added at the top of the file instead of above the append-only sentinel, breaking the file’s explicit merge-conflict prevention convention.</violation>
</file>
<file name="packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts">
<violation number="1" location="packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts:188">
P2: Hidden team event types are filtered after pagination/cursor calculation, so members can receive short pages and hidden items still advance `nextCursor`, potentially skipping later visible event types.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
packages/trpc/server/routers/viewer/eventTypes/getEventTypesFromGroup.handler.ts
Outdated
Show resolved
Hide resolved
Author
|
hi maintainers ,could someone add the run-ci label so the ci can run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements parent-level Hidden support for managed event types and ensures the setting is applied consistently to child event types.
Fixes #25903
Fixes CAL-6920
Summary
Adds parent managed-event Hidden behavior with lock/unlock support.
Propagates parent hidden/hiddenLocked state to child event types on create/update.
Ensures listing-level Hidden toggle updates parent and synchronizes existing children.
Preserves per-member visibility behavior when Hidden is unlocked.
Hides hidden team event types from member listings while keeping admin visibility/management.
Adds schema + migration support for hidden lock persistence.
Dependencies
Prisma migration included for [hiddenLocked].
No new package dependencies.
Visual Demo
Image Demo
Before/after screenshots:
Member view (hidden managed event is not visible to member)
Admin view (hidden managed event remains visible/manageable to admin)
Mandatory Tasks (DO NOT REMOVE)
I have self-reviewed the code (A decent size PR without self-review might be rejected).
I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
N/A
I confirm automated tests are in place that prove my fix is effective or that my feature works.
How should this be tested?
Environment setup
Ensure these env vars are set in [.env]:
DATABASE_URL
DATABASE_DIRECT_URL
Setup commands
yarn
yarn prisma generate
yarn workspace @calcom/prisma db-migrate
yarn dev
Minimal test data
One team/org with:
1 admin/owner
1+ members
One parent managed event type with assigned members (children generated from assignments)
Manual verification (happy paths)
Parent Hidden locked propagates to children
Open parent managed event.
Lock Hidden field.
Toggle Hidden ON and save.
Expected:
Parent is hidden.
All assigned children are hidden.
Toggle Hidden OFF and save.
Expected:
Parent is visible.
All assigned children are visible.
Listing toggle sync
From event types listing, toggle Hidden on the parent managed event.
Expected:
Parent hidden state updates.
Existing children synchronize immediately.
Unlocked Hidden supports per-member control
Unlock Hidden in parent form.
Set different member “Show on profile” values.
Save.
Expected:
Each child reflects that member’s own visibility value.
Parent saves do not overwrite per-member visibility while unlocked.
Member visibility behavior
Login as member.
Expected:
Hidden team event types are not shown in member listing.
Login as admin.
Expected:
Hidden event remains visible/manageable for admin.
Automated test run
$env:TZ='UTC'; yarn vitest run apps/web/test/lib/handleChildrenEventTypes.test.ts
Checklist
I have read the contributing guide.
My code follows the style guidelines of this project.
I have commented code only where needed for non-obvious logic.
I have checked my changes for new relevant warnings/errors in touched scope.
This PR is focused on a single feature end-to-end.