Fix: perbaiki struktur organisasi#1640
Open
pandigresik wants to merge 4 commits into
Open
Conversation
Contributor
|
🔄 AI PR Review sedang antri di server...
|
Contributor
|
Cek pada bagian resources/views/data/pengurus/form.blade.php menghapus field bagan_tingkat, tapi script bawah masih menjalankan: |
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 Struktur Organisasi - Ganti Highcharts dengan OrgChart dan Hitung Level Bagan Otomatis
Description
Mengganti library Highcharts Organization Chart dengan jQuery OrgChart untuk render struktur organisasi. Struktur data diubah dari flat (data + nodes) menjadi nested tree, sehingga level bagan tidak perlu dihitung manual (
bagan_tingkat) tapi otomatis berdasarkan kedalaman relasi atasan-anak.Changes made:
Refactor (BaganTrait.php): Mengubah query dari flat data + nodes menjadi nested tree structure. Setiap node memiliki
children[]berdasarkan relasiatasan. Menghapus fieldbagan_tingkatdari query. Menambahkan methodcleanNode()untuk menghapus keyatasandari output.Feature (bagan.blade.php): Mengganti Highcharts dengan jQuery OrgChart. Menambahkan
createNodecallback untuk render foto, jabatan, dan nama per node. Border node mengikutibagan_warna. Menambahkan tombol "Download Gambar" menggunakan html2canvas.Feature (struktur-organisasi.blade.php): Perubahan sama seperti bagan.blade.php - migrasi ke OrgChart dengan fitur download.
Feature (asset_orgchart.blade.php): File baru - partial untuk load CSS/JS OrgChart, orgchart CSS, dan html2canvas (lokal).
Feature (bagan.css): Menambahkan custom styles untuk OrgChart: node card, foto, jabatan, nama, garis koneksi, responsive, dan hiding root wrapper node.
Cleanup (form.blade.php): Menghapus field
bagan_tingkatdari form edit pengurus karena level sudah otomatis.Asset (html2canvas.min.js): Menambahkan html2canvas v1.4.1 secara lokal di
bower_components/html2canvas/untuk download gambar.Asset (orgchart): Menambahkan jQuery OrgChart library (CSS + JS) di
bower_components/orgchart/.Reason for change:
dataarray untuk edge +nodesarray untuk node) yang membuat perhitungan level (bagan_tingkat) harus dilakukan manual di form. OrgChart mendukung nested tree langsung.bagan_tingkatlagi.Impact of change:
bagan_tingkatdihapus)bagan_warnamasing-masingRelated Issue
Steps to Reproduce
Before fix (problem):
bagan_tingkat)bagan_tingkatsalah, posisi node di bagan berantakanAfter fix (solution):
Testing on related features:
bagan_tingkatdihapus) ✅Checklist
Technical Details
Technical Explanation
BaganTrait.php - Query diubah dari flat ke nested:
JavaScript - OrgChart dengan nested data:
Configuration changes
bagan_tingkattidak digunakan lagi (dihapus dari form)bagan_warnatetap digunakan untuk warna border nodeDependencies added
bower_components/orgchart/(CSS + JS)bower_components/html2canvas/html2canvas.min.js(lokal)Testing
Manual Testing
bagan_warnabagan_tingkatsudah tidak adaScreenshots / Video
Before:
Struktur organisasi menggunakan Highcharts dengan level manual
After:
Struktur organisasi menggunakan OrgChart dengan level otomatis, foto, dan tombol download
Breaking Changes
bagan_tingkatdi form edit pengurus dihapus (tidak mempengaruhi database, hanya UI)Migration Guide
Not required
References
Additional notes: Perubahan ini menghapus kebutuhan manual input
bagan_tingkatdi form. Level bagan sekarang dihitung otomatis berdasarkan relasi atasan-anak di database.