cherry-pick(#6960): Add strategy latest and timeContext to auto flow tabular and gauge views (#6981)

cherry-pick(#6960): Add strategy latest and timeContext to auto flow tabular and gauge views (#6960)
This commit is contained in:
Shefali Joshi 2023-08-21 17:45:55 -07:00 committed by GitHub
parent 856d88597e
commit b043f26e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -68,7 +68,12 @@ define([], function () {
this.updateRowData.bind(this)
);
this.openmct.telemetry.request(this.domainObject, { size: 1 }).then(
const options = {
size: 1,
strategy: 'latest',
timeContext: this.openmct.time.getContextForView([])
};
this.openmct.telemetry.request(this.domainObject, options).then(
function (history) {
if (!this.initialized && history.length > 0) {
this.updateRowData(history[history.length - 1]);

View File

@ -638,7 +638,11 @@ export default {
this.valueKey = this.metadata.valuesForHints(['range'])[0].source;
this.openmct.telemetry.request(domainObject, { strategy: 'latest' }).then((values) => {
const options = {
strategy: 'latest',
timeContext: this.openmct.time.getContextForView([])
};
this.openmct.telemetry.request(domainObject, options).then((values) => {
const length = values.length;
this.updateValue(values[length - 1]);
});