From b71baad3e7d60b0badc76dc445621b435ff3b812 Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Tue, 25 Nov 2025 16:53:41 +0700 Subject: [PATCH 1/4] Penambahan statistik pengisian papan --- app/Enums/Modul.php | 6 + .../Controllers/StatistikPapanController.php | 14 + .../views/presisi/statistik/papan.blade.php | 464 ++++++++++++++++++ routes/web.php | 1 + 4 files changed, 485 insertions(+) create mode 100644 app/Http/Controllers/StatistikPapanController.php create mode 100644 resources/views/presisi/statistik/papan.blade.php diff --git a/app/Enums/Modul.php b/app/Enums/Modul.php index ccf0afb6..d0cad0ba 100644 --- a/app/Enums/Modul.php +++ b/app/Enums/Modul.php @@ -123,6 +123,12 @@ final class Modul extends Enum 'text' => 'Sandang', 'url' => 'data-presisi/statistik/sandang', 'permission' => 'statistik-datapresisi-sandang', + ], + [ + 'icon' => 'far fa-fw fa-circle', + 'text' => 'Papan', + 'url' => 'data-presisi/statistik/papan', + 'permission' => 'statistik-datapresisi-papan', ] ] ], diff --git a/app/Http/Controllers/StatistikPapanController.php b/app/Http/Controllers/StatistikPapanController.php new file mode 100644 index 00000000..cab69a9f --- /dev/null +++ b/app/Http/Controllers/StatistikPapanController.php @@ -0,0 +1,14 @@ + url(''), + 'judul' => 'Papan' + ]); + } +} diff --git a/resources/views/presisi/statistik/papan.blade.php b/resources/views/presisi/statistik/papan.blade.php new file mode 100644 index 00000000..d4a45cf9 --- /dev/null +++ b/resources/views/presisi/statistik/papan.blade.php @@ -0,0 +1,464 @@ +@extends('layouts.index') + +@section('plugins.chart', true) + +@section('title', 'Data Statistik') + +@section('content_header') +

Data Statistik {{ $judul }}

+@stop + +@section('content') + @include('partials.breadcrumbs') +
+
+
+
+

Statistik {{ $judul }}

+
+ +
+
+
+ +
+
+
+
+
+
+
+

+
+
+
+ + + +
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+ + + + + + + + + +
NoNilaiJumlah
+
+
+
+
+
+@endsection + +@section('js') + + @include('statistik.chart') + +@endsection +@push('css') + +@endpush diff --git a/routes/web.php b/routes/web.php index 845180f9..28a09ab0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -314,6 +314,7 @@ Route::prefix('statistik')->group(function () { Route::get('sandang', [App\Http\Controllers\StatistikSandangController::class, 'index']); + Route::get('papan', [App\Http\Controllers\StatistikPapanController::class, 'index']); }); }); From 35ac54ef0b62ee1331b52765521748b96558bab1 Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Wed, 26 Nov 2025 07:56:16 +0700 Subject: [PATCH 2/4] perbaiki test --- tests/Feature/DataPresisiLaporanTest.php | 149 ++++------------------- 1 file changed, 27 insertions(+), 122 deletions(-) diff --git a/tests/Feature/DataPresisiLaporanTest.php b/tests/Feature/DataPresisiLaporanTest.php index ca59b343..33d4fe4e 100644 --- a/tests/Feature/DataPresisiLaporanTest.php +++ b/tests/Feature/DataPresisiLaporanTest.php @@ -13,7 +13,7 @@ public function test_can_access_laporan_semua_desa_page() $response->assertStatus(200); $response->assertViewIs('data_pokok.data_presisi.laporan.index'); - $response->assertViewHas('title', 'Data Presisi Laporan Semua Desa'); + $response->assertViewHas('title', 'Data Presisi Pengisian Laporan Semua Desa'); } /** @test */ @@ -55,7 +55,8 @@ public function test_laporan_semua_desa_has_correct_table_columns() 'Jaminan Sosial', 'Adat', 'Ketenagakerjaan', - 'Jumlah Penduduk' + 'Jumlah Penduduk', + 'Jumlah Rumah Tangga' ]; foreach ($expectedColumns as $column) { @@ -98,20 +99,7 @@ public function test_can_access_laporan_perdesa_page() $response->assertStatus(200); $response->assertViewIs('data_pokok.data_presisi.laporan.perdesa'); - $response->assertViewHas('title', 'Data Presisi Laporan Per Desa'); - } - - /** @test */ - public function test_laporan_perdesa_has_required_filter_elements() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test all filter elements exist - $this->assertStringContainsString('id="filter_kabupaten"', $content); - $this->assertStringContainsString('id="filter_kecamatan"', $content); - $this->assertStringContainsString('id="filter_desa"', $content); + $response->assertViewHas('title', 'Data Presisi Pengisian Laporan Per Desa'); } /** @test */ @@ -136,71 +124,7 @@ public function test_laporan_perdesa_has_correct_table_columns() } /** @test */ - public function test_laporan_perdesa_has_select2_initialization() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test Select2 initialization for all filters - $this->assertStringContainsString("$('#filter_kabupaten').select2(", $content); - $this->assertStringContainsString("$('#filter_kecamatan').select2(", $content); - $this->assertStringContainsString("$('#filter_desa').select2(", $content); - } - - /** @test */ - public function test_laporan_perdesa_has_cascading_filter_logic() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test kabupaten change event - $this->assertStringContainsString("$('#filter_kabupaten').on('change'", $content); - - // Test kecamatan change event - $this->assertStringContainsString("$('#filter_kecamatan').on('change'", $content); - - // Test desa change event with reload - $this->assertStringContainsString("$('#filter_desa').on('change'", $content); - $this->assertStringContainsString('laporanTable.ajax.reload()', $content); - } - - /** @test */ - public function test_laporan_perdesa_loads_kabupaten_from_api() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test API call to get kabupaten list - $this->assertStringContainsString('/api/v1/statistik-web/get-list-kabupaten', $content); - } - - /** @test */ - public function test_laporan_perdesa_loads_kecamatan_from_api() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test API call to get kecamatan list - $this->assertStringContainsString('/api/v1/statistik-web/get-list-kecamatan', $content); - } - - /** @test */ - public function test_laporan_perdesa_loads_desa_from_api() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test API call to get desa list - $this->assertStringContainsString('/api/v1/statistik-web/get-list-desa', $content); - } - - /** @test */ - public function test_laporan_perdesa_has_datatable_with_filters() + public function test_laporan_perdesa_has_datatable_configuration() { $response = $this->get(route('laporan.data-presisi.perdesa')); @@ -212,52 +136,11 @@ public function test_laporan_perdesa_has_datatable_with_filters() $this->assertStringContainsString('searching: false', $content); // Test filter parameters in DataTable - $this->assertStringContainsString('"filter[config_id]"', $content); $this->assertStringContainsString('"kode_kabupaten"', $content); $this->assertStringContainsString('"kode_kecamatan"', $content); $this->assertStringContainsString('"config_desa"', $content); } - /** @test */ - public function test_laporan_perdesa_has_default_session_values() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test that session default values are being set (even if empty) - // Check that variables exist in JavaScript code - $this->assertStringContainsString('defaultKabupaten', $content); - $this->assertStringContainsString('defaultKecamatan', $content); - $this->assertStringContainsString('defaultDesa', $content); - } - - /** @test */ - public function test_laporan_perdesa_has_prevent_reload_flag() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test preventReload flag to avoid cascading reloads - $this->assertStringContainsString('preventReload', $content); - $this->assertStringContainsString('preventReload = true', $content); - $this->assertStringContainsString('preventReload = false', $content); - $this->assertStringContainsString('if (!preventReload', $content); - } - - /** @test */ - public function test_laporan_perdesa_disables_child_filters_initially() - { - $response = $this->get(route('laporan.data-presisi.perdesa')); - - $content = $response->getContent(); - - // Test that child filters are disabled until parent is selected - $this->assertStringContainsString("$('#filter_kecamatan').prop('disabled', true)", $content); - $this->assertStringContainsString("$('#filter_desa').prop('disabled', true)", $content); - } - /** @test */ public function test_laporan_perdesa_number_formatting_for_columns() { @@ -310,4 +193,26 @@ public function test_both_pages_extend_correct_layout() $content2 = $response2->getContent(); $this->assertStringContainsString('class="main-footer"', $content2); } + + /** @test */ + public function test_laporan_semua_desa_has_export_buttons() + { + $response = $this->get(route('laporan.data-presisi.index')); + $content = $response->getContent(); + + // Test export buttons exist + $this->assertStringContainsString('id="cetak"', $content); + $this->assertStringContainsString('id="export-excel"', $content); + } + + /** @test */ + public function test_laporan_perdesa_has_export_buttons() + { + $response = $this->get(route('laporan.data-presisi.perdesa')); + $content = $response->getContent(); + + // Test export buttons exist + $this->assertStringContainsString('id="cetak"', $content); + $this->assertStringContainsString('id="export-excel"', $content); + } } From 647e4a71869530144b12d7d2509031a3bc50ae45 Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Wed, 26 Nov 2025 16:51:42 +0700 Subject: [PATCH 3/4] Penambahan statistik pengisian Seni Budaya --- app/Enums/Modul.php | 6 + .../StatistikSenibudayaController.php | 14 + .../2025_11_25_160801_update_menu_admin.php | 27 + .../presisi/statistik/senibudaya.blade.php | 464 ++++++++++++++++++ routes/web.php | 1 + 5 files changed, 512 insertions(+) create mode 100644 app/Http/Controllers/StatistikSenibudayaController.php create mode 100644 database/migrations/2025_11_25_160801_update_menu_admin.php create mode 100644 resources/views/presisi/statistik/senibudaya.blade.php diff --git a/app/Enums/Modul.php b/app/Enums/Modul.php index 4cc98447..a454550c 100644 --- a/app/Enums/Modul.php +++ b/app/Enums/Modul.php @@ -129,6 +129,12 @@ final class Modul extends Enum 'text' => 'Papan', 'url' => 'data-presisi/statistik/papan', 'permission' => 'statistik-datapresisi-papan', + ], + [ + 'icon' => 'far fa-fw fa-circle', + 'text' => 'Seni Budaya', + 'url' => 'data-presisi/statistik/senibudaya', + 'permission' => 'statistik-datapresisi-senibudaya', ] ] ], diff --git a/app/Http/Controllers/StatistikSenibudayaController.php b/app/Http/Controllers/StatistikSenibudayaController.php new file mode 100644 index 00000000..1235024d --- /dev/null +++ b/app/Http/Controllers/StatistikSenibudayaController.php @@ -0,0 +1,14 @@ + url(''), + 'judul' => 'seni budaya' + ]); + } +} diff --git a/database/migrations/2025_11_25_160801_update_menu_admin.php b/database/migrations/2025_11_25_160801_update_menu_admin.php new file mode 100644 index 00000000..389df806 --- /dev/null +++ b/database/migrations/2025_11_25_160801_update_menu_admin.php @@ -0,0 +1,27 @@ +Data Statistik {{ $judul }} +@stop + +@section('content') + @include('partials.breadcrumbs') +
+
+
+
+

