From 1d4cf1ff06573487f3762cbfe34ca0162d080ef0 Mon Sep 17 00:00:00 2001 From: David Tsay <3614296+davetsay@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:11:25 -0800 Subject: [PATCH] feat: Inspector tabs (#6137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * framework for all inspector views being provided * move elements view to plugin * move location view into plugin * move styles view into plugin * move properties view into plugin * install inspector views in index.html * rename filters inspector view provider for tab * finish elements view as plugin * finish location view as plugin * finish properties view as plugin * finish styles view as plugin * point main styles to new plugins * finish inspector tab and views components * fix paths for styles views * fix path issues * rename fault management inspector view fix unit test * fix paths for unit tests * rename bar graph inspector view fix unit test * rename plots inspector view fix unit test * inspector views installed in mct.js * sort inspector views by priority * make name required for inspector tabs * priority changes * only show filters tab if filters exist * object renamed to domainObject * remove dead code * select first tab if selected tab becomes hidden * bandaid fix to get e2e working * also apply bandaid to this test * [a11y] Basic ARIA tab role for Inspector panels * test(e2e): better selectors for scatterPlot test * test(e2e): fix search test selector * pass key and glyph to views * use key for tabs identification * high + 1 priority for object specific views * Closes #6118 - Significant layout and behavior refinements to Inspector tabs. - New theme constants for tabs. - Tabs in Tab Views updated to use theme constants. * Closes #6118 - Refinement to look of Inspector tabs. - Shortened names in many *InspectorViewProvider.js files. - WIP adding glyph capability, display not yet wired up. * Closes #6118 - Tightened H2 spacing in Inspector. * move annotations into plugin * register annotations view provider * move tags inside annotations * fix paths * move element item group into plugin * move PlotElementsPool view into plugin * plots has a different element view * fix paths for plot elements pool * fix: `role=` instead of `aria-role=` 🤦‍♂️ * test(e2e): fix tab locators * move location views into properties tab view * include location.scss * move location into properties tab * fix html for location within properties view * retain selected tab on new selection * refresh view of same tab with new selection * add browse mode inspector view for alphanumerics * fix prop passing * removed vestigial code * fix inspector tab selection * remove timeouts and unnessecary awaits * test: assert checkbox status before checking * add selectInspectorTab to general app actions * use selectInspectorTabs from appActions * need to pass page to playwright function * select the correct tab * fix plan unit test * fix plots tests by clicking on correct tab --------- Co-authored-by: Jesse Mazzella Co-authored-by: Charles Hacskaylo Co-authored-by: John Hill Co-authored-by: Scott Bell --- e2e/appActions.js | 22 +- .../plugins/plot/autoscale.e2e.spec.js | 2 + .../plugins/plot/logPlot.e2e.spec.js | 5 + .../plugins/plot/overlayPlot.e2e.spec.js | 37 +-- .../plugins/plot/plotLegendSwatch.e2e.spec.js | 3 + .../plugins/plot/scatterPlot.e2e.spec.js | 18 +- .../plugins/plot/stackedPlot.e2e.spec.js | 18 +- e2e/tests/functional/search.e2e.spec.js | 4 +- src/MCT.js | 3 +- .../BarGraphInspectorViewProvider.js | 4 +- src/plugins/charts/bar/pluginSpec.js | 2 +- .../ScatterPlotInspectorViewProvider.js | 4 +- .../components/inspector/StylesView.vue | 8 +- src/plugins/condition/pluginSpec.js | 2 +- .../AlphanumericFormatViewProvider.js | 2 +- .../components/AlphanumericFormat.vue | 5 +- .../FaultManagementInspector.vue | 2 +- .../FaultManagementInspectorViewProvider.js | 6 +- src/plugins/faultManagement/pluginSpec.js | 3 +- .../filters/FiltersInspectorViewProvider.js | 20 +- .../annotations/AnnotationsInspectorView.vue | 2 +- .../annotations/AnnotationsViewProvider.js | 62 +++++ .../annotations}/tags/TagEditor.vue | 0 .../annotations}/tags/TagSelection.vue | 2 +- .../annotations}/tags/tags.scss | 0 .../inspectorViews/elements}/ElementItem.vue | 18 +- .../elements}/ElementItemGroup.vue | 0 .../inspectorViews/elements}/ElementsPool.vue | 16 +- .../elements/ElementsViewProvider.js | 70 ++++++ .../elements}/PlotElementsPool.vue | 4 +- .../elements/PlotElementsViewProvider.js | 67 ++++++ .../inspectorViews/elements}/elements.scss | 0 src/plugins/inspectorViews/plugin.js | 37 +++ .../inspectorViews/properties}/DetailText.vue | 0 .../inspectorViews/properties}/Location.vue | 102 +++------ .../inspectorViews/properties}/Properties.vue | 89 ++++---- .../properties/PropertiesViewProvider.js | 60 +++++ .../inspectorViews/properties}/location.scss | 0 .../styles/FontStyleEditor.vue | 2 +- .../styles/SavedStyleSelector.vue | 0 .../styles/SavedStylesInspectorView.vue | 2 +- .../styles/SavedStylesView.vue | 2 +- .../styles/StylesInspectorView.vue | 64 +++--- .../styles/StylesInspectorViewProvider.js | 89 ++++++++ .../inspectorViews}/styles/StylesManager.js | 0 .../inspectorViews}/styles/constants.js | 0 .../inspector/PlanInspectorViewProvider.js | 2 +- src/plugins/plan/pluginSpec.js | 4 +- .../plot/inspector/PlotOptionsBrowse.vue | 10 +- .../plot/inspector/PlotOptionsEdit.vue | 10 +- .../inspector/PlotsInspectorViewProvider.js | 4 +- .../StackedPlotsInspectorViewProvider.js | 4 +- src/plugins/plot/pluginSpec.js | 6 +- src/plugins/plugins.js | 7 +- .../TableConfigurationViewProvider.js | 2 +- .../components/table-configuration.vue | 4 +- .../TimeListInspectorViewProvider.js | 2 +- src/styles/_constants-espresso.scss | 9 +- src/styles/_constants-maelstrom.scss | 7 + src/styles/_constants-snow.scss | 9 +- src/styles/_controls.scss | 10 +- src/styles/vue-styles.scss | 6 +- src/ui/inspector/Inspector.vue | 215 ++---------------- src/ui/inspector/InspectorStylesSpec.js | 4 +- src/ui/inspector/InspectorTabs.vue | 115 ++++++++++ src/ui/inspector/InspectorViews.vue | 64 ++++-- src/ui/inspector/inspector.scss | 40 ++++ src/ui/registries/InspectorViewRegistry.js | 188 ++++++++------- 68 files changed, 1006 insertions(+), 574 deletions(-) rename src/{ui/inspector => plugins/inspectorViews}/annotations/AnnotationsInspectorView.vue (99%) create mode 100644 src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js rename src/{ui/components => plugins/inspectorViews/annotations}/tags/TagEditor.vue (100%) rename src/{ui/components => plugins/inspectorViews/annotations}/tags/TagSelection.vue (98%) rename src/{ui/components => plugins/inspectorViews/annotations}/tags/tags.scss (100%) rename src/{ui/inspector => plugins/inspectorViews/elements}/ElementItem.vue (90%) rename src/{ui/inspector => plugins/inspectorViews/elements}/ElementItemGroup.vue (100%) rename src/{ui/inspector => plugins/inspectorViews/elements}/ElementsPool.vue (93%) create mode 100644 src/plugins/inspectorViews/elements/ElementsViewProvider.js rename src/{ui/inspector => plugins/inspectorViews/elements}/PlotElementsPool.vue (99%) create mode 100644 src/plugins/inspectorViews/elements/PlotElementsViewProvider.js rename src/{ui/inspector => plugins/inspectorViews/elements}/elements.scss (100%) create mode 100644 src/plugins/inspectorViews/plugin.js rename src/{ui/inspector/details => plugins/inspectorViews/properties}/DetailText.vue (100%) rename src/{ui/inspector => plugins/inspectorViews/properties}/Location.vue (51%) rename src/{ui/inspector/details => plugins/inspectorViews/properties}/Properties.vue (81%) create mode 100644 src/plugins/inspectorViews/properties/PropertiesViewProvider.js rename src/{ui/inspector => plugins/inspectorViews/properties}/location.scss (100%) rename src/{ui/inspector => plugins/inspectorViews}/styles/FontStyleEditor.vue (98%) rename src/{ui/inspector => plugins/inspectorViews}/styles/SavedStyleSelector.vue (100%) rename src/{ui/inspector => plugins/inspectorViews}/styles/SavedStylesInspectorView.vue (97%) rename src/{ui/inspector => plugins/inspectorViews}/styles/SavedStylesView.vue (98%) rename src/{ui/inspector => plugins/inspectorViews}/styles/StylesInspectorView.vue (54%) create mode 100644 src/plugins/inspectorViews/styles/StylesInspectorViewProvider.js rename src/{ui/inspector => plugins/inspectorViews}/styles/StylesManager.js (100%) rename src/{ui/inspector => plugins/inspectorViews}/styles/constants.js (100%) create mode 100644 src/ui/inspector/InspectorTabs.vue diff --git a/e2e/appActions.js b/e2e/appActions.js index c0bedfc1e1..b80f30f599 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -383,6 +383,25 @@ async function setEndOffset(page, offset) { await setTimeConductorOffset(page, offset, endOffsetButton); } +/** + * Selects an inspector tab based on the provided tab name + * + * @param {import('@playwright/test').Page} page + * @param {String} name the name of the tab + */ +async function selectInspectorTab(page, name) { + const inspectorTabs = page.getByRole('tablist'); + const inspectorTab = inspectorTabs.getByTitle(name); + const inspectorTabClass = await inspectorTab.getAttribute('class'); + const isSelectedInspectorTab = inspectorTabClass.includes('is-current'); + + // do not click a tab that is already selected or it will timeout your test + // do to a { pointer-events: none; } on selected tabs + if (!isSelectedInspectorTab) { + await inspectorTab.click(); + } +} + // eslint-disable-next-line no-undef module.exports = { createDomainObjectWithDefaults, @@ -396,5 +415,6 @@ module.exports = { setFixedTimeMode, setRealTimeMode, setStartOffset, - setEndOffset + setEndOffset, + selectInspectorTab }; diff --git a/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js b/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js index 74ae3171ba..9b81f65399 100644 --- a/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/autoscale.e2e.spec.js @@ -24,6 +24,7 @@ Testsuite for plot autoscale. */ +const { selectInspectorTab } = require('../../../../appActions'); const { test, expect } = require('../../../../pluginFixtures'); test.use({ viewport: { @@ -50,6 +51,7 @@ test.describe('Autoscale', () => { // enter edit mode await page.click('button[title="Edit"]'); + await selectInspectorTab(page, 'Config'); await turnOffAutoscale(page); await setUserDefinedMinAndMax(page, '-2', '2'); diff --git a/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js index 4779c177ce..d9533caab3 100644 --- a/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/logPlot.e2e.spec.js @@ -26,6 +26,8 @@ necessarily be used for reference when writing new tests in this area. */ const { test, expect } = require('../../../../pluginFixtures'); +const { selectInspectorTab } = require('../../../../appActions'); + test.describe('Log plot tests', () => { test('Log Plot ticks are functionally correct in regular and log mode and after refresh', async ({ page, openmctConfig }) => { const { myItemsFolderName } = openmctConfig; @@ -36,6 +38,7 @@ test.describe('Log plot tests', () => { await makeOverlayPlot(page, myItemsFolderName); await testRegularTicks(page); await enableEditMode(page); + await selectInspectorTab(page, 'Config'); await enableLogMode(page); await testLogTicks(page); await disableLogMode(page); @@ -186,6 +189,7 @@ async function enableEditMode(page) { */ async function enableLogMode(page) { // turn on log mode + await expect(page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox')).not.toBeChecked(); await page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox').check(); // await page.locator('text=Y Axis Label Log mode Auto scale Padding >> input[type="checkbox"]').first().check(); } @@ -195,6 +199,7 @@ async function enableLogMode(page) { */ async function disableLogMode(page) { // turn off log mode + await expect(page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox')).toBeChecked(); await page.getByRole('listitem').filter({ hasText: 'Log mode' }).getByRole('checkbox').uncheck(); } diff --git a/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js index f02d6e32e4..c14664e8b2 100644 --- a/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/overlayPlot.e2e.spec.js @@ -26,7 +26,7 @@ necessarily be used for reference when writing new tests in this area. */ const { test, expect } = require('../../../../pluginFixtures'); -const { createDomainObjectWithDefaults } = require('../../../../appActions'); +const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions'); test.describe('Overlay Plot', () => { test.beforeEach(async ({ page }) => { @@ -45,6 +45,8 @@ test.describe('Overlay Plot', () => { await page.goto(overlayPlot.url); + await selectInspectorTab(page, 'Config'); + // navigate to plot series color palette await page.click('.l-browse-bar__actions__edit'); await page.locator('li.c-tree__item.menus-to-left .c-disclosure-triangle').click(); @@ -89,22 +91,7 @@ test.describe('Overlay Plot', () => { await page.goto(overlayPlot.url); await page.click('button[title="Edit"]'); - // Expand the elements pool vertically - await page.locator('.l-pane.l-pane--vertical-handle-before', { - hasText: 'Elements' - }).locator('.l-pane__handle').hover(); - await page.mouse.down(); - await page.mouse.move(0, 100); - await page.mouse.up(); - - const yAxis1PropertyGroup = page.locator('[aria-label="Y Axis Properties"]'); - const yAxis2PropertyGroup = page.locator('[aria-label="Y Axis 2 Properties"]'); - const yAxis3PropertyGroup = page.locator('[aria-label="Y Axis 3 Properties"]'); - - // Assert that Y Axis 1 property group is visible only - await expect(yAxis1PropertyGroup).toBeVisible(); - await expect(yAxis2PropertyGroup).toBeHidden(); - await expect(yAxis3PropertyGroup).toBeHidden(); + await selectInspectorTab(page, 'Elements'); // Drag swg a, c, e into Y Axis 2 await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]')); @@ -112,6 +99,12 @@ test.describe('Overlay Plot', () => { await page.locator(`#inspector-elements-tree >> text=${swgE.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 2"]')); // Assert that Y Axis 1 and Y Axis 2 property groups are visible only + await selectInspectorTab(page, 'Config'); + + const yAxis1PropertyGroup = page.locator('[aria-label="Y Axis Properties"]'); + const yAxis2PropertyGroup = page.locator('[aria-label="Y Axis 2 Properties"]'); + const yAxis3PropertyGroup = page.locator('[aria-label="Y Axis 3 Properties"]'); + await expect(yAxis1PropertyGroup).toBeVisible(); await expect(yAxis2PropertyGroup).toBeVisible(); await expect(yAxis3PropertyGroup).toBeHidden(); @@ -120,15 +113,21 @@ test.describe('Overlay Plot', () => { const yAxis2Group = page.getByLabel("Y Axis 2"); const yAxis3Group = page.getByLabel("Y Axis 3"); + await selectInspectorTab(page, 'Elements'); + // Drag swg b into Y Axis 3 await page.locator(`#inspector-elements-tree >> text=${swgB.name}`).dragTo(page.locator('[aria-label="Element Item Group Y Axis 3"]')); // Assert that all Y Axis property groups are visible + await selectInspectorTab(page, 'Config'); + await expect(yAxis1PropertyGroup).toBeVisible(); await expect(yAxis2PropertyGroup).toBeVisible(); await expect(yAxis3PropertyGroup).toBeVisible(); // Verify that the elements are in the correct buckets and in the correct order + await selectInspectorTab(page, 'Elements'); + expect(yAxis1Group.getByRole('listitem', { name: swgD.name })).toBeTruthy(); expect(yAxis1Group.getByRole('listitem').nth(0).getByText(swgD.name)).toBeTruthy(); expect(yAxis2Group.getByRole('listitem', { name: swgE.name })).toBeTruthy(); @@ -154,8 +153,10 @@ test.describe('Overlay Plot', () => { await page.goto(overlayPlot.url); await page.click('button[title="Edit"]'); + await selectInspectorTab(page, 'Elements'); + await page.locator(`#inspector-elements-tree >> text=${swgA.name}`).click(); - await page.locator('.js-overlay canvas').nth(1); + const plotPixelSize = await getCanvasPixelsWithData(page); expect(plotPixelSize).toBeGreaterThan(0); }); diff --git a/e2e/tests/functional/plugins/plot/plotLegendSwatch.e2e.spec.js b/e2e/tests/functional/plugins/plot/plotLegendSwatch.e2e.spec.js index 7660f81a9f..2d3e2268f7 100644 --- a/e2e/tests/functional/plugins/plot/plotLegendSwatch.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/plotLegendSwatch.e2e.spec.js @@ -25,6 +25,7 @@ Tests to verify log plot functionality. Note this test suite if very much under necessarily be used for reference when writing new tests in this area. */ +const { selectInspectorTab } = require('../../../../appActions'); const { test, expect } = require('../../../../pluginFixtures'); test.describe('Legend color in sync with plot color', () => { @@ -33,6 +34,8 @@ test.describe('Legend color in sync with plot color', () => { // navigate to plot series color palette await page.click('.l-browse-bar__actions__edit'); + await selectInspectorTab(page, 'Config'); + await page.locator('li.c-tree__item.menus-to-left .c-disclosure-triangle').click(); await page.locator('.c-click-swatch--menu').click(); await page.locator('.c-palette__item[style="background: rgb(255, 166, 61);"]').click(); diff --git a/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js index eda0cb6194..29d581b859 100644 --- a/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/scatterPlot.e2e.spec.js @@ -25,7 +25,7 @@ */ const { test, expect } = require('../../../../pluginFixtures'); -const { createDomainObjectWithDefaults } = require('../../../../appActions'); +const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions'); const uuid = require('uuid').v4; test.describe('Scatter Plot', () => { @@ -40,8 +40,8 @@ test.describe('Scatter Plot', () => { }); test('Can add and remove telemetry sources', async ({ page }) => { - const editButtonLocator = page.locator('button[title="Edit"]'); - const saveButtonLocator = page.locator('button[title="Save"]'); + const editButton = page.locator('button[title="Edit"]'); + const saveButton = page.locator('button[title="Save"]'); // Create a sine wave generator within the scatter plot const swg1 = await createDomainObjectWithDefaults(page, { @@ -53,9 +53,10 @@ test.describe('Scatter Plot', () => { // Navigate to the scatter plot and verify that // the SWG appears in the elements pool await page.goto(scatterPlot.url); - await editButtonLocator.click(); + await editButton.click(); + await selectInspectorTab(page, 'Elements'); await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg1.name}`)).toBeVisible(); - await saveButtonLocator.click(); + await saveButton.click(); await page.locator('li[title="Save and Finish Editing"]').click(); // Create another sine wave generator within the scatter plot @@ -72,10 +73,13 @@ test.describe('Scatter Plot', () => { // Navigate to the scatter plot and verify that the new SWG // appears in the elements pool and the old one is gone await page.goto(scatterPlot.url); - await editButtonLocator.click(); + await editButton.click(); + + // Click the "Elements" tab + await selectInspectorTab(page, 'Elements'); await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg1.name}`)).toBeHidden(); await expect.soft(page.locator(`#inspector-elements-tree >> text=${swg2.name}`)).toBeVisible(); - await saveButtonLocator.click(); + await saveButton.click(); // Right click on the new SWG in the elements pool and delete it await page.locator(`#inspector-elements-tree >> text=${swg2.name}`).click({ diff --git a/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js b/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js index 6337a9f1a0..868372185f 100644 --- a/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/stackedPlot.e2e.spec.js @@ -26,7 +26,7 @@ necessarily be used for reference when writing new tests in this area. */ const { test, expect } = require('../../../../pluginFixtures'); -const { createDomainObjectWithDefaults } = require('../../../../appActions'); +const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../../../appActions'); test.describe('Stacked Plot', () => { let stackedPlot; @@ -65,11 +65,7 @@ test.describe('Stacked Plot', () => { await page.click('button[title="Edit"]'); - // Expand the elements pool vertically - await page.locator('.l-pane__handle').nth(2).hover({ trial: true }); - await page.mouse.down(); - await page.mouse.move(0, 100); - await page.mouse.up(); + await selectInspectorTab(page, 'Elements'); await swgBElementsPoolItem.click({ button: 'right' }); await page.getByRole('menuitem').filter({ hasText: /Remove/ }).click(); @@ -92,11 +88,7 @@ test.describe('Stacked Plot', () => { await page.click('button[title="Edit"]'); - // Expand the elements pool vertically - await page.locator('.l-pane__handle').nth(2).hover({ trial: true }); - await page.mouse.down(); - await page.mouse.move(0, 100); - await page.mouse.up(); + await selectInspectorTab(page, 'Elements'); const stackedPlotItem1 = page.locator('.c-plot--stacked-container').nth(0); const stackedPlotItem2 = page.locator('.c-plot--stacked-container').nth(1); @@ -136,6 +128,8 @@ test.describe('Stacked Plot', () => { test('Selecting a child plot while in browse and edit modes shows its properties in the inspector', async ({ page }) => { await page.goto(stackedPlot.url); + await selectInspectorTab(page, 'Config'); + // Click on the 1st plot await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"] canvas`).nth(1).click(); @@ -163,6 +157,8 @@ test.describe('Stacked Plot', () => { // Go into edit mode await page.click('button[title="Edit"]'); + await selectInspectorTab(page, 'Config'); + // Click on canvas for the 1st plot await page.locator(`[aria-label="Stacked Plot Item ${swgA.name}"]`).click(); diff --git a/e2e/tests/functional/search.e2e.spec.js b/e2e/tests/functional/search.e2e.spec.js index be137fa7cd..162312d4f5 100644 --- a/e2e/tests/functional/search.e2e.spec.js +++ b/e2e/tests/functional/search.e2e.spec.js @@ -24,7 +24,7 @@ */ const { test, expect } = require('../../pluginFixtures'); -const { createDomainObjectWithDefaults } = require('../../appActions'); +const { createDomainObjectWithDefaults, selectInspectorTab } = require('../../appActions'); const { v4: uuid } = require('uuid'); test.describe('Grand Search', () => { @@ -50,7 +50,7 @@ test.describe('Grand Search', () => { await expect(page.locator('[aria-label="Search Result"] >> nth=2')).toContainText(`Clock C ${myItemsFolderName} Red Folder Blue Folder`); await expect(page.locator('[aria-label="Search Result"] >> nth=3')).toContainText(`Clock D ${myItemsFolderName} Red Folder Blue Folder`); // Click the Elements pool to dismiss the search menu - await page.locator('.l-pane__label:has-text("Elements")').click(); + await selectInspectorTab(page, 'Elements'); await expect(page.locator('[aria-label="Search Result"] >> nth=0')).toBeHidden(); await page.locator('[aria-label="OpenMCT Search"] [aria-label="Search Input"]').click(); diff --git a/src/MCT.js b/src/MCT.js index cd9f6c131c..2738a68abc 100644 --- a/src/MCT.js +++ b/src/MCT.js @@ -143,7 +143,7 @@ define([ * @memberof module:openmct.MCT# * @name inspectorViews */ - ['inspectorViews', () => new InspectorViewRegistry()], + ['inspectorViews', () => new InspectorViewRegistry.default()], /** * Registry for views which should appear in Edit Properties @@ -295,6 +295,7 @@ define([ this.install(this.plugins.DeviceClassifier()); this.install(this.plugins.UserIndicator()); this.install(this.plugins.Gauge()); + this.install(this.plugins.InspectorViews()); } MCT.prototype = Object.create(EventEmitter.prototype); diff --git a/src/plugins/charts/bar/inspector/BarGraphInspectorViewProvider.js b/src/plugins/charts/bar/inspector/BarGraphInspectorViewProvider.js index 0028ea40df..61e9245bd2 100644 --- a/src/plugins/charts/bar/inspector/BarGraphInspectorViewProvider.js +++ b/src/plugins/charts/bar/inspector/BarGraphInspectorViewProvider.js @@ -5,7 +5,7 @@ import BarGraphOptions from "./BarGraphOptions.vue"; export default function BarGraphInspectorViewProvider(openmct) { return { key: BAR_GRAPH_INSPECTOR_KEY, - name: 'Bar Graph Inspector View', + name: 'Bar Graph Configuration', canView: function (selection) { if (selection.length === 0 || selection[0].length === 0) { return false; @@ -42,7 +42,7 @@ export default function BarGraphInspectorViewProvider(openmct) { }; }, priority: function () { - return 1; + return openmct.priority.HIGH + 1; } }; } diff --git a/src/plugins/charts/bar/pluginSpec.js b/src/plugins/charts/bar/pluginSpec.js index b80b3ca66c..1b9e317cfb 100644 --- a/src/plugins/charts/bar/pluginSpec.js +++ b/src/plugins/charts/bar/pluginSpec.js @@ -579,7 +579,7 @@ describe("the plugin", function () { child.append(viewContainer); const applicableViews = openmct.inspectorViews.get(selection); - plotInspectorView = applicableViews[0]; + plotInspectorView = applicableViews.filter(view => view.name === 'Bar Graph Configuration')[0]; plotInspectorView.show(viewContainer); await Vue.nextTick(); diff --git a/src/plugins/charts/scatter/inspector/ScatterPlotInspectorViewProvider.js b/src/plugins/charts/scatter/inspector/ScatterPlotInspectorViewProvider.js index 54487dfe37..ea7ae6d414 100644 --- a/src/plugins/charts/scatter/inspector/ScatterPlotInspectorViewProvider.js +++ b/src/plugins/charts/scatter/inspector/ScatterPlotInspectorViewProvider.js @@ -5,7 +5,7 @@ import PlotOptions from "./PlotOptions.vue"; export default function ScatterPlotInspectorViewProvider(openmct) { return { key: SCATTER_PLOT_INSPECTOR_KEY, - name: 'Bar Graph Inspector View', + name: 'Config', canView: function (selection) { if (selection.length === 0 || selection[0].length === 0) { return false; @@ -42,7 +42,7 @@ export default function ScatterPlotInspectorViewProvider(openmct) { }; }, priority: function () { - return 1; + return openmct.priority.HIGH + 1; } }; } diff --git a/src/plugins/condition/components/inspector/StylesView.vue b/src/plugins/condition/components/inspector/StylesView.vue index 3c3904ef1a..6ced26b456 100644 --- a/src/plugins/condition/components/inspector/StylesView.vue +++ b/src/plugins/condition/components/inspector/StylesView.vue @@ -29,9 +29,6 @@ Your selection includes one or more items that use Conditional Styling. Applying a static style below will replace any Conditional Styling with the new choice.