Skip to content

New: React-based admin UI with REST API - #236

Open
KingYes wants to merge 4 commits into
masterfrom
new/react-admin-ui
Open

New: React-based admin UI with REST API#236
KingYes wants to merge 4 commits into
masterfrom
new/react-admin-ui

Conversation

@KingYes

@KingYes KingYes commented Aug 25, 2026

Copy link
Copy Markdown
Member

✨ 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)

Component Change
Backend New AAL_Log_Query (query logic), AAL_Log_Presenter (data formatting), AAL_REST (REST endpoints) classes; removed AAL_Activity_Log_List_Table dependency
Frontend New React app (app.js, api.js, index.js); replaces inline WP_List_Table rendering with #aal-admin-root mount point
Admin UI AAL_Admin_Ui now enqueues React bundle; removed list table preparation, added script bootstrap with config
Export Refactored to use AAL_Log_Query + AAL_Log_Presenter instead of list table methods
Build Added webpack, babel, @wordpress/scripts; GitHub Actions updated to build JS assets

3. How It Works

Entry point: AAL_REST::register_routes() registers /logs, /logs/filters, and /promotions/{id}/dismiss endpoints.

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() and AAL_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

@wiz-9a149474ff

wiz-9a149474ff Bot commented Aug 25, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 High 1 Low
Software Management Finding Software Management Findings -
Total 1 High 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

Comment thread classes/class-aal-log-query.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant