Add modern isolated admin dashboard with Bootstrap 5#461
Add modern isolated admin dashboard with Bootstrap 5#461dereuromark merged 21 commits intomasterfrom
Conversation
- Create QueueAppController as isolated base for admin controllers - Add queue.php layout with Bootstrap 5.3.3 and Font Awesome 6.7.2 via CDN - Add reusable elements: sidebar, stats_card, status_badge, flash messages - Update admin templates with card-based layout and modern styling - Add new configuration options: adminLayout, dashboardAutoRefresh, ignoreAuthorization - Update icon fallback to use Font Awesome 6 icons - Add documentation for admin dashboard features
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #461 +/- ##
============================================
+ Coverage 73.53% 76.50% +2.97%
- Complexity 834 853 +19
============================================
Files 43 44 +1
Lines 2868 2933 +65
============================================
+ Hits 2109 2244 +135
+ Misses 759 689 -70 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in, self-contained admin dashboard UI for the Queue plugin, introducing an isolated base controller and a new Bootstrap 5 + Font Awesome layout while updating the existing admin templates to use the new components and styling.
Changes:
- Introduces an isolated
QueueAppControllerfor admin controllers, with configuration-driven layout selection and optional Authorization skipping. - Adds a new Bootstrap/Font Awesome admin layout plus reusable UI elements (sidebar, stats cards, status badges, Bootstrap flash templates).
- Refactors the Queue admin templates (dashboard, queued jobs, processes) to a modern Bootstrap-based UI and documents setup/usage.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/layout/queue.php | New isolated Bootstrap 5 admin layout, JS behavior (tooltips/confirm/auto-refresh), and shared styling. |
| templates/element/yes_no.php | Updates fallback yes/no rendering to Bootstrap-style badges with icons. |
| templates/element/ok.php | Updates fallback ok/not-ok rendering to Bootstrap-style badges with icons. |
| templates/element/icon.php | Changes icon fallback rendering to Font Awesome-based output when Icon helper is unavailable. |
| templates/element/flash/warning.php | Adds Bootstrap-styled warning flash element. |
| templates/element/flash/success.php | Adds Bootstrap-styled success flash element. |
| templates/element/flash/info.php | Adds Bootstrap-styled info flash element. |
| templates/element/flash/error.php | Adds Bootstrap-styled error flash element. |
| templates/element/Queue/status_badge.php | Adds a reusable job-status badge element for the dashboard UI. |
| templates/element/Queue/stats_card.php | Adds a reusable statistics card element for the dashboard UI. |
| templates/element/Queue/sidebar.php | Adds a sidebar navigation/quick-actions element for the isolated admin layout. |
| templates/Admin/QueuedJobs/view.php | Refactors job detail view into a Bootstrap card-based layout with richer status/timeline display. |
| templates/Admin/QueuedJobs/index.php | Refactors queued jobs list into a Bootstrap table layout with icon-based actions and tooltips. |
| templates/Admin/QueueProcesses/index.php | Refactors process history list into a Bootstrap table layout with actions. |
| templates/Admin/Queue/processes.php | Refactors active workers page into Bootstrap cards with action buttons. |
| templates/Admin/Queue/index.php | Refactors the main dashboard page with status banner, stat cards, tables, and configuration display. |
| src/Controller/Admin/QueuedJobsController.php | Switches admin controller base class to QueueAppController for isolation. |
| src/Controller/Admin/QueueProcessesController.php | Switches admin controller base class to QueueAppController for isolation. |
| src/Controller/Admin/QueueController.php | Switches admin controller base class and adds computed stats/config data for the new dashboard UI. |
| src/Controller/Admin/QueueAppController.php | New isolated base controller configuring helpers, Flash, optional layout, and optional Authorization skipping. |
| docs/sections/admin_dashboard.md | Adds documentation for enabling/configuring/using the new admin dashboard. |
| docs/README.md | Links the new admin dashboard documentation from the docs index. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The duration() method is specific to the Tools TimeHelper. Applications not using the Tools plugin would get a fatal error. This adds a method_exists check with a fallback to PHP's DateInterval::format().
- Remove Dashboard/List links from sidebars (now in navbar) - Add nav-link CSS classes to sidebar links - Add Font Awesome icons to sidebar action links - Simplify link routes by removing explicit plugin/prefix - Add block => true to postLinks in sidebars - Clean up stats page sidebar and add list-group styling - Add QueueScheduler link in navbar when plugin is loaded - Add Chart.js CDN to layout for stats page
- Convert all edit pages from old sidebar nav to Bootstrap 5 cards - Update grid classes from old Foundation to Bootstrap 5 (col-lg-*) - Add proper form-control/form-select classes to all form inputs - Add Font Awesome icons to all buttons and headers - Use list-group for action links in sidebars - Convert search element from inline float to responsive card layout - Add proper spacing, alerts, and visual hierarchy - QueuedJobs: edit, data, test, execute, import, migrate - QueueProcesses: edit, view - element: search
- Move Execute Job link outside collapsible demo section - Fix search element to use $jobTypes variable for task dropdown
- Fix Chart.js infinite vertical expansion on stats page - Use query parameter for job_type to support slashes in names - Add back button when viewing specific job type stats - Add mobile offcanvas navigation - Add adminLayout and dashboardAutoRefresh to config example - Remove ignoreAuthorization feature (security concerns)
- Change adminLayout default: null uses Queue.queue, false disables - Add tests for clone(), execute(), and migrate() actions - Update documentation to reflect new default behavior
- Add isRequeued() method to QueueHelper to detect jobs that have failed but are within retry limits and will be picked up again - Add warning state to ok.php element for orange/yellow display - Update all status display logic in dashboard and QueuedJobs views to use hasFailed() and isRequeued() helper methods instead of raw field checks - Requeued jobs now show with yellow "Requeued" badge instead of incorrectly showing as "Failed" or "Running" - Add tests for isRequeued() method
Pending count was including running and failed jobs, causing the sum of all stats cards to exceed the actual number of jobs. Now properly subtracts running and failed counts from pending to avoid overlap.
- Reorder stats cards: Scheduled → Pending → Running → Failed (follows job lifecycle chronologically) - Add safeguard against negative pendingJobs count with max(0, ...)
Summary
This PR introduces a modern, self-contained admin dashboard for the Queue plugin that is completely isolated from the host application's CSS/JS.
Key Features
QueueAppController) that extendsCake\Controller\ControllerdirectlyConfigure::read('Queue.adminLayout')New Files
Controllers:
src/Controller/Admin/QueueAppController.php- Isolated base controllerLayout:
templates/layout/queue.php- Self-contained layout with CDN assetsElements:
templates/element/Queue/sidebar.php- Sidebar navigationtemplates/element/Queue/stats_card.php- Statistics card componenttemplates/element/Queue/status_badge.php- Job status badgestemplates/element/flash/*.php- Bootstrap 5 flash messagesDocumentation:
docs/sections/admin_dashboard.md- Full documentationConfiguration Options
Dashboard Features