diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fb429f..9d7d23d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,6 +128,7 @@ jobs: env: COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml DOCKER_APP_IMAGE: ${{ needs.merge.outputs.image }} + SECRET_KEY_BASE: dummy_secret steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.rubocop.yml b/.rubocop.yml index a05ff8c..e816d99 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,8 @@ -require: - - rubocop-rails +plugins: rubocop-rails AllCops: UseCache: false + TargetRubyVersion: 3.4 # Exclude generated files Exclude: - 'bin/**/*' @@ -185,7 +185,7 @@ Lint/TripleQuotes: # (new in 1.9) Enabled: true Style/IfWithBooleanLiteralBranches: # (new in 1.9) Enabled: true -Gemspec/DateAssignment: # (new in 1.10) +Gemspec/DeprecatedAttributeAssignment: Enabled: true Style/HashConversion: # (new in 1.10) Enabled: true @@ -332,3 +332,265 @@ Rails/RedundantPresenceValidationOnBelongsTo: # new in 2.13 Enabled: true Rails/RootJoinChain: # new in 2.13 Enabled: true + +# added 20260220 +Gemspec/AddRuntimeDependency: # new in 1.65 + Enabled: true +Gemspec/AttributeAssignment: # new in 1.77 + Enabled: true +Gemspec/DevelopmentDependencies: # new in 1.44 + Enabled: true +Layout/EmptyLinesAfterModuleInclusion: # new in 1.79 + Enabled: true +Layout/LineContinuationLeadingSpace: # new in 1.31 + Enabled: true +Layout/LineContinuationSpacing: # new in 1.31 + Enabled: true +Lint/ArrayLiteralInRegexp: # new in 1.71 + Enabled: true +Lint/ConstantOverwrittenInRescue: # new in 1.31 + Enabled: true +Lint/ConstantReassignment: # new in 1.70 + Enabled: true +Lint/CopDirectiveSyntax: # new in 1.72 + Enabled: true +Lint/DuplicateMagicComment: # new in 1.37 + Enabled: true +Lint/DuplicateMatchPattern: # new in 1.50 + Enabled: true +Lint/DuplicateSetElement: # new in 1.67 + Enabled: true +Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69 + Enabled: true +Lint/ItWithoutArgumentsInBlock: # new in 1.59 + Enabled: true +Lint/LiteralAssignmentInCondition: # new in 1.58 + Enabled: true +Lint/MixedCaseRange: # new in 1.53 + Enabled: true +Lint/NonAtomicFileOperation: # new in 1.31 + Enabled: true +Lint/NumericOperationWithConstantResult: # new in 1.69 + Enabled: true +Lint/RedundantRegexpQuantifiers: # new in 1.53 + Enabled: true +Lint/RedundantTypeConversion: # new in 1.72 + Enabled: true +Lint/RefinementImportMethods: # new in 1.27 + Enabled: true +Lint/RequireRangeParentheses: # new in 1.32 + Enabled: true +Lint/SharedMutableDefault: # new in 1.70 + Enabled: true +Lint/SuppressedExceptionInNumberConversion: # new in 1.72 + Enabled: true +Lint/UnescapedBracketInRegexp: # new in 1.68 + Enabled: true +Lint/UselessConstantScoping: # new in 1.72 + Enabled: true +Lint/UselessDefaultValueArgument: # new in 1.76 + Enabled: true +Lint/UselessDefined: # new in 1.69 + Enabled: true +Lint/UselessNumericOperation: # new in 1.66 + Enabled: true +Lint/UselessOr: # new in 1.76 + Enabled: true +Lint/UselessRescue: # new in 1.43 + Enabled: true +Metrics/CollectionLiteralLength: # new in 1.47 + Enabled: true +Naming/PredicateMethod: # new in 1.76 + Enabled: true +Security/CompoundHash: # new in 1.28 + Enabled: true +Style/AmbiguousEndlessMethodDefinition: # new in 1.68 + Enabled: true +Style/ArrayIntersect: # new in 1.40 + Enabled: true +Style/ArrayIntersectWithSingleElement: # new in 1.81 + Enabled: true +Style/BitwisePredicate: # new in 1.68 + Enabled: true +Style/CollectionQuerying: # new in 1.77 + Enabled: true +Style/CombinableDefined: # new in 1.68 + Enabled: true +Style/ComparableBetween: # new in 1.74 + Enabled: true +Style/ComparableClamp: # new in 1.44 + Enabled: true +Style/ConcatArrayLiterals: # new in 1.41 + Enabled: true +Style/DataInheritance: # new in 1.49 + Enabled: true +Style/DigChain: # new in 1.69 + Enabled: true +Style/DirEmpty: # new in 1.48 + Enabled: true +Style/EmptyClassDefinition: # new in 1.84 + Enabled: true +Style/EmptyHeredoc: # new in 1.32 + Enabled: true +Style/EmptyStringInsideInterpolation: # new in 1.76 + Enabled: true +Style/EnvHome: # new in 1.29 + Enabled: true +Style/ExactRegexpMatch: # new in 1.51 + Enabled: true +Style/FetchEnvVar: # new in 1.28 + Enabled: true +Style/FileEmpty: # new in 1.48 + Enabled: true +Style/FileNull: # new in 1.69 + Enabled: true +Style/FileTouch: # new in 1.69 + Enabled: true +Style/HashFetchChain: # new in 1.75 + Enabled: true +Style/HashSlice: # new in 1.71 + Enabled: true +Style/ItAssignment: # new in 1.70 + Enabled: true +Style/ItBlockParameter: # new in 1.75 + Enabled: true +Style/KeywordArgumentsMerging: # new in 1.68 + Enabled: true +Style/MagicCommentFormat: # new in 1.35 + Enabled: true +Style/MapCompactWithConditionalBlock: # new in 1.30 + Enabled: true +Style/MapIntoArray: # new in 1.63 + Enabled: true +Style/MapToSet: # new in 1.42 + Enabled: true +Style/MinMaxComparison: # new in 1.42 + Enabled: true +Style/ModuleMemberExistenceCheck: # new in 1.82 + Enabled: true +Style/NegativeArrayIndex: # new in 1.84 + Enabled: true +Style/ObjectThen: # new in 1.28 + Enabled: true +Style/OperatorMethodCall: # new in 1.37 + Enabled: true +Style/RedundantArrayConstructor: # new in 1.52 + Enabled: true +Style/RedundantArrayFlatten: # new in 1.76 + Enabled: true +Style/RedundantConstantBase: # new in 1.40 + Enabled: true +Style/RedundantCurrentDirectoryInPath: # new in 1.53 + Enabled: true +Style/RedundantDoubleSplatHashBraces: # new in 1.41 + Enabled: true +Style/RedundantEach: # new in 1.38 + Enabled: true +Style/RedundantFilterChain: # new in 1.52 + Enabled: true +Style/RedundantFormat: # new in 1.72 + Enabled: true +Style/RedundantHeredocDelimiterQuotes: # new in 1.45 + Enabled: true +Style/RedundantInitialize: # new in 1.27 + Enabled: true +Style/RedundantInterpolationUnfreeze: # new in 1.66 + Enabled: true +Style/RedundantLineContinuation: # new in 1.49 + Enabled: true +Style/RedundantRegexpArgument: # new in 1.53 + Enabled: true +Style/RedundantRegexpConstructor: # new in 1.52 + Enabled: true +Style/RedundantStringEscape: # new in 1.37 + Enabled: true +Style/ReturnNilInPredicateMethodDefinition: # new in 1.53 + Enabled: true +Style/ReverseFind: # new in 1.84 + Enabled: true +Style/SafeNavigationChainLength: # new in 1.68 + Enabled: true +Style/SendWithLiteralMethodName: # new in 1.64 + Enabled: true +Style/SingleLineDoEndBlock: # new in 1.57 + Enabled: true +Style/SuperArguments: # new in 1.64 + Enabled: true +Style/SuperWithArgsParentheses: # new in 1.58 + Enabled: true +Style/YAMLFileRead: # new in 1.53 + Enabled: true +Rails/ActionControllerFlashBeforeRender: # new in 2.16 + Enabled: true +Rails/ActionControllerTestCase: # new in 2.14 + Enabled: true +Rails/ActionOrder: # new in 2.17 + Enabled: true +Rails/ActiveSupportOnLoad: # new in 2.16 + Enabled: true +Rails/DangerousColumnNames: # new in 2.21 + Enabled: true +Rails/DeprecatedActiveModelErrorsMethods: # new in 2.14 + Enabled: true +Rails/DotSeparatedKeys: # new in 2.15 + Enabled: true +Rails/DuplicateAssociation: # new in 2.14 + Enabled: true +Rails/DuplicateScope: # new in 2.14 + Enabled: true +Rails/EnumSyntax: # new in 2.26 + Enabled: true +Rails/EnvLocal: # new in 2.22 + Enabled: true +Rails/FindByOrAssignmentMemoization: # new in 2.33 + Enabled: true +Rails/FreezeTime: # new in 2.16 + Enabled: true +Rails/HttpStatusNameConsistency: # new in 2.34 + Enabled: true +Rails/I18nLazyLookup: # new in 2.14 + Enabled: true +Rails/I18nLocaleTexts: # new in 2.14 + Enabled: true +Rails/IgnoredColumnsAssignment: # new in 2.17 + Enabled: true +Rails/MigrationClassName: # new in 2.14 + Enabled: true +Rails/MultipleRoutePaths: # new in 2.29 + Enabled: true +Rails/OrderArguments: # new in 2.33 + Enabled: true +Rails/RedirectBackOrTo: # new in 2.34 + Enabled: true +Rails/RedundantActiveRecordAllMethod: # new in 2.21 + Enabled: true +Rails/ResponseParsedBody: # new in 2.18 + Enabled: true +Rails/RootPathnameMethods: # new in 2.16 + Enabled: true +Rails/RootPublicPath: # new in 2.15 + Enabled: true +Rails/SelectMap: # new in 2.21 + Enabled: true +Rails/StripHeredoc: # new in 2.15 + Enabled: true +Rails/StrongParametersExpect: # new in 2.29 + Enabled: true +Rails/ThreeStateBooleanColumn: # new in 2.19 + Enabled: true +Rails/ToFormattedS: # new in 2.15 + Enabled: true +Rails/ToSWithArgument: # new in 2.16 + Enabled: true +Rails/TopLevelHashWithIndifferentAccess: # new in 2.16 + Enabled: true +Rails/TransactionExitStatement: # new in 2.14 + Enabled: true +Rails/UnusedRenderContent: # new in 2.21 + Enabled: true +Rails/WhereMissing: # new in 2.16 + Enabled: true +Rails/WhereNotWithMultipleConditions: # new in 2.17 + Enabled: true +Rails/WhereRange: # new in 2.25 + Enabled: true diff --git a/.ruby-version b/.ruby-version index be94e6f..eb39e53 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.3 diff --git a/.yarnrc b/.yarnrc index f5b1384..4027885 100644 --- a/.yarnrc +++ b/.yarnrc @@ -2,4 +2,4 @@ # yarn lockfile v1 -lastUpdateCheck 1770150293563 +lastUpdateCheck 1771868064007 diff --git a/Dockerfile b/Dockerfile index 03f3209..1749531 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # The base stage scaffolds elements which are common to building and running # the application, such as installing ca-certificates, creating the app user, # and installing runtime system dependencies. -FROM ruby:3.2.2-slim AS base +FROM ruby:3.3-slim AS base # ------------------------------------------------------------ # Declarative metadata @@ -35,9 +35,14 @@ RUN apt-get update -qq # Install standard packages from the Debian repository RUN apt-get install -y --no-install-recommends \ + build-essential \ curl \ git \ gpg \ + pkg-config \ + libyaml-dev \ + libxml2-dev \ + libxslt1-dev \ libpq-dev \ libvips42 diff --git a/Gemfile b/Gemfile index 0e38aa9..5ba49b9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,33 +1,35 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '~> 3.2.2' +ruby '~> 3.3' +gem 'addressable', '~> 2.8' gem 'awesome_print', '~> 1.9' -gem 'berkeley_library-alma', '~> 0.0.7' +gem 'berkeley_library-alma', '~> 0.1.1' gem 'berkeley_library-docker', '~> 0.2.0' -gem 'berkeley_library-logging', '~> 0.2', '>= 0.2.7' -gem 'berkeley_library-marc', '~> 0.3' -gem 'berkeley_library-util', '~> 0.1', '>= 0.1.8' +gem 'berkeley_library-logging', '~> 0.3.0' +gem 'berkeley_library-marc', '~> 0.3.2' +gem 'berkeley_library-util', '~> 0.3.0' gem 'cssbundling-rails' -gem 'dotiw', '~> 5.3' -gem 'iiif-presentation', '~> 1.0' -gem 'jbuilder', '~> 2.5' +gem 'csv' +gem 'dotiw', '~> 5.3.3' +gem 'iiif-presentation', '~> 1.4' +gem 'jbuilder', '~> 2.14.0' gem 'jsbundling-rails' gem 'jwt', '~> 2.2' -# Workaround for https://github.com/alexspeller/non-stupid-digest-assets/issues/54 -gem 'non-stupid-digest-assets', git: 'https://github.com/BerkeleyLibrary/non-stupid-digest-assets.git', ref: '1de0c38' -gem 'okcomputer', '~> 1.19', '>= 1.19.1' -gem 'omniauth-cas', '~> 2.0' -gem 'pagy', '~> 5.6' +gem 'mutex_m', '~> 0.3.0' +gem 'observer', '~> 0.1.2' +gem 'okcomputer', '~> 1.19' +gem 'omniauth', '~> 2.1' +gem 'omniauth-cas', '~> 3.0' +gem 'omniauth-rails_csrf_protection', '~> 1.0' +gem 'pagy', '~> 43' gem 'pg', '~> 1.2' gem 'pg_search', '~> 2.3' -gem 'puma', '~> 5.0' -gem 'rails', '~> 7.0.4', '>= 7.0.4.3' -gem 'ruby-prof', '~> 0.17.0' # TODO: move this back to dev/test -gem 'ruby-vips', '~> 2.0' -gem 'sprockets-rails', '~> 3.4' -gem 'typesafe_enum', '~> 0.3' +gem 'puma', '~> 7.2' +gem 'rails', '~> 8.0.4' +gem 'ruby-vips', '~> 2.3' +gem 'sprockets-rails', '~> 3.5.0' group :development, :test do gem 'brakeman' @@ -35,23 +37,25 @@ group :development, :test do gem 'byebug', platforms: %i[mri mingw x64_mingw] gem 'colorize' gem 'factory_bot_rails' - gem 'rspec-rails', '~> 5.0' + gem 'rspec-rails', '~> 8.0' + gem 'rubocop-rspec_rails', '~> 2.31.0' + gem 'ruby-prof', '~> 2.0.0' end group :development do gem 'dotenv', '~> 2.7', require: false gem 'foreman' gem 'listen' - gem 'rubocop', '~> 1.26.0' - gem 'rubocop-rails', '~> 2.13.2' - gem 'rubocop-rspec', '~> 2.4.0' - gem 'web-console', '>= 4.1.0' + gem 'rubocop', '~> 1.84.0' + gem 'rubocop-rails', '~> 2.34.0' + gem 'rubocop-rspec', '~> 3.9.0' + gem 'web-console', '>= 4.2.1' end group :test do gem 'capybara', '~> 3.36' gem 'concurrent-ruby', '~> 1.1' - gem 'database_cleaner-active_record', '~> 2.0' + gem 'database_cleaner-active_record', '~> 2.2' gem 'rspec', '~> 3.10' gem 'rspec_junit_formatter', '~> 0.5' gem 'selenium-webdriver', '~> 4.0' diff --git a/Gemfile.lock b/Gemfile.lock index abc3ff7..df48e30 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,401 +1,482 @@ -GIT - remote: https://github.com/BerkeleyLibrary/non-stupid-digest-assets.git - revision: 1de0c3852c49c9578c45d1d6e24c7996b3ebe267 - ref: 1de0c38 - specs: - non-stupid-digest-assets (1.0.9) - sprockets (>= 2.0) - GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (8.0.4) + actionpack (= 8.0.4) + activesupport (= 8.0.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + zeitwerk (~> 2.6) + actionmailbox (8.0.4) + actionpack (= 8.0.4) + activejob (= 8.0.4) + activerecord (= 8.0.4) + activestorage (= 8.0.4) + activesupport (= 8.0.4) + mail (>= 2.8.0) + actionmailer (8.0.4) + actionpack (= 8.0.4) + actionview (= 8.0.4) + activejob (= 8.0.4) + activesupport (= 8.0.4) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.4) + actionview (= 8.0.4) + activesupport (= 8.0.4) + nokogiri (>= 1.8.5) + 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.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.4) + actionpack (= 8.0.4) + activerecord (= 8.0.4) + activestorage (= 8.0.4) + activesupport (= 8.0.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (8.0.4) + activesupport (= 8.0.4) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.4) + activesupport (= 8.0.4) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (8.0.4) + activesupport (= 8.0.4) + activerecord (8.0.4) + activemodel (= 8.0.4) + activesupport (= 8.0.4) + timeout (>= 0.4.0) + activestorage (8.0.4) + actionpack (= 8.0.4) + activejob (= 8.0.4) + activerecord (= 8.0.4) + activesupport (= 8.0.4) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4.3) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.0.4) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) - amazing_print (1.4.0) - ast (2.4.2) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) + amazing_print (1.8.1) + ast (2.4.3) awesome_print (1.9.2) + base64 (0.3.0) benchmark (0.5.0) - berkeley_library-alma (0.0.7.1) + berkeley_library-alma (0.1.1) berkeley_library-logging (~> 0.2) berkeley_library-marc (~> 0.3.1) berkeley_library-util (~> 0.1, >= 0.1.2) nokogiri (~> 1.13, >= 1.13.6) berkeley_library-docker (0.2.0) - berkeley_library-logging (0.2.7) - activesupport (>= 6) + berkeley_library-logging (0.3.0) + activesupport (>= 7) amazing_print (~> 1.1) - colorize (~> 0.8.1) + colorize (~> 1.0) lograge (~> 0.11) - ougai (~> 1.8) - berkeley_library-marc (0.3.1) + ougai (~> 2.0) + berkeley_library-marc (0.3.2) marc (~> 1.0) parslet (~> 2.0) ruby-marc-spec (~> 0.1) - berkeley_library-util (0.1.8) - berkeley_library-logging (~> 0.2) + berkeley_library-util (0.3.0) + berkeley_library-logging (~> 0.3) rest-client (~> 2.1) typesafe_enum (~> 0.3) + bigdecimal (4.0.1) bindex (0.8.1) - brakeman (5.4.1) - builder (3.2.4) - bundle-audit (0.1.0) + brakeman (8.0.4) + racc + builder (3.3.0) + bundle-audit (0.2.0) bundler-audit - bundler-audit (0.9.1) - bundler (>= 1.2.0, < 3) + bundler-audit (0.9.3) + bundler (>= 1.2.0) thor (~> 1.0) - byebug (11.1.3) - capybara (3.39.1) + byebug (13.0.0) + reline (>= 0.6.0) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - colorize (0.8.1) - concurrent-ruby (1.2.2) - crack (0.4.5) + colorize (1.1.0) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + crack (1.0.1) + bigdecimal rexml crass (1.0.6) - cssbundling-rails (1.1.2) + cssbundling-rails (1.4.3) railties (>= 6.0.0) - database_cleaner-active_record (2.1.0) + csv (3.3.5) + database_cleaner-active_record (2.2.2) activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) + database_cleaner-core (~> 2.0) database_cleaner-core (2.0.1) - date (3.3.3) - diff-lcs (1.5.0) - docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + date (3.5.1) + diff-lcs (1.6.2) + docile (1.4.1) + domain_name (0.6.20240107) dotenv (2.8.1) dotiw (5.3.3) activesupport i18n - erubi (1.12.0) - factory_bot (6.2.1) - activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) - railties (>= 5.0.0) - faraday (2.7.5) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.15.5) - foreman (0.89.1) - globalid (1.1.0) - activesupport (>= 5.0) - hashdiff (1.0.1) - hashie (5.0.0) + drb (2.2.3) + erb (6.0.2) + erubi (1.13.1) + factory_bot (6.5.6) + activesupport (>= 6.1.0) + factory_bot_rails (6.5.1) + factory_bot (~> 6.5) + railties (>= 6.1.0) + faraday (2.14.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) + ffi (1.17.3-aarch64-linux-gnu) + ffi (1.17.3-x86_64-linux-gnu) + foreman (0.90.0) + thor (~> 1.4) + geo_coord (0.2.0) + globalid (1.3.0) + activesupport (>= 6.1) + hashdiff (1.2.1) + hashie (5.1.0) + logger http-accept (1.7.0) - http-cookie (1.0.5) + http-cookie (1.1.0) domain_name (~> 0.5) - i18n (1.13.0) + i18n (1.14.8) concurrent-ruby (~> 1.0) - iiif-presentation (1.1.0) + iiif-presentation (1.4.2) activesupport (>= 3.2.18) - faraday (>= 0.9) + faraday (~> 2.7) + geo_coord json - jbuilder (2.11.5) - actionview (>= 5.0.0) - activesupport (>= 5.0.0) - jsbundling-rails (1.1.1) + io-console (0.8.2) + irb (1.17.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.14.1) + actionview (>= 7.0.0) + activesupport (>= 7.0.0) + jsbundling-rails (1.3.1) railties (>= 6.0.0) - json (2.6.3) - jwt (2.7.0) - listen (3.9.0) + json (2.18.1) + jwt (2.10.2) + base64 + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lograge (0.12.0) + logger (1.7.0) + lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.21.3) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marc (1.2.0) + marc (1.4.0) + nokogiri (~> 1.0) rexml - scrub_rb (>= 1.0.1, < 2) - unf - marcel (1.0.2) - matrix (0.4.2) - method_source (1.0.0) - mime-types (3.4.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) - mini_mime (1.1.2) - minitest (5.18.0) - net-imap (0.3.4) + marcel (1.1.0) + matrix (0.4.3) + mime-types (3.7.0) + logger + mime-types-data (~> 3.2025, >= 3.2025.0507) + mime-types-data (3.2026.0224) + mini_mime (1.1.5) + minitest (6.0.2) + drb (~> 2.0) + prism (~> 1.5) + mutex_m (0.3.0) + net-http (0.9.1) + uri (>= 0.11.1) + net-imap (0.6.3) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.1) net-protocol netrc (0.11.0) - nio4r (2.5.9) - nokogiri (1.15.2-aarch64-linux) - racc (~> 1.4) - nokogiri (1.15.2-arm64-darwin) + nio4r (2.7.5) + nokogiri (1.19.1-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.15.2-x86_64-darwin) + nokogiri (1.19.1-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) - racc (~> 1.4) - oj (3.14.3) + observer (0.1.2) + oj (3.16.15) + bigdecimal (>= 3.0) + ostruct (>= 0.2) okcomputer (1.19.1) benchmark - omniauth (1.9.2) + omniauth (2.1.4) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) - omniauth-cas (2.0.0) - addressable (~> 2.3) - nokogiri (~> 1.5) - omniauth (~> 1.2) - ougai (1.9.1) + logger + rack (>= 2.2.3) + rack-protection + omniauth-cas (3.0.2) + addressable (~> 2.8) + nokogiri (~> 1.12) + omniauth (~> 2.1) + omniauth-rails_csrf_protection (1.0.2) + actionpack (>= 4.2) + omniauth (~> 2.0) + ostruct (0.6.3) + ougai (2.0.0) oj (~> 3.10) - pagy (5.10.1) - activesupport - parallel (1.23.0) - parser (3.2.2.1) + pagy (43.3.1) + json + uri + yaml + parallel (1.27.0) + parser (3.3.10.2) ast (~> 2.4.1) + racc parslet (2.0.0) - pg (1.5.3) - pg_search (2.3.6) - activerecord (>= 5.2) - activesupport (>= 5.2) - public_suffix (5.0.1) - puma (5.6.5) + pg (1.6.3-aarch64-linux) + pg (1.6.3-x86_64-linux) + pg_search (2.3.7) + activerecord (>= 6.1) + activesupport (>= 6.1) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.2) + puma (7.2.0) nio4r (~> 2.0) - racc (1.6.2) - rack (2.2.7) - rack-test (2.1.0) + racc (1.8.1) + rack (3.2.5) + rack-protection (4.2.1) + base64 (>= 0.1.0) + logger (>= 1.6.0) + rack (>= 3.0.0, < 4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rackup (2.3.1) + rack (>= 3) + rails (8.0.4) + actioncable (= 8.0.4) + actionmailbox (= 8.0.4) + actionmailer (= 8.0.4) + actionpack (= 8.0.4) + actiontext (= 8.0.4) + actionview (= 8.0.4) + activejob (= 8.0.4) + activemodel (= 8.0.4) + activerecord (= 8.0.4) + activestorage (= 8.0.4) + activesupport (= 8.0.4) bundler (>= 1.15.0) - railties (= 7.0.4.3) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 8.0.4) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) - method_source + rails-html-sanitizer (1.7.0) + loofah (~> 2.25) + 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 (8.0.4) + actionpack (= 8.0.4) + activesupport (= 8.0.4) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - regexp_parser (2.8.0) - request_store (1.5.1) + rdoc (7.2.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.5) - 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) + rexml (3.4.4) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.0) + rspec-support (~> 3.13.0) + rspec-rails (8.0.3) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.7) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.26.1) + rubocop (1.84.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.16.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.28.1) - parser (>= 3.2.1.0) - rubocop-rails (2.13.2) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-rails (2.34.3) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rspec (2.4.0) - rubocop (~> 1.0) - rubocop-ast (>= 1.1.0) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) + rubocop-rspec_rails (2.31.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-rspec (~> 3.5) ruby-marc-spec (0.1.3) marc (~> 1.1) parslet (~> 2.0) typesafe_enum (~> 0.3) - ruby-prof (0.17.0) + ruby-prof (2.0.3) + base64 + ostruct ruby-progressbar (1.13.0) - ruby-vips (2.1.4) + ruby-vips (2.3.0) ffi (~> 1.12) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - scrub_rb (1.0.1) - selenium-webdriver (4.9.1) + logger + rubyzip (3.2.2) + securerandom (0.4.1) + selenium-webdriver (4.41.0) + base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2, < 3.0) + rubyzip (>= 1.2.2, < 4.0) websocket (~> 1.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) - simplecov-rcov (0.3.1) + simplecov-html (0.13.2) + simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - sprockets (4.2.0) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - thor (1.2.2) - timeout (0.3.2) + stringio (3.2.0) + thor (1.5.0) + timeout (0.6.0) + tsort (0.2.0) typesafe_enum (0.3.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (2.4.2) - web-console (4.2.0) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) + useragent (0.16.11) + web-console (4.3.0) + actionview (>= 8.0.0) bindex (>= 0.4.0) - railties (>= 6.0.0) - webmock (3.18.1) + railties (>= 8.0.0) + webmock (3.26.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket (1.2.9) - websocket-driver (0.7.5) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + yaml (0.4.0) + zeitwerk (2.7.5) PLATFORMS - aarch64-linux - arm64-darwin - x86_64-darwin + aarch64-linux-gnu x86_64-linux DEPENDENCIES + addressable (~> 2.8) awesome_print (~> 1.9) - berkeley_library-alma (~> 0.0.7) + berkeley_library-alma (~> 0.1.1) berkeley_library-docker (~> 0.2.0) - berkeley_library-logging (~> 0.2, >= 0.2.7) - berkeley_library-marc (~> 0.3) - berkeley_library-util (~> 0.1, >= 0.1.8) + berkeley_library-logging (~> 0.3.0) + berkeley_library-marc (~> 0.3.2) + berkeley_library-util (~> 0.3.0) brakeman bundle-audit byebug @@ -403,42 +484,46 @@ DEPENDENCIES colorize concurrent-ruby (~> 1.1) cssbundling-rails - database_cleaner-active_record (~> 2.0) + csv + database_cleaner-active_record (~> 2.2) dotenv (~> 2.7) - dotiw (~> 5.3) + dotiw (~> 5.3.3) factory_bot_rails foreman - iiif-presentation (~> 1.0) - jbuilder (~> 2.5) + iiif-presentation (~> 1.4) + jbuilder (~> 2.14.0) jsbundling-rails jwt (~> 2.2) listen - non-stupid-digest-assets! - okcomputer (~> 1.19, >= 1.19.1) - omniauth-cas (~> 2.0) - pagy (~> 5.6) + mutex_m (~> 0.3.0) + observer (~> 0.1.2) + okcomputer (~> 1.19) + omniauth (~> 2.1) + omniauth-cas (~> 3.0) + omniauth-rails_csrf_protection (~> 1.0) + pagy (~> 43) pg (~> 1.2) pg_search (~> 2.3) - puma (~> 5.0) - rails (~> 7.0.4, >= 7.0.4.3) + puma (~> 7.2) + rails (~> 8.0.4) rspec (~> 3.10) - rspec-rails (~> 5.0) + rspec-rails (~> 8.0) rspec_junit_formatter (~> 0.5) - rubocop (~> 1.26.0) - rubocop-rails (~> 2.13.2) - rubocop-rspec (~> 2.4.0) - ruby-prof (~> 0.17.0) - ruby-vips (~> 2.0) + rubocop (~> 1.84.0) + rubocop-rails (~> 2.34.0) + rubocop-rspec (~> 3.9.0) + rubocop-rspec_rails (~> 2.31.0) + ruby-prof (~> 2.0.0) + ruby-vips (~> 2.3) selenium-webdriver (~> 4.0) simplecov (~> 0.21) simplecov-rcov (~> 0.2) - sprockets-rails (~> 3.4) - typesafe_enum (~> 0.3) - web-console (>= 4.1.0) + sprockets-rails (~> 3.5.0) + web-console (>= 4.2.1) webmock RUBY VERSION - ruby 3.2.2p53 + ruby 3.3.10p183 BUNDLED WITH - 2.4.10 + 2.5.22 diff --git a/app/assets/images/icons/twitter-square.svg b/app/assets/images/icons/twitter-square.svg deleted file mode 100644 index 3aa36dd..0000000 --- a/app/assets/images/icons/twitter-square.svg +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 99a5981..4f1100c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,7 +3,7 @@ # rubocop:disable Metrics/ClassLength class ApplicationController < ActionController::Base include ExceptionHandling - include Pagy::Backend + include Pagy::Method # ------------------------------------------------------------ # Global controller configuration @@ -15,7 +15,7 @@ class ApplicationController < ActionController::Base # Global hooks after_action do - pagy_headers_merge(@pagy) if @pagy + response.headers.merge!(@pagy.headers_hash) if @pagy merge_link_header end @@ -137,7 +137,7 @@ def with_profile(report_filename, &) return if performed? flash_now!(:danger, t('application.profile.failed', msg: e.message)) - render('application/standard_error', locals: { exception: e }) + render('application/standard_error', status: :internal_server_error, locals: { status: :internal_server_error, exception: e, message: e.message }) end # ------------------------------ @@ -150,7 +150,7 @@ def render_with_errors(view, errors, log_message) def render_422(view, errors, locals: {}) flash_now!(:danger, errors.full_messages) - render(view, status: :unprocessable_entity, locals:) + render(view, status: :unprocessable_content, locals:) end # ------------------------------ @@ -184,23 +184,27 @@ def add_flash(flash_obj, lvl, msg) end def ensure_flash_array(flash_obj, lvl) - return (flash_obj[lvl] = []) unless (current = flash_obj[lvl]) + return flash_obj[lvl] = [] unless (current = flash_obj[lvl]) current.is_a?(Array) ? current : (flash_obj[lvl] = Array(current)) end def do_profile(report_filename, &block) - RubyProf.stop if RubyProf.running? - RubyProf.start + raise ArgumentError, 'block is required' unless block + + profile = RubyProf::Profile.new + profile.start + begin block.call ensure - write_profile_report(report_filename) if RubyProf.running? + result = profile.stop end + + write_profile_report(report_filename, result) end - def write_profile_report(report_filename) - result = RubyProf.stop + def write_profile_report(report_filename, result) File.open(File.join(public_dir, report_filename), 'w') do |f| RubyProf::GraphHtmlPrinter.new(result).print(f, min_percent: 2) end diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 672cf7e..3da61a4 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -38,7 +38,7 @@ def destroy return render_item_errors(status: :forbidden) unless @item.destroy logger.info("Deleted item #{@item.directory} (“#{@item.title}”, id: #{item_id})") - render body: nil, status: :no_content + head :no_content end # GET /processing.json @@ -55,7 +55,7 @@ def processing def paginate_items Item.scan_for_new_items! - @pagy, @items = pagy(items) + @pagy, @items = pagy(:offset, items) response.headers['Current-Page-Items'] = @items.count end @@ -80,7 +80,7 @@ def set_item # Only allow a list of trusted parameters through. def item_params - params.require(:item).permit(:directory, :title, :author, :copies, :active, :publisher, :physical_desc, term_ids: []) + params.expect(item: [:directory, :title, :author, :copies, :active, :publisher, :physical_desc, { term_ids: [] }]) end def query_params diff --git a/app/controllers/lending_controller.rb b/app/controllers/lending_controller.rb index a0e92ae..8928a78 100644 --- a/app/controllers/lending_controller.rb +++ b/app/controllers/lending_controller.rb @@ -19,12 +19,12 @@ class LendingController < ApplicationController # ------------------------------------------------------------ # Controller actions - # TODO: merge 'edit' and 'show' - def edit; end - # Admin view def show; end + # TODO: merge 'edit' and 'show' + def edit; end + # Patron view # TODO: separate actions for with/without token, # separate views for with/without active loan @@ -163,7 +163,9 @@ def existing_loan end def active_loan - @active_loan ||= Loan.active.find_by(**loan_args) + return @active_loan if defined?(@active_loan) + + @active_loan = Loan.active.find_by(**loan_args) end def most_recent_loan @@ -184,7 +186,7 @@ def directory # create/update parameters def lending_item_params # TODO: better/more consistent name - params.require(:item).permit(:directory, :title, :author, :publisher, :physical_desc, :copies, :active, term_ids: []) + params.expect(item: [:directory, :title, :author, :publisher, :physical_desc, :copies, :active, { term_ids: [] }]) end # loan lookup parameters diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index ae3c171..c297bcb 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -10,10 +10,18 @@ # # @see https://github.com/omniauth/omniauth class SessionsController < ApplicationController + # Require login, then: + # - redirect administrators to "Manage Items" + # - return 403 Forbidden for other users + def index + require_lending_admin! + + redirect_to(items_path) + end + # Redirect the user to Calnet for authentication def new - redirect_args = { origin: params[:url] || request.base_url }.to_query - redirect_to("/auth/calnet?#{redirect_args}", allow_other_host: true) + @origin = params[:url].presence || request.base_url end # Generate a new user session using data returned from a valid Calnet login @@ -25,7 +33,7 @@ def callback log_signin(user) end - redirect_url = (request.env['omniauth.origin'] || root_path) # TODO: better default redirect path + redirect_url = request.env['omniauth.origin'] || root_path # TODO: better default redirect path redirect_to(redirect_url, allow_other_host: true) end @@ -37,15 +45,6 @@ def destroy redirect_to(cas_logout_url, allow_other_host: true) end - # Require login, then: - # - redirect administrators to "Manage Items" - # - return 403 Forbidden for other users - def index - require_lending_admin! - - redirect_to(items_path) - end - private def auth_params @@ -53,7 +52,7 @@ def auth_params end def cas_base_uri - cas_host = Rails.application.config.cas_host + cas_host = Rails.application.config.x.cas_host URI.parse("https://#{cas_host}") end diff --git a/app/controllers/terms_controller.rb b/app/controllers/terms_controller.rb index 7613d83..c639e5b 100644 --- a/app/controllers/terms_controller.rb +++ b/app/controllers/terms_controller.rb @@ -42,7 +42,7 @@ def destroy return render_term_errors(status: :forbidden) unless @term.destroy logger.info("Deleted term #{@term.name} (#{@term.start_date}–#{@term.end_date})”, id: #{term_id})") - render body: nil, status: :no_content + head :no_content end private @@ -83,14 +83,16 @@ def set_term @term = Term.find(term_id) end + # rubocop:disable Rails/StrongParametersExpect def term_params params.require(:term).permit(:name, :start_date, :end_date).tap do |pp| logger.info("#{self.class}.term_params", pp) end end + # rubocop:enable Rails/StrongParametersExpect def term_default? - @term_default ||= params.require(:term).permit(:default_term)[:default_term] + @term_default ||= params.require(:term).permit(:default_term)[:default_term] # rubocop:disable Rails/StrongParametersExpect end def query_params diff --git a/app/javascript/items/api/items.js b/app/javascript/items/api/items.js index 7293987..f3c4604 100644 --- a/app/javascript/items/api/items.js +++ b/app/javascript/items/api/items.js @@ -58,7 +58,7 @@ function pagingFromResponse (response) { const paging = { currentPage: getInt(headers, 'current-page', 1), totalPages: getInt(headers, 'total-pages', 1), - itemsPerPage: getInt(headers, 'page-items', 0), + itemsPerPage: getInt(headers, 'page-limit', 0), currentPageItems: getInt(headers, 'current-page-items', 0), totalItems: getInt(headers, 'total-count', 0) } @@ -71,7 +71,7 @@ function pagingFromResponse (response) { } const links = Link.parse(linkHeader) - for (const rel of ['first', 'prev', 'next', 'last']) { + for (const rel of ['first', 'previous', 'next', 'last']) { if (links.has('rel', rel)) { const urlStr = links.get('rel', rel)[0].uri paging[rel] = new URL(urlStr) diff --git a/app/javascript/items/components/ItemPaging.vue b/app/javascript/items/components/ItemPaging.vue index 1dfdc87..7f72e8d 100644 --- a/app/javascript/items/components/ItemPaging.vue +++ b/app/javascript/items/components/ItemPaging.vue @@ -19,11 +19,11 @@