cm-admin 1.4.0 → 1.4.1
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/Gemfile.lock +1 -1
- data/app/views/layouts/_custom_action_modals.html.slim +7 -1
- data/app/views/layouts/cm_admin.html.slim +1 -1
- data/lib/cm_admin/models/action.rb +1 -1
- data/lib/cm_admin/models/dsl_method.rb +2 -2
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_field_helper.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: 71972c83f78f398ea36d7ebcff092bd08d6ebaed009bbd7cd4a7157932b37798
|
|
4
|
+
data.tar.gz: 43da1cdbad06a71d04357c6f63d9a2c16b9459c04dcabeb6b8e264c90187af73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc28d6cebd0d4c19193922677bfa2ad13fe384d3453bd31fce263d32bfe79a6f8a48344a36874bc3f002b25c441d532e95557b1f565a932d7a688f54145971b0
|
|
7
|
+
data.tar.gz: 68b1596bb461e543f11591d3b969162e7f6465e7cf44ad24225b3191dc9256ccb579173a138e11f8ecc4256a0a1cd15ec4c3316d99c4f87f28f028ccf64ac9f6
|
data/Gemfile.lock
CHANGED
|
@@ -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 }
|
|
@@ -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
|
data/lib/cm_admin/version.rb
CHANGED
|
@@ -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.
|
|
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.
|
|
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-
|
|
13
|
+
date: 2023-12-20 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|