Skip to content

Commit 8c2558b

Browse files
ozyxdavetsayunlikelyzero
authored
fix(#7524): Open in New Tab action from a sub-object in a layout (#7542)
* refactor: url tools use named exports * fix: refactor method and remove customUrlParams * test(e2e): verify bounds are preserved in data pivoting * test: remove test as feature is no longer needed - dataVisualization logic has moved from MMGIS plugin to the open source. As such, we can just use the time conductor bounds * refactor: autoformat keeps changing this so i'mma just commit it * refactor: remove unnecessary code * refactor: simplify, add docs * Revert "refactor: remove unnecessary code" This reverts commit 87aef35. * a11y: improve aria labels for ITC * fix: simplify url method * fix: update ITC app actions * test: add test to generate test data for display layout w/ overlay plot + ITC enabled * test(e2e): add suite + test for open in new tab from subobject - needs cleanup * a11y: various a11y improvement drivebys * a11y: clock indicator needs to be quiet * a11y: add `aria-live` to SuperMenu details * a11y: greatly improve a11y of Menus and SuperMenus * test(e2e): clean up test * fix: improve a11y for context menus, fix test * chore: remove nop-longer-recommended extension * feat: provide one more bound option for example data viz * fix: no need for `mount`, use dynamic rendering instead * Revert "fix: simplify url method" This reverts commit b24c7da. * fix: correct time conductor bounds when opening in a new tab from a plot in the inspector * test: fix e2e tests * Revert "test: remove test as feature is no longer needed" This reverts commit 759ebd4. * test: move 2p annotation to test * test: fix e2e * fix: no words for the word god today * test: fix e2e * fix: e2e test * test: fix test * driveby: fix perf test * fix: revert required prop change --------- Co-authored-by: David Tsay <[email protected]> Co-authored-by: John Hill <[email protected]>
1 parent 0eadc7a commit 8c2558b

40 files changed

+465
-165
lines changed

.vscode/extensions.json

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
77
"Vue.volar",
8-
"Vue.vscode-typescript-vue-plugin",
98
"dbaeumer.vscode-eslint",
109
"rvest.vs-code-prettier-eslint"
1110
],

e2e/appActions.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -505,15 +505,14 @@ async function setTimeConductorBounds(page, startDate, endDate) {
505505
* @param {string} startDate
506506
* @param {string} endDate
507507
*/
508-
async function setIndependentTimeConductorBounds(page, startDate, endDate) {
509-
// Activate Independent Time Conductor in Fixed Time Mode
510-
await page.getByRole('switch').click();
508+
async function setIndependentTimeConductorBounds(page, { start, end }) {
509+
// Activate Independent Time Conductor
510+
await page.getByLabel('Enable Independent Time Conductor').click();
511511

512512
// Bring up the time conductor popup
513-
await page.click('.c-conductor-holder--compact .c-compact-tc');
513+
await page.getByLabel('Independent Time Conductor Settings').click();
514514
await expect(page.locator('.itc-popout')).toBeInViewport();
515-
516-
await setTimeBounds(page, startDate, endDate);
515+
await setTimeBounds(page, start, end);
517516

518517
await page.keyboard.press('Enter');
519518
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"cookies": [],
3+
"origins": [
4+
{
5+
"origin": "http://localhost:8080",
6+
"localStorage": [
7+
{
8+
"name": "mct",
9+
"value": "{\"mine\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},\"29836e66-111a-45f8-81ed-f662661be9f9\":{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[{\"width\":32,\"height\":18,\"x\":1,\"y\":1,\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"hasFrame\":true,\"fontSize\":\"default\",\"font\":\"default\",\"type\":\"subobject-view\",\"id\":\"022720f7-a6b5-40c3-b051-75f5d10a9042\"}],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604780,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413604780},\"55cd0300-6e57-4992-b670-0c2880c0e6b2\":{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[{\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}}],\"useIndependentTime\":true,\"timeOptions\":{\"clockOffsets\":{\"start\":-1800000,\"end\":30000},\"fixedOffsets\":{\"start\":1731438671000,\"end\":1731442271000},\"clock\":\"local\",\"mode\":\"fixed\"}},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413605500,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413605500},\"ec13f652-4636-4763-8e88-898144cbc6f2\":{\"name\":\"Child SWG 1\",\"type\":\"generator\",\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"},\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"created\":1732413604440,\"persisted\":1732413604440}}"
10+
},
11+
{
12+
"name": "mct-tree-expanded",
13+
"value": "[]"
14+
},
15+
{
16+
"name": "tcHistory",
17+
"value": "{\"utc\":[{\"start\":1731352271000,\"end\":1731355871000}]}"
18+
},
19+
{
20+
"name": "mct-recent-objects",
21+
"value": "[{\"objectPath\":[{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/29836e66-111a-45f8-81ed-f662661be9f9\",\"domainObject\":{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280}},{\"objectPath\":[{\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"},\"name\":\"Child SWG 1\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"created\":1732413604440,\"persisted\":1732413604440},{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413604440},{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/29836e66-111a-45f8-81ed-f662661be9f9/55cd0300-6e57-4992-b670-0c2880c0e6b2/ec13f652-4636-4763-8e88-898144cbc6f2\",\"domainObject\":{\"identifier\":{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"},\"name\":\"Child SWG 1\",\"type\":\"generator\",\"telemetry\":{\"period\":10,\"amplitude\":1,\"offset\":0,\"dataRateInHz\":1,\"phase\":0,\"randomness\":0,\"loadDelay\":0,\"infinityValues\":false,\"exceedFloat32\":false,\"staleness\":false},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"created\":1732413604440,\"persisted\":1732413604440}},{\"objectPath\":[{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413604440},{\"identifier\":{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"},\"name\":\"Parent Display Layout\",\"type\":\"layout\",\"composition\":[{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"}],\"configuration\":{\"items\":[],\"layoutGrid\":[10,10]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413603280,\"location\":\"mine\",\"created\":1732413602140,\"persisted\":1732413603280},{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine/29836e66-111a-45f8-81ed-f662661be9f9/55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"domainObject\":{\"identifier\":{\"key\":\"55cd0300-6e57-4992-b670-0c2880c0e6b2\",\"namespace\":\"\"},\"name\":\"Child Overlay Plot 1\",\"type\":\"telemetry.plot.overlay\",\"composition\":[{\"key\":\"ec13f652-4636-4763-8e88-898144cbc6f2\",\"namespace\":\"\"}],\"configuration\":{\"series\":[]},\"notes\":\"framework/generateLocalStorageData.e2e.spec.js\\nGenerate Visual Test Data @localStorage @generatedata\\nGenerate display layout with 1 child overlay plot\\nchrome\",\"modified\":1732413604440,\"location\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"created\":1732413603280,\"persisted\":1732413604440}},{\"objectPath\":[{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140},{\"identifier\":{\"key\":\"ROOT\",\"namespace\":\"\"},\"name\":\"Open MCT\",\"type\":\"root\",\"composition\":[{\"key\":\"mine\",\"namespace\":\"\"}]}],\"navigationPath\":\"/browse/mine\",\"domainObject\":{\"identifier\":{\"key\":\"mine\",\"namespace\":\"\"},\"name\":\"My Items\",\"type\":\"folder\",\"composition\":[{\"key\":\"29836e66-111a-45f8-81ed-f662661be9f9\",\"namespace\":\"\"}],\"location\":\"ROOT\",\"modified\":1732413602140,\"created\":1732413600860,\"persisted\":1732413602140}}]"
22+
}
23+
]
24+
}
25+
]
26+
}

e2e/tests/framework/appActions.e2e.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ test.describe('AppActions', () => {
174174
type: 'Folder'
175175
});
176176
await openObjectTreeContextMenu(page, folder.url);
177-
await expect(page.getByLabel('Menu')).toBeVisible();
177+
await expect(page.getByLabel(`${folder.name} Context Menu`)).toBeVisible();
178178
});
179179
});

e2e/tests/framework/generateLocalStorageData.e2e.spec.js

+53-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333

3434
import { fileURLToPath } from 'url';
3535

36-
import { createDomainObjectWithDefaults, createExampleTelemetryObject } from '../../appActions.js';
36+
import {
37+
createDomainObjectWithDefaults,
38+
createExampleTelemetryObject,
39+
setIndependentTimeConductorBounds,
40+
setTimeConductorBounds
41+
} from '../../appActions.js';
3742
import { MISSION_TIME } from '../../constants.js';
3843
import { expect, test } from '../../pluginFixtures.js';
3944

@@ -89,6 +94,53 @@ test.describe('Generate Visual Test Data @localStorage @generatedata @clock', ()
8994
});
9095
});
9196

97+
test('Generate display layout with 1 child overlay plot', async ({ page, context }) => {
98+
const parent = await createDomainObjectWithDefaults(page, {
99+
type: 'Display Layout',
100+
name: 'Parent Display Layout'
101+
});
102+
const overlayPlot = await createDomainObjectWithDefaults(page, {
103+
type: 'Overlay Plot',
104+
name: 'Child Overlay Plot 1',
105+
parent: parent.uuid
106+
});
107+
await createDomainObjectWithDefaults(page, {
108+
type: 'Sine Wave Generator',
109+
name: 'Child SWG 1',
110+
parent: overlayPlot.uuid
111+
});
112+
113+
await page.goto(parent.url, { waitUntil: 'domcontentloaded' });
114+
115+
await setIndependentTimeConductorBounds(page, {
116+
start: '2024-11-12 19:11:11.000Z',
117+
end: '2024-11-12 20:11:11.000Z'
118+
});
119+
120+
const NEW_GLOBAL_START_BOUNDS = '2024-11-11 19:11:11.000Z';
121+
const NEW_GLOBAL_END_BOUNDS = '2024-11-11 20:11:11.000Z';
122+
123+
await setTimeConductorBounds(page, NEW_GLOBAL_START_BOUNDS, NEW_GLOBAL_END_BOUNDS);
124+
125+
// Verify that the global time conductor bounds have been updated
126+
expect(
127+
await page.getByLabel('Global Time Conductor').getByLabel('Start bounds').textContent()
128+
).toEqual(NEW_GLOBAL_START_BOUNDS);
129+
expect(
130+
await page.getByLabel('Global Time Conductor').getByLabel('End bounds').textContent()
131+
).toEqual(NEW_GLOBAL_END_BOUNDS);
132+
133+
//Save localStorage for future test execution
134+
await context.storageState({
135+
path: fileURLToPath(
136+
new URL(
137+
'../../../e2e/test-data/display_layout_with_child_overlay_plot.json',
138+
import.meta.url
139+
)
140+
)
141+
});
142+
});
143+
92144
test('Generate flexible layout with 2 child display layouts', async ({ page, context }) => {
93145
// Create Display Layout
94146
const parent = await createDomainObjectWithDefaults(page, {

e2e/tests/functional/planning/timestrip.e2e.spec.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ test.describe('Time Strip', () => {
131131
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
132132
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');
133133

134-
await setIndependentTimeConductorBounds(page, startBoundString, endBoundString);
134+
await setIndependentTimeConductorBounds(page, {
135+
start: startBoundString,
136+
end: endBoundString
137+
});
135138
expect(await activityBounds.count()).toEqual(1);
136139
});
137140

@@ -160,7 +163,10 @@ test.describe('Time Strip', () => {
160163
const startBoundString = new Date(startBound).toISOString().replace('T', ' ');
161164
const endBoundString = new Date(endBound).toISOString().replace('T', ' ');
162165

163-
await setIndependentTimeConductorBounds(page, startBoundString, endBoundString);
166+
await setIndependentTimeConductorBounds(page, {
167+
start: startBoundString,
168+
end: endBoundString
169+
});
164170

165171
// Verify that two events are displayed
166172
expect(await activityBounds.count()).toEqual(2);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ test.describe('Basic Condition Set Use', () => {
286286
await page.locator('button[title="Save"]').click();
287287
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
288288

289-
await page.click('button[title="Change the current view"]');
289+
await page.getByLabel('Open the View Switcher Menu').click();
290290

291291
await expect(page.getByRole('menuitem', { name: /Lad Table/ })).toBeHidden();
292292
await expect(page.getByRole('menuitem', { name: /Conditions View/ })).toBeVisible();

0 commit comments

Comments
 (0)