mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Merge pull request #13857 from rioug/10298-remove-rails-sass
Remove rails-sass dependency
This commit is contained in:
5
Gemfile
5
Gemfile
@@ -127,9 +127,8 @@ gem 'angular_rails_csrf'
|
||||
|
||||
gem 'jquery-rails', '4.4.0'
|
||||
gem 'jquery-ui-rails', '~> 4.2'
|
||||
# TODO move away from sass-rails, master branch will get rid of dependency, so we can move to
|
||||
# https://github.com/sass/embedded-host-node
|
||||
gem "select2-rails", github: "openfoodfoundation/select2-rails", branch: "v349_with_thor_v1"
|
||||
gem "select2-rails", github: "openfoodfoundation/select2-rails",
|
||||
branch: "v349_with-relaxed-dependencies"
|
||||
|
||||
gem 'good_migrations'
|
||||
|
||||
|
||||
34
Gemfile.lock
34
Gemfile.lock
@@ -10,11 +10,10 @@ GIT
|
||||
|
||||
GIT
|
||||
remote: https://github.com/openfoodfoundation/select2-rails.git
|
||||
revision: fc240e85fbdf1878ff3c39d972c0cd9a312f5ed4
|
||||
branch: v349_with_thor_v1
|
||||
revision: 9693e0cc5b04938da46692d3fa83aa8934791981
|
||||
branch: v349_with-relaxed-dependencies
|
||||
specs:
|
||||
select2-rails (3.4.9)
|
||||
sass-rails
|
||||
thor (>= 0.14)
|
||||
|
||||
GIT
|
||||
@@ -305,7 +304,7 @@ GEM
|
||||
eventmachine (>= 1.0.0.beta.1)
|
||||
email_validator (2.2.4)
|
||||
activemodel
|
||||
erb (6.0.0)
|
||||
erb (6.0.1)
|
||||
erubi (1.13.1)
|
||||
et-orbi (1.3.0)
|
||||
tzinfo
|
||||
@@ -516,7 +515,6 @@ GEM
|
||||
newrelic_rpm (9.24.0)
|
||||
nio4r (2.7.5)
|
||||
nokogiri (1.18.10)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
nokogiri-html5-inference (0.3.0)
|
||||
nokogiri (~> 1.14)
|
||||
@@ -584,7 +582,7 @@ GEM
|
||||
pry (0.15.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
psych (5.2.6)
|
||||
psych (5.3.1)
|
||||
date
|
||||
stringio
|
||||
public_suffix (7.0.0)
|
||||
@@ -686,7 +684,7 @@ GEM
|
||||
logger (~> 1.5)
|
||||
ostruct (~> 0.6)
|
||||
readline (~> 0.0)
|
||||
rdoc (6.16.0)
|
||||
rdoc (7.0.1)
|
||||
erb
|
||||
psych (>= 4.0.0)
|
||||
tsort
|
||||
@@ -806,13 +804,6 @@ GEM
|
||||
sanitize (7.0.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.16.8)
|
||||
sass (3.4.25)
|
||||
sass-rails (5.0.8)
|
||||
railties (>= 5.2.0)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (>= 1.1, < 3)
|
||||
sd_notify (0.1.1)
|
||||
securerandom (0.4.1)
|
||||
semantic_range (3.1.0)
|
||||
@@ -824,11 +815,12 @@ GEM
|
||||
semantic_range (>= 2.3.0)
|
||||
shoulda-matchers (7.0.1)
|
||||
activesupport (>= 7.1)
|
||||
sidekiq (7.2.4)
|
||||
concurrent-ruby (< 2)
|
||||
connection_pool (>= 2.3.0)
|
||||
rack (>= 2.2.4)
|
||||
redis-client (>= 0.19.0)
|
||||
sidekiq (7.3.10)
|
||||
base64
|
||||
connection_pool (>= 2.3.0, < 3)
|
||||
logger
|
||||
rack (>= 2.2.4, < 3.3)
|
||||
redis-client (>= 0.23.0, < 1)
|
||||
sidekiq-scheduler (5.0.3)
|
||||
rufus-scheduler (~> 3.2)
|
||||
sidekiq (>= 6, < 8)
|
||||
@@ -876,7 +868,7 @@ GEM
|
||||
railties (>= 5.2)
|
||||
redis (>= 4.0, < 6.0)
|
||||
stringex (2.8.6)
|
||||
stringio (3.1.8)
|
||||
stringio (3.2.0)
|
||||
stripe (15.5.0)
|
||||
swd (2.0.3)
|
||||
activesupport (>= 3)
|
||||
@@ -964,7 +956,7 @@ GEM
|
||||
xml-simple (1.1.8)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zeitwerk (2.7.3)
|
||||
zeitwerk (2.7.4)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
@import './mail/all.scss';
|
||||
@@ -1,3 +0,0 @@
|
||||
@import '../../../webpacker/css/admin/globals/palette.scss';
|
||||
@import 'email';
|
||||
@import 'payments_list';
|
||||
@@ -76,4 +76,19 @@ module ApplicationHelper
|
||||
def cache_key_with_locale(key, locale)
|
||||
Array.wrap(key) + ["v2", locale.to_s, I18nDigests.for_locale(locale)]
|
||||
end
|
||||
|
||||
def pdf_stylesheet_pack_tag(source)
|
||||
# With shakapacker dev server running, the wicked_pdf_stylesheet_pack_tag will produce a
|
||||
# relative path, because we don't have `config.action_controller.asset_host`. Relative path
|
||||
# can't be resolved by `wkhtmltopdf`. So we pass the wepacker dev server host and port to
|
||||
# the shakapacker helper, so it generates the correct url.
|
||||
# For more info: https://stackoverflow.com/questions/58490299/how-to-include-css-stylesheet-into-wicked-pdf/60541688#60541688
|
||||
if running_in_development?
|
||||
options = { media: "all",
|
||||
host: "#{Shakapacker.dev_server.host}:#{Shakapacker.dev_server.port}" }
|
||||
stylesheet_pack_tag(source, **options)
|
||||
else
|
||||
wicked_pdf_stylesheet_pack_tag(source)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
||||
%title
|
||||
= Spree::Config[:site_name]
|
||||
= stylesheet_link_tag 'mail', media: "screen"
|
||||
= stylesheet_pack_tag "mail", media: "screen"
|
||||
%body{:bgcolor => "#FFFFFF" }
|
||||
- unless @hide_ofn_navigation
|
||||
%table.head-wrap
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
= wicked_pdf_stylesheet_link_tag "mail"
|
||||
= pdf_stylesheet_pack_tag "mail"
|
||||
|
||||
%table{:width => "100%"}
|
||||
%tbody
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
= wicked_pdf_stylesheet_link_tag "mail"
|
||||
= pdf_stylesheet_pack_tag "mail"
|
||||
|
||||
%table{:width => "100%"}
|
||||
%tbody
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
= wicked_pdf_stylesheet_link_tag "mail"
|
||||
= pdf_stylesheet_pack_tag "mail"
|
||||
|
||||
%table{:width => "100%"}
|
||||
%tbody
|
||||
@@ -102,4 +102,4 @@
|
||||
= render partial: 'spree/admin/orders/_invoice/order_note'
|
||||
|
||||
.text-center
|
||||
= link_to_platform_terms
|
||||
= link_to_platform_terms
|
||||
|
||||
3
app/webpacker/css/mail/all.scss
Normal file
3
app/webpacker/css/mail/all.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
@import '../admin/globals/palette.scss';
|
||||
@import 'email';
|
||||
@import 'payments_list';
|
||||
1
app/webpacker/packs/mail.scss
Normal file
1
app/webpacker/packs/mail.scss
Normal file
@@ -0,0 +1 @@
|
||||
@import "../css/mail/all.scss";
|
||||
@@ -19,6 +19,5 @@ Rails.application.config.assets.precompile += [
|
||||
'web/all.js',
|
||||
'darkswarm/all.js',
|
||||
'shared/*',
|
||||
'mail.scss',
|
||||
'*.jpg', '*.jpeg', '*.png', '*.gif' '*.svg',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user