wip
This commit is contained in:
parent
0a37fd2d91
commit
025f306d49
|
|
@ -214,7 +214,7 @@ private function validateForm()
|
||||||
'name' => $this->formData['name'],
|
'name' => $this->formData['name'],
|
||||||
'pivot_file' => $this->pivotFiles[0] ?? null,
|
'pivot_file' => $this->pivotFiles[0] ?? null,
|
||||||
'span_file' => $this->spanFiles[0] ?? null,
|
'span_file' => $this->spanFiles[0] ?? null,
|
||||||
'harvest_data_file' => $this->harvestDataFiles[0] ?? null,
|
'harvest_file' => $this->harvestDataFiles[0] ?? null,
|
||||||
'boundingBoxes' => $this->formData['boundingBoxes'],
|
'boundingBoxes' => $this->formData['boundingBoxes'],
|
||||||
], [
|
], [
|
||||||
'name' => [
|
'name' => [
|
||||||
|
|
@ -223,9 +223,17 @@ private function validateForm()
|
||||||
'string',
|
'string',
|
||||||
'max:255'
|
'max:255'
|
||||||
],
|
],
|
||||||
'pivot_file' => ['sometimes'],
|
'pivot_file.extension' => ['sometimes',function ($attribute, $value, $fail) {
|
||||||
'span_file' => ['sometimes'],
|
if($value != 'json'){
|
||||||
'harvestDataFile' => ['sometimes',new HarvestFile],
|
$fail('Not a json file');
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
'span_file' => ['sometimes',function ($attribute, $value, $fail) {
|
||||||
|
if($value != 'json'){
|
||||||
|
$fail('Not a json file');
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
'harvest_file' => ['sometimes',new HarvestFile],
|
||||||
'boundingBoxes' => ['required', 'array', 'min:1'],
|
'boundingBoxes' => ['required', 'array', 'min:1'],
|
||||||
'boundingBoxes.*.name' => ['required', 'string', 'max:255'],
|
'boundingBoxes.*.name' => ['required', 'string', 'max:255'],
|
||||||
'boundingBoxes.*.top_left_latitude' => ['required', 'string'],
|
'boundingBoxes.*.top_left_latitude' => ['required', 'string'],
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ class HarvestFile implements ValidationRule
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
//
|
$extensions = [''];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@
|
||||||
<livewire:dropzone
|
<livewire:dropzone
|
||||||
wire:model="harvestDataFiles"
|
wire:model="harvestDataFiles"
|
||||||
:rules="['extensions:xls,xlsx,ods','mimes:xls,xlsx,ods','required']"
|
:rules="['extensions:xls,xlsx,ods','mimes:xls,xlsx,ods','required']"
|
||||||
:key="'harvestDataFiles'"
|
:key="'harvest_file'"
|
||||||
/>
|
/>
|
||||||
@error('harvestDataFiles')
|
@error('harvest_file')
|
||||||
{{ $message }}
|
{{ $message }}
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue