Fix: detail data presisi#1077
Merged
Merged
Conversation
|
🔄 AI PR Review sedang antri di server...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Fix: Perbaikan filter lokasi dan chart Data Presisi
Description
Perbaikan komprehensif pada modul Data Presisi untuk memperbaiki 3 bug utama: (1) chart hanya menampilkan data berdasarkan pagination tabel, (2) filter desa menghasilkan total data tidak akurat, dan (3) statistik detail tidak sesuai. Solusi meliputi refactor chart untuk mengambil data via API terpisah dan konsistensi pengiriman parameter filter lokasi.
Depedency
Gunakan https://github.com/OpenSID/API-Database-Gabungan/pull/439
Changes made:
data_pokok/data_presisi/partials/chart.blade.phpuntuk menghilangkan duplikasi kode chart di semua moduldata_grafik) menjadi mengambil data via APIstatistikdengan parameter filter yang benarkode_kabupaten,kode_kecamatan, danconfig_desapada request AJAX DataTable di semua halamandata_grafikglobal dan duplikasi fungsigenerateChartData,tampilChartdari setiap chart bladeReason for change:
Impact of change:
✅ Chart Akurat: Chart sekarang mengambil data via API
statistiksecara terpisah dari tabel, menampilkan semua data yang difilter✅ Data Terfilter Benar: Total data, anggota RTM, dan statistik sesuai dengan data di SIDP
✅ Kode Terpusat: Shared partial
chart.blade.phpmenghilangkan duplikasi kode di 12+ file chart✅ Konsistensi: Semua modul (Data Presisi, Data Pokok, DTKS) menggunakan pola yang sama
✅ Filter Konsisten: Parameter lokasi dikirimkan baik di URL, DataTable request, maupun chart API call
Related Issue
Files Modified
Data Presisi - Chart & Index (Refactor chart + filter lokasi)
resources/views/data_pokok/data_presisi/adat/chart.blade.phpresources/views/data_pokok/data_presisi/adat/index.blade.phpresources/views/data_pokok/data_presisi/kesehatan/chart.blade.phpresources/views/data_pokok/data_presisi/kesehatan/detail_data.blade.phpresources/views/data_pokok/data_presisi/kesehatan/index.blade.phpresources/views/data_pokok/data_presisi/ketenagakerjaan/chart.blade.phpresources/views/data_pokok/data_presisi/ketenagakerjaan/detail_data.blade.phpresources/views/data_pokok/data_presisi/ketenagakerjaan/index.blade.phpresources/views/data_pokok/data_presisi/laporan/chart.blade.phpresources/views/data_pokok/data_presisi/laporan/index.blade.phpresources/views/data_pokok/data_presisi/pangan/chart.blade.phpresources/views/data_pokok/data_presisi/pangan/detail_data.blade.phpresources/views/data_pokok/data_presisi/pangan/index.blade.phpresources/views/data_pokok/data_presisi/pendidikan/chart.blade.phpresources/views/data_pokok/data_presisi/pendidikan/detail_data.blade.phpresources/views/data_pokok/data_presisi/pendidikan/index.blade.phpresources/views/data_pokok/data_presisi/seni_budaya/chart.blade.phpresources/views/data_pokok/data_presisi/seni_budaya/detail_data.blade.phpresources/views/data_pokok/data_presisi/seni_budaya/index.blade.phpData Presisi - Detail Data (Filter lokasi)
resources/views/data_pokok/data_presisi/aktivitas_keagamaan/detail_data.blade.phpresources/views/data_pokok/data_presisi/jaminan_sosial/detail_data.blade.phpresources/views/data_pokok/data_presisi/papan/detail_data.blade.phpresources/views/data_pokok/data_presisi/sandang/detail_data.blade.phpData Presisi - Laporan (Filter lokasi)
resources/views/data_pokok/data_presisi/laporan/perdesa.blade.phpData Pokok (Refactor chart + filter lokasi)
resources/views/data_pokok/agama/chart.blade.phpresources/views/data_pokok/agama/index.blade.phpresources/views/data_pokok/jaminan_sosial/chart.blade.phpresources/views/data_pokok/jaminan_sosial/index.blade.phpresources/views/data_pokok/kesehatan/chart.blade.phpresources/views/data_pokok/kesehatan/index.blade.phpresources/views/data_pokok/ketenagakerjaan/chart.blade.phpresources/views/data_pokok/ketenagakerjaan/index.blade.phpresources/views/data_pokok/pendidikan/chart.blade.phpresources/views/data_pokok/pendidikan/index.blade.phpDTKS (Refactor chart + filter lokasi)
resources/views/dtks/papan/chart.blade.phpresources/views/dtks/papan/index.blade.phpresources/views/dtks/sandang/chart.blade.phpresources/views/dtks/sandang/index.blade.phpNew File
resources/views/data_pokok/data_presisi/partials/chart.blade.php(shared chart utilities)Steps to Reproduce
Before fix (problem):
After fix (solution):
Testing on related features:
Checklist
Technical Details
Technical Explanation
1. Shared Chart Partial (
partials/chart.blade.php)Membuat partial terpusat yang berisi fungsi-fungsi chart yang sebelumnya diduplikasi di setiap modul:
@include('data_pokok.data_presisi.partials.chart')Fungsi yang disediakan:
tampilChart(type, canvasId, chartData)- Membuat chart baru dengan Chart.jsgenerateChartData(data, key)- Mengubah data array menjadi format chartrandColorRGB()- Generate warna random untuk chart2. Chart Mengambil Data via API
Sebelumnya: Chart dibuat dari data tabel yang sudah di-load (
data_grafik)Sesudahnya: Chart mengambil data sendiri via API
statistik3. Konsistensi Parameter Filter Lokasi
Sebelumnya: Parameter tidak dikirim di beberapa tempat
Sesudahnya: Parameter dikirim di URL, DataTable request, dan chart API
Configuration changes
Tidak ada perubahan konfigurasi.
Dependencies added
Tidak ada dependency baru. Menggunakan Chart.js yang sudah ada.
Testing
Manual Testing
Browser Compatibility
Screenshots / Video
Before:
After:
Breaking Changes
None
Migration Guide
Not required
References
Additional notes:
Tabel Ringkasan Perubahan per Modul:
data-presisi/adat/statistikdata-presisi/jaminan-sosial/statistikdata-presisi/kesehatan/statistikketenagakerjaan/statistikdata-presisi/laporan/statistikdata-presisi/pangan/statistikdata-presisi/papan/statistikpendidikan/statistikdata-presisi/seni-budaya/statistikCatatan Penting:
statistikdi backend sudah mendukung parameterkategori,kode_kabupaten,kode_kecamatan,config_desachart.blade.phpmenggunakan fungsiapiProxyGetyang harus tersedia di layout