para 0.12.4 → 0.12.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a6fa08f8df1085f17f1f988dc1059f8442179e0d11e1fea66cfb6f1206f3c0a
4
- data.tar.gz: 53e0d26aa54c3402b3bb1ab78283a23802f151cf60cc139a354c177f103d6824
3
+ metadata.gz: 54ef941e16858159844a9edfc2d38bf45205c54b0de05a9138db4db9b55f9cd9
4
+ data.tar.gz: a3119a93739b8f5590984e0e78279258d580be453a39e880446ec9026c5f4783
5
5
  SHA512:
6
- metadata.gz: 22fd8dca678dd2d10589dcf7ebd06098ae3c8901f0b00643fedbf698ee3772ec74eb1ef74df4acf930cf99028ca8b8423408922d2450434f222b68e64bd927b9
7
- data.tar.gz: b7be03740c3004f80ece9fb7b3662e4fcbaec530603af948c6d805e68cb09bfce3e15231b7e39a6203eeb68244807797fa80c2d032d94928aef0f4690d48bb4e
6
+ metadata.gz: a81dade0932df9173846f0d9ea7750def8140f1f2b62c88b0d5098d67cb59b05bf26053d0cc1902bcaca9743eba7b278ce472d923406e620ae3679302035302e
7
+ data.tar.gz: 657bef4b4cf573e663459e548bc1b198d621e517a4178f6acf3aea3520ecba5ea19b5f871561657ca704d7cb3b63cedefb228b82e280b3e422db68b0d549ea71
@@ -13,6 +13,5 @@
13
13
  - form.object_name = @object_name
14
14
  - nested_form = capture do
15
15
  = render(partial: find_partial_for(@model, :remote_nested_form), locals: { form: form, model: @model, object: @object, object_name: @object_name })
16
- = form.attributes_mappings_field_for(form)
17
16
 
18
17
  = nested_form
@@ -1,2 +1,2 @@
1
- = link_to_add_association form, attribute_name, partial: find_partial_for(model, 'nested_many/container', partial_dir: 'inputs'), form_name: 'form', class: "btn btn-shadow add-button nested-many-inset-add-button #{add_button_class}", data: { :'association-insertion-node' => "##{ dom_identifier }", :'association-insertion-method' => 'append' }, render_options: { nested_attribute_name: attribute_name, orderable: orderable, locals: { model: model, nested_locals: nested_locals, inset: inset, uncollapsed: uncollapsed, allow_destroy_if: allow_destroy_if, render_partial: render_partial, remote_partial_params: remote_partial_params } } do
1
+ = link_to_add_association form, attribute_name, partial: find_partial_for(model, 'nested_many/container', partial_dir: 'inputs'), form_name: 'form', class: "btn btn-shadow add-button nested-many-inset-add-button #{add_button_class}", data: { :'association-insertion-node' => "##{ dom_identifier }", :'association-insertion-method' => 'append' }, render_options: { nested_attribute_name: attribute_name, orderable: orderable, track_attribute_mappings: render_partial, locals: { model: model, nested_locals: nested_locals, inset: inset, uncollapsed: uncollapsed, allow_destroy_if: allow_destroy_if, render_partial: render_partial, remote_partial_params: remote_partial_params } } do
2
2
  = add_button_label
@@ -1,7 +1,7 @@
1
1
  - if subclasses.one?
2
2
  - submodel = subclasses.first
3
3
 
4
- = link_to_add_association form, attribute_name, wrap_object: proc { with_inverse_association_for(submodel.new, attribute_name, form.object) }, partial: find_partial_for(model, 'nested_many/container', partial_dir: 'inputs'), form_name: 'form', class: "btn btn-shadow add-button nested-many-inset-add-button #{add_button_class}", data: { :'association-insertion-node' => "##{ dom_identifier }", :'association-insertion-method' => 'append' }, render_options: { nested_attribute_name: attribute_name, orderable: orderable, locals: { model: submodel, nested_locals: nested_locals, inset: inset, uncollapsed: uncollapsed, render_partial: render_partial, remote_partial_params: remote_partial_params, allow_destroy_if: allow_destroy_if } } do
4
+ = link_to_add_association form, attribute_name, wrap_object: proc { with_inverse_association_for(submodel.new, attribute_name, form.object) }, partial: find_partial_for(model, 'nested_many/container', partial_dir: 'inputs'), form_name: 'form', class: "btn btn-shadow add-button nested-many-inset-add-button #{add_button_class}", data: { :'association-insertion-node' => "##{ dom_identifier }", :'association-insertion-method' => 'append' }, render_options: { nested_attribute_name: attribute_name, orderable: orderable, track_attribute_mappings: render_partial, locals: { model: submodel, nested_locals: nested_locals, inset: inset, uncollapsed: uncollapsed, render_partial: render_partial, remote_partial_params: remote_partial_params, allow_destroy_if: allow_destroy_if } } do
5
5
  = add_button_label
6
6
  - else
7
7
  .add-button.nested-many-inset-add-button.dropdown
@@ -11,5 +11,5 @@
11
11
  %ul.dropdown-menu
12
12
  - subclasses.each do |submodel|
13
13
  %li
