Angular 15 + Bootstrap 5 Upgrade

Bug #2000482 reported by Bill Erickson
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Original Bootstrap 5 bug is here: https://bugs.launchpad.net/evergreen/+bug/1907297

Creating this bug as a combo of Angular 15 and Bootstrap 5 since they are tightly linked.

Bootstrap migration notes: https://getbootstrap.com/docs/5.0/migration/

WIP branch on the way with some migration notes.

Revision history for this message
Bill Erickson (berick) wrote :

WIP branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp2000482-angular-15-bootstrap-5

To use:

cd Open-ILS/src/eg2 && rm -rf node_modules
sudo npm install -g @angular/cli@^15.0
npm install

--

The upgrade to Angular 15 is done in the WIP branch. The Bootstrap migration will take some work, though.

Bootstrap changes I've encountered so far mostly have to do with changing utility class names, e.g. ml-2 is now ms-2 ("margin left" vs "margin start" for better RTL support), loss of "form-inline" class and way more flexibility with the grid system.

This is a good reference: https://getbootstrap.com/docs/5.0/migration/

Revision history for this message
Bill Erickson (berick) wrote :

Pushed another commit with login page form-inline cleanup plus a large swath of renamed utility classes.

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

One issue with the badge classes: .rounded-pill is intended to be added to .badge rather than replacing it. So a badge that was previously:

{{{badge badge-danger}}}

should now be:

{{{badge rounded-pill bg-danger}}}

Revision history for this message
Bill Erickson (berick) wrote :

Thanks Stephanie. I have recovered the badges from my previous scrubbing in the working branch.

Revision history for this message
Bill Erickson (berick) wrote :

I've pushed a variety of additional repairs. Making good progress.

Releasing control of this bug for now, but more review and patching is needed.

The main thing to look for are uses of "form-control". In a lot of cases, the class may be present, but it's not doing much anyway, so the pages look fine. In other cases, forms are out of whack (fields flowing vertically instead of horizontally). The solution generally is to make more use of row / col classes and d-flex for general left/right flow.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
status: In Progress → Confirmed
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

It's going to be a few more days before I can work on the class names, but I wanted to leave two notes here:

Popper2 is part of this upgrade, and might have to be installed separately if it doesn't happen automatically: https://github.com/ng-bootstrap/ng-bootstrap/issues/4249 It has some new options that should solve our issues with popovers overflowing the viewport.

I've created a migration guide that covers Bootstrap 3 (in case there are lingering vestiges) through 5.2: https://docs.google.com/spreadsheets/d/1NFx09zghDW_sGcbPnM8iED0_7S2XyISwCnWNuOMhLK4/edit?usp=sharing

Feel free to comment if you spot something I've missed.

Changed in evergreen:
assignee: nobody → Stephanie Leary (stephanieleary)
Revision history for this message
Stephanie Leary (stephanieleary) wrote :
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

I've just updated this branch to merge the recent changes to forms and labels. I've tweaked the spacing of inputs on the catalog search form and results, but there are probably a lot of other instances where we need to adjust spacing.

At this point, I need more eyes on this. However, since testing this involves upgrading Angular, it won't play well with others on bug squashing servers.

Changed in evergreen:
assignee: Stephanie Leary (stephanieleary) → nobody
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Since this branch does not play well with others, Jason Boyer has set it up on its own test server:
https://festivus.evergreencatalog.com/eg2/en-US/staff/
login: admin / demo123

I've added a tab to the Bootstrap migration spreadsheet to track minor layout issues:
https://docs.google.com/spreadsheets/d/1NFx09zghDW_sGcbPnM8iED0_7S2XyISwCnWNuOMhLK4/edit?usp=sharing

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

I have made some additional changes to the markup and CSS to handle Bootstrap 5's form layout changes. In order to deal with the month-old merge conflicts, I've squashed the commits on a new branch:
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=25a0ae917ba42fd6b9a5f2b04c49b44b16b4c828

My original branch is still up, if anyone wants it for reference.

tags: added: pullrequest
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Here's another branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp2000482-angular-15-bootstrap-5-v2

1. Adds signoff to Stephanie's squashed commit.
2. Adds a few more minor Bootstrap 5 fixes

I'm fairly sure additional UI fixes are needed. Just needs more exploration.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for your work on this, Bill and Stephanie!

I pushed my signoffs and two new commits to: user/sandbergja/lp2000482-angular-15-bootstrap-5-v3

The two new commits that do the following
* Fix a karma issue that was causing the test suite not to run at all for me
* Fix the two failing tests (one caused by a breaking change in rxjs, another caused by an updated localization)
* Clean up a compiler warning

Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Galen Charlton (gmc)
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed for inclusion in 3.11-beta, along with a couple follow-ups. Thanks, Bill, Stephanie, and Jane!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.