-
Notifications
You must be signed in to change notification settings - Fork 18
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
Update Admin Panel to work via iframes #799
Conversation
a03723e
to
c0c8983
Compare
This reverts commit 27b0919.
src/meshdb/templates/admin/password_reset/password_reset_complete.html
Outdated
Show resolved
Hide resolved
|
||
# TODO (wdn): Add more tests checking if navigating to xyz page works | ||
# Unfortunately, because that is a lot of javascript, it's tricky to test. | ||
# It may be possible to run selenium integration tests or something to validate |
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'd support selenium-based tests for integration testing deployed copies of the application (dev, gamma, etc) but probably we don't want it in our unit testing pipeline, those things are slow enough already
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.
Probably not in our unit testing pipeline, no. Are you OK with me handling this in a separate PR or would you like me to take a crack at a solution for this here?
Doing some local testing and noticed a few issues:
Overall it feels much snappier though, great job on the performance improvements |
That's odd. My last commit should have fixed that. Did you pull the latest?
Fixed
Should be fixed |
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 not looking super closely, but I don't want to block you any more than I already have. You've iterated on this a ton and I trust your judgement about the readiness of this for release
|
||
|
||
@staff_member_required | ||
def admin_iframe_view(request: HttpRequest) -> HttpResponse: |
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.
Might want to add a test for this authentication/redirect
src/meshweb/static/admin/map.js
Outdated
if (url.pathname.startsWith("/admin/logout")) return true; | ||
if (url.pathname.endsWith("/export/") && isForm) return true; | ||
if (url.host !== location.host) return true; | ||
console.log(`Admin Panel src set to: ${admin_panel_iframe.src}`); |
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.
Might want to gate all these log lines with a debug statement or something for cleanliness.
Refactors the way the map is incorporated into the admin panel. Instead of embedding it and doing a lot of tricks to update the DOM, it puts the admin panel and the map into their own iframes, and ties them together with a little JavaScript secret sauce.
/admin
Still a lot to do on this: