Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/hitide UI 44 #57

Merged
merged 10 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ jobs:
run: |
npm install
npm run build

- name: Make Config Files
run: |
cat ./configs/hitideConfig-${{ env.THE_ENV }}.js > ./dist/hitideConfig.js

## Deployment
- name: Deploy Env Override
Expand All @@ -206,6 +202,10 @@ jobs:
echo "THE_ENV=${override_env}" >> $GITHUB_ENV
echo "TARGET_ENV_UPPERCASE=${override_env_upper}" >> $GITHUB_ENV

- name: Make Config Files
run: |
cat ./configs/hitideConfig-${{ env.THE_ENV }}.js > ./dist/hitideConfig.js

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- issue-48: Fixed collection resolution error handling
- issue-49: Removed unused Docker and Jenkins folders/files from HiTIDE-UI
- issue-52: Fixed missing thumbnail placeholder
- issue-44: Fixed footprints and previews stay on map when not intended


## [4.16.2]
Expand Down
31 changes: 26 additions & 5 deletions src/jpl/dijit/GranulesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ define([
postGranulesFetch: function(response) {
this.availableGranules = response.hits;
var _context = this;

response.items.map(function(x) {
GranuleMetadata.convertFootprintAndImageFromCMR(x);
var granule_id = x["meta"]["concept-id"];
Expand All @@ -766,6 +767,19 @@ define([
_context.gridStore.add(x)
});

// remove footprints and preview from displaying on the map if they are not in the current page of the granule table
var currentlyVisibleFootprints = {}
var currentlyVisiblePreviews = {}

for (var i=0; i<this.stateStore.data.length; i++) {
var currentVisibleGranule = this.stateStore.data[i]
if (currentVisibleGranule.footprint) currentlyVisibleFootprints[currentVisibleGranule["Granule-Name"]] = currentVisibleGranule
if (currentVisibleGranule.preview) currentlyVisiblePreviews[currentVisibleGranule["Granule-Name"]] = currentVisibleGranule
}

_context.toggleFootprints(Object.values(currentlyVisibleFootprints), false, true)
_context.togglePreviews(Object.values(currentlyVisiblePreviews), false, true)

this.granulesInGrid = this.gridStore.query().length;

// Set no data message accordingly
Expand Down Expand Up @@ -857,7 +871,6 @@ define([
}
return value.toISOString().slice(0, 16);
},

updateStateStoreObj: function(obj) {
// If obj has no active states, remove it else upsert
if (!obj.footprint && !obj.preview) {
Expand Down Expand Up @@ -906,15 +919,19 @@ define([
}
},

toggleFootprints: function(granuleObjs, active) {
toggleFootprints: function(granuleObjs, active, inStoreAlready) {
// if obj already in grid store, update and don't put
inStoreAlready = inStoreAlready || false
for (var i = 0; i < granuleObjs.length; i++) {
// Update store
var obj = granuleObjs[i];

if (obj.footprint != active) {
if(obj["Granule-Footprint"]){
obj.footprint = active;
this.gridStore.put(obj);
if (!inStoreAlready) {
this.gridStore.put(obj);
}
this.updateStateStoreObj(obj);

// Update fp
Expand All @@ -925,14 +942,18 @@ define([
}
},

togglePreviews: function(granuleObjs, active) {
togglePreviews: function(granuleObjs, active, inStoreAlready) {
// if obj already in grid store, update and don't put
inStoreAlready = inStoreAlready || false
for (var i = 0; i < granuleObjs.length; i++) {
// Update store
var obj = granuleObjs[i];
if (obj.preview != active) {
if(obj.has_image){
obj.preview = active;
this.gridStore.put(obj);
if (!inStoreAlready) {
this.gridStore.put(obj);
}
this.updateStateStoreObj(obj);

// Update preview
Expand Down
Loading