Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Translation of QuestionOption.text (and Refactor Translation of ResearchDomain.label) #662

Closed
wants to merge 55 commits into from

Conversation

aaronskiba
Copy link
Collaborator

Fixes #537

Changes proposed in this PR:

  • Enable translation of QuestionOption.text throughout the app.
  • Refactor translation of ResearchDomain.label
    • NOTE: The ResearchDomain.label translation was already enabled. However, the approach taken in this refactor is more consistent with the rest of the codebase.

aaronskiba and others added 4 commits February 12, 2024 14:40
Set "integration" as target branch for dependabot
This commit includes needed extra handling in app/models/concerns/exportable_plan.rb. (This file executes .pluck(:text), which  prevents us from translating  via our overridden text getter method.)
This translation approach is used for every other field specified in config/initializers/translation.rb.
This reverts commit 4fe1918.

Commit 43e4a196f7307416862f771c10b34e583f4b5f8a makes this prior code change redundant.
@aaronskiba aaronskiba changed the title Enable translations for QuestionOption.text (and Refactor Translation of ResearchDomain.label) Enable Translation of QuestionOption.text (and Refactor Translation of ResearchDomain.label) Feb 14, 2024
aaronskiba and others added 25 commits February 14, 2024 12:13
Edit Webmock allowed requests  to get chromedriver
This adds the terms and conditions checkbox to the devise invitation form. In addition, `accept_terms` has been added to devise_parameter_sanitizer.permit(). This change is required in order for `accept_terms` to be updated within the update method of Devise::InvitationsController.
This change results in the user being unable to submit the invitation form unless the accept terms checkbox is actually checked.
The checkbox handling here is a bit different from the checkbox handling within the create account section of the homepage (see the create method within RegistrationsController). We could do the same here, but it would require a bit more work. Specifically, we'd have to override the Devise::InvitationsController update method within InvitationsController. Also, a bit of extra handling would be required within the DeviseController require_no_authentication method that we are already overriding within InvitationsController.
This change enables app errors to be sent to rollbar.com

`config/initializers/rollbar.rb` includes the following line:
`config.enabled = false if Rails.env.test?`
Thus, having the gem as part of the :default group should be okay.

`rake rollbar:test` can be executed to send a test message to rollbar.com. However, this rake task doesn't work when `require: false` is part of the gem 'rollbar' config.
Edit Rollbar Gem To Enable Tracking on rollbar.com
Prior to this commit, all of the templates were simply being sorted by title.

Now, the sorting follows the instructions specified within the following GitHub issue comment: #685 (comment)
The `funder.present? && !funder.new_record?` check was being unnecessarily repeated.

NOTE: This file features a lot of code exclusive to DMP Assistant. I feel like it could be further cleaned up.
Commit d127444 removed this assignment. However, considering that this instance variable may be used by some corresponding views, this commit puts back the assignment.
Fix Ordering of Templates Within Create Plan Template Dropdown
Add Terms and Conditions For Invitation Form
Merge release `4.0.2+portage-4.0.2` hotfix changes into integration
Merge "integration" into deployment-portage
Bumps [rack](https://github.com/rack/rack) from 2.2.8 to 2.2.9.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](rack/rack@v2.2.8...v2.2.9)

---
updated-dependencies:
- dependency-name: rack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
aaronskiba and others added 26 commits April 9, 2024 12:06
Commit d127444 implemented the template sorting as described here: #685

However, the fix did not address the template sorting when "No research organization associated with this plan or my research organization is not listed" is checked. This commit does.
`@templates = @templates.uniq` is executed in line 69. Thus, `@templates = @templates.flatten.uniq` would be redundant in line 57.
Handle Ordering of Templates When "No research organization" Box is Checked
Merge "integration" into deployment-portage
Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.13 to 6.2.1.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.13...v6.2.1)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Update CHANGELOG.md for Release 4.0.2+portage-4.0.3
Merge "deployment-portage" into integration
`bundle install` was executed after the Gemfile update.
Update translation gem git: url in Gemfile
Requests to this external API are used for fetching organisations that may not already exist within the local db. At this time, DMP Assistant is limiting organisations to only those that exist within the local db. (New organisations are currently only created manually by DMP super admins).
In order to be executed successfully, the RSpec tests within spec/services/external_apis/ror_service_spec.rb require that Rails.configuration.x.ror.active = true. Regardless of the value of this variable within config/initializers/external_apis/ror.rb, this commit overrides the value to true for the duration of the spec/services/external_apis/ror_service_spec.rb tests.
Deactivate Requests to External ROR API
This commit includes needed extra handling in app/models/concerns/exportable_plan.rb. (This file executes .pluck(:text), which  prevents us from translating  via our overridden text getter method.)
This translation approach is used for every other field specified in config/initializers/translation.rb.
This reverts commit 4fe1918.

Commit c17eeb1 makes this prior code change redundant.
@aaronskiba
Copy link
Collaborator Author

Tried rebasing this, but now it's trying to reapply 50+ commits (I think it's because this branch was initially based off of deployment-portage, but we've since created the integration branch.). As a result, #742 has been created and this PR is being closed.

@aaronskiba aaronskiba closed this May 6, 2024
@aaronskiba aaronskiba deleted the aaron/issues/537 branch May 8, 2024 21:40
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.

1 participant