activeadmin-tom_select 4.1.0 → 4.1.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/.claude/commands/fix-tests.md +1 -1
- data/.github/workflows/ci.yml +3 -4
- data/.github/workflows/npm-publish.yml +3 -3
- data/.rubocop.yml +1 -1
- data/AGENTS.md +2 -2
- data/CHANGELOG.md +19 -1
- data/Gemfile.lock +85 -79
- data/README.md +20 -18
- data/activeadmin-tom_select.gemspec +3 -3
- data/docs/guide-update-your-app.md +198 -25
- data/docs/update-tom-select.md +322 -158
- data/gemfiles/rails_7.x_active_admin_4.x.gemfile.lock +11 -11
- data/gemfiles/rails_8.x_active_admin_4.x.gemfile.lock +66 -64
- data/lib/activeadmin/inputs/filters/searchable_select_input.rb +5 -12
- data/lib/activeadmin/inputs/filters/tom_select_input.rb +19 -0
- data/lib/activeadmin/inputs/searchable_select_input.rb +5 -11
- data/lib/activeadmin/inputs/tom_select_input.rb +16 -0
- data/lib/activeadmin/tom_select/engine.rb +3 -1
- data/lib/activeadmin/tom_select/option_collection.rb +1 -1
- data/lib/activeadmin/tom_select/resource_dsl_extension.rb +1 -1
- data/lib/activeadmin/tom_select/resource_extension.rb +1 -1
- data/lib/activeadmin/tom_select/select_input_extension.rb +14 -5
- data/lib/activeadmin/tom_select/version.rb +2 -2
- data/lib/activeadmin/tom_select.rb +3 -3
- data/lib/generators/active_admin/tom_select/install/install_generator.rb +5 -5
- data/npm-package/package-lock.json +2 -2
- data/npm-package/package.json +2 -2
- data/npm-package/src/index.js +1 -3
- data/npm-package/src/tom-select-tailwind.css +26 -20
- data/sonar-project.properties +5 -4
- data/spec/features/form_input_spec.rb +2 -2
- data/spec/features/inline_ajax_setting_spec.rb +1 -1
- data/spec/internal/Gemfile.lock +1 -1
- data/spec/internal/app/admin/articles.rb +28 -0
- data/spec/internal/app/assets/config/manifest.js +2 -1
- data/spec/internal/app/assets/stylesheets/active_admin.tailwind.css +1 -1
- data/spec/internal/app/assets/stylesheets/application.tailwind.css +0 -15
- data/spec/internal/app/javascript/active_admin.js +2 -4
- data/spec/internal/db/schema.rb +3 -1
- data/spec/internal/db/seeds.rb +4 -7
- data/spec/internal/package-lock.json +3 -3
- data/spec/internal/package.json +1 -1
- data/spec/internal/yarn.lock +1 -1
- data/spec/support/reset_settings.rb +1 -1
- metadata +5 -2
@@ -10,11 +10,11 @@ RSpec.describe 'form input', type: :request do
|
|
10
10
|
# So we'll test with that configuration
|
11
11
|
describe 'with ajax option (from static admin file)' do
|
12
12
|
before(:each) do
|
13
|
-
ActiveAdmin::
|
13
|
+
ActiveAdmin::TomSelect.inline_ajax_options = true
|
14
14
|
end
|
15
15
|
|
16
16
|
after(:each) do
|
17
|
-
ActiveAdmin::
|
17
|
+
ActiveAdmin::TomSelect.inline_ajax_options = false
|
18
18
|
end
|
19
19
|
it 'renders select input with searchable-select-input css class' do
|
20
20
|
get "#{ADMIN_POSTS_PATH}/new"
|
@@ -12,7 +12,7 @@ RSpec.describe 'inline_ajax_options setting', type: :request do
|
|
12
12
|
Category.create!(name: 'Music')
|
13
13
|
Category.create!(name: 'Cooking')
|
14
14
|
|
15
|
-
ActiveAdmin::
|
15
|
+
ActiveAdmin::TomSelect.inline_ajax_options = true
|
16
16
|
get '/admin/test_inline_ajax_posts/new'
|
17
17
|
|
18
18
|
expect(response.body).to have_selector('.searchable-select-input option',
|
data/spec/internal/Gemfile.lock
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
ActiveAdmin.register Post, as: 'Article' do
|
2
|
+
permit_params :title, :body, :category_id, :user_id, :created_at, :updated_at
|
3
|
+
|
4
|
+
index do
|
5
|
+
selectable_column
|
6
|
+
id_column
|
7
|
+
column :title
|
8
|
+
column :category
|
9
|
+
column :user
|
10
|
+
column :created_at
|
11
|
+
actions
|
12
|
+
end
|
13
|
+
|
14
|
+
# Use the new tom_select input type
|
15
|
+
filter :title
|
16
|
+
filter :category, as: :tom_select, ajax: true
|
17
|
+
filter :user, as: :tom_select, ajax: true
|
18
|
+
|
19
|
+
form do |f|
|
20
|
+
f.inputs do
|
21
|
+
f.input :title
|
22
|
+
f.input :body
|
23
|
+
f.input :category, as: :tom_select, ajax: true
|
24
|
+
f.input :user, as: :tom_select, ajax: true
|
25
|
+
end
|
26
|
+
f.actions
|
27
|
+
end
|
28
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
@import "tailwindcss/components";
|
3
3
|
@import "tailwindcss/utilities";
|
4
4
|
|
5
|
-
@import "
|
5
|
+
@import "activeadmin-tom_select/src/tom-select-tailwind.css";
|
6
6
|
|
7
7
|
/* Additional batch actions dropdown styles that aren't in the ActiveAdmin plugin */
|
8
8
|
@layer components {
|
@@ -1,15 +0,0 @@
|
|
1
|
-
@import "tailwindcss";
|
2
|
-
|
3
|
-
/* Import our Tom Select Tailwind theme overrides */
|
4
|
-
@import '../../../../../src/tom-select-tailwind.css';
|
5
|
-
|
6
|
-
/* Additional batch actions dropdown styles that aren't in the ActiveAdmin plugin */
|
7
|
-
@layer components {
|
8
|
-
.batch-actions-dropdown-toggle:disabled {
|
9
|
-
@apply opacity-50 cursor-not-allowed;
|
10
|
-
}
|
11
|
-
|
12
|
-
.batch-actions-dropdown-arrow {
|
13
|
-
@apply w-2.5 h-2.5;
|
14
|
-
}
|
15
|
-
}
|
@@ -8,12 +8,10 @@ import TomSelect from 'tom-select';
|
|
8
8
|
window.TomSelect = TomSelect;
|
9
9
|
|
10
10
|
// Import and setup ActiveAdmin Tom Select
|
11
|
-
import { setupAutoInit, initSearchableSelects } from '
|
11
|
+
import { setupAutoInit, initSearchableSelects } from 'activeadmin-tom_select';
|
12
12
|
|
13
13
|
// Make the init function globally available for tests
|
14
14
|
window.initSearchableSelects = initSearchableSelects;
|
15
15
|
|
16
16
|
// Initialize the module after everything is loaded
|
17
|
-
setupAutoInit();
|
18
|
-
|
19
|
-
console.log('ActiveAdmin JS loaded with Tom Select');
|
17
|
+
setupAutoInit();
|
data/spec/internal/db/schema.rb
CHANGED
@@ -10,7 +10,9 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
|
13
|
+
# Use appropriate version based on Rails version
|
14
|
+
schema_version = Rails.version.start_with?('8') ? '8.0' : '7.1'
|
15
|
+
ActiveRecord::Schema[schema_version].define(version: 0) do
|
14
16
|
create_table 'active_admin_comments', force: :cascade do |t|
|
15
17
|
t.string 'namespace'
|
16
18
|
t.text 'body'
|
data/spec/internal/db/seeds.rb
CHANGED
@@ -50,7 +50,7 @@ rgb_colors_data = [
|
|
50
50
|
{ code: '#FFFFFF', description: 'White' }
|
51
51
|
]
|
52
52
|
|
53
|
-
|
53
|
+
rgb_colors_data.map do |color|
|
54
54
|
RgbColor.find_or_create_by(code: color[:code]) do |rgb|
|
55
55
|
rgb.description = color[:description]
|
56
56
|
end
|
@@ -58,10 +58,7 @@ end
|
|
58
58
|
|
59
59
|
# Create internal tag names
|
60
60
|
10.times do |i|
|
61
|
-
InternalTagName.find_or_create_by(name: "Internal Tag #{i + 1}")
|
62
|
-
tag.description = "Description for internal tag #{i + 1}"
|
63
|
-
tag.color_id = rgb_colors.sample.id
|
64
|
-
end
|
61
|
+
InternalTagName.find_or_create_by(name: "Internal Tag #{i + 1}")
|
65
62
|
end
|
66
63
|
|
67
64
|
# Create option types and values
|
@@ -72,7 +69,7 @@ option_types = []
|
|
72
69
|
|
73
70
|
5.times do |j|
|
74
71
|
OptionValue.find_or_create_by(
|
75
|
-
|
72
|
+
name: "Value #{j + 1} for #{option_type.name}",
|
76
73
|
option_type_id: option_type.id
|
77
74
|
)
|
78
75
|
end
|
@@ -114,7 +111,7 @@ end
|
|
114
111
|
|
115
112
|
# Update posts with colors
|
116
113
|
Post.all.each do |post|
|
117
|
-
post.update(
|
114
|
+
post.update(color_id: colors.sample.id) if post.color_id.nil?
|
118
115
|
end
|
119
116
|
|
120
117
|
# Create Tags
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"dependencies": {
|
9
9
|
"@activeadmin/activeadmin": "^4.0.0-beta16",
|
10
10
|
"@rails/ujs": "^7.1.400",
|
11
|
-
"
|
11
|
+
"activeadmin-tom_select": "file:../../npm-package",
|
12
12
|
"tailwindcss": "^3.4.17",
|
13
13
|
"tom-select": "^2.4.3"
|
14
14
|
},
|
@@ -17,7 +17,7 @@
|
|
17
17
|
}
|
18
18
|
},
|
19
19
|
"../../npm-package": {
|
20
|
-
"name": "
|
20
|
+
"name": "activeadmin-tom_select",
|
21
21
|
"version": "4.1.0",
|
22
22
|
"license": "MIT",
|
23
23
|
"peerDependencies": {
|
@@ -622,7 +622,7 @@
|
|
622
622
|
"integrity": "sha512-SFtA5X59BimNG8cy60pgZhPf1bGpg5KXVYF6Jj5H5hrwwNXKNmD2yNZhHC+WfuLqBN+972cZHR9Fto6nJQz+Xw==",
|
623
623
|
"license": "MIT"
|
624
624
|
},
|
625
|
-
"node_modules
|
625
|
+
"node_modules/activeadmin-tom_select": {
|
626
626
|
"resolved": "../../npm-package",
|
627
627
|
"link": true
|
628
628
|
},
|
data/spec/internal/package.json
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
"dependencies": {
|
15
15
|
"@activeadmin/activeadmin": "^4.0.0-beta16",
|
16
16
|
"@rails/ujs": "^7.1.400",
|
17
|
-
"
|
17
|
+
"activeadmin-tom_select": "file:../../npm-package",
|
18
18
|
"tailwindcss": "^3.4.17",
|
19
19
|
"tom-select": "^2.4.3"
|
20
20
|
}
|
data/spec/internal/yarn.lock
CHANGED
@@ -111,7 +111,7 @@
|
|
111
111
|
resolved "https://registry.npmjs.org/@rails/ujs/-/ujs-7.1.2.tgz"
|
112
112
|
integrity sha512-c5x02djEKEVVE4qfN4XgElJS4biM0xxtIVpcJ0ZHLK116U19rowTtmD0AJ/RCb3Xaewa4GPIWLlwgeC0dCQqzw==
|
113
113
|
|
114
|
-
"
|
114
|
+
"activeadmin-tom_select@file:../../npm-package":
|
115
115
|
version "4.1.0"
|
116
116
|
resolved "file:../../npm-package"
|
117
117
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-tom_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rocket Sensei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|
@@ -320,7 +320,9 @@ files:
|
|
320
320
|
- lefthook.yml
|
321
321
|
- lib/activeadmin-tom_select.rb
|
322
322
|
- lib/activeadmin/inputs/filters/searchable_select_input.rb
|
323
|
+
- lib/activeadmin/inputs/filters/tom_select_input.rb
|
323
324
|
- lib/activeadmin/inputs/searchable_select_input.rb
|
325
|
+
- lib/activeadmin/inputs/tom_select_input.rb
|
324
326
|
- lib/activeadmin/tom_select.rb
|
325
327
|
- lib/activeadmin/tom_select/engine.rb
|
326
328
|
- lib/activeadmin/tom_select/option_collection.rb
|
@@ -350,6 +352,7 @@ files:
|
|
350
352
|
- spec/internal/Procfile.dev
|
351
353
|
- spec/internal/README.md
|
352
354
|
- spec/internal/Rakefile
|
355
|
+
- spec/internal/app/admin/articles.rb
|
353
356
|
- spec/internal/app/admin/categories.rb
|
354
357
|
- spec/internal/app/admin/dashboard.rb
|
355
358
|
- spec/internal/app/admin/option_types.rb
|