From b0d1fe200a0ea7d98a6dcdb5a7b984b1dd5b05d7 Mon Sep 17 00:00:00 2001 From: BrittainJackson7 Date: Thu, 31 Aug 2023 17:18:01 -0700 Subject: [PATCH] Remove debugging and extra code --- .../presentational/FootprintResults.jsx | 9 +-- .../presentational/ResultsAccessories.jsx | 56 +++---------------- .../presentational/SearchAndFilterInput.jsx | 3 - src/components/presentational/Sidebar.jsx | 2 - 4 files changed, 8 insertions(+), 62 deletions(-) diff --git a/src/components/presentational/FootprintResults.jsx b/src/components/presentational/FootprintResults.jsx index ae169e65f..800aa965a 100644 --- a/src/components/presentational/FootprintResults.jsx +++ b/src/components/presentational/FootprintResults.jsx @@ -32,13 +32,6 @@ export default function FootprintResults(props) { const [oldTargetName, setOldTargetName] = React.useState(""); const [oldFilterString, setOldFilterString] = React.useState(""); - /*const [selectedOptionsWithValues, setSelectedOptionsWithValues] = React.useState([]); - - // Function to update selected options and values - const updateSelectedOptions = (selectedOptions) => { - setSelectedOptionsWithValues(selectedOptions); - }; */ - const addFeatures = (newFeatures, key) => { let myFeatureCollections = featureCollections; myFeatureCollections[key].features.push(...newFeatures); @@ -221,7 +214,7 @@ export default function FootprintResults(props) { if(numFeatures > matched) { setNumFeatures(matched); } - + return (
{hasFootprints && diff --git a/src/components/presentational/ResultsAccessories.jsx b/src/components/presentational/ResultsAccessories.jsx index 35a061b40..ce2c5ddd3 100644 --- a/src/components/presentational/ResultsAccessories.jsx +++ b/src/components/presentational/ResultsAccessories.jsx @@ -73,16 +73,13 @@ function determineDatasetType(features) { // Find the key that ends with "id" const idKey = propertyKeys.find(key => key.endsWith("id")); - //console.log(idKey); + if(!idKey) return 'unknown'; // If no id found if(features.stac_extensions) return "stac"; - // Based on the key determine the type + + // Based on the key determine the type(in case we need to specify in the future) switch(idKey) { - case "productid": - return "hirise"; - case "pdsvolid": - return "hirise" default: return 'unknown'; } @@ -113,22 +110,17 @@ export function FootprintCard(props){ //initialize variables let ThumbnailLink = ''; - let modifiedProductId = ''; let BrowserLink = ''; let showMetadata; let stacAPIFlag = false; let pyGeoAPIFlag = false; - const { selectedOptionsWithValues } = props; - // Metadata Popup const geoTiffViewer = new GeoTiffViewer("GeoTiffAsset"); //determine feature type const featureType = determineDatasetType(props.feature); - //console.log("Dataset type is:", featureType); //debugging - //console.log(props.feature); //debugging //check for feature type in order to gather correct meta data switch(featureType) { @@ -140,7 +132,6 @@ export function FootprintCard(props){ // set boolean stacAPIFlag = true; - // display meta data for STAC api showMetadata = (value) => () => { geoTiffViewer.displayGeoTiff(value.assets.thumbnail.href); @@ -152,30 +143,9 @@ export function FootprintCard(props){ ); geoTiffViewer.openModal(); }; + break; - case "hirise": - // Switch the id and date and link - // props.feature.id = props.feature.properties.productid; - //props.feature.properties.datetime = props.feature.properties.createdate; - //modifiedProductId = props.feature.id.replace(/_RED|_COLOR/g, ''); - //ThumbnailLink = 'https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/ESP/ORB_012600_012699/' + modifiedProductId + '/' + props.feature.id + '.thumb.jpg'; - //BrowserLink = props.feature.properties.produrl; - - // set boolean - pyGeoAPIFlag = true; - //display different modal for PyGeo API - showMetadata = (value) => () => { - //geoTiffViewer.displayGeoTiff(ThumbnailLink); - geoTiffViewer.changeMetaData( - value.properties.datasetid, - value.properties.productid, - value.properties.datetime, - value.links - ); - geoTiffViewer.openModal(); - }; - break; default: pyGeoAPIFlag = true; //display different modal for PyGeo API @@ -187,15 +157,11 @@ export function FootprintCard(props){ value.properties.datetime, value.links ); - } - break; - - } - - + }; - + break; + }; const cardClick = () => { window.postMessage(["zoomFootprint", props.feature], "*"); @@ -247,14 +213,6 @@ export function FootprintCard(props){ ID: {props.feature.id}
- {/*} - */} {props.feature?.properties && Object.entries(props.feature.properties).map(([key, value]) => { // Check if the key exists in the selected queryables diff --git a/src/components/presentational/SearchAndFilterInput.jsx b/src/components/presentational/SearchAndFilterInput.jsx index 1c61af4ee..34b7cb25c 100644 --- a/src/components/presentational/SearchAndFilterInput.jsx +++ b/src/components/presentational/SearchAndFilterInput.jsx @@ -158,13 +158,10 @@ export default function SearchAndFilterInput(props) { // retrieves all PyGEO collections const isInPyAPI = collection.filter(data => data.hasOwnProperty('itemType')); - //console.log(isInPyAPI); // finds and assigns the selected collection from the PYGEO api const selectedCollection = isInPyAPI.find(data => data.title === props.selectedTitle); - //console.log(selectedCollection); - // retrieves all pyGEO titles const collectionTitles = isInPyAPI.map(data => data.title); diff --git a/src/components/presentational/Sidebar.jsx b/src/components/presentational/Sidebar.jsx index d8a6fe5ce..d362dd990 100644 --- a/src/components/presentational/Sidebar.jsx +++ b/src/components/presentational/Sidebar.jsx @@ -56,10 +56,8 @@ export default function Sidebar(props) { // Callback to update selected queryables const UpdateQueryableTitles = (selectedQueryables) => { - updatedQueryableTitles = selectedQueryables; setUpdatedQueryableTitles(selectedQueryables) - console.log("Selected Queryables: ", selectedQueryables); } return ( <> -- GitLab