From cdda79b416ccc09218579ef8223609920f4e1ded Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 26 Jan 2023 15:41:37 -0500 Subject: [PATCH 01/10] Add codespell workflow --- .github/workflows/codespell.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..243ba8ce5f --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 From ff6753da21bd464c1bee1f0e7ec8b34293ef01d0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 26 Jan 2023 14:04:43 -0500 Subject: [PATCH 02/10] rudimentary .codespellrc config to exlcude pdfs etc --- .codespellrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..1cbfc0169e --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = *.css*,*.pdf,.git,locales,locale,*.lock,db +# ignore-words-list = From 15c5556f9537a832a7eec21df90595cb520020b2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 26 Jan 2023 13:57:54 -0500 Subject: [PATCH 03/10] A collection of typo fixes done "manually" but detected by codespell ran across entire repo reworked while unapplying locale fixes --- .../org_admin/template_customization_transfers_controller.rb | 2 +- db/migrate/20161122152339_new_plan_template_structure.rb | 2 +- lib/tasks/upgrade.rake | 4 ++-- lib/tasks/utils/templates.rake | 2 +- public/i18n.js | 2 +- spec/features/authentication/sign_up_email_password_spec.rb | 4 ++-- spec/models/user_spec.rb | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/org_admin/template_customization_transfers_controller.rb b/app/controllers/org_admin/template_customization_transfers_controller.rb index bd9bca6eef..2b605cba94 100644 --- a/app/controllers/org_admin/template_customization_transfers_controller.rb +++ b/app/controllers/org_admin/template_customization_transfers_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module OrgAdmin - # Controller that handles transfering parent template changes to a customized template + # Controller that handles transferring parent template changes to a customized template class TemplateCustomizationTransfersController < ApplicationController include Versionable diff --git a/db/migrate/20161122152339_new_plan_template_structure.rb b/db/migrate/20161122152339_new_plan_template_structure.rb index 0f3aa398bb..321b9a3a68 100644 --- a/db/migrate/20161122152339_new_plan_template_structure.rb +++ b/db/migrate/20161122152339_new_plan_template_structure.rb @@ -230,7 +230,7 @@ def up # template/phases/sections/questions/question_options/question_themes # now need to init answers, notes, answers_options #new_plan.template.new_phases.each do |new_phase| - puts "transfering plan data" + puts "transferring plan data" project.project_groups.each do |group| role = initRole(group, new_plan) role.save! diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake index e603299729..3404f925a2 100644 --- a/lib/tasks/upgrade.rake +++ b/lib/tasks/upgrade.rake @@ -847,7 +847,7 @@ namespace :upgrade do end count = Identifier.where(identifiable_type: 'User').length - p "Transfer complete. Orginal user_identifier count #{identifiers.length}, new identifiers count #{count}" + p "Transfer complete. Original user_identifier count #{identifiers.length}, new identifiers count #{count}" if identifiers.length > count p '' p "#{identifiers.length - count} records could not be transferred." @@ -884,7 +884,7 @@ namespace :upgrade do identifiable: oi.org, value: oi.identifier) end count = Identifier.where(identifiable_type: 'Org').length - p "Transfer complete. Orginal org_identifier count #{identifiers.length}, new identifiers count #{count}" + p "Transfer complete. Original org_identifier count #{identifiers.length}, new identifiers count #{count}" # rubocop:disable Layout/LineLength if identifiers.length > count p '' diff --git a/lib/tasks/utils/templates.rake b/lib/tasks/utils/templates.rake index ef56c64643..7b6a0efa96 100644 --- a/lib/tasks/utils/templates.rake +++ b/lib/tasks/utils/templates.rake @@ -30,7 +30,7 @@ namespace :templates do funder_template.phases.select { |phase| phase.versionable_id.nil? }.each do |phase| p "Processing Template: #{funder_template.id} - #{funder_template.title}" - # Run all of this within a transation so that it rolls back if there is an issue! + # Run all of this within a transaction so that it rolls back if there is an issue! phase.transaction do phase_version = SecureRandom.uuid p " Updating versionable_id for Phase: #{phase.id} to #{phase_version}" diff --git a/public/i18n.js b/public/i18n.js index 9797f5b2c9..79806b400e 100644 --- a/public/i18n.js +++ b/public/i18n.js @@ -38,7 +38,7 @@ return ("0" + number.toString()).substr(-2); }; - // Improved toFixed number rounding function with support for unprecise floating points + // Improved toFixed number rounding function with support for imprecise floating points // JavaScript's standard toFixed function does not round certain numbers correctly (for example 0.105 with precision 2). var toFixed = function(number, precision) { return decimalAdjust('round', number, -precision).toFixed(precision); diff --git a/spec/features/authentication/sign_up_email_password_spec.rb b/spec/features/authentication/sign_up_email_password_spec.rb index 890b3c15c8..36c8b65c28 100644 --- a/spec/features/authentication/sign_up_email_password_spec.rb +++ b/spec/features/authentication/sign_up_email_password_spec.rb @@ -56,7 +56,7 @@ fill_in 'Last Name', with: Faker::Movies::StarWars.character.split.last fill_in 'Password', with: SecureRandom.uuid # Need to use JS to set the accept terms label since dmptool-ui treats the - # whole thing as a label and theis particular label has a URL so 'clicking' it + # whole thing as a label and their particular label has a URL so 'clicking' it # via Capybara results in going to the URL behind that link :/ page.execute_script("document.getElementById('user_accept_terms').checked = true;") @@ -79,7 +79,7 @@ select_an_org('#sign-up-org', @non_ror_org.name, 'Institution') fill_in 'Password', with: SecureRandom.uuid # Need to use JS to set the accept terms label since dmptool-ui treats the - # whole thing as a label and theis particular label has a URL so 'clicking' it + # whole thing as a label and their particular label has a URL so 'clicking' it # via Capybara results in going to the URL behind that link :/ page.execute_script("document.getElementById('user_accept_terms').checked = true;") click_button 'Sign up' diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index c0fec87f84..47e41abf5b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -6,7 +6,7 @@ context 'validations' do it { is_expected.to validate_presence_of(:email) } - it 'validates that email addres is unqique' do + it 'validates that email address is unqique' do subject.email = 'text-email@example.com' expect(subject).to validate_uniqueness_of(:email) .case_insensitive From 9424938d3508d759c57f9089318b6ffa8a72c74e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Mar 2023 18:06:04 -0400 Subject: [PATCH 04/10] fix committee typo present throughout (exclude locale) --- app/views/branded/plans/_project_details.html.erb | 2 +- app/views/plans/_project_details.html.erb | 2 +- db/migrate/20161122152339_new_plan_template_structure.rb | 2 +- spec/models/user_spec.rb | 2 +- spec/presenters/org_selection_presenter_spec.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/branded/plans/_project_details.html.erb b/app/views/branded/plans/_project_details.html.erb index 456aea3aa4..3c31ac8a07 100644 --- a/app/views/branded/plans/_project_details.html.erb +++ b/app/views/branded/plans/_project_details.html.erb @@ -5,7 +5,7 @@ project_title_tooltip = _('If applying for funding, state the name exactly as i project_abstract_tooltip = _("Briefly summarise your research project to help others understand the purposes for which the data are being collected or created.") ethics_tooltip = _("Whether there are any potential ethical issues related to data that this DMP describes") ethics_description_tooltip = _("Description of the ethical issues") -ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics commitee") +ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics committee") %> <% dmp_id = plan.dmp_id %> diff --git a/app/views/plans/_project_details.html.erb b/app/views/plans/_project_details.html.erb index f82690ee68..9e948178bc 100644 --- a/app/views/plans/_project_details.html.erb +++ b/app/views/plans/_project_details.html.erb @@ -6,7 +6,7 @@ project_abstract_tooltip = _("Briefly summarise your research project to help ot id_tooltip = _('A pertinent ID as determined by the funder and/or organisation.') ethics_tooltip = _("Whether there are any potential ethical issues related to data that this DMP describes") ethics_description_tooltip = _("Description of the ethical issues") -ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics commitee") +ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics committee") %>
diff --git a/db/migrate/20161122152339_new_plan_template_structure.rb b/db/migrate/20161122152339_new_plan_template_structure.rb index 321b9a3a68..ad8a1fa495 100644 --- a/db/migrate/20161122152339_new_plan_template_structure.rb +++ b/db/migrate/20161122152339_new_plan_template_structure.rb @@ -147,7 +147,7 @@ def up puts "" puts "beginning number #{proj_number}" proj_number +=1 - if project.dmptemplate.nil? # one of the templates dosent exist + if project.dmptemplate.nil? # one of the templates doesn't exist next end new_plan = initNewPlan(project) # copy data from project to NewPlan object diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 47e41abf5b..17ba559237 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -464,7 +464,7 @@ end end - # Test creationg a User from an omniauth callback like Shibboleth + # Test creating a User from an omniauth callback like Shibboleth describe '.from_omniauth' do subject { described_class.from_omniauth(auth) } diff --git a/spec/presenters/org_selection_presenter_spec.rb b/spec/presenters/org_selection_presenter_spec.rb index 4bea891b9c..4b7344dd29 100644 --- a/spec/presenters/org_selection_presenter_spec.rb +++ b/spec/presenters/org_selection_presenter_spec.rb @@ -45,7 +45,7 @@ expect(@presenter.crosswalk_entry_from_org_id(value: '999')).to eql('{}') end - it 'return ther correct crosswalk entry' do + it 'return their correct crosswalk entry' do rslt = @presenter.crosswalk_entry_from_org_id(value: @org.id.to_s) expected = OrgSelection::OrgToHashService.to_hash(org: @org).to_json expect(rslt).to eql(expected) From c9e9920366bebb9d2fe38038875b82624956539d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Mar 2023 18:01:02 -0400 Subject: [PATCH 05/10] [DATALAD RUNCMD] requirments typo === Do not change lines below === { "chain": [ "3bf9ab10b3f6a00cd47b55f190d9ab6490f86fda" ], "cmd": "git sedi requirments requirements", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- app/views/branded/static_pages/general_guidance.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/branded/static_pages/general_guidance.html.erb b/app/views/branded/static_pages/general_guidance.html.erb index eecb3045c7..66cd03db22 100644 --- a/app/views/branded/static_pages/general_guidance.html.erb +++ b/app/views/branded/static_pages/general_guidance.html.erb @@ -234,7 +234,7 @@
  • <%= _('Is there any requirement that the data be retained? If so, for how long? 3-5 years, 10-20 years, permanently? Not all data need to be retained, and some data required to be retained need not be retained indefinitely. Have a good understanding of your obligation for the data\'s retention.') %>
  • -

    <%= _('Beyond any externally imposed requirments, think about the long-term usefulness of the data. If the data is from an experiment that you anticipate will be repeatable more quickly, inexpensively, and accurately as technology progresses, you may want to store it for a relatively brief period. If the data consists of observations made outside the laborartory that can never be repeated, you may wish to store it indefinitely.') %>

    +

    <%= _('Beyond any externally imposed requirements, think about the long-term usefulness of the data. If the data is from an experiment that you anticipate will be repeatable more quickly, inexpensively, and accurately as technology progresses, you may want to store it for a relatively brief period. If the data consists of observations made outside the laborartory that can never be repeated, you may wish to store it indefinitely.') %>


    <%= _('Sharing and Archiving') %>

    From 5803aac8e10ea53941345658893fc719b03abbdd Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 26 Jan 2023 14:12:01 -0500 Subject: [PATCH 06/10] Manually fix ambigous typos --- .codespellrc | 2 +- .../paginable/templates/_invite_modal_content.html.erb | 4 ++-- config/dmproadmap.yml | 2 +- config/initializers/_dmproadmap.rb | 2 +- config/initializers/doorkeeper.rb | 2 +- spec/features/authentication/sign_up_bypass_sso_spec.rb | 2 +- spec/features/shared/org_autocomplete_spec.rb | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.codespellrc b/.codespellrc index 1cbfc0169e..06b3a04e62 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] -skip = *.css*,*.pdf,.git,locales,locale,*.lock,db +skip = *.css*,*.pdf,.git,locales,locale,*.lock,db,language_presenter.rb # ignore-words-list = diff --git a/app/views/branded/paginable/templates/_invite_modal_content.html.erb b/app/views/branded/paginable/templates/_invite_modal_content.html.erb index 767281ad29..6a76f27b37 100644 --- a/app/views/branded/paginable/templates/_invite_modal_content.html.erb +++ b/app/views/branded/paginable/templates/_invite_modal_content.html.erb @@ -16,7 +16,7 @@ <% end %>

    - <%= _("You can use the default email subject and body below or replace them with your own message. Refer to ther preview section below to see what the email will look like.") %> + <%= _("You can use the default email subject and body below or replace them with your own message. Refer to their preview section below to see what the email will look like.") %>

    <%= f.fields_for :template, template do |tmplt_fields| %> @@ -61,4 +61,4 @@
    <%= f.submit _("Send email"), class: "btn btn-default" %>
    -<% end %> \ No newline at end of file +<% end %> diff --git a/config/dmproadmap.yml b/config/dmproadmap.yml index 9ca6800b9c..3387122761 100644 --- a/config/dmproadmap.yml +++ b/config/dmproadmap.yml @@ -249,7 +249,7 @@ default: &default # organisational contact/help page instead of using the built-in contact_us form # contact_us_url: "https//example.org/default_contact_us_page" - # Your organisation name, used in various places throught the application + # Your organisation name, used in various places throughout the application organisation_name: "My institution's name" # Your orgsanisation abbreviation organisation_abbreviation: "DMPTool" diff --git a/config/initializers/_dmproadmap.rb b/config/initializers/_dmproadmap.rb index f65a2f64aa..61a7d4dc62 100644 --- a/config/initializers/_dmproadmap.rb +++ b/config/initializers/_dmproadmap.rb @@ -28,7 +28,7 @@ class Application < Rails::Application # ORGANISATION SETTINGS # # --------------------- # - # Your organisation name, used in various places throught the application + # Your organisation name, used in various places throughout the application config.x.organisation.name = Rails.configuration.x.dmproadmap.organisation_name # Your organisation's abbreviation config.x.organisation.abbreviation = Rails.configuration.x.dmproadmap.organisation_abbreviation diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 929fca33ae..4ae81db8de 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -29,7 +29,7 @@ # resource_owner_authenticator do # The user must be signed_in in to provide authorization for the ApiClient - # if they are not, send them to the oauth sign in page (retain the parms in the session) + # if they are not, send them to the oauth sign in page (retain the params in the session) unless current_user.present? && session['oauth-referer'].present? oauth_path = oauth_authorization_path(client_id: params.fetch('client_id', ''), redirect_uri: params.fetch( diff --git a/spec/features/authentication/sign_up_bypass_sso_spec.rb b/spec/features/authentication/sign_up_bypass_sso_spec.rb index c4f2e06ed6..863f72ec85 100644 --- a/spec/features/authentication/sign_up_bypass_sso_spec.rb +++ b/spec/features/authentication/sign_up_bypass_sso_spec.rb @@ -60,7 +60,7 @@ select_an_org('#sign-up-org', @org.name, 'Institution') fill_in 'Password', with: SecureRandom.uuid # Need to use JS to set the accept terms label since dmptool-ui treats the - # whole thing as a label and theis particular label has a URL so 'clicking' it + # whole thing as a label and their particular label has a URL so 'clicking' it # via Capybara results in going to the URL behind that link :/ page.execute_script("document.getElementById('user_accept_terms').checked = true;") click_button 'Sign up' diff --git a/spec/features/shared/org_autocomplete_spec.rb b/spec/features/shared/org_autocomplete_spec.rb index aa5d881ce7..5037442f05 100644 --- a/spec/features/shared/org_autocomplete_spec.rb +++ b/spec/features/shared/org_autocomplete_spec.rb @@ -110,7 +110,7 @@ fill_in 'Last Name', with: Faker::Movies::StarWars.character.split.last fill_in 'Password', with: SecureRandom.uuid # Need to use JS to set the accept terms label since dmptool-ui treats the - # whole thing as a label and theis particular label has a URL so 'clicking' it + # whole thing as a label and their particular label has a URL so 'clicking' it # via Capybara results in going to the URL behind that link :/ page.execute_script("document.getElementById('user_accept_terms').checked = true;") end From 4a2c83ba086793cac525985000c848935ba0a02a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 26 Jan 2023 15:33:16 -0500 Subject: [PATCH 07/10] ans -> answer to not confuse codespell --- app/controllers/answers_controller.rb | 4 ++-- app/presenters/api/v1/research_output_presenter.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/answers_controller.rb b/app/controllers/answers_controller.rb index c50ec5bb88..18adcf8d24 100644 --- a/app/controllers/answers_controller.rb +++ b/app/controllers/answers_controller.rb @@ -187,7 +187,7 @@ def permitted_params def check_answered(section, q_array, all_answers) n_qs = section.questions.select { |question| q_array.include?(question.id) }.length - n_ans = all_answers.select { |ans| q_array.include?(ans.question.id) and ans.answered? }.length - [n_qs, n_ans] + n_answers = all_answers.select { |answer| q_array.include?(answer.question.id) and answer.answered? }.length + [n_qs, n_answers] end end diff --git a/app/presenters/api/v1/research_output_presenter.rb b/app/presenters/api/v1/research_output_presenter.rb index 3eee119e07..a9bbce494a 100644 --- a/app/presenters/api/v1/research_output_presenter.rb +++ b/app/presenters/api/v1/research_output_presenter.rb @@ -62,7 +62,7 @@ def fetch_q_and_a(themes:) ret = themes.map do |theme| qs = @plan.questions.select { |q| q.themes.collect(&:title).include?(theme) } descr = qs.map do |q| - a = @plan.answers.select { |ans| ans.question_id = q.id }.first + a = @plan.answers.select { |answer| answer.question_id = q.id }.first next unless a.present? "Question: #{q.text}
    Answer: #{a.text}" From 0827494142bca2dbbc761ccf37129416f3d15a02 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Mar 2023 18:01:02 -0400 Subject: [PATCH 08/10] [DATALAD RUNCMD] recipient typo === Do not change lines below === { "chain": [ "663a7bd399e659602ca2cff5c9fafe64f10fff8f" ], "cmd": "git sedi recepient recipient", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- app/mailers/user_mailer.rb | 4 ++-- .../user_mailer/permissions_change_notification.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 37ba5fa605..1e3971970e 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -72,12 +72,12 @@ def permissions_change_notification(role, user) @role = role @plan_title = @role.plan.title @user = user - @recepient = @role.user + @recipient = @role.user @messaging = role_text(@role) @helpdesk_email = helpdesk_email(org: @user.org) I18n.with_locale I18n.default_locale do - mail(to: @recepient.email, + mail(to: @recipient.email, subject: format(_('Changed permissions on a Data Management Plan in %{tool_name}'), tool_name: tool_name)) end diff --git a/app/views/user_mailer/permissions_change_notification.html.erb b/app/views/user_mailer/permissions_change_notification.html.erb index 5a66cd22a3..ad7084809f 100644 --- a/app/views/user_mailer/permissions_change_notification.html.erb +++ b/app/views/user_mailer/permissions_change_notification.html.erb @@ -1,5 +1,5 @@

    - <%= _('Hello %{recepientname}') %{ recepientname: @recepient.name } %> + <%= _('Hello %{recipientname}') %{ recipientname: @recipient.name } %>

    <%= _('Your permissions relating to %{plan_title} have changed. You now have %{type} access. This means you can %{placeholder1} %{placeholder2}') % { From 7198caab5f24f2b528aea1a03f32e5c589757ff6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Mar 2023 17:51:54 -0400 Subject: [PATCH 09/10] Ignore any locale --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index 06b3a04e62..8f7d17ce6a 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] -skip = *.css*,*.pdf,.git,locales,locale,*.lock,db,language_presenter.rb +skip = *.css*,*.pdf,.git,locales,locale,*.lock,db,language_presenter.rb,locale # ignore-words-list = From 22ea6a2f8a4f5a148737f42707d194b17b4aff6a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Mar 2023 18:07:09 -0400 Subject: [PATCH 10/10] [DATALAD RUNCMD] run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- CHANGELOG.md | 2 +- Gemfile | 2 +- README.md | 4 ++-- app/assets/stylesheets/blocks/README.md | 2 +- app/assets/stylesheets/dmptool/_label.scss | 2 +- app/controllers/concerns/conditional_user_mailer.rb | 2 +- app/controllers/concerns/paginable.rb | 2 +- app/controllers/concerns/versionable.rb | 2 +- app/controllers/dmptool/public_pages_controller.rb | 2 +- app/controllers/plans_controller.rb | 4 ++-- app/controllers/public_pages_controller.rb | 2 +- app/controllers/users/sessions_controller.rb | 2 +- app/helpers/authentication_helper.rb | 2 +- app/helpers/super_admin/api_client_helper.rb | 2 +- app/javascript/src/answers/edit.js | 2 +- app/javascript/src/answers/rdaMetadata.js | 4 ++-- app/javascript/src/shared/createAccountForm.js | 2 +- app/javascript/src/usage/index.js | 2 +- app/javascript/src/utils/accordion.js | 2 +- app/javascript/src/utils/autoComplete.js | 2 +- app/javascript/src/utils/sectionUpdate.js | 2 +- app/javascript/src/utils/tinymce.js | 2 +- app/models/external_api_access_token.rb | 2 +- app/models/plan.rb | 2 +- app/models/role.rb | 2 +- app/models/section.rb | 2 +- app/models/template.rb | 6 +++--- app/models/user.rb | 10 +++++----- app/policies/api/v1/plans_policy.rb | 2 +- app/policies/template_policy.rb | 2 +- app/services/api/v1/auth/jwt/json_web_token.rb | 2 +- app/services/api/v1/conversion_service.rb | 2 +- app/services/api/v1/deserialization/funding.rb | 2 +- app/services/api/v1/deserialization/plan.rb | 2 +- app/services/api/v1/deserialization_service.rb | 2 +- app/services/api/v2/conversion_service.rb | 2 +- app/services/api/v2/deserialization/dataset.rb | 2 +- app/services/api/v2/deserialization/plan.rb | 2 +- app/services/api/v2/deserialization_service.rb | 2 +- app/services/external_apis/base_service.rb | 2 +- app/services/external_apis/orcid_service.rb | 2 +- app/services/org/create_created_plan_service.rb | 2 +- app/services/org/create_exported_plan_service.rb | 2 +- app/services/org/create_joined_user_service.rb | 2 +- .../org/create_last_month_created_plan_service.rb | 2 +- .../org/create_last_month_exported_plan_service.rb | 2 +- .../org/create_last_month_joined_user_service.rb | 2 +- .../org/create_last_month_shared_plan_service.rb | 2 +- app/services/org/create_shared_plan_service.rb | 2 +- app/views/branded/plans/_collaborator_form.html.erb | 2 +- app/views/branded/plans/_download_form.html.erb | 2 +- app/views/branded/plans/_visibility_form.html.erb | 2 +- .../branded/static_pages/general_guidance.html.erb | 2 +- app/views/plans/_share_form.html.erb | 2 +- app/views/shared/export/_plan_txt.erb | 4 ++-- app/views/super_admin/api_clients/_form.html.erb | 2 +- app/views/users/_api_client_form.html.erb | 2 +- config/initializers/htmlto_word_xslt_helper.rb | 2 +- docs/sso/README.md | 4 ++-- lib/data_cleanup/README.md | 4 ++-- lib/global_helpers.rb | 6 +++--- lib/ssm_config_loader.rb | 2 +- lib/tasks/upgrade.rake | 4 ++-- lib/tasks/utils/templates.rake | 2 +- public/i18n.js | 2 +- spec/controllers/contributors_controller_spec.rb | 4 ++-- spec/models/language_spec.rb | 2 +- spec/models/user_spec.rb | 4 ++-- spec/presenters/identifier_presenter_spec.rb | 2 +- spec/services/api/v1/conversion_service_spec.rb | 2 +- spec/services/api/v2/conversion_service_spec.rb | 2 +- spec/services/api/v2/json_validation_service_spec.rb | 2 +- spec/services/external_apis/base_service_spec.rb | 2 +- spec/services/external_apis/spdx_service_spec.rb | 2 +- spec/services/org/create_created_plan_service_spec.rb | 2 +- spec/services/org_selection/search_service_spec.rb | 2 +- spec/support/helpers/autocomplete_helper.rb | 2 +- 77 files changed, 94 insertions(+), 94 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 915bf88061..7845c12c5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,7 +68,7 @@ This version includes changes from [DMPRoadmap release v4.0.2](https://github.co - Froze mail gem version [#3254](https://github.com/DMPRoadmap/roadmap/issues/3254) - Fixed an issue with the Rails 6 keyword arguments change that was causing the `paginable_sort_link` to fail - Updated sans-serif font used in PDF downloads to Roboto since Google API no longer offers Helvetica -- Fixed discrepencies with default/max per_page values for API and UI pagination +- Fixed discrepancies with default/max per_page values for API and UI pagination - Updated the CSV export so that it now includes research outputs ### Changed diff --git a/Gemfile b/Gemfile index 9701fcf3e5..cbb8bd1b59 100644 --- a/Gemfile +++ b/Gemfile @@ -54,7 +54,7 @@ gem 'jbuilder' gem 'bootsnap', require: false # GEMS ADDED TO HELP HANDLE RAILS MIGRATION FROM 3.x to 4.2 -# THESE GEMS HELP SUPPORT DEPRACATED FUNCTIONALITY AND WILL LOSE SUPPORT IN +# THESE GEMS HELP SUPPORT DEPRECATED FUNCTIONALITY AND WILL LOSE SUPPORT IN # FUTURE VERSIONS WE SHOULD CONSIDER BRINGING THE CODE UP TO DATE INSTEAD # A set of Rails responders to dry up your application diff --git a/README.md b/README.md index 13c2d83bca..650d9c5c26 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,13 @@ If you would like to install and run this application, we encourage you to start If the basic DMPRoadmap system does not provide the functionality you require please review the list of customizations that we have made below. If our additional changes do not meet your needs, you are encouraged to fork the DMPRoadmap codebase and customize it to your needs. If you do customize it please contact the DMPRoadmap team to let the community know about the additional functionality you plan to offer. It may be useful to the larger community. -If DMPTool meets your organization's needs, you should install it following the [installation instructions on our wiki](https://github.com/CDLUC3/dmptool/wiki/installation) then perform the folowing tasks: +If DMPTool meets your organization's needs, you should install it following the [installation instructions on our wiki](https://github.com/CDLUC3/dmptool/wiki/installation) then perform the following tasks: - **Homepage images:** While you are free to use the images provided along with this repository, it is advisable to replace them with ones more relevant to your user base. The system randomly serves up one of five images that are located in `app/assets/images/homepage/`. Follow the image sizes in the provided examples for your images. You must also retain the file names as the `app/assets/stylesheets/dmptool/blocks/_home_welcome.scss` references them by name - **Rotating news on the homepage:** Update the blog url value in `config/dmproadmap.yml` with the address of your blog's RSS feed. - **Styles:** The system loads the base DMPRoadmap stylesheet first then the DMPTool stylesheet. We recommend that you add your own additional stylesheet if your changes are extensive or update `app/assets/stylesheets/dmptool/**/*.scss` directly. Do not make changes to the other stylesheets as they are managed as part of the DMPRoadmap project. - **Static Content:** Update the files in `app/views/branded/static_pages/` so that they are appropriate for your installation. -- **Shibboleth:** Setting up your own Shibboleth service provider (SP) is beyond the scope of this application. If you have an SP available and want to use it, make sure that you enable the shibboleth settings in `config/dmproadmap.yml` and then add your organization's entity id (found in your Shib SP's list of registered IdPs) within the UI. Then log out and log back in via your institution's credentials to test that things are working properly. Note that the DMPTool only allows users to authenticate via Shibboleth if the organization is regsitered within the system (meaning that it appears in the application's `orgs` table) +- **Shibboleth:** Setting up your own Shibboleth service provider (SP) is beyond the scope of this application. If you have an SP available and want to use it, make sure that you enable the shibboleth settings in `config/dmproadmap.yml` and then add your organization's entity id (found in your Shib SP's list of registered IdPs) within the UI. Then log out and log back in via your institution's credentials to test that things are working properly. Note that the DMPTool only allows users to authenticate via Shibboleth if the organization is registered within the system (meaning that it appears in the application's `orgs` table) ## Variations between DMPRoadmap and DMPTool diff --git a/app/assets/stylesheets/blocks/README.md b/app/assets/stylesheets/blocks/README.md index 295713a06d..1d7d7be716 100644 --- a/app/assets/stylesheets/blocks/README.md +++ b/app/assets/stylesheets/blocks/README.md @@ -1,6 +1,6 @@ # CSS Blocks -Blocks refer to reusable units within the CSS files. Where practicable, we should always try to define a general block or UX concept, rather than styling indivudual elements. +Blocks refer to reusable units within the CSS files. Where practicable, we should always try to define a general block or UX concept, rather than styling individual elements. Example: diff --git a/app/assets/stylesheets/dmptool/_label.scss b/app/assets/stylesheets/dmptool/_label.scss index f91ae76b38..a3df316bc2 100644 --- a/app/assets/stylesheets/dmptool/_label.scss +++ b/app/assets/stylesheets/dmptool/_label.scss @@ -1,7 +1,7 @@ label { font-weight: 600; - // Add a space to the front of links that appear within a label becuase the white space + // Add a space to the front of links that appear within a label because the white space // is getting collapsed a { padding-left: 3px; diff --git a/app/controllers/concerns/conditional_user_mailer.rb b/app/controllers/concerns/conditional_user_mailer.rb index c83338347d..ef08915765 100644 --- a/app/controllers/concerns/conditional_user_mailer.rb +++ b/app/controllers/concerns/conditional_user_mailer.rb @@ -8,7 +8,7 @@ module ConditionalUserMailer # # recipients - User or Enumerable object or any object that includes Enumerable class # key - A key (dot notation) whose value is true/false and belongs to - # prefences.email (see dmproadmap.rb initializer) + # preferences.email (see dmproadmap.rb initializer) # # Returns Boolean def deliver_if(key:, recipients: [], &block) diff --git a/app/controllers/concerns/paginable.rb b/app/controllers/concerns/paginable.rb index 0fd358dc47..80301e32ac 100644 --- a/app/controllers/concerns/paginable.rb +++ b/app/controllers/concerns/paginable.rb @@ -137,7 +137,7 @@ def refine_query(scope) # Can raise ActiveRecord::StatementInvalid (e.g. column does not # exist, ambiguity on column, etc) - # how we contruct scope depends on whether sort field is in the + # how we construct scope depends on whether sort field is in the # main table or in a related table scope_table = scope.klass.name.underscore parts = @args[:sort_field].partition('.') diff --git a/app/controllers/concerns/versionable.rb b/app/controllers/concerns/versionable.rb index e242f16e78..4689ce5e2f 100644 --- a/app/controllers/concerns/versionable.rb +++ b/app/controllers/concerns/versionable.rb @@ -4,7 +4,7 @@ module Versionable private - # Takes in a Template, phase, Section, Question, or Annotaion + # Takes in a Template, phase, Section, Question, or Annotation # IF the template is published, generates a new template # finds the passed object in the new template # diff --git a/app/controllers/dmptool/public_pages_controller.rb b/app/controllers/dmptool/public_pages_controller.rb index 4b548666da..effbeac96c 100644 --- a/app/controllers/dmptool/public_pages_controller.rb +++ b/app/controllers/dmptool/public_pages_controller.rb @@ -108,7 +108,7 @@ def process_sort_by end end - # Proces the search term + # Process the search term def process_search public_plans_params[:search].present? ? "%#{public_plans_params[:search]}%" : '%' end diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 7c83f0b965..82a4225691 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -373,7 +373,7 @@ def duplicate end # rubocop:enable Metrics/AbcSize - # TODO: This should probablly just be merged with the update route + # TODO: This should probably just be merged with the update route # POST /plans/:id/visibility # rubocop:disable Metrics/AbcSize, Metrics/MethodLength def visibility @@ -406,7 +406,7 @@ def visibility end # rubocop:enable Metrics/AbcSize, Metrics/MethodLength - # TODO: This should probablly just be merged with the update route + # TODO: This should probably just be merged with the update route # POST /plans/:id/set_test def set_test plan = Plan.find(params[:id]) diff --git a/app/controllers/public_pages_controller.rb b/app/controllers/public_pages_controller.rb index 4fe5248d38..550c4a9d45 100644 --- a/app/controllers/public_pages_controller.rb +++ b/app/controllers/public_pages_controller.rb @@ -37,7 +37,7 @@ def template_export # only export live templates, id passed is family_id @template = Template.live(params[:id]) # covers authorization for this action. - # Pundit dosent support passing objects into scoped policies + # Pundit doesn't support passing objects into scoped policies unless PublicPagePolicy.new(current_user, @template).template_export? msg = 'You are not authorized to export that template' redirect_to public_templates_path, notice: msg and return diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index afdb27f2e4..edd0dc08e5 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -77,7 +77,7 @@ def after_sign_in_path_for(resource) elsif resource.language_id.present? session[:locale] = resource.language.abbreviation end - # Change the locale if the user has a prefered language + # Change the locale if the user has a preferred language (oauth_path.presence || plans_path) end diff --git a/app/helpers/authentication_helper.rb b/app/helpers/authentication_helper.rb index fb59564cc0..6a4d58ba69 100644 --- a/app/helpers/authentication_helper.rb +++ b/app/helpers/authentication_helper.rb @@ -23,7 +23,7 @@ def process_oauth # have the full name client = ApiClient.where(uid: @pre_auth.client.uid).first - # Stash the info into a session variable so that the info is retained accross the sign in + # Stash the info into a session variable so that the info is retained across the sign in # workflow session['oauth-referer'] = ApplicationService.encrypt(payload: { client_id: client.id, path: oauth_path }) diff --git a/app/helpers/super_admin/api_client_helper.rb b/app/helpers/super_admin/api_client_helper.rb index fabfbaf07b..5aa097edff 100644 --- a/app/helpers/super_admin/api_client_helper.rb +++ b/app/helpers/super_admin/api_client_helper.rb @@ -24,7 +24,7 @@ def label_for_scope(scope) def tooltip_for_scope(scope) case scope when 'read_dmps' - _("Access to all publicly visible plans and, if associated with an org, the organisationally visible plans. They can also access a user's plans through OAuth autorization.") + _("Access to all publicly visible plans and, if associated with an org, the organisationally visible plans. They can also access a user's plans through OAuth authorization.") when 'edit_dmps' _("Edit any plans created through the API and edit a user's plan after gaining OAuth authorization from the user") when 'create_dmps' diff --git a/app/javascript/src/answers/edit.js b/app/javascript/src/answers/edit.js index 5058af290d..467912b929 100644 --- a/app/javascript/src/answers/edit.js +++ b/app/javascript/src/answers/edit.js @@ -33,7 +33,7 @@ $(() => { * form with class form-answer. The key represents a question id and the value holds * the debounced function for a given input, textarea or select. Note, this map is * populated on demand, i.e. the first time a change is made at a given input, textarea - * or select within the form, a new key-value should be created. Succesive times, the + * or select within the form, a new key-value should be created. Successive times, the * debounced function should be retrieved instead. */ const debounceMap = {}; diff --git a/app/javascript/src/answers/rdaMetadata.js b/app/javascript/src/answers/rdaMetadata.js index f0c8746813..82ff5455a5 100644 --- a/app/javascript/src/answers/rdaMetadata.js +++ b/app/javascript/src/answers/rdaMetadata.js @@ -139,7 +139,7 @@ $(() => { function waitAndUpdate() { if (noWaiting > 0) { - // if we are waiting on api responces, call this function in 1 seccond + // if we are waiting on api responses, call this function in 1 second setTimeout(waitAndUpdate, 1000); } else { // update all the dropdowns/ standards explore box (calling on subject @@ -183,7 +183,7 @@ $(() => { // update the standards display selector $('.rda_metadata .sub-subject select').change(); } else { - // show the sub-subject incase it was previously hidden + // show the sub-subject in case it was previously hidden subSubject.closest('div').show(); // update the sub-subject display selector subSubject.find('option').remove(); diff --git a/app/javascript/src/shared/createAccountForm.js b/app/javascript/src/shared/createAccountForm.js index 602fff74f3..54ae6a8f7b 100644 --- a/app/javascript/src/shared/createAccountForm.js +++ b/app/javascript/src/shared/createAccountForm.js @@ -16,7 +16,7 @@ $(() => { switch (field.attr('id')) { case 'org_index_name': { - // We need to detemine if the user selected an item from the Org autocomplete + // We need to determine if the user selected an item from the Org autocomplete // or provided a manually entered Org name const userEnteredField = form.find('#org_index_user_entered_name'); const warningBlock = form.find('.autocomplete-warning'); diff --git a/app/javascript/src/usage/index.js b/app/javascript/src/usage/index.js index 8013ec0f4a..ca81a8657b 100644 --- a/app/javascript/src/usage/index.js +++ b/app/javascript/src/usage/index.js @@ -19,7 +19,7 @@ $(() => { }; // attach listener to separator select menu - // on change look for "stat" elements and chnage their query param + // on change look for "stat" elements and change their query param const fieldSep = document.getElementById('csv-field-sep'); if (fieldSep !== null) { fieldSep.addEventListener('click', (e) => { diff --git a/app/javascript/src/utils/accordion.js b/app/javascript/src/utils/accordion.js index 253893bbd9..41a516ae48 100644 --- a/app/javascript/src/utils/accordion.js +++ b/app/javascript/src/utils/accordion.js @@ -9,7 +9,7 @@ * <%= _('collapse all') %> *

    * - * Your accordion should follow the Boostrap 3.x layout: + * Your accordion should follow the Bootstrap 3.x layout: * ------------------------------------------------------------ *
    *
    diff --git a/app/javascript/src/utils/autoComplete.js b/app/javascript/src/utils/autoComplete.js index 703c5e0fdb..e9c7fb6445 100644 --- a/app/javascript/src/utils/autoComplete.js +++ b/app/javascript/src/utils/autoComplete.js @@ -56,7 +56,7 @@ const getId = (context, attrName) => { return ''; }; -// Determine which warning message to display based on the precense of the +// Determine which warning message to display based on the presence of the // :not_in_list checkbox const invalidSelectionMessage = (id) => { let msg = getConstant('AUTOCOMPLETE_ARIA_HELPER_EMPTY_WITHOUT_CUSTOM'); diff --git a/app/javascript/src/utils/sectionUpdate.js b/app/javascript/src/utils/sectionUpdate.js index d31ce3331a..8fcfd2992f 100644 --- a/app/javascript/src/utils/sectionUpdate.js +++ b/app/javascript/src/utils/sectionUpdate.js @@ -18,5 +18,5 @@ export const updateSectionProgress = (id, numSecAnswers, numSecQuestions) => { }; // given a question id find the containing div -// used inconditional questions +// used unconditional questions export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.question-body'); diff --git a/app/javascript/src/utils/tinymce.js b/app/javascript/src/utils/tinymce.js index dda3b7041f..a57be57d99 100644 --- a/app/javascript/src/utils/tinymce.js +++ b/app/javascript/src/utils/tinymce.js @@ -141,7 +141,7 @@ export const Tinymce = { }, /* Destroy an editor instance whose target element/textarea has HTML id passed. This method - executes tinymce.Editor.destroy (e.g. https://www.tinymce.com/docs/api/tinymce/tinymce.editor/#destroy) for a successfull id found. + executes tinymce.Editor.destroy (e.g. https://www.tinymce.com/docs/api/tinymce/tinymce.editor/#destroy) for a successful id found. @return undefined */ destroyEditorById(id) { diff --git a/app/models/external_api_access_token.rb b/app/models/external_api_access_token.rb index 94f85c11de..e25883a4e6 100644 --- a/app/models/external_api_access_token.rb +++ b/app/models/external_api_access_token.rb @@ -25,7 +25,7 @@ # Model representing an OAuth access token to an external system like ORCID class ExternalApiAccessToken < ApplicationRecord # This class works in conjunction with Devise OmniAuth providers. If a provider returns an - # acess token along with the :uid, then the access token gets stored in this table. It expects + # access token along with the :uid, then the access token gets stored in this table. It expects # the following to be passed back as part of the "omniauth.auth" response: # # "credentials": { diff --git a/app/models/plan.rb b/app/models/plan.rb index 4be851ee98..9c92461bc2 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -303,7 +303,7 @@ def settings(key) # none exists. # # qid - The id for the question to find the answer for - # create_if_missing - If true, will genereate a default answer + # create_if_missing - If true, will generate a default answer # to the question (defaults: true). # # Returns Answer diff --git a/app/models/role.rb b/app/models/role.rb index 461cea9707..efef70fcdf 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -71,7 +71,7 @@ class Role < ApplicationRecord # Return ActiveRecord::Relation scope :with_access_flags, lambda { |*flags| bad_flag = flags.detect { |flag| !flag.in?(flag_mapping['access'].keys) } - raise ArgumentError, "Unkown access flag '#{bad_flag}'" if bad_flag + raise ArgumentError, "Unknown access flag '#{bad_flag}'" if bad_flag access_values = flags.map { |flag| sql_in_for_flag(flag.to_sym, 'access') } .flatten diff --git a/app/models/section.rb b/app/models/section.rb index 29879a1685..961dbb9fa6 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -126,7 +126,7 @@ def deep_copy(**options) copy end - # Can't be modified as it was duplicatd over from another Phase. + # Can't be modified as it was duplicated over from another Phase. def unmodifiable? !modifiable? end diff --git a/app/models/template.rb b/app/models/template.rb index 7cc64c799e..a6471198e6 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -459,17 +459,17 @@ def publishability unless latest? error += _('You can not publish a historical version of this template. ') publishable = false - # all templates have atleast one phase + # all templates have at least one phase end if phases.count <= 0 error += _('You can not publish a template without phases. ') publishable = false - # all phases must have atleast 1 section + # all phases must have at least 1 section end unless phases.map { |p| p.sections.count.positive? }.reduce(true) { |fin, val| fin && val } error += _('You can not publish a template without sections in a phase. ') publishable = false - # all sections must have atleast one question + # all sections must have at least one question end unless sections.map { |s| s.questions.count.positive? }.reduce(true) { |fin, val| fin && val } error += _('You can not publish a template without questions in a section. ') diff --git a/app/models/user.rb b/app/models/user.rb index 139b962b70..dc3e0789bb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -72,12 +72,12 @@ class User < ApplicationRecord # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable # devise :invitable, :database_authenticatable, :registerable, :recoverable, - # :rememberable, :trackable, :validatable, :omniauthable, + # :memorable, :trackable, :validatable, :omniauthable, # omniauth_providers: %i[shibboleth orcid] # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable - devise :database_authenticatable, :registerable, :recoverable, :rememberable, + devise :database_authenticatable, :registerable, :recoverable, :memorable, :trackable, :validatable, :omniauthable, omniauth_providers: %i[shibboleth orcid] @@ -144,7 +144,7 @@ class User < ApplicationRecord # # validates :org, presence: { message: PRESENCE_MESSAGE } - # Validations to support ouur sign in / sign up workflow + # Validations to support our sign in / sign up workflow validates :institution, presence: { message: PRESENCE_MESSAGE } validates :accept_terms, inclusion: { in: [true, nil], message: _('and conditions') } @@ -301,7 +301,7 @@ def identifier_for(scheme) identifiers.by_scheme_name(scheme, 'User')&.first end - # Checks if the user is a super admin. If the user has any privelege which requires + # Checks if the user is a super admin. If the user has any privilege which requires # them to see the super admin page then they are a super admin. # # Returns Boolean @@ -309,7 +309,7 @@ def can_super_admin? can_add_orgs? || can_grant_api_to_orgs? || can_change_org? end - # Checks if the user is an organisation admin if the user has any privlege which + # Checks if the user is an organisation admin if the user has any privilege which # requires them to see the org-admin pages then they are an org admin. # # Returns Boolean diff --git a/app/policies/api/v1/plans_policy.rb b/app/policies/api/v1/plans_policy.rb index 52f638ecb5..84d976b3b4 100644 --- a/app/policies/api/v1/plans_policy.rb +++ b/app/policies/api/v1/plans_policy.rb @@ -7,7 +7,7 @@ class PlansPolicy < ApplicationPolicy # NOTE: @user is either a User or an ApiClient # A helper method that takes the current client and returns the plans they - # have acess to + # have access to class Scope ## return the visible plans (via the API) to a given client # ALL can view: public diff --git a/app/policies/template_policy.rb b/app/policies/template_policy.rb index d53e087fd2..359b62ce8e 100644 --- a/app/policies/template_policy.rb +++ b/app/policies/template_policy.rb @@ -76,7 +76,7 @@ def unpublish? # - The template which they are modifying belongs to their org ## - # Anyone with an account should be able to get templates for the sepecified research_org + funder + # Anyone with an account should be able to get templates for the specified research_org + funder # This policy is applicable to the Create Plan page def template_options? @user.present? diff --git a/app/services/api/v1/auth/jwt/json_web_token.rb b/app/services/api/v1/auth/jwt/json_web_token.rb index d788ad0d77..dbb828c453 100644 --- a/app/services/api/v1/auth/jwt/json_web_token.rb +++ b/app/services/api/v1/auth/jwt/json_web_token.rb @@ -4,7 +4,7 @@ module Api module V1 module Auth module Jwt - # Class to handle encryption/descryption of the JWT + # Class to handle encryption/description of the JWT class JsonWebToken class << self def encode(payload:, exp: 24.hours.from_now) diff --git a/app/services/api/v1/conversion_service.rb b/app/services/api/v1/conversion_service.rb index d024ccc926..d6ef2c4b6a 100644 --- a/app/services/api/v1/conversion_service.rb +++ b/app/services/api/v1/conversion_service.rb @@ -23,7 +23,7 @@ def yes_no_unknown_to_boolean(value) false end - # Converts the context and value into an Identifier with a psuedo + # Converts the context and value into an Identifier with a pseudo # IdentifierScheme for display in JSON partials. Which will result in: # { type: 'context', identifier: 'value' } def to_identifier(context:, value:) diff --git a/app/services/api/v1/deserialization/funding.rb b/app/services/api/v1/deserialization/funding.rb index 0511eadcbc..c71ede9621 100644 --- a/app/services/api/v1/deserialization/funding.rb +++ b/app/services/api/v1/deserialization/funding.rb @@ -3,7 +3,7 @@ module Api module V1 module Deserialization - # Logic to deserialize RDA common standard to a Plan funder and grant infor + # Logic to deserialize RDA common standard to a Plan funder and grant info class Funding class << self # Convert the funding information and attach to the Plan diff --git a/app/services/api/v1/deserialization/plan.rb b/app/services/api/v1/deserialization/plan.rb index 3f4d8ddcb7..75f5a5f220 100644 --- a/app/services/api/v1/deserialization/plan.rb +++ b/app/services/api/v1/deserialization/plan.rb @@ -64,7 +64,7 @@ def deserialize(json: {}) # TODO: Handle ethical issues when the Question is in place - # Process Project, Contributors and Data Contact and Datsets + # Process Project, Contributors and Data Contact and Datasets plan = deserialize_project(plan: plan, json: json) plan = deserialize_contact(plan: plan, json: json) plan = deserialize_contributors(plan: plan, json: json) diff --git a/app/services/api/v1/deserialization_service.rb b/app/services/api/v1/deserialization_service.rb index 1c396d995e..f777e940d2 100644 --- a/app/services/api/v1/deserialization_service.rb +++ b/app/services/api/v1/deserialization_service.rb @@ -74,7 +74,7 @@ def translate_role(role:) url = ::Contributor::ONTOLOGY_BASE_URL role = role.gsub("#{url}/", '').downcase if role.include?(url) - # Return the role if its a valid one otherwise defualt + # Return the role if its a valid one otherwise default return role if ::Contributor.new.all_roles.include?(role.downcase.to_sym) default diff --git a/app/services/api/v2/conversion_service.rb b/app/services/api/v2/conversion_service.rb index 07c286106d..0c41d2c218 100644 --- a/app/services/api/v2/conversion_service.rb +++ b/app/services/api/v2/conversion_service.rb @@ -23,7 +23,7 @@ def yes_no_unknown_to_boolean(value) false end - # Converts the context and value into an Identifier with a psuedo + # Converts the context and value into an Identifier with a pseudo # IdentifierScheme for display in JSON partials. Which will result in: # { type: 'context', identifier: 'value' } def to_identifier(context:, value:) diff --git a/app/services/api/v2/deserialization/dataset.rb b/app/services/api/v2/deserialization/dataset.rb index a45789928e..6f986c487b 100644 --- a/app/services/api/v2/deserialization/dataset.rb +++ b/app/services/api/v2/deserialization/dataset.rb @@ -110,7 +110,7 @@ def find_by_identifier(plan:, json:) research_output end - # Find the dateset by ID or title + plan + # Find the dataset by ID or title + plan def find_or_initialize(plan:, json: {}) return nil if json.blank? diff --git a/app/services/api/v2/deserialization/plan.rb b/app/services/api/v2/deserialization/plan.rb index bb8ecb4fa2..adc6f252ce 100644 --- a/app/services/api/v2/deserialization/plan.rb +++ b/app/services/api/v2/deserialization/plan.rb @@ -62,7 +62,7 @@ def deserialize(json: {}) plan.ethical_issues_description = json[:ethical_issues_description] plan.ethical_issues_report = json[:ethical_issues_report] - # Process Project, Contributors and Data Contact and Datsets + # Process Project, Contributors and Data Contact and Datasets plan = deserialize_project(plan: plan, json: json) # The contact is handled from within the controller since the Plan.add_user! method # requires that the Plan has been persisted to the DB diff --git a/app/services/api/v2/deserialization_service.rb b/app/services/api/v2/deserialization_service.rb index cc945e31c8..af6546a6e0 100644 --- a/app/services/api/v2/deserialization_service.rb +++ b/app/services/api/v2/deserialization_service.rb @@ -64,7 +64,7 @@ def translate_role(role:) role = role.gsub(url, '').downcase if role.include?(url) role = role.tr('-', '_').delete('/') - # Return the role if its a valid one otherwise defualt + # Return the role if its a valid one otherwise default return role if ::Contributor.new.all_roles.include?(role.downcase.to_sym) default diff --git a/app/services/external_apis/base_service.rb b/app/services/external_apis/base_service.rb index 40daad6b71..688f746c3e 100644 --- a/app/services/external_apis/base_service.rb +++ b/app/services/external_apis/base_service.rb @@ -42,7 +42,7 @@ def active? end # The standard headers to be used when communicating with an external API. - # These headers can be overriden or added to when calling an external API + # These headers can be overridden or added to when calling an external API # by sending your changes in the `additional_headers` attribute of # `http_get` def headers diff --git a/app/services/external_apis/orcid_service.rb b/app/services/external_apis/orcid_service.rb index 3ad1d51748..48b290b7e2 100644 --- a/app/services/external_apis/orcid_service.rb +++ b/app/services/external_apis/orcid_service.rb @@ -47,7 +47,7 @@ def add_work(user:, plan:) # TODO: allow the user to reauth to get a token if they do not have one or theirs is expired/revoked - # Fail if the user doesn't have an orcid or an acess token + # Fail if the user doesn't have an orcid or an access token return false unless orcid.present? && token.present? target = "#{api_base_url}#{format(work_path, id: orcid.value.gsub(landing_page_url, ''))}" diff --git a/app/services/org/create_created_plan_service.rb b/app/services/org/create_created_plan_service.rb index 2f88950305..13ddff0dcb 100644 --- a/app/services/org/create_created_plan_service.rb +++ b/app/services/org/create_created_plan_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatCreatedPlan.class diff --git a/app/services/org/create_exported_plan_service.rb b/app/services/org/create_exported_plan_service.rb index 7fe475b98b..5b4b543114 100644 --- a/app/services/org/create_exported_plan_service.rb +++ b/app/services/org/create_exported_plan_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatExportedPlan.class diff --git a/app/services/org/create_joined_user_service.rb b/app/services/org/create_joined_user_service.rb index cc8707467f..a30d949ea5 100644 --- a/app/services/org/create_joined_user_service.rb +++ b/app/services/org/create_joined_user_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatJoinedUser.class diff --git a/app/services/org/create_last_month_created_plan_service.rb b/app/services/org/create_last_month_created_plan_service.rb index 43940c2c2b..74e563aa58 100644 --- a/app/services/org/create_last_month_created_plan_service.rb +++ b/app/services/org/create_last_month_created_plan_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatCreatedPlan.class diff --git a/app/services/org/create_last_month_exported_plan_service.rb b/app/services/org/create_last_month_exported_plan_service.rb index b1dc366d3c..096fbc32db 100644 --- a/app/services/org/create_last_month_exported_plan_service.rb +++ b/app/services/org/create_last_month_exported_plan_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatExportedPlan.class diff --git a/app/services/org/create_last_month_joined_user_service.rb b/app/services/org/create_last_month_joined_user_service.rb index 640cfe0821..49df87e06e 100644 --- a/app/services/org/create_last_month_joined_user_service.rb +++ b/app/services/org/create_last_month_joined_user_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatJoinedUser.class diff --git a/app/services/org/create_last_month_shared_plan_service.rb b/app/services/org/create_last_month_shared_plan_service.rb index fca29870bc..58126d0f62 100644 --- a/app/services/org/create_last_month_shared_plan_service.rb +++ b/app/services/org/create_last_month_shared_plan_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatSharedPlan.class diff --git a/app/services/org/create_shared_plan_service.rb b/app/services/org/create_shared_plan_service.rb index 7a914816ee..ad64986ed8 100644 --- a/app/services/org/create_shared_plan_service.rb +++ b/app/services/org/create_shared_plan_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# statements fix Circular dependancy errors due to threading +# statements fix Circular dependency errors due to threading # see: https://github.com/grosser/parallel#nameerror-uninitialized-constant OrgDateRangeable.class StatSharedPlan.class diff --git a/app/views/branded/plans/_collaborator_form.html.erb b/app/views/branded/plans/_collaborator_form.html.erb index 44dd57a4be..ac86165c0b 100644 --- a/app/views/branded/plans/_collaborator_form.html.erb +++ b/app/views/branded/plans/_collaborator_form.html.erb @@ -2,7 +2,7 @@ <% editor = Role.new(editor: true, commenter: true) %> <% commenter = Role.new(commenter: true) %> <% administerable = @plan.administerable_by?(current_user.id) %> -<% email_tooltip = _("Enter the email address of your collaborator: If they are already using #{ApplicationService.application_name}, they will see this plan on their dashboard, and receive an email. If they are not currently using #{ApplicationService.application_name}, they will recieve an email inviting them to the tool so they can collaborate on your plan.") %> +<% email_tooltip = _("Enter the email address of your collaborator: If they are already using #{ApplicationService.application_name}, they will see this plan on their dashboard, and receive an email. If they are not currently using #{ApplicationService.application_name}, they will receive an email inviting them to the tool so they can collaborate on your plan.") %> <% permissions_tooltip = _('Co-owner: Has admin-rights to the plan (can invite other users, view the plan, answer questions, or comment). Editor: Has edit-rights to the plan (can view the plan, answer questions, or comment). Read Only: Has read-rights to the plan (can view the plan or comment)') %>

    <%= _('DMP Collaborators')%>

    diff --git a/app/views/branded/plans/_download_form.html.erb b/app/views/branded/plans/_download_form.html.erb index 0e2010dc9e..124903271e 100644 --- a/app/views/branded/plans/_download_form.html.erb +++ b/app/views/branded/plans/_download_form.html.erb @@ -133,7 +133,7 @@ options_for_select(Settings::Template::VALID_MARGIN_RANGE.to_a, @export_settings.formatting[:margin][:right]), class: 'form-control', - "data-default": @plan.template.settings(:export).formatting[:margin][:rigth] %> + "data-default": @plan.template.settings(:export).formatting[:margin][:right] %>
    diff --git a/app/views/branded/plans/_visibility_form.html.erb b/app/views/branded/plans/_visibility_form.html.erb index 91e59219c1..a47d616840 100644 --- a/app/views/branded/plans/_visibility_form.html.erb +++ b/app/views/branded/plans/_visibility_form.html.erb @@ -50,7 +50,7 @@ <% else %>

     <%= _("This plan is currently set to: ") %> <% if plan.publicly_visible? %> - <%= _('Public visibilty - anyone can view').html_safe %> + <%= _('Public visibility - anyone can view').html_safe %> <% elsif plan.organisationally_visible? %> <%= _('Organisation visibility - anyone at my organisation can view').html_safe %> <% else %> diff --git a/app/views/branded/static_pages/general_guidance.html.erb b/app/views/branded/static_pages/general_guidance.html.erb index 66cd03db22..c489d03388 100644 --- a/app/views/branded/static_pages/general_guidance.html.erb +++ b/app/views/branded/static_pages/general_guidance.html.erb @@ -305,7 +305,7 @@

    <%= _('Common additional elements') %>

      -
    • <%= sanitize _('Although the core elements are sufficient in the simplest case – citation to the entirety of a static dataset – additional elements may be needed if you wish to cite a dynamic dataset or a subset of a larger dataset.
      • Version of the dataset analyzed in the citing paper
      • Access date when the data was accessed for analysis in the citing paper
      • Subset of the dataset analyzed (e.g., a range of dates or record numbers, a list of variables)
      • Verifier that the dataset or subset accessed by a reader is identical to the one analyzed by the author (e.g., a Checksum)
      • Location of the dataset on the internet, needed if the identifier is not "actionable" (convertable to a web address)
      ') %>
    • +
    • <%= sanitize _('Although the core elements are sufficient in the simplest case – citation to the entirety of a static dataset – additional elements may be needed if you wish to cite a dynamic dataset or a subset of a larger dataset.
      • Version of the dataset analyzed in the citing paper
      • Access date when the data was accessed for analysis in the citing paper
      • Subset of the dataset analyzed (e.g., a range of dates or record numbers, a list of variables)
      • Verifier that the dataset or subset accessed by a reader is identical to the one analyzed by the author (e.g., a Checksum)
      • Location of the dataset on the internet, needed if the identifier is not "actionable" (convertible to a web address)
      ') %>

    <%= _('Example citations') %>

    diff --git a/app/views/plans/_share_form.html.erb b/app/views/plans/_share_form.html.erb index e68cede35a..c197468340 100644 --- a/app/views/plans/_share_form.html.erb +++ b/app/views/plans/_share_form.html.erb @@ -2,7 +2,7 @@ <% editor = Role.new(editor: true, commenter: true) %> <% commenter = Role.new(commenter: true) %> <% administerable = @plan.administerable_by?(current_user.id) %> -<% email_tooltip = _("Enter the email address of your collaborator: If they are already using #{ApplicationService.application_name}, they will see this plan on their dashboard, and recieve an email. If they are not currently using #{ApplicationService.application_name}, they will recieve an email inviting them to the tool so they can collaborate on your plan.") %> +<% email_tooltip = _("Enter the email address of your collaborator: If they are already using #{ApplicationService.application_name}, they will see this plan on their dashboard, and receive an email. If they are not currently using #{ApplicationService.application_name}, they will receive an email inviting them to the tool so they can collaborate on your plan.") %> <% permissions_tooltip = _('Co-owner: Has admin-rights to the plan (can invite other users, view the plan, answer questions, or comment). Editor: Has edit-rights to the plan (can view the plan, answer questions, or comment). Read Only: Has read-rights to the plan (can view the plan or comment)') %>

    <%= _('Set plan visibility') %>

    diff --git a/app/views/shared/export/_plan_txt.erb b/app/views/shared/export/_plan_txt.erb index 07ce5bc122..52da27ebc2 100644 --- a/app/views/shared/export/_plan_txt.erb +++ b/app/views/shared/export/_plan_txt.erb @@ -49,7 +49,7 @@ <% if remove_list(@plan).include?(question[:id]) %> <% next %> <% end %> - <%# text in this case is an array to accomodate for option_based %> + <%# text in this case is an array to accommodate for option_based %> <% if @show_questions %> <% answer = @plan.answer(question[:id], false) %> <% if @show_unanswered %> @@ -89,7 +89,7 @@ <%= "#{strip_tags(output.description.gsub(/<\/?p>/, '').gsub(//, '\n').chomp)}\n\n" %> <%= "" %> <%= "#{_(" May contain sensitive data?")}:\t#{presenter.display_boolean(value: output.sensitive_data)}" %> - <%= "#{_(" May contain personally identiable information?")}:\t#{presenter.display_boolean(value: output.personal_data)}" %> + <%= "#{_(" May contain personally identifiable information?")}:\t#{presenter.display_boolean(value: output.personal_data)}" %> <%= "#{_(" Intended repository(ies)")}:\t#{presenter.display_repository.join(", ")}" %> <%= "#{_(" Initial license")}:\t#{presenter.display_license}" %> <%= "#{_(" Metadata standard(s)")}:\t#{presenter.display_metadata_standard.join(", ")}" %> diff --git a/app/views/super_admin/api_clients/_form.html.erb b/app/views/super_admin/api_clients/_form.html.erb index e7f076ee75..28c4d07330 100644 --- a/app/views/super_admin/api_clients/_form.html.erb +++ b/app/views/super_admin/api_clients/_form.html.erb @@ -4,7 +4,7 @@ method = @api_client.new_record? ? :post : :put orgs = Org.includes(identifiers: [:identifier_scheme]).where(is_other: false) tooltip_for_trusted = _("The API Client is a trusted external application and will be able to access read/edit/create/delete any data without having to acquire the User's authorization via OAuth.") -redirect_uri_tooltip = _("A redirect URI is the address that will be sent the user's OAuth authorization code. If you have multiple URIs, pllease place them on inidividual lines. The redirect_uri you specify in your calls to the API must match one of the ones you define here.") +redirect_uri_tooltip = _("A redirect URI is the address that will be sent the user's OAuth authorization code. If you have multiple URIs, pllease place them on individual lines. The redirect_uri you specify in your calls to the API must match one of the ones you define here.") callback_uri_tooltip = _("An API endpoint on your application/system that we can use to notify you when a DMP is updated. You will receive notifications of updates to any DMPs you create, download or update.") scopes_tooltip = _("Specify the types of access we allow for this API Client.") %> diff --git a/app/views/users/_api_client_form.html.erb b/app/views/users/_api_client_form.html.erb index c00b6af160..efc9131802 100644 --- a/app/views/users/_api_client_form.html.erb +++ b/app/views/users/_api_client_form.html.erb @@ -8,7 +8,7 @@ name_tooltip = _("The name of your application/system that will interact with the %{application_name}'s API") % { application_name: "DMPTool" } description_tooltip = _("Please provide a brief description of your system and the purpose of the intgeration.") - redirect_uri_tooltip = _("A redirect URI is the address that will be sent the user's OAuth authorization code. If you have multiple URIs, pllease place them on inidividual lines. The redirect_uri you specify in your calls to the API must match one of the ones you define here.") + redirect_uri_tooltip = _("A redirect URI is the address that will be sent the user's OAuth authorization code. If you have multiple URIs, pllease place them on individual lines. The redirect_uri you specify in your calls to the API must match one of the ones you define here.") callback_uri_tooltip = _("An API endpoint on your application/system that we can use to notify you when a DMP is updated. You will receive notifications of updates to any DMPs you create, download or update.") %> <%= form_for api_client, url: url, method: method, remote: true, html: { class: 'api_client' } do |f| %> diff --git a/config/initializers/htmlto_word_xslt_helper.rb b/config/initializers/htmlto_word_xslt_helper.rb index 5b2c56943f..b72cd6772e 100644 --- a/config/initializers/htmlto_word_xslt_helper.rb +++ b/config/initializers/htmlto_word_xslt_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # This helper method xslt_path prepends the htmltoword method, -# to allow us to overide the numbering.xslt styleheet with one +# to allow us to override the numbering.xslt styleheet with one # with fix in https://github.com/karnov/htmltoword/issues/73 # We applied this gem gem htmltoword-1.1.0. diff --git a/docs/sso/README.md b/docs/sso/README.md index f10346d6e4..c5a101ae98 100644 --- a/docs/sso/README.md +++ b/docs/sso/README.md @@ -8,7 +8,7 @@ The DMPTool requires that the following SAML attributes are released: - `eduPersonPrincipalName` **required** (aka eppn, the user's unique identifier. The value should be universally unique, the most common value is the email) - `mail` **required** (the users email address) - `displayName` (the user's first and last name) -- or send `givenname` and `sn`as seperate fields +- or send `givenname` and `sn`as separate fields Once your institution's Identity Provider is configured correctly, a DMPTool administrator can enable your institution to use SSO within the DMPTool. Once enabled, your users will select your institution from the DMPTool login screen then be redirected to your institution's login page to authenticate. @@ -56,6 +56,6 @@ If the [SSO Test Page](https://dmptool.org/cgi-bin/PrintShibInfo.pl) shows a bla This message was received from your institution's SSO which did not recognize the DMPTool as a trusted service provider. You will need to contact your IT department that supports your SSO to have them add the DMPTool as a trusted service. Include a link to this page when you contact them. -### I clicked on the button to sign in with my institutional credentials and received an 'Unknown or unusable identitiy provider' error +### I clicked on the button to sign in with my institutional credentials and received an 'Unknown or unusable identity provider' error We use an 'entityID' to determine where the URL of your SSO system. You would receive this message if we have the wrong entityID for your institution. You can find your institution's entityID from the [InCommon](https://www.incommon.org/community-organizations/) or [eduGAIN](https://technical.edugain.org/entities) directories. diff --git a/lib/data_cleanup/README.md b/lib/data_cleanup/README.md index 0574bf30da..939c5f5bf1 100644 --- a/lib/data_cleanup/README.md +++ b/lib/data_cleanup/README.md @@ -65,7 +65,7 @@ These are defined in `lib/data_cleanup/rules`. ### Creating a new rule -You can create a new rule by running the following genrator: +You can create a new rule by running the following generator: ``` bash $ rails g data_cleanup_rule user/fix_missing_emails @@ -73,7 +73,7 @@ $ rails g data_cleanup_rule user/fix_missing_emails This will create a file `lib/data_cleanup/rules/user/fix_missing_emails.rb` which contains the rules for updating users with missing emails. -Feel free to add your own rules where neccesary to fix your own data. +Feel free to add your own rules where necessary to fix your own data. ## Logging output diff --git a/lib/global_helpers.rb b/lib/global_helpers.rb index 7d52c0c4df..02b0935a86 100644 --- a/lib/global_helpers.rb +++ b/lib/global_helpers.rb @@ -3,10 +3,10 @@ # Helpers for GetText strings module GlobalHelpers # overloading the method - # came across a wierd issue where the function would refused to be called from + # came across a weird issue where the function would refused to be called from # class functions of other classes... but it will work if this is a class function # easiest way to give this functionality is to overload the function - # if you have a better solution, please impliment it as this is ugly + # if you have a better solution, please implement it as this is ugly def self.constant(str) I18n.t("magic_strings.#{str}", locale: I18n.default_locale) end @@ -16,7 +16,7 @@ def self.constant(str) ## # Takes in a string which is meant to be constant, and looks it up in the default # (en_GB) locale. This should ensure that the back-end remains constant and - # consistantly called + # consistently called # # str - The String which will be looked up in the localisation # diff --git a/lib/ssm_config_loader.rb b/lib/ssm_config_loader.rb index fa1ae05194..a12fb191db 100644 --- a/lib/ssm_config_loader.rb +++ b/lib/ssm_config_loader.rb @@ -15,7 +15,7 @@ def call(name:, **_opts) ssm = Uc3Ssm::ConfigResolver.new parameters = ssm.parameters_for_path(path: name, recursive: true) config = {} - # reverse processing order to ensure correct precidence based on ssm_root_path + # reverse processing order to ensure correct precedence based on ssm_root_path parameters.reverse_each do |param| # strip off ssm_root_path sub_path = name + param[:name].partition(name)[-1] diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake index 3404f925a2..f528ac4988 100644 --- a/lib/tasks/upgrade.rake +++ b/lib/tasks/upgrade.rake @@ -606,7 +606,7 @@ namespace :upgrade do section.update! versionable_id: funder_section.versionable_id if fuzzy_match?(text_a, text_b) end - funder_section.questions.select { |ques| ques.versionable_id.nil? }.each do |funder_question| + funder_section.questions.select { |quest| quest.versionable_id.nil? }.each do |funder_question| Rails.logger.info "Updating versionable_id for Question: #{funder_question.id}" funder_question.update! versionable_id: SecureRandom.uuid @@ -1202,7 +1202,7 @@ namespace :upgrade do p '' p " Assigned #{number_with_delimiter(rors_added)} ROR identifiers to your Orgs" p " Assigned #{number_with_delimiter(fundrefs_added)} Crossref Funder identifiers to your Orgs" - p ' NOTE: Please refer to the tmp/ror_fundref_ids.csv file to see how the assigment worked.' + p ' NOTE: Please refer to the tmp/ror_fundref_ids.csv file to see how the assignment worked.' p ' You should make any adjustments BEFORE running part 2 of the upgrade scripts!' p ' For example ROR sometimes incorrectly matches Orgs. For example:' p " 'University of Somewhere' may match to 'Univerity of Somewhere - Medical Center'" diff --git a/lib/tasks/utils/templates.rake b/lib/tasks/utils/templates.rake index 7b6a0efa96..c83731f9e3 100644 --- a/lib/tasks/utils/templates.rake +++ b/lib/tasks/utils/templates.rake @@ -53,7 +53,7 @@ namespace :templates do versionable_id: section_version ) - section.questions.select { |ques| ques.versionable_id.nil? }.each do |question| + section.questions.select { |quest| quest.versionable_id.nil? }.each do |question| question_version = SecureRandom.uuid p " Updating versionable_id for Question: #{question.id} to #{question_version}" question.update_columns(versionable_id: question_version) diff --git a/public/i18n.js b/public/i18n.js index 79806b400e..9031caa370 100644 --- a/public/i18n.js +++ b/public/i18n.js @@ -364,7 +364,7 @@ } }; - // Merge serveral hash options, checking if value is set before + // Merge several hash options, checking if value is set before // overwriting any value. The precedence is from left to right. // // I18n.prepareOptions({name: "John Doe"}, {name: "Mary Doe", role: "user"}); diff --git a/spec/controllers/contributors_controller_spec.rb b/spec/controllers/contributors_controller_spec.rb index bdf55e1097..3ce7ddab13 100644 --- a/spec/controllers/contributors_controller_spec.rb +++ b/spec/controllers/contributors_controller_spec.rb @@ -72,7 +72,7 @@ expect(contrib.email).to eql(params[:email]) expect(contrib.phone).to eql(params[:phone].to_s) - # Verify that the corrrect roles were assigned + # Verify that the correct roles were assigned contrib.all_roles.each do |role| expect(contrib.send(:"#{role}?")).to eql(params[:"#{role}"] == '1') end @@ -98,7 +98,7 @@ expect(@contributor.email).to eql(params[:email]) expect(@contributor.phone).to eql(params[:phone].to_s) - # Verify that the corrrect roles were assigned + # Verify that the correct roles were assigned @contributor.all_roles.each do |role| expect(@contributor.send(:"#{role}?")).to eql(params[:"#{role}"] == '1') end diff --git a/spec/models/language_spec.rb b/spec/models/language_spec.rb index 35885205df..c2a5bc8ab5 100644 --- a/spec/models/language_spec.rb +++ b/spec/models/language_spec.rb @@ -55,7 +55,7 @@ describe '.default' do subject { described_class.default } - context 'when langauge is default_language' do + context 'when language is default_language' do let!(:language) { create(:language, abbreviation: 'foo', default_language: true) } it { is_expected.to eql(language) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 17ba559237..6e411b9145 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -502,7 +502,7 @@ let!(:key) { :email } - context "when the User doesn't have thier own Pref" do + context "when the User doesn't have their own Pref" do it 'returns the default value' do Pref.expects(:default_settings) .returns(email: { foo: { 'bar' => 'baz' } }) @@ -510,7 +510,7 @@ end end - context 'when the User has thier own Pref' do + context 'when the User has their own Pref' do before do create(:pref, user: user, settings: { email: { foo: { bar: 'bam' } } }) diff --git a/spec/presenters/identifier_presenter_spec.rb b/spec/presenters/identifier_presenter_spec.rb index 32660ca2c4..78fa736ffb 100644 --- a/spec/presenters/identifier_presenter_spec.rb +++ b/spec/presenters/identifier_presenter_spec.rb @@ -11,7 +11,7 @@ end describe '#identifiers' do - it "returns the identiable object's identifiers" do + it "returns the identifiable object's identifiers" do id = build(:identifier) @user.identifiers << id @user.org.identifiers << build(:identifier) diff --git a/spec/services/api/v1/conversion_service_spec.rb b/spec/services/api/v1/conversion_service_spec.rb index e5aaecb199..1e547ad220 100644 --- a/spec/services/api/v1/conversion_service_spec.rb +++ b/spec/services/api/v1/conversion_service_spec.rb @@ -59,7 +59,7 @@ expect(expected.identifier_scheme.name).to eql(context) end - it "returns an Identifier asssociated with the 'grant' scheme" do + it "returns an Identifier associated with the 'grant' scheme" do value = Faker::Lorem.word expected = described_class.to_identifier(context: Faker::Lorem.word, value: value) diff --git a/spec/services/api/v2/conversion_service_spec.rb b/spec/services/api/v2/conversion_service_spec.rb index d546faa7e2..a5ede1fa2a 100644 --- a/spec/services/api/v2/conversion_service_spec.rb +++ b/spec/services/api/v2/conversion_service_spec.rb @@ -59,7 +59,7 @@ expect(expected.identifier_scheme.name).to eql(context) end - it "returns an Identifier asssociated with the 'grant' scheme" do + it "returns an Identifier associated with the 'grant' scheme" do value = Faker::Lorem.word expected = described_class.to_identifier(context: Faker::Lorem.word, value: value) diff --git a/spec/services/api/v2/json_validation_service_spec.rb b/spec/services/api/v2/json_validation_service_spec.rb index 9835d3f7fb..114396ecdd 100644 --- a/spec/services/api/v2/json_validation_service_spec.rb +++ b/spec/services/api/v2/json_validation_service_spec.rb @@ -143,7 +143,7 @@ end it 'returns `false` when json[:title] or json[:dataset_id] are not present' do - json = { desription: Faker::Lorem.paragraph } + json = { description: Faker::Lorem.paragraph } expect(described_class.dataset_valid?(json: json)).to be(false) end diff --git a/spec/services/external_apis/base_service_spec.rb b/spec/services/external_apis/base_service_spec.rb index b9721d376f..9a81b57b98 100644 --- a/spec/services/external_apis/base_service_spec.rb +++ b/spec/services/external_apis/base_service_spec.rb @@ -259,7 +259,7 @@ expect(result[:headers][:Accept]).to eql('*/*') end - it 'merges additonal headers into the :headers option' do + it 'merges additional headers into the :headers option' do result = described_class.send(:options, additional_headers: { foo: 'bar' }) expect(result[:headers][:Accept]).to eql('*/*') expect(result[:headers][:foo]).to eql('bar') diff --git a/spec/services/external_apis/spdx_service_spec.rb b/spec/services/external_apis/spdx_service_spec.rb index 689f778d24..f5b6b119b0 100644 --- a/spec/services/external_apis/spdx_service_spec.rb +++ b/spec/services/external_apis/spdx_service_spec.rb @@ -51,7 +51,7 @@ expect(described_class.send(:query_spdx)).to eql([]) end - it 'returns an empty array if the response conatins no license' do + it 'returns an empty array if the response contains no license' do JSON.expects(:parse).returns({}) expect(described_class.send(:query_spdx)).to eql([]) end diff --git a/spec/services/org/create_created_plan_service_spec.rb b/spec/services/org/create_created_plan_service_spec.rb index 473d88ff44..1526738c47 100644 --- a/spec/services/org/create_created_plan_service_spec.rb +++ b/spec/services/org/create_created_plan_service_spec.rb @@ -152,7 +152,7 @@ def find_by_dates(dates:, org_id:) expect(counts).to eq([2, 1, 2, 0]) end - it 'generates montly counts by template for each org since their creation' do + it 'generates monthly counts by template for each org since their creation' do Org.stubs(:all).returns([org]) described_class.call diff --git a/spec/services/org_selection/search_service_spec.rb b/spec/services/org_selection/search_service_spec.rb index 61d77a6ccb..ff6b6b83a6 100644 --- a/spec/services/org_selection/search_service_spec.rb +++ b/spec/services/org_selection/search_service_spec.rb @@ -261,7 +261,7 @@ end end - describe '#evaluate(reord:, search_term:)' do + describe '#evaluate(record:, search_term:)' do before do described_class.stubs(:score).returns(0) described_class.stubs(:weigh).returns(0) diff --git a/spec/support/helpers/autocomplete_helper.rb b/spec/support/helpers/autocomplete_helper.rb index 03547e370c..81fdfb2411 100644 --- a/spec/support/helpers/autocomplete_helper.rb +++ b/spec/support/helpers/autocomplete_helper.rb @@ -54,7 +54,7 @@ def suggestion_exists?(name) # # Some unfortunate hacks to deal with naming inconsistencies on the create plan page # # and the Super Admin merge orgs tab # id = id.gsub('org_org_', 'org_').gsub('funder_org_', 'funder_') - # # Excape any single quotes so it doesn't blow up our JS + # # Escape any single quotes so it doesn't blow up our JS # hash = { id: org.id, name: org.name.gsub("'", '') } # # Capybara/Selenium can't interact with a hidden field because the user can't, # # so use some JS to set the value