Skip to content

Commit fc047ac

Browse files
Merge pull request #3403 from DMPRoadmap/development
Roadmap V4.2.0
2 parents 8a0d0fb + 56759df commit fc047ac

File tree

260 files changed

+4424
-3524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+4424
-3524
lines changed

.github/workflows/eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/setup-node@v2
1616
with:
1717
cache: 'yarn'
18-
node-version: 16
18+
node-version: 18
1919

2020
# Run yarn install for JS dependencies
2121
- name: 'Yarn Install'

.github/workflows/mysql.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ jobs:
2525
# Install Node
2626
- uses: actions/setup-node@v3
2727
with:
28-
node-version: '16.6.0'
28+
node-version: 18
2929
cache: 'yarn'
30-
node-version: 16
3130

3231
# Copy all of the example configs over
3332
- name: 'Setup the application'

.github/workflows/postgres.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ jobs:
4444
# Install Node
4545
- uses: actions/setup-node@v3
4646
with:
47-
node-version: '16.6.0'
47+
node-version: 18
4848
cache: 'yarn'
49-
node-version: 16
5049

5150
# Install the Postgres developer packages
5251
- name: 'Install Postgresql Packages'

CHANGELOG.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,165 @@
11
# Changelog
22

3+
## v4.2.0
4+
5+
**Note this upgrade is mainly a migration from Bootstrap 3 to Bootstrap 5.**
6+
7+
Note that this will have a significant impact on any scss and html customizations you may have made to your fork of this project.
8+
9+
The following links will be helpful:
10+
11+
[Get started with Bootstrap v5.2.3](https://getbootstrap.com/docs/5.2/getting-started/introduction/)<br>
12+
[Migrating to v4](https://getbootstrap.com/docs/4.0/migration)<br>
13+
[How to Migrate from Bootstrap Version 3 to 4](https://designmodo.com/migrate-bootstrap-4/)<br>
14+
[Migrating to v5](https://getbootstrap.com/docs/5.0/migration)<br>
15+
[How to Migrate from Bootstrap Version 4 to 5](https://designmodo.com/migrate-bootstrap-5/)<br>
16+
[Use Bootstrap 5 with Ruby on Rails 6 and webpack](https://medium.com/daily-web-dev/use-bootstrap-4-with-ruby-on-rails-6-and-webpack-fe7300604267)<br>
17+
[What happened to $grid-float-breakpoint in Bootstrap 4. And screen size breakpoint shift from 3 -> 4](
18+
https://bibwild.wordpress.com/2019/06/10/what-happened-to-grid-float-breakpoint-in-bootstrap-4-and-screen-size-breakpoint-shift-from-3-4/)<br>
19+
[What are media queries in Bootstrap 4?](https://www.educative.io/answers/what-are-media-queries-in-bootstrap-4)<br>
20+
21+
### Key changes
22+
23+
- Node package changes:
24+
* Changed version of `bootstrap "^3.4.1"` --> `"^5.2.3"`
25+
* Added `@popperjs/core.`
26+
* Removed `bootstrap-3-typeahead, bootstrap-sass & popper.js`
27+
- Stylesheet changes
28+
* In `app/assets/stylesheets/application.scss`:
29+
+ removed `bootstrap-sass` import <br>
30+
and replaced with<br>
31+
`@import "../../../node_modules/bootstrap/scss/bootstrap";`
32+
33+
* The order of the `import` statements have been changed to import the `blocks/` and `utils/` after the default bootstrap stylesheets
34+
35+
* In `app/assets/stylesheets/blocks/`:
36+
+ Replaced in relevant files:
37+
+ `@use "../../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss" as * ;`<br>
38+
with <br>
39+
`@use "../../../../node_modules/bootstrap/scss/bootstrap" as *;`
40+
+ Enclosed all division calculations using symbol `/` with `calc()` function,<br>
41+
e.g., replaced<br>
42+
`padding-right: $grid-gutter-width / 2;`<br>
43+
with<br>
44+
`padding-right: calc($grid-gutter-width / 2);`<br>
45+
+ Replaced breaking media queries since Bootstrap 3:
46+
- `@media (max-width: $grid-float-breakpoint-max) {}`<br>
47+
with<br>
48+
`@include media-breakpoint-down(md){}`
49+
50+
- `@media (max-width: $grid-float-breakpoint-max) {}`<br>
51+
with<br>
52+
`@include media-breakpoint-down(md) {}`
53+
* Deleted `app/javascript/src/utils/popoverHelper.js`.
54+
+ Mixins
55+
- Media query mixins parameters have changed for a more logical approach.
56+
* `media-breakpoint-down()` uses the breakpoint itself instead of the next breakpoint (e.g., `media-breakpoint-down(lg)` instead of `media-breakpoint-down(md)` targets viewports smaller than lg).
57+
+ Color system
58+
- All `lighten()`and `darken()` functions replaced. These functions will mix the color with either white or black instead of changing its lightness by a fixed amount.
59+
* Replaced `lighten()` by `tint-color()`.
60+
* Replaced `darken()` by `shade-color()`.
61+
62+
#### Components & HTML
63+
64+
Note many of these Bootstrap changes has required us to rewrite or change some of the Javascript files.
65+
66+
When we use a native DOM element in Javascript, we obtain it by applying get() to the Jquery element (cf., https://api.jquery.com/get/).
67+
We sometimes use the button native Dom element to programmatically click, as the Jquery button element with trigger('click') won't work because the trigger() function cannot be used to mimic native browser events, such as clicking (cf., https://learn.jquery.com/events/triggering-event-handlers/ )
68+
69+
+ Accordion & spinners
70+
- Bespoke versions replaced by Bootstrap 5 accordion and spinner now.
71+
- Accordion
72+
* Changed the default Bootstrap arrow icon for the accordion to use the fontawesome icons plus and minus icons. Created a several accordion specific colour variables:
73+
<br>// Accordion colors
74+
<br> `$color-accordion-button: $color-primary-text`;
75+
<br> `$color-accordion-button-icon: $color-primary-text`;
76+
<br> `$color-accordion-button-bg: $color-primary-background`;
77+
<br> `$color-accordion-button-active-bg: shade-color($color-accordion-button-bg, 30%)`;
78+
<br>(See `app/assets/stylesheets/blocks/_accordion.scss` and `app/assets/stylesheets/variables/_colours.scss` for details.)
79+
* The drag icon in `app/views/org_admin/sections/_section.html.erb` now appears after the plus (or minus) icon.
80+
- The spinner block now uses class`d-none` instead of`hidden` to hide.
81+
- In views with multiple accordion sections with "expand all" or "collapse all" links, we use the native Dom element of the accordion buttons to programmatically click, (cf. to note above).
82+
+ Buttons
83+
- Bootstrap dropped `btn-block` class for utilities. So we removed any styling using it.
84+
- Close Buttons: Renamed `close` to`btn-close`.
85+
- Renamed `btn-default` to `btn-secondary` and variable `$btn-default-color` changed to `$btn-secondary-color`.
86+
+ Dropdowns
87+
- Dropdown list items with class `dropdown` have class `dropdown-item` added usually with`px-3` for positioning.
88+
- Added new `dropdown-menu-dark` variant and associated variables for on-demand dark dropdowns.
89+
- Data attributes changes required by Bootstrap 5 (as used by accordion and dropdown buttons):
90+
* `data-display` --> `data-bs-display`
91+
* `data-parent` --> `data-bs-parent`
92+
* `data-target` --> `data-bs-target`
93+
* `data-toggle` --> `data-bs-toggle`
94+
- Bootstrap 5 Popover added to some dropdown-menu items by adding attribute `data-bs-toggle="popover"`
95+
+ Form
96+
- `form-group` class replaced with `form-control`.
97+
- Form labels now require `form-label` or `form-check-label` to go with `form-control` and `form-check` respectively. So all obsolete `control-label` replaced by `form-label` and missing ones added.
98+
- Dropped form-specific layout classes for our grid system. Use Bootstrap grid and utilities instead of `form-group`, `form-row`, or `form-inline`.
99+
- `form-text` no longer sets display, allowing you to create inline or block help text as you wish just by changing the HTML element.
100+
- Input group addons are now specific to their placement relative to an input. So `input-group-addon` and in our case we replaced with
101+
`input-group-addon`.
102+
- Renamed `checkbox` and `radio` into `form-check`.
103+
+ Images
104+
- Renamed `img-responsive` to `img-fluid`.
105+
+ Labels and badges
106+
- Class `label` has been removed and replaced by `badge` to disambiguate from the `<label>` element.
107+
* Renamed `label` class to `badge`
108+
* Replaced `label-default` by `bg-secondary`
109+
* Replaced `label-info` by `bg-info`
110+
* Replaced `label-warning` by `bg-warning .text-dark`
111+
* Replaced `label-danger` by `bg-danger`
112+
+ Links
113+
- Links are underlined by default (not just on hover), unless they're part of specific components. So we had to add css to remove underline in many cases.
114+
+ Modals
115+
- To programmatically show or hide a Bootstrap modal, we have followed both these approaches:
116+
* Either, get access to the Jquery modal element and call functions `modal('show')` or `modal('hide')`.
117+
* Or, apply click() to the native Dom element of the button to trigger the modal (cf. to note above).
118+
+ Navs & navbars
119+
- Bootstrap rewrote component with flexbox. Dropped nearly all > selectors for simpler styling via un-nested classes.
120+
Instead of HTML-specific selectors like .nav > li > a, we use separate classes for `navs, nav-items, and nav-links`. (Note because the `nav-link` class has not always been added as it comes with styles not appropriate for our styling for links.)
121+
This makes your HTML more flexible while bringing along increased extensibility. So we have dropped HTML-specific selectors and css in `_navs.scss`
122+
e.g.,
123+
<br>`.nav-tabs > li > a:hover` --> `nav-tabs nav-link:hover`,
124+
<br>`.nav-pills > li > a:hover` -->`nav-pills .nav-link:hover`.
125+
- Pages with css classes `nav` and`navbar` updated to work with Bootstrap 5. So `app/assets/stylesheets/blocks/_navbars.scss` and `app/assets/stylesheets/blocks/_navs.scss` updated.
126+
* Replaced`nav navbar-nav` combination --> `navbar-nav`
127+
* Replaced`navbar-toggle` --> `navbar-toggler`
128+
* Replaced multiple spans in`navbar-toggle` button with class`icon-bar`<br> --> single span with`toggler-icon`
129+
* Lists with `nav navbar-nav` have class`nav-item` added to list elements.
130+
- Note because the `nav-link` class include styling that is not appropriate in many places, we have not included it in those cases.
131+
+ Notifications
132+
- Notifications now use classes `d-block` and `d-none` to show and hide respectively.
133+
+ Panels, thumbnails & wells (replacements)
134+
- Bootstrap 5 dropped panels, thumbnails and wells. So pages with them updated with Bootstrap 5 replacements.
135+
* All views with css classes`panel, panel-body, panel-*` Have panel replaced by card to give `card, card_body, card-*`, etc.
136+
* As `panel-default` and some otherpanel css classes don't have card equivalents with same suffixes we have added these classes temporarily in `_cards.sccs`, e.g.,`.card-default`, etc.
137+
+ Utilities
138+
- Bootstrap renamed several utilities to use logical property names instead of directional names with the addition of RTL support:
139+
* Renamed `left-*` and `right-*` to `start-*` and `end-*`.
140+
* Renamed `float-left` and `float-right` to `float-start` and `float-end`.
141+
* Renamed `ml-*` and `mr-*` to `ms-*` and `me-*`.
142+
* Renamed `pl-*` and `pr-*` to `ps-*` and `pe-*`.
143+
* Renamed `text-left` and `text-right` to `text-start` and `text-end`.
144+
- The `hidden` and `show` classes have been removed because they conflicted with jQuery's.
145+
* Replaced `hidden` with `d-none`.
146+
- Text utilities
147+
* As Bootstrap 5.2 dropped class `text-justify` we have created a custom version based on comment https://github.com/twbs/bootstrap/pull/29793#issuecomment-1814683346
148+
* `text-*` utilities do not add hover and focus states to links anymore. `link-*` helper classes can be used instead.
149+
150+
### Fixed
151+
- Fixed rubocop errors after Bootstrap upgrade
152+
- Fixed RSpec tests after Bootstrap upgrade
153+
- Fix "undefined" Tooltip Messages [#3364](https://github.com/DMPRoadmap/roadmap/pull/3364)
154+
- Fixed rubocop errors after V4.1.1 release
155+
- Fixed MySQL and PostgreSQL GitHub Actions [PR #3376](https://github.com/DMPRoadmap/roadmap/pull/3376)
156+
- Removed duplicate `node-version:` statements from the `mysql.yml` and `postgres.yml` workflows
157+
- Replaced `webdrivers` gem with `selenium-webdriver` gem
158+
- Disabled `rack-attack` gem from throttling `/users/sign_in` path in Rails test environment
159+
- Addressed `Faker` deprecation warnings
160+
- Made some small changes to fix some existing tests
161+
- Prevent Duplicate Options in 'Select Guidance' [PR #3365](https://github.com/DMPRoadmap/roadmap/pull/3365)
162+
3163
## V4.1.1
4164

5165
### Added

Gemfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ gem 'activerecord_json_validator'
202202
# See : https://github.com/DMPRoadmap/roadmap/issues/3254
203203
gem 'mail', '2.7.1'
204204

205+
# This library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.
206+
# https://github.com/ruby/net-smtp
207+
gem 'net-smtp'
208+
205209
# ================================= #
206210
# ENVIRONMENT SPECIFIC DEPENDENCIES #
207211
# ================================= #
@@ -248,7 +252,7 @@ group :test do
248252
gem 'capybara'
249253

250254
# Easy installation and use of web drivers to run system tests with browsers
251-
gem 'webdrivers'
255+
gem 'selenium-webdriver'
252256

253257
# RSpec::CollectionMatchers lets you express expected outcomes on
254258
# collections of an object in an example.

0 commit comments

Comments
 (0)