Skip to content

Commit

Permalink
File input new design (#246)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Nahum <[email protected]>
  • Loading branch information
formsdev and JhumanJ authored Nov 28, 2023
1 parent 730bdd1 commit 57fdfb2
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 203 deletions.
7 changes: 5 additions & 2 deletions app/Jobs/Form/StoreFormSubmissionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Http\Requests\AnswerFormRequest;
use App\Models\Forms\Form;
use App\Models\Forms\FormSubmission;
use App\Service\Forms\FormLogicPropertyResolver;
use App\Service\Storage\StorageFileNameParser;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Filesystem\Filesystem;
Expand Down Expand Up @@ -224,8 +225,10 @@ private function addHiddenPrefills(array &$formData): void
collect($this->form->properties)->filter(function ($property) {
return isset($property['hidden'])
&& isset($property['prefill'])
&& $property['hidden']
&& !is_null($property['prefill']);
&& FormLogicPropertyResolver::isHidden($property, $this->submissionData)
&& !is_null($property['prefill'])
&& !in_array($property['type'], ['files'])
&& !($property['type'] == 'url' && isset($property['file_upload']) && $property['file_upload']);
})->each(function (array $property) use (&$formData) {
if ($property['type'] === 'date' && isset($property['prefill_today']) && $property['prefill_today']) {
$formData[$property['id']] = now()->format((isset($property['with_time']) && $property['with_time']) ? 'Y-m-d H:i' : 'Y-m-d');
Expand Down
Loading

0 comments on commit 57fdfb2

Please sign in to comment.