Tabs > HAML > Migrate app/views/devise/shared/_tabs_ldap.html.haml & ee/app/views/devise/shared/_tab_smartcard.html.haml to GlTabs
The sign-in page can render a varying amount of tabs depending on what sign-in methods are available in the GitLab instance.
The tabs are implemented in two HAML views:
app/views/devise/shared/_tabs_ldap.html.haml
ee/app/views/devise/shared/_tab_smartcard.html.haml
At least 2 sign-methods must be enabled for the tabs to show up. It might help to enable LDAP to try this out: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/ldap.md.
It is worth noting that sign-in tabs are shown on the sign-in page and the "Enter admin mode" page.
Implementation plan
The following implementation plan is meant as a rough guide to go about the migration, parts of it might need to be adjusted based on potential challenges uncovered along the way.
- Migrate
%ul.nav-links.new-session-tabs.nav-tabs.nav.nav-links-unboxed
to thegl_tabs_nav
helper.- Keep an eye on the CSS classes. Some of them might need to be preserved for the tab toggling logic to function properly. There might be an opportunity to clean up some associated styles. You might want to create a new
.js-*
class for the sole purpose of attaching Javascript behaviors.
- Keep an eye on the CSS classes. Some of them might need to be preserved for the tab toggling logic to function properly. There might be an opportunity to clean up some associated styles. You might want to create a new
- Migrate individual tabs (
= link_to
) to thegl_tab_link_to
helper.- For the interactivity to be preserved, it will likely be necessary to preserve the
data: { toggle: 'tab' }
attribute. Refer to this MR for an example: !81254 (merged). - Make sure tabs are properly activated (the
.active
class).
- For the interactivity to be preserved, it will likely be necessary to preserve the
- Check that the Javascript logic in
app/assets/javascripts/pages/sessions/new/signin_tabs_memoizer.js
still works as expected. Proceed to any necessary clean up.
Edited by Paul Gascou-Vaillancourt