[18.0][FIX] base_user_show_email: keep the login label layout classes - #995
Open
jcadhoc wants to merge 1 commit into
Open
[18.0][FIX] base_user_show_email: keep the login label layout classes#995jcadhoc wants to merge 1 commit into
jcadhoc wants to merge 1 commit into
Conversation
Core renders the login label as:
<label for="login" class="form-label d-flex justify-content-between">Email</label>
and the user switcher component portals its "Choose a user" button
straight into that element (web/static/src/core/user_switch/user_switch.xml,
`t-portal="'label.form-label'"`).
This module replaced the whole label to rename it to "Login" and dropped
`d-flex justify-content-between` in the process, so the portalled button
lost its spacing and ended up glued to the label text
("LoginChoose a user"). The password label right below, untouched by this
module, keeps rendering correctly.
Keep the classes core sets on the label so the switcher button is laid
out as intended.
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.
Problem
On the login page, the module's renamed label and the core user switcher
button end up glued together, rendering as
LoginChoose a user.Core renders the login label as:
and the user switcher portals its "Choose a user" button straight into that
element —
addons/web/static/src/core/user_switch/user_switch.xml:base_user_show_emailreplaces the whole label to rename it to "Login" anddrops
d-flex justify-content-betweenalong the way, so the portalled buttonloses its spacing. The password label right below — untouched by this module —
keeps rendering correctly, which is what makes the difference visible.
The switcher only shows up once the browser has stored logins for that
database, so the glitch is only visible to returning users, which is probably
why it went unnoticed.
Fix
Keep the layout classes core sets on the label. One-line change, no behaviour
change beyond the layout.
Test plan
base_user_show_email./web/login: the "Choose a user" button should sit at the right endof the label row, aligned the same way as "Reset password" is on the
password label.
Same issue is present on 19.0 (the label markup and the portal target are
unchanged there).
Internal ref: https://www.adhoc.inc/odoo/project.task/71192