alchemy_cms 6.0.0.pre.rc4 → 6.0.0.pre.rc5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of alchemy_cms might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da8076b5e01533899e6c3003841940160335389c6e8a961bedec1b08839f61ba
4
- data.tar.gz: dfcd49629458243d86cb4bb49615da876b3e5bfb1b69de121f90fe6e98bb964c
3
+ metadata.gz: 380b59193f2297abbf578f48a662afd797a678edd9948b5967a5df870df20b5f
4
+ data.tar.gz: e36993e934138b801ce941d7a3b272790b41dde673f1cbded7e874cba637dd8d
5
5
  SHA512:
6
- metadata.gz: a25f6e26595f7b7e218200a0a7dbc1e69ac175c1daa3736b443501f80c8f1012215c69ab2f17addeb61b397cb3288b018b87f8e175d1ec9c1399e38101018d7f
7
- data.tar.gz: 1c8cee2a1c08c70581945e25dc0745ba9bf2dea83e44220e00a096fce531df941bea97405836dcc4cf650ede4e12162e7ab6b9dc18a8e297f4ac6f71a18643d6
6
+ metadata.gz: '01489e9bf191e8ba5f42d19dfc93336d318744c41ccf6764625ebf787b8f2f030d219829be4b3b5830db93699e681883217909d8239ca023323469c95b7aab28'
7
+ data.tar.gz: 33599581bdff5315660e260562179f7e9b12ef9269dd50aeba7e5e52cdcb8bf5db5188bb86cb8cc60b53a0346d6c0bf8fe336c5eef234aec54a6110f7d5386b8
@@ -72,13 +72,6 @@ jobs:
72
72
  sudo apt update -qq
73
73
  sudo apt install -qq --fix-missing libmysqlclient-dev -o dir::cache::archives="/home/runner/apt/cache"
74
74
  sudo chown -R runner /home/runner/apt/cache
75
- - name: Install bundler
76
- run: |
77
- gem install bundler
78
- - name: Install bundle
79
- timeout-minutes: 10
80
- run: |
81
- bundle install --jobs 4 --retry 3
82
75
  - name: Restore node modules cache
83
76
  id: yarn-cache
84
77
  uses: actions/cache@v2.1.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 6.0.0-rc5 (2022-02-24)
