fix: Update tests and CI for ActiveAdmin 4 compatibility

- Fix active_admin_comments to use active_admin_comments_for in AA4
- Add author to CSS test to fix validation error
- Update has_many support for AA4 using .has-many-add button click
- Simplify GitHub Actions workflow for AA4 testing
- All tests now passing with ActiveAdmin 4.0.0.beta16

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Этот коммит содержится в:
Gleb Tv
2025-09-23 21:21:19 +03:00
родитель d7c3252c52
Коммит 60b1bbb7cd
7 изменённых файлов: 25 добавлений и 17 удалений

Просмотреть файл

@@ -33,7 +33,7 @@ ActiveAdmin.register Author do
row :profile
row :posts
end
active_admin_comments
active_admin_comments_for(resource) if active_admin_config.comments?
end
form do |f|

Просмотреть файл

@@ -41,7 +41,7 @@ ActiveAdmin.register Post do
nil
end
end
active_admin_comments
active_admin_comments_for(resource) if active_admin_config.comments?
end
form do |f|

Просмотреть файл

@@ -3086,10 +3086,14 @@
document.addEventListener("turbo:load", initQuillEditors);
document.addEventListener("turbo:render", initQuillEditors);
document.addEventListener("turbolinks:load", initQuillEditors);
document.addEventListener("has_many_add:after", function(event) {
const newFields = event.target.querySelectorAll("[data-aa-quill-editor]");
newFields.forEach(initQuillEditor);
setupFormSubmission();
document.addEventListener("click", function(event) {
if (event.target.closest(".has-many-add")) {
setTimeout(function() {
const newEditors = document.querySelectorAll("[data-aa-quill-editor]:not(.quill-editor--active)");
newEditors.forEach(initQuillEditor);
setupFormSubmission();
}, 10);
}
});
}
const QuillEditor = {

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@@ -69,7 +69,8 @@ RSpec.describe 'CSS Loading', type: :system do
it 'applies Quill styles correctly when editor is present' do
# Create a test model with Quill editor
post = Post.create!(title: 'Test Post', description: '<p>Test content</p>')
author = Author.create!(email: 'test@example.com', name: 'Test Author', age: 30)
post = Post.create!(author: author, title: 'Test Post', description: '<p>Test content</p>')
visit "/admin/posts/#{post.id}/edit"
# Wait for editor to load