Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow location restricted files to show in document viewer content window #2752

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
data-controller="content-list"
data-action="thumbnails-found@window->content-list#drawThumbnails"
role="tablist">
<%= render Document::ContentListItemComponent.with_collection(viewer.purl_object.downloadable_files, viewer:) if document_viewer? %>
<%= render Document::ContentListItemComponent.with_collection(viewer.purl_object.all_resource_files.reject(&:no_download?), viewer:) if document_viewer? %>
</ul>
<% end %>
<% end %>
3 changes: 2 additions & 1 deletion app/javascript/controllers/file_auth_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default class extends Controller {
console.debug("Now figure out if we can render", contentResource)
// Ensure location restriction banner is hidden by default in case it was visible for the previous document
this.locationRestrictionTarget.hidden = true
// Ensure the login banner is hidden by default in case it was visible for the prior resource
this.loginPanelTarget.hidden = true
if (!contentResource.service) {
// no auth service is present, just render the resource
this.renderViewer({ fileUri: contentResource.id })
Expand Down Expand Up @@ -279,7 +281,6 @@ export default class extends Controller {
this.locationRestrictionTarget.hidden = false
// Display the location restriction message based on the authorization response
this.locationRestrictionMessageTarget.innerHTML = this.retrieveRestrictedLocationMessage(json)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this back in please

}

// Checks the result of the probe auth request to see if access is restricted to location
Expand Down