diff --git a/CHANGELOG.md b/CHANGELOG.md index 6931cab0d3..946898ba6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,18 @@ # Changelog -## v4.1.1 +## V4.1.1 +### Added +- Added `MORE_INFO` and `LESS_INFO` JS constants (for the Research Outputs feature) - Added a .gitkeep file to the app/assets/builds directory to address potential issues when building the application.css file during production deploys #3314 +### Fixed +- Updated the default font on the 'Download page' to be 'Roboto, Arial, Sans-Serif' +- Fixed an issue with API V0 that was causing a 500 Internal Server error +- Solved issue where spring was loaded in production mode : ran `bin/spring binstub --all` +- Updated fontawesome to V6 + + ## v4.1.0 **Note this upgrade is a migration from Ruby v2.7.6 to v3.0.5.** Note that this could have an impact on any customizations you may have made to your fork of this project. Please see https://www.fastruby.io/blog/ruby/upgrades/upgrade-ruby-from-2.7-to-3.0.html for further information on what to check. In particular, please note the changes to the way [Ruby 3 handles keyword arguments](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/) diff --git a/app/assets/stylesheets/blocks/_font_awesomes.scss b/app/assets/stylesheets/blocks/_font_awesomes.scss index 80cd437774..ddfc9d197d 100644 --- a/app/assets/stylesheets/blocks/_font_awesomes.scss +++ b/app/assets/stylesheets/blocks/_font_awesomes.scss @@ -15,12 +15,12 @@ } /* change color of search icon */ -.fa-search { +.fa-magnifying-glass { color: $color-primary-text; } /* adjust the position of the 'remove - X' button for links */ -.link .fa-times-circle { +.link .fa-circle-xmark { margin-top: $grid-gutter-width; } diff --git a/app/controllers/api/v0/plans_controller.rb b/app/controllers/api/v0/plans_controller.rb index 4e74ab2db9..4f61a211d3 100644 --- a/app/controllers/api/v0/plans_controller.rb +++ b/app/controllers/api/v0/plans_controller.rb @@ -101,7 +101,7 @@ def index max_per_page = Rails.configuration.x.application.api_max_page_size page = params.fetch('page', 1).to_i per_page = params.fetch('per_page', max_per_page).to_i - per_page = max_per_page if @per_page > max_per_page + per_page = max_per_page if per_page > max_per_page @args = { per_page: per_page, page: page } @plans = refine_query(@plans) respond_with @plans diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index feebd82668..98a51f3781 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -8,11 +8,11 @@ module NotificationsHelper def fa_classes(notification) case notification.level when 'warning' - 'fa-exclamation-circle' + 'fa-circle-exclamation' when 'danger' - 'fa-times-circle' + 'fa-circle-xmark' else - 'fa-info-circle' + 'fa-circle-info' end end end diff --git a/app/helpers/template_helper.rb b/app/helpers/template_helper.rb index 807e6c4559..7e0cdc7917 100644 --- a/app/helpers/template_helper.rb +++ b/app/helpers/template_helper.rb @@ -48,7 +48,7 @@ def direct_link(template, hidden = false, text = nil, id = nil) link_to(plans_url(plan: params), method: :post, title: _('Create plan'), class: cls, id: id, style: style) do if text.nil? - ''.html_safe + ''.html_safe else text.html_safe end diff --git a/app/javascript/src/answers/rdaMetadata.js b/app/javascript/src/answers/rdaMetadata.js index f0c8746813..0cb96bc10c 100644 --- a/app/javascript/src/answers/rdaMetadata.js +++ b/app/javascript/src/answers/rdaMetadata.js @@ -129,9 +129,9 @@ $(() => { Object.keys(standardsArray).forEach((key) => { // add the standard to list if (key === standardsArray[key]) { - selectedStandards.append(`
  • ${key}${key}${descriptions[key].title}
  • `); + selectedStandards.append(`
  • ${descriptions[key].title}
  • `); } }); }); @@ -240,7 +240,7 @@ $(() => { standard = standardId; } }); - selectedStandards.append(`
  • ${descriptions[standard].title}
  • `); + selectedStandards.append(`
  • ${descriptions[standard].title}
  • `); const formStandards = group.next('form').find('#standards'); // get the data for selected standards from the data attribute 'standard' // of the hidden field #standards within the answer form @@ -271,7 +271,7 @@ $(() => { // the identifier for the standard which was selected const standard = target.data('standard'); // append the standard to the displayed list of selected standards - selectedStandards.append(`
  • ${descriptions[standard].title}
  • `); + selectedStandards.append(`
  • ${descriptions[standard].title}
  • `); const formStandards = group.next('form').find('#standards'); // get the data for selected standards from the data attribute 'standard' // of the hidden field #standards within the answer form @@ -327,7 +327,7 @@ $(() => { const group = target.closest('.rda_metadata'); const selectedStandards = group.find('.selected_standards .list'); const standardName = group.find('.custom-standard-name').val(); - selectedStandards.append(`
  • ${standardName}
  • `); + selectedStandards.append(`
  • ${standardName}
  • `); const formStandards = group.next('form').find('#standards'); // get the data for selected standards from the data attribute 'standard' // of the hidden field #standards within the answer form diff --git a/app/javascript/src/orgAdmin/phases/show.js b/app/javascript/src/orgAdmin/phases/show.js index 57af3b2634..f7f7f96095 100644 --- a/app/javascript/src/orgAdmin/phases/show.js +++ b/app/javascript/src/orgAdmin/phases/show.js @@ -29,7 +29,7 @@ $(() => { // Initialize the draggable-sections element as a jQuery sortable. // Read the docs here for more info: http://api.jqueryui.com/sortable/ $('.draggable-sections').sortable({ - handle: 'i.fa-arrows-alt', + handle: 'i.fa-up-down-left-right', axis: 'y', cursor: 'move', // Remove the placeholder object from the DOM once the item has been placed diff --git a/app/javascript/src/plans/index.js b/app/javascript/src/plans/index.js new file mode 100644 index 0000000000..81a696393a --- /dev/null +++ b/app/javascript/src/plans/index.js @@ -0,0 +1,29 @@ +import * as notifier from '../utils/notificationHelper'; +import getConstant from '../utils/constants'; +import { paginableSelector } from '../utils/paginable'; + +$(() => { + $(paginableSelector).on('ajax:success', 'input.set_test_plan', (e) => { + const checkbox = $(e.target); + const data = e.detail[0]; + if (data.code === 1 && data.msg && data.msg !== '') { + notifier.renderNotice(data.msg); + } else { + notifier.renderAlert(data.msg); + } + + if (checkbox.is(':checked')) { + checkbox.parent().siblings('.plan-visibility').html(getConstant('PLAN_VISIBILITY_WHEN_TEST')) + .attr('title', ''); + } else { + checkbox.parent().siblings('.plan-visibility').html(getConstant('PLAN_VISIBILITY_WHEN_NOT_TEST')) + .attr('title', getConstant('PLAN_VISIBILITY_WHEN_NOT_TEST_TOOLTIP')); + } + }); + $(paginableSelector).on('ajax:error', 'input.set_test_plan', (e) => { + const xhr = e.detail(2); + notifier.renderAlert(xhr.responseText); + }); + + $('#create-modal').modal('show'); +}); diff --git a/app/javascript/src/utils/notificationHelper.js b/app/javascript/src/utils/notificationHelper.js index 7e1647ac8e..cba147a8c9 100644 --- a/app/javascript/src/utils/notificationHelper.js +++ b/app/javascript/src/utils/notificationHelper.js @@ -40,7 +40,7 @@ function renderMessage(options = {}) { export function renderNotice(msg, options = {}) { renderMessage({ message: msg, - icon: 'check-circle', + icon: 'circle-check', className: 'alert-info', floating: options.floating === true, autoDismiss: options.autoDismiss === true, @@ -50,7 +50,7 @@ export function renderNotice(msg, options = {}) { export function renderAlert(msg, options = {}) { renderMessage({ message: msg, - icon: 'times-circle', + icon: 'circle-xmark', className: 'alert-warning', floating: options.floating === true, autoDismiss: options.autoDismiss === true, diff --git a/app/models/settings/template.rb b/app/models/settings/template.rb index 7a00ec970f..7e1878d4d0 100644 --- a/app/models/settings/template.rb +++ b/app/models/settings/template.rb @@ -38,7 +38,7 @@ class Template < RailsSettings::SettingObject left: 12, right: 12 }, - font_face: 'Arial, Helvetica, Sans-Serif', + font_face: 'Roboto, Arial, Sans-Serif', font_size: 10 # pt }, max_pages: 3, diff --git a/app/views/devise/registrations/_external_identifier.html.erb b/app/views/devise/registrations/_external_identifier.html.erb index 884dba3d91..a4fe597bc8 100644 --- a/app/views/devise/registrations/_external_identifier.html.erb +++ b/app/views/devise/registrations/_external_identifier.html.erb @@ -81,7 +81,7 @@ <% unlinktext = _("Unlink your account from #{scheme.description}. You can link again at any time.") %> <% unlinkconf = _("Are you sure you want to unlink #{scheme.description} ID?") %> <% end %> - <%= link_to ''.html_safe, + <%= link_to ''.html_safe, destroy_user_identifier_path(id), method: :delete, title: unlinktext, diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 15ca73dbff..242ede806c 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,67 +1,67 @@ -
    -
    -

    <%= _('Sign in or Create account') %>

    -
    -
    - -
    -
    - <% unless session["devise.shibboleth_data"].nil? %> - <% cookies[:show_shib_link] = { value: 'show_shib_link', - expires: 3.hours.from_now } %> - -
    -

    - <%= _("Do you have a %{application_name} account?") % { - application_name: ApplicationService.application_name} %> -

    -

    - -

    -

    - <%= _("Sign in") %> -

    -

    - <%= _("This will link your existing account to your credentials.") %> -

    -

    <%= render partial: 'shared/sign_in_form' %>

    -
    - -
    - -

    - <%= _("No %{application_name} account?") % { - application_name: ApplicationService.application_name} %> -

    - -

    - -

    - -

    - <%= _("Create account") %> -

    -

    - <%= _("This will create an account and link it to your credentials.") %> -

    -
    -

    - <%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %> -
    -

    -
    -
    - <% else %> -
    -

    - <%= _("Create account") %>   - -

    -
    - <%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %> -
    -
    - <% end %> -
    -
    +
    +
    +

    <%= _('Sign in or Create account') %>

    +
    +
    + +
    +
    + <% unless session["devise.shibboleth_data"].nil? %> + <% cookies[:show_shib_link] = { value: 'show_shib_link', + expires: 3.hours.from_now } %> + +
    +

    + <%= _("Do you have a %{application_name} account?") % { + application_name: ApplicationService.application_name} %> +

    +

    + +

    +

    + <%= _("Sign in") %> +

    +

    + <%= _("This will link your existing account to your credentials.") %> +

    +

    <%= render partial: 'shared/sign_in_form' %>

    +
    + +
    + +

    + <%= _("No %{application_name} account?") % { + application_name: ApplicationService.application_name} %> +

    + +

    + +

    + +

    + <%= _("Create account") %> +

    +

    + <%= _("This will create an account and link it to your credentials.") %> +

    +
    +

    + <%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %> +
    +

    +
    +
    + <% else %> +
    +

    + <%= _("Create account") %>   + +

    +
    + <%= render partial: 'shared/create_account_form', locals: {orgs: @all_orgs, org_partial: @org_partial} %> +
    +
    + <% end %> +
    +
    diff --git a/app/views/layouts/_notifications.html.erb b/app/views/layouts/_notifications.html.erb index 6ed6029f1c..dce4530756 100644 --- a/app/views/layouts/_notifications.html.erb +++ b/app/views/layouts/_notifications.html.erb @@ -6,7 +6,7 @@ <%= sanitize a.body %> <% if a.dismissable? %> <% end %> diff --git a/app/views/layouts/_signin_signout.html.erb b/app/views/layouts/_signin_signout.html.erb index f43d77b87e..56ad183de7 100644 --- a/app/views/layouts/_signin_signout.html.erb +++ b/app/views/layouts/_signin_signout.html.erb @@ -26,10 +26,10 @@ @@ -37,7 +37,7 @@ <% if !active_page?(root_path, true) %>
  • - + <%= _('Sign in') %>
  • diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8b35e5eec6..fe98bb3b93 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -88,7 +88,7 @@ class="notification-area alert <%= has_alert ? 'alert-warning ' : 'alert-info ' %> <%= (has_alert or has_notice) ? 'show' : 'hide' %>" role="<%= (has_notice ? 'status' : (has_alert ? 'alert' : '')) %>"> - + <%= has_alert ? _('Error:') : _('Notice:') %> <%= sanitize (has_alert ? alert : notice) %> <%= yield :errors %> @@ -144,7 +144,10 @@ AUTOCOMPLETE_ARIA_HELPER_EMPTY: _("No results are available for your entry."), AUTOCOMPLETE_SEARCHING: _("Searching ..."), - CURRENT_LOCALE: LocaleService.to_gettext(locale: @current_locale.to_s) + CURRENT_LOCALE: LocaleService.to_gettext(locale: @current_locale.to_s), + + MORE_INFO: _("More info"), + LESS_INFO: _("Less info") }.to_json %> diff --git a/app/views/org_admin/phases/container.html.erb b/app/views/org_admin/phases/container.html.erb index a7adaa7c0b..00533e9630 100644 --- a/app/views/org_admin/phases/container.html.erb +++ b/app/views/org_admin/phases/container.html.erb @@ -58,7 +58,7 @@
    <% if template.latest? && (modifiable || template.customization_of.present?) %> - + <%= _("Drag arrows to rearrange sections.") %> <% unless phase.sections.all?(&:modifiable?) %> <%= _("You may place them before or after the main template sections.") %> diff --git a/app/views/org_admin/sections/_section.html.erb b/app/views/org_admin/sections/_section.html.erb index cb56aa07b2..65d4456661 100644 --- a/app/views/org_admin/sections/_section.html.erb +++ b/app/views/org_admin/sections/_section.html.erb @@ -19,7 +19,7 @@ <% plussign = "fa-minus" if current_section.present? && section.id == current_section.id %> <% if local_assigns[:draggable] %> - <% end %> @@ -46,4 +46,4 @@ <% end %>
    - \ No newline at end of file + diff --git a/app/views/orgs/_profile_form.html.erb b/app/views/orgs/_profile_form.html.erb index d42a5bdf2c..06673fecd6 100644 --- a/app/views/orgs/_profile_form.html.erb +++ b/app/views/orgs/_profile_form.html.erb @@ -142,7 +142,7 @@ <%= _('Organisation Types') %>   - + @@ -171,7 +171,7 @@
    <%= _('Organisation type(s)') %>   - +
    diff --git a/app/views/paginable/templates/_customisable.html.erb b/app/views/paginable/templates/_customisable.html.erb index 9eaab2f9ed..da85873975 100644 --- a/app/views/paginable/templates/_customisable.html.erb +++ b/app/views/paginable/templates/_customisable.html.erb @@ -32,7 +32,7 @@ <% elsif customization.draft? %> <% tooltip = _('You have unpublished changes! Select "Publish changes" in the Actions menu when you are ready to make them available to users.') %> <%= _('Published') %> <%= tooltip %> -    +    <% else %> <%= _('Unpublished') %> <% end %> diff --git a/app/views/paginable/templates/_organisational.html.erb b/app/views/paginable/templates/_organisational.html.erb index 5058e6e060..2376970062 100644 --- a/app/views/paginable/templates/_organisational.html.erb +++ b/app/views/paginable/templates/_organisational.html.erb @@ -37,7 +37,7 @@ <% elsif template.draft? %> <% tooltip = _('You have unpublished changes! Select "Publish changes" in the Actions menu when you are ready to make them available to users.') %> <%= _('Published') %> <%= tooltip %> -    +    <% else %> <%= _('Unpublished') %> <% end %> diff --git a/app/views/shared/_links.html.erb b/app/views/shared/_links.html.erb index 2dfaa8568d..681af0352a 100644 --- a/app/views/shared/_links.html.erb +++ b/app/views/shared/_links.html.erb @@ -12,7 +12,7 @@   - + <%= tooltip %> @@ -40,7 +40,7 @@
    - +
    diff --git a/app/views/shared/_popover.html.erb b/app/views/shared/_popover.html.erb index 3a7519e62f..433b69935f 100644 --- a/app/views/shared/_popover.html.erb +++ b/app/views/shared/_popover.html.erb @@ -2,7 +2,7 @@ <% if message.present? %> - + <%= message %>> <% end %> diff --git a/app/views/shared/_search.html.erb b/app/views/shared/_search.html.erb index 7fb8c234c2..ea756ca074 100644 --- a/app/views/shared/_search.html.erb +++ b/app/views/shared/_search.html.erb @@ -4,7 +4,7 @@
    - + <%= text_field_tag(:search, search_term, class: 'form-control', 'aria-labelledby': 'search', spellcheck: true, 'aria-describedby': 'search-addon', 'aria-required': true) %> diff --git a/app/views/super_admin/users/_confirm_merge.html.erb b/app/views/super_admin/users/_confirm_merge.html.erb index 8814a35334..4c0c5d1fc0 100644 --- a/app/views/super_admin/users/_confirm_merge.html.erb +++ b/app/views/super_admin/users/_confirm_merge.html.erb @@ -6,7 +6,7 @@
    - + <%= select_tag(:merge_id, options_from_collection_for_select(@users, "id", "email"), class: "form-control") %>
    diff --git a/app/views/super_admin/users/edit.html.erb b/app/views/super_admin/users/edit.html.erb index 098af7517a..e95e0c89c0 100644 --- a/app/views/super_admin/users/edit.html.erb +++ b/app/views/super_admin/users/edit.html.erb @@ -88,7 +88,7 @@
    - + <%= text_field_tag(:email, nil, class: "form-control", placeholder: _("Email")) %>
    diff --git a/bin/rspec b/bin/rspec index 01397d929f..6021396d7c 100755 --- a/bin/rspec +++ b/bin/rspec @@ -5,7 +5,6 @@ begin rescue LoadError => e raise unless e.message.include?('spring') end - # # This file was generated by Bundler. # diff --git a/bin/spring b/bin/spring index d89ee495fa..4080d890e1 100755 --- a/bin/spring +++ b/bin/spring @@ -1,15 +1,12 @@ #!/usr/bin/env ruby -# This file loads Spring without using Bundler, in order to be fast. +# This file loads Spring without using loading other gems in the Gemfile, in order to be fast. # It gets overwritten when you run the `spring binstub` command. -unless defined?(Spring) - require 'rubygems' +if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV['RAILS_ENV']) require 'bundler' - lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) - spring = lockfile.specs.detect { |spec| spec.name == 'spring' } - if spring + Bundler.locked_gems.specs.find { |spec| spec.name == 'spring' }&.tap do |spring| Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path gem 'spring', spring.version require 'spring/binstub' diff --git a/package.json b/package.json index 22c5a89c8b..92908f075d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@babel/core": "^7.20.12", "@babel/plugin-transform-runtime": "^7.19.6", "@babel/preset-env": "^7.20.2", - "@fortawesome/fontawesome-free": "^5.15.4", + "@fortawesome/fontawesome-free": "^6.4.0", "@hotwired/turbo-rails": "^7.1.3", "@rails/actioncable": "^6.0.3-1", "@rails/activestorage": "^6.0.3-1", diff --git a/spec/support/helpers/links_helper.rb b/spec/support/helpers/links_helper.rb index cdf63ba34e..a4501227d5 100644 --- a/spec/support/helpers/links_helper.rb +++ b/spec/support/helpers/links_helper.rb @@ -6,6 +6,6 @@ def add_link end def remove_link - all('.link a > .fa-times-circle').last.click + all('.link a > .fa-circle-xmark').last.click end end diff --git a/yarn.lock b/yarn.lock index df8db52b32..eec53e3a4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -964,10 +964,10 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== -"@fortawesome/fontawesome-free@^5.15.4": - version "5.15.4" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz#ecda5712b61ac852c760d8b3c79c96adca5554e5" - integrity sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg== +"@fortawesome/fontawesome-free@^6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.4.0.tgz#1ee0c174e472c84b23cb46c995154dc383e3b4fe" + integrity sha512-0NyytTlPJwB/BF5LtRV8rrABDbe3TdTXqNB3PdZ+UUUZAEIrdOJdmABqKjt4AXwIoJNaRVVZEXxpNrqvE1GAYQ== "@hotwired/turbo-rails@^7.1.3": version "7.3.0"