Fix: perbaikan alert#1639
Open
pandigresik wants to merge 2 commits into
Open
Conversation
Contributor
|
🔄 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: Perbaiki alert konfirmasi windows ke alert standar OpenDK
Description
Standarisasi seluruh notifikasi di aplikasi dengan mengganti native browser
alert()danconfirm()dengan Bootstrap modal yang konsisten. Membuat Blade component (x-modal-alertdanx-modal-confirm) serta JavaScript utility (modal-helper.js) agar semua notifikasi memiliki tampilan seragam dan dapat dikelola dengan mudah.Changes made:
resources/views/components/modal-alert.blade.php— Blade componentx-modal-alertuntuk menampilkan pesan notifikasi dengan dukungan tipe (success/danger/warning/info)resources/views/components/modal-confirm.blade.php— Blade componentx-modal-confirmuntuk konfirmasi dengan callback dan data-confirm attributepublic/js/modal-helper.js— JavaScript helper dengan fungsiopenAlert(),openConfirm(), dan event handler untukdata-confirmattributeresources/views/layouts/app.blade.phpdandashboard_template.blade.php— Include komponen modal dan JS helperlivewireInstance.on('success'/'error')dari SweetAlert2 keopenAlert()public/js/admin.js— MigrasierrorValidation()dari SweetAlert2 keopenAlert()alert()denganopenAlert()(file validation, OTP/2FA errors, AJAX errors)confirm()denganopenConfirm()ataudata-confirmattribute (delete confirmation, archive messages, backup database)Reason for change:
alert()danconfirm()tampil tidak konsisten antar browser dan tidak sesuai dengan tema aplikasiImpact of change:
Related Issue
Steps to Reproduce
Before fix (problem):
alert('File tersebut tidak diperbolehkan.')alert('Kode OTP telah kadaluarsa...')confirm('Yakin ingin menghapus?')After fix (solution):
Checklist
Technical Details
Technical Explanation
Membuat dua Blade component yang dirender di layout:
JS helper
modal-helper.jsmenyediakan tiga mekanisme:openAlert(message, title, type)— Fungsi global untuk menampilkan modal alert. Type (success/danger/warning/info) mengubah class pada.modal-contentuntuk warna yang sesuai (Bootstrap 3modal-success,modal-danger, dll)openConfirm(message, title, callback, btnYesText)— Fungsi global untuk konfirmasi dengan callback. Menggunakan variabel globalconfirmCallbackyang dipanggil saat tombol "Ya" diklik[data-confirm]attribute — Event handler delegated untuk tombol submit form atau link. Secara otomatis mencegah default action, menampilkan konfirmasi, dan mengeksekusi submit/navigasi jika dikonfirmasiConfiguration changes
Tidak ada perubahan konfigurasi
Dependencies added
Tidak ada dependencies baru (menggunakan Bootstrap 3 yang sudah terinstall)
Testing
Manual Testing
Breaking Changes
None — semua native alert/confirm diganti dengan Bootstrap modal yang memiliki perilaku serupa (modal alert bersifat blocking dengan tombol OK, modal confirm dengan Batal/Ya)
Migration Guide
Not required — perubahan hanya pada frontend, tidak ada perubahan database atau API
References