Refactor Discord and Slack Integration Handlers for Improved Data Formatting (#736)
- Moved the instantiation of FormSubmissionFormatter to ensure consistent handling of submission data across both DiscordIntegration and SlackIntegration classes. - Updated the logic to show hidden fields based on settings, enhancing the flexibility of data presentation in notifications. - Modified StoreFormSubmissionJob to ensure UUIDs are properly converted to strings, improving data integrity. - Simplified the redirect URL field check in FormSubmissionProcessor for better readability. These changes aim to enhance the maintainability and functionality of integration handlers and form submission processing. Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -136,7 +136,7 @@ class StoreFormSubmissionJob implements ShouldQueue
|
||||
}
|
||||
} else {
|
||||
if ($field['type'] == 'text' && isset($field['generates_uuid']) && $field['generates_uuid']) {
|
||||
$finalData[$field['id']] = ($this->form->is_pro) ? Str::uuid() : 'Please upgrade your OpenForm subscription to use our ID generation features';
|
||||
$finalData[$field['id']] = ($this->form->is_pro) ? Str::uuid()->toString() : 'Please upgrade your OpenForm subscription to use our ID generation features';
|
||||
} else {
|
||||
if ($field['type'] == 'text' && isset($field['generates_auto_increment_id']) && $field['generates_auto_increment_id']) {
|
||||
$finalData[$field['id']] = ($this->form->is_pro) ? (string) ($this->form->submissions_count + 1) : 'Please upgrade your OpenForm subscription to use our ID generation features';
|
||||
|
||||
Reference in New Issue
Block a user