Skip to content

Commit

Permalink
feat: quick fix collect tasks in temp array
Browse files Browse the repository at this point in the history
  • Loading branch information
stevan06v committed Oct 2, 2024
1 parent 74647ba commit abdf121
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions resources/views/livewire/monitors/card.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function placeholder()

<div class="w-full p-5 items-center rounded-xl">
<div class="flex items-center justify-between mb-5">

<a class="text-secondary-grey text-lg font-sourceSansPro font-bold rounded-md border-2 border-other-grey px-6 py-3" href="/monitors/{{ $monitor->id }}" title="Show Monitor">
{{ strtoupper($monitor->type == 'USER' ? $monitor->login_name : $monitor->organization_name) }} / {{ strtoupper($monitor->title) }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
new class extends Component {
public Monitor $monitor;
public function mount(Monitor $monitor)
{
$this->monitor = $monitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
public Monitor $monitor;
public $dataFetched = false;
public $tasks = [];
public function mount(Monitor $monitor)
{
Expand Down Expand Up @@ -47,15 +49,14 @@ protected function calculate_statistics(): void
$allMilestonesEmpty = true;
foreach ($this->monitor->repositories as $repository) {
foreach ($repository->milestones as $milestone) {
if (!$milestone->tasks()->get()->isEmpty()) {
$allMilestonesEmpty = false;
break 2;
}
}
$repositoryTasks = $repository->milestones->flatMap(function ($milestone) {
return $milestone->tasks;
});
$this->tasks = array_merge($this->tasks, $repositoryTasks->all());
}
if ($allMilestonesEmpty) {
if (empty($this->tasks)) {
$this->reload_issues();
}
Expand Down
2 changes: 2 additions & 0 deletions resources/views/livewire/monitors/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public function updatedSearch()

<div class="mt-4 mx-8">



<sl-input wire:ignore wire:model.live="search" class="w-max" placeholder="Search for a monitor...">
<sl-icon name="search" slot="prefix"></sl-icon>
</sl-input>
Expand Down
3 changes: 3 additions & 0 deletions resources/views/livewire/monitors/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public function mount(Monitor $monitor)

<div>
<div class="mx-8 mt-6">
<a href="/monitors" title="Show Monitor" class="flex items-center mb-2">
<sl-icon class="cursor-pointer text-primary-blue text-4xl rounded-md border-2 p-2 border-other-grey" name="arrow-left-short" wire:ignore></sl-icon>
</a>
<div class="border-other-grey border-2 rounded-2xl">
<livewire:monitors.card lazy="true" :monitor="$monitor"/>
</div>
Expand Down

0 comments on commit abdf121

Please sign in to comment.