New: React-based admin UI with REST API - #236
Open
KingYes wants to merge 4 commits into
Open
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
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.
✨ PR Description
1. Problem & Context
Replacing the legacy PHP list table UI with a modern React-based admin interface backed by a new REST API. This enables better UX, independent frontend/backend iteration, and paves the way for external integrations.
2. What Changed (Where)
AAL_Log_Query(query logic),AAL_Log_Presenter(data formatting),AAL_REST(REST endpoints) classes; removedAAL_Activity_Log_List_Tabledependencyapp.js,api.js,index.js); replaces inline WP_List_Table rendering with#aal-admin-rootmount pointAAL_Admin_Uinow enqueues React bundle; removed list table preparation, added script bootstrap with configAAL_Log_Query+AAL_Log_Presenterinstead of list table methods@wordpress/scripts; GitHub Actions updated to build JS assets3. How It Works
Entry point:
AAL_REST::register_routes()registers/logs,/logs/filters, and/promotions/{id}/dismissendpoints.Client requests flow through React →
fetchLogs()→ REST API →AAL_Log_Query::query()(handles permissions, filtering, pagination) →AAL_Log_Presenter::to_json()(formats DB rows).AAL_Admin_Ui::enqueue_admin_scripts()inlines bootstrap config (window.aalAdmin) with REST base, IP collection setting, export nonce; React app reads this to initialize state.Filtering is stateless per request; URL params persist via
syncUrl().4. Risks
Build dependency: REST API now requires npm build step. Mitigate: CI enforces build before merge; backward compat maintained (old code still works if build missing, just shows notice).
Permission model change: Query-level filtering replaces list table's item-level checks. Verify
AAL_Log_Query::get_where_by_role()andAAL_REST::check_permissions()cover all capability scenarios, especially custom roles.Missing asset handling: Admin shows error notice if JS build missing—acceptable UX but needs documentation in setup/deployment guides.
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how