Skip to content
Snippets Groups Projects
Commit 5e26bf4c authored by BrittainJackson7's avatar BrittainJackson7
Browse files

Fix bug that transfers queryable selections across collections

parent 8bb730b4
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,8 @@ export default function FootprintResults(props) { ...@@ -68,6 +68,8 @@ export default function FootprintResults(props) {
// Call the callback function to pass the selected title to the Sidebar // Call the callback function to pass the selected title to the Sidebar
props.updateSelectedTitle(selectedCollectionTitle); props.updateSelectedTitle(selectedCollectionTitle);
props.UpdateQueryableTitles(null);
// Send to Leaflet // Send to Leaflet
window.postMessage(["setVisibleCollections", newCollectionId], "*"); window.postMessage(["setVisibleCollections", newCollectionId], "*");
...@@ -203,6 +205,7 @@ export default function FootprintResults(props) { ...@@ -203,6 +205,7 @@ export default function FootprintResults(props) {
} }
// Updates collectionId if switching to a new set of collections (new target) // Updates collectionId if switching to a new set of collections (new target)
let myId = collectionId; let myId = collectionId;
if (!collections[myId]) { if (!collections[myId]) {
...@@ -219,6 +222,7 @@ export default function FootprintResults(props) { ...@@ -219,6 +222,7 @@ export default function FootprintResults(props) {
// Send to Leaflet // Send to Leaflet
window.postMessage(["setFeatureCollections", myId, collections], "*"); window.postMessage(["setFeatureCollections", myId, collections], "*");
})(); })();
......
...@@ -227,6 +227,10 @@ export default function SearchAndFilterInput(props) { ...@@ -227,6 +227,10 @@ export default function SearchAndFilterInput(props) {
UpdateQueryableTitles(selectedOptionsWithValues); UpdateQueryableTitles(selectedOptionsWithValues);
}; };
//queryables
const handleQueryableRemove = (event) => {
UpdateQueryableTitles(event);
};
// Sorting // Sorting
const handleSortChange = (event) => { const handleSortChange = (event) => {
...@@ -296,6 +300,8 @@ export default function SearchAndFilterInput(props) { ...@@ -296,6 +300,8 @@ export default function SearchAndFilterInput(props) {
setAreaTextVal(""); // Area (received by window message from AstroMap) setAreaTextVal(""); // Area (received by window message from AstroMap)
setDateFromVal(null); // From Date setDateFromVal(null); // From Date
setDateToVal(null); // To Date setDateToVal(null); // To Date
handleQueryableRemove(null); // properties selection
}, [props.targetName]); }, [props.targetName]);
......
...@@ -82,6 +82,7 @@ export default function Sidebar(props) { ...@@ -82,6 +82,7 @@ export default function Sidebar(props) {
setQueryAddress={props.setQueryAddress} setQueryAddress={props.setQueryAddress}
updateSelectedTitle={updateSelectedTitle} updateSelectedTitle={updateSelectedTitle}
selectedQueryables = {updatedQueryableTitles} selectedQueryables = {updatedQueryableTitles}
UpdateQueryableTitles = {UpdateQueryableTitles}
/> />
</Collapse> </Collapse>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment