[Admin] Fix Unclosed form_tag in table component#6172
Merged
tvdeyen merged 1 commit intosolidusio:mainfrom Mar 6, 2025
Merged
Conversation
This PR fixes an HTML structure break caused by an unclosed form_tag, ensuring that forms added after using ui/table are rendered correctly.
## Background
While customizing the index page to add a new form, I encountered a problem where the added form was not displayed in the browser. Upon investigation, I discovered that the issue stemmed from the form_tag in ui/table/component.html.erb not being explicitly closed, which resulted in subsequent form tags disappearing.
``` rb
<%= render component("ui/table/toolbar").new("data-#{stimulus_id}-target": "batchToolbar", role: "toolbar", "aria-label": t(".batch_actions"), hidden: true) do %>
<%= form_tag '', id: batch_actions_form_id %>
<% @data.batch_actions.each do |batch_action| %>
<%= render_batch_action_button(batch_action) %>
<% end %>
<% end %>
```
Due to the lack of a proper block structure closing the form_tag, the HTML became malformed, and any form tags declared afterward were not rendered.
Updated the form_tag to use a block form, ensuring that the opening and closing tags are explicitly defined.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6172 +/- ##
==========================================
+ Coverage 85.71% 86.64% +0.93%
==========================================
Files 443 514 +71
Lines 10081 11894 +1813
==========================================
+ Hits 8641 10306 +1665
- Misses 1440 1588 +148 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Member
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
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.
Summary
This PR fixes an HTML structure break caused by an unclosed form_tag, ensuring that forms added after using ui/table are rendered correctly.
Background
While customizing the index page to add a new form, I encountered a problem where the added form was not displayed in the browser. Upon investigation, I discovered that the issue stemmed from the form_tag in ui/table/component.html.erb not being explicitly closed, which resulted in subsequent form tags disappearing.
Due to the lack of a proper block structure closing the form_tag, the HTML became malformed, and any form tags declared afterward were not rendered.
Updated the form_tag to use a block form, ensuring that the opening and closing tags are explicitly defined.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: