polaris_view_components 0.13.2 → 0.13.4
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/helpers/polaris/form_builder.rb +9 -6
- data/lib/install/install.rb +1 -1
- data/lib/polaris/view_components/engine.rb +3 -0
- data/lib/polaris/view_components/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: b7d052a6fa246f0e105b8b14d20eaf63e9026e41d62914e98142319cbb369d7b
|
4
|
+
data.tar.gz: db839814e647f792b4bbce8de63ef599bec70865750e5a2fefb51e4aacc875fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb725f2d852a297e88d3cb5eb42be10e4c19045b8ca7392f5263a233b90a43ba2ec2bcac6c73b7ad2a593dba3e746f610780f59aab65e85a25ca76c31f6175ad
|
7
|
+
data.tar.gz: 3509e930ba377b466ac97cf13e12386ae1495ae80dd61ff65a1043e0ce5076a627e72bae003d6e9102e5c13d90312dcdac8335a891fe592acb5d9048cc605cd9
|
data/README.md
CHANGED
@@ -26,10 +26,10 @@ Render Polaris ViewComponents:
|
|
26
26
|
|
27
27
|
## Installation
|
28
28
|
|
29
|
-
Add to
|
29
|
+
Add `polaris_view_components` to your Gemfile:
|
30
30
|
|
31
|
-
```
|
32
|
-
|
31
|
+
```bash
|
32
|
+
bundle add polaris_view_components
|
33
33
|
```
|
34
34
|
|
35
35
|
Run installer:
|
@@ -16,12 +16,15 @@ module Polaris
|
|
16
16
|
model: object.class.model_name.human.downcase
|
17
17
|
)
|
18
18
|
|
19
|
-
render Polaris::BannerComponent.new(title: title, status: :critical, within: :container) do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
render Polaris::BannerComponent.new(title: title, status: :critical, within: :container) do |banner|
|
20
|
+
[
|
21
|
+
render(Polaris::ListComponent.new) do |list|
|
22
|
+
object.errors.full_messages.each do |error|
|
23
|
+
list.item { error.html_safe }
|
24
|
+
end
|
25
|
+
end,
|
26
|
+
(template.capture { yield(banner) } if block_given?)
|
27
|
+
].compact.join.html_safe
|
25
28
|
end
|
26
29
|
end
|
27
30
|
|
data/lib/install/install.rb
CHANGED
@@ -30,7 +30,7 @@ if IMPORTMAP_BINSTUB.exist?
|
|
30
30
|
|
31
31
|
say "Pin polaris_view_components"
|
32
32
|
append_to_file IMPORTMAP_CONFIG_PATH do
|
33
|
-
|
33
|
+
%(pin "polaris-view-components", to: "polaris_view_components.js"\n)
|
34
34
|
end
|
35
35
|
else
|
36
36
|
package_json = File.read(Rails.root.join("package.json"))
|
@@ -36,7 +36,10 @@ module Polaris
|
|
36
36
|
|
37
37
|
initializer "polaris_view_components.helpers" do
|
38
38
|
ActiveSupport.on_load(:action_controller_base) do
|
39
|
+
require "polaris/view_helper"
|
39
40
|
helper Polaris::ViewHelper
|
41
|
+
|
42
|
+
require "polaris/url_helper"
|
40
43
|
helper Polaris::UrlHelper
|
41
44
|
end
|
42
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polaris_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Gamble
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-04-
|
12
|
+
date: 2023-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|