From 9aa3d32b6e3c11b15a51f077c3c1fc0de463fbde Mon Sep 17 00:00:00 2001 From: arifal Date: Thu, 15 May 2025 14:18:27 +0700 Subject: [PATCH] add link in potential dashboard --- .../Dashboards/PotentialsController.php | 4 +- .../js/dashboards/potentials/inside_system.js | 7 +++ .../views/components/custom-circle.blade.php | 16 +----- .../potentials/inside_system.blade.php | 50 ++++++++++++++----- .../potentials/outside_system.blade.php | 6 ++- 5 files changed, 53 insertions(+), 30 deletions(-) diff --git a/app/Http/Controllers/Dashboards/PotentialsController.php b/app/Http/Controllers/Dashboards/PotentialsController.php index 4841f0e..1ce8e2c 100644 --- a/app/Http/Controllers/Dashboards/PotentialsController.php +++ b/app/Http/Controllers/Dashboards/PotentialsController.php @@ -3,12 +3,14 @@ namespace App\Http\Controllers\Dashboards; use App\Http\Controllers\Controller; +use App\Models\Menu; use Illuminate\Http\Request; class PotentialsController extends Controller { public function inside_system(){ - return view('dashboards.potentials.inside_system'); + $menus = Menu::all(); + return view('dashboards.potentials.inside_system', compact('menus')); } public function outside_system(){ return view('dashboards.potentials.outside_system'); diff --git a/resources/js/dashboards/potentials/inside_system.js b/resources/js/dashboards/potentials/inside_system.js index 02576d6..4ef19f2 100644 --- a/resources/js/dashboards/potentials/inside_system.js +++ b/resources/js/dashboards/potentials/inside_system.js @@ -168,6 +168,13 @@ document.addEventListener("DOMContentLoaded", async function (e) { await new DashboardPotentialInsideSystem().init(); }); +function handleCircleClick(element) { + const url = element.getAttribute("data-url") || "#"; + if (url !== "#") { + window.location.href = url; + } +} + function resizeDashboard() { let targetElement = document.getElementById("lack-of-potential-wrapper"); let dashboardElement = document.getElementById( diff --git a/resources/views/components/custom-circle.blade.php b/resources/views/components/custom-circle.blade.php index 70d35ab..afe42fc 100644 --- a/resources/views/components/custom-circle.blade.php +++ b/resources/views/components/custom-circle.blade.php @@ -1,11 +1,11 @@ @props(['title' => 'title component', 'visible_data' => false, 'data_count' => '', 'visible_data_type' => false, -'data_type' => '','style' => '', 'size' => '', 'line' => [], 'data_id' => '']) +'data_type' => '','style' => '', 'size' => '', 'data_id' => '', 'document_url' => '#']) @section('css') @vite(['resources/scss/components/_custom_circle.scss']) @endsection -
+

{{ $title }}

@if ($visible_data === "true") @@ -14,17 +14,5 @@ @if ($visible_data_type === "true")
{{ $data_type }}
@endif - @if (!empty($lines)) - - @foreach ($lines as $line) - - @endforeach - - @endif
\ No newline at end of file diff --git a/resources/views/dashboards/potentials/inside_system.blade.php b/resources/views/dashboards/potentials/inside_system.blade.php index abd53e5..c82a2da 100644 --- a/resources/views/dashboards/potentials/inside_system.blade.php +++ b/resources/views/dashboards/potentials/inside_system.blade.php @@ -21,11 +21,20 @@
- +
- +
- +
@@ -33,30 +42,39 @@
- - - + +
-
+
- +
-
+
- + - +
@@ -75,7 +93,10 @@ 'style' => 'margin-left:180px;top:-20px;' ]) @endcomponent - +
@@ -102,7 +123,10 @@
- +
diff --git a/resources/views/dashboards/potentials/outside_system.blade.php b/resources/views/dashboards/potentials/outside_system.blade.php index 9e392b9..e3c293b 100644 --- a/resources/views/dashboards/potentials/outside_system.blade.php +++ b/resources/views/dashboards/potentials/outside_system.blade.php @@ -27,7 +27,8 @@ 'document_type' => 'Berkas', 'document_id' => 'outside-system-non-business', 'visible_small_circle' => true, - 'style' => 'top:10px;' + 'style' => 'top:10px;', + 'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'non-business']) ]) @endcomponent
@@ -37,7 +38,8 @@ 'document_type' => 'Berkas', 'document_id' => 'outside-system-business', 'visible_small_circle' => true, - 'style' => 'top:300px;' + 'style' => 'top:300px;', + 'document_url' => route('pbg-task.index', ['menu_id' => 13, 'filter' => 'business']) ]) @endcomponent