File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed
app/views/layouts/mission_control/jobs Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 99 < meta name ="turbo-cache-control " content ="no-cache ">
1010 < link rel ="
stylesheet "
href ="
https://cdn.jsdelivr.net/npm/[email protected] /css/bulma.min.css "
> 1111 <%= stylesheet_link_tag "mission_control/jobs/application" , "data-turbo-track" : "reload" %>
12- <%= javascript_importmap_tags "application-mcj" %>
12+ <%= javascript_importmap_tags "application" , importmap : MissionControl :: Jobs . importmap %>
1313</ head >
1414< body >
1515
Original file line number Diff line number Diff line change 1- pin "application-mcj " , to : "mission_control/jobs/application.js" , preload : true
1+ pin "application" , to : "mission_control/jobs/application.js" , preload : true
22pin "@hotwired/turbo-rails" , to : "turbo.min.js" , preload : true
33pin "@hotwired/stimulus" , to : "stimulus.min.js" , preload : true
44pin "@hotwired/stimulus-loading" , to : "stimulus-loading.js" , preload : true
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ module Jobs
1919 mattr_accessor :internal_query_count_limit , default : 500_000 # Hard limit to keep unlimited count queries fast enough
2020 mattr_accessor :show_console_help , default : true
2121 mattr_accessor :scheduled_job_delay_threshold , default : 1 . minute
22+ mattr_accessor :importmap , default : Importmap ::Map . new
2223 mattr_accessor :backtrace_cleaner
2324 end
2425end
Original file line number Diff line number Diff line change @@ -87,9 +87,13 @@ class Engine < ::Rails::Engine
8787 app . config . assets . precompile += %w[ mission_control_jobs_manifest ]
8888 end
8989
90- initializer "mission_control-jobs.importmap" , before : "importmap" do |app |
91- app . config . importmap . paths << root . join ( "config/importmap.rb" )
92- app . config . importmap . cache_sweepers << root . join ( "app/javascript" )
90+ initializer "mission_control-jobs.importmap" , after : "importmap" do |app |
91+ MissionControl ::Jobs . importmap . draw ( root . join ( "config/importmap.rb" ) )
92+ MissionControl ::Jobs . importmap . cache_sweeper ( watches : root . join ( "app/javascript" ) )
93+
94+ ActiveSupport . on_load ( :action_controller_base ) do
95+ before_action { MissionControl ::Jobs . importmap . cache_sweeper . execute_if_updated }
96+ end
9397 end
9498 end
9599 end
You can’t perform that action at this time.
0 commit comments