Skip to content

Commit

Permalink
Merge pull request #12 from podaac/release/4.15.0
Browse files Browse the repository at this point in the history
Release 4.15.0
  • Loading branch information
jamesfwood authored Jul 19, 2023
2 parents 680bb9d + 0b763c6 commit e4ae4c1
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 47 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
git push origin "${{ env.THE_VERSION }}" --force
- name: Publish UMM-T with new version
uses: podaac/cmr-umm-updater@0.4.0
uses: podaac/cmr-umm-updater@0.5.0
if: |
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release')
Expand All @@ -172,6 +172,7 @@ jobs:
timeout: 60
disable_removal: 'true'
umm_type: 'umm-t'
use_associations: 'false'
env:
LAUNCHPAD_TOKEN_SIT: ${{secrets.LAUNCHPAD_TOKEN_SIT}}
LAUNCHPAD_TOKEN_UAT: ${{secrets.LAUNCHPAD_TOKEN_UAT}}
Expand All @@ -193,6 +194,17 @@ jobs:
cat ./configs/hitideConfig-${{ env.THE_ENV }}.js > ./dist/hitideConfig.js
## Deployment
- name: Deploy Env Override
if: |
github.event.head_commit.message == '/deploy sit' ||
github.event.head_commit.message == '/deploy uat'
run: |
message="${{ github.event.head_commit.message }}"
trimmed_message=${message:1} # Remove leading slash
override_env=$(echo "$trimmed_message" | grep -oE '[^[:space:]]+$')
override_env_upper=$(echo "$trimmed_message" | awk '{print toupper($NF)}')
echo "THE_ENV=${override_env}" >> $GITHUB_ENV
echo "TARGET_ENV_UPPERCASE=${override_env_upper}" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -206,6 +218,8 @@ jobs:
if: |
github.ref == 'refs/heads/develop' ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release')
startsWith(github.ref, 'refs/heads/release') ||
github.event.head_commit.message == '/deploy sit' ||
github.event.head_commit.message == '/deploy uat'
run:
aws s3 sync ./dist s3://podaac-services-${{ env.THE_ENV}}-hitide --exclude dataset-configs/* --exclude palettes/* --delete
aws s3 sync ./dist s3://podaac-services-${{ env.THE_ENV }}-hitide --exclude dataset-configs/* --exclude palettes/* --delete
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed


## [4.15.0]
### Added
- issue-17: Add way to read config files to allow for multiple lat lon for variables images.
- Add in commit message triggers
### Changed
### Removed
### Fixed
- PODAAC-5547: Replace spaces " " in group names to use "_" to work with tig with png names with "_" (replacing spaces)
- Update footprint to allow drawing of polygons with holes
- PODAAC-5326: Fixed 'Add matching granules to download' button

## [4.14.0]
### Added
- Moved repo to https://github.com/podaac/hitide-ui
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@gov.nasa.jpl.podaac/hitide-ui",
"title": "HiTIDE",
"description": "High Level Tool for Interactive Data Extraction",
"version": "4.14.0",
"version": "4.15.0-rc.8",
"scripts": {
"build": "grunt --force; npm run copy",
"copy": "node scripts/copy-files.js",
Expand Down
3 changes: 1 addition & 2 deletions src/hitideConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ function calculateCmrGraphqlUrl(cmrBase, hitideProfileBase) {
cmrBase.includes("sit") ? "https://graphql.sit.earthdata.nasa.gov/api" :
"https://graphql.earthdata.nasa.gov/api"
);
}

}
154 changes: 119 additions & 35 deletions src/jpl/dijit/GranulesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ define([
itemsPerPage: 25,
currentSolrIdx: 0,
availableGranules: 0,
granuleNames: [],
granulesInGrid: 0,
_granuleSearchInProgress: false,
loadingGranulesMessage: '<div class="granulesControllerLoadingGranulesMessage">Loading Granules...</div>',
Expand Down Expand Up @@ -125,8 +126,8 @@ define([
};
topic.publish(GranuleSelectionEvent.prototype.VARIABLES_FETCHED, message);
});

// set up button listener
// // set up button listener
on(this.addMatchingBtn, "click", lang.hitch(this, this.handleDownloadMatching));
on(this.matchingAddedMessageUndo, "click", lang.hitch(this, this.removeMatchingDownload));

Expand Down Expand Up @@ -620,17 +621,127 @@ define([
this._eventListeners.push(topic.subscribe(DownloadsEvent.prototype.JOB_SUBMITTED, lang.hitch(this, this.resetHandleDownloadMatchingBtn)))
this._eventListeners.push(topic.subscribe(MyDataEvent.prototype.REMOVE_DOWNLOAD_QUERY_NOTIFY, lang.hitch(this, this.handleRemoveDownloadQueryNotify)))
this._eventListeners.push(topic.subscribe(MapEvent.prototype.MAP_INITIALIZED, lang.hitch(this, this.mapInitialized)));

},

displayLoadingSpinner: function(display) {
domStyle.set(this.granulesControllerLoadingSpinner, "visibility", (display ? "visible" : "hidden"));
},

fetchGranules: function() {
fetchGranulesNames: function() {
// Set searching flag to true
this._granuleSearchInProgress = true;

var withCredentials = false;

var url;
if(this.source === "cmr"){

var sort
if(this.granuleGrid._sort[0].attribute == "Granule-StartTime"){
sort = "start_date";
}
else if(this.granuleGrid._sort[0].attribute == "Granule-StopTime"){
sort = "end_date";
}
else if(this.granuleGrid._sort[0].attribute == "Granule-Name"){
sort = "readable_granule_name";
}

url = this.config.hitide.externalConfigurables.cmrGranuleSearchService + "?";
url += "collection_concept_id=" + this.datasetId;
url += "&bounding_box[]=" + (this.bbox || "");
// limit is ~2000 for page size
url += "&page_size=" + this.availableGranules;
url += "&offset=" + this.currentSolrIdx;
url += "&temporal[]=" + DOMUtil.prototype.dateFormatISOBeginningOfDay(this.startDateWidget.get("value")) + "," + DOMUtil.prototype.dateFormatISOEndOfDay(this.endDateWidget.get("value"));
url += "&sort_key[]=" + (this.granuleGrid._sort[0].descending ? "-" : "%2B") + sort

if(this.nameFilterBox.get("value")){
url += "&native_id[]=" + this.nameFilterBox.get("value") + "&options[native_id][pattern]=true";
}

withCredentials = this.config.hitide.externalConfigurables.crossOriginCmrCookies;
}
else{
url = this.config.hitide.externalConfigurables.granuleSearchService + "?";
url += "datasetId=" + this.datasetId;
url += "&startTime=" + DOMUtil.prototype.dateFormatISOBeginningOfDay(this.startDateWidget.get("value"));
url += "&endTime=" + DOMUtil.prototype.dateFormatISOEndOfDay(this.endDateWidget.get("value"));
url += "&name=" + this.nameFilterBox.get("value");
url += "&bbox=" + (this.bbox || "");
url += "&itemsPerPage=" + this.availableGranules;
url += "&startIndex=" + this.currentSolrIdx;
url += "&sort=" + this.granuleGrid._sort[0].attribute + (this.granuleGrid._sort[0].descending ? " desc" : " asc");
}

var _context = this;
var r;
var topicHandler = topic.subscribe(SearchEvent.prototype.CANCEL_REQUESTS, function(message) {
if (message.target === "*" || message.target === this.datasetId) {
r.cancel();
}
});
r = xhr.get(url, {
headers: {
"X-Requested-With": null
},
handleAs: "json",
method: "get",
withCredentials: withCredentials
}).then(function(response) {
// Unsubscribe from cancel requests
topicHandler.remove();
// Update accordingly
if (_context.domNode) {
var granuleNamesToReturn
if (_context.source === 'cmr') {
granuleNamesToReturn = response.items.map(function(granuleObj) {
return granuleObj["meta"]["native-id"];
});
} else {
granuleNamesToReturn = response.response.docs.map(function(granuleObj) {
return granuleObj['Granule-Name']
})
}
var startDate = moment.utc(_context.startDateWidget.getValue());
var endDate = moment.utc(_context.endDateWidget.getValue());
var queryId = Math.floor(Math.random() * (9999999999 - 0)) + 0;
var downloadQuery = {
datasetId: _context.datasetId,
datasetShortName: _context.datasetShortName,
startDate: startDate.format("YYYY/MM/DD"),
endDate: endDate.format("YYYY/MM/DD"),
numSelected: _context.availableGranules,
bbox: _context.bbox.toString(),
notifyOnRemove: true,
variables: _context.datasetVariables,
granuleNames: granuleNamesToReturn,
granuleNamesFilter: _context.nameFilterBox.value,
queryId: queryId
};
/* add source: 'cmr' if appropriate */
if(_context.source === 'cmr')
downloadQuery.source = 'cmr';
topic.publish(MyDataEvent.prototype.ADD_DOWNLOAD_QUERY, downloadQuery);
_context.queryId = queryId;
domStyle.set(_context.addMatchingBtn, "display", "none");
domStyle.set(_context.matchingAddedMessage, "display", "block");
}
}, function(err) {
// Unsubscribe from cancel requests
topicHandler.remove();
console.log("ERROR", err);
// Set searching flag to false
_context._granuleSearchInProgress = false;

// Show spinner
_context.displayLoadingSpinner(false);
});
},

fetchGranules: function() {
// Set searching flag to true
this._granuleSearchInProgress = true;
// Show spinner
this.displayLoadingSpinner(true);

Expand Down Expand Up @@ -658,7 +769,6 @@ define([
url += "&temporal[]=" + DOMUtil.prototype.dateFormatISOBeginningOfDay(this.startDateWidget.get("value")) + "," + DOMUtil.prototype.dateFormatISOEndOfDay(this.endDateWidget.get("value"));
url += "&sort_key[]=" + (this.granuleGrid._sort[0].descending ? "-" : "%2B") + sort

console.log(url);
if(this.nameFilterBox.get("value")){
url += "&native_id[]=" + this.nameFilterBox.get("value") + "&options[native_id][pattern]=true";
}
Expand Down Expand Up @@ -719,16 +829,13 @@ define([
// }).startup();
});
},


postGranulesFetch: function(response) {
if(this.source === "cmr"){
this.availableGranules = response.hits;
var _context = this;
response.items.map(function(x) {

GranuleMetadata.convertFootprintAndImageFromCMR(x);

var granule_id = x["meta"]["concept-id"];
var fpState = _context.stateStore.get(granule_id);
var previewState = _context.stateStore.get(granule_id);
Expand All @@ -751,11 +858,9 @@ define([
this.availableGranules = response.response.numFound;
var _context = this;
response.response.docs.map(function(x) {

// MapUtil and Terraformer don't properly handle granule footprints or extents
// when they are ENVELOPE type. So, convert all ENVELOPE strings to POLYGON strings.
GranuleMetadata.convertFootprintsAndExtentsFromEnvelopeToPolygon(x);

// Add extra fields to response docs
// Check for state in stateStore
var fpState = _context.stateStore.get(x["Granule-Id"]);
Expand Down Expand Up @@ -1037,30 +1142,10 @@ define([
"matching granules is less than the specified limit."
}).startup();
} else {
var startDate = moment.utc(this.startDateWidget.getValue());
var endDate = moment.utc(this.endDateWidget.getValue());
var queryId = Math.floor(Math.random() * (9999999999 - 0)) + 0;
var downloadQuery = {
datasetId: this.datasetId,
datasetShortName: this.datasetShortName,
startDate: startDate.format("YYYY/MM/DD"),
endDate: endDate.format("YYYY/MM/DD"),
numSelected: this.availableGranules,
bbox: this.bbox.toString(),
notifyOnRemove: true,
variables: this.datasetVariables,
granuleNames: [],
granuleNamesFilter: this.nameFilterBox.value,
queryId: queryId
};
/* add source: 'cmr' if appropriate */
if(this.source === 'cmr')
downloadQuery.source = 'cmr';

topic.publish(MyDataEvent.prototype.ADD_DOWNLOAD_QUERY, downloadQuery);
this.queryId = queryId;
domStyle.set(this.addMatchingBtn, "display", "none");
domStyle.set(this.matchingAddedMessage, "display", "block");
//
var _context = this
// get the granule names and add download query
_context.fetchGranulesNames()
}
},

Expand Down Expand Up @@ -1096,7 +1181,6 @@ define([
}
});


// Alert user if > max granule downloads and block
if (granuleNameIds.length > this.config.hitide.externalConfigurables.maxGranulesPerDownload) {
new AlertDialog({
Expand Down
2 changes: 1 addition & 1 deletion src/jpl/dijit/LayerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ define([
});

function calculateImageFilename(granuleName, variableName) {
var variableNameWithDots = variableName.replaceAll('/', '.');
var variableNameWithDots = variableName.replaceAll('/', '.').replaceAll(' ', '_');
if (variableNameWithDots[0] !== '.') {
variableNameWithDots = '.' + variableNameWithDots;
}
Expand Down
20 changes: 18 additions & 2 deletions src/jpl/dijit/LegendsAndOpacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,24 @@ define([
this.open = false;
},
handleVariablesFetched: function(message) {
if (this.datasets[message.datasetId]) {
this.datasets[message.datasetId].updateVariables(message.imgVariables);
if('multi_lon_lat' in message){
var new_variables = [];
for(var i = 0; i < message.multi_groups.length; i++){
var group_name = message.multi_groups[i];
for(var j = 0; j < message.imgVariables.length; j++){
var image_variable = Object.assign({}, message.imgVariables[j]);
image_variable['id'] = group_name + '/' + image_variable['id'];
new_variables.push(image_variable);
}
}
if (this.datasets[message.datasetId]) {
this.datasets[message.datasetId].updateVariables(new_variables);
}
}
else{
if (this.datasets[message.datasetId]) {
this.datasets[message.datasetId].updateVariables(message.imgVariables);
}
}
},
handleAddGranuleFootprint: function(message) {
Expand Down
9 changes: 9 additions & 0 deletions src/jpl/dijit/templates/HelpDialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ <h5 class="help-brandVersion" data-dojo-attach-point="hitideVersion">version #.#
<a style="font-weight: 500" href="https://podaac.jpl.nasa.gov/HITIDE_feedback" target="_blank">podaac.jpl.nasa.gov/HITIDE_feedback</a>
</div>
<div class="help-container help-container-hidden" id="helpReleaseNotesContent">
<div>
<div class="helpReleaseNotesVersionTitle">
<b>Version 4.15.0</b> (7/18/2023)
</div>
<ul>
<li><span class="releaseNotesTag releaseNotesTagFixed">Fixed</span> Button "Add Matching X Granules To Downloads" now works properly.</li>
<li><span class="releaseNotesTag releaseNotesTagFixed">Fixed</span> Various collection bug fixes.</li>
</ul>
</div>
<div>
<div class="helpReleaseNotesVersionTitle">
<b>Version 4.14.0</b> (5/10/2023)
Expand Down
Loading

0 comments on commit e4ae4c1

Please sign in to comment.