-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Admin] Fix Unclosed form_tag in table component #6172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Admin] Fix Unclosed form_tag in table component #6172
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
💔 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 |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
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: