Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Nov 14, 2023
1 parent 70452d9 commit c212555
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 120 deletions.
5 changes: 0 additions & 5 deletions .rubocop_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ AllCops:
# Otherwise we fallback to the oldest officially supported Ruby version (2.0).
TargetRubyVersion: 3.0

RSpec:
Patterns:
- "(?:^|/)spec/"
- "(?:^|/)test/"

# Indent private/protected/public as deep as method definitions
Layout/AccessModifierIndentation:
EnforcedStyle: indent
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem "decidim", DECIDIM_VERSION
gem "decidim-consultations", DECIDIM_VERSION

gem "decidim-action_delegator", github: "coopdevs/decidim-module-action_delegator", branch: "main"
gem "decidim-decidim_awesome", github: "decidim-ice/decidim-module-decidim_awesome", branch: "develop"
gem "decidim-decidim_awesome", github: "decidim-ice/decidim-module-decidim_awesome"
gem "decidim-term_customizer", github: "mainio/decidim-module-term_customizer", branch: "master"

gem "bootsnap", "~> 1.7"
Expand Down Expand Up @@ -42,7 +42,6 @@ end

group :production do
gem "aws-sdk-s3", require: false
gem "fog-aws"
gem "sidekiq"
gem "sidekiq-cron"
end
21 changes: 4 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ GIT

GIT
remote: https://github.com/decidim-ice/decidim-module-decidim_awesome.git
revision: 4e6db5717752c2031273cd77518730a76b5aa411
branch: develop
revision: 4f1b2eb8a9db544e3f781a248cc5b3659e808a36
specs:
decidim-decidim_awesome (0.10.0)
decidim-admin (>= 0.26.0, < 0.28)
Expand All @@ -24,7 +23,7 @@ GIT

GIT
remote: https://github.com/decidim/decidim.git
revision: 6271ef2fd11632e4dd340935ea0e4b0a2d70547b
revision: d3df678a92807f7de87cea33d3b0a89251069b9f
ref: release/0.27-stable
specs:
decidim (0.27.4)
Expand Down Expand Up @@ -282,7 +281,7 @@ GEM
nokogiri
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.848.0)
aws-partitions (1.849.0)
aws-sdk-core (3.186.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
Expand Down Expand Up @@ -447,23 +446,13 @@ GEM
file_validators (3.0.0)
activemodel (>= 3.2)
mime-types (>= 1.0)
fog-aws (3.21.0)
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
fog-core (2.3.0)
builder
excon (~> 0.71)
formatador (>= 0.2, < 2.0)
mime-types
fog-json (1.2.0)
fog-core
multi_json (~> 1.10)
fog-local (0.8.0)
fog-core (>= 1.27, < 3.0)
fog-xml (0.1.4)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
formatador (1.1.0)
foundation_rails_helper (4.0.1)
actionpack (>= 4.1, < 7.1)
Expand Down Expand Up @@ -583,10 +572,9 @@ GEM
mixlib-shellout (3.2.7)
chef-utils
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.6.0)
mustache (1.1.1)
net-imap (0.4.4)
net-imap (0.4.5)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -932,7 +920,6 @@ DEPENDENCIES
deface
faker (~> 2.18)
faraday
fog-aws
letter_opener_web
listen (~> 3.5)
memory_profiler
Expand Down
7 changes: 1 addition & 6 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
"corejs": false
}
],
[
"@babel/plugin-transform-regenerator",
{
"async": false
}
]
["@babel/plugin-transform-regenerator", { "async": false }]
]
}
9 changes: 1 addition & 8 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,15 @@
require "action_cable/engine"
# require "action_mailbox/engine"
# require "action_text/engine"
require_relative "../lib/decidim/env"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Decidim
def self.module_installed?(mod)
Gem.loaded_specs.has_key?("decidim-#{mod}")
end
end

module DecidimApplication
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
config.load_defaults 6.1

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
Expand Down
38 changes: 19 additions & 19 deletions config/initializers/carrierwave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@

