diff --git a/laravel_app/app/Livewire/Projects/ProjectManager.php b/laravel_app/app/Livewire/Projects/ProjectManager.php index d748c10..ab4813f 100644 --- a/laravel_app/app/Livewire/Projects/ProjectManager.php +++ b/laravel_app/app/Livewire/Projects/ProjectManager.php @@ -24,7 +24,7 @@ class ProjectManager extends Component public $showMailSettingsModal = false; - public $projectIdBeingDeleted; + public $reportIdBeingDeleted = null; public array $pivotFiles; public array $spanFiles; @@ -70,6 +70,28 @@ public function openCreateProjectModal() $this->showProjectModal = true; } + public function createProject() + { + $projectIdentifier = $this->formData['id'] ?? null; + Validator::make( + [ + 'name' => $this->formData['name'] + ], + [ + 'name' => [ + 'required', + Rule::unique('projects')->ignore($projectIdentifier), + 'string', + 'max:255' + ] + ])->validate(); + $project = Project::create([ + 'name' => $this->formData['name'], + 'download_path' => $this->formData['name'] + ]); + return redirect()->route('project.show',[$project->name,'settings']); + } + public function saveProject() { $this->resetErrorBag(); @@ -119,8 +141,8 @@ public function deleteEmailRecipient($index) */ public function confirmReportDeletion($reportId) { - $this->confirmingReportDeletion = true; + $this->confirmingReportDeletion = true; $this->reportIdBeingDeleted = $reportId; } @@ -129,11 +151,10 @@ public function confirmReportDeletion($reportId) * * @return void */ - public function deleteProject() + public function deleteProject():void { Project::whereId($this->reportIdBeingDeleted)->first()->delete(); $this->resetFormData(); - $this->confirmingReportDeletion = false; } @@ -226,5 +247,6 @@ public function mergeFormData(): void $this->formData['pivot_file'] = $this->pivotFiles[0] ?? null; $this->formData['span_file'] = $this->spanFiles[0] ?? null; $this->formData['harvest_file'] = $this->harvestDataFiles[0] ?? null; + $this->formData['download_path'] = $this->formData['download_path'] ?? $this->formData['name']; } } diff --git a/laravel_app/app/Livewire/Projects/Tabs/Settings.php b/laravel_app/app/Livewire/Projects/Tabs/Settings.php index 4510d0e..f77bbb3 100644 --- a/laravel_app/app/Livewire/Projects/Tabs/Settings.php +++ b/laravel_app/app/Livewire/Projects/Tabs/Settings.php @@ -29,6 +29,7 @@ class Settings extends Component public $isDirty = false; + /** * Mount the component. * @@ -164,11 +165,6 @@ private function resetFormData() $this->addEmailRecipient(); } - public function todo() - { - - } - private function validateForm() { $projectIdentifier = $this->formData['id'] ?? null; diff --git a/laravel_app/resources/views/components/project-manager-grid.blade.php b/laravel_app/resources/views/components/project-manager-grid.blade.php index cb4d462..3ef1649 100644 --- a/laravel_app/resources/views/components/project-manager-grid.blade.php +++ b/laravel_app/resources/views/components/project-manager-grid.blade.php @@ -15,10 +15,20 @@
- - {{-- TODO change the modal so it only have a name (no need modal)--}} - {{ __('Create Project') }} - +
+ + {{ __('Create Project') }} + +
+ + + {{ __('Cancel') }} + + Create +
+
@foreach ($projectManager->projects->sortBy('name') as $project)
diff --git a/laravel_app/resources/views/livewire/projects/menu.blade.php b/laravel_app/resources/views/livewire/projects/menu.blade.php index fdcf2a4..bbdd56c 100644 --- a/laravel_app/resources/views/livewire/projects/menu.blade.php +++ b/laravel_app/resources/views/livewire/projects/menu.blade.php @@ -5,4 +5,3 @@ Mailings Settings
-{{--TODO change to responsive menu--}} diff --git a/laravel_app/resources/views/livewire/projects/tabs/download.blade.php b/laravel_app/resources/views/livewire/projects/tabs/download.blade.php index e57d680..55e87c5 100644 --- a/laravel_app/resources/views/livewire/projects/tabs/download.blade.php +++ b/laravel_app/resources/views/livewire/projects/tabs/download.blade.php @@ -3,72 +3,71 @@ {{-- wire:poll.1s=""--}} {{-- @endif--}} {{-- TODO Put Back the poll but to the list of downloads only--}} + class="m-2" > -
-
-
-

Downloads

- @if ($project->hasPendingDownload()) -

- Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }} -

- @endif -
-
- - - {{ __('Create Download') }} - -
+
+
+

Downloads

+ @if ($project->hasPendingDownload()) +

+ Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }} +

+ @endif
-
-
-
-
- - +
+ + + {{ __('Create Download') }} + +
+ +
+
+
+
+
+ + + + + + + + + + @foreach($downloads as $download) - - - - + + + - - - @foreach($downloads as $download) - - - - - - @endforeach - -
+ Name + + File + + Status +
- Name - - File - - Status - {{ $download->name }} + {{ $download->path }} + + +
{{ $download->name }} - {{ $download->path }} - - -
+ @endforeach + + -
-
-
- Results: {{ \Illuminate\Support\Number::format($downloads->total()) }} -
- - {{ $downloads->links('livewire.pagination') }} -
- {{--
--}} +
+
+ Results: {{ \Illuminate\Support\Number::format($downloads->total()) }} +
+ + {{ $downloads->links('livewire.pagination') }} +
+ {{--
--}}
diff --git a/laravel_app/resources/views/livewire/projects/tabs/mosaic.blade.php b/laravel_app/resources/views/livewire/projects/tabs/mosaic.blade.php index c70a78f..4303247 100644 --- a/laravel_app/resources/views/livewire/projects/tabs/mosaic.blade.php +++ b/laravel_app/resources/views/livewire/projects/tabs/mosaic.blade.php @@ -3,26 +3,26 @@ wire:poll.1s="" @endif > -
+

Mosaics

- @if ($project->hasPendingDownload()) + @if ($project->hasPendingMosaic())

Pending mosaics for this project: {{ $project->mosaics()->statusPending()->count() }}

@endif
-
- +
+ + class="justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"> Create Mosaic
-
+
diff --git a/laravel_app/resources/views/livewire/projects/tabs/report.blade.php b/laravel_app/resources/views/livewire/projects/tabs/report.blade.php index 5b961f6..2062ab9 100644 --- a/laravel_app/resources/views/livewire/projects/tabs/report.blade.php +++ b/laravel_app/resources/views/livewire/projects/tabs/report.blade.php @@ -1,14 +1,14 @@ -
-
+
+

Reports

-
+
+ class="flex justify-center rounded-md bg-indigo-600 px-3 py-2 text-center text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"> Create Report
diff --git a/laravel_app/resources/views/livewire/projects/tabs/settings.blade.php b/laravel_app/resources/views/livewire/projects/tabs/settings.blade.php index c934fd5..ce6a6ab 100644 --- a/laravel_app/resources/views/livewire/projects/tabs/settings.blade.php +++ b/laravel_app/resources/views/livewire/projects/tabs/settings.blade.php @@ -58,7 +58,6 @@
-{{-- TODO change mail to something else and check schedule--}}