2
+
3
+ ### Changes
4
+
5
+ - Change database version to 6.0 [#2239](https://github.com/AlchemyCMS/alchemy_cms/pull/2239) ([tvdeyen](https://github.com/tvdeyen))
6
+ - Remove unused route [#2238](https://github.com/AlchemyCMS/alchemy_cms/pull/2238) ([phantomwhale](https://github.com/phantomwhale))
7
+ - Add custom gutentag tag validations class [#2232](https://github.com/AlchemyCMS/alchemy_cms/pull/2232) ([tvdeyen](https://github.com/tvdeyen))
8
+ - Touch nodes and all ancestors on page update [#2226](https://github.com/AlchemyCMS/alchemy_cms/pull/2226) ([tvdeyen](https://github.com/tvdeyen))
9
+ - Extract Airbrake error handler into extension [#2221](https://github.com/AlchemyCMS/alchemy_cms/pull/2221) ([tvdeyen](https://github.com/tvdeyen))
10
+
1
11
  ## 6.0.0-rc4 (2022-01-16)
2
12
 
3
13
  ### Changes
@@ -144,7 +144,7 @@ module Alchemy
144
144
  after_update :create_legacy_url,
145
145
  if: :saved_change_to_urlname?
146
146
 
147
- after_update -> { nodes.update_all(updated_at: Time.current) }
147
+ after_update :touch_nodes
148
148
 
149
149
  # Concerns
150
150
  include PageScopes
@@ -603,5 +603,10 @@ module Alchemy
603
603
  def create_legacy_url
604
604
  legacy_urls.find_or_create_by(urlname: urlname_before_last_save)
605
605
  end
606
+
607
+ def touch_nodes
608
+ ids = node_ids + nodes.flat_map { |n| n.ancestors.pluck(:id) }
609
+ Node.where(id: ids).touch_all
610
+ end
606
611
  end
607
612
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ class TagValidations
5
+ def self.call(klass)
6
+ new(klass).call
7
+ end
8
+
9
+ def initialize(klass)
10
+ @klass = klass
11
+ end
12
+
13
+ def call
14
+ klass.validates :name, presence: true, uniqueness: { case_sensitive: true }
15
+ end
16
+
17
+ private
18
+
19
+ attr_reader :klass
20
+ end
21
+ end
data/config/routes.rb CHANGED
@@ -124,7 +124,6 @@ Alchemy::Engine.routes.draw do
124
124
 
125
125
  resources :messages, only: [:index, :new, :create]
126
126
  resources :elements, only: :show
127
- resources :contents, only: :show
128
127
 
129
128
  namespace :api, defaults: { format: "json" } do
130
129
  resources :contents, only: [:index, :show]
@@ -1,23 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
3
+ class AlchemyFourPointFour < ActiveRecord::Migration[6.0]
4
4
  def up
5
5
  unless table_exists?("alchemy_attachments")
6
- create_table "alchemy_attachments", force: :cascade do |t|
6
+ create_table "alchemy_attachments" do |t|
7
7
  t.string "name"
8
8
  t.string "file_name"
9
9
  t.string "file_mime_type"
10
10
  t.integer "file_size"
11
11
  t.references "creator"
12
12
  t.references "updater"
13
- t.timestamps null: false
13
+ t.timestamps
14
14
  t.string "file_uid"
15
15
  t.index ["file_uid"], name: "index_alchemy_attachments_on_file_uid"
16
16
  end
17
17
  end
18
18
 
19
19
  unless table_exists?("alchemy_contents")
20
- create_table "alchemy_contents", force: :cascade do |t|
20
+ create_table "alchemy_contents" do |t|
21
21
  t.string "name"
22
22
  t.references "essence", null: false, polymorphic: true, index: { unique: true }
23
23
  t.references "element", null: false
@@ -25,14 +25,14 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
25
25
  end
26
26
 
27
27
  unless table_exists?("alchemy_elements")
28
- create_table "alchemy_elements", force: :cascade do |t|
28
+ create_table "alchemy_elements" do |t|
29
29
  t.string "name"
30
30
  t.integer "position"
31
31
  t.references "page", null: false, index: false
32
32
  t.boolean "public", default: true
33
33
  t.boolean "folded", default: false
34
34
  t.boolean "unique", default: false
35
- t.timestamps null: false
35
+ t.timestamps
36
36
  t.references "creator"
37
37
  t.references "updater"
38
38
  t.references "parent_element", index: false
@@ -44,27 +44,27 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
44
44
  end
45
45
 
46
46
  unless table_exists?("alchemy_elements_alchemy_pages")
47
- create_table "alchemy_elements_alchemy_pages", id: false, force: :cascade do |t|
47
+ create_table "alchemy_elements_alchemy_pages", id: false do |t|
48
48
  t.references "element"
49
49
  t.references "page"
50
50
  end
51
51
  end
52
52
 
53
53
  unless table_exists?("alchemy_essence_booleans")
54
- create_table "alchemy_essence_booleans", force: :cascade do |t|
54
+ create_table "alchemy_essence_booleans" do |t|
55
55
  t.boolean "value"
56
56
  t.index ["value"], name: "index_alchemy_essence_booleans_on_value"
57
57
  end
58
58
  end
59
59
 
60
60
  unless table_exists?("alchemy_essence_dates")
61
- create_table "alchemy_essence_dates", force: :cascade do |t|
61
+ create_table "alchemy_essence_dates" do |t|
62
62
  t.datetime "date"
63
63
  end
64
64
  end
65
65
 
66
66
  unless table_exists?("alchemy_essence_files")
67
- create_table "alchemy_essence_files", force: :cascade do |t|
67
+ create_table "alchemy_essence_files" do |t|
68
68
  t.references "attachment"
69
69
  t.string "title"
70
70
  t.string "css_class"
@@ -73,13 +73,13 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
73
73
  end
74
74
 
75
75
  unless table_exists?("alchemy_essence_htmls")
76
- create_table "alchemy_essence_htmls", force: :cascade do |t|
76
+ create_table "alchemy_essence_htmls" do |t|
77
77
  t.text "source"
78
78
  end
79
79
  end
80
80
 
81
81
  unless table_exists?("alchemy_essence_links")
82
- create_table "alchemy_essence_links", force: :cascade do |t|
82
+ create_table "alchemy_essence_links" do |t|
83
83
  t.string "link"
84
84
  t.string "link_title"
85
85
  t.string "link_target"
@@ -88,13 +88,13 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
88
88
  end
89
89
 
90
90
  unless table_exists?("alchemy_essence_pages")
91
- create_table "alchemy_essence_pages", force: :cascade do |t|
91
+ create_table "alchemy_essence_pages" do |t|
92
92
  t.references "page"
93
93
  end
94
94
  end
95
95
 
96
96
  unless table_exists?("alchemy_essence_pictures")
97
- create_table "alchemy_essence_pictures", force: :cascade do |t|
97
+ create_table "alchemy_essence_pictures" do |t|
98
98
  t.references "picture"
99
99
  t.string "caption"
100
100
  t.string "title"
@@ -111,7 +111,7 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
111
111
  end
112
112
 
113
113
  unless table_exists?("alchemy_essence_richtexts")
114
- create_table "alchemy_essence_richtexts", force: :cascade do |t|
114
+ create_table "alchemy_essence_richtexts" do |t|
115
115
  t.text "body"
116
116
  t.text "stripped_body"
117
117
  t.boolean "public"
@@ -119,14 +119,14 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
119
119
  end
120
120
 
121
121
  unless table_exists?("alchemy_essence_selects")
122
- create_table "alchemy_essence_selects", force: :cascade do |t|
122
+ create_table "alchemy_essence_selects" do |t|
123
123
  t.string "value"
124
124
  t.index ["value"], name: "index_alchemy_essence_selects_on_value"
125
125
  end
126
126
  end
127
127
 
128
128
  unless table_exists?("alchemy_essence_texts")
129
- create_table "alchemy_essence_texts", force: :cascade do |t|
129
+ create_table "alchemy_essence_texts" do |t|
130
130
  t.text "body"
131
131
  t.string "link"
132
132
  t.string "link_title"
@@ -137,7 +137,7 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
137
137
  end
138
138
 
139
139
  unless table_exists?("alchemy_folded_pages")
140
- create_table "alchemy_folded_pages", force: :cascade do |t|
140
+ create_table "alchemy_folded_pages" do |t|
141
141
  t.references "page", null: false, index: false
142
142
  t.references "user", null: false, index: false
143
143
  t.boolean "folded", default: false
@@ -146,13 +146,13 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
146
146
  end
147
147
 
148
148
  unless table_exists?("alchemy_languages")
149
- create_table "alchemy_languages", force: :cascade do |t|
149
+ create_table "alchemy_languages" do |t|
150
150
  t.string "name"
151
151
  t.string "language_code"
152
152
  t.string "frontpage_name"
153
153
  t.string "page_layout", default: "intro"
154
154
  t.boolean "public", default: false
155
- t.timestamps null: false
155
+ t.timestamps
156
156
  t.references "creator"
157
157
  t.references "updater"
158
158
  t.boolean "default", default: false
@@ -165,16 +165,16 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
165
165
  end
166
166
 
167
167
  unless table_exists?("alchemy_legacy_page_urls")
168
- create_table "alchemy_legacy_page_urls", force: :cascade do |t|
168
+ create_table "alchemy_legacy_page_urls" do |t|
169
169
  t.string "urlname", null: false
170
170
  t.references "page", null: false
171
- t.timestamps null: false
171
+ t.timestamps
172
172
  t.index ["urlname"], name: "index_alchemy_legacy_page_urls_on_urlname"
173
173
  end
174
174
  end
175
175
 
176
176
  unless table_exists?("alchemy_nodes")
177
- create_table "alchemy_nodes", force: :cascade do |t|
177
+ create_table "alchemy_nodes" do |t|
178
178
  t.string "name"
179
179
  t.string "title"
180
180
  t.string "url"
@@ -189,7 +189,7 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
189
189
  t.references "language", null: false
190
190
  t.references "creator"
191
191
  t.references "updater"
192
- t.timestamps null: false
192
+ t.timestamps
193
193
  t.references "site", null: false
194
194
  t.index ["lft"], name: "index_alchemy_nodes_on_lft"
195
195
  t.index ["rgt"], name: "index_alchemy_nodes_on_rgt"
@@ -197,7 +197,7 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
197
197
  end
198
198
 
199
199
  unless table_exists?("alchemy_pages")
200
- create_table "alchemy_pages", force: :cascade do |t|
200
+ create_table "alchemy_pages" do |t|
201
201
  t.string "name"
202
202
  t.string "urlname"
203
203
  t.string "title"
@@ -217,7 +217,7 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
217
217
  t.boolean "robot_follow", default: true
218
218
  t.boolean "sitemap", default: true
219
219
  t.boolean "layoutpage", default: false
220
- t.timestamps null: false
220
+ t.timestamps
221
221
  t.references "creator"
222
222
  t.references "updater"
223
223
  t.references "language"
@@ -234,12 +234,12 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
234
234
  end
235
235
 
236
236
  unless table_exists?("alchemy_pictures")
237
- create_table "alchemy_pictures", force: :cascade do |t|
237
+ create_table "alchemy_pictures" do |t|
238
238
  t.string "name"
239
239
  t.string "image_file_name"
240
240
  t.integer "image_file_width"
241
241
  t.integer "image_file_height"
242
- t.timestamps null: false
242
+ t.timestamps
243
243
  t.references "creator"
244
244
  t.references "updater"
245
245
  t.string "upload_hash"
@@ -250,10 +250,10 @@ class AlchemyFourPointFour < ActiveRecord::Migration[5.2]
250
250
  end
251
251
 
252
252
  unless table_exists?("alchemy_sites")
253
- create_table "alchemy_sites", force: :cascade do |t|
253
+ create_table "alchemy_sites" do |t|
254
254
  t.string "host"
255
255
  t.string "name"
256
- t.timestamps null: false
256
+ t.timestamps
257
257
  t.boolean "public", default: false
258
258
  t.text "aliases"
259
259
  t.boolean "redirect_to_primary_host"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateAlchemyEssenceNodes < ActiveRecord::Migration[5.2]
3
+ class CreateAlchemyEssenceNodes < ActiveRecord::Migration[6.0]
4
4
  def change
5
5
  create_table :alchemy_essence_nodes do |t|
6
6
  t.references "node"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- class RemoveSiteIdFromNodes < ActiveRecord::Migration[5.2]
2
+ class RemoveSiteIdFromNodes < ActiveRecord::Migration[6.0]
3
3
  def up
4
4
  remove_foreign_key :alchemy_nodes, :alchemy_sites
5
5
  remove_index :alchemy_nodes, :site_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddLanguageIdForeignKeyToAlchemyPages < ActiveRecord::Migration[5.2]
3
+ class AddLanguageIdForeignKeyToAlchemyPages < ActiveRecord::Migration[6.0]
4
4
  def change
5
5
  add_foreign_key :alchemy_pages, :alchemy_languages, column: :language_id
6
6
  change_column_null :alchemy_pages, :language_id, false, Alchemy::Language.default&.id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- class AddMenuTypeToAlchemyNodes < ActiveRecord::Migration[5.2]
2
+ class AddMenuTypeToAlchemyNodes < ActiveRecord::Migration[6.0]
3
3
  class LocalNode < ActiveRecord::Base
4
4
  self.table_name = :alchemy_nodes
5
5
  acts_as_nested_set scope: :language_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- class MakePageLayoutpageNullFalse < ActiveRecord::Migration[5.2]
2
+ class MakePageLayoutpageNullFalse < ActiveRecord::Migration[6.0]
3
3
  def change
4
4
  change_column_null :alchemy_pages, :layoutpage, false, false
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- class RemoveVisibleFromAlchemyPages < ActiveRecord::Migration[5.2]
2
+ class RemoveVisibleFromAlchemyPages < ActiveRecord::Migration[6.0]
3
3
  class LocalPage < ActiveRecord::Base
4
4
  self.table_name = "alchemy_pages"
5
5
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateAlchemyPictureThumbs < ActiveRecord::Migration[5.2]
3
+ class CreateAlchemyPictureThumbs < ActiveRecord::Migration[6.0]
4
4
  def up
5
5
  return if table_exists?(:alchemy_picture_thumbs)
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class RemoveTriStateBooleans < ActiveRecord::Migration[5.2]
3
+ class RemoveTriStateBooleans < ActiveRecord::Migration[6.0]
4
4
  def change
5
5
  change_column_null :alchemy_elements, :public, false, false
6
6
  change_column_default :alchemy_elements, :public, true
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreatePageVersions < ActiveRecord::Migration[5.2]
3
+ class CreatePageVersions < ActiveRecord::Migration[6.0]
4
4
  def change
5
5
  create_table :alchemy_page_versions do |t|
6
6
  t.references :page,
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddPageVersionIdToAlchemyElements < ActiveRecord::Migration[5.2]
3
+ class AddPageVersionIdToAlchemyElements < ActiveRecord::Migration[6.0]
4
4
  class LocalPage < ActiveRecord::Base
5
5
  self.table_name = :alchemy_pages
6
6
  has_many :elements, class_name: "LocalElement", inverse_of: :page
@@ -19,11 +19,12 @@ module Alchemy
19
19
  NonStupidDigestAssets.whitelist += [/^tinymce\//]
20
20
  end
21
21
 
22
- # Gutentag downcases all tgas before save.
23
- # We support having tags with uppercase characters.
24
- # The Gutentag search is case insensitive.
25
- initializer "alchemy.gutentag_normalizer" do
22
+ # Gutentag downcases all tags before save
23
+ # and Gutentag validations are not case sensitive.
24
+ # But we support having tags with uppercase characters.
25
+ config.to_prepare do
26
26
  Gutentag.normaliser = ->(value) { value.to_s }
27
+ Gutentag.tag_validations = Alchemy::TagValidations
27
28
  end
28
29
 
29
30
  # Custom Ransack sort arrows
@@ -44,12 +45,5 @@ module Alchemy
44
45
  end
45
46
  end
46
47
  end
47
-
48
- initializer "alchemy.error_tracking" do
49
- if defined?(Airbrake)
50
- require_relative "error_tracking/airbrake_handler"
51
- Alchemy::ErrorTracking.notification_handler = Alchemy::ErrorTracking::AirbrakeHandler
52
- end
53
- end
54
48
  end
55
49
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.0-rc4"
4
+ VERSION = "6.0.0-rc5"
5
5
 
6
6
  def self.version
7
7
  VERSION
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.0.0.pre.rc4
4
+ version: 6.0.0.pre.rc5
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: 2022-01-16 00:00:00.000000000 Z
16
+ date: 2022-02-24 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -1007,6 +1007,7 @@ files:
1007
1007
  - app/serializers/alchemy/picture_serializer.rb
1008
1008
  - app/services/alchemy/delete_elements.rb
1009
1009
  - app/services/alchemy/duplicate_element.rb
1010
+ - app/services/alchemy/tag_validations.rb
1010
1011
  - app/views/alchemy/_edit_mode.html.erb
1011
1012
  - app/views/alchemy/_menubar.html.erb
1012
1013
  - app/views/alchemy/_preview_mode_code.html.erb
@@ -1308,7 +1309,6 @@ files:
1308
1309
  - lib/alchemy/elements_finder.rb
1309
1310
  - lib/alchemy/engine.rb
1310
1311
  - lib/alchemy/error_tracking.rb
1311
- - lib/alchemy/error_tracking/airbrake_handler.rb
1312
1312
  - lib/alchemy/errors.rb
1313
1313
  - lib/alchemy/essence.rb
1314
1314
  - lib/alchemy/filetypes.rb
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- module ErrorTracking
5
- class AirbrakeHandler < BaseHandler
6
- def self.call(exception)
7
- return if ["development", "test"].include?(Rails.env)
8
-
9
- notify_airbrake(exception)
10
- end
11
- end
12
- end
13
- end