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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bcc252aa00bb8dac32547d85cf1fd53c72a4c9726b3e092389e9ad1ef464095
4
- data.tar.gz: 4c5c3d415f82750e64ab281791a90ed8a1069b52e136f399fca6baabe34a9bb0
3
+ metadata.gz: 78f89e2eccee1468634aeeb827a6316ad2aab8b6159e1be81fedad7dcf4af917
4
+ data.tar.gz: ce2f0dfc441128af6fac25e51eb64131b3e5aea68398b41af8f585d1529022c8
5
5
  SHA512:
6
- metadata.gz: d9c004225ef93e480ff61f4f1a244639afbab8fcdd532295f4cd459b8e693429f6a62810871a0f3a7bdcba67c42883c6fdf069b983ccd2e8ffc244af536212b6
7
- data.tar.gz: f49305ebbc5e40be87ab257273e26a2c51fffa497f6dd9ae4831cfb17d6c07f1a4e98ce629337b0ce0e8925d10a4c8147a0079f8b86b380c96860722507e023b
6
+ metadata.gz: '09855ccdcdec4dde56de8242614948af82513b56c38383e89149416b0e6e39ac0c0f58284410e9b536eb7dd89ccdcaa2f40b6933ecd76e506f7b478f02fc5ad3'
7
+ data.tar.gz: 259d5867d373e63750f9af64ab874f1402f2a6dfe7b3cc839ac6a9cb7bb6f29f729d48f24b9537146fafe0951cfff6b1184fbd8a94cce441639ee17ddebceec6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (2.4.1)
4
+ cm-admin (2.4.2)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '2.4.1'
2
+ VERSION = '2.4.2'
3
3
  end
@@ -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 'New Entity', class: 'drawer-btn', data: { behaviour: 'offcanvas', drawer_fetch_url: }
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.1
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-15 00:00:00.000000000 Z
17
+ date: 2024-10-16 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: caxlsx_rails