Skip to content

Latest commit

 

History

History
114 lines (92 loc) · 4.4 KB

File metadata and controls

114 lines (92 loc) · 4.4 KB

Bootstrap 5.3.3 Upgrade Summary

Changes Made

1. Updated Layout.cshtml

  • Bootstrap CSS: Upgraded from 3.3.7 to 5.3.3
  • Bootstrap JS: Upgraded from 3.3.7 to 5.3.3
  • jQuery: Kept and updated to 3.7.1 (latest stable)
  • Navigation: Updated Bootstrap 3 navbar structure to Bootstrap 5
    • Changed navbar-toggle to navbar-toggler
    • Updated dropdown attributes from data-toggle to data-bs-toggle
    • Changed dropdown-menu > li > a to dropdown-item
    • Updated dividers from <li class="divider"></li> to <hr class="dropdown-divider">
  • Alerts: Updated alert close buttons to use Bootstrap 5 syntax
    • Changed data-dismiss to data-bs-dismiss
    • Updated close button from × to btn-close

2. Updated Analysis/Index.cshtml (Methods of Analysis page)

  • Accordion: Converted Bootstrap 3 panels to Bootstrap 5 accordion
    • Changed panel-group to accordion
    • Converted panel to accordion-item
    • Updated panel-heading to accordion-header
    • Changed panel-body to accordion-body
    • Updated collapse attributes to use data-bs-* syntax

3. Created Compatibility Files

CSS Compatibility (wwwroot/css/bootstrap-compatibility.css)

  • Button styles: Added .btn-default equivalent styles
  • Panel components: CSS fallbacks for panel-to-card migration
  • Form groups: Maintained spacing compatibility
  • Wells: Provided styling for .well and .well-sm classes
  • Glyphicons: FontAwesome fallbacks for common glyphicon classes
  • Input groups: Styling for .input-group-addon
  • Grid system: Maintained compatibility for legacy column classes
  • Utilities: Text colors, sr-only, collapse behaviors

JavaScript Compatibility (wwwroot/js/bootstrap-compatibility.js)

  • Data attributes: Automatic migration from data-* to data-bs-*
  • Panel groups: Automatic conversion to Bootstrap 5 accordions
  • Tooltips: Legacy tooltip initialization
  • jQuery API: Compatibility layer for $.fn.tooltip(), $.fn.collapse(), $.fn.modal()
  • Event handling: Legacy event support for alerts and other components

4. Updated Tooltip Scripts

  • ShowdownScriptsPartial: Updated to use Bootstrap 5 tooltip syntax
  • Changed data-original-title to data-bs-original-title

Features Preserved

jQuery Support

  • jQuery 3.7.1 maintained for compatibility with:
    • DataTables integration
    • Custom form handling
    • Legacy JavaScript code
    • Third-party plugins

Existing Functionality

  • All navigation menus
  • Alert messages
  • Form validation
  • Data tables
  • Tooltips
  • Dropdowns
  • Collapse/accordion functionality

Browser Compatibility

Bootstrap 5.3.3 supports:

  • Chrome >= 60
  • Firefox >= 60
  • Edge >= 79
  • Safari >= 12
  • iOS Safari >= 12
  • Android Chrome >= 60

Performance Improvements

  • Smaller bundle size: Bootstrap 5 is smaller than Bootstrap 3
  • Better CSS: Improved CSS custom properties and utilities
  • Modern JavaScript: Native ES6+ features instead of jQuery dependencies
  • Improved accessibility: Better ARIA support and semantic markup

Testing Recommendations

  1. Navigation Menu: Test all dropdown menus and mobile responsiveness
  2. Analysis Page: Verify accordion functionality on the methods-of-analysis page
  3. Forms: Test all form validation and submission
  4. Alerts: Verify alert dismissal functionality
  5. Data Tables: Test sorting, filtering, and pagination
  6. Tooltips: Verify tooltip display and content
  7. Mobile: Test responsive behavior on various screen sizes

Potential Issues to Monitor

  1. Third-party plugins: Some jQuery plugins may need updates
  2. Custom CSS: Existing custom styles may need adjustment
  3. JavaScript libraries: Dependencies on Bootstrap 3 APIs may need attention
  4. Print styles: Layout changes may affect print formatting

Future Improvements

  1. Gradual migration: Replace compatibility layer with native Bootstrap 5 code
  2. Icon migration: Consider migrating from FontAwesome 4.7 to newer version
  3. CSS optimization: Remove unused compatibility styles over time
  4. Component modernization: Update forms to use Bootstrap 5 validation styles

Files Modified

  • Anlab.Mvc\Views\Shared\Layout.cshtml
  • Anlab.Mvc\Views\Analysis\Index.cshtml
  • Anlab.Mvc\Views\Shared\_ShowdownScriptsPartial.cshtml
  • Anlab.Mvc\wwwroot\css\bootstrap-compatibility.css (new)
  • Anlab.Mvc\wwwroot\js\bootstrap-compatibility.js (new)