Skip to content

Upgrade to bootstrap 4 - #62

Open
nwmac wants to merge 2 commits into
masterfrom
bootstrap4
Open

Upgrade to bootstrap 4#62
nwmac wants to merge 2 commits into
masterfrom
bootstrap4

Conversation

@nwmac

@nwmac nwmac commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Upgrades Bootstrap from 3.4.1 to 4.6.2, swaps the removed Glyphicons for @rancher/icons, and cleans up the resulting Bootstrap-4 compatibility issues (class renames, dropdown/input-group markup, modal sizing).

We'll need to update Rancher to pick up version 1.2.0 once this is merged and published.

Changes

  • Note that a lot of the changes are style changes to update the icon classes - Bootstrap 4 has no icon set by default, so this PR adds in Rancher icons.
  • I have removed the Log out link as this was not working and is not needed for use in Rancher dashboard.
  • The script to patch a running container has been updated now that the old Ember UI has been removed (ui-dashboard rather than ui for the path.

Detail:

  • Bootstrap 3 → 4.6.2 (bootstrap.bundle.js so Popper is included for dropdowns/tooltips).
  • Glyphicons → @rancher/icons 2.0.63: removed all glyphicon-* references, mapped each to the closest rancher-icons glyph (icon icon-*). Font files are copied into dist/<v>/fonts/ and style.css is concatenated into the SCSS pipeline. font-display: block is stripped so a font-load failure shows a fallback glyph instead of nothing.
  • Template migration (templates/*.hbs, partials/*.hbs):
    • col-xs-*col-*
    • btn-defaultbtn-secondary, btn-xsbtn-sm
    • input-group-addon / input-group-btn → v4 input-group-prepend / input-group-append with .input-group-text
    • Dropdown restructured from <ul><li><a> to <div><a class="dropdown-item">; pull-rightdropdown-menu-right
    • Modal close button moved after the title
    • Removed "Log Out" links (visible UI only; the underlying logout option/method are kept for the embedding host contract)
  • Modal sizing (src/HTMLApi.js): also set max-width when sizing .modal-dialog — v4's default max-width: 500px was capping the intended 750px. Footer buttons now btn btn-sm btn-secondary (v4 has no btn-default). templates/modal.hbs footer switched from text-align: center to justify-content: center since .modal-footer is now a flexbox.
  • JSON collapser (src/HTMLApi.js, vendor/JSONFormatter.js): collapse toggle uses icon icon-plus/icon icon-minus instead of glyphicons.
  • Styles (styles/main.scss): dropped the Glyphicons @font-face, added a .well compat shim, added a .icon base rule (display: inline-block; line-height: 1; vertical-align: -0.125em) so icons align with adjacent text.
  • Build script (scripts/build): switched to bootstrap.bundle.js, wired in rancher-icons, unset the deprecated npm_config_* env vars inherited from an outer npm run (silences Unknown env config warnings), and passes --no-fund to npm install.

Screenshots

@nwmac nwmac added this to the 2.16.0 milestone Aug 25, 2026
@nwmac nwmac self-assigned this Aug 25, 2026

@codyrancher codyrancher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appear to be minor differences like button styling but I don't think it's anything to hold this up over. The functionality appears to be there (I haven't confirmed why logout isn't present but I don't think that's important)

Image

@nwmac

nwmac commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@codyrancher I wasn't too bothered about the colours, but looking at it again, I will try and make the button colours the same. I'll also look at the styling of the headers in the panel as they have lost their boldness.

I removed logout as on my Rancher it didn't do anything and I don't think we want to log the user out from this UI.

@codyrancher

Copy link
Copy Markdown
Member

@codyrancher I wasn't too bothered about the colours, but looking at it again, I will try and make the button colours the same. I'll also look at the styling of the headers in the panel as they have lost their boldness.

I removed logout as on my Rancher it didn't do anything and I don't think we want to log the user out from this UI.

Sounds good, if you change your mind feel free to merge. I'll do another pass if more changes land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants