From 652bf9e400d3648c6c4db19d6c91d2b8b89f89d4 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Thu, 29 Feb 2024 14:47:30 -0800 Subject: [PATCH 01/34] refactor: url tools use named exports --- src/plugins/LADTable/components/LadRow.vue | 4 ++-- src/plugins/notebook/components/NotebookEmbed.vue | 2 +- src/plugins/openInNewTabAction/openInNewTabAction.js | 2 +- src/tools/url.js | 2 +- src/tools/urlSpec.js | 2 +- src/ui/layout/search/ObjectSearchResult.vue | 4 ++-- src/ui/mixins/object-link.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/LADTable/components/LadRow.vue b/src/plugins/LADTable/components/LadRow.vue index ea7e525435b..2adf23743de 100644 --- a/src/plugins/LADTable/components/LadRow.vue +++ b/src/plugins/LADTable/components/LadRow.vue @@ -58,7 +58,7 @@ const CONTEXT_MENU_ACTIONS = ['viewDatumAction', 'viewHistoricalData', 'remove']; const BLANK_VALUE = '---'; -import identifierToString from '/src/tools/url.js'; +import { objectPathToUrl } from '/src/tools/url.js'; import PreviewAction from '@/ui/preview/PreviewAction.js'; import tooltipHelpers from '../../../api/tooltips/tooltipMixins.js'; @@ -260,7 +260,7 @@ export default { event.preventDefault(); this.preview(this.objectPath); } else { - const resultUrl = identifierToString(this.openmct, this.objectPath); + const resultUrl = objectPathToUrl(this.openmct, this.objectPath); this.openmct.router.navigate(resultUrl); } }, diff --git a/src/plugins/notebook/components/NotebookEmbed.vue b/src/plugins/notebook/components/NotebookEmbed.vue index 9fb4d061644..725faec51c3 100644 --- a/src/plugins/notebook/components/NotebookEmbed.vue +++ b/src/plugins/notebook/components/NotebookEmbed.vue @@ -52,7 +52,7 @@ import Moment from 'moment'; import mount from 'utils/mount'; -import objectPathToUrl from '@/tools/url'; +import { objectPathToUrl } from '@/tools/url'; import tooltipHelpers from '../../../api/tooltips/tooltipMixins.js'; import ImageExporter from '../../../exporters/ImageExporter.js'; diff --git a/src/plugins/openInNewTabAction/openInNewTabAction.js b/src/plugins/openInNewTabAction/openInNewTabAction.js index 501c4431b6c..e9f601924bd 100644 --- a/src/plugins/openInNewTabAction/openInNewTabAction.js +++ b/src/plugins/openInNewTabAction/openInNewTabAction.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -import objectPathToUrl from '/src/tools/url.js'; +import { objectPathToUrl } from '/src/tools/url.js'; export default class OpenInNewTab { constructor(openmct) { this.name = 'Open In New Tab'; diff --git a/src/tools/url.js b/src/tools/url.js index 2d11459c5d8..8cf66de23e5 100644 --- a/src/tools/url.js +++ b/src/tools/url.js @@ -66,7 +66,7 @@ export function identifierToString(openmct, objectPath) { * @param {any} customUrlParams * @returns {string} url */ -export default function objectPathToUrl(openmct, objectPath, customUrlParams = {}) { +export function objectPathToUrl(openmct, objectPath, customUrlParams = {}) { let url = identifierToString(openmct, objectPath); let urlParams = paramsToArray(openmct, customUrlParams); diff --git a/src/tools/urlSpec.js b/src/tools/urlSpec.js index 7323aa828d7..740067ee14c 100644 --- a/src/tools/urlSpec.js +++ b/src/tools/urlSpec.js @@ -1,5 +1,5 @@ import { createOpenMct, resetApplicationState } from '../utils/testing.js'; -import { default as objectPathToUrl, identifierToString, paramsToArray } from './url.js'; +import { identifierToString, objectPathToUrl, paramsToArray } from './url.js'; describe('the url tool', function () { let openmct; diff --git a/src/ui/layout/search/ObjectSearchResult.vue b/src/ui/layout/search/ObjectSearchResult.vue index 6972122bf89..805456a6627 100644 --- a/src/ui/layout/search/ObjectSearchResult.vue +++ b/src/ui/layout/search/ObjectSearchResult.vue @@ -55,7 +55,7 @@ diff --git a/src/api/menu/components/SuperMenu.vue b/src/api/menu/components/SuperMenu.vue index 58a94a06f3e..cd8d72f7be3 100644 --- a/src/api/menu/components/SuperMenu.vue +++ b/src/api/menu/components/SuperMenu.vue @@ -75,12 +75,12 @@
-
+
- {{ hoveredItem.name }} + {{ hoveredItemName }}
- {{ hoveredItem.description }} + {{ hoveredItemDescription }}
@@ -92,21 +92,34 @@ export default { inject: ['options'], data() { return { - hoveredItem: {} + hoveredItem: null }; }, computed: { optionsLabel() { const label = this.options.label ? `${this.options.label} Super Menu` : 'Super Menu'; return label; + }, + itemDescriptionIconClass() { + const iconClass = ['l-item-description__icon']; + if (this.hoveredItem) { + iconClass.push('bg-' + this.hoveredItem.cssClass); + } + return iconClass; + }, + hoveredItemName() { + return this.hoveredItem?.name ?? ''; + }, + hoveredItemDescription() { + return this.hoveredItem?.description ?? ''; } }, methods: { - toggleItemDescription(action = {}) { + toggleItemDescription(action = null) { const hoveredItem = { - name: action.name, - description: action.description, - cssClass: action.cssClass + name: action?.name, + description: action?.description, + cssClass: action?.cssClass }; this.hoveredItem = hoveredItem; diff --git a/src/styles/_global.scss b/src/styles/_global.scss index c5d414d0ef7..42e9607ed54 100644 --- a/src/styles/_global.scss +++ b/src/styles/_global.scss @@ -68,6 +68,18 @@ div { flex: 1 1 auto; } +.visually-hidden { + // Provides a way to add accessible text to elements + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} + /******************************************************** BROWSER ELEMENTS */ body.desktop { ::-webkit-scrollbar { @@ -361,7 +373,7 @@ body.desktop .has-local-controls { } } -[aria-disabled = 'true'], +[aria-disabled='true'], *[disabled], .disabled { opacity: $controlDisabledOpacity; @@ -397,7 +409,7 @@ body.desktop .has-local-controls { position: absolute; top: 0; bottom: 0; - content: ""; + content: ''; right: 0; width: $fadeTruncateW * 1.5; z-index: 2; From 84c27d7748b0bc03171f6d13ad39d239c0d47778 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Sun, 3 Mar 2024 17:41:40 -0800 Subject: [PATCH 18/34] test(e2e): clean up test --- .../displayLayout/displayLayout.e2e.spec.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js b/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js index 0d7cca779b0..a59c9b21edf 100644 --- a/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js +++ b/e2e/tests/functional/plugins/displayLayout/displayLayout.e2e.spec.js @@ -58,12 +58,23 @@ test.describe('Display Layout Sub-object Actions @localStorage @2p', () => { .getByLabel('Main Tree') .getByLabel('Navigate to Parent Display Layout layout Object') .click(); + // Wait for the URL to change to the display layout await waitForMyItemsNavigation; }); test('Open in New Tab action preserves time bounds', async ({ page }) => { - const TEST_FIXED_START_TIME = 1731352271000; - const TEST_FIXED_END_TIME = TEST_FIXED_START_TIME + 3600000; + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/7524' + }); + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/6982' + }); + + const TEST_FIXED_START_TIME = 1731352271000; // 2024-11-11 19:11:11.000Z + const TEST_FIXED_END_TIME = TEST_FIXED_START_TIME + 3600000; // 2024-11-11 20:11:11.000Z + // Verify the ITC has the expected initial bounds expect( await page .getByLabel('Child Overlay Plot 1 Frame Controls') @@ -86,7 +97,7 @@ test.describe('Display Layout Sub-object Actions @localStorage @2p', () => { TEST_FIXED_END_TIME ); - // ITC bounds should still match the original global bounds + // ITC bounds should still match the initial ITC bounds expect( await page .getByLabel('Child Overlay Plot 1 Frame Controls') @@ -116,6 +127,7 @@ test.describe('Display Layout Sub-object Actions @localStorage @2p', () => { await newPage.getByLabel('Global Time Conductor').getByLabel('End bounds').textContent() ).toEqual(NEW_GLOBAL_END_BOUNDS); + // Verify that the ITC is enabled in the new page await expect(newPage.getByLabel('Disable Independent Time Conductor')).toBeVisible(); // Verify that the ITC bounds in the new page match the original ITC bounds expect( @@ -433,7 +445,7 @@ test.describe('Display Layout', () => { const startDate = '2021-12-30 01:01:00.000Z'; const endDate = '2021-12-30 01:11:00.000Z'; - await setIndependentTimeConductorBounds(page, startDate, endDate); + await setIndependentTimeConductorBounds(page, { start: startDate, end: endDate }); // check image date await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible(); From dac242e3c47f93d458223965a0aebe2ddfcfb293 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Sun, 3 Mar 2024 17:42:00 -0800 Subject: [PATCH 19/34] fix: improve a11y for context menus, fix test --- e2e/tests/framework/appActions.e2e.spec.js | 2 +- src/api/menu/components/MenuComponent.vue | 2 +- src/ui/mixins/context-menu-gesture.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/tests/framework/appActions.e2e.spec.js b/e2e/tests/framework/appActions.e2e.spec.js index 4aba0e196ec..cc932479518 100644 --- a/e2e/tests/framework/appActions.e2e.spec.js +++ b/e2e/tests/framework/appActions.e2e.spec.js @@ -174,6 +174,6 @@ test.describe('AppActions', () => { type: 'Folder' }); await openObjectTreeContextMenu(page, folder.url); - await expect(page.getByLabel('Menu')).toBeVisible(); + await expect(page.getByLabel(`${folder.name} Context Menu`)).toBeVisible(); }); }); diff --git a/src/api/menu/components/MenuComponent.vue b/src/api/menu/components/MenuComponent.vue index dfba201b4d2..ae5d4d743ce 100644 --- a/src/api/menu/components/MenuComponent.vue +++ b/src/api/menu/components/MenuComponent.vue @@ -87,7 +87,7 @@ export default { }, computed: { optionsLabel() { - const label = this.options.label ? `${this.options.label} Menu` : 'Menu'; + const label = this.options.label ? `${this.options.label} Context Menu` : 'Context Menu'; return label; } }, diff --git a/src/ui/mixins/context-menu-gesture.js b/src/ui/mixins/context-menu-gesture.js index 038e500329e..343f246fe3a 100644 --- a/src/ui/mixins/context-menu-gesture.js +++ b/src/ui/mixins/context-menu-gesture.js @@ -61,7 +61,8 @@ export default { let sortedActions = this.openmct.actions._groupAndSortActions(actions); const menuOptions = { - onDestroy: this.onContextMenuDestroyed + onDestroy: this.onContextMenuDestroyed, + label: this.objectPath[0].name }; const menuItems = this.openmct.menus.actionsToMenuItems( From 7bdf8e3ab2eeb556afd723a01c53bef9e143493e Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 4 Mar 2024 11:11:16 -0800 Subject: [PATCH 20/34] chore: remove nop-longer-recommended extension --- .vscode/extensions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 24ebdbe6fb2..d88ed5d86a6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,6 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ "Vue.volar", - "Vue.vscode-typescript-vue-plugin", "dbaeumer.vscode-eslint", "rvest.vs-code-prettier-eslint" ], From 72370152ede858af130ec802a16dd577a3574bca Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 4 Mar 2024 11:36:55 -0800 Subject: [PATCH 21/34] feat: provide one more bound option for example data viz --- .../components/ExampleDataVisualizationSource.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example/dataVisualization/components/ExampleDataVisualizationSource.vue b/example/dataVisualization/components/ExampleDataVisualizationSource.vue index b4856b60feb..fe0dcde44ec 100644 --- a/example/dataVisualization/components/ExampleDataVisualizationSource.vue +++ b/example/dataVisualization/components/ExampleDataVisualizationSource.vue @@ -55,6 +55,7 @@