Skip to content

Commit

Permalink
Merge pull request #4007 from sul-dlss/aeon-pageable
Browse files Browse the repository at this point in the history
Consolidate aeon_pageable? and folio_aeon_pageable?
  • Loading branch information
cbeer authored Feb 22, 2024
2 parents 4fc618c + 29e6711 commit a83e172
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/policies/location_request_link_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def show?
end

def aeon_pageable?
folio_aeon_pageable? if folio_items?
return false if !folio_items? || folio_permanent_locations.none?

folio_permanent_locations.all? { |location| location.dig('details', 'pageAeonSite') }
end

private
Expand All @@ -36,7 +38,7 @@ def folio_pageable?

!folio_disabled_status_location? &&
(folio_mediated_pageable? ||
folio_aeon_pageable? ||
aeon_pageable? ||
folio_item_pageable?)
end

Expand All @@ -56,12 +58,6 @@ def folio_mediated_pageable?
folio_permanent_locations.all? { |location| location.dig('details', 'pageMediationGroupKey') }
end

def folio_aeon_pageable?
return false unless folio_items? && folio_permanent_locations.any?

folio_permanent_locations.all? { |location| location.dig('details', 'pageAeonSite') }
end

def folio_item_pageable?
items.any? do |item|
item.allowed_request_types&.include?('Page')
Expand Down

0 comments on commit a83e172

Please sign in to comment.