cm-admin 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_helper.rb +6 -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: 78f89e2eccee1468634aeeb827a6316ad2aab8b6159e1be81fedad7dcf4af917
|
4
|
+
data.tar.gz: ce2f0dfc441128af6fac25e51eb64131b3e5aea68398b41af8f585d1529022c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09855ccdcdec4dde56de8242614948af82513b56c38383e89149416b0e6e39ac0c0f58284410e9b536eb7dd89ccdcaa2f40b6933ecd76e506f7b478f02fc5ad3'
|
7
|
+
data.tar.gz: 259d5867d373e63750f9af64ab874f1402f2a6dfe7b3cc839ac6a9cb7bb6f29f729d48f24b9537146fafe0951cfff6b1184fbd8a94cce441639ee17ddebceec6
|
data/Gemfile.lock
CHANGED
data/lib/cm_admin/version.rb
CHANGED
@@ -142,9 +142,14 @@ module CmAdmin
|
|
142
142
|
ar_object = model_name.constantize.new if model_name.present?
|
143
143
|
return unless field.input_type.to_s == 'single_select' && model_name.present? && has_valid_policy(ar_object, 'new')
|
144
144
|
|
145
|
+
entity_formatted_name = if field.can_create_new_entity.is_a?(Hash) && field.can_create_new_entity[:display_name].present?
|
146
|
+
field.can_create_new_entity[:display_name]
|
147
|
+
else
|
148
|
+
CmAdmin::Model.find_by(name: model_name)&.formatted_name
|
149
|
+
end
|
145
150
|
field_id = form_obj.field_id(field.field_name.to_sym)
|
146
151
|
drawer_fetch_url = "#{CmAdmin::Engine.mount_path}/#{model_name.tableize}/fetch_drawer?from_field_id=#{field_id}"
|
147
|
-
tag.div
|
152
|
+
tag.div "New #{entity_formatted_name}", class: 'drawer-btn', data: { behaviour: 'offcanvas', drawer_fetch_url: }
|
148
153
|
end
|
149
154
|
|
150
155
|
def set_nested_section_form_fields(resource, form_obj, nested_sections)
|
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: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: exe
|
16
16
|
cert_chain: []
|
17
|
-
date: 2024-10-
|
17
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: caxlsx_rails
|