Skip to content

Commit 7bccb73

Browse files
committed
Merge branch 'release/2.0.8' of https://github.com/nasa/openmct into release/2.0.8
2 parents 5a4dd11 + 78df5fc commit 7bccb73

File tree

8 files changed

+144
-36
lines changed

8 files changed

+144
-36
lines changed

e2e/tests/functional/plugins/timeConductor/timeConductor.e2e.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,24 @@ test.describe('Time conductor input fields real-time mode', () => {
147147
expect(page.url()).toContain(`startDelta=${startDelta}`);
148148
expect(page.url()).toContain(`endDelta=${endDelta}`);
149149
});
150+
151+
test.fixme('time conductor history in fixed time mode will track changing start and end times', async ({ page }) => {
152+
// change start time, verify it's tracked in history
153+
// change end time, verify it's tracked in history
154+
});
155+
156+
test.fixme('time conductor history in realtime mode will track changing start and end times', async ({ page }) => {
157+
// change start offset, verify it's tracked in history
158+
// change end offset, verify it's tracked in history
159+
});
160+
161+
test.fixme('time conductor history allows you to set a historical timeframe', async ({ page }) => {
162+
// make sure there are historical history options
163+
// select an option and make sure the time conductor start and end bounds are updated correctly
164+
});
165+
166+
test.fixme('time conductor history allows you to set a realtime offsets', async ({ page }) => {
167+
// make sure there are realtime history options
168+
// select an option and verify the offsets are updated correctly
169+
});
150170
});

e2e/tests/functional/search.e2e.spec.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525

2626
const { test, expect } = require('../../pluginFixtures');
27+
const { createDomainObjectWithDefaults } = require('../../appActions');
28+
const { v4: uuid } = require('uuid');
2729

