Action Panel
Action Panel
The Action Panel provides a step-by-step workflow system for processing items through various stages. It includes a stepper interface and a flexible step system that can be extended by host applications.
Overview
The Action Panel consists of:
- StepperController - Handles step navigation and actions
- Steps - Individual step classes that handle specific workflow stages
- ReviewProcess - Manages the overall workflow state
Step System
Steps are defined in LooposUi::ActionPanel::Steps and inherit from LooposUi::ActionPanel::Steps::Base. Each step can:
- Update item attributes
- Advance or return to previous steps
- Submit protocol answers
- Perform custom actions
Events & Notifications
The Action Panel publishes events using ActiveSupport::Notifications when items are updated.
This allows host applications to react to these events - note it's synchronous, so you should avoid doing any heavy lifting in the event handler,
or use a background job.
Available Events
loopos_ui.steps.item.updated
Published when an item is updated successfully.
Event Payload:
item_token(String) - The token of the updated itemparams(Hash) - The parameters that were sent in the update requestresponse(Object) - The API response object. The body of the response is available inresponse.body, and will contain the Core API response (the item).block_id(Integer, optional) - The block ID (only present forupdate_block_item)
Example Subscription:
# config/initializers/loopos_ui.rb or app/jobs/application_job.rbActiveSupport::Notifications.subscribe("loopos_ui.steps.item.updated") do |name, start, finish, id, payload| item_token = payload[:item_token] # Sync ReverseOrder or perform other actions ReverseOrderSyncService.sync(item_token) # Or trigger a background job # SyncReverseOrderJob.perform_later(item_token)endUse Cases
Examples of use cases for subscribing to these events:
- Syncing ReverseOrder - Keep Hubs' ReverseOrder copy synchronized with Core's Item
- Audit Logging - Log all item updates for compliance
- Cache Invalidation - Invalidate caches when items are updated
- Webhooks - Trigger external webhooks when items change
- Analytics - Track item update events for analytics
Integration
To use the Action Panel in your application, you need to configure the action_panel_implementation in your initializer. See the Configuration documentation for details.