diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc43767c..59fc2d5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,8 +51,5 @@ jobs: - name: Setup DB run: bin/rails db:prepare - - name: Start tmate session - uses: mxschmitt/action-tmate@v3 - - name: Run tests run: bin/bundle exec rspec --format documentation diff --git a/Gemfile b/Gemfile index 7c386daf..049fdba5 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem "dfe-autocomplete", ref: "11738c0" gem "faraday", "~> 2.9" gem "gds_zendesk" -gem "govuk-components", "~> 5.0.2" +gem "govuk-components", "~> 5.7.0" gem "govuk_design_system_formbuilder" gem "govuk_markdown", "~> 2.0" gem "jsbundling-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 024f8a65..a185f65c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -186,10 +186,10 @@ GEM zendesk_api (>= 1.37, < 4.0) globalid (1.2.1) activesupport (>= 6.1) - govuk-components (5.0.2) + govuk-components (5.7.0) html-attributes-utils (~> 1.0.0, >= 1.0.0) - pagy (~> 6.0) - view_component (>= 3.9, < 3.10) + pagy (>= 6, < 10) + view_component (>= 3.9, < 3.17) govuk_design_system_formbuilder (5.0.0) actionview (>= 6.1) activemodel (>= 6.1) @@ -242,7 +242,7 @@ GEM rack (>= 2.1.4.1) marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) minitest (5.25.1) msgpack (1.6.0) @@ -288,7 +288,7 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) - pagy (6.4.3) + pagy (9.1.0) parallel (1.24.0) parser (3.3.5.0) ast (~> 2.4.1) @@ -378,18 +378,18 @@ GEM rinku (2.0.6) rladr (1.2.0) rouge (4.4.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.1) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-rails (6.1.1) actionpack (>= 6.1) activesupport (>= 6.1) @@ -398,7 +398,7 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-support (3.12.1) + rspec-support (3.13.1) rubocop (1.60.2) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -513,7 +513,7 @@ GEM useragent (0.16.10) vcr (6.2.0) version_gem (1.1.1) - view_component (3.9.0) + view_component (3.16.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -571,7 +571,7 @@ DEPENDENCIES faraday (~> 2.9) foreman (~> 0.87.2) gds_zendesk - govuk-components (~> 5.0.2) + govuk-components (~> 5.7.0) govuk_design_system_formbuilder govuk_markdown (~> 2.0) jsbundling-rails diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 343583e7..18919987 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -9,8 +9,6 @@ <%= tag :meta, name: 'viewport', content: 'width=device-width, initial-scale=1' %> <%= tag :meta, name: 'theme-color', content: '#0b0c0c' %> - - <%= favicon_link_tag image_path('favicon.ico'), type: nil, sizes: "48x48" %> <%= favicon_link_tag image_path('favicon.svg'), type: 'image/svg+xml', sizes: "any" %> <%= favicon_link_tag image_path('govuk-icon-mask.svg'), rel: 'mask-icon', color: "#0b0c0c", type: nil %> diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index 4a3318a3..0ec5f9b8 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -1,60 +1,62 @@ # frozen_string_literal: true -require "pagy/extras/support" - -# Pagy initializer file (5.10.1) +# Pagy initializer file (9.1.0) # Customize only what you really need and notice that the core Pagy works also without any of the following lines. # Should you just cherry pick part of this file, please maintain the require-order of the extras -# Pagy DEFAULT Variables -# See https://ddnexus.github.io/pagy/api/pagy#variables -# All the Pagy::DEFAULT are set for all the Pagy instances but can be overridden per instance by just passing them to -# Pagy.new|Pagy::Countless.new|Pagy::Calendar::*.new or any of the #pagy* controller methods -# Instance variables -# See https://ddnexus.github.io/pagy/api/pagy#instance-variables +# Pagy Variables +# See https://ddnexus.github.io/pagy/docs/api/pagy#variables +# You can set any pagy variable as a Pagy::DEFAULT. They can also be overridden per instance by just passing them to +# Pagy.new|Pagy::Countless.new|Pagy::Calendar::*.new or any of the #pagy* controller methods +# Here are the few that make more sense as DEFAULTs: Pagy::DEFAULT[:page] = 1 # default -Pagy::DEFAULT[:items] = 100 # default +Pagy::DEFAULT[:limit] = 100 # default Pagy::DEFAULT[:outset] = 0 # default # Other Variables # See https://ddnexus.github.io/pagy/api/pagy#other-variables Pagy::DEFAULT[:size] = [1, 4, 4, 1] # default Pagy::DEFAULT[:page_param] = :page # default -# The :params can be also set as a lambda e.g ->(params){ params.exclude('useless').merge!('custom' => 'useful') } -# Pagy::DEFAULT[:params] = {} # default -# Pagy::DEFAULT[:fragment] = '#fragment' # example -# Pagy::DEFAULT[:link_extra] = 'data-remote="true"' # example -# Pagy::DEFAULT[:i18n_key] = 'pagy.item_name' # default -# Pagy::DEFAULT[:cycle] = true # example + +# Pagy::DEFAULT[:limit] = 20 # default +# Pagy::DEFAULT[:size] = 7 # default +# Pagy::DEFAULT[:ends] = true # default +# Pagy::DEFAULT[:page_param] = :page # default +# Pagy::DEFAULT[:count_args] = [] # example for non AR ORMs +# Pagy::DEFAULT[:max_pages] = 3000 # example + # Extras -# See https://ddnexus.github.io/pagy/extras +# See https://ddnexus.github.io/pagy/categories/extra + + +# Legacy Compatibility Extras + +# Size extra: Enable the Array type for the `:size` variable (e.g. `size: [1,4,4,1]`) +# See https://ddnexus.github.io/pagy/docs/extras/size +# require 'pagy/extras/size' # must be required before the other extras + # Backend Extras +# Arel extra: For better performance utilizing grouped ActiveRecord collections: +# See: https://ddnexus.github.io/pagy/docs/extras/arel +# require 'pagy/extras/arel' + # Array extra: Paginate arrays efficiently, avoiding expensive array-wrapping and without overriding -# See https://ddnexus.github.io/pagy/extras/array -require "pagy/extras/array" +# See https://ddnexus.github.io/pagy/docs/extras/array +require 'pagy/extras/array' # Calendar extra: Add pagination filtering by calendar time unit (year, quarter, month, week, day) -# See https://ddnexus.github.io/pagy/extras/calendar +# See https://ddnexus.github.io/pagy/docs/extras/calendar # require 'pagy/extras/calendar' -# Default for each unit -# Pagy::Calendar::Year::DEFAULT[:order] = :asc # Time direction of pagination -# Pagy::Calendar::Year::DEFAULT[:format] = '%Y' # strftime format -# -# Pagy::Calendar::Quarter::DEFAULT[:order] = :asc # Time direction of pagination -# Pagy::Calendar::Quarter::DEFAULT[:format] = '%Y-Q%q' # strftime format -# -# Pagy::Calendar::Month::DEFAULT[:order] = :asc # Time direction of pagination -# Pagy::Calendar::Month::DEFAULT[:format] = '%Y-%m' # strftime format -# -# Pagy::Calendar::Week::DEFAULT[:order] = :asc # Time direction of pagination -# Pagy::Calendar::Week::DEFAULT[:format] = '%Y-%W' # strftime format -# -# Pagy::Calendar::Day::DEFAULT[:order] = :asc # Time direction of pagination -# Pagy::Calendar::Day::DEFAULT[:format] = '%Y-%m-%d' # strftime format +# Default for each calendar unit class in IRB: +# >> Pagy::Calendar::Year::DEFAULT +# >> Pagy::Calendar::Quarter::DEFAULT +# >> Pagy::Calendar::Month::DEFAULT +# >> Pagy::Calendar::Week::DEFAULT +# >> Pagy::Calendar::Day::DEFAULT # # Uncomment the following lines, if you need calendar localization without using the I18n extra # module LocalizePagyCalendar @@ -65,12 +67,12 @@ # Pagy::Calendar.prepend LocalizePagyCalendar # Countless extra: Paginate without any count, saving one query per rendering -# See https://ddnexus.github.io/pagy/extras/countless +# See https://ddnexus.github.io/pagy/docs/extras/countless # require 'pagy/extras/countless' # Pagy::DEFAULT[:countless_minimal] = false # default (eager loading) # Elasticsearch Rails extra: Paginate `ElasticsearchRails::Results` objects -# See https://ddnexus.github.io/pagy/extras/elasticsearch_rails +# See https://ddnexus.github.io/pagy/docs/extras/elasticsearch_rails # Default :pagy_search method: change only if you use also # the searchkick or meilisearch extra that defines the same # Pagy::DEFAULT[:elasticsearch_rails_pagy_search] = :pagy_search @@ -79,15 +81,19 @@ # require 'pagy/extras/elasticsearch_rails' # Headers extra: http response headers (and other helpers) useful for API pagination -# See http://ddnexus.github.io/pagy/extras/headers +# See https://ddnexus.github.io/pagy/docs/extras/headers # require 'pagy/extras/headers' # Pagy::DEFAULT[:headers] = { page: 'Current-Page', -# items: 'Page-Items', +# limit: 'Page-Items', # count: 'Total-Count', # pages: 'Total-Pages' } # default +# Keyset extra: Paginate with the Pagy keyset pagination technique +# See https://ddnexus.github.io/pagy/docs/extras/keyset +# require 'pagy/extras/keyset' + # Meilisearch extra: Paginate `Meilisearch` result objects -# See https://ddnexus.github.io/pagy/extras/meilisearch +# See https://ddnexus.github.io/pagy/docs/extras/meilisearch # Default :pagy_search method: change only if you use also # the elasticsearch_rails or searchkick extra that define the same method # Pagy::DEFAULT[:meilisearch_pagy_search] = :pagy_search @@ -96,18 +102,18 @@ # require 'pagy/extras/meilisearch' # Metadata extra: Provides the pagination metadata to Javascript frameworks like Vue.js, react.js, etc. -# See https://ddnexus.github.io/pagy/extras/metadata -# you must require the frontend helpers internal extra (BEFORE the metadata extra) ONLY if you need also the :sequels -# require 'pagy/extras/frontend_helpers' +# See https://ddnexus.github.io/pagy/docs/extras/metadata +# you must require the JS Tools internal extra (BEFORE the metadata extra) ONLY if you need also the :sequels +# require 'pagy/extras/js_tools' # require 'pagy/extras/metadata' # For performance reasons, you should explicitly set ONLY the metadata you use in the frontend # Pagy::DEFAULT[:metadata] = %i[scaffold_url page prev next last] # example # Searchkick extra: Paginate `Searchkick::Results` objects -# See https://ddnexus.github.io/pagy/extras/searchkick +# See https://ddnexus.github.io/pagy/docs/extras/searchkick # Default :pagy_search method: change only if you use also # the elasticsearch_rails or meilisearch extra that defines the same -# DEFAULT[:searchkick_pagy_search] = :pagy_search +# Pagy::DEFAULT[:searchkick_pagy_search] = :pagy_search # Default original :search method called internally to do the actual search # Pagy::DEFAULT[:searchkick_search] = :search # require 'pagy/extras/searchkick' @@ -117,80 +123,66 @@ # Frontend Extras # Bootstrap extra: Add nav, nav_js and combo_nav_js helpers and templates for Bootstrap pagination -# See https://ddnexus.github.io/pagy/extras/bootstrap +# See https://ddnexus.github.io/pagy/docs/extras/bootstrap # require 'pagy/extras/bootstrap' # Bulma extra: Add nav, nav_js and combo_nav_js helpers and templates for Bulma pagination -# See https://ddnexus.github.io/pagy/extras/bulma +# See https://ddnexus.github.io/pagy/docs/extras/bulma # require 'pagy/extras/bulma' -# Foundation extra: Add nav, nav_js and combo_nav_js helpers and templates for Foundation pagination -# See https://ddnexus.github.io/pagy/extras/foundation -# require 'pagy/extras/foundation' - -# Materialize extra: Add nav, nav_js and combo_nav_js helpers for Materialize pagination -# See https://ddnexus.github.io/pagy/extras/materialize -# require 'pagy/extras/materialize' - -# Navs extra: Add nav_js and combo_nav_js javascript helpers -# Notice: the other frontend extras add their own framework-styled versions, -# so require this extra only if you need the unstyled version -# See https://ddnexus.github.io/pagy/extras/navs -# require 'pagy/extras/navs' - -# Semantic extra: Add nav, nav_js and combo_nav_js helpers for Semantic UI pagination -# See https://ddnexus.github.io/pagy/extras/semantic -# require 'pagy/extras/semantic' - -# UIkit extra: Add nav helper and templates for UIkit pagination -# See https://ddnexus.github.io/pagy/extras/uikit -# require 'pagy/extras/uikit' +# Pagy extra: Add the pagy styled versions of the javascript-powered navs +# and a few other components to the Pagy::Frontend module. +# See https://ddnexus.github.io/pagy/docs/extras/pagy +# require 'pagy/extras/pagy' # Multi size var used by the *_nav_js helpers -# See https://ddnexus.github.io/pagy/extras/navs#steps -# Pagy::DEFAULT[:steps] = { 0 => [2,3,3,2], 540 => [3,5,5,3], 720 => [5,7,7,5] } # example +# See https://ddnexus.github.io/pagy/docs/extras/pagy#steps +# Pagy::DEFAULT[:steps] = { 0 => 5, 540 => 7, 720 => 9 } # example + # Feature Extras -# Gearbox extra: Automatically change the number of items per page depending on the page number -# See https://ddnexus.github.io/pagy/extras/gearbox +# Gearbox extra: Automatically change the limit per page depending on the page number +# See https://ddnexus.github.io/pagy/docs/extras/gearbox # require 'pagy/extras/gearbox' # set to false only if you want to make :gearbox_extra an opt-in variable # Pagy::DEFAULT[:gearbox_extra] = false # default true -# Pagy::DEFAULT[:gearbox_items] = [15, 30, 60, 100] # default +# Pagy::DEFAULT[:gearbox_limit] = [15, 30, 60, 100] # default -# Items extra: Allow the client to request a custom number of items per page with an optional selector UI -# See https://ddnexus.github.io/pagy/extras/items -# require 'pagy/extras/items' -# set to false only if you want to make :items_extra an opt-in variable -# Pagy::DEFAULT[:items_extra] = false # default true -# Pagy::DEFAULT[:items_param] = :items # default -# Pagy::DEFAULT[:max_items] = 100 # default +# Limit extra: Allow the client to request a custom limit per page with an optional selector UI +# See https://ddnexus.github.io/pagy/docs/extras/limit +# require 'pagy/extras/limit' +# set to false only if you want to make :limit_extra an opt-in variable +# Pagy::DEFAULT[:limit_extra] = false # default true +# Pagy::DEFAULT[:limit_param] = :limit # default +# Pagy::DEFAULT[:limit_max] = 100 # default # Overflow extra: Allow for easy handling of overflowing pages -# See https://ddnexus.github.io/pagy/extras/overflow +# See https://ddnexus.github.io/pagy/docs/extras/overflow # require 'pagy/extras/overflow' # Pagy::DEFAULT[:overflow] = :empty_page # default (other options: :last_page and :exception) -# Support extra: Extra support for features like: incremental, infinite, auto-scroll pagination -# See https://ddnexus.github.io/pagy/extras/support -# require 'pagy/extras/support' - # Trim extra: Remove the page=1 param from links -# See https://ddnexus.github.io/pagy/extras/trim +# See https://ddnexus.github.io/pagy/docs/extras/trim # require 'pagy/extras/trim' # set to false only if you want to make :trim_extra an opt-in variable # Pagy::DEFAULT[:trim_extra] = false # default true # Standalone extra: Use pagy in non Rack environment/gem -# See https://ddnexus.github.io/pagy/extras/standalone +# See https://ddnexus.github.io/pagy/docs/extras/standalone # require 'pagy/extras/standalone' # Pagy::DEFAULT[:url] = 'http://www.example.com/subdir' # optional default +# Jsonapi extra: Implements JSON:API specifications +# See https://ddnexus.github.io/pagy/docs/extras/jsonapi +# require 'pagy/extras/jsonapi' # must be required after the other extras +# set to false only if you want to make :jsonapi an opt-in variable +# Pagy::DEFAULT[:jsonapi] = false # default true + # Rails # Enable the .js file required by the helpers that use javascript -# (pagy*_nav_js, pagy*_combo_nav_js, and pagy_items_selector_js) -# See https://ddnexus.github.io/pagy/extras#javascript +# (pagy*_nav_js, pagy*_combo_nav_js, and pagy_limit_selector_js) +# See https://ddnexus.github.io/pagy/docs/api/javascript # With the asset pipeline # Sprockets need to look into the pagy javascripts dir, so add it to the assets paths @@ -199,7 +191,7 @@ # I18n # Pagy internal I18n: ~18x faster using ~10x less memory than the i18n gem -# See https://ddnexus.github.io/pagy/api/frontend#i18n +# See https://ddnexus.github.io/pagy/docs/api/i18n # Notice: No need to configure anything in this section if your app uses only "en" # or if you use the i18n extra below # @@ -225,13 +217,12 @@ # filepath: 'path/to/pagy-xyz.yml', # pluralize: lambda{ |count| ... } ) + # I18n extra: uses the standard i18n gem which is ~18x slower using ~10x more memory # than the default pagy internal i18n (see above) -# See https://ddnexus.github.io/pagy/extras/i18n +# See https://ddnexus.github.io/pagy/docs/extras/i18n # require 'pagy/extras/i18n' -# Default i18n key -# Pagy::DEFAULT[:i18n_key] = 'pagy.item_name' # default # When you are done setting your own default freeze it, so it will not get changed accidentally -Pagy::DEFAULT.freeze +Pagy::DEFAULT.freeze \ No newline at end of file diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a672f7de..a2962a63 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -115,10 +115,6 @@ match.captures.first end end - - config.ignore_request do |request| - URI(request.uri).path.ends_with?("/favicon") - end end Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }