active_scaffold 4.1.2 → 4.1.4
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/CHANGELOG.rdoc +8 -0
- data/app/assets/javascripts/jquery/active_scaffold.js +2 -0
- data/app/assets/javascripts/jquery/tiny_mce_bridge.js +3 -6
- data/lib/active_scaffold/actions/core.rb +1 -0
- data/lib/active_scaffold/bridges/bitfields/bitfields_bridge.rb +5 -4
- data/lib/active_scaffold/extensions/action_view_rendering.rb +4 -0
- data/lib/active_scaffold/helpers/action_link_helpers.rb +2 -1
- data/lib/active_scaffold/version.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: 7779c25b68085b6f9211742c807f90113cdd42c9397e3c60fea72e27ec0eb1ac
|
|
4
|
+
data.tar.gz: 0730c726da51cc31d08fc8081022e249224feddcca239d09d1a663da9a49fa0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 205afed622c3b48938adc5baa75b8ca1e016ce4a959f5a60f539918f502d172f81d0c39b38bc4ea900ef37e49f7e5b6cb0bbb1c2d10122b3b72ec87a40075521
|
|
7
|
+
data.tar.gz: 21f01f191d84180b1b15ae54a3f4e9091fa9c088670105e6484a9ca641880c901e0aa803e4d0e38ec7d8a464a134a8826310a942981fd3b8447c094a128b8ef4
|
data/CHANGELOG.rdoc
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
- Fix dirty attributes on refresh_field action, record is built on unsaved instance copying attributes, but it reports only changed attributes from the form now
|
|
2
|
+
- Fix incompatibility with Rails renderable objects (ViewComponent, Turbo Streams)
|
|
3
|
+
|
|
4
|
+
= 4.1.3
|
|
5
|
+
- Columns using bitfields are not treated as number columns (e.g. don't get numeric class in list)
|
|
6
|
+
- Fix loading tinymce when the form is loaded on page load
|
|
7
|
+
- Speed up rendering action link with images, when list is long, image_path can be reused
|
|
8
|
+
|
|
1
9
|
= 4.1.2
|
|
2
10
|
- Call cache_column_counts in get_row, so custom code changing queries to calculate counts is used when a row is refreshed too
|
|
3
11
|
|
|
@@ -548,6 +548,7 @@
|
|
|
548
548
|
|
|
549
549
|
window.ActiveScaffold = {
|
|
550
550
|
last_focus: null,
|
|
551
|
+
setup_callbacks: [],
|
|
551
552
|
setup: function(container) {
|
|
552
553
|
/* setup some elements on page/form load */
|
|
553
554
|
ActiveScaffold.load_embedded(container);
|
|
@@ -560,6 +561,7 @@
|
|
|
560
561
|
if (container != document) {
|
|
561
562
|
jQuery('[data-rs-type]', container).each(function() { RecordSelect.from_attributes(jQuery(this)); });
|
|
562
563
|
}
|
|
564
|
+
ActiveScaffold.setup_callbacks.forEach(function(callback) { callback(container); });
|
|
563
565
|
},
|
|
564
566
|
setup_history_state: function() {
|
|
565
567
|
if (!jQuery('.active-scaffold').length) return;
|
|
@@ -36,11 +36,8 @@
|
|
|
36
36
|
jQuery(document).on('ajax:complete', 'form.as_form', function() {
|
|
37
37
|
jQuery('textarea.mceEditor', this).each(loadTinyMCE);
|
|
38
38
|
});
|
|
39
|
-
/* enable tinymce textarea after form open */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (action_link && action_link.adapter) {
|
|
43
|
-
jQuery(action_link.adapter).find('textarea.mceEditor').each(loadTinyMCE);
|
|
44
|
-
}
|
|
39
|
+
/* enable tinymce textarea after form open or page load */
|
|
40
|
+
ActiveScaffold.setup_callbacks.push(function(container) {
|
|
41
|
+
jQuery('textarea.mceEditor', container).each(loadTinyMCE);
|
|
45
42
|
});
|
|
46
43
|
})();
|
|
@@ -6,11 +6,12 @@ module ActiveScaffold
|
|
|
6
6
|
super
|
|
7
7
|
return unless model.respond_to?(:bitfields) && model.bitfields.present?
|
|
8
8
|
|
|
9
|
-
model.bitfields.
|
|
9
|
+
model.bitfields.each do |column, options|
|
|
10
|
+
columns[column].number = false
|
|
10
11
|
columns << options.keys
|
|
11
|
-
options.each_key.with_index(1) do |
|
|
12
|
-
columns[
|
|
13
|
-
columns[
|
|
12
|
+
options.each_key.with_index(1) do |bit_column, i|
|
|
13
|
+
columns[bit_column].form_ui = :checkbox
|
|
14
|
+
columns[bit_column].weight = 1000 + i
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -36,6 +36,8 @@ module ActiveScaffold # :nodoc:
|
|
|
36
36
|
# options[:xhr] force to load embedded scaffold with AJAX even when render_component gem is installed.
|
|
37
37
|
#
|
|
38
38
|
def render(*args, &)
|
|
39
|
+
return args.first.render_in(self) if args.one? && args.first.respond_to?(:render_in)
|
|
40
|
+
|
|
39
41
|
if args.first.is_a?(Hash) && args.first[:active_scaffold]
|
|
40
42
|
render_embedded args.first
|
|
41
43
|
elsif args.first == :super
|
|
@@ -182,6 +184,8 @@ module ActionView
|
|
|
182
184
|
# override the render method to use our @lookup_context instead of the
|
|
183
185
|
# memoized @_lookup_context
|
|
184
186
|
def render(options = {}, locals = {}, &block)
|
|
187
|
+
return options.render_in(self) if options.respond_to?(:render_in)
|
|
188
|
+
|
|
185
189
|
case options
|
|
186
190
|
when Hash
|
|
187
191
|
in_rendering_context(options) do |_|
|
|
@@ -317,7 +317,8 @@ module ActiveScaffold
|
|
|
317
317
|
def action_link_text(link, record, options)
|
|
318
318
|
if link.image
|
|
319
319
|
title = options[:link] || link.label(record)
|
|
320
|
-
|
|
320
|
+
asset = (@_link_images ||= {})[link.image[:name]] ||= image_path(link.image[:name])
|
|
321
|
+
text = image_tag(asset, size: link.image[:size], alt: title, title: title, skip_pipeline: true)
|
|
321
322
|
end
|
|
322
323
|
text || options[:link]
|
|
323
324
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_scaffold
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.1.
|
|
4
|
+
version: 4.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Many, see README
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-12-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dartsass-sprockets
|