alchemy_cms 6.1.2 → 6.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2f303fbee5eb7ba00c41042f4a2c435e345621eae81768d8c66f86dad04d23d
4
- data.tar.gz: e2ad0dfb05e0412676eb203c0ac7829d4945c8e8db879c8393748bb40089ce19
3
+ metadata.gz: 1ffc03e16f129a444f6adfcdf851012f04cdbca01d1bf10e8e4edae163383be2
4
+ data.tar.gz: c40cc3dd8deb37fa7cae8c78de08438c184d2200cce480fce1785cc5ca62f210
5
5
  SHA512:
6
- metadata.gz: 1ec82e1628873bcfb3f1e16826087289ab1dcefe4bb98598ad320bce329c3f1481dc0df28fdbd0570a3fb79f6325de4a9eee510dd4dc6a981f3cc82565bd908b
7
- data.tar.gz: 10c17180fbff27a83a2c6f052c200a9723858dea973f547206c9ca094e46b18bdc7130f5914e006acd058296b6783b4adafa47bc2bad87fca29ca6774673a973
6
+ metadata.gz: 141196b0c09257888ebe8408513ab5fb2bbebdcb5eaa4b8871fbec81afde8d6323021ca7d97dc2f880a44151860b618501b92f42e0649164ac6affdac01ca384
7
+ data.tar.gz: fc764011dd71971b3ec970bc0c86f8a5fc4f3b288f5e9596facb69dab8a5ad35805743dfe4c128682419b356504e6ab8b27b0db3e9d1da43d676b6a309615ba2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.1.4 (2023-05-18)
4
+
5
+ - [6.1] Revert "Preload related objects in Alchemy::PagesController" [#2473](https://github.com/AlchemyCMS/alchemy_cms/pull/2473) ([tvdeyen](https://github.com/tvdeyen))
6
+
7
+ ## 6.1.3 (2023-03-29)
8
+
9
+ - Fix installer: Add seeds file if not exists [#2446](https://github.com/AlchemyCMS/alchemy_cms/pull/2446) ([tvdeyen](https://github.com/tvdeyen))
10
+ - Integrate non_stupid_digest_assets gem [#2430](https://github.com/AlchemyCMS/alchemy_cms/pull/2430) ([afdev82](https://github.com/afdev82))
11
+
3
12
  ## 6.1.2 (2023-02-27)
4
13
 
5
14
  - [6.1] Fix thumbnail writing for multi-concurrent and multi-db setups [#2434](https://github.com/AlchemyCMS/alchemy_cms/pull/2434) ([tvdeyen](https://github.com/tvdeyen))
data/Gemfile CHANGED
@@ -19,6 +19,7 @@ group :development, :test do
19
19
  # in our case the culprit is `handlebars-assets`. The changes between 2.7.0 and 2.8.0 are
20
20
  # minimal, but breaking.
21
21
  gem "execjs", "= 2.8.1"
22
+ gem "selenium-webdriver", "< 4.9.1" # until https://github.com/teamcapybara/capybara/pull/2665 got merged
22
23
 
23
24
  if ENV["GITHUB_ACTIONS"]
24
25
  # Necessary because GH Actions gem cache does not have this "Bundled with Ruby" gem installed
data/alchemy_cms.gemspec CHANGED
@@ -45,7 +45,6 @@ Gem::Specification.new do |gem|
45
45
  gem.add_runtime_dependency "jquery-ui-rails", ["~> 6.0"]
46
46
  gem.add_runtime_dependency "kaminari", ["~> 1.1"]
47
47
  gem.add_runtime_dependency "originator", ["~> 3.1"]
48
- gem.add_runtime_dependency "non-stupid-digest-assets", ["~> 1.0.8"]
49
48
  gem.add_runtime_dependency "ransack", [">= 1.8", "< 4.0"]
50
49
  gem.add_runtime_dependency "request_store", ["~> 1.2"]
51
50
  gem.add_runtime_dependency "responders", [">= 2.0", "< 4.0"]
@@ -104,14 +104,7 @@ module Alchemy
104
104
  # If no index page and no admin users are present we show the "Welcome to Alchemy" page.
105
105
  #
106
106
  def load_index_page
107
- @page ||= begin
108
- Alchemy::Page.
109
- contentpages.
110
- language_roots.
111
- where(language: Language.current).
112
- includes(page_includes).
113
- first
114
- end
107
+ @page ||= Language.current_root_page
115
108
  render template: "alchemy/welcome", layout: false if signup_required?
116
109
  end
117
110
 
@@ -127,13 +120,10 @@ module Alchemy
127
120
  def load_page
128
121
  page_not_found! unless Language.current
129
122
 
130
- @page ||= begin
131
- Alchemy::Page.
132
- contentpages.
133
- where(language: Language.current).
134
- includes(page_includes).
135
- find_by(urlname: params[:urlname])
136
- end
123
+ @page ||= Language.current.pages.contentpages.find_by(
124
+ urlname: params[:urlname],
125
+ language_code: params[:locale] || Language.current.code,
126
+ )
137
127
  end
138
128
 
139
129
  def enforce_locale
@@ -244,9 +234,5 @@ module Alchemy
244
234
  def page_not_found!
245
235
  not_found_error!("Alchemy::Page not found \"#{request.fullpath}\"")
246
236
  end
247
-
248
- def page_includes
249
- Alchemy::EagerLoading.page_includes(version: :public_version)
250
- end
251
237
  end
252
238
  end
@@ -21,6 +21,7 @@
21
21
  #
22
22
 
23
23
  require_dependency "alchemy/element/definitions"
24
+ require_dependency "alchemy/element/dom_id"
24
25
  require_dependency "alchemy/element/element_contents"
25
26
  require_dependency "alchemy/element/element_ingredients"
26
27
  require_dependency "alchemy/element/element_essences"
@@ -136,14 +136,15 @@ module Alchemy
136
136
  end
137
137
 
138
138
  def alchemy_resource_filters
139
+ @_file_formats ||= distinct.pluck(:image_file_format).compact.presence || []
139
140
  [
140
141
  {
141
142
  name: :by_file_format,
142
- values: distinct.pluck(:image_file_format),
143
+ values: @_file_formats,
143
144
  },
144
145
  {
145
146
  name: :misc,
146
- values: %w(recent last_upload without_tag),
147
+ values: %w(recent last_upload without_tag deletable),
147
148
  },
148
149
  ]
149
150
  end
@@ -128,6 +128,7 @@ en:
128
128
  last_upload: Last upload only
129
129
  recent: Recently uploaded only
130
130
  without_tag: Without tag
131
+ deletable: Not linked by file content
131
132
  attachment:
132
133
  by_file_type:
133
134
  name: File Type
@@ -139,7 +140,6 @@ en:
139
140
  last_upload: Last upload only
140
141
  recent: Recently uploaded only
141
142
  without_tag: Without tag
142
- deletable: Not linked by file content
143
143
 
144
144
  # === Translations for content validations
145
145
  # Used when a user did not enter (correct) values to the content field.
@@ -31,7 +31,13 @@ module Alchemy
31
31
  end
32
32
 
33
33
  def inject_seeder
34
- append_file "./db/seeds.rb", "Alchemy::Seeder.seed!\n"
34
+ seed_file = Rails.root.join("db", "seeds.rb")
35
+ args = [seed_file, "Alchemy::Seeder.seed!\n"]
36
+ if File.exist?(seed_file)
37
+ append_file(*args)
38
+ else
39
+ add_file(*args)
40
+ end
35
41
  end
36
42
  end
37
43
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.1.2"
4
+ VERSION = "6.1.4"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/lib/alchemy_cms.rb CHANGED
@@ -15,7 +15,7 @@ require "handlebars_assets"
15
15
  require "jquery-rails"
16
16
  require "jquery-ui-rails"
17
17
  require "kaminari"
18
- require "non-stupid-digest-assets"
18
+ require "non_stupid_digest_assets"
19
19
  require "ransack"
20
20
  require "request_store"
21
21
  require "responders"
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sprockets/manifest"
4
+ require "active_support/core_ext/module/attribute_accessors"
5
+
6
+ module NonStupidDigestAssets
7
+ mattr_accessor :whitelist
8
+ @@whitelist = []
9
+
10
+ class << self
11
+ def assets(assets)
12
+ return assets if whitelist.empty?
13
+
14
+ whitelisted_assets(assets)
15
+ end
16
+
17
+ private
18
+
19
+ def whitelisted_assets(assets)
20
+ assets.select do |logical_path, _digest_path|
21
+ whitelist.any? do |item|
22
+ item =~ logical_path
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+ module CompileWithNonDigest
29
+ def compile(*args)
30
+ paths = super
31
+ NonStupidDigestAssets.assets(assets).each do |(logical_path, digest_path)|
32
+ full_digest_path = File.join dir, digest_path
33
+ full_digest_gz_path = "#{full_digest_path}.gz"
34
+ full_non_digest_path = File.join dir, logical_path
35
+ full_non_digest_gz_path = "#{full_non_digest_path}.gz"
36
+
37
+ if File.exist? full_digest_path
38
+ logger.debug "Writing #{full_non_digest_path}"
39
+ FileUtils.copy_file full_digest_path, full_non_digest_path, :preserve_attributes
40
+ else
41
+ logger.debug "Could not find: #{full_digest_path}"
42
+ end
43
+ if File.exist? full_digest_gz_path
44
+ logger.debug "Writing #{full_non_digest_gz_path}"
45
+ FileUtils.copy_file full_digest_gz_path, full_non_digest_gz_path, :preserve_attributes
46
+ else
47
+ logger.debug "Could not find: #{full_digest_gz_path}"
48
+ end
49
+ end
50
+ paths
51
+ end
52
+ end
53
+ end
54
+
55
+ Sprockets::Manifest.prepend NonStupidDigestAssets::CompileWithNonDigest
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.1.2",
3
+ "version": "6.1.4",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.2
4
+ version: 6.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2023-02-27 00:00:00.000000000 Z
16
+ date: 2023-05-18 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -387,20 +387,6 @@ dependencies:
387
387
  - - "~>"
388
388
  - !ruby/object:Gem::Version
389
389
  version: '3.1'
390
- - !ruby/object:Gem::Dependency
391
- name: non-stupid-digest-assets
392
- requirement: !ruby/object:Gem::Requirement
393
- requirements:
394
- - - "~>"
395
- - !ruby/object:Gem::Version
396
- version: 1.0.8
397
- type: :runtime
398
- prerelease: false
399
- version_requirements: !ruby/object:Gem::Requirement
400
- requirements:
401
- - - "~>"
402
- - !ruby/object:Gem::Version
403
- version: 1.0.8
404
390
  - !ruby/object:Gem::Dependency
405
391
  name: ransack
406
392
  requirement: !ruby/object:Gem::Requirement
@@ -1432,6 +1418,7 @@ files:
1432
1418
  - lib/generators/alchemy/site_layouts/templates/layout.html.haml
1433
1419
  - lib/generators/alchemy/site_layouts/templates/layout.html.slim
1434
1420
  - lib/generators/alchemy/views/views_generator.rb
1421
+ - lib/non_stupid_digest_assets.rb
1435
1422
  - lib/tasks/alchemy/db.rake
1436
1423
  - lib/tasks/alchemy/install.rake
1437
1424
  - lib/tasks/alchemy/thumbnails.rake
@@ -1538,7 +1525,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1538
1525
  version: '0'
1539
1526
  requirements:
1540
1527
  - ImageMagick (libmagick), v6.6 or greater.
1541
- rubygems_version: 3.4.6
1528
+ rubygems_version: 3.4.12
1542
1529
  signing_key:
1543
1530
  specification_version: 4
1544
1531
  summary: A powerful, userfriendly and flexible CMS for Rails