14
- = link_to_add_association form, attribute_name, wrap_object: proc { with_inverse_association_for(submodel.new, attribute_name, form.object) }, partial: find_partial_for(submodel, 'nested_many/container', partial_dir: 'inputs'), form_name: 'form', class: 'dropdown-link', data: { :'association-insertion-node' => "##{ dom_identifier }", :'association-insertion-method' => 'append' }, render_options: { nested_attribute_name: attribute_name, orderable: orderable, locals: { model: submodel, nested_locals: nested_locals, inset: inset, uncollapsed: uncollapsed, allow_destroy_if: allow_destroy_if, render_partial: render_partial, remote_partial_params: remote_partial_params } } do
14
+ = link_to_add_association form, attribute_name, wrap_object: proc { with_inverse_association_for(submodel.new, attribute_name, form.object) }, partial: find_partial_for(submodel, 'nested_many/container', partial_dir: 'inputs'), form_name: 'form', class: 'dropdown-link', data: { :'association-insertion-node' => "##{ dom_identifier }", :'association-insertion-method' => 'append' }, render_options: { nested_attribute_name: attribute_name, orderable: orderable, track_attribute_mappings: render_partial, locals: { model: submodel, nested_locals: nested_locals, inset: inset, uncollapsed: uncollapsed, allow_destroy_if: allow_destroy_if, render_partial: render_partial, remote_partial_params: remote_partial_params } } do
15
15
  = submodel.model_name.human
@@ -38,6 +38,11 @@ Para.config do |config|
38
38
  #
39
39
  # config.uncollapse_inset_nested_fields = false
40
40
 
41
+ # Set this to false if you want to define the :file and :image simple form inputs in the
42
+ # app, to customize them.
43
+ #
44
+ # config.load_file_inputs = false
45
+
41
46
  # Set if the Para::Breadcrumb::Controller module should be included into the
42
47
  # app, allowing easy breadcrumbs management in the app.
43
48
  #
data/lib/para/config.rb CHANGED
@@ -49,6 +49,12 @@ module Para
49
49
  mattr_accessor :uncollapse_inset_nested_fields
50
50
  @@uncollapse_inset_nested_fields = true
51
51
 
52
+ # Allow setting `load_file_inputs` to false to disable loading of simple form file
53
+ # inputs from SimpleFormExtension::Inputs module, allowing to use custom file inputs
54
+ # from the app.
55
+ mattr_accessor :load_file_inputs
56
+ @@load_file_inputs = true
57
+
52
58
  # Allows changing default cache store used by Para to store jobs through
53
59
  # the ActiveJob::Status gem
54
60
  #
@@ -1,7 +1,7 @@
1
1
  module Para
2
2
  module FormBuilder
3
3
  module AttributesMappingsTracker
4
- def initialize(*) #:nodoc:
4
+ def initialize(*) # :nodoc:
5
5
  @attributes_mappings = {}
6
6
 
7
7
  super
@@ -22,10 +22,9 @@ module Para
22
22
  def fields_for(*args, &block)
23
23
  fields_options = args.extract_options!
24
24
 
25
- track_attribute_mappings = (
25
+ track_attribute_mappings =
26
26
  fields_options[:track_attribute_mappings] != false &&
27
27
  options[:track_attribute_mappings]
28
- )
29
28
 
30
29
  fields_options.reverse_merge!(
31
30
  track_attribute_mappings: track_attribute_mappings
@@ -42,7 +41,7 @@ module Para
42
41
  return unless options[:track_attribute_mappings]
43
42
 
44
43
  hidden_field :_attributes_mappings, value: @attributes_mappings.to_json,
45
- data: { :'attributes-mappings' => fields.options[:child_index] }
44
+ data: { 'attributes-mappings': fields.options[:child_index] }
46
45
  end
47
46
 
48
47
  private
@@ -51,11 +50,11 @@ module Para
51
50
  return unless options[:track_attribute_mappings]
52
51
 
53
52
  type = if input_options[:as]
54
- input_options[:as]
55
- else
56
- input = find_input(attribute_name, input_options, &block)
57
- input.class.name.demodulize.underscore.gsub(/_input\z/, '')
58
- end
53
+ input_options[:as]
54
+ else
55
+ input = find_input(attribute_name, input_options, &block)
56
+ input.class.name.demodulize.underscore.gsub(/_input\z/, '')
57
+ end
59
58
 
60
59
  @attributes_mappings[attribute_name] = type
61
60
  end
data/lib/para/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Para
4
- VERSION = '0.12.4'
4
+ VERSION = '0.12.6'
5
5
  end
@@ -8,9 +8,12 @@ module SimpleFormExtension
8
8
  autoload :CollectionCheckBoxesInput
9
9
  autoload :CollectionRadioButtonsInput
10
10
  autoload :ColorInput
11
- autoload :FileInput
12
- autoload :ImageInput
13
11
  autoload :SelectizeInput
14
12
  autoload :SliderInput
13
+
14
+ if Para.config.load_file_inputs
15
+ autoload :FileInput
16
+ autoload :ImageInput
17
+ end
15
18
  end
16
19
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: active_decorator
@@ -777,7 +776,6 @@ homepage: http://github.com/glyph-fr/para
777
776
  licenses:
778
777
  - MIT
779
778
  metadata: {}
780
- post_install_message:
781
779
  rdoc_options: []
782
780
  require_paths:
783
781
  - lib
@@ -792,8 +790,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
792
790
  - !ruby/object:Gem::Version
793
791
  version: '0'
794
792
  requirements: []
795
- rubygems_version: 3.5.17
796
- signing_key:
793
+ rubygems_version: 3.6.7
797
794
  specification_version: 4
798
795
  summary: Rails admin engine
799
796
  test_files: []