Statistik {{ $judul }}

+
+ +
+
+
+ +
+
+
+
+
+
+
+

+
+
+
+ + + +
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+ + + + + + + + + +
NoNilaiJumlah
+
+
+
+
+
+@endsection + +@section('js') + + @include('statistik.chart') + +@endsection +@push('css') + +@endpush diff --git a/routes/web.php b/routes/web.php index f990e8cd..b3e5acb3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -323,6 +323,7 @@ Route::prefix('statistik')->group(function () { Route::get('sandang', [App\Http\Controllers\StatistikSandangController::class, 'index']); Route::get('papan', [App\Http\Controllers\StatistikPapanController::class, 'index']); + Route::get('senibudaya', [App\Http\Controllers\StatistikSenibudayaController::class, 'index']); }); }); From 2f002d50d1ec47e154f039df2389cd1e82929b4a Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Wed, 26 Nov 2025 16:56:05 +0700 Subject: [PATCH 4/4] perbaiki judul --- resources/views/presisi/statistik/senibudaya.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/presisi/statistik/senibudaya.blade.php b/resources/views/presisi/statistik/senibudaya.blade.php index 6fde85d1..50e0e0f5 100644 --- a/resources/views/presisi/statistik/senibudaya.blade.php +++ b/resources/views/presisi/statistik/senibudaya.blade.php @@ -5,7 +5,7 @@ @section('title', 'Data Statistik') @section('content_header') -

Data Statistik {{ $judul }}

+

Data Statistik Seni Budaya

@stop @section('content')