# Although we use Backblaze's B2 as object storage for assets, we use its S3's compatible API. We
# briefly tried the `fog-backblaze` gem but things didn't seem to work at first.
if Rails.application.secrets.dig(:storage, :s3, :access_key_id)
require "carrierwave/storage/fog"
# if Rails.application.secrets.dig(:storage, :s3, :access_key_id)
# require "carrierwave/storage/fog"

CarrierWave.configure do |config|
config.storage = :fog
config.fog_provider = "fog/aws"
config.fog_credentials = {
provider: "AWS",
aws_access_key_id: Rails.application.secrets.dig(:storage, :s3, :access_key_id),
aws_secret_access_key: Rails.application.secrets.dig(:storage, :s3, :secret_access_key),
endpoint: Rails.application.secrets.dig(:storage, :s3, :endpoint)
}
config.fog_directory = Rails.application.secrets.dig(:storage, :s3, :bucket)
config.fog_public = true
config.fog_attributes = {
"Cache-Control" => "max-age=#{365.days.to_i}",
"X-Content-Type-Options" => "nosniff"
}
end
end
# CarrierWave.configure do |config|
# config.storage = :fog
# config.fog_provider = "fog/aws"
# config.fog_credentials = {
# provider: "AWS",
# aws_access_key_id: Rails.application.secrets.dig(:storage, :s3, :access_key_id),
# aws_secret_access_key: Rails.application.secrets.dig(:storage, :s3, :secret_access_key),
# endpoint: Rails.application.secrets.dig(:storage, :s3, :endpoint)
# }
# config.fog_directory = Rails.application.secrets.dig(:storage, :s3, :bucket)
# config.fog_public = true
# config.fog_attributes = {
# "Cache-Control" => "max-age=#{365.days.to_i}",
# "X-Content-Type-Options" => "nosniff"
# }
# end
# end
2 changes: 1 addition & 1 deletion config/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ daily_open_data_job:
args:
task: decidim:open_data:export

daily_clean_delete_download_your_data_files_job:
daily_delete_download_your_data_files_job:
cron: "33 3 * * *"
class: "InvokeRakeTaskJob"
queue: default
Expand Down
9 changes: 9 additions & 0 deletions config/webpack/.modernizrrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"minify": true,
"options": [
"setClasses"
],
"feature-detects": [
"css/transitions"
]
}
18 changes: 15 additions & 3 deletions config/webpack/custom.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable */

const path = require("path");
const { config } = require("@rails/webpacker");
const { InjectManifest } = require("workbox-webpack-plugin");

module.exports = {
module: {
Expand Down Expand Up @@ -93,5 +92,18 @@ module.exports = {
optimization: {
runtimeChunk: false
},
entry: config.entrypoints
entry: config.entrypoints,
plugins: [
new InjectManifest({
swSrc: "src/decidim/sw/sw.js",

/**
* NOTE:
* @rails/webpacker outputs to '/packs',
* in order to make the SW run properly
* they must be put at the project's root folder '/'
*/
swDest: "../sw.js"
})
]
}
2 changes: 1 addition & 1 deletion config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ development:
hmr: false
client:
# Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
overlay: true
overlay: false
# May also be a string
# webSocketURL:
# hostname: "0.0.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def up
models = ActiveRecord::Base.descendants.select { |c| c.included_modules.include?(Decidim::HasReference) }

models.each do |model|
next unless model.table_exists?

model.find_each(&:touch)
end
end
Expand Down
56 changes: 0 additions & 56 deletions lib/decidim/env.rb

This file was deleted.

4 changes: 2 additions & 2 deletions spec/system/favicon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

it "uses the default favicon" do
visit decidim.root_path
expect(page).to have_xpath("/html/head/link[contains(@href, 'default_favicon')]", visible: :all)
expect(page).to have_xpath("/html/body/link[contains(@href, 'default_favicon')]", visible: :all)
end
end

Expand All @@ -25,7 +25,7 @@

it "uses the organization favicon" do
visit decidim.root_path
expect(page).to have_xpath("/html/head/link[contains(@href, 'icon.png')]", visible: :all)
expect(page).to have_xpath("/html/body/link[contains(@href, 'icon.png')]", visible: :all)
end
end
end

0 comments on commit c212555

Please sign in to comment.