Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Dec 29, 2024
1 parent 461085f commit 233f90a
Show file tree
Hide file tree
Showing 469 changed files with 491 additions and 32 deletions.
1 change: 1 addition & 0 deletions config/playground-matrix-resource.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
2 changes: 1 addition & 1 deletion resources/views/project/form-info.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@if ($parents->isEmpty())
<input type="hidden" name="parent_id" value="" />
@else
<x-playground::forms.column-select column="parent_id" key="label" label="Parent Project" :records="$parents"/>
<x-playground::forms.column-select column="parent_id" key="label" label="Parent Project" :records="$parents->toArray()"/>
@endif

@php $boards = Playground\Matrix\Models\Board::all() @endphp
Expand Down
1 change: 1 addition & 0 deletions routes/backlogs.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/boards.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/epics.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/flows.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/matrices.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/matrix.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/milestones.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/notes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/projects.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/releases.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/roadmaps.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/sources.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/sprints.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/tags.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/teams.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/tickets.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions routes/versions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
28 changes: 14 additions & 14 deletions src/Dashboard/AbstractDashboard.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down Expand Up @@ -33,8 +34,8 @@ class AbstractDashboard
public function getCount(string $key): int|null
{
if (empty($key)
|| !array_key_exists($key, $this->counts)
|| !is_int($this->counts[$key])
|| ! array_key_exists($key, $this->counts)
|| ! is_int($this->counts[$key])
) {
return null;
}
Expand All @@ -44,7 +45,7 @@ public function getCount(string $key): int|null

public function setCount(string $key, int|null $value): self
{
if (!empty($key) ) {
if (! empty($key) ) {
$this->counts[$key] = $value;
}

Expand All @@ -59,8 +60,8 @@ public function decrementCount(string $key, int $value = -1): self
$value
));
}
if (!empty($key) ) {
if (!array_key_exists($key, $this->counts)) {
if (! empty($key) ) {
if (! array_key_exists($key, $this->counts)) {
$this->counts[$key] = 0;
}
$this->counts[$key] -= $value;
Expand All @@ -77,8 +78,8 @@ public function incrementCount(string $key, int $value = 1): self
$value
));
}
if (!empty($key) ) {
if (!array_key_exists($key, $this->counts)) {
if (! empty($key) ) {
if (! array_key_exists($key, $this->counts)) {
$this->counts[$key] = 0;
}
$this->counts[$key] -= $value;
Expand All @@ -89,7 +90,7 @@ public function incrementCount(string $key, int $value = 1): self

public function setLabel(string $key, string $label): self
{
if (!empty($key) && !empty($label)) {
if (! empty($key) && ! empty($label)) {
$this->labels[$key] = $label;
}

Expand All @@ -98,19 +99,18 @@ public function setLabel(string $key, string $label): self

public function hasLinks(string $key): bool
{
return !empty($key)
return ! empty($key)
&& array_key_exists($key, $this->links)
&& !empty($this->links[$key])
;
&& ! empty($this->links[$key]);
}

/**
* @param array<string, mixed> $options
*/
public function addLink(string $key, array $options = []): self
{
if (!empty($key)) {
if (!array_key_exists($key, $this->links)) {
if (! empty($key)) {
if (! array_key_exists($key, $this->links)) {
$this->links[$key] = [];
}
$this->links[$key][] = new DashboardLink($options);
Expand All @@ -125,7 +125,7 @@ public function addLink(string $key, array $options = []): self
public function getLinks(string $key): array
{
if (empty($key)
|| !array_key_exists($key, $this->links)
|| ! array_key_exists($key, $this->links)
|| empty($this->links[$key])
) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion src/Dashboard/DashboardLink.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Dashboard;


/**
* \Playground\Matrix\DashboardLink
*/
Expand Down
6 changes: 1 addition & 5 deletions src/Dashboard/Index.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<?php

/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Dashboard;

use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\Collection;

use Playground\Matrix\Models;

/**
* \Playground\Matrix\Resource\Dashboard\Index
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/BacklogController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/BoardController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
8 changes: 3 additions & 5 deletions src/Http/Controllers/Concerns/Loading.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand All @@ -7,8 +8,6 @@
namespace Playground\Matrix\Resource\Http\Controllers\Concerns;

use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\Collection;
use Playground\Matrix\Models;
use Playground\Matrix\Resource\Dashboard\Index as IndexDashboard;

/**
Expand All @@ -19,8 +18,7 @@ trait Loading
public function loadMatrix(
Request $request,
string $route,
): IndexDashboard
{
): IndexDashboard {
$dashboard = new IndexDashboard;
$data = [];

Expand Down Expand Up @@ -87,7 +85,7 @@ public function loadMatrix(
$dashboard->setLabel($key, $key);
$dashboard->setCount($key, $data[$key]->count());

foreach($data[$key] as $model) {
foreach ($data[$key] as $model) {
$dashboard->addLink($key, [
'description' => $model->description,
'label' => $model->label ?: $model->title,
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/EpicController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/FlowController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Http/Controllers/IndexController.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

/**
* Playground
*/

declare(strict_types=1);
namespace Playground\Matrix\Resource\Http\Controllers;

use Illuminate\View\View;
use Illuminate\Http\Request;
use Illuminate\View\View;

/**
* \Playground\Matrix\Resource\Http\Controllers\IndexController
Expand All @@ -27,12 +28,13 @@ public function index(Request $request): View
// 'config' => config('playground-matrix-resource'),
// ]);

if (!empty(config('playground-matrix-resource.load.matrix'))) {
if (! empty(config('playground-matrix-resource.load.matrix'))) {
$data['dashboard'] = $this->loadMatrix(
$request,
'playground.matrix.resource',
);
}

return view('playground-matrix-resource::index/index', $data);
}
}
1 change: 1 addition & 0 deletions src/Http/Controllers/MatrixController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/MilestoneController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/NoteController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
5 changes: 3 additions & 2 deletions src/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down Expand Up @@ -466,12 +467,12 @@ public function update(

$user = $request->user();

$project->update($validated);

if ($user?->id) {
$project->modified_by_id = $user->id;
}

$project->update($validated);

if ($request->expectsJson()) {
return (new Resources\Project($project))->additional(['meta' => [
'info' => $this->packageInfo,
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/ReleaseController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/RoadmapController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/SourceController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/SprintController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Playground
*/
Expand Down
Loading

0 comments on commit 233f90a

Please sign in to comment.