view_component 2.56.0 → 2.57.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of view_component might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +26 -0
- data/lib/view_component/base.rb +6 -2
- data/lib/view_component/test_helpers.rb +10 -1
- data/lib/view_component/version.rb +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: a22d7248560f80072ed000776afa4f92b164cd80931570feb4a3416bb6ba3627
|
4
|
+
data.tar.gz: 9bc617ae2ff51bad6f61b41412b4b3827c4bbe3f2366e0a3829ee00216d9518d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 648585993d06389775c8d14edee060fc551394edadaa7337a4b10709183941f9143cad71dc045ec4dca50db5bd568b8b57066518c0222e32e569f89e787043af
|
7
|
+
data.tar.gz: 4c8fbee2640a2fba303ce93010bdf789cbe094f233e7253dc4491207cadd3101914d86ae22c4b85e7c3db78b18e048b14955b41ce86ceb510fd4495e6ef216dc
|
data/docs/CHANGELOG.md
CHANGED
@@ -9,6 +9,32 @@ title: Changelog
|
|
9
9
|
|
10
10
|
## main
|
11
11
|
|
12
|
+
## 2.57.0
|
13
|
+
|
14
|
+
* Add missing `require` for `Translatable` module in `Base`.
|
15
|
+
|
16
|
+
*Hans Lemuet*
|
17
|
+
|
18
|
+
* Allow anything that responds to `#render_in` to be rendered in the parent component's view context.
|
19
|
+
|
20
|
+
*Cameron Dutro*
|
21
|
+
|
22
|
+
* Fix script/release so it honors semver.
|
23
|
+
|
24
|
+
*Cameron Dutro*
|
25
|
+
|
26
|
+
## 2.56.2
|
27
|
+
|
28
|
+
* Restore removed `rendered_component`, marking it for deprecation in v3.0.0.
|
29
|
+
|
30
|
+
*Tyson Gach*, *Richard Macklin*, *Joel Hawksley*
|
31
|
+
|
32
|
+
## 2.56.1
|
33
|
+
|
34
|
+
* Rename private accessor `rendered_component` to `rendered_content`.
|
35
|
+
|
36
|
+
*Yoshiyuki Hirano*, *Simon Dawson*
|
37
|
+
|
12
38
|
## 2.56.0
|
13
39
|
|
14
40
|
* Introduce experimental `render_preview` test helper. Note: `@rendered_component` in `TestHelpers` has been renamed to `@rendered_content`.
|
data/lib/view_component/base.rb
CHANGED
@@ -9,6 +9,7 @@ require "view_component/polymorphic_slots"
|
|
9
9
|
require "view_component/previewable"
|
10
10
|
require "view_component/slotable"
|
11
11
|
require "view_component/slotable_v2"
|
12
|
+
require "view_component/translatable"
|
12
13
|
require "view_component/with_content_helper"
|
13
14
|
|
14
15
|
module ViewComponent
|
@@ -182,8 +183,11 @@ module ViewComponent
|
|
182
183
|
#
|
183
184
|
# @private
|
184
185
|
def render(options = {}, args = {}, &block)
|
185
|
-
if options.
|
186
|
-
options.
|
186
|
+
if options.respond_to?(:render_in)
|
187
|
+
if options.is_a?(ViewComponent::Base)
|
188
|
+
options.__vc_original_view_context = __vc_original_view_context
|
189
|
+
end
|
190
|
+
|
187
191
|
super
|
188
192
|
else
|
189
193
|
__vc_original_view_context.render(options, args, &block)
|
@@ -30,7 +30,16 @@ module ViewComponent
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# @private
|
33
|
-
attr_reader :
|
33
|
+
attr_reader :rendered_content
|
34
|
+
|
35
|
+
def rendered_component
|
36
|
+
ViewComponent::Deprecation.warn(
|
37
|
+
"`rendered_component` is deprecated and will be removed in v3.0.0. " \
|
38
|
+
"Use `page` instead."
|
39
|
+
)
|
40
|
+
|
41
|
+
rendered_content
|
42
|
+
end
|
34
43
|
|
35
44
|
# Render a component inline. Internally sets `page` to be a `Capybara::Node::Simple`,
|
36
45
|
# allowing for Capybara assertions to be used:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.57.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|