Skip to content

Add modern isolated admin dashboard with Bootstrap 5#461

Merged
dereuromark merged 21 commits intomasterfrom
feature/isolated-admin-dashboard
Mar 18, 2026
Merged

Add modern isolated admin dashboard with Bootstrap 5#461
dereuromark merged 21 commits intomasterfrom
feature/isolated-admin-dashboard

Conversation

@dereuromark
Copy link
Copy Markdown
Owner

@dereuromark dereuromark commented Mar 17, 2026

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

  • Bootstrap 5.3.3 + Font Awesome 6.7.2 via CDN with SRI hashes
  • Isolated base controller (QueueAppController) that extends Cake\Controller\Controller directly
  • Configuration-driven layout - can be enabled/disabled via Configure::read('Queue.adminLayout')
  • Backwards compatible - existing templates continue to work; new layout is opt-in

New Files

Controllers:

  • src/Controller/Admin/QueueAppController.php - Isolated base controller

Layout:

  • templates/layout/queue.php - Self-contained layout with CDN assets

Elements:

  • templates/element/Queue/sidebar.php - Sidebar navigation
  • templates/element/Queue/stats_card.php - Statistics card component
  • templates/element/Queue/status_badge.php - Job status badges
  • templates/element/flash/*.php - Bootstrap 5 flash messages

Documentation:

  • docs/sections/admin_dashboard.md - Full documentation

Configuration Options

'Queue' => [
    'adminLayout' => 'Queue.queue',        // Enable isolated layout
    'dashboardAutoRefresh' => 30,          // Auto-refresh seconds (0 = disabled)
    'ignoreAuthorization' => true,         // Skip auth in admin controllers
],

Dashboard Features

  • Status banner showing queue running/idle state
  • Statistics cards for pending, scheduled, running, and failed jobs
  • Pending/scheduled jobs tables with inline actions
  • Job statistics aggregation
  • Trigger jobs section for addable tasks
  • Configuration display
  • Sidebar navigation with quick actions
dashboard

- 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-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 17, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 98.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.50%. Comparing base (1baab99) to head (fc13957).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/View/Helper/QueueHelper.php 96.77% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 QueueAppController for 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.

dereuromark and others added 10 commits March 17, 2026 22:49
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)
@dereuromark dereuromark marked this pull request as ready for review March 18, 2026 00:54
- Change adminLayout default: null uses Queue.queue, false disables
- Add tests for clone(), execute(), and migrate() actions
- Update documentation to reflect new default behavior
# Conflicts:
#	templates/Admin/QueuedJobs/index.php
- 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, ...)
@dereuromark dereuromark merged commit 0b50781 into master Mar 18, 2026
16 checks passed
@dereuromark dereuromark deleted the feature/isolated-admin-dashboard branch March 18, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants