alchemy_cms 6.0.0.pre.b5 → 6.0.0.pre.b6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/controllers/alchemy/admin/elements_controller.rb +8 -4
- data/app/models/alchemy/element/presenters.rb +9 -2
- data/lib/alchemy/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2356162437442579cc431fade3fc3486f5262d22e6a6212950634e5ac90f595
|
4
|
+
data.tar.gz: 4a933ae8c9652adbe6fef16cf2e420c31160b4352fb2fba3a15f536f67f1dbc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807c2793f1805245bf12512582f2bfd06acdc777a811b070877447792d20b5cfae46b7e04276d90aed455f97fca91f88385df51317a294b9569b7e845017dfbe
|
7
|
+
data.tar.gz: 04ec712fe19f499cf0174ee0d044a6c086abec3c063cfa5df32380033de40f4373c9e0978f626a74ac83a67b190ef4154566da152b39e02dba47b15bc6d9e94f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 6.0.0-b6 (2021-09-02)
|
2
|
+
|
3
|
+
- Fix element with ingredients preview text [#2187](https://github.com/AlchemyCMS/alchemy_cms/pull/2187) ([tvdeyen](https://github.com/tvdeyen))
|
4
|
+
- Do not validate element during toggle fold and create [#2186](https://github.com/AlchemyCMS/alchemy_cms/pull/2186) ([tvdeyen](https://github.com/tvdeyen))
|
1
5
|
## 6.0.0-b5 (2021-08-27)
|
2
6
|
|
3
7
|
- Remove spec that tests default data store value [#2184](https://github.com/AlchemyCMS/alchemy_cms/pull/2184) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -32,14 +32,14 @@ module Alchemy
|
|
32
32
|
if @paste_from_clipboard = params[:paste_from_clipboard].present?
|
33
33
|
@element = paste_element_from_clipboard
|
34
34
|
else
|
35
|
-
@element = Element.
|
35
|
+
@element = Element.new(create_element_params)
|
36
36
|
end
|
37
37
|
if @page.definition["insert_elements_at"] == "top"
|
38
38
|
@insert_at_top = true
|
39
|
-
@element.
|
39
|
+
@element.position = 1
|
40
40
|
end
|
41
41
|
end
|
42
|
-
if @element.
|
42
|
+
if @element.save
|
43
43
|
render :create
|
44
44
|
else
|
45
45
|
@element.page_version = @page_version
|
@@ -91,10 +91,14 @@ module Alchemy
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
+
# Toggle fodls the element and persists the state in the db
|
95
|
+
#
|
96
|
+
# Ingredient validations might make the element invalid.
|
97
|
+
# In this case we are just toggling a UI state and do not care about the validations.
|
94
98
|
def fold
|
95
99
|
@page = @element.page
|
96
100
|
@element.folded = !@element.folded
|
97
|
-
@element.save
|
101
|
+
@element.save(validate: false)
|
98
102
|
end
|
99
103
|
|
100
104
|
private
|
@@ -99,12 +99,12 @@ module Alchemy
|
|
99
99
|
# The ingredient that's used for element's preview text.
|
100
100
|
#
|
101
101
|
# It tries to find one of element's ingredients that is defined +as_element_title+.
|
102
|
-
# Takes element's first ingredient if no ingredient is defined +as_element_title+.
|
102
|
+
# Takes element's first defined ingredient if no ingredient is defined +as_element_title+.
|
103
103
|
#
|
104
104
|
# @return (Alchemy::Ingredient)
|
105
105
|
#
|
106
106
|
def preview_ingredient
|
107
|
-
@_preview_ingredient ||= ingredients.detect(&:preview_ingredient?) ||
|
107
|
+
@_preview_ingredient ||= ingredients.detect(&:preview_ingredient?) || first_ingredient_by_definition
|
108
108
|
end
|
109
109
|
|
110
110
|
private
|
@@ -122,6 +122,13 @@ module Alchemy
|
|
122
122
|
def preview_text_from_preview_ingredient(maxlength)
|
123
123
|
preview_ingredient&.preview_text(maxlength)
|
124
124
|
end
|
125
|
+
|
126
|
+
def first_ingredient_by_definition
|
127
|
+
return if ingredient_definitions.empty?
|
128
|
+
|
129
|
+
role = ingredient_definitions.first["role"]
|
130
|
+
ingredients.detect { |ingredient| ingredient.role == role }
|
131
|
+
end
|
125
132
|
end
|
126
133
|
end
|
127
134
|
end
|
data/lib/alchemy/version.rb
CHANGED
data/package.json
CHANGED
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.
|
4
|
+
version: 6.0.0.pre.b6
|
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: 2021-
|
16
|
+
date: 2021-09-02 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|