diff --git a/app/Domain/Goalcanvas/Hxcontrollers/GoalcanvasCard.php b/app/Domain/Goalcanvas/Hxcontrollers/Canvas.php similarity index 67% rename from app/Domain/Goalcanvas/Hxcontrollers/GoalcanvasCard.php rename to app/Domain/Goalcanvas/Hxcontrollers/Canvas.php index d8dd7584d..eab525e53 100644 --- a/app/Domain/Goalcanvas/Hxcontrollers/GoalcanvasCard.php +++ b/app/Domain/Goalcanvas/Hxcontrollers/Canvas.php @@ -3,22 +3,22 @@ namespace Leantime\Domain\Goalcanvas\Hxcontrollers; use Leantime\Core\Controller\HtmxController; -use Leantime\Domain\Goalcanvas\Services\Goalcanvas; +use Leantime\Domain\Goalcanvas\Services\Goalcanvas as GoalcanvasService; use Leantime\Domain\Projects\Services\Projects; -class GoalcanvasCard extends HtmxController +class Canvas extends HtmxController { - protected static string $view = 'goalcanvas::partials.goalCanvasCard'; + protected static string $view = 'goalcanvas::components.canvas'; - private Goalcanvas $goalService; + private GoalcanvasService $goalService; private Projects $projectService; /** * Controller constructor * */ - public function init(Goalcanvas $goalService, Projects $projectService): void + public function init(GoalcanvasService $goalService, Projects $projectService): void { $this->goalService = $goalService; $this->projectService = $projectService; @@ -34,9 +34,12 @@ public function get($params): void $statusLabels = $this->goalService->getGoalStatusLabels(); $relatesLabels = $this->goalService->getGoalRelatesLabels(); $users = $this->projectService->getUsersAssignedToProject(session('currentProject')); + $canvasItems = $this->goalService->getCanvasItemsById($id); + $this->tpl->assign('canvas', $canvas); $this->tpl->assign('statusLabels', $statusLabels); $this->tpl->assign('relatesLabels', $relatesLabels); $this->tpl->assign('users', $users); + $this->tpl->assign('goalItems', $canvasItems); } } diff --git a/app/Domain/Goalcanvas/Templates/components/canvas.blade.php b/app/Domain/Goalcanvas/Templates/components/canvas.blade.php new file mode 100644 index 000000000..a6e18091b --- /dev/null +++ b/app/Domain/Goalcanvas/Templates/components/canvas.blade.php @@ -0,0 +1,56 @@ + +@props([ + 'canvasId' => '', + 'canvasTitle' => '', + 'goalItems' => [], + 'statusLabels' => [], + 'relatesLabels' => [], + 'users' => [], + 'id' => '', +]) + +@if (empty($id) == false) +
+ + loading... + +
+@else +
+
+ + Create New Goal + +
+ + {{ $canvasTitle }} + +
+
+
+ +
+
+
+
+
+ @if (count($goalItems) == 0) +
No goals on this board yet. Open the board to + start adding goals
+ @endif + + @foreach ($goalItems as $goal) + + @endforeach +
+
+
+
+
+
+@endif diff --git a/app/Domain/Goalcanvas/Templates/components/goal-card.blade.php b/app/Domain/Goalcanvas/Templates/components/goal-card.blade.php deleted file mode 100644 index cdc746bb4..000000000 --- a/app/Domain/Goalcanvas/Templates/components/goal-card.blade.php +++ /dev/null @@ -1,68 +0,0 @@ - -@props([ - 'canvasId' => '', - 'canvasTitle' => '', - 'goalItems' => [], - 'statusLabels' => [], - 'relatesLabels' => [], - 'users' => [], - 'id' => '', - ]) - - -@if(!empty($id)) -
- - loading... - {{-- - - --}} -
-@else - -
- -
- -
-
-
-
-
- @if (count($goalItems) == 0) -
No goals on this board yet. Open the board to - start adding goals
- @endif - - @foreach ($goalItems as $goal) - - @endforeach -
-
-
-
-
-
-
-@endif \ No newline at end of file diff --git a/app/Domain/Goalcanvas/Templates/dashboard.blade.php b/app/Domain/Goalcanvas/Templates/dashboard.blade.php index bbae04d7f..e575fbb79 100644 --- a/app/Domain/Goalcanvas/Templates/dashboard.blade.php +++ b/app/Domain/Goalcanvas/Templates/dashboard.blade.php @@ -105,14 +105,14 @@ class="sr-only">{{ sprintf(__('text.percent_complete'), round($goalStats['avgPer @if (count($allCanvas) > 0) @foreach ($allCanvas as $canvasRow) - @php + {{-- @php $canvasItems = $canvasSvc->getCanvasItemsById($canvasRow['id']); - @endphp + @endphp --}} - dispatchFilter('notificationFilter', $notification); + + $notification = self::dispatchFilter('notificationFilter', $notification); //Email $users = $this->getUsersToNotify($notification->projectId); @@ -330,7 +330,7 @@ public function notifyProjectUsers(Notification $notification): void ); } - $eventCore->dispatchEvent('notifyProjectUsers', ['type' => 'projectUpdate', 'module' => $notification->module, 'moduleId' => $entityId, 'message' => $notification->message, 'subject' => $notification->subject, 'users' => $this->getAllUserInfoToNotify($notification->projectId), 'url' => $notification->url['url']], 'domain.services.projects'); + self::dispatchEvent('notifyProjectUsers', ['type' => 'projectUpdate', 'module' => $notification->module, 'moduleId' => $entityId, 'message' => $notification->message, 'subject' => $notification->subject, 'users' => $this->getAllUserInfoToNotify($notification->projectId), 'url' => $notification->url['url']], 'domain.services.projects'); } /**