[Done] PendinMessage works on every tab
This commit is contained in:
parent
c349a78f14
commit
43dd3c5e09
|
|
@ -17,17 +17,11 @@ class PendingMessage extends Component
|
||||||
|
|
||||||
public function mount(Project $project,string $type = null): void
|
public function mount(Project $project,string $type = null): void
|
||||||
{
|
{
|
||||||
logger('in PendingMessage->mount();');
|
|
||||||
$this->project = Project::find($project->id);
|
$this->project = Project::find($project->id);
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
$this->count = static::getPendingCount($project,$type);
|
$this->count = static::getPendingCount($project,$type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
logger('in PendingMessage->boot();');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getPendingCount(Project $p,string $t): int
|
public static function getPendingCount(Project $p,string $t): int
|
||||||
{
|
{
|
||||||
return (match($t){
|
return (match($t){
|
||||||
|
|
@ -40,7 +34,6 @@ public static function getPendingCount(Project $p,string $t): int
|
||||||
|
|
||||||
public function updateSelf()
|
public function updateSelf()
|
||||||
{
|
{
|
||||||
logger($this->attributes->toJson());
|
|
||||||
$this->count = static::getPendingCount($this->project, $this->type);
|
$this->count = static::getPendingCount($this->project, $this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ public function render()
|
||||||
$query = $this->applySearch($query);
|
$query = $this->applySearch($query);
|
||||||
$downloads = $query->paginate(10, pageName: 'downloadPage');
|
$downloads = $query->paginate(10, pageName: 'downloadPage');
|
||||||
|
|
||||||
|
logger(sprintf('%s %s', __CLASS__, now()));
|
||||||
return view('livewire.projects.tabs.download',
|
return view('livewire.projects.tabs.download',
|
||||||
compact('downloads')
|
compact('downloads')
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,7 @@
|
||||||
<div class="sm:flex sm:flex-col">
|
<div class="sm:flex sm:flex-col">
|
||||||
<div class="flex flex-col md:flex-row md:justify-between items-center w-full my-4">
|
<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>
|
<h1 class="text-base font-semibold leading-6 text-gray-900">Downloads</h1>
|
||||||
@if ($project->hasPendingDownload())
|
<livewire:components.pending-message :project="$project" type="downloads"></livewire:components.pending-message>
|
||||||
<p class="text-base text-gray-700 animate-pulse">
|
|
||||||
Pending downloads for this project: {{ $project->downloads()->statusPending()->count() }}
|
|
||||||
</p>
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 sm:mt-0 flex flex-col sm:flex-row sm:justify-between gap-2">
|
<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-search class="flex-1 w-full"></x-search>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="sm:flex sm:flex-col sm:items-center">
|
<div class="sm:flex sm:flex-col sm:items-center">
|
||||||
<div class="w-full flex justify-between my-4">
|
<div class="w-full flex justify-between my-4">
|
||||||
<h1 class="text-base font-semibold leading-6 text-gray-900">{{ __('Mailing') }}</h1>
|
<h1 class="text-base font-semibold leading-6 text-gray-900">{{ __('Mailing') }}</h1>
|
||||||
<p class="mt-2 text-sm text-gray-700"></p>
|
<livewire:components.pending-message :project="$project" type="mailings"></livewire:components.pending-message>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
|
<div class="mt-4 sm:mt-0 sm:flex sm:justify-between w-full">
|
||||||
<x-search></x-search>
|
<x-search></x-search>
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,7 @@
|
||||||
<div class="sm:flex sm:flex-col sm:items-center">
|
<div class="sm:flex sm:flex-col sm:items-center">
|
||||||
<div class="flex justify-between w-full my-4">
|
<div class="flex justify-between w-full my-4">
|
||||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Mosaics</h1>
|
<h1 class="text-base font-semibold leading-6 text-gray-900">Mosaics</h1>
|
||||||
@if ($project->hasPendingMosaic())
|
<livewire:components.pending-message :project="$project" type="mosaics"></livewire:components.pending-message>
|
||||||
<p class="text-base text-gray-700 animate-pulse">
|
|
||||||
Pending mosaics for this project: {{ $project->mosaics()->statusPending()->count() }}
|
|
||||||
</p>
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col md:flex-row mt-4 items-center md:justify-between w-full gap-2">
|
<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-search class="flex-1 w-full"></x-search>
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@
|
||||||
<div class="sm:flex sm:flex-col sm:items-center">
|
<div class="sm:flex sm:flex-col sm:items-center">
|
||||||
<div class="w-full flex justify-between my-4">
|
<div class="w-full flex justify-between my-4">
|
||||||
<h1 class="text-base font-semibold leading-6 text-gray-900">Reports</h1>
|
<h1 class="text-base font-semibold leading-6 text-gray-900">Reports</h1>
|
||||||
{{-- @if($project->hasPendingReport())--}}
|
|
||||||
{{-- <p class="text-base text-gray-700 animate-pulse"> Pending reports for this project: {{ $project->reports()->statusPending()->count() }}</p>--}}
|
|
||||||
<livewire:components.pending-message :project="$project" type="reports"></livewire:components.pending-message>
|
<livewire:components.pending-message :project="$project" type="reports"></livewire:components.pending-message>
|
||||||
{{-- @endif--}}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 md:mt-0 flex flex-col md:flex md:justify-between md:flex-row w-full gap-2">
|
<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-search></x-search>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue