Class: Observ::ReviewQueueController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Observ::ReviewQueueController
- Defined in:
- app/controllers/observ/review_queue_controller.rb
Instance Method Summary collapse
- #complete ⇒ Object
- #index ⇒ Object
- #sessions ⇒ Object
- #show ⇒ Object
- #skip ⇒ Object
- #stats ⇒ Object
- #traces ⇒ Object
Instance Method Details
#complete ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'app/controllers/observ/review_queue_controller.rb', line 63 def complete @review_item.complete!(by: params[:completed_by]) if params[:next] && (next_item = next_review_item) redirect_to review_path(next_item), notice: "Review saved. Showing next item." else redirect_to reviews_path, notice: "Review completed." end end |
#index ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/observ/review_queue_controller.rb', line 7 def index @review_items = Observ::ReviewItem .actionable .by_priority .includes(:reviewable) .page(params[:page]) .per(Observ.config.pagination_per_page) @stats = queue_stats @filter = :all end |
#sessions ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/observ/review_queue_controller.rb', line 19 def sessions @review_items = Observ::ReviewItem .sessions .actionable .by_priority .includes(:reviewable) .page(params[:page]) .per(Observ.config.pagination_per_page) @stats = queue_stats(scope: :sessions) @filter = :sessions render :index end |
#show ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'app/controllers/observ/review_queue_controller.rb', line 47 def show @review_item.start_review! @reviewable = @review_item.reviewable @next_item = next_review_item @queue_position = queue_position # Load additional data for sessions if @reviewable.is_a?(Observ::Session) @session_metrics = @reviewable.session_metrics @traces = @reviewable.traces.includes(:observations).order(start_time: :asc).limit(10) @chat = @reviewable.chat if defined?(::Chat) elsif @reviewable.is_a?(Observ::Trace) @observations = @reviewable.observations.order(start_time: :asc).limit(5) end end |
#skip ⇒ Object
73 74 75 76 77 78 79 80 81 |
# File 'app/controllers/observ/review_queue_controller.rb', line 73 def skip @review_item.skip!(by: params[:completed_by]) if (next_item = next_review_item) redirect_to review_path(next_item), notice: "Skipped. Showing next item." else redirect_to reviews_path, notice: "Item skipped. No more items to review." end end |
#stats ⇒ Object
83 84 85 |
# File 'app/controllers/observ/review_queue_controller.rb', line 83 def stats @stats = detailed_stats end |
#traces ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/observ/review_queue_controller.rb', line 33 def traces @review_items = Observ::ReviewItem .traces .actionable .by_priority .includes(:reviewable) .page(params[:page]) .per(Observ.config.pagination_per_page) @stats = queue_stats(scope: :traces) @filter = :traces render :index end |