-
Notifications
You must be signed in to change notification settings - Fork 6
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
indicate stanford-only restriction even after login #1763
indicate stanford-only restriction even after login #1763
Conversation
f86c39c
to
490472b
Compare
pointers for logout link implementation:
|
question for @alundgard: What should I do about the logged in banner either pushing the player controls under the bottom of the embed iframe in PURL, or pushing the hamburger icon for the companion window above it (which behavior occurs depends on whether the user just logged in, or already logged in before loading the page). From post-standup discussion, the options seemed like:
|
|
e70fbf6
to
c71b2da
Compare
app/assets/stylesheets/media.scss
Outdated
// First selector is for embargo. Last selector is other auth restrictions | ||
.authLinkWrapper + .media-component-body, [data-controller="auth-restriction"]:has(.authLinkWrapper:not([hidden])) + .media-component-body { | ||
max-height: calc(100vh - 88px); // Scroll height for metadata when the auth wrapper is displaying | ||
[data-controller="auth-restriction"]:not([hidden]) + .media-component-body { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the selector simplification here and the associated HTML and JS updates (motivation described in more detail the last commit message), i found that the video player wouldn't expand to fill the space left by the dismissed banner. also, the video player would be a bit jumpy on page load, and would be shrunk as if the banner was already displayed, even if the banner had yet to be shown because a response from stacks had yet to be received.
the fix associated with this CSS tweak seems to smooth things out so that the video player consistently shrinks when auth message is displayed, and expands when it's not.
example of the incorrectly unexpanded player before the fix in the last commit (seems to be a problem post-login even on main
at the moment):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still look right for an embargo? It looks like that selector has been removed entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, after a bunch of uncertainty, i did what i thought was the safest thing to move this PR along without introducing a regression: i put the old selector back. but i made two small tweaks: i flipped the order, because that felt more natural given the order of the DOM elements in media_with_companion_windows_component.erb
, and i updated the comment because i'm pretty sure the selector i added back is for citation-only.
per stereotypically wordy slack reply, there's a corner case with two banners that neither the old CSS nor the slightly re-jiggered CSS seem to account for. but i don't think this PR makes that worse, so maybe we can circle back on that in a follow up if need be.
.authLinkWrapper + .media-component-body, [data-controller="auth-restriction"]:has(.authLinkWrapper:not([hidden])) + .media-component-body { | ||
max-height: calc(100vh - 88px); // Scroll height for metadata when the auth wrapper is displaying | ||
[data-controller="auth-restriction"]:not([hidden]) + .media-component-body { | ||
max-height: calc(100vh - 100px); // Scroll height for metadata when the auth wrapper is displaying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
svg { | ||
font-size: 0.85rem; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this styling was just the result of a bit of tweaking till i got something that i thought looked slightly better than the default. very open to suggestions here.
2275267
to
10333cc
Compare
06804d6
to
adbe637
Compare
… more accurately reflect current behavior
…re consistent * start with the auth-restriction div hidden when the DOM is initially rendered * un-hide it in the methods that do other DOM manipulation to display auth restriction messages conditionally based on authResponse * hide it if the auth-restriction message is dismissed * simplify the CSS selector for media-component-body sizing, since now it only has to care about whether auth-restriction div is hidden or not * rename a method for accuracy, take advantage of a possible simplification (stimulus auth_restriction_controller.dismissStanfordRestriction becomes .hideLoginPrompt) otherwise, i found that the old CSS was sometimes subtracting from max-height for media-component-body when it should've been left full height, presumably some things in the more complex selector weren't hidden as expected.
adbe637
to
827343e
Compare
closes #1531
requires sul-dlss/stacks#1049(merged)This is the simpler approach to dealing with #1531, from which we can iterate and do something more like the ideal mockup. (per comment on the ticket: "Simpler approach: a persistent banner across the tab (i.e., not collapsible). That is also fine.")
mockup for the simpler approach
TODO:
add a working log out linknone of the logout link possibilities discussed in standup seemed to work for me, will ticket as separate follow on workspecs? from post-standup discussion, seemed like this maybe isn't worth a feature spec (and like it might be hard to write one)? but maybe worth a view component spec to make sure the banner renders when expected and not when not?there's already a spec to this effect (media_with_companion_windows_component_spec.rb
Existing login banner:
![Screen Shot 2023-11-29 at 11 34 54 PM](https://private-user-images.githubusercontent.com/7741604/286853059-938364f5-ec77-4619-ba66-c61a885ffd11.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTYyMjcsIm5iZiI6MTczOTAxNTkyNywicGF0aCI6Ii83NzQxNjA0LzI4Njg1MzA1OS05MzgzNjRmNS1lYzc3LTQ2MTktYmE2Ni1jNjFhODg1ZmZkMTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTE1ODQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjNlYTdjZTRmM2Y1YjkxMDIzMDg3ZTEyZDg5MDQ3NTE0ZDExZTkyYTc3NTkzY2UxZjg1MDhhMDljYjkzZGRmNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.IWVS5o6Yqyfv2Aix5nCj7IEOwt40LH8y6ZycuR34LNM)
New banner indicating successful login, with close button (I tried unsuccessfully to float it to the right, then settled for this because it seemed somewhat defensible to have it the "close" button placed similarly to the Login button before login -- happy to revisit if that's too much rationalizing):
![Screen Shot 2023-11-29 at 11 33 38 PM](https://private-user-images.githubusercontent.com/7741604/286853281-384d6d8b-dd96-4558-b324-d38a8840b94a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTYyMjcsIm5iZiI6MTczOTAxNTkyNywicGF0aCI6Ii83NzQxNjA0LzI4Njg1MzI4MS0zODRkNmQ4Yi1kZDk2LTQ1NTgtYjMyNC1kMzhhODg0MGI5NGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTE1ODQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTUzNDEzOWZhZWI2YTZkOGZkZTg0M2IwYjQ1MTY1MjA2ZGMwNTg0ZWJlYmE2YjFjNTM2Y2YwNDY3MTcxNzY2OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.vpt-vm3e8tBoZ2SRHNdyRToKyYNulx3wSyCgwsKY40o)
Video after dismissing the post-login message:
![Screen Shot 2023-11-29 at 11 34 02 PM](https://private-user-images.githubusercontent.com/7741604/286853852-526af155-087c-4367-bdfe-5b209a28ac99.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTYyMjcsIm5iZiI6MTczOTAxNTkyNywicGF0aCI6Ii83NzQxNjA0LzI4Njg1Mzg1Mi01MjZhZjE1NS0wODdjLTQzNjctYmRmZS01YjIwOWEyOGFjOTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTE1ODQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWE4ODE2ODdmNzZiNWY3ZWI5ZmQyZGEwYmQ5MjE3MDM2OGY2NzIzMjAyZTE0MzlkZDUwMDZkMmU4MmE2YTM0OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.iaxp6ME8sfCCkHv62uS6siUoSG6ez_NfbHXFDu3-VM0)