Commit fc4ecf5
fix: Apply organization brand colors and theme to member personal events (calcom#24456)
* fix: Apply organization brand colors and theme to member personal events
- Fetch organization brand colors and theme in getEventTypesFromDB
- Override user brand colors/theme with org values for personal events
- Apply to booking confirmation pages, user booking pages, and routing forms
- Follow same pattern as hideBranding for consistency
- Fixes issue where org brand colors only applied to team events
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: Resolve type errors for organization brand color and theme overrides
- Added brandColor, darkBrandColor, theme to ProfileRepository findById organization select
- Updated test mock to include new organization fields
- Ensures consistent organization branding types across all queries
- All type errors related to brand color changes now resolved
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: Remove redundant profile assignment causing type errors
The spread operator already includes profile when it exists.
Explicit assignment causes type conflicts with union types where
profile is not guaranteed to exist in all branches.
Resolves TypeScript error at bookings-single-view.getServerSideProps.tsx:134
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: Use eventTypeRaw.profile for organization brand color access
Changed eventType.profile to eventTypeRaw.profile in profile object construction
to fix TypeScript errors where profile property doesn't exist on transformed
eventType object. The eventTypeRaw object maintains the original profile field
from the database query.
Resolves TypeScript errors at lines 155, 158, 161 in
bookings-single-view.getServerSideProps.tsx
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix type error
* refactor: Extract branding logic into getBrandingForEventType utility
- Create getBrandingForEventType utility function that handles organization
brand color overrides for both team and personal events
- For team events: org branding → team branding → null
- For personal events: org branding → user branding → null
- Refactor bookings-single-view to use utility function
- Update team booking page to apply organization brand overrides
- Add organization branding fields to ProfileRepository and team queries
Addresses review feedback from @hariombalhara on PR calcom#24456
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Update getBranding.ts
* Change
Set themeBasis to null instead of branding.theme.
* refactor: Simplify branding fallback logic to prevent mixing org/team settings
- Changed getBrandingForEventType to use either parent or team branding entirely
- Simplified team parent branding structure in getServerSideProps
- Prevents inconsistent branding when some properties exist in parent but not others
- Addresses PR review feedback from hariombalhara
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
* addressed review
* test: Add comprehensive unit tests for branding utility functions
- Add 20 unit tests covering getBrandingForEventType, getBrandingForUser, and getBrandingForTeam
- Test organization branding override scenarios for both team and personal events
- Test fallback behavior when organization branding is not set
- Test handling of null and optional branding properties
- Verify theme and color inheritance from parent organizations
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* test: Simplify branding tests to focus on core scenarios
- Reduce from 20 to 8 essential test cases
- Focus on org override and fallback behavior for each utility
- Remove redundant edge case tests while maintaining full coverage
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: hariom@cal.com <hariombalhara@gmail.com>1 parent 9d45228 commit fc4ecf5
10 files changed
Lines changed: 361 additions & 19 deletions
File tree
- apps/web
- lib
- apps/routing-forms/[...pages]
- team/[slug]/[type]
- modules
- bookings/views
- users/views
- server/lib/[user]
- packages/features
- eventtypes/lib
- profile
- lib
- repositories
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
71 | 78 | | |
72 | 79 | | |
73 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
74 | 84 | | |
75 | 85 | | |
76 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| |||
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
119 | | - | |
120 | | - | |
| 132 | + | |
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
124 | | - | |
| 136 | + | |
125 | 137 | | |
126 | 138 | | |
127 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
| |||
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
| 165 | + | |
156 | 166 | | |
157 | 167 | | |
158 | 168 | | |
| |||
204 | 214 | | |
205 | 215 | | |
206 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
207 | 220 | | |
208 | 221 | | |
209 | 222 | | |
| |||
214 | 227 | | |
215 | 228 | | |
216 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
217 | 233 | | |
218 | 234 | | |
219 | 235 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
154 | | - | |
155 | | - | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | | - | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
138 | | - | |
139 | | - | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | | - | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
0 commit comments