some more work

This commit is contained in:
Martin Folkerts 2024-07-09 15:47:53 +02:00
parent f9c5b9d181
commit 3ea7eec68e
7 changed files with 81 additions and 77 deletions

View file

@ -22,6 +22,7 @@ class ProjectInterpolateGrowthModelJob implements ShouldQueue
public function __construct(Project $project)
{
logger(__CLASS__ . __METHOD__);
$this->project = $project;
}

View file

@ -14,7 +14,6 @@ class ReportRow extends Component
// 'Badge:refresh' => '$refresh',
];
#[Reactive]
public ProjectReport $report;
public MailingForm $mailingForm;

View file

@ -308,13 +308,14 @@ public function scheduleReport(?Carbon $endDate = null, ?int $offset = null)
$endDate ??= Carbon::yesterday();
$offset ??= 7;
logger('Scheduling report for '.$endDate->format('d-m-Y').' with offset '.$offset.' days');
Bus::chain([
Bus::batch($this->getFileDownloadsFor($endDate, $offset)),
Bus::batch($this->getMosaicsFor($endDate, $offset)),
Bus::batch($this->getFileDownloadsFor($endDate->clone(), $offset)),
Bus::batch($this->getMosaicsFor($endDate->clone(), $offset)),
Bus::batch(
[
new ProjectInterpolateGrowthModelJob($this),
$this->getReportFor($endDate, $offset, true)
$this->getReportFor($endDate->clone(), $offset, true)
]),
])
->dispatch();

View file

