From 518b97a4c03f12a61854210b924748d384190c2f Mon Sep 17 00:00:00 2001 From: gjacob24 Date: Mon, 13 Nov 2023 16:26:55 +0000 Subject: [PATCH 01/31] Rubocop fix after v4.1.1 --- CHANGELOG.md | 4 ++++ app/controllers/plan_exports_controller.rb | 2 +- app/helpers/customizable_template_link_helper.rb | 6 +++--- app/models/answer.rb | 2 +- app/models/exported_plan.rb | 2 +- app/models/plan.rb | 8 ++++---- app/models/question.rb | 2 +- lib/csvable.rb | 7 +++---- lib/tasks/upgrade.rake | 2 +- spec/support/helpers/identifier_helper.rb | 2 +- 10 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9deb1e87a..d6ab484e6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## V4.1.2 or V4.2.0 + +### Fixed +- Fixed rubocop errors after V4.1.1 release ## V4.1.1 ### Added diff --git a/app/controllers/plan_exports_controller.rb b/app/controllers/plan_exports_controller.rb index a000a53588..c9f191c339 100644 --- a/app/controllers/plan_exports_controller.rb +++ b/app/controllers/plan_exports_controller.rb @@ -155,6 +155,6 @@ def export_params # in html that break docx creation by htmltoword gem. def clean_html_for_docx_creation(html) # Replaces single backslash \ with \\ with gsub. - html.gsub(/\\/, '\&\&') + html.gsub('\\', '\&\&') end end diff --git a/app/helpers/customizable_template_link_helper.rb b/app/helpers/customizable_template_link_helper.rb index f0cb62dfd8..d8b72e8353 100644 --- a/app/helpers/customizable_template_link_helper.rb +++ b/app/helpers/customizable_template_link_helper.rb @@ -10,16 +10,16 @@ def link_to_customizable_template(name, customization, template) if customization.present? if customization.created_at < template.created_at - name = name.blank? ? _('Transfer customisation') : name + name = _('Transfer customisation') if name.blank? link_to name, org_admin_template_customization_transfers_path(customization.id), data: { method: 'post' } else - name = name.blank? ? _('Edit customisation') : name + name = _('Edit customisation') if name.blank? link_to name, org_admin_template_path(id: customization.id) end else - name = name.blank? ? _('Customise') : name + name = _('Customise') if name.blank? link_to name, org_admin_template_customizations_path(template.id), 'data-method': 'post' diff --git a/app/models/answer.rb b/app/models/answer.rb index d1ff70e9b3..9a4dcb4d14 100644 --- a/app/models/answer.rb +++ b/app/models/answer.rb @@ -105,7 +105,7 @@ def answered? # # Returns Array def non_archived_notes - notes.select { |n| n.archived.blank? }.sort! { |x, y| x.created_at <=> y.created_at } + notes.select { |n| n.archived.blank? }.sort_by!(&:created_at) end # The parsed JSON hash for the current answer object. Generates a new hash if none diff --git a/app/models/exported_plan.rb b/app/models/exported_plan.rb index 65890d3286..a6219edab2 100644 --- a/app/models/exported_plan.rb +++ b/app/models/exported_plan.rb @@ -182,7 +182,7 @@ def as_txt(sections, unanswered_questions, question_headings, details) next if answer.nil? && !unanswered_questions if question_headings - qtext = sanitize_text(question.text.gsub(/
  • /, ' * ')) + qtext = sanitize_text(question.text.gsub('
  • ', ' * ')) output += "\n* #{qtext}" end if answer.nil? diff --git a/app/models/plan.rb b/app/models/plan.rb index 3b7e18ec85..7626bba207 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -375,7 +375,7 @@ def complete_feedback(org_admin) # # Returns Boolean def editable_by?(user_id) - roles.select { |r| r.user_id == user_id && r.active && r.editor }.any? + roles.any? { |r| r.user_id == user_id && r.active && r.editor } end ## @@ -409,7 +409,7 @@ def readable_by?(user_id) # # Returns Boolean def commentable_by?(user_id) - roles.select { |r| r.user_id == user_id && r.active && r.commenter }.any? || + roles.any? { |r| r.user_id == user_id && r.active && r.commenter } || reviewable_by?(user_id) end @@ -419,7 +419,7 @@ def commentable_by?(user_id) # # Returns Boolean def administerable_by?(user_id) - roles.select { |r| r.user_id == user_id && r.active && r.administrator }.any? + roles.any? { |r| r.user_id == user_id && r.active && r.administrator } end # determines if the plan is reviewable by the specified user @@ -539,7 +539,7 @@ def num_questions # # Returns Boolean def visibility_allowed? - !is_test? && phases.select { |phase| phase.visibility_allowed?(self) }.any? + !is_test? && phases.any? { |phase| phase.visibility_allowed?(self) } end # Determines whether or not a question (given its id) exists for the self plan diff --git a/app/models/question.rb b/app/models/question.rb index adf8753f66..509a977136 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -118,7 +118,7 @@ def deep_copy(**options) copy = dup copy.modifiable = options.fetch(:modifiable, modifiable) copy.section_id = options.fetch(:section_id, nil) - copy.save!(validate: false) if options.fetch(:save, false) + copy.save!(validate: false) if options.fetch(:save, false) options[:question_id] = copy.id question_options.each { |qo| copy.question_options << qo.deep_copy(**options) } annotations.each do |annotation| diff --git a/lib/csvable.rb b/lib/csvable.rb index b86c19bf02..9a2b3d004f 100644 --- a/lib/csvable.rb +++ b/lib/csvable.rb @@ -5,14 +5,13 @@ module Csvable require 'csv' class << self # rubocop:disable Style/OptionalBooleanParameter - # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity + # rubocop:disable Metrics/AbcSize def from_array_of_hashes(data = [], humanize = true, sep = ',') return '' unless data.first&.keys headers = if humanize data.first.keys - .map(&:to_s) - .map(&:humanize) + .map { |x| x.to_s.humanize } else data.first.keys .map(&:to_s) @@ -27,6 +26,6 @@ def from_array_of_hashes(data = [], humanize = true, sep = ',') end end # rubocop:enable Style/OptionalBooleanParameter - # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity + # rubocop:enable Metrics/AbcSize end end diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake index 66fc66998c..98c97cdcb2 100644 --- a/lib/tasks/upgrade.rake +++ b/lib/tasks/upgrade.rake @@ -924,7 +924,7 @@ namespace :upgrade do orgs.each do |org| # If the Org already has a ROR identifier skip it - next if org.identifiers.select { |id| id.identifier_scheme_id == ror.id }.any? + next if org.identifiers.any? { |id| id.identifier_scheme_id == ror.id } # The abbreviation sometimes causes weird results so strip it off # in this instance diff --git a/spec/support/helpers/identifier_helper.rb b/spec/support/helpers/identifier_helper.rb index 53afc495e3..caeabe70de 100644 --- a/spec/support/helpers/identifier_helper.rb +++ b/spec/support/helpers/identifier_helper.rb @@ -19,7 +19,7 @@ def orcid_scheme end def append_prefix(scheme:, val:) - val = val.start_with?('/') ? val[1..val.length] : val + val = val[1..val.length] if val.start_with?('/') url = landing_page_for(scheme: scheme) val.start_with?(url) ? val : "#{url}#{val}" end From 932e31e8d216fdd5125cf5886520efba398d1479 Mon Sep 17 00:00:00 2001 From: gjacob24 Date: Fri, 27 Oct 2023 16:37:41 +0100 Subject: [PATCH 02/31] Issue #3144 - Upgrade to Bootstrap 5 This commit consists of the file changes required for the upgrade from Bootstrap 3 to 5. A more detailed version is in CHANGELOG.md (and in wiki: https://github.com/DMPRoadmap/roadmap/wiki/Release-notes-for-Bootstrap-5-upgrade) --- CHANGELOG.md | 152 +++++++++++++++- app/assets/stylesheets/application.scss | 30 ++- .../stylesheets/blocks/_accessibility.scss | 2 +- app/assets/stylesheets/blocks/_accordion.scss | 82 +++++++++ app/assets/stylesheets/blocks/_buttons.scss | 51 +++--- app/assets/stylesheets/blocks/_cards.scss | 55 ++++++ app/assets/stylesheets/blocks/_dropdowns.scss | 7 + .../stylesheets/blocks/_font_awesomes.scss | 4 +- app/assets/stylesheets/blocks/_footers.scss | 7 +- app/assets/stylesheets/blocks/_forms.scss | 21 +++ app/assets/stylesheets/blocks/_html.scss | 31 +++- app/assets/stylesheets/blocks/_index.scss | 4 +- .../stylesheets/blocks/_input_groups.scss | 13 +- .../blocks/_inverse_dropdowns.scss | 3 +- app/assets/stylesheets/blocks/_labels.scss | 15 +- app/assets/stylesheets/blocks/_lists.scss | 6 +- app/assets/stylesheets/blocks/_logos.scss | 7 +- .../stylesheets/blocks/_modal_dialogs.scss | 39 ++-- .../blocks/_modal_permissions.scss | 6 +- .../stylesheets/blocks/_modal_search.scss | 1 + app/assets/stylesheets/blocks/_navbars.scss | 15 +- app/assets/stylesheets/blocks/_navs.scss | 58 +++--- .../stylesheets/blocks/_new_plans_form.scss | 6 +- .../blocks/_notification_areas.scss | 6 +- app/assets/stylesheets/blocks/_org_links.scss | 2 +- app/assets/stylesheets/blocks/_panels.scss | 30 --- .../stylesheets/blocks/_profile_form.scss | 6 +- app/assets/stylesheets/blocks/_spinner.scss | 15 +- app/assets/stylesheets/blocks/_tables.scss | 24 ++- .../stylesheets/blocks/_template_filters.scss | 6 +- app/assets/stylesheets/utils/_functions.scss | 9 + app/assets/stylesheets/utils/_index.scss | 1 + .../stylesheets/variables/_bootstrap.scss | 14 +- .../stylesheets/variables/_colours.scss | 15 +- .../customizable_template_link_helper.rb | 14 +- app/javascript/application.js | 3 - .../orgAdmin/conditions/updateConditions.js | 26 ++- app/javascript/src/orgAdmin/phases/newEdit.js | 66 +++---- app/javascript/src/orgAdmin/phases/show.js | 2 +- app/javascript/src/researchOutputs/form.js | 6 +- app/javascript/src/utils/accordion.js | 171 +++++++++++++----- app/javascript/src/utils/popoverHelper.js | 8 - app/javascript/src/utils/requiredField.js | 2 +- app/javascript/src/utils/sectionUpdate.js | 15 +- app/javascript/src/utils/spinner.js | 4 +- app/javascript/src/utils/tinymce.js | 5 +- app/javascript/src/utils/tooltipHelper.js | 4 +- app/views/answers/_new_edit.html.erb | 8 +- app/views/answers/_status.html.erb | 10 +- .../contact_us/contacts/_new_left.html.erb | 18 +- app/views/contact_us/contacts/new.html.erb | 4 +- app/views/contributors/_form.html.erb | 33 ++-- app/views/contributors/edit.html.erb | 4 +- app/views/contributors/new.html.erb | 2 +- app/views/devise/invitations/edit.html.erb | 86 ++++----- app/views/devise/passwords/edit.html.erb | 80 ++++---- app/views/devise/passwords/new.html.erb | 50 ++--- .../devise/registrations/_api_token.html.erb | 12 +- .../_password_confirmation.html.erb | 22 +-- .../registrations/_password_details.html.erb | 25 ++- .../registrations/_personal_details.html.erb | 36 ++-- app/views/devise/registrations/edit.html.erb | 28 +-- .../_guidance_group_form.html.erb | 10 +- .../guidance_groups/_index_by_theme.html.erb | 41 ++--- app/views/guidance_groups/_show.html.erb | 21 +-- app/views/guidance_groups/admin_edit.html.erb | 2 +- app/views/guidance_groups/admin_new.html.erb | 2 +- .../guidances/_guidance_display.html.erb | 85 +++++---- app/views/guidances/new_edit.html.erb | 14 +- app/views/kaminari/_last_page.html.erb | 2 +- app/views/kaminari/_next_page.html.erb | 2 +- app/views/kaminari/_page.html.erb | 2 +- app/views/kaminari/_prev_page.html.erb | 2 +- app/views/layouts/_branding.html.erb | 91 +++++----- app/views/layouts/_footer.html.erb | 32 ++-- app/views/layouts/_header.html.erb | 4 +- app/views/layouts/_navigation.html.erb | 84 +++++---- app/views/layouts/_paginable.html.erb | 4 +- app/views/layouts/_signin_signout.html.erb | 29 +-- app/views/layouts/application.html.erb | 10 +- app/views/layouts/modal_search/_form.html.erb | 27 +-- .../layouts/modal_search/_result.html.erb | 4 +- .../layouts/modal_search/_results.html.erb | 4 +- .../layouts/modal_search/_selections.html.erb | 4 +- app/views/notes/_archive.html.erb | 6 +- app/views/notes/_edit.html.erb | 8 +- app/views/notes/_layout.html.erb | 8 +- app/views/notes/_list.html.erb | 4 +- app/views/notes/_new.html.erb | 6 +- app/views/notes/_show.html.erb | 2 +- .../org_admin/annotations/_form.html.erb | 4 +- app/views/org_admin/conditions/_add.html.erb | 2 +- .../org_admin/conditions/_container.html.erb | 8 +- app/views/org_admin/conditions/_form.html.erb | 14 +- .../conditions/_webhook_form.html.erb | 24 ++- app/views/org_admin/departments/edit.html.erb | 14 +- app/views/org_admin/departments/new.html.erb | 14 +- app/views/org_admin/phases/_form.html.erb | 16 +- app/views/org_admin/phases/_index.html.erb | 23 +-- app/views/org_admin/phases/_phase.html.erb | 12 +- app/views/org_admin/phases/container.html.erb | 16 +- app/views/org_admin/phases/preview.html.erb | 10 +- app/views/org_admin/plans/index.html.erb | 6 +- .../question_options/_option_fields.html.erb | 18 +- app/views/org_admin/questions/_form.html.erb | 45 +++-- app/views/org_admin/questions/_index.html.erb | 4 +- app/views/org_admin/questions/_show.html.erb | 75 ++++---- app/views/org_admin/sections/_form.html.erb | 20 +- app/views/org_admin/sections/_index.html.erb | 71 ++++---- .../org_admin/sections/_progress.html.erb | 2 +- .../org_admin/sections/_section.html.erb | 61 +++---- .../sections/_section_group.html.erb | 4 +- .../org_admin/shared/_theme_selector.html.erb | 7 +- app/views/org_admin/templates/_form.html.erb | 30 +-- .../org_admin/templates/_navigation.html.erb | 12 +- .../org_admin/templates/container.html.erb | 8 +- .../org_admin/templates/history.html.erb | 2 +- app/views/org_admin/templates/index.html.erb | 22 +-- app/views/org_admin/templates/new.html.erb | 6 +- app/views/org_admin/users/edit.html.erb | 26 +-- app/views/orgs/_external_identifiers.html.erb | 10 +- app/views/orgs/_feedback_form.html.erb | 10 +- app/views/orgs/_profile_form.html.erb | 52 +++--- app/views/orgs/admin_edit.html.erb | 36 ++-- app/views/orgs/shibboleth_ds.html.erb | 6 +- .../paginable/api_clients/_index.html.erb | 2 +- .../paginable/contributors/_index.html.erb | 12 +- .../paginable/departments/_index.html.erb | 4 +- .../paginable/guidance_groups/_index.html.erb | 10 +- app/views/paginable/guidances/_index.html.erb | 12 +- app/views/paginable/orgs/_index.html.erb | 6 +- .../plans/_privately_visible.html.erb | 16 +- .../research_outputs/_index.html.erb | 6 +- .../templates/_customisable.html.erb | 21 ++- .../templates/_organisational.html.erb | 22 ++- .../templates/_publicly_visible.html.erb | 2 +- app/views/phases/_edit_plan_answers.html.erb | 41 ++--- app/views/phases/_guidances_notes.html.erb | 67 ++++--- app/views/phases/_overview.html.erb | 2 +- app/views/plans/_download_form.html.erb | 64 +++---- app/views/plans/_edit_details.html.erb | 6 +- app/views/plans/_guidance_choices.html.erb | 6 +- app/views/plans/_guidance_selection.html.erb | 14 +- app/views/plans/_navigation.html.erb | 43 +++-- app/views/plans/_overview_details.html.erb | 26 ++- app/views/plans/_project_details.html.erb | 96 +++++----- .../plans/_request_feedback_form.html.erb | 4 +- app/views/plans/_share_form.html.erb | 30 +-- app/views/plans/new.html.erb | 34 ++-- app/views/public_pages/plan_index.html.erb | 4 +- .../public_pages/template_index.html.erb | 4 +- .../_new_edit_question_datefield.html.erb | 6 +- .../_new_edit_question_option_based.html.erb | 14 +- .../_new_edit_question_textarea.html.erb | 4 +- .../_new_edit_question_textfield.html.erb | 6 +- .../questions/_preview_question.html.erb | 2 +- app/views/research_outputs/_form.html.erb | 80 ++++---- app/views/research_outputs/edit.html.erb | 2 +- .../research_outputs/licenses/_form.html.erb | 2 +- app/views/research_outputs/new.html.erb | 2 +- .../repositories/_search_result.html.erb | 2 +- .../select_output_type.js.erb | 8 +- app/views/shared/_access_controls.html.erb | 21 +-- app/views/shared/_copy_link_modal.html.erb | 28 +-- .../shared/_create_account_form.html.erb | 37 ++-- app/views/shared/_create_plan_modal.html.erb | 10 +- app/views/shared/_links.html.erb | 22 +-- app/views/shared/_modal.html.erb | 4 +- app/views/shared/_popover.html.erb | 2 +- app/views/shared/_search.html.erb | 18 +- app/views/shared/_sign_in_form.html.erb | 70 +++---- app/views/shared/_table_filter.html.erb | 42 ++--- app/views/static_pages/about_us.html.erb | 2 +- app/views/static_pages/privacy.html.erb | 2 +- app/views/static_pages/termsuse.html.erb | 2 +- .../super_admin/api_clients/_form.html.erb | 46 ++--- .../super_admin/api_clients/edit.html.erb | 2 +- .../super_admin/api_clients/index.html.erb | 2 +- .../super_admin/api_clients/new.html.erb | 2 +- .../super_admin/notifications/_form.html.erb | 36 ++-- .../super_admin/notifications/edit.html.erb | 2 +- .../super_admin/notifications/index.html.erb | 9 +- .../super_admin/notifications/new.html.erb | 2 +- app/views/super_admin/orgs/_analysis.html.erb | 4 +- app/views/super_admin/orgs/index.html.erb | 2 +- app/views/super_admin/orgs/new.html.erb | 6 +- app/views/super_admin/themes/_form.html.erb | 14 +- app/views/super_admin/themes/edit.html.erb | 2 +- app/views/super_admin/themes/index.html.erb | 4 +- app/views/super_admin/themes/new.html.erb | 2 +- .../super_admin/users/_confirm_merge.html.erb | 8 +- app/views/super_admin/users/edit.html.erb | 40 ++-- .../_template_statistics_accordion.html.erb | 34 ++-- app/views/usage/_total_usage.html.erb | 20 +- app/views/usage/_user_statistics.html.erb | 32 ++-- .../usage/_user_statistics_accordion.html.erb | 34 ++-- app/views/usage/index.html.erb | 2 +- .../users/_admin_grant_permissions.html.erb | 18 +- .../users/_notification_preferences.html.erb | 44 ++--- app/views/users/admin_index.html.erb | 2 +- package.json | 6 +- yarn.lock | 28 +-- 202 files changed, 2248 insertions(+), 1784 deletions(-) create mode 100644 app/assets/stylesheets/blocks/_accordion.scss create mode 100644 app/assets/stylesheets/blocks/_cards.scss create mode 100644 app/assets/stylesheets/blocks/_forms.scss delete mode 100644 app/assets/stylesheets/blocks/_panels.scss create mode 100644 app/assets/stylesheets/utils/_functions.scss delete mode 100644 app/javascript/src/utils/popoverHelper.js diff --git a/CHANGELOG.md b/CHANGELOG.md index a9deb1e87a..5894631ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,153 @@ # Changelog +## v4.2.0 + +**Note this upgrade is mainly a migration from Bootstrap 3 to Bootstrap 5.** + +Note that this will have a significant impact on any scss and html customizations you may have made to your fork of this project. + +The following links will be helpful: + +[Get started with Bootstrap v5.2.3](https://getbootstrap.com/docs/5.2/getting-started/introduction/)
    +[Migrating to v4](https://getbootstrap.com/docs/4.0/migration)
    +[How to Migrate from Bootstrap Version 3 to 4](https://designmodo.com/migrate-bootstrap-4/)
    +[Migrating to v5](https://getbootstrap.com/docs/5.0/migration)
    +[How to Migrate from Bootstrap Version 4 to 5](https://designmodo.com/migrate-bootstrap-5/)
    +[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)
    +[What happened to $grid-float-breakpoint in Bootstrap 4. And screen size breakpoint shift from 3 -> 4]( +https://bibwild.wordpress.com/2019/06/10/what-happened-to-grid-float-breakpoint-in-bootstrap-4-and-screen-size-breakpoint-shift-from-3-4/)
    +[What are media queries in Bootstrap 4?](https://www.educative.io/answers/what-are-media-queries-in-bootstrap-4)
    + +### Key changes + +- Node package changes: + * Changed version of `bootstrap "^3.4.1"` --> `"^5.2.3"` + * Added `@popperjs/core.` + * Removed `bootstrap-3-typeahead, bootstrap-sass & popper.js` +- Stylesheet changes + * In `app/assets/stylesheets/application.scss`: + + removed `bootstrap-sass` import
    + and replaced with
    + `@import "../../../node_modules/bootstrap/scss/bootstrap";` + + * The order of the `import` statements have been changed to import the `blocks/` and `utils/` after the default bootstrap stylesheets + + * In `app/assets/stylesheets/blocks/`: + + Replaced in relevant files: + + `@use "../../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss" as * ;`
    + with
    + `@use "../../../../node_modules/bootstrap/scss/bootstrap" as *;` + + Enclosed all division calculations using symbol `/` with `calc()` function,
    + e.g., replaced
    + `padding-right: $grid-gutter-width / 2;`
    + with
    + `padding-right: calc($grid-gutter-width / 2);`
    + + Replaced breaking media queries since Bootstrap 3: + - `@media (max-width: $grid-float-breakpoint-max) {}`
    + with
    + `@include media-breakpoint-down(md){}` + + - `@media (max-width: $grid-float-breakpoint-max) {}`
    + with
    + `@include media-breakpoint-down(md) {}` + * Deleted `app/javascript/src/utils/popoverHelper.js`. ++ Mixins + - Media query mixins parameters have changed for a more logical approach. + * `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). ++ Color system + - 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. + * Replaced `lighten()` by `tint-color()`. + * Replaced `darken()` by `shade-color()`. + +#### Components & HTML + +Note many of these Bootstrap changes has required us to rewrite or change some of the Javascript files. + +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/). +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/ ) + ++ Accordion & spinners + - Bespoke versions replaced by Bootstrap 5 accordion and spinner now. + - Accordion + * 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: +
    // Accordion colors +
    `$color-accordion-button: $color-primary-text`; +
    `$color-accordion-button-icon: $color-primary-text`; +
    `$color-accordion-button-bg: $color-primary-background`; +
    `$color-accordion-button-active-bg: shade-color($color-accordion-button-bg, 30%)`; +
    (See `app/assets/stylesheets/blocks/_accordion.scss` and `app/assets/stylesheets/variables/_colours.scss` for details.) + * The drag icon in `app/views/org_admin/sections/_section.html.erb` now appears after the plus (or minus) icon. + - The spinner block now uses class`d-none` instead of`hidden` to hide. + - 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). ++ Buttons + - Bootstrap dropped `btn-block` class for utilities. So we removed any styling using it. + - Close Buttons: Renamed `close` to`btn-close`. + - Renamed `btn-default` to `btn-secondary` and variable `$btn-default-color` changed to `$btn-secondary-color`. ++ Dropdowns + - Dropdown list items with class `dropdown` have class `dropdown-item` added usually with`px-3` for positioning. + - Added new `dropdown-menu-dark` variant and associated variables for on-demand dark dropdowns. + - Data attributes changes required by Bootstrap 5 (as used by accordion and dropdown buttons): + * `data-display` --> `data-bs-display` + * `data-parent` --> `data-bs-parent` + * `data-target` --> `data-bs-target` + * `data-toggle` --> `data-bs-toggle` + - Bootstrap 5 Popover added to some dropdown-menu items by adding attribute `data-bs-toggle="popover"` ++ Form + - `form-group` class replaced with `form-control`. + - 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. + - Dropped form-specific layout classes for our grid system. Use Bootstrap grid and utilities instead of `form-group`, `form-row`, or `form-inline`. + - `form-text` no longer sets display, allowing you to create inline or block help text as you wish just by changing the HTML element. + - Input group addons are now specific to their placement relative to an input. So `input-group-addon` and in our case we replaced with +`input-group-addon`. + - Renamed `checkbox` and `radio` into `form-check`. ++ Images + - Renamed `img-responsive` to `img-fluid`. ++ Labels and badges + - Class `label` has been removed and replaced by `badge` to disambiguate from the `