Skip to content

Commit

Permalink
Merge branch 'development' into feature_consolidate_middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Jan 19, 2024
2 parents 469cf70 + f8879eb commit 9feb861
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
12 changes: 4 additions & 8 deletions meteor_packages/mats-common/imports/startup/api/matsMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,8 @@ const _checkMetaDataRefresh = async function () {
if (refresh === true) {
// refresh the app metadata
// app specific routines
// const asrKeys = Object.keys(appSpecificResetRoutines);
const asrKeys = appSpecificResetRoutines;
for (let ai = 0; ai < asrKeys.length; ai++) {
global.appSpecificResetRoutines[ai]();
for (let ai = 0; ai < appSpecificResetRoutines.length; ai += 1) {
await global.appSpecificResetRoutines[ai]();
}
// remember that we updated ALL the metadata tables just now
metaDataTableUpdates.update(
Expand Down Expand Up @@ -3630,10 +3628,8 @@ const resetApp = async function (appRef) {
}
}
// invoke the app specific routines
// const asrKeys = Object.keys(appSpecificResetRoutines);
const asrKeys = appSpecificResetRoutines;
for (let ai = 0; ai < asrKeys.length; ai++) {
global.appSpecificResetRoutines[ai]();
for (let ai = 0; ai < appSpecificResetRoutines.length; ai += 1) {
await global.appSpecificResetRoutines[ai]();
}
matsCache.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,17 @@ class CBUtilities {

queryCB = async (statement) => {
const couchbase = require("couchbase");
const Future = require("fibers/future");
try {
let result;
const conn = await this.getConnection();
const result = await conn.cluster.query(statement);
const dFuture = new Future();
(async () => {
result = await conn.cluster.query(statement);
// done waiting - have results
dFuture.return();
})();
dFuture.wait();
return result.rows;
} catch (err) {
return `queryCB ERROR: ${err}`;
Expand Down
12 changes: 8 additions & 4 deletions meteor_packages/mats-common/lib/param_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const setValueTextForParamName = function (paramName, text) {
document.getElementById(`${paramName}-dateRange`) !== undefined &&
document.getElementById(`${paramName}-dateRange`) !== null
) {
delete document.getElementById(`${paramName}-dateRange`).value;
document.getElementById(`${paramName}-dateRange`).value = text;
}
} catch (error) {
Expand Down Expand Up @@ -433,7 +434,10 @@ const getDefaultDateRange = function (name) {
typeof dateParam.stopDate === "string"
? dateParam.stopDate
: moment.utc(dateParam.stopDate).locale("en").format("MM/DD/YYYY HH:mm");
const dstr = dateParam.default;
const dstr =
typeof dateParam.default === "string"
? dateParam.default
: `${startInit} - ${stopInit}`;
return { startDate: startInit, stopDate: stopInit, dstr };
};

Expand Down Expand Up @@ -470,7 +474,7 @@ const setAllParamsToDefault = function () {
} else if (param !== undefined && param.superiorNames !== undefined) {
dependents.push(param);
// everything else
} else {
} else if (param !== undefined) {
params.push(param);
}
}
Expand Down Expand Up @@ -511,7 +515,7 @@ const setAllParamsToDefault = function () {
},
});
targetElem.dispatchEvent(resetMapEvent);
} else {
} else if (param !== undefined) {
setDefaultForParamName(param);
}
});
Expand All @@ -521,7 +525,7 @@ const setAllParamsToDefault = function () {
if (param !== undefined && param.type === matsTypes.InputTypes.dateRange) {
const { dstr } = getDefaultDateRange(param.name);
setValueTextForParamName(param.name, dstr);
} else {
} else if (param !== undefined) {
setDefaultForParamName(param);
}
});
Expand Down
9 changes: 7 additions & 2 deletions meteor_packages/mats-common/public/MATSReleaseNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
<p></p>
<h4>Production build date: <x-cr>Current revision</x-cr></h4>
<p style="margin: 25px 0"></p>
<h4>PUT APP VERSIONS HERE</h4>
<h4>All apps v5.2.2</h4>
<p style="margin: 25px 0"></p>
<p>Changes:</p>
<p>* PUT CHANGES HERE</p>
<p>* METAR app uses improved metadata schema, resulting in speed improvements.</p>
<p>* Additional AMDAR datasets added to upper air app.</p>
<p>
* Possibly fixed the double value string bug that can happen after a metadata
update.
</p>
</div>
<div>
<hr
Expand Down

0 comments on commit 9feb861

Please sign in to comment.