Refactor Form Submission and Field Management Logic
- Simplified the constructor in StoreFormSubmissionJob for improved readability. - Enhanced the storeFile method to handle null and empty values more robustly, ensuring better validation of file names. - Updated StorageFileNameParser to return null for empty file names, improving error handling. - Refactored OpenForm.vue to optimize form initialization and prevent unnecessary reinitializations, enhancing performance. - Introduced new methods for managing field groups and preventing recursive updates in OpenForm.vue, improving the overall user experience. - Enhanced FormEditorSidebar.vue to utilize Pinia store for better state management and clarity. - Improved FormFieldEdit.vue to prevent page jumps during field editing, ensuring a smoother user experience. - Added new getters in working_form.js for better page management and navigation within forms. These changes aim to enhance the maintainability and performance of the form handling logic, providing a more efficient and user-friendly experience.
This commit is contained in:
@@ -176,9 +176,9 @@ class StoreFormSubmissionJob implements ShouldQueue
|
||||
* - file_name-{uuid}.{ext}
|
||||
* - {uuid}
|
||||
*/
|
||||
private function storeFile(?string $value)
|
||||
private function storeFile($value, ?bool $isPublic = null)
|
||||
{
|
||||
if ($value == null) {
|
||||
if (is_null($value) || empty($value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -196,6 +196,9 @@ class StoreFormSubmissionJob implements ShouldQueue
|
||||
}
|
||||
|
||||
$fileNameParser = StorageFileNameParser::parse($value);
|
||||
if (!$fileNameParser || !$fileNameParser->uuid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Make sure we retrieve the file in tmp storage, move it to persistent
|
||||
$fileName = PublicFormController::TMP_FILE_UPLOAD_PATH . '/' . $fileNameParser->uuid;
|
||||
|
||||
Reference in New Issue
Block a user