Restore submit_tag for AA 3.x login button styling#8
Merged
Conversation
The add-AA-v4-support change (commit 15e89a0) flipped both view branches from submit_tag inside form_tag to button_to. That works for the AA v4 branch (Tailwind classes do the styling), but on AA v3 the formtastic theme styles `#login input[type="submit"]` — a <button> element doesn't match the selector, so the SSO button regressed from the themed blue to an unstyled dark default. Keep button_to in the AA v4 branch; revert the AA v3 (else) branch to form_tag + submit_tag so the formtastic-themed look is back. The wrapping form picks up the .formtastic class so AA's stylesheet applies.
Regression test for the styling fix: AA v3's formtastic stylesheet targets #login input[type="submit"], and a <button> doesn't match the selector. The spec asserts the rendered login page uses input[type=submit] on AA v3 (skipped on AA v4 where button_to + Tailwind is intentional) so future view edits can't silently regress the themed blue button back to a dark default.
The install generator (`rails generate active_admin:oidc:install`) copies templates/sessions_new.html.erb to the host app for AA v3. That template carried the same button_to-based markup the gem-side view did, so host apps that ran the installer (and ones that do so after this fix lands) would still see the dark unstyled SSO button until they hand-edited their own override.
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
Restores the themed (formtastic-blue) SSO login button on ActiveAdmin 3.x. Commit
15e89a0(add support of active admin v4) replacedsubmit_taginsideform_tagwithbutton_tofor both AA v3 and v4 branches. AA v4 is happy withbutton_tobecause Tailwind classes do the styling — but AA v3's formtastic stylesheet targets#login input[type="submit"], and<button type="submit">doesn't match that selector, so the SSO button regressed from the themed blue to the unstyled dark default.Fix
Keep
button_toin the AA v4 branch (Tailwind handles it). Revert the AA v3 (else) branch toform_tag+submit_tagso the formtastic-themed look is back. The wrapping form picks up the.formtasticclass so AA's stylesheet applies.Before / after
<button>(regression)<input type="submit">(matches v1.0 look)button_to(unchanged)button_to(unchanged)Test plan
rake spec:allis green.