Added acces rules for jobs, operator/jobs and admin/dashboard view, including lazy loading for cancel button in broadcasts

This commit is contained in:
2024-09-13 14:27:50 +02:00
parent 64289d045d
commit 418b41556e
19 changed files with 145 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
class Operator::JobsController < ApplicationController
before_action :set_job, only: %i[show edit update destroy increment_page decrement_page]
before_action :set_job_lists, only: %i[index]
before_action :authorize!
# GET /jobs or /jobs.json
def index
@@ -133,7 +134,7 @@ class Operator::JobsController < ApplicationController
end
def broadcast_update_job
Turbo::StreamsChannel.broadcast_replace_later_to "jobs", target: @job, partial: "jobs/job_tr", locals: { job: @job }
Turbo::StreamsChannel.broadcast_replace_later_to "jobs", target: @job, partial: "jobs/job_tr", locals: { job: @job }
if @status_changed
Turbo::StreamsChannel.broadcast_remove_to "operator_jobs", target: @job
broadcast_update_status_cards_and_start_next_job_button