From dfe86884d2b68e0f7d1a2ac09b0cc60f5c43ab4b Mon Sep 17 00:00:00 2001 From: Julia Wu Date: Wed, 11 Dec 2024 11:58:00 -0800 Subject: [PATCH] Enable "explore in tool" on dev place pages (#4785) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the "explore in [timeline/map] tool" to chart footers in the dev place pages. Also sorts fields alphabetically for codacy code quality. Example: ![Screenshot 2024-12-11 at 10 00 48 AM](https://github.com/user-attachments/assets/260d9429-989b-4a0d-a8e5-f93a132c3a55) --- .../webdriver/shared_tests/place_explorer_test.py | 14 ++++++++++++++ static/js/components/tiles/chart_footer.tsx | 4 ++-- static/js/place/dev_place_main.tsx | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/server/webdriver/shared_tests/place_explorer_test.py b/server/webdriver/shared_tests/place_explorer_test.py index d03aa6f082..988474e86b 100644 --- a/server/webdriver/shared_tests/place_explorer_test.py +++ b/server/webdriver/shared_tests/place_explorer_test.py @@ -301,3 +301,17 @@ def test_dev_place_overview_california(self): related_places_callout_el = WebDriverWait( self.driver, self.TIMEOUT_SEC).until(related_places_callout_el_present) self.assertEqual(related_places_callout_el.text, 'Places in California') + + # Assert the "Download" link is present in charts + download_link_present = EC.presence_of_element_located( + (By.CLASS_NAME, 'download-outlink')) + download_link_el = WebDriverWait( + self.driver, self.TIMEOUT_SEC).until(download_link_present) + self.assertTrue('Download' in download_link_el.text) + + # Assert the "Explore in ... Tool" link is present in charts + explore_in_link_present = EC.presence_of_element_located( + (By.CLASS_NAME, 'explore-in-outlink')) + explore_in_link_el = WebDriverWait( + self.driver, self.TIMEOUT_SEC).until(explore_in_link_present) + self.assertTrue('Explore in' in explore_in_link_el.text) diff --git a/static/js/components/tiles/chart_footer.tsx b/static/js/components/tiles/chart_footer.tsx index 098a42fbe0..9a4c178731 100644 --- a/static/js/components/tiles/chart_footer.tsx +++ b/static/js/components/tiles/chart_footer.tsx @@ -49,7 +49,7 @@ export function ChartFooter(props: ChartFooterPropType): JSX.Element {
{props.handleEmbed && ( -
+
download )} {props.exploreLink && ( -