Skip to content

Commit

Permalink
feature/hitide-ui-65: fixed thumbnails and footprints disappearing (#73)
Browse files Browse the repository at this point in the history
* feature/hitide-ui-65: fixed thumbnails and footprints disappearing

---------

Co-authored-by: jbyrne <[email protected]>
  • Loading branch information
jbyrne6 and jbyrne committed Jul 11, 2024
1 parent 3bd63e7 commit ba9ae82
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
### Removed
### Fixed
- issue-65: Fixed footprints and previews disappearing from map when not intended


## [4.17.1]
Expand Down
5 changes: 3 additions & 2 deletions src/hitideConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var hitideProfileOrigin = "https://hitide.profile.podaac.uat.earthdatacloud.nasa.gov/hitide/api";
// var hitideProfileOrigin = "http://localhost:8080/hitide/api";

window.hitideConfig = {
paletteService: "https://hitide.podaac.earthdatacloud.nasa.gov/palettes",
Expand All @@ -10,7 +11,7 @@ window.hitideConfig = {
cmrVariableService: hitideProfileOrigin + "/cmr/graphql",
crossOriginCmrCookies: true,

authCodeUrl: "https://uat.urs.earthdata.nasa.gov/oauth/authorize",
authCodeUrl: "https://urs.earthdata.nasa.gov/oauth/authorize",

loginUrl: hitideProfileOrigin + "/session/login",
logoutUrl: hitideProfileOrigin + "/session/logout",
Expand All @@ -24,5 +25,5 @@ window.hitideConfig = {
datasetSearchServiceItemsPerPage: 200,
maxGranulesPerDownload: 999999999,
googleTagManagerId: "GTM-M5D83V6",
earthDataAppClientId: "dxpH2WeN_f8IpNLgHwplsg"
earthDataAppClientId: "mn6VmRfej3U2Tm0UhbC1jw"
};
24 changes: 16 additions & 8 deletions src/jpl/dijit/GranulesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ define([
_granuleSearchInProgress: false,
loadingGranulesMessage: '<div class="granulesControllerLoadingGranulesMessage">Loading Granules...</div>',
noGranulesMessage: '<div class="granulesControllerNoDataMessage">No Granules Found</div>',
scrollLoadInProgress: false,

constructor: function() {
this.datasetVariables = {};
Expand Down Expand Up @@ -757,14 +758,17 @@ define([
stateStoreItemsToRemove.push((currentStateStore[j]))
}
}
for(var k=0; k<stateStoreItemsToRemove.length; k++) {
_context.stateStore.remove(stateStoreItemsToRemove[k]["Granule-Id"])
topic.publish(GranuleSelectionEvent.prototype.REMOVE_GRANULE_FOOTPRINT, {
granuleObj: stateStoreItemsToRemove[k]
});
topic.publish(GranuleSelectionEvent.prototype.REMOVE_GRANULE_PREVIEW, {
granuleObj: stateStoreItemsToRemove[k]
});
// if scroll, don't remove
if(!this.scrollLoadInProgress) {
for(var k=0; k<stateStoreItemsToRemove.length; k++) {
_context.stateStore.remove(stateStoreItemsToRemove[k]["Granule-Id"])
topic.publish(GranuleSelectionEvent.prototype.REMOVE_GRANULE_FOOTPRINT, {
granuleObj: stateStoreItemsToRemove[k]
});
topic.publish(GranuleSelectionEvent.prototype.REMOVE_GRANULE_PREVIEW, {
granuleObj: stateStoreItemsToRemove[k]
});
}
}
// clear anything from state store that is not a concept id in the response items
response.items.map(function(x) {
Expand Down Expand Up @@ -838,6 +842,9 @@ define([
// Show spinner
this.displayLoadingSpinner(false);

// set scroll back to false
this.scrollLoadInProgress = false;

},

filterGranules: function() {
Expand Down Expand Up @@ -892,6 +899,7 @@ define([
// First approach, fetch more if scroll pos is 90% of way down
if ((scrollPosTop + offsetHeight) / scrollHeight > 0.90) {
this.currentSolrIdx += this.itemsPerPage;
this.scrollLoadInProgress = true;
this.fetchGranules();
}
},
Expand Down

0 comments on commit ba9ae82

Please sign in to comment.