Skip to content

Commit

Permalink
Merge pull request #87 from zavan/api-only
Browse files Browse the repository at this point in the history
Compatibility with api_only applications
  • Loading branch information
rosa authored Aug 19, 2024
2 parents 7875a55 + 5feecbe commit 7f71ec8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PATH
mission_control-jobs (0.3.1)
importmap-rails
irb (~> 1.13)
propshaft
rails (>= 7.1)
stimulus-rails
turbo-rails
Expand Down Expand Up @@ -177,6 +178,11 @@ GEM
parser (3.3.0.5)
ast (~> 2.4.1)
racc
propshaft (0.8.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
Expand Down
4 changes: 0 additions & 4 deletions app/assets/config/mission_control_jobs_manifest.js

This file was deleted.

18 changes: 2 additions & 16 deletions app/assets/stylesheets/mission_control/jobs/application.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/

@import url("./forms.css");
@import url("./jobs.css");
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
class MissionControl::Jobs::ApplicationController < MissionControl::Jobs.base_controller_class.constantize
ActionController::Base::MODULES.each do |mod|
include mod unless self < mod
end

layout "mission_control/jobs/application"

# Include helpers if not already included
helper MissionControl::Jobs::ApplicationHelper unless self < MissionControl::Jobs::ApplicationHelper
helper Importmap::ImportmapTagsHelper unless self < Importmap::ImportmapTagsHelper

include MissionControl::Jobs::ApplicationScoped, MissionControl::Jobs::NotFoundRedirections
include MissionControl::Jobs::AdapterFeatures

Expand Down
4 changes: 4 additions & 0 deletions lib/mission_control/jobs/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
require "importmap-rails"
require "turbo-rails"
require "stimulus-rails"
require "propshaft"

module MissionControl
module Jobs
class Engine < ::Rails::Engine
isolate_namespace MissionControl::Jobs

config.middleware.use ActionDispatch::Flash unless config.action_dispatch.flash

config.mission_control = ActiveSupport::OrderedOptions.new unless config.try(:mission_control)
config.mission_control.jobs = ActiveSupport::OrderedOptions.new

Expand Down Expand Up @@ -87,6 +90,7 @@ class Engine < ::Rails::Engine
end

initializer "mission_control-jobs.assets" do |app|
app.config.assets.paths << root.join("app/assets/stylesheets")
app.config.assets.paths << root.join("app/javascript")
app.config.assets.precompile += %w[ mission_control_jobs_manifest ]
end
Expand Down
1 change: 1 addition & 0 deletions mission_control-jobs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
end

spec.add_dependency "rails", ">= 7.1"
spec.add_dependency "propshaft"
spec.add_dependency "importmap-rails"
spec.add_dependency "turbo-rails"
spec.add_dependency "stimulus-rails"
Expand Down

0 comments on commit 7f71ec8

Please sign in to comment.