From 0ccb1d288458d2487e1a13b30c15f30d7cb2c9a8 Mon Sep 17 00:00:00 2001 From: Tai Wilkin Date: Tue, 23 Feb 2021 14:52:49 -0500 Subject: [PATCH 1/3] Hide Unnecessary Components in Embedded Map When running in embedded mode, hide the header and footer, the contributor filter, the report link, the Guide tab, the OAR sidebar header, and the facility detail actions; make the contributor links into text; add a 'open in OAR' link; and remove the 'embed' parameter from 'share this search'. --- src/app/src/App.jsx | 14 +- src/app/src/components/FacilitiesMap.jsx | 7 +- .../src/components/FacilityDetailSidebar.jsx | 154 +++++++++------- .../components/FacilityDetailSidebarInfo.jsx | 3 +- ...acilitySidebarSearchTabFacilitiesCount.jsx | 2 + src/app/src/components/FilterSidebar.jsx | 15 +- .../src/components/FilterSidebarSearchTab.jsx | 170 +++++++++--------- src/app/src/components/Navbar.jsx | 6 +- .../components/VectorTileFacilitiesMap.jsx | 7 +- src/app/src/util/util.js | 3 + 10 files changed, 221 insertions(+), 160 deletions(-) diff --git a/src/app/src/App.jsx b/src/app/src/App.jsx index 295ee47fa..f5df4fb4e 100644 --- a/src/app/src/App.jsx +++ b/src/app/src/App.jsx @@ -88,15 +88,17 @@ class App extends Component { } render() { - const { fetchingFeatureFlags } = this.props; + const { fetchingFeatureFlags, embed } = this.props; + const mainPanelStyle = embed ? { ...appStyles.mainPanelStyle, bottom: 0, top: 0 } + : appStyles.mainPanelStyle; return (
- -
+ +
} />
-
+ {embed ? null :
} toast('Copied search to clipboard')} >
-
- - Filter by Contributor - - - 1}> - - } - label="Show only shared facilities" - /> - contributorPopoverAnchorEl - ? null - : - setContributorPopoverAnchorEl(e.currentTarget)} + +
+ - - - setContributorPopoverAnchorEl(null)} + Filter by Contributor + + + 1}> + + } + label="Show only shared facilities" + /> + contributorPopoverAnchorEl + ? null + : + setContributorPopoverAnchorEl(e.currentTarget)} + > + + + setContributorPopoverAnchorEl(null)} + > + {contributorInfoPopoverContent} + + +
+
+ - {contributorInfoPopoverContent} - - -
-
- - Filter by Contributor Type - - -
+ Filter by Contributor Type + + +
+
- - Report an issue - -
+ {!embed ? ( + + Report an issue + + ) : null} +
- - {renderStatusRibbon()} - + {renderStatusRibbon()}
diff --git a/src/app/src/components/FilterSidebarFacilitiesTab.jsx b/src/app/src/components/FilterSidebarFacilitiesTab.jsx index 63f6c1bf4..6cfa5fe02 100644 --- a/src/app/src/components/FilterSidebarFacilitiesTab.jsx +++ b/src/app/src/components/FilterSidebarFacilitiesTab.jsx @@ -316,13 +316,13 @@ function FilterSidebarFacilitiesTab({ secondary={address} /> - - {isClosed && ( + {isClosed ? ( +
Closed facility
- )} -
+
+ ) : null} )) } From e62483e58d9492d0b935b2879cd6cd234c0cab29 Mon Sep 17 00:00:00 2001 From: Tai Wilkin Date: Tue, 2 Mar 2021 12:45:12 -0500 Subject: [PATCH 3/3] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4d60252f..bce1176f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Add Closure to CSV Download [#1249](https://github.com/open-apparel-registry/open-apparel-registry/pull/1249) - Manage Embed Parameter [#1257](https://github.com/open-apparel-registry/open-apparel-registry/pull/1257) - Send Notification of Facility Report Response [#1250](https://github.com/open-apparel-registry/open-apparel-registry/pull/1250) +- Render Appropriately in Embed Mode [#1260](https://github.com/open-apparel-registry/open-apparel-registry/pull/1260) ### Changed