mirror of
https://github.com/nasa/openmct.git
synced 2025-05-08 19:48:41 +00:00
4386 - In time conductor history, show them on hover if only milliseconds have changed - tooltip (#5783)
* 4386 - In time conductor history, show them on hover if only milliseconds have changed * [e2e] Add quick test Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov> Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com> Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
This commit is contained in:
parent
2bdac56505
commit
27c30132d2
@ -168,3 +168,23 @@ test.describe('Time conductor input fields real-time mode', () => {
|
|||||||
// select an option and verify the offsets are updated correctly
|
// select an option and verify the offsets are updated correctly
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.describe('Time Conductor History', () => {
|
||||||
|
test("shows milliseconds on hover @unstable", async ({ page }) => {
|
||||||
|
test.info().annotations.push({
|
||||||
|
type: 'issue',
|
||||||
|
description: 'https://github.com/nasa/openmct/issues/4386'
|
||||||
|
});
|
||||||
|
// Navigate to Open MCT in Fixed Time Mode, UTC Time System
|
||||||
|
// with startBound at 2022-01-01 00:00:00.000Z
|
||||||
|
// and endBound at 2022-01-01 00:00:00.200Z
|
||||||
|
await page.goto('./#/browse/mine?view=grid&tc.mode=fixed&tc.startBound=1640995200000&tc.endBound=1640995200200&tc.timeSystem=utc&hideInspector=true', { waitUntil: 'networkidle' });
|
||||||
|
await page.locator("[aria-label='Time Conductor History']").hover({ trial: true});
|
||||||
|
await page.locator("[aria-label='Time Conductor History']").click();
|
||||||
|
|
||||||
|
// Validate history item format
|
||||||
|
const historyItem = page.locator('text="2022-01-01 00:00:00 + 200ms"');
|
||||||
|
await expect(historyItem).toBeEnabled();
|
||||||
|
await expect(historyItem).toHaveAttribute('title', '2022-01-01 00:00:00.000 - 2022-01-01 00:00:00.200');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -144,10 +144,11 @@ export default {
|
|||||||
this.initializeHistoryIfNoHistory();
|
this.initializeHistoryIfNoHistory();
|
||||||
},
|
},
|
||||||
getHistoryMenuItems() {
|
getHistoryMenuItems() {
|
||||||
|
const descriptionDateFormat = 'YYYY-MM-DD HH:mm:ss.SSS';
|
||||||
const history = this.historyForCurrentTimeSystem.map(timespan => {
|
const history = this.historyForCurrentTimeSystem.map(timespan => {
|
||||||
let name;
|
let name;
|
||||||
let startTime = this.formatTime(timespan.start);
|
const startTime = this.formatTime(timespan.start);
|
||||||
let description = `${startTime} - ${this.formatTime(timespan.end)}`;
|
const description = `${this.formatTime(timespan.start, descriptionDateFormat)} - ${this.formatTime(timespan.end, descriptionDateFormat)}`;
|
||||||
|
|
||||||
if (this.timeSystem.isUTCBased && !this.openmct.time.clock()) {
|
if (this.timeSystem.isUTCBased && !this.openmct.time.clock()) {
|
||||||
name = `${startTime} ${millisecondsToDHMS(timespan.end - timespan.start)}`;
|
name = `${startTime} ${millisecondsToDHMS(timespan.end - timespan.start)}`;
|
||||||
@ -253,7 +254,7 @@ export default {
|
|||||||
|
|
||||||
return maxRecordsLength;
|
return maxRecordsLength;
|
||||||
},
|
},
|
||||||
formatTime(time) {
|
formatTime(time, utcDateFormat) {
|
||||||
let format = this.timeSystem.timeFormat;
|
let format = this.timeSystem.timeFormat;
|
||||||
let isNegativeOffset = false;
|
let isNegativeOffset = false;
|
||||||
|
|
||||||
@ -274,7 +275,8 @@ export default {
|
|||||||
let formattedDate;
|
let formattedDate;
|
||||||
|
|
||||||
if (formatter instanceof UTCTimeFormat) {
|
if (formatter instanceof UTCTimeFormat) {
|
||||||
formattedDate = formatter.format(time, formatter.DATE_FORMATS.PRECISION_SECONDS);
|
const formatString = formatter.isValidFormatString(utcDateFormat) ? utcDateFormat : formatter.DATE_FORMATS.PRECISION_SECONDS;
|
||||||
|
formattedDate = formatter.format(time, formatString);
|
||||||
} else {
|
} else {
|
||||||
formattedDate = formatter.format(time);
|
formattedDate = formatter.format(time);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user