New Create Project input.
This commit is contained in:
parent
70cd51379a
commit
1b47aaf168
|
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,20 @@
|
|||
|
||||
<x-slot name="content">
|
||||
<div class="space-y-6">
|
||||
<x-secondary-button wire:click="openCreateProjectModal">
|
||||
{{-- TODO change the modal so it only have a name (no need modal)--}}
|
||||
{{ __('Create Project') }}
|
||||
</x-secondary-button>
|
||||
<div class="flex flex-auto gap-2" x-data="{showCreateProjectInput:false}">
|
||||
<x-secondary-button x-show="!showCreateProjectInput" @click="showCreateProjectInput = true">
|
||||
{{ __('Create Project') }}
|
||||
</x-secondary-button>
|
||||
<div x-show="showCreateProjectInput" class="flex justify-center items-center gap-1">
|
||||
<x-input x-ref="projectName" id="name" type="text" class="w-fit"
|
||||
wire:model="formData.name"
|
||||
placeholder="New Project Name"/>
|
||||
<x-secondary-button @click="showCreateProjectInput = false" class="w-fit h-full">
|
||||
{{ __('Cancel') }}
|
||||
</x-secondary-button>
|
||||
<x-button class=" h-full" wire:click="createProject">Create</x-button>
|
||||
</div>
|
||||
</div>
|
||||
@foreach ($projectManager->projects->sortBy('name') as $project)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="break-all">
|
||||
|
|
|
|||
|
|
@ -5,4 +5,3 @@
|
|||
<a class=" capitalize font-semibold text-md hover:rounded-lg hover:bg-gray-50 hover:text-indigo-600 hover:border-0 py-2 pl-2 pr-3 leading-6 whitespace-nowrap gap-2 flex items-baseline group text-gray-700 {{!($activeTab == 'mailings') ?: 'rounded-lg bg-gray-50 text-indigo-600 border-0'}}" href="{{route('project.show',[$projectName,'mailings'])}}"><i class="group-hover:text-indigo-600 w-4 text-gray-400 fa-regular fa-envelope"></i>Mailings</a>
|
||||
<a class=" capitalize font-semibold text-md hover:rounded-lg hover:bg-gray-50 hover:text-indigo-600 hover:border-0 py-2 pl-2 pr-3 leading-6 whitespace-nowrap gap-2 flex items-baseline group text-gray-700 {{!($activeTab == 'settings') ?: 'rounded-lg bg-gray-50 text-indigo-600 border-0'}}" href="{{route('project.show',[$projectName,'settings'])}}"><i class="group-hover:text-indigo-600 w-4 text-gray-400 fa-regular fa-compass"></i>Settings</a>
|
||||
</div>
|
||||
{{--TODO change to responsive menu--}}
|
||||
|
|
|
|||
|
|
@ -3,72 +3,71 @@
|
|||
{{-- wire:poll.1s=""--}}
|
||||
{{-- @endif--}}
|
||||
{{-- TODO Put Back the poll but to the list of downloads only--}}
|
||||
class="m-2"
|
||||
>
|
||||
<div class="px-4 sm:px-6 lg:px-8">
|
||||
<div class="sm:flex sm:flex-col">
|
||||
<div class="flex flex-col md:flex-row md:justify-between items-center w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Downloads</h1>
|
||||
@if ($project->hasPendingDownload())
|
||||
<p class="text-base text-gray-700 animate-pulse">
|
||||
Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 flex flex-col sm:flex-row sm:justify-between gap-2">
|
||||
<x-search class="flex-1 w-full"></x-search>
|
||||
<x-button wire:click="openDownloadModal"
|
||||
class="rounded-md bg-indigo-600 px-3 py-2 justify-center 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 Download') }}
|
||||
</x-button>
|
||||
</div>
|
||||
<div class="sm:flex sm:flex-col">
|
||||
<div class="flex flex-col md:flex-row md:justify-between items-center w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Downloads</h1>
|
||||
@if ($project->hasPendingDownload())
|
||||
<p class="text-base text-gray-700 animate-pulse">
|
||||
Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-8 flow-root">
|
||||
<div class="relative">
|
||||
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||
<div class="inline-block min-w-full py-2 align-middle">
|
||||
<table class="min-w-full divide-y divide-gray-300">
|
||||
<thead>
|
||||
<div class="mt-4 sm:mt-0 flex flex-col sm:flex-row sm:justify-between gap-2">
|
||||
<x-search class="flex-1 w-full"></x-search>
|
||||
<x-button wire:click="openDownloadModal"
|
||||
class="rounded-md bg-indigo-600 px-3 py-2 justify-center 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 Download') }}
|
||||
</x-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-8 flow-root">
|
||||
<div class="relative">
|
||||
<div class="overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||
<div class="inline-block min-w-full py-2 align-middle">
|
||||
<table class="min-w-full divide-y divide-gray-300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
File
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gray-900">
|
||||
Status
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
@foreach($downloads as $download)
|
||||
<tr>
|
||||
<th scope="col"
|
||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 lg:pl-8">
|
||||
Name
|
||||
</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
File
|
||||
</th>
|
||||
<th scope="col"
|
||||
class="px-3 py-3.5 text-right pr-4 sm:pr-8 lg:pr-8 text-sm font-semibold text-gray-900">
|
||||
Status
|
||||
</th>
|
||||
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $download->name }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||
{{ $download->path }}
|
||||
</td>
|
||||
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
|
||||
<x-badge :status="$download->status"></x-badge>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
@foreach($downloads as $download)
|
||||
<tr>
|
||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $download->name }}</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||
{{ $download->path }}
|
||||
</td>
|
||||
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8">
|
||||
<x-badge :status="$download->status"></x-badge>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="pt-4 flex justify-between items-center">
|
||||
<div class="text-gray-700 text-sm">
|
||||
Results: {{ \Illuminate\Support\Number::format($downloads->total()) }}
|
||||
</div>
|
||||
|
||||
{{ $downloads->links('livewire.pagination') }}
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div wire:loading class="absolute inset-0 bg-white opacity-75"></div>--}}
|
||||
<div class="pt-4 flex justify-between items-center">
|
||||
<div class="text-gray-700 text-sm">
|
||||
Results: {{ \Illuminate\Support\Number::format($downloads->total()) }}
|
||||
</div>
|
||||
|
||||
{{ $downloads->links('livewire.pagination') }}
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div wire:loading class="absolute inset-0 bg-white opacity-75"></div>--}}
|
||||
</div>
|
||||
</div>
|
||||
<x-download-create-modal :manager="$this"/>
|
||||
|
|
|
|||
|
|
@ -3,26 +3,26 @@
|
|||
wire:poll.1s=""
|
||||
@endif
|
||||
>
|
||||
<div class="px-4 sm:px-6 lg:px-8">
|
||||
<div class="px-4 ">
|
||||
<div class="sm:flex sm:flex-col sm:items-center">
|
||||
<div class="flex justify-between w-full my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Mosaics</h1>
|
||||
@if ($project->hasPendingDownload())
|
||||
@if ($project->hasPendingMosaic())
|
||||
<p class="text-base text-gray-700 animate-pulse">
|
||||
Pending mosaics for this project: {{ $project->mosaics()->statusPending()->count() }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
|
||||
<x-search></x-search>
|
||||
<div class="flex flex-col md:flex-row mt-4 items-center md:justify-between w-full gap-2">
|
||||
<x-search class="flex-1 w-full"></x-search>
|
||||
<x-button wire:click="openCreateMosiacsModal"
|
||||
class="block 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">
|
||||
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
|
||||
</x-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-8 flow-root">
|
||||
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
||||
<div class="">
|
||||
<div class="relative">
|
||||
<div class="inline-block min-w-full py-2 align-middle">
|
||||
<table class="min-w-full divide-y divide-gray-300">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<div>
|
||||
<div class="px-4 sm:px-6 lg:px-8">
|
||||
<div class="px-4 sm:px-6 lg:px-8">
|
||||
<div class="">
|
||||
<div class="sm:flex sm:flex-col sm:items-center">
|
||||
<div class="w-full flex justify-between my-4">
|
||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Reports</h1>
|
||||
<p class="mt-2 text-sm text-gray-700"></p>
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
|
||||
<div class="mt-4 md:mt-0 flex flex-col md:flex md:justify-between md:flex-row w-full gap-2">
|
||||
<x-search></x-search>
|
||||
<x-button wire:click="openCreateReportModal"
|
||||
class="block 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">
|
||||
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
|
||||
</x-button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{-- TODO change mail to something else and check schedule--}}
|
||||
<div id="scheduling"
|
||||
class="flex flex-col md:flex-row">
|
||||
<div class="flex flex-col my-4 md:w-1/3">
|
||||
|
|
|
|||
Loading…
Reference in a new issue