From 2d69584b654b6024656c3590f567cf6e8c06fb94 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:32:56 -0700 Subject: [PATCH 1/3] Prevent duplicate options in 'Select Guidance' - Prior to this commit, if current_user.org was also a @default_org, then @important_ggs would contain duplicate [org, ggs]. --- app/controllers/plans_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 421514001a..277ce4a699 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -192,10 +192,8 @@ def show end @default_orgs = Org.default_orgs @all_ggs_grouped_by_org.each do |org, ggs| - @important_ggs << [org, ggs] if @default_orgs.include?(org) - - # If this is one of the already selected guidance groups its important! - @important_ggs << [org, ggs] if !(ggs & @selected_guidance_groups).empty? && !@important_ggs.include?([org, ggs]) + # @default_orgs and already selected guidance groups are important. + @important_ggs << [org, ggs] if (@default_orgs.include?(org) || !(ggs & @selected_guidance_groups).empty?) && !@important_ggs.include?([org, ggs]) end # Sort the rest by org name for the accordion From 7d047413926ec28e457879f1910c72e71ffd94b8 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:35:58 -0700 Subject: [PATCH 2/3] refactor / make rubocop happy --- app/controllers/plans_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 277ce4a699..e3da35eae0 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -193,7 +193,9 @@ def show @default_orgs = Org.default_orgs @all_ggs_grouped_by_org.each do |org, ggs| # @default_orgs and already selected guidance groups are important. - @important_ggs << [org, ggs] if (@default_orgs.include?(org) || !(ggs & @selected_guidance_groups).empty?) && !@important_ggs.include?([org, ggs]) + if (@default_orgs.include?(org) || (ggs & @selected_guidance_groups).any?) && !@important_ggs.include?([org, ggs]) + @important_ggs << [org, ggs] + end end # Sort the rest by org name for the accordion From a3676abcfa803982df24ffbe806eb279f738cb37 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:50:22 -0600 Subject: [PATCH 3/3] Add Changelog entries for PR #3365 and #3376 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ecca00727..3aeeb4e2f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -151,6 +151,14 @@ We sometimes use the button native Dom element to programmatically click, as the - Fixed rubocop errors after Bootstrap upgrade - Fixed RSpec tests after Bootstrap upgrade - Fix "undefined" Tooltip Messages [#3364](https://github.com/DMPRoadmap/roadmap/pull/3364) +- Fixed rubocop errors after V4.1.1 release +- Fixed MySQL and PostgreSQL GitHub Actions [PR #3376](https://github.com/DMPRoadmap/roadmap/pull/3376) + - Removed duplicate `node-version:` statements from the `mysql.yml` and `postgres.yml` workflows + - Replaced `webdrivers` gem with `selenium-webdriver` gem + - Disabled `rack-attack` gem from throttling `/users/sign_in` path in Rails test environment + - Addressed `Faker` deprecation warnings + - Made some small changes to fix some existing tests +- Prevent Duplicate Options in 'Select Guidance' [PR #3365](https://github.com/DMPRoadmap/roadmap/pull/3365) ## V4.1.1