cm-admin 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 680b8d7f174e764d9a17115f20014a8c02ff18a274bc4df022f5285671be343f
4
- data.tar.gz: b3278745964ecd7cfc13ea6a4c8381ba5b8ead0b19e086dcc125a6da6ab70fde
3
+ metadata.gz: 71972c83f78f398ea36d7ebcff092bd08d6ebaed009bbd7cd4a7157932b37798
4
+ data.tar.gz: 43da1cdbad06a71d04357c6f63d9a2c16b9459c04dcabeb6b8e264c90187af73
5
5
  SHA512:
6
- metadata.gz: f5ba67994c1f9746a5ccd57a02ea66ce0127cebfec936792f54ad655e8a7a5dc075bfa7c25d3294b234baf095cbf956ef70f65310d332b1271410d51b0728878
7
- data.tar.gz: 26c7185ff4ef0168e0ee16936a4518e84250836c10a3b549d21f0691816411d407b99e030c7d605524da04e58fabc4ff424a6de0069bc887b8e820320e622f63
6
+ metadata.gz: fc28d6cebd0d4c19193922677bfa2ad13fe384d3453bd31fce263d32bfe79a6f8a48344a36874bc3f002b25c441d532e95557b1f565a932d7a688f54145971b0
7
+ data.tar.gz: 68b1596bb461e543f11591d3b969162e7f6465e7cf44ad24225b3191dc9256ccb579173a138e11f8ecc4256a0a1cd15ec4c3316d99c4f87f28f028ccf64ac9f6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.4.0)
4
+ cm-admin (1.4.1)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -15,4 +15,10 @@
15
15
  - custom_action_with_modals.each do |custom_action|
16
16
  = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: @ar_object }
17
17
  - if destroy_action
18
- = render partial: '/layouts/destroy_action_modal', locals: { ar_object: @ar_object }
18
+ = render partial: '/layouts/destroy_action_modal', locals: { ar_object: @ar_object }
19
+ - elsif @current_action&.action_type == :custom && @associated_ar_object&.data.present?
20
+ - @associated_ar_object.data.each do |ar_object|
21
+ - custom_action_with_modals.select{|custom_action| custom_action.model_name == @current_action.child_records.to_s.classify}.each do |custom_action|
22
+ = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: ar_object }
23
+ - if destroy_action
24
+ = render partial: '/layouts/destroy_action_modal', locals: { ar_object: ar_object }
@@ -47,6 +47,6 @@ html
47
47
  - else
48
48
  = yield
49
49
  = render 'layouts/cm_flash_message'
50
- - unless (@current_action.view_type || params[:view_type])
50
+ - unless (@current_action.view_type == :kanban || params[:view_type] == 'kanban')
51
51
  = render 'layouts/custom_action_modals'
52
52
 
@@ -7,7 +7,7 @@ module CmAdmin
7
7
  attr_accessor :name, :display_name, :verb, :layout_type, :layout, :partial, :path, :page_title, :page_description,
8
8
  :child_records, :is_nested_field, :nested_table_name, :parent, :display_if, :route_type, :code_block,
9
9
  :display_type, :action_type, :redirection_url, :sort_direction, :sort_column, :icon_name, :scopes, :view_type,
10
- :kanban_attr
10
+ :kanban_attr, :model_name
11
11
 
12
12
  VALID_SORT_DIRECTION = Set[:asc, :desc].freeze
13
13
 
@@ -61,7 +61,7 @@ module CmAdmin
61
61
  else
62
62
  action = CmAdmin::Models::Action.new(name: custom_action.to_s, verb: :get, path: ':id/'+custom_action,
63
63
  layout_type: layout_type, layout: layout, partial: partial, child_records: associated_model,
64
- action_type: :custom, display_type: :page)
64
+ action_type: :custom, display_type: :page, model_name: self.name)
65
65
  @available_actions << action
66
66
  @current_action = action
67
67
  @available_tabs << CmAdmin::Models::Tab.new(tab_name, custom_action, display_if, &block)
@@ -137,7 +137,7 @@ module CmAdmin
137
137
  layout_type: layout_type, partial: partial, path: path,
138
138
  parent: self.current_action.name, display_type: display_type, display_if: display_if,
139
139
  action_type: :custom, route_type: route_type, icon_name: icon_name, modal_configuration: modal_configuration,
140
- url_params: url_params, &block)
140
+ model_name: self.name, url_params: url_params, &block)
141
141
  @available_actions << action
142
142
  # self.class.class_eval(&block)
143
143
  end
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -27,7 +27,7 @@ module CmAdmin
27
27
  end
28
28
 
29
29
  def cm_decimal_field(form_obj, cm_field, value, required_class, _target_action)
30
- form_obj.number_field cm_field.field_name,
30
+ form_obj.text_field cm_field.field_name,
31
31
  class: "field-control #{required_class}",
32
32
  disabled: cm_field.disabled.call(form_obj.object),
33
33
  value: value,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sajinmp
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-12-12 00:00:00.000000000 Z
13
+ date: 2023-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails