From b043f26e49a4a96482b60387351947449c52f70b Mon Sep 17 00:00:00 2001 From: Shefali Joshi Date: Mon, 21 Aug 2023 17:45:55 -0700 Subject: [PATCH] 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) --- src/plugins/autoflow/AutoflowTabularRowController.js | 7 ++++++- src/plugins/gauge/components/Gauge.vue | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/autoflow/AutoflowTabularRowController.js b/src/plugins/autoflow/AutoflowTabularRowController.js index 77042d20f3..4b8fda76ba 100644 --- a/src/plugins/autoflow/AutoflowTabularRowController.js +++ b/src/plugins/autoflow/AutoflowTabularRowController.js @@ -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]); diff --git a/src/plugins/gauge/components/Gauge.vue b/src/plugins/gauge/components/Gauge.vue index 989f51eaf9..d54128eba1 100644 --- a/src/plugins/gauge/components/Gauge.vue +++ b/src/plugins/gauge/components/Gauge.vue @@ -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]); });