cherry-pick(#6929): Condition sets now provide the timeContext they're using when sending requests (#6959)

cherry-pick(6929): Condition sets now provide the timeContext they're using when sending requests (#6929)

* Send in the timeContext for requests

* Fix failing test

---------

Co-authored-by: Scott Bell <scott@traclabs.com>
This commit is contained in:
Shefali Joshi 2023-08-21 11:31:15 -07:00 committed by GitHub
parent 2002396d0e
commit c3ac07ebaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -201,9 +201,11 @@ export default class AllTelemetryCriterion extends TelemetryCriterion {
} }
requestLAD(telemetryObjects, requestOptions) { requestLAD(telemetryObjects, requestOptions) {
//We pass in the global time context here
let options = { let options = {
strategy: 'latest', strategy: 'latest',
size: 1 size: 1,
timeContext: this.openmct.time.getContextForView([])
}; };
if (requestOptions !== undefined) { if (requestOptions !== undefined) {

View File

@ -189,9 +189,11 @@ export default class TelemetryCriterion extends EventEmitter {
} }
requestLAD(telemetryObjects, requestOptions) { requestLAD(telemetryObjects, requestOptions) {
//We pass in the global time context here
let options = { let options = {
strategy: 'latest', strategy: 'latest',
size: 1 size: 1,
timeContext: this.openmct.time.getContextForView([])
}; };
if (requestOptions !== undefined) { if (requestOptions !== undefined) {

View File

@ -83,13 +83,19 @@ describe('The telemetry criterion', function () {
}); });
openmct.telemetry.getMetadata.and.returnValue(testTelemetryObject.telemetry); openmct.telemetry.getMetadata.and.returnValue(testTelemetryObject.telemetry);
openmct.time = jasmine.createSpyObj('timeAPI', ['timeSystem', 'bounds', 'getAllTimeSystems']); openmct.time = jasmine.createSpyObj('timeAPI', [
'timeSystem',
'bounds',
'getAllTimeSystems',
'getContextForView'
]);
openmct.time.timeSystem.and.returnValue({ key: 'system' }); openmct.time.timeSystem.and.returnValue({ key: 'system' });
openmct.time.bounds.and.returnValue({ openmct.time.bounds.and.returnValue({
start: 0, start: 0,
end: 1 end: 1
}); });
openmct.time.getAllTimeSystems.and.returnValue([{ key: 'system' }]); openmct.time.getAllTimeSystems.and.returnValue([{ key: 'system' }]);
openmct.time.getContextForView.and.returnValue({});
testCriterionDefinition = { testCriterionDefinition = {
id: 'test-criterion-id', id: 'test-criterion-id',