-
-
Notifications
You must be signed in to change notification settings - Fork 141
[feature] Setting url fragments and applying to that data on both maps #703
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: gsoc25-map
Are you sure you want to change the base?
Conversation
1ed30c3
to
acec94b
Compare
f570034
to
e533011
Compare
Set URL fragments when clicking nodes in geo and indoor maps, and apply state from URL on load. Fixes #562
e533011
to
b5cd494
Compare
632f83b
to
0fa8b29
Compare
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.
Amazing work Deepanshu! 🚀 🚀 🚀
This PR is on point!!! Just need to add some comments here and there.
ef9e7c4
to
0fa8b29
Compare
34da180
to
af11750
Compare
af11750
to
838bb84
Compare
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.
@dee077 Good work with adding the buttons to the device page. But, these buttons are redirecting the user to /admin/
page. The end goal is to create a dedicated page for the map.
I'm unsure if we need field label for the button. I'm attaching the screenshot so @nemesifier can confirm quickly.

return super(admin.ModelAdmin, self).has_delete_permission(request, obj) | ||
|
||
|
||
def patch_device_location_inline(self): |
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.
Let's add a comment here explaining why we are doing this.
const location_parent = $("fieldset.module.aligned.loci.coords"); | ||
const floorplan_parent = $("fieldset.module.aligned.indoor.coords"); |
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.
nit pick: the variable naming convention is not right for JS. We use camelCase.
current_hash = self.web_driver.execute_script( | ||
"return window.location.hash;" | ||
) | ||
expected_hash = f"#id={mapId}&nodeId={location.id}" | ||
self.assertEqual(expected_hash, current_hash) |
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.
You can use url_to_be
expected condition https://www.selenium.dev/selenium/docs/api/py/selenium_webdriver_support/selenium.webdriver.support.expected_conditions.html#selenium.webdriver.support.expected_conditions.url_to_be
This will ensure that the user is redirected to /admin/
.
logs = self.get_browser_logs() | ||
self.assertEqual(len(logs), 0) | ||
self.assertTrue(popup.is_displayed()) | ||
self.assertIn(device.name, popup.get_attribute("innerHTML")) |
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.
Can we also verify the location name in the pop-up?
current_hash = self.web_driver.execute_script( | ||
"return window.location.hash;" | ||
) | ||
expected_hash = f"#id={indoorMapId}&nodeId={device_location.id}" | ||
self.assertEqual(expected_hash, current_hash) |
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.
Same here, use EC.url_to_be
logs = self.get_browser_logs() | ||
self.assertEqual(len(logs), 0) | ||
self.assertTrue(popup.is_displayed()) | ||
self.assertIn(device.name, popup.get_attribute("innerHTML")) |
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.
It should be possible to also verify the floorplan-title
.
Checklist
Reference to Existing Issue
Closes #562.
Description of Changes
urlFragements
from config on both maps to allow fragments to set and apply from netjsongraph.jsfloorplan.js
to parse the params first, and if it exists for the indoor map open the floorplan overlayBlockers