Repository navigation
Conversation
Apps read status tags placed straight in a panel body, and attach several files to a multiple input; both needed a subclass in each app. Co-Authored-By: Clanker
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the panel status-tag helpers and multiple-file upload changes.
No open issues 🎉
What changed in this PR
Adds panel status-tag helpers and multiple-file uploads to the ActiveAdmin 4-compatible 2.x API.
Changes:
- Adds keyless panel status-tag queries with label, status, and count filtering.
- Allows file fields to accept arrays of paths while preserving single-path behavior.
- Adds supporting fixtures, specs, and documentation.
| File | Description |
|---|---|
| spec/support/pages.rb | Enables query parameters on document form URLs. |
| spec/fixtures/second_upload.txt | Adds a second upload fixture. |
| spec/dummy/app/models/document.rb | Records names from multiple uploaded files. |
| spec/dummy/app/admin/documents.rb | Supports multiple-file inputs and parameters. |
| spec/dummy/app/admin/dashboard.rb | Adds panel status-tag fixtures. |
| spec/active_admin_page_objects/panel_spec.rb | Covers panel status-tag queries across drivers. |
| spec/active_admin_page_objects/file_field_spec.rb | Covers multiple-file uploads. |
| README.md | Documents both new capabilities. |
| lib/active_admin_page_objects/status_tag.rb | Shares query logic and adds panel matchers. |
| lib/active_admin_page_objects/form/file_field.rb | Accepts arrays of file paths. |
| CHANGELOG.md | Records the new APIs under Unreleased. |
Review effort: Balanced
Reads the <tfoot> row by column key, such as the totals row of activeadmin_table_footer, which also supports ActiveAdmin 4. Co-Authored-By: Clanker
A select widget may need to type text other than the option label. The keyword reaches choose_option only when given, so widget modules written for the two-argument form keep working. Co-Authored-By: Clanker
Co-Authored-By: Clanker
A Symbol field key keeps its leading underscore as formtastic ids it, the field prefix skips collection_selection[] or comes from Form.object_name, and required? also reads the label's abbr marker. Co-Authored-By: Clanker
Co-Authored-By: Clanker
Includes the 1.2.1 fix: a label that Rails wraps in div.field_with_errors after a validation error still counts. Co-Authored-By: Clanker
Co-Authored-By: Clanker
With automatic reload off, Comments#add raised ObsoleteNode on the panel found before the submit. ActiveAdmin 4 has no tabs, so a theme that hides the panel overrides reveal_comments to show it again. Co-Authored-By: Clanker
ActiveAdmin renders the line on a single page too, where the pagination nav is missing, so it is its own section. It reads the numbers from the bold parts, which keeps it working with a translated line. Co-Authored-By: Clanker
has_semantic_errors? and has_no_semantic_errors? take count: for the errors that match one message. On ActiveAdmin 4 the default form section only meets another formtastic form in a custom sidebar section, where a declared root is simpler than scoping the default. Co-Authored-By: Clanker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports to 2.x (ActiveAdmin 4) what 1.x gained in 1.1.0 to 1.2.1, plus helpers apps asked for: panel status tags, several files in
FileField#fill,PaginationInfoandhave_semantic_errors(message, count:). The CHANGELOG lists each change.Decisions the diff does not show:
Tabs#body(label),ModalDialog#has_field?and the enabled-button wait.MainMenu#has_submenu?waits until an ActiveAdmin 4 app needs it.Comments#addcalls the privatereveal_comments(panel), which does nothing here. A theme that hides the panel overrides it.BatchActions#clickaccepts no confirmation; the spec handles it.formsection stays unscoped: ActiveAdmin 4's filter form is not formtastic. The README shows declaring a form root.has_status_tag?(label)lives onPanelonly; rows and attributes tables keephas_status_tag?(key, label).FileField#fillpasses a single path as a String: rack_test raisesTypeErrorfor an Array on an input withoutmultiple.PaginationInfois its own section, not part ofPagination: ActiveAdmin renders the line on a single page, where the pagination nav is missing.Verified with the full suite (446 examples) and RuboCop. New specs failed before their change.