Skip to content

Conversation

@benjaminfaure
Copy link
Contributor

  • Bootstrap 3 to 5 upgrade

  • Fixed rubocop errors after Bootstrap upgrade

  • Fixed RSpec tests after Bootstrap upgrade

  • Fix "undefined" Tooltip Messages #3364

  • Fixed rubocop errors after V4.1.1 release

  • Fixed MySQL and PostgreSQL GitHub Actions PR #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

gjacob24 and others added 30 commits November 13, 2023 16:26
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)
According to https://github.com/titusfortner/webdrivers:
"If you can update to the latest version of Selenium (4.11+), please do so and stop requiring this gem."
Without this modification, the selenium tests often trigger a 429 / Too Many Requests error. (Perhaps this should be applied to "/users/password" as well?)
Prior to this commit, the following deprecation warning was appearing in the terminal:
NOTE: Faker::Internet.safe_email is deprecated; use email instead. It will be removed on or after 2023-10.

More here: faker-ruby/faker#2733
Prior to this commit, the GitHub Actions associated with these files were failing with the message, "Invalid workflow file
The workflow is not valid. .github/workflows/mysql.yml (Line: X, Col: Y): 'node-version' is already defined"
NOTE: Additional Rubocop offences currently exist in the codebase. These fixes only address the PR changes that correspond with this commit.
Changes in this PR:
1) modal-search-result-selector class changed from 'hidden' to 'd-none'
2) changes to the related rspec tests for the above
1: Added to  spec/rails_helper.rb:
Capybara.default_max_wait_time = 10
2: Fix for SuperAdmins Orgs Super admin removes links
     Failure/Error: all('.link a > .fa-circle-xmark').last.click
Changed selectors in spec/features/super_admins/orgs_spec.rb & updated spec/support/helpers/links_helper.rb updated. It was necessary, to scroll to links that were not visible and click by using Javascripts scripts.
3: Fixed errors in ./spec/features/questions/textarea_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)",
        "(1/1) answered" -> "( 1 / 1)"
4: Fix for error in ./spec/features/annotations/annotations_editing_spec.rb
Changed "Noo bar" -> "<p>Noo bar</p>".
5: Fixed error in ./spec/features/questions/radiobuttons_questions_spec.rb.
Changed "(0/1) answered" -> "(0 / 1)".
6: Fixed error in ./spec/features/questions/dropdown_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)".
7: Fixed error in spec/features/feedback_requests_spec.rb
Replaced "within('div.panel') do" -> "within('.tab-pane.active')"
8: Fixed errors in ./spec/features/questions/checkbox_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)",
        "(1/1) answered" -> "( 1 / 1)"
9: Fixed error in ./spec/features/templates/templates_editings_spec.rb.
Changed "Foo bar" -. "<p>Foo bar</p>".
10: Fix for ./spec/features/questions/textfield_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)",
        "(1/1) answered" -> "( 1 / 1)"
Fix MySQL and PostgreSQL GitHub Actions
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)
Changes in this PR:
1) modal-search-result-selector class changed from 'hidden' to 'd-none'
2) changes to the related rspec tests for the above
1: Added to  spec/rails_helper.rb:
Capybara.default_max_wait_time = 10
2: Fix for SuperAdmins Orgs Super admin removes links
     Failure/Error: all('.link a > .fa-circle-xmark').last.click
Changed selectors in spec/features/super_admins/orgs_spec.rb & updated spec/support/helpers/links_helper.rb updated. It was necessary, to scroll to links that were not visible and click by using Javascripts scripts.
3: Fixed errors in ./spec/features/questions/textarea_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)",
        "(1/1) answered" -> "( 1 / 1)"
4: Fix for error in ./spec/features/annotations/annotations_editing_spec.rb
Changed "Noo bar" -> "<p>Noo bar</p>".
5: Fixed error in ./spec/features/questions/radiobuttons_questions_spec.rb.
Changed "(0/1) answered" -> "(0 / 1)".
6: Fixed error in ./spec/features/questions/dropdown_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)".
7: Fixed error in spec/features/feedback_requests_spec.rb
Replaced "within('div.panel') do" -> "within('.tab-pane.active')"
8: Fixed errors in ./spec/features/questions/checkbox_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)",
        "(1/1) answered" -> "( 1 / 1)"
9: Fixed error in ./spec/features/templates/templates_editings_spec.rb.
Changed "Foo bar" -. "<p>Foo bar</p>".
10: Fix for ./spec/features/questions/textfield_questions_spec.rb.
Changed "(0/1) answered" -> "( 0 / 1)",
        "(1/1) answered" -> "( 1 / 1)"
…to1:DMPRoadmap/roadmap into issue_3144_upgrade_to_bootstrap_5
 - rubocop fixes after Bootstrap upgrade and RSpec tests fixes
(Note: default value for 'dropdown' argument removed in app/helpers/customizable_template_link_helper.rb as part of rubocop fix)
- Request feedback box changed from 'well' to card' class
- Reset password view alignment of checkbox and label fields
- Required field red star alignment for Project Details and Share plan pages
Prior to this commit, requiredField.js was calling getConstant('REQUIRED_FIELD_TEXT') before the constant was loaded to constants.js. As a result, `asterisk` was evaluating to `undefined`.
getConstant('VALIDATION_MESSAGE_PASSWORDS_MATCH') still exists in passwordhelper.js

Was previously removed here: portagenetwork@33a6058
- Prior to this commit, if current_user.org was also a @default_org, then @important_ggs would contain duplicate [org, ggs].
@github-actions
Copy link

github-actions bot commented Apr 9, 2024

1 Warning
⚠️ This PR is too big! Consider breaking it down into smaller PRs.

Generated by 🚫 Danger

benjaminfaure and others added 5 commits April 9, 2024 08:53
Changes:
 - To deal with missing favicon.ico error ( ActionController::RoutingError:
       No route matches [GET] "/favicon.ico") :
   added config/routes_test.rb to add a route will return an empty response
   with a 200 OK status code when the browser requests the favicon.ico file.
   Then for test purposes we add the lines to config/encvironments/test.rb:
     # Add config/routes_test.rb to routes
     config.paths['config/routes.rb'] << Rails.root.join('config/routes_test.rb')

  - The other outstanding errors arose because in the test environment
    we sometimes encounter errors like (Selenium::WebDriver::Error::ElementClickInterceptedError: element click intercepted:
    # Element <input type="submit" name="commit" value="Change affiliation" class="btn btn-secondary" data-disable-with="Change affiliation">
    # is not clickable at point (101, 203). Other element would receive
the click: <div id="ui-id-2" tabindex="-1"
class="ui-menu-item-wrapper">...</div>).
    To get round this we use JS to click on element using code like
this:
  change_affiliation_input_button = find('input[value="Change affiliation"]')
   execute_script('arguments[0].click();', change_affiliation_input_button)
:selenium_chrome_headless driver has a default window-size of (800x600). This small window-size seems to result in the `Selenium::WebDriver::Error::ElementClickInterceptedError:`

This commit increases the window-size and also reverts the prior fix for these errors (commit 55321d0)
…p_upgrade

Fix for failing Rubocop tests.
@benjaminfaure benjaminfaure merged commit fc047ac into main Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants