cm-admin 2.4.1 → 2.4.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1811b7dc704a66a4f26ec20ee3ff1a72c1cd369d19cc968d60fcfb135eab8ded
|
4
|
+
data.tar.gz: d2b62571d0a3f3205615a604bcfdaa046590621478be3aebd37be2025dac130b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee0549268bffe487c3eeabea14b127ea036b71ffbf18fbcdca944832c42558fb121f11cb4b4e7f5eb1baa9153614e588e92c21b295efce2511c06c7cfcd414a8
|
7
|
+
data.tar.gz: da4a8ab490c02decefe6597d8937da700762e91171af8859ee246e8cf769dab48356c292c750e26f111891496cf4100b865dd728cb750f7e979d0d90c10e9676
|
data/Gemfile.lock
CHANGED
@@ -47,7 +47,8 @@ $(document).on("click", '[data-behaviour="form_submit"]', function (e) {
|
|
47
47
|
});
|
48
48
|
if (submit.length === 0) {
|
49
49
|
$("." + form_class).submit();
|
50
|
-
|
50
|
+
$('[data-behaviour="form_submit_spinner"]').removeClass("visually-hidden");
|
51
|
+
return $('[data-behaviour="form_submit"]').addClass("visually-hidden");
|
51
52
|
}
|
52
53
|
});
|
53
54
|
|
@@ -36,6 +36,10 @@
|
|
36
36
|
text-decoration: underline;
|
37
37
|
}
|
38
38
|
|
39
|
+
.cm-admin .btn-loading {
|
40
|
+
@extend .btn, .btn-primary, .btn-sm, .btn-icon-spacing, .disabled;
|
41
|
+
}
|
42
|
+
|
39
43
|
// button mixin - We can use if needed
|
40
44
|
// @include button-variant($background: #6554e0, $border: #6554e0);
|
41
45
|
|
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)
|
@@ -180,7 +185,11 @@ module CmAdmin
|
|
180
185
|
|
181
186
|
concat split_form_into_section(resource, form_obj, entities)
|
182
187
|
concat tag.br
|
183
|
-
concat form_obj.submit 'Save', class: 'btn-cta', data: { behaviour: 'form_submit', form_class: "cm_#{form_obj.object.class.name.downcase}_form" }
|
188
|
+
concat form_obj.submit 'Save', class: 'btn-cta', data: { behaviour: 'form_submit', form_class: "cm_#{form_obj.object.class.name.downcase}_form", turbo_submits_with: 'Submitting...' }
|
189
|
+
concat (button_tag(type: 'button', class: 'btn-loading visually-hidden', data: { behaviour: 'form_submit_spinner' }) do
|
190
|
+
concat content_tag(:span, '', class: 'spinner-border spinner-border-sm', role: 'status')
|
191
|
+
concat ' Submitting...'
|
192
|
+
end)
|
184
193
|
concat button_tag 'Discard', class: 'btn-secondary discard-form', data: { behaviour: 'discard_form' } unless @is_drawer_form
|
185
194
|
end
|
186
195
|
end
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael
|
@@ -11,10 +11,10 @@ authors:
|
|
11
11
|
- Pranav
|
12
12
|
- Mahaveer
|
13
13
|
- Austin
|
14
|
-
autorequire:
|
14
|
+
autorequire:
|
15
15
|
bindir: exe
|
16
16
|
cert_chain: []
|
17
|
-
date: 2024-10-
|
17
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: caxlsx_rails
|
@@ -507,7 +507,7 @@ licenses:
|
|
507
507
|
metadata:
|
508
508
|
homepage_uri: https://github.com/commutatus/cm-admin
|
509
509
|
source_code_uri: https://github.com/commutatus/cm-admin
|
510
|
-
post_install_message:
|
510
|
+
post_install_message:
|
511
511
|
rdoc_options: []
|
512
512
|
require_paths:
|
513
513
|
- lib
|
@@ -523,7 +523,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
523
523
|
version: '0'
|
524
524
|
requirements: []
|
525
525
|
rubygems_version: 3.5.16
|
526
|
-
signing_key:
|
526
|
+
signing_key:
|
527
527
|
specification_version: 4
|
528
528
|
summary: CmAdmin is a robust gem designed to assist in creating admin panels for Rails
|
529
529
|
applications
|