[fix] Bug with bounding boxes in database, DBseeder and dropzone.

This commit is contained in:
guillaume91 2024-05-23 11:21:12 +02:00
parent a4f48d04a4
commit 4dfedb75b3
9 changed files with 22 additions and 66 deletions

View file

@ -2,7 +2,6 @@
namespace App\Jobs;
use App\Enums\Status;
use App\Models\Project;
use App\Models\ProjectDownload;
use Illuminate\Bus\Batchable;

View file

@ -16,7 +16,7 @@ class DownloadManager extends Component
{
use WithPagination;
public $project;
public Project $project;
public $formData;
@ -88,6 +88,7 @@ public function placeholder()
public function render()
{
$query = $this->project->downloads()->orderBy('name', 'desc');
$query = $this->applySearch($query);
$downloads = $query->paginate(10, pageName: 'downloadPage');

View file

@ -28,6 +28,6 @@ public function up(): void
*/
public function down(): void
{
Schema::dropIfExists('reports');
Schema::dropIfExists('project_reports');
}
};

View file

@ -23,6 +23,6 @@ public function up(): void
*/
public function down(): void
{
Schema::dropIfExists('password_resets');
Schema::dropIfExists('password_reset_tokens');
}
};

View file

@ -45,27 +45,6 @@ private function createChembaProject()
'updated_at' => '2021-01-01 00:00:00',
]);
$chembaProject->boundingBoxes()->createMany([
[
'name' => 'Chemba West',
'top_left_latitude' => 34.9460,
'top_left_longitude' => -17.3516,
'bottom_right_latitude' => 34.9380,
'bottom_right_longitude' => -17.2917,
'created_at' => '2021-01-01 00:00:00',
'updated_at' => '2021-01-01 00:00:00',
],
[
'name' => 'Chemba East',
'top_left_latitude' => 34.8830,
'top_left_longitude' => -17.3516,
'bottom_right_latitude' => 34.9380,
'bottom_right_longitude' => -17.2917,
'created_at' => '2021-01-01 00:00:00',
'updated_at' => '2021-01-01 00:00:00',
],
]);
foreach ($chembaProject->getMergedTiffList() as $mergedTiff) {
$download = $chembaProject->downloads()->create([
'name' => basename($mergedTiff),
@ -151,27 +130,6 @@ private function createXinavaneProject()
'updated_at' => '2021-01-01 00:00:00',
]);
$project->boundingBoxes()->createMany([
[
'name' => 'Xinavane West',
'top_left_latitude' => 32.6213,
'top_left_longitude' => -25.0647,
'bottom_right_latitude' => 32.6284,
'bottom_right_longitude' => -25.0570,
'created_at' => '2021-01-01 00:00:00',
'updated_at' => '2021-01-01 00:00:00',
],
[
'name' => 'Xinavane East',
'top_left_latitude' => 32.6790,
'top_left_longitude' => -25.0333,
'bottom_right_latitude' => 32.7453,
'bottom_right_longitude' => -25.0235,
'created_at' => '2021-01-01 00:00:00',
'updated_at' => '2021-01-01 00:00:00',
],
]);
$project->emailRecipients()->createMany([
[
'name' => 'Martin Folkerts',
@ -245,17 +203,6 @@ private function createKakiraProject()
'updated_at' => '2021-01-01 00:00:00',
]);
$project->boundingBoxes()->createMany([
[
'name' => 'kakira_demo',
'top_left_latitude' => 33.289993827426535,
'top_left_longitude' => 0.491981861534345,
'bottom_right_latitude' => 33.32572075441914,
'bottom_right_longitude' => 0.5144195937114393,
'created_at' => '2021-01-01 00:00:00',
'updated_at' => '2021-01-01 00:00:00',
],
]);
$project->emailRecipients()->createMany([
[

View file

@ -728,9 +728,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001547",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz",
"integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==",
"version": "1.0.30001621",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001621.tgz",
"integrity": "sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==",
"dev": true,
"funding": [
{

View file

@ -27,7 +27,7 @@ class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg
Name
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Year-Week
File
</th>
<th scope="col"
class="px-3 py-3.5 text-right text-sm font-semibold text-gray-900 sm:pr-8 lg:pr-8">

View file

@ -66,7 +66,7 @@ class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gr
{{ $downloads->links('livewire.pagination') }}
</div>
</div>
<div wire:loading class="absolute inset-0 bg-white opacity-75"></div>
{{-- <div wire:loading class="absolute inset-0 bg-white opacity-75"></div>--}}
</div>
</div>
</div>

View file

@ -5,7 +5,7 @@
uuid: @js($uuid),
multiple: @js($multiple),
})"
@dragenter.prevent.document="onDragenter($event)"
@dragenter.prevent="onDragenter($event)"
@dragleave.prevent="onDragleave($event)"
@dragover.prevent="onDragover($event)"
@drop.prevent="onDrop"
@ -157,13 +157,22 @@ class="hidden"
multiple ? _this.uploadMultiple(...args) : _this.upload(...args)
},
onDragenter() {
this.isDragging = true
if(!this.isDragging){
this.isDragging = true;
console.log('ondragenter:',uuid,'->',this.isDragging);
}
},
onDragleave() {
this.isDragging = false
if(this.isDragging) {
this.isDragging = false;
console.log('ondragleave: ',uuid,'->', this.isDragging);
}
},
onDragover() {
this.isDragging = true
if(!this.isDragging) {
this.isDragging = true;
console.log('ondragover: ',uuid,'->',this.isDragging);
}
},
removeUpload(tmpFilename) {
// Dispatch an event to remove the temporarily uploaded file