From 94f700ffbbd470b5353d00de6d7bb1747b2d62e0 Mon Sep 17 00:00:00 2001 From: David Tsay <3614296+davetsay@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:29:53 -0800 Subject: [PATCH] Fix local storage filtering overriding historical session filtering set by url (#235) Co-authored-by: Jamie V. --- src/historical/HistoricalProvider.js | 10 ++--- src/historical/HistoricalProviderSpec.js | 2 +- .../indicator/historicalSessionIndicator.vue | 34 ++++++++-------- .../historicalSessionSelector.vue | 26 ++++++------- .../session/SessionLocalStorageHandler.js | 35 +++++++++-------- src/services/session/SessionService.js | 39 ++++++++----------- src/services/session/SessionURLHandler.js | 37 +++++++++--------- .../test/service/SessionServiceSpec.js | 8 ++-- src/venues/VenueService.js | 4 +- 9 files changed, 95 insertions(+), 100 deletions(-) diff --git a/src/historical/HistoricalProvider.js b/src/historical/HistoricalProvider.js index 195e60b..ae378cc 100644 --- a/src/historical/HistoricalProvider.js +++ b/src/historical/HistoricalProvider.js @@ -517,11 +517,11 @@ define([ } const sessions = this.getSessionService(); - const session = sessions.getHistoricalSession(); + const sessionFilter = sessions.getHistoricalSessionFilter(); - if (session) { - params.filter.session_id = '(' + session.numbers.join(',') + ')'; - params.filter.session_host = session.host; + if (sessionFilter) { + params.filter.session_id = `(${sessionFilter.numbers.join(',')})`; + params.filter.session_host = sessionFilter.host; } else if (window.openmctMCWSConfig?.sessions?.historicalSessionFilter?.disable !== true && window.openmctMCWSConfig?.sessions?.historicalSessionFilter?.denyUnfilteredQueries === true) { const notificationMessage = 'Filtering by historical sessions is required for historical queries.'; @@ -531,7 +531,7 @@ define([ } if (this.isUnsupportedDomain(provider, options)) { - const message = !session + const message = !sessionFilter ? `This view requires a session or supported time system for historical requests.` : `This view does not support ${options.domain}. Historical data might not match the time system.`; diff --git a/src/historical/HistoricalProviderSpec.js b/src/historical/HistoricalProviderSpec.js index 06b895b..9d30ff0 100644 --- a/src/historical/HistoricalProviderSpec.js +++ b/src/historical/HistoricalProviderSpec.js @@ -31,7 +31,7 @@ describe('Historical Provider', function () { }); mockSessionService = jasmine.createSpyObj('SessionService', [ - 'getHistoricalSession' + 'getHistoricalSessionFilter' ]); spyOn(HistoricalProvider.prototype, 'getSessionService').and.returnValue(mockSessionService); diff --git a/src/multipleHistoricalSessions/indicator/historicalSessionIndicator.vue b/src/multipleHistoricalSessions/indicator/historicalSessionIndicator.vue index 8b23314..ec98d86 100644 --- a/src/multipleHistoricalSessions/indicator/historicalSessionIndicator.vue +++ b/src/multipleHistoricalSessions/indicator/historicalSessionIndicator.vue @@ -3,12 +3,12 @@
@@ -24,7 +24,7 @@