feat(power-dashboard): power dashboard controller, views, and services - #397
Closed
tomas-goncalves wants to merge 43 commits into
Closed
feat(power-dashboard): power dashboard controller, views, and services#397tomas-goncalves wants to merge 43 commits into
tomas-goncalves wants to merge 43 commits into
Conversation
…tion. Improve error logging for batch checkout
- Remove debug Rails.logger.debug calls from Checkout#participant_belongs_to_org - Use .blank? instead of .nil? in PPECollectionController - Make return_hardhat private in PPECollectionController - Use find_by instead of find in PPEDistributionController to avoid RecordNotFound exceptions - Simplify checkout condition in Tools::CheckoutsController#checkin - Add can? authorization checks to checkout/checkin actions
- Add find_by_query to Organization, Participant, ScissorLift, and Tool models - Add scissor_lift_certified? helper to Participant - Add current_checkout helper to ScissorLift, refactor dependent methods to use it - Expand ScissorLiftCheckout with associations and methods - Update Checkout model with additional logic for dashboard use - Add dashboard and power_dashboard routes - Expand en.yml locale strings for new dashboard UI - Update application config and test helper
…barcode in notice
fix(ppe-collection): extract hardcoded strings to i18n and fix blank barcode in notice
- Add find_by_query to Organization, Participant, ScissorLift, and Tool models - Add scissor_lift_certified? helper to Participant - Add current_checkout helper to ScissorLift, refactor dependent methods to use it - Expand ScissorLiftCheckout with associations and methods - Update Checkout model with additional logic for dashboard use - Add dashboard and power_dashboard routes - Expand en.yml locale strings for new dashboard UI - Update application config and test helper
…op offenses - Extract Checkout.checkout_batch / checkin_batch and all private helpers into CheckoutBatchOperations concern (fixes Metrics/ClassLength) - Use module ClassMethods instead of class_methods do to avoid Metrics/BlockLength - Refactor Tools::CheckoutsController: add before_action for checkin auth/resource loading, extract process_checkout_batch and flash helpers (fixes AbcSize, CyclomaticComplexity, PerceivedComplexity) - Rename Participant#is_booth_chair? -> booth_chair? (fixes Naming/PredicatePrefix) - Extract hardcoded flash strings to i18n in ppe_collection, ppe_distribution, and checkouts controllers (fixes Rails/I18nLocaleTexts)
- Inline single-use wrappers empty_checkout_result and missing_tool_result in CheckoutBatchOperations - Merge apply_checkout_error and error_checkout_for_exception into one method - Rename Participant.find_by_search -> search to avoid Rails/DynamicFindBy - Fix Participant.find_by_query and find_or_create_by_search to call Participant.search instead of find_by(search:) (nonexistent column) - Fix Tools::CheckoutsController#store_borrower_in_session same bug
tomas-goncalves
force-pushed
the
advanced-dashboard/power-dashboard-backend
branch
from
March 25, 2026 08:10
64e266e to
a3c33b6
Compare
- Add explicit `gem 'csv'` (Ruby 3.4 no longer bundles csv) - Include Application::BreadcrumbsHelper, DocumentTitleHelper, and NavigationHelper in ApplicationHelper (were defined but never included) - Rename Model.find_by_query → Model.lookup on Tool, Participant, Organization, and ScissorLift to satisfy Rails/DynamicFindBy - Update db/schema.rb to reflect resolved duplicate tool_type migration
Prettier/rubocop reformat commits in this branch's history had drifted these files from master, breaking the YouTube player (javascript_include_tag lost its <%= tag). Restore all four files to their master state.
Adds the execution services shared by DashboardController and PowerDashboardController under the Dashboard:: namespace: - ActionExecutor, ActionRegistry, ReceiptBuilder, SessionState - QueueResource, ScissorLiftOverviewResource - All 19 action handler classes (Dashboard::Actions::*) Tests for these services are covered by dashboard_controller_test.rb (via the complete/execute actions) and will be further validated by power_dashboard_actions_test.rb in the PowerDashboard Backend PR.
Adds en.locale keys used by Dashboard::Actions::* classes: resources.labels, resources.receipts, resources.tool, resources.scissor_lift, resources.queue, resources.session, etc.
Used by ScanResolver for the lookup flow target. Depends only on model find_by_query methods from the foundation PR.
- auto_add_tools? now defaults to true (session opt-out instead of opt-in)
- checkin/checkout resolve context automatically without keyword qualifiers:
lift selected → lift action
cart has items → cart action
tool selected → single-resource action
Explicit keywords (lift, cart) still override context.
- New Dashboard::Actions::ToolDirectCheckout for checking out the current
tool directly when no cart items are present
…d no resource selected
- Pass current_ability object instead of method(:can?) so action classes can call ability.can? directly (cleaner than .call) - Prefix all unused keyword arguments with _ across action classes - Use anonymous keyword forwarding (**) on Base#t - Autocorrect Layout, Style, and Rails violations across all action files
- Add DashboardController with flow state management - Add Dashboard services: FlowDefinition, FlowState, FlowUpdater, PendingBuilder, ScanResolver, ShowContextBuilder - Add dashboard views (show, confirm, result) - Add DashboardHelper - Add auto_submit Stimulus controller - Add dashboard routes - Add controller and unit tests
- Restore before_action :require_authentication in DashboardController - Add power-dashboard shared styles and dashboard-flow styles to binder.css - Excludes autocomplete and power-layout styles (deferred to later PRs)
Step names are already shown in the h1 via dashboard_h1. Remove duplicate <p>Select ...</p> paragraphs above forms.
Use ::PowerDashboard:: to avoid Ruby resolving relative to DashboardController. Guard action_requires_confirmation? so the dashboard wizard works before PowerDashboard (PR C) is available.
Replace ::PowerDashboard:: references with Dashboard:: following the rename of execution services in the action-services PR.
Moved from PowerDashboardHelper which is not yet available. Used by the confirm view to render receipt lines.
…iftOverviewResource, ResourceLookup
Moved from PowerDashboardHelper. Uses Dashboard:: namespace for QueueResource and ScissorLiftOverviewResource. Partials are deferred to the Power Dashboard Frontend PR.
Move resource partials to shared/resources/ so they work in both dashboard and power dashboard. Add lift_overview_* helpers to DashboardHelper. Update current_resource_config to point to shared/resources/ partials.
Autocomplete controller and route are deferred to the autocomplete PR.
Display each active queue the organization is in (electrical/structural) with its position and message.
…ttons Replace submit_tag with button_tag to support two-line button content, adding a short description span beneath each label. Add .btn-description CSS rule for smaller, lighter text styling. Buttons updated: Checkout, Checkin, Queue, Lift, Lookup (flow selection); Electrical, Structural (queue type); Add, Remove, View Current (queue action); By User, By Org (queue source); Checkout Lift, Checkin Lift, Renew, View Current (lift action).
- Replace is_checked_out? with checked_out? in views and services - Rename find_by_query → lookup at all call sites (scan_resolver, resource_lookup); refactor resource_lookup to use || chain helper - Refactor DashboardHelper: extract STEP_LABELS constant to replace case/when dispatch, extract apply_resource_display_config and receipt_list_html, compact lift_overview_* methods - Refactor ScissorLiftOverviewResource#lifts using ternary for remaining - Autocorrect Layout, Style, and Rails violations in flow_state, flow_updater, pending_builder, session_state, show_context_builder
…rd::ResourceLookup)
…icates Delete 6 view partials from app/views/power_dashboard/resources/ that were exact copies of app/views/shared/resources/. Update PowerDashboardHelper #current_resource_config to reference the shared partials instead.
Port test/controllers/power_dashboard_controller_test.rb and test/unit/power_dashboard_actions_test.rb from fork/advanced-user-dashboard. Update namespace references: PowerDashboard::ActionExecutor, PowerDashboard::SessionState, PowerDashboard::ActionRegistry → Dashboard::. Remove forfeit_scissor_lift assertions (action removed in this branch).
tomas-goncalves
force-pushed
the
advanced-dashboard/power-dashboard-backend
branch
from
March 25, 2026 20:55
a3c33b6 to
741de6f
Compare
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.
Summary
Stack
Merge in order:
advanced-dashboard/foundation→masteradvanced-dashboard/dashboard→masteradvanced-dashboard/power-dashboard-backend→masteradvanced-dashboard/autocomplete→masterTo review only what this PR adds, compare against
advanced-dashboard/dashboard.