-
Notifications
You must be signed in to change notification settings - Fork 2
BEG-223: Add session expiry warning modal #15
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
base: main
Are you sure you want to change the base?
BEG-223: Add session expiry warning modal #15
Conversation
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.
LGTM
|
||
<div id="session-expire-warning-modal"> | ||
<p style="font-size:48px;color:#FF0000">⚠</p> | ||
<p>Your admin session will expire in one minute, please save your changes or refresh the page.</p> |
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.
Do we want to actually give the option to extend the session asynchronously? It would be more user-friendly.
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.
I'm happy to, but I might need a bit more guidance on how to do that.
Just exploring options now, I added a button to refresh the page, but what would be the best way to refresh the session without refreshing the entire page and potentially losing any unsvaed changes?
So far I just added this to the phtml:
<button onclick="window.location.reload();">Refresh Page</button>
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.
The trouble with just reloading the page is that the user is likely to lose whatever changes they've got. We should be able to execute an AJAX request that can renew their session, but remain on the page they're currently on.
Obviously, we'd require testing to make sure that whatever page they're editing remains saveable (no form key issues, etc.)
Request in #14 , this feature provides an admin UI modal that warns the admin user if they're within one minute of their session expiring.
I've taken a simple approach in the phtml file, but open to suggestions for improvement.