@ -1,7 +1,6 @@
<span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium"
@if($this->type)
x-init="Echo.private(`{{$this->type}}.{{$this->id}}`).listen('Project{{ucfirst($this->type)}}Status', (e) => {
console.log(e);
if(e.project{{ucfirst($this->type)}}.status){
$wire.setStatus(e.project{{ucfirst($this->type)}}.status);
$wire.refreshPendingMessage();

View file

@ -5,9 +5,11 @@
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 lg:pl-8">{{ $report->name }}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<livewire:components.badge :status="$report->status" :id="$report->id" :type="'report'" wire:key="{{$report->id}}"></livewire:components.badge>
<livewire:components.badge :status="$report->status" :id="$report->id" :type="'report'"
wire:key="{{$report->id}}"></livewire:components.badge>
</td>
<td class="py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 lg:pr-8 flex justify-end">
<x-menu>
<x-menu.button>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
@ -18,45 +20,46 @@
</x-menu.button>
<x-menu.items>
<x-menu.close>
<x-menu.item wire:click="download">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round"
d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"/>
</svg>
@if($report->status == \App\Enums\Status::Success->value)
<x-menu.close>
<x-menu.item wire:click="download">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round"
d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"/>
</svg>
Download
</x-menu.item>
</x-menu.close>
Download
</x-menu.item>
</x-menu.close>
<x-dialog>
<x-dialog.open>
<x-menu.close>
<x-menu.item>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round"
d="M9 3.75H6.912a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H15M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859M12 3v8.25m0 0-3-3m3 3 3-3"/>
</svg>
<x-dialog>
<x-dialog.open>
<x-menu.close>
<x-menu.item>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round"
d="M9 3.75H6.912a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H15M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859M12 3v8.25m0 0-3-3m3 3 3-3"/>
</svg>
Create Mail
</x-menu.item>
</x-menu.close>
</x-dialog.open>
Create Mail
</x-menu.item>
</x-menu.close>
</x-dialog.open>
<x-dialog.panel wire:model="createMailingModal">
<form wire:submit="createMailing" class="flex flex-col gap-4">
<h2 class="text-3xl font-bold mb-1">@lang('Create report email')</h2>
<x-dialog.panel wire:model="createMailingModal">
<form wire:submit="createMailing" class="flex flex-col gap-4">
<h2 class="text-3xl font-bold mb-1">@lang('Create report email')</h2>
<hr class="w-[75%]">
<hr class="w-[75%]">
<label class="flex flex-col gap-2">
@lang('Recipients')
@foreach($mailingForm->recipients as $recipient)
<span
class="inline-flex items-center gap-x-1.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600">
<label class="flex flex-col gap-2">
@lang('Recipients')
@foreach($mailingForm->recipients as $recipient)
<span
class="inline-flex items-center gap-x-1.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round"
@ -66,30 +69,30 @@ class="w-4 h-4">
[{{ $recipient['name'] }}] {{ $recipient['email'] }}
</span>
@endforeach
@endforeach
</label>
</label>
<label class="flex flex-col gap-2">
@lang('Subject')
<input autofocus wire:model="mailingForm.subject"
class="px-3 py-2 border font-normal rounded-lg border-slate-300 read-only:opacity-50 read-only:cursor-not-allowed">
@error('mailingForm.subject')
<div class="text-sm text-red-500 font-normal">{{ $message }}</div>@enderror
</label>
<label class="flex flex-col gap-2">
@lang('Subject')
<input autofocus wire:model="mailingForm.subject"
class="px-3 py-2 border font-normal rounded-lg border-slate-300 read-only:opacity-50 read-only:cursor-not-allowed">
@error('mailingForm.subject')
<div class="text-sm text-red-500 font-normal">{{ $message }}</div>@enderror
</label>
<label class="flex flex-col gap-2">
@lang('Content')
<textarea wire:model="mailingForm.message" rows="5"
class="px-3 py-2 border font-normal rounded-lg border-slate-300 read-only:opacity-50 read-only:cursor-not-allowed"></textarea>
@error('mailingForm.message')
<div class="text-sm text-red-500 font-normal">{{ $message }}</div>@enderror
</label>
<label class="flex flex-col gap-2">
@lang('Content')
<textarea wire:model="mailingForm.message" rows="5"
class="px-3 py-2 border font-normal rounded-lg border-slate-300 read-only:opacity-50 read-only:cursor-not-allowed"></textarea>
@error('mailingForm.message')
<div class="text-sm text-red-500 font-normal">{{ $message }}</div>@enderror
</label>
<label class="flex flex-col gap-2">
@lang('Report')
<span
class="inline-flex items-center gap-x-1.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600">
<label class="flex flex-col gap-2">
@lang('Report')
<span
class="inline-flex items-center gap-x-1.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round"
@ -99,26 +102,26 @@ class="w-4 h-4">
{{ $report->name }}
</span>
</label>
</label>
<x-dialog.footer>
<x-dialog.close>
<button type="button"
class="text-center rounded-xl bg-slate-300 text-slate-800 px-6 py-2 font-semibold">
Cancel
</button>
</x-dialog.close>
<x-dialog.close>
<button type="submit"
class="text-center rounded-xl bg-blue-500 text-white px-6 py-2 font-semibold disabled:cursor-not-allowed disabled:opacity-50">
Save
</button>
<x-dialog.footer>
<x-dialog.close>
<button type="button"
class="text-center rounded-xl bg-slate-300 text-slate-800 px-6 py-2 font-semibold">
Cancel
</button>
</x-dialog.close>
</x-dialog.footer>
</form>
</x-dialog.panel>
</x-dialog>
<x-dialog.close>
<button type="submit"
class="text-center rounded-xl bg-blue-500 text-white px-6 py-2 font-semibold disabled:cursor-not-allowed disabled:opacity-50">
Save
</button>
</x-dialog.close>
</x-dialog.footer>
</form>
</x-dialog.panel>
</x-dialog>
@endif
<x-dialog>
<x-dialog.open>
<x-menu.item>

Binary file not shown.

View file

@ -197,6 +197,7 @@ pivot_stats <- extracted_values %>%
combined_CI_data <- readRDS(here(cumulative_CI_vals_dir,"combined_CI_data.rds")) #%>% drop_na(pivot_quadrant)
head(combined_CI_data)
pivot_stats2 <- bind_rows(pivot_stats, combined_CI_data)
# pivot_stats2 <- combined_CI_data
print("All CI values extracted from latest image.")