Commit aea0661
feat: disable changing field type of routing forms if responses exist (calcom#21911)
* feat: add field type change warning dialog to routing forms
- Add FieldTypeChangeWarningDialog component to prevent field type changes
- Show informative dialog explaining data integrity concerns when users try to change field types
- Provide alternative suggestion to create new field instead of changing existing one
- Add i18n translations for dialog messages
- Integrate dialog into routing form edit page field type selector
- Bypass Teams plan restriction for testing routing forms functionality
- Fix ESLint error by properly handling scrollIntoView in embed mode with disable comment
Prevents data integrity issues by blocking field type changes (e.g. multiselect → text)
that could make existing form responses incompatible and cause data loss.
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: make field type dialog more selective to allow legitimate changes during form creation
- Only show warning dialog when there's actual data integrity risk
- Allow field type changes for new fields or fields without meaningful labels
- Fixes E2E test timeout by not blocking legitimate field type changes
- Maintains data protection for existing fields with real data
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: complete field type dialog implementation with translations and component
- Add FieldTypeChangeWarningDialog component with proper i18n support
- Add all required translation strings for dialog messages
- Ensure dialog only shows for actual data integrity risks
- Allow legitimate field type changes during form creation
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* simplify field type dialog: one button, button replaces SelectField, remove forms page changes
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* use Button component
* feat: restore SelectField with conditional dialog for field type changes
- Restore original SelectField dropdown to allow users to see available field types
- Add conditional logic to show dialog only when different type is selected AND form has responses
- Prevent field type changes by not calling onChange when dialog is shown
- Pass hasFormResponses prop from FormEdit to Field component
- Maintain data integrity while providing clear user guidance
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* controlled value
* convert dialog to tooltip
* Update common.json
* remove unused texts
* allow type changing for new field
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: eunjae@cal.com <hey@eunjae.dev>1 parent 3fd9ef3 commit aea0661
2 files changed
Lines changed: 64 additions & 35 deletions
File tree
- apps/web/public/static/locales/en
- packages/app-store/routing-forms/pages/form-edit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2835 | 2835 | | |
2836 | 2836 | | |
2837 | 2837 | | |
2838 | | - | |
| 2838 | + | |
2839 | 2839 | | |
2840 | 2840 | | |
2841 | 2841 | | |
| |||
2888 | 2888 | | |
2889 | 2889 | | |
2890 | 2890 | | |
| 2891 | + | |
2891 | 2892 | | |
2892 | 2893 | | |
2893 | 2894 | | |
| |||
2933 | 2934 | | |
2934 | 2935 | | |
2935 | 2936 | | |
2936 | | - | |
| 2937 | + | |
2937 | 2938 | | |
2938 | 2939 | | |
2939 | 2940 | | |
| |||
2996 | 2997 | | |
2997 | 2998 | | |
2998 | 2999 | | |
2999 | | - | |
| 3000 | + | |
3000 | 3001 | | |
3001 | 3002 | | |
3002 | 3003 | | |
| |||
3031 | 3032 | | |
3032 | 3033 | | |
3033 | 3034 | | |
3034 | | - | |
3035 | | - | |
3036 | | - | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
3037 | 3038 | | |
3038 | 3039 | | |
3039 | 3040 | | |
| |||
3103 | 3104 | | |
3104 | 3105 | | |
3105 | 3106 | | |
3106 | | - | |
| 3107 | + | |
3107 | 3108 | | |
3108 | 3109 | | |
3109 | 3110 | | |
| |||
3181 | 3182 | | |
3182 | 3183 | | |
3183 | 3184 | | |
3184 | | - | |
3185 | | - | |
| 3185 | + | |
| 3186 | + | |
3186 | 3187 | | |
3187 | 3188 | | |
3188 | 3189 | | |
| |||
Lines changed: 54 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
152 | 176 | | |
153 | 177 | | |
154 | 178 | | |
| |||
213 | 237 | | |
214 | 238 | | |
215 | 239 | | |
| 240 | + | |
216 | 241 | | |
217 | 242 | | |
218 | 243 | | |
| |||
236 | 261 | | |
237 | 262 | | |
238 | 263 | | |
| 264 | + | |
| 265 | + | |
239 | 266 | | |
240 | 267 | | |
241 | 268 | | |
242 | 269 | | |
243 | 270 | | |
244 | 271 | | |
| 272 | + | |
245 | 273 | | |
246 | 274 | | |
247 | 275 | | |
| |||
0 commit comments