( existingUserFields: UserMappedField[] )
| 210 | * Migrate existing user fields to the new field configuration system |
| 211 | */ |
| 212 | export function migrateUserFieldsToFieldConfig( |
| 213 | existingUserFields: UserMappedField[] |
| 214 | ): ModalFieldConfig[] { |
| 215 | if (!existingUserFields || existingUserFields.length === 0) { |
| 216 | return []; |
| 217 | } |
| 218 | |
| 219 | return existingUserFields.map((userField, index) => ({ |
| 220 | id: userField.id || `user-${index}`, |
| 221 | fieldType: "user" as const, |
| 222 | group: "custom" as const, |
| 223 | displayName: userField.displayName || `Field ${index + 1}`, |
| 224 | visibleInCreation: true, |
| 225 | visibleInEdit: true, |
| 226 | order: index, |
| 227 | enabled: true, |
| 228 | })); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Initialize or migrate field configuration |
no outgoing calls
no test coverage detected