2830
test.describe('Grand Search', () => {
2931
test('Can search for objects, and subsequent search dropdown behaves properly', async ({ page, openmctConfig }) => {
@@ -112,13 +114,16 @@ test.describe("Search Tests @unstable", () => {
112114
await expect(page.locator('text=No matching results.')).toBeVisible();
113115
});
114116

115-
test('Validate single object in search result', async ({ page }) => {
117+
test('Validate single object in search result @couchdb', async ({ page }) => {
116118
//Go to baseURL
117119
await page.goto("./", { waitUntil: "networkidle" });
118120

119121
// Create a folder object
120-
const folderName = 'testFolder';
121-
await createFolderObject(page, folderName);
122+
const folderName = uuid();
123+
await createDomainObjectWithDefaults(page, {
124+
type: 'folder',
125+
name: folderName
126+
});
122127

123128
// Full search for object
124129
await page.type("input[type=search]", folderName);
@@ -127,7 +132,7 @@ test.describe("Search Tests @unstable", () => {
127132
await waitForSearchCompletion(page);
128133

129134
// Get the search results
130-
const searchResults = await page.locator(searchResultSelector);
135+
const searchResults = page.locator(searchResultSelector);
131136

132137
// Verify that one result is found
133138
expect(await searchResults.count()).toBe(1);

src/api/objects/InMemorySearchProvider.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ class InMemorySearchProvider {
295295
// using structuredClone. Thus we're using JSON.parse/JSON.stringify to discard
296296
// those functions.
297297
const nonMutableDomainObject = JSON.parse(JSON.stringify(newDomainObjectToIndex));
298-
provider.index(nonMutableDomainObject);
298+
299+
const objectProvider = this.openmct.objects.getProvider(nonMutableDomainObject.identifier);
300+
if (objectProvider === undefined || objectProvider.search === undefined) {
301+
provider.index(nonMutableDomainObject);
302+
}
299303
}
300304

301305
onCompositionRemoved(domainObjectToRemoveIdentifier) {

src/plugins/charts/scatter/ScatterPlotView.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ export default {
9797
9898
},
9999
followTimeContext() {
100-
this.timeContext.on('bounds', this.reloadTelemetry);
100+
this.timeContext.on('bounds', this.reloadTelemetryOnBoundsChange);
101101
},
102102
stopFollowingTimeContext() {
103103
if (this.timeContext) {
104-
this.timeContext.off('bounds', this.reloadTelemetry);
104+
this.timeContext.off('bounds', this.reloadTelemetryOnBoundsChange);
105105
}
106106
},
107107
addToComposition(telemetryObject) {
@@ -181,6 +181,11 @@ export default {
181181
this.composition.on('remove', this.removeTelemetryObject);
182182
this.composition.load();
183183
},
184+
reloadTelemetryOnBoundsChange(bounds, isTick) {
185+
if (!isTick) {
186+
this.reloadTelemetry();
187+
}
188+
},
184189
reloadTelemetry() {
185190
this.valuesByTimestamp = {};
186191

src/plugins/timeConductor/ConductorHistory.vue

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
const DEFAULT_DURATION_FORMATTER = 'duration';
4040
const LOCAL_STORAGE_HISTORY_KEY_FIXED = 'tcHistory';
4141
const LOCAL_STORAGE_HISTORY_KEY_REALTIME = 'tcHistoryRealtime';
42-
const DEFAULT_RECORDS = 10;
42+
const DEFAULT_RECORDS_LENGTH = 10;
4343
4444
import { millisecondsToDHMS } from "utils/duration";
4545
import UTCTimeFormat from "../utcTimeSystem/UTCTimeFormat.js";
@@ -79,24 +79,22 @@ export default {
7979
* @timespans {start, end} number representing timestamp
8080
*/
8181
fixedHistory: {},
82-
presets: []
82+
presets: [],
83+
isFixed: this.openmct.time.clock() === undefined
8384
};
8485
},
8586
computed: {
8687
currentHistory() {
8788
return this.mode + 'History';
8889
},
89-
isFixed() {
90-
return this.openmct.time.clock() === undefined;
91-
},
9290
historyForCurrentTimeSystem() {
9391
const history = this[this.currentHistory][this.timeSystem.key];
9492
9593
return history;
9694
},
9795
storageKey() {
9896
let key = LOCAL_STORAGE_HISTORY_KEY_FIXED;
99-
if (this.mode !== 'fixed') {
97+
if (!this.isFixed) {
10098
key = LOCAL_STORAGE_HISTORY_KEY_REALTIME;
10199
}
102100
@@ -108,35 +106,43 @@ export default {
108106
handler() {
109107
// only for fixed time since we track offsets for realtime
110108
if (this.isFixed) {
109+
this.updateMode();
111110
this.addTimespan();
112111
}
113112
},
114113
deep: true
115114
},
116115
offsets: {
117116
handler() {
117+
this.updateMode();
118118
this.addTimespan();
119119
},
120120
deep: true
121121
},
122122
timeSystem: {
123123
handler(ts) {
124+
this.updateMode();
124125
this.loadConfiguration();
125126
this.addTimespan();
126127
},
127128
deep: true
128129
},
129130
mode: function () {
130-
this.getHistoryFromLocalStorage();
131-
this.initializeHistoryIfNoHistory();
131+
this.updateMode();
132132
this.loadConfiguration();
133133
}
134134
},
135135
mounted() {
136+
this.updateMode();
136137
this.getHistoryFromLocalStorage();
137138
this.initializeHistoryIfNoHistory();
138139
},
139140
methods: {
141+
updateMode() {
142+
this.isFixed = this.openmct.time.clock() === undefined;
143+
this.getHistoryFromLocalStorage();
144+
this.initializeHistoryIfNoHistory();
145+
},
140146
getHistoryMenuItems() {
141147
const history = this.historyForCurrentTimeSystem.map(timespan => {
142148
let name;
@@ -203,8 +209,8 @@ export default {
203209
currentHistory = currentHistory.filter(ts => !(ts.start === timespan.start && ts.end === timespan.end));
204210
currentHistory.unshift(timespan); // add to front
205211
206-
if (currentHistory.length > this.records) {
207-
currentHistory.length = this.records;
212+
if (currentHistory.length > this.MAX_RECORDS_LENGTH) {
213+
currentHistory.length = this.MAX_RECORDS_LENGTH;
208214
}
209215
210216
this.$set(this[this.currentHistory], key, currentHistory);
@@ -231,7 +237,7 @@ export default {
231237
.filter(option => option.timeSystem === this.timeSystem.key);
232238
233239
this.presets = this.loadPresets(configurations);
234-
this.records = this.loadRecords(configurations);
240+
this.MAX_RECORDS_LENGTH = this.loadRecords(configurations);
235241
},
236242
loadPresets(configurations) {
237243
const configuration = configurations.find(option => {
@@ -243,9 +249,9 @@ export default {
243249
},
244250
loadRecords(configurations) {
245251
const configuration = configurations.find(option => option.records);
246-
const records = configuration ? configuration.records : DEFAULT_RECORDS;
252+
const maxRecordsLength = configuration ? configuration.records : DEFAULT_RECORDS_LENGTH;
247253
248-
return records;
254+
return maxRecordsLength;
249255
},
250256
formatTime(time) {
251257
let format = this.timeSystem.timeFormat;

src/plugins/timeConductor/pluginSpec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ describe('time conductor', () => {
131131
describe('duration functions', () => {
132132
it('should transform milliseconds to DHMS', () => {
133133
const functionResults = [millisecondsToDHMS(0), millisecondsToDHMS(86400000),
134-
millisecondsToDHMS(129600000), millisecondsToDHMS(661824000)];
135-
const validResults = [' ', '+ 1d', '+ 1d 12h', '+ 7d 15h 50m 24s'];
134+
millisecondsToDHMS(129600000), millisecondsToDHMS(661824000), millisecondsToDHMS(213927028)];
135+
const validResults = [' ', '+ 1d', '+ 1d 12h', '+ 7d 15h 50m 24s', '+ 2d 11h 25m 27s 28ms'];
136136
expect(validResults).toEqual(functionResults);
137137
});
138138

139139
it('should get precise duration', () => {
140140
const functionResults = [getPreciseDuration(0), getPreciseDuration(643680000),
141-
getPreciseDuration(1605312000)];
142-
const validResults = ['00:00:00:00', '07:10:48:00', '18:13:55:12'];
141+
getPreciseDuration(1605312000), getPreciseDuration(213927028)];
142+
const validResults = ['00:00:00:00:000', '07:10:48:00:000', '18:13:55:12:000', '02:11:25:27:028'];
143143
expect(validResults).toEqual(functionResults);
144144
});
145145
});

0 commit comments

Comments
 (0)