diff --git a/Gemfile b/Gemfile index 8f043ac1..74deb48c 100644 --- a/Gemfile +++ b/Gemfile @@ -6,8 +6,8 @@ source 'https://rubygems.org' # README) is available at: # https://github.com/NHSDigital/activemodel-caution.git -gem 'activemodel-caution', '7.0.8' # Supports rails ~> 7.0.8.0 -gem 'rails', '~> 7.0.4', '>= 7.0.8.1' +gem 'activemodel-caution', '7.1.5.0' # Supports rails ~> 7.1.5.0 +gem 'rails', '~> 7.1.5', '>= 7.1.5.1' # Fixes uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger on Rails 7.0x # and earlier. See https://github.com/rails/rails/issues/54260. gem 'concurrent-ruby', '1.3.4' @@ -47,7 +47,7 @@ gem 'cancancan', '~> 3.0' gem 'cocoon' gem 'devise', '~> 4.7', '>= 4.7.1' gem 'highline' -gem 'paper_trail', '~> 12.0' +gem 'paper_trail', '~> 16.0' gem 'paper_trail-association_tracking' gem 'possibly' gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock index a9f9fac0..e7934d61 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,76 +2,88 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (2.0.1) - actioncable (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) + actioncable (7.1.5.2) + actionpack (= 7.1.5.2) + activesupport (= 7.1.5.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + zeitwerk (~> 2.6) + actionmailbox (7.1.5.2) + actionpack (= 7.1.5.2) + activejob (= 7.1.5.2) + activerecord (= 7.1.5.2) + activestorage (= 7.1.5.2) + activesupport (= 7.1.5.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.7) - actionpack (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activesupport (= 7.0.8.7) + actionmailer (7.1.5.2) + actionpack (= 7.1.5.2) + actionview (= 7.1.5.2) + activejob (= 7.1.5.2) + activesupport (= 7.1.5.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.7) - actionview (= 7.0.8.7) - activesupport (= 7.0.8.7) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.5.2) + actionview (= 7.1.5.2) + activesupport (= 7.1.5.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.7) - actionpack (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.5.2) + actionpack (= 7.1.5.2) + activerecord (= 7.1.5.2) + activestorage (= 7.1.5.2) + activesupport (= 7.1.5.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.7) - activesupport (= 7.0.8.7) + actionview (7.1.5.2) + activesupport (= 7.1.5.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.7) - activesupport (= 7.0.8.7) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.5.2) + activesupport (= 7.1.5.2) globalid (>= 0.3.6) - activemodel (7.0.8.7) - activesupport (= 7.0.8.7) - activemodel-caution (7.0.8.0) - actionpack (~> 7.0.8.0) - activemodel (~> 7.0.8.0) - activerecord (~> 7.0.8.0) - activesupport (~> 7.0.8.0) - railties (~> 7.0.8.0) - activerecord (7.0.8.7) - activemodel (= 7.0.8.7) - activesupport (= 7.0.8.7) - activestorage (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activesupport (= 7.0.8.7) + activemodel (7.1.5.2) + activesupport (= 7.1.5.2) + activemodel-caution (7.1.5.0) + actionpack (~> 7.1.5.0) + activemodel (~> 7.1.5.0) + activerecord (~> 7.1.5.0) + activesupport (~> 7.1.5.0) + railties (~> 7.1.5.0) + activerecord (7.1.5.2) + activemodel (= 7.1.5.2) + activesupport (= 7.1.5.2) + timeout (>= 0.4.0) + activestorage (7.1.5.2) + actionpack (= 7.1.5.2) + activejob (= 7.1.5.2) + activerecord (= 7.1.5.2) + activesupport (= 7.1.5.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.7) + activesupport (7.1.5.2) + base64 + benchmark (>= 0.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) @@ -83,6 +95,7 @@ GEM multi_json (~> 1.0) base64 (0.2.0) bcrypt (3.1.20) + benchmark (0.4.1) bigdecimal (3.1.8) bindex (0.8.1) bio-vcf (0.9.5) @@ -138,6 +151,7 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.3.4) + connection_pool (2.5.3) crass (1.0.6) csv (3.3.0) daemons (1.4.1) @@ -160,9 +174,11 @@ GEM docx (0.8.0) nokogiri (~> 1.13, >= 1.13.0) rubyzip (~> 2.0) + drb (2.2.3) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) + erb (5.0.2) erubi (1.13.0) eventmachine (1.2.7) execjs (2.10.0) @@ -210,6 +226,10 @@ GEM i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.7.2) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -249,6 +269,7 @@ GEM msworddoc-extractor (0.2.0) ruby-ole multi_json (1.15.0) + mutex_m (0.3.0) ndr_authenticate (0.3.4) devise devise_saml_authenticatable (~> 1.9) @@ -281,12 +302,12 @@ GEM simplecov unicode-display_width (>= 1.3.3) with_clean_rbenv - ndr_error (2.3.1) + ndr_error (2.3.2) ndr_ui net-imap net-pop net-smtp - rails (>= 6.0, < 7.1) + rails (>= 6.1, < 7.3) will_paginate ndr_import (11.2.1) activemodel @@ -310,10 +331,10 @@ GEM ndr_support (5.10.4) activerecord (>= 7.0, < 8.1) activesupport (>= 7.0, < 8.1) - ndr_ui (3.3.1) + ndr_ui (3.3.2) bootstrap-sass (~> 3.4.1) jquery-rails (>= 4.1.0) - rails (>= 6.0, < 7.1) + rails (>= 6.1, < 7.3) sprockets (>= 4.0) sprockets-rails (>= 3.0.0) ndr_workflow (1.2.4) @@ -354,10 +375,10 @@ GEM nokogiri (~> 1.10) ruby-ole (~> 1.2) orm_adapter (0.5.0) - paper_trail (12.3.0) - activerecord (>= 5.2) - request_store (~> 1.1) - paper_trail-association_tracking (2.2.1) + paper_trail (16.0.0) + activerecord (>= 6.1) + request_store (~> 1.4) + paper_trail-association_tracking (2.3.0) paper_trail (>= 12.0) parallel (1.26.3) parser (3.3.6.0) @@ -372,6 +393,9 @@ GEM pg (1.4.6) possibly (1.0.1) power_assert (2.0.4) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) prometheus-client (4.0.0) pry (0.15.0) coderay (~> 1.1) @@ -387,28 +411,33 @@ GEM puma (>= 5.0) rack racc (1.8.1) - rack (2.2.17) + rack (3.2.0) rack-mini-profiler (3.3.1) rack (>= 1.2.0) rack-proxy (0.7.7) rack + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) railroady (1.6.0) - rails (7.0.8.7) - actioncable (= 7.0.8.7) - actionmailbox (= 7.0.8.7) - actionmailer (= 7.0.8.7) - actionpack (= 7.0.8.7) - actiontext (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activemodel (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rails (7.1.5.2) + actioncable (= 7.1.5.2) + actionmailbox (= 7.1.5.2) + actionmailer (= 7.1.5.2) + actionpack (= 7.1.5.2) + actiontext (= 7.1.5.2) + actionview (= 7.1.5.2) + activejob (= 7.1.5.2) + activemodel (= 7.1.5.2) + activerecord (= 7.1.5.2) + activestorage (= 7.1.5.2) + activesupport (= 7.1.5.2) bundler (>= 1.15.0) - railties (= 7.0.8.7) + railties (= 7.1.5.2) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -416,18 +445,22 @@ GEM rails-html-sanitizer (1.6.1) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) - method_source + railties (7.1.5.2) + actionpack (= 7.1.5.2) + activesupport (= 7.1.5.2) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) + rdoc (6.14.2) + erb + psych (>= 4.0.0) regexp-examples (1.6.0) regexp_property_values (~> 1.5) regexp_parser (2.9.3) @@ -488,6 +521,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt + securerandom (0.4.1) selenium-webdriver (4.34.0) base64 (~> 0.2) logger (~> 1.4) @@ -543,7 +577,8 @@ GEM railties (>= 5.2) semantic_range (>= 2.3.0) websocket (1.2.11) - websocket-driver (0.7.6) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (4.0.1) @@ -562,7 +597,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - activemodel-caution (= 7.0.8) + activemodel-caution (= 7.1.5.0) bootstrap-table-rails (~> 1.20.2) byebug cancancan (~> 3.0) @@ -599,7 +634,7 @@ DEPENDENCIES ndr_ui (~> 3.3) ndr_workflow (~> 1.2, >= 1.2.2) nokogiri (~> 1.11) - paper_trail (~> 12.0) + paper_trail (~> 16.0) paper_trail-association_tracking parser pg (~> 1.4.6) @@ -611,7 +646,7 @@ DEPENDENCIES puma-daemon rack-mini-profiler railroady - rails (~> 7.0.4, >= 7.0.8.1) + rails (~> 7.1.5, >= 7.1.5.1) rainbow regexp-examples sass-rails diff --git a/bin/setup b/bin/setup index 97dc988f..ab7924f2 100755 --- a/bin/setup +++ b/bin/setup @@ -5,7 +5,7 @@ require 'fileutils' APP_ROOT = File.expand_path('..', __dir__) def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") + system(*args, exception: true) end FileUtils.chdir APP_ROOT do diff --git a/config/application.rb b/config/application.rb index 135ca1f2..d0a5a892 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,12 @@ module Mbis class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.1 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks)) # Configuration for the application, engines, and railties goes here. # @@ -34,9 +39,6 @@ class Application < Rails::Application # Configure the ActionDispatch::ShowExceptions middleware to use NdrError's exception logger: config.exceptions_app = NdrError::Middleware::PublicExceptions.new(Rails.public_path) - config.autoloader = :zeitwerk - config.eager_load_paths += %W[#{config.root}/lib] - # Weird assets are not Ruby code: Rails.autoloaders.main.ignore("#{config.root}/lib/schema_browser/Template") diff --git a/config/environments/development.rb b/config/environments/development.rb index b03604fa..b4eed6d5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,7 +6,7 @@ # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false @@ -14,6 +14,9 @@ # Show full error reports. config.consider_all_requests_local = true + # Enable server timing + config.server_timing = true + # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. if Rails.root.join('tmp/caching-dev.txt').exist? @@ -30,6 +33,9 @@ config.cache_store = :null_store end + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false config.action_mailer.perform_deliveries = false @@ -66,10 +72,9 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - config.file_watcher = ActiveSupport::EventedFileUpdateChecker - # Uncomment if you wish to allow Action Cable access from any origin. # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index a0a2dec1..b6a3a977 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -3,8 +3,10 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. + # Accept rubocop warnings so that we can copy the standard Rails template for this file + # rubocop:disable Style/GlobalStdStream, Layout/DotPosition, Layout/MultilineMethodCallIndentation, Style/RedundantConstantBase # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -13,22 +15,21 @@ config.eager_load = true # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false + config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). # config.require_master_key = true - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - # config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false config.public_file_server.enabled = true # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass - # Do not fallback to assets pipeline if a precompiled asset is missed. + # Do not fall back to assets pipeline if a precompiled asset is missed. config.assets.compile = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. @@ -46,22 +47,33 @@ # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Include generic and useful information about system operation, but avoid logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = :info + if ENV['RAILS_LOG_TO_STDOUT'].present? + config.logger = ActiveSupport::Logger.new(STDOUT) + .tap { |logger| logger.formatter = ::Logger::Formatter.new } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + end # Prepend all log lines with the following tags. config.log_tags = [:request_id] + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info') + # Use a different cache store in production. # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "mbis_production" + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = 'mbis_production' config.action_mailer.perform_caching = false # config.action_mailer.default_url_options = { host: 'prescriptions.phe.nhs.uk', protocol: 'https' } @@ -74,50 +86,21 @@ # the I18n.default_locale when a translation cannot be found). # config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Log disallowed deprecations. - config.active_support.disallowed_deprecation = :log - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] + # Don't log any deprecations. + config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - if ENV['RAILS_LOG_TO_STDOUT'].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - # Inserts middleware to perform automatic connection switching. - # The `database_selector` hash is used to pass options to the DatabaseSelector - # middleware. The `delay` is used to determine how long to wait after a write - # to send a subsequent read to the primary. - # - # The `database_resolver` class is used by the middleware to determine which - # database is appropriate to use based on the time delay. - # - # The `database_resolver_context` class is used by the middleware to set - # timestamps for the last write to the primary. The resolver uses the context - # class timestamps to determine how long to wait before reading from the - # replica. - # - # By default Rails will store a last write timestamp in the session. The - # DatabaseSelector middleware is designed as such you can define your own - # strategy for connection switching and pass that into the middleware through - # these configuration options. - # config.active_record.database_selector = { delay: 2.seconds } - # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver - # config.active_record.database_resolver_context = \ - # ActiveRecord::Middleware::DatabaseSelector::Resolver::Session + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # 'example.com', # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == '/up' } } + # rubocop:enable Style/GlobalStdStream, Layout/DotPosition, Layout/MultilineMethodCallIndentation, Style/RedundantConstantBase end diff --git a/config/environments/test.rb b/config/environments/test.rb index 19810e36..4342624e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -9,11 +9,6 @@ # Settings specified here will take precedence over those in config/application.rb. config.active_record.verbose_query_logs = true - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - if defined?(Spring) # If a test environment is being kept warm by spring, allow it to reload: config.cache_classes = false @@ -28,9 +23,10 @@ # Turn false under Spring and add config.action_view.cache_template_loading = true. config.cache_classes = true - # Eager loading loads your whole application. When running a single test locally, - # this probably isn't necessary. It's a good idea to do in a continuous integration - # system, or in some way before deploying your code. + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. config.eager_load = ENV['CI'].present? # Configure public file server for tests with Cache-Control for performance. @@ -40,12 +36,12 @@ } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false @@ -86,4 +82,7 @@ # Speed up tests by disabling audit by default PaperTrail.enabled = false end + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index a465bfc9..331c32e7 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -5,8 +5,6 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path -# Add Yarn node_modules folder to the asset load path. -# Rails.application.config.assets.paths << Rails.root.join('node_modules') # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in the app/assets diff --git a/config/initializers/paper_trails.rb b/config/initializers/paper_trails.rb index afb40ea4..b0126440 100644 --- a/config/initializers/paper_trails.rb +++ b/config/initializers/paper_trails.rb @@ -1,2 +1,13 @@ # PaperTrail.track_associations is not set by default. As of PaperTrail 5, it defaults to false. PaperTrail.config.track_associations = true + +# Ensure PaperTrail can load YAML-formatted object history +::ActiveRecord.yaml_column_permitted_classes = [ + ::ActiveRecord::Type::Time::Value, + ::ActiveSupport::TimeWithZone, + ::ActiveSupport::TimeZone, + ::BigDecimal, + ::Date, + ::Symbol, + ::Time +] diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index b2be4a25..fdb2383e 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -1,5 +1,7 @@ +# Be sure to restart your server when you modify this file. + # Define an application-wide HTTP permissions policy. For further -# information see https://developers.google.com/web/updates/2018/06/feature-policy +# information see: https://developers.google.com/web/updates/2018/06/feature-policy # Rails.application.config.permissions_policy do |f| f.camera :none diff --git a/lib/tasks/export_weekly.rake b/lib/tasks/export_weekly.rake index f1f9ec8f..b7812dfe 100644 --- a/lib/tasks/export_weekly.rake +++ b/lib/tasks/export_weekly.rake @@ -92,8 +92,8 @@ namespace :export do warn "ERROR: Configuration file #{config_fname} does not exist; aborting." exit 1 end - logger = ActiveSupport::Logger.new($stdout) - logger.extend(ActiveSupport::Logger.broadcast(Rails.logger)) + logger = ActiveSupport::BroadcastLogger.new(ActiveSupport::Logger.new($stdout)) + logger.broadcast_to(Rails.logger) if import_weekly old_quieter = ENV['quieter_import_weekly'] ENV['quieter_import_weekly'] = 'y' diff --git a/lib/tasks/import_weekly.rake b/lib/tasks/import_weekly.rake index 6de105fd..67cc74dc 100644 --- a/lib/tasks/import_weekly.rake +++ b/lib/tasks/import_weekly.rake @@ -9,8 +9,8 @@ namespace :import do SYNTAX task weekly: [:environment, 'pseudo:keys:load'] do e_types = ENV['e_types'].presence&.split(',') || %w[PSBIRTH PSDEATH] - logger = ActiveSupport::Logger.new($stdout) - logger.extend(ActiveSupport::Logger.broadcast(Rails.logger)) + logger = ActiveSupport::BroadcastLogger.new(ActiveSupport::Logger.new($stdout)) + logger.broadcast_to(Rails.logger) begin count = Import::Helpers::RakeHelper::FileImporter.import_weekly(e_types, logger: logger) if count.zero? diff --git a/test/controllers/workflow/assignments_controller_test.rb b/test/controllers/workflow/assignments_controller_test.rb index 5899a710..a9c8806d 100644 --- a/test/controllers/workflow/assignments_controller_test.rb +++ b/test/controllers/workflow/assignments_controller_test.rb @@ -92,14 +92,14 @@ def setup test 'sends notification emails on successful assignment' do project_state = @project.current_project_state - args = { + params = { project: @project, assigned_to: @user_two, assigned_by: @user_one } assert_enqueued_emails 1 do - assert_enqueued_email_with ProjectsMailer, :project_assignment, args: args do + assert_enqueued_email_with ProjectsMailer, :project_assignment, params: params do post workflow_project_state_assignments_path(project_state), params: { assignment: { assigned_user_id: @user_two.id diff --git a/test/integration/admin/manage_data_items_test.rb b/test/integration/admin/manage_data_items_test.rb index e0f34284..1ceee86c 100644 --- a/test/integration/admin/manage_data_items_test.rb +++ b/test/integration/admin/manage_data_items_test.rb @@ -77,6 +77,7 @@ def setup find_button('New Node').click find_link('Entity').click + assert_text 'Add a new Entity' within_modal do fill_in 'Name', with: 'New Entity' diff --git a/test/integration/application_project_test.rb b/test/integration/application_project_test.rb index c7b48ac3..7935eab1 100644 --- a/test/integration/application_project_test.rb +++ b/test/integration/application_project_test.rb @@ -305,13 +305,12 @@ class ApplicationProjectTest < ActionDispatch::IntegrationTest private def reassign_for_moderation_to(assignee:, assigner:) - assert_assignment_email(assignee: assignee, assigner: assigner) do - click_button 'Send for Peer Review' - within('#modal-dpia_review') do - select assignee.full_name, from: 'project[project_state][assigned_user_id]' - click_button 'Save' - end + click_button 'Send for Peer Review' + within('#modal-dpia_review') do + select assignee.full_name, from: 'project[project_state][assigned_user_id]' + click_button 'Save' end + assert has_no_button?('Save') assert has_no_button?('Send for Moderation') @@ -323,7 +322,7 @@ def reassign_for_moderation_to(assignee:, assigner:) def assert_assignment_email(assignee:, assigner:, comments: nil) yield - assert_enqueued_email_with ProjectsMailer, :project_assignment, args: { + assert_enqueued_email_with ProjectsMailer, :project_assignment, params: { project: @project.reload, assigned_to: assignee, assigned_by: assigner, diff --git a/test/integration/directorates_and_divsion_management_test.rb b/test/integration/directorates_and_divsion_management_test.rb index 1eff059d..3b49c460 100644 --- a/test/integration/directorates_and_divsion_management_test.rb +++ b/test/integration/directorates_and_divsion_management_test.rb @@ -42,13 +42,14 @@ def setup test 'delete a directorate attached to team' do visit directorates_path + assert_text 'Add Directorate' assert_difference('Directorate.count', 0) do accept_prompt do directorate2_row = page.find('#directorates_information').find('tr', text: 'Directorate 1') directorate2_row.click_link('Delete') end + assert_text("You can't delete directorate as it assigned to active user or active teams") end - assert page.has_content?("You can't delete directorate as it assigned to active user or active teams") end end diff --git a/test/integration/workflow_test.rb b/test/integration/workflow_test.rb index 5e139e35..1273f3d2 100644 --- a/test/integration/workflow_test.rb +++ b/test/integration/workflow_test.rb @@ -77,7 +77,7 @@ class WorkflowTest < ActionDispatch::IntegrationTest assert has_no_button?('Submit for Delegate Approval') - assert_enqueued_email_with ProjectsMailer, :state_changed, args: { + assert_enqueued_email_with ProjectsMailer, :state_changed, params: { project: project, user: other_user, current_user: user diff --git a/test/test_helper.rb b/test/test_helper.rb index 6bcfc36b..6cdb35bf 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -242,8 +242,8 @@ def close_modal(selector: '#modal') module ActionMailerHelper # Override :assert_enqueued_email_with to be aware of our own mailer config injection # (see ApplicationMailer), for convenience. - def assert_enqueued_email_with(mailer, method, args: nil, queue: 'default', &block) - args.merge!(url_options: ActionMailer::Base.default_url_options) if args.is_a?(Hash) + def assert_enqueued_email_with(mailer, method, params: nil, queue: 'default', &block) + params.merge!(url_options: ActionMailer::Base.default_url_options) if params.is_a?(Hash) super end diff --git a/vendor/cache/actioncable-7.0.8.7.gem b/vendor/cache/actioncable-7.0.8.7.gem deleted file mode 100644 index a31a18be..00000000 Binary files a/vendor/cache/actioncable-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/actioncable-7.1.5.2.gem b/vendor/cache/actioncable-7.1.5.2.gem new file mode 100644 index 00000000..6e9658ea Binary files /dev/null and b/vendor/cache/actioncable-7.1.5.2.gem differ diff --git a/vendor/cache/actionmailbox-7.0.8.7.gem b/vendor/cache/actionmailbox-7.0.8.7.gem deleted file mode 100644 index d16e1f31..00000000 Binary files a/vendor/cache/actionmailbox-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/actionmailbox-7.1.5.2.gem b/vendor/cache/actionmailbox-7.1.5.2.gem new file mode 100644 index 00000000..bd7fb8f3 Binary files /dev/null and b/vendor/cache/actionmailbox-7.1.5.2.gem differ diff --git a/vendor/cache/actionmailer-7.0.8.7.gem b/vendor/cache/actionmailer-7.0.8.7.gem deleted file mode 100644 index f9d3b12e..00000000 Binary files a/vendor/cache/actionmailer-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/actionmailer-7.1.5.2.gem b/vendor/cache/actionmailer-7.1.5.2.gem new file mode 100644 index 00000000..b174620b Binary files /dev/null and b/vendor/cache/actionmailer-7.1.5.2.gem differ diff --git a/vendor/cache/actionpack-7.0.8.7.gem b/vendor/cache/actionpack-7.0.8.7.gem deleted file mode 100644 index 62e7a655..00000000 Binary files a/vendor/cache/actionpack-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/actionpack-7.1.5.2.gem b/vendor/cache/actionpack-7.1.5.2.gem new file mode 100644 index 00000000..15e7d736 Binary files /dev/null and b/vendor/cache/actionpack-7.1.5.2.gem differ diff --git a/vendor/cache/actiontext-7.0.8.7.gem b/vendor/cache/actiontext-7.0.8.7.gem deleted file mode 100644 index a43704bb..00000000 Binary files a/vendor/cache/actiontext-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/actiontext-7.1.5.2.gem b/vendor/cache/actiontext-7.1.5.2.gem new file mode 100644 index 00000000..2645b124 Binary files /dev/null and b/vendor/cache/actiontext-7.1.5.2.gem differ diff --git a/vendor/cache/actionview-7.0.8.7.gem b/vendor/cache/actionview-7.0.8.7.gem deleted file mode 100644 index d4edd4f2..00000000 Binary files a/vendor/cache/actionview-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/actionview-7.1.5.2.gem b/vendor/cache/actionview-7.1.5.2.gem new file mode 100644 index 00000000..7714c4cc Binary files /dev/null and b/vendor/cache/actionview-7.1.5.2.gem differ diff --git a/vendor/cache/activejob-7.0.8.7.gem b/vendor/cache/activejob-7.0.8.7.gem deleted file mode 100644 index 751bceb3..00000000 Binary files a/vendor/cache/activejob-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/activejob-7.1.5.2.gem b/vendor/cache/activejob-7.1.5.2.gem new file mode 100644 index 00000000..450de2ff Binary files /dev/null and b/vendor/cache/activejob-7.1.5.2.gem differ diff --git a/vendor/cache/activemodel-7.0.8.7.gem b/vendor/cache/activemodel-7.0.8.7.gem deleted file mode 100644 index e26a6f22..00000000 Binary files a/vendor/cache/activemodel-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/activemodel-7.1.5.2.gem b/vendor/cache/activemodel-7.1.5.2.gem new file mode 100644 index 00000000..f7a926c2 Binary files /dev/null and b/vendor/cache/activemodel-7.1.5.2.gem differ diff --git a/vendor/cache/activemodel-caution-7.0.8.0.gem b/vendor/cache/activemodel-caution-7.0.8.0.gem deleted file mode 100644 index 4e8b488f..00000000 Binary files a/vendor/cache/activemodel-caution-7.0.8.0.gem and /dev/null differ diff --git a/vendor/cache/activemodel-caution-7.1.5.0.gem b/vendor/cache/activemodel-caution-7.1.5.0.gem new file mode 100644 index 00000000..9173b6c0 Binary files /dev/null and b/vendor/cache/activemodel-caution-7.1.5.0.gem differ diff --git a/vendor/cache/activerecord-7.0.8.7.gem b/vendor/cache/activerecord-7.0.8.7.gem deleted file mode 100644 index 97211e4a..00000000 Binary files a/vendor/cache/activerecord-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/activerecord-7.1.5.2.gem b/vendor/cache/activerecord-7.1.5.2.gem new file mode 100644 index 00000000..88532f15 Binary files /dev/null and b/vendor/cache/activerecord-7.1.5.2.gem differ diff --git a/vendor/cache/activestorage-7.0.8.7.gem b/vendor/cache/activestorage-7.0.8.7.gem deleted file mode 100644 index e75b5f0c..00000000 Binary files a/vendor/cache/activestorage-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/activestorage-7.1.5.2.gem b/vendor/cache/activestorage-7.1.5.2.gem new file mode 100644 index 00000000..4e4344e1 Binary files /dev/null and b/vendor/cache/activestorage-7.1.5.2.gem differ diff --git a/vendor/cache/activesupport-7.0.8.7.gem b/vendor/cache/activesupport-7.0.8.7.gem deleted file mode 100644 index 47089c9f..00000000 Binary files a/vendor/cache/activesupport-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/activesupport-7.1.5.2.gem b/vendor/cache/activesupport-7.1.5.2.gem new file mode 100644 index 00000000..1c1c951a Binary files /dev/null and b/vendor/cache/activesupport-7.1.5.2.gem differ diff --git a/vendor/cache/benchmark-0.4.1.gem b/vendor/cache/benchmark-0.4.1.gem new file mode 100644 index 00000000..90cd2725 Binary files /dev/null and b/vendor/cache/benchmark-0.4.1.gem differ diff --git a/vendor/cache/connection_pool-2.5.3.gem b/vendor/cache/connection_pool-2.5.3.gem new file mode 100644 index 00000000..23c398fc Binary files /dev/null and b/vendor/cache/connection_pool-2.5.3.gem differ diff --git a/vendor/cache/drb-2.2.3.gem b/vendor/cache/drb-2.2.3.gem new file mode 100644 index 00000000..0c78b283 Binary files /dev/null and b/vendor/cache/drb-2.2.3.gem differ diff --git a/vendor/cache/erb-5.0.2.gem b/vendor/cache/erb-5.0.2.gem new file mode 100644 index 00000000..a63e03bc Binary files /dev/null and b/vendor/cache/erb-5.0.2.gem differ diff --git a/vendor/cache/irb-1.15.2.gem b/vendor/cache/irb-1.15.2.gem new file mode 100644 index 00000000..1d053448 Binary files /dev/null and b/vendor/cache/irb-1.15.2.gem differ diff --git a/vendor/cache/mutex_m-0.3.0.gem b/vendor/cache/mutex_m-0.3.0.gem new file mode 100644 index 00000000..85be3e25 Binary files /dev/null and b/vendor/cache/mutex_m-0.3.0.gem differ diff --git a/vendor/cache/ndr_error-2.3.1.gem b/vendor/cache/ndr_error-2.3.1.gem deleted file mode 100644 index 18454717..00000000 Binary files a/vendor/cache/ndr_error-2.3.1.gem and /dev/null differ diff --git a/vendor/cache/ndr_error-2.3.2.gem b/vendor/cache/ndr_error-2.3.2.gem new file mode 100644 index 00000000..0cbf7dde Binary files /dev/null and b/vendor/cache/ndr_error-2.3.2.gem differ diff --git a/vendor/cache/ndr_ui-3.3.1.gem b/vendor/cache/ndr_ui-3.3.1.gem deleted file mode 100644 index fdfe9be4..00000000 Binary files a/vendor/cache/ndr_ui-3.3.1.gem and /dev/null differ diff --git a/vendor/cache/ndr_ui-3.3.2.gem b/vendor/cache/ndr_ui-3.3.2.gem new file mode 100644 index 00000000..2f5c03a7 Binary files /dev/null and b/vendor/cache/ndr_ui-3.3.2.gem differ diff --git a/vendor/cache/paper_trail-12.3.0.gem b/vendor/cache/paper_trail-12.3.0.gem deleted file mode 100644 index b599e8b6..00000000 Binary files a/vendor/cache/paper_trail-12.3.0.gem and /dev/null differ diff --git a/vendor/cache/paper_trail-16.0.0.gem b/vendor/cache/paper_trail-16.0.0.gem new file mode 100644 index 00000000..d16caa26 Binary files /dev/null and b/vendor/cache/paper_trail-16.0.0.gem differ diff --git a/vendor/cache/paper_trail-association_tracking-2.2.1.gem b/vendor/cache/paper_trail-association_tracking-2.2.1.gem deleted file mode 100644 index 1b742cd4..00000000 Binary files a/vendor/cache/paper_trail-association_tracking-2.2.1.gem and /dev/null differ diff --git a/vendor/cache/paper_trail-association_tracking-2.3.0.gem b/vendor/cache/paper_trail-association_tracking-2.3.0.gem new file mode 100644 index 00000000..1bafc31d Binary files /dev/null and b/vendor/cache/paper_trail-association_tracking-2.3.0.gem differ diff --git a/vendor/cache/pp-0.6.2.gem b/vendor/cache/pp-0.6.2.gem new file mode 100644 index 00000000..25704968 Binary files /dev/null and b/vendor/cache/pp-0.6.2.gem differ diff --git a/vendor/cache/prettyprint-0.2.0.gem b/vendor/cache/prettyprint-0.2.0.gem new file mode 100644 index 00000000..0944aaba Binary files /dev/null and b/vendor/cache/prettyprint-0.2.0.gem differ diff --git a/vendor/cache/rack-2.2.17.gem b/vendor/cache/rack-2.2.17.gem deleted file mode 100644 index 3ca5c0ae..00000000 Binary files a/vendor/cache/rack-2.2.17.gem and /dev/null differ diff --git a/vendor/cache/rack-3.2.0.gem b/vendor/cache/rack-3.2.0.gem new file mode 100644 index 00000000..2f3af2a1 Binary files /dev/null and b/vendor/cache/rack-3.2.0.gem differ diff --git a/vendor/cache/rack-session-2.1.1.gem b/vendor/cache/rack-session-2.1.1.gem new file mode 100644 index 00000000..f0372322 Binary files /dev/null and b/vendor/cache/rack-session-2.1.1.gem differ diff --git a/vendor/cache/rackup-2.2.1.gem b/vendor/cache/rackup-2.2.1.gem new file mode 100644 index 00000000..286eb159 Binary files /dev/null and b/vendor/cache/rackup-2.2.1.gem differ diff --git a/vendor/cache/rails-7.0.8.7.gem b/vendor/cache/rails-7.0.8.7.gem deleted file mode 100644 index bb3219b8..00000000 Binary files a/vendor/cache/rails-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/rails-7.1.5.2.gem b/vendor/cache/rails-7.1.5.2.gem new file mode 100644 index 00000000..f8056b68 Binary files /dev/null and b/vendor/cache/rails-7.1.5.2.gem differ diff --git a/vendor/cache/railties-7.0.8.7.gem b/vendor/cache/railties-7.0.8.7.gem deleted file mode 100644 index a2220dc9..00000000 Binary files a/vendor/cache/railties-7.0.8.7.gem and /dev/null differ diff --git a/vendor/cache/railties-7.1.5.2.gem b/vendor/cache/railties-7.1.5.2.gem new file mode 100644 index 00000000..d644194a Binary files /dev/null and b/vendor/cache/railties-7.1.5.2.gem differ diff --git a/vendor/cache/rdoc-6.14.2.gem b/vendor/cache/rdoc-6.14.2.gem new file mode 100644 index 00000000..7d4e3990 Binary files /dev/null and b/vendor/cache/rdoc-6.14.2.gem differ diff --git a/vendor/cache/securerandom-0.4.1.gem b/vendor/cache/securerandom-0.4.1.gem new file mode 100644 index 00000000..05072cab Binary files /dev/null and b/vendor/cache/securerandom-0.4.1.gem differ diff --git a/vendor/cache/websocket-driver-0.7.6.gem b/vendor/cache/websocket-driver-0.7.6.gem deleted file mode 100644 index 920a3969..00000000 Binary files a/vendor/cache/websocket-driver-0.7.6.gem and /dev/null differ diff --git a/vendor/cache/websocket-driver-0.8.0.gem b/vendor/cache/websocket-driver-0.8.0.gem new file mode 100644 index 00000000..4b401375 Binary files /dev/null and b/vendor/cache/websocket-driver-0.8.0.gem differ