Skip to content

Provide renderWhenVisible to LadTableSets #7384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test.describe('Testing numeric data with inspector data visualization (i.e., dat
await page.goto('./', { waitUntil: 'domcontentloaded' });
});

test('Can click on telemetry and see data in inspector', async ({ page }) => {
test('Can click on telemetry and see data in inspector', async ({ page, context }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should have had a @2p

const exampleDataVisualizationSource = await createDomainObjectWithDefaults(page, {
type: 'Example Data Visualization Source'
});
Expand Down Expand Up @@ -67,5 +67,16 @@ test.describe('Testing numeric data with inspector data visualization (i.e., dat
page.locator('span.plot-series-name', { hasText: 'Second Sine Wave Generator Hz' })
).toBeVisible();
await expect(page.locator('.js-series-data-loaded')).toBeVisible();

// test new tab
await page.getByLabel('Inspector Views').getByLabel('More actions').click();
const pagePromise = context.waitForEvent('page');
await page.getByRole('menuitem', { name: /Open In New Tab/ }).click();

// ensure our new tab's title is correct
const newPage = await pagePromise;
await newPage.waitForLoadState();
// expect new tab title to contain 'Second Sine Wave Generator'
await expect(newPage).toHaveTitle('Second Sine Wave Generator');
});
});
68 changes: 68 additions & 0 deletions e2e/tests/functional/plugins/lad/ladSet.e2e.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2024, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

import { createDomainObjectWithDefaults } from '../../../../appActions.js';
import { expect, test } from '../../../../pluginFixtures.js';

test.describe('LAD Table Sets', () => {
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });

const ladTableSet = await createDomainObjectWithDefaults(page, {
type: 'LAD Table Set'
});

const firstLadTable = await createDomainObjectWithDefaults(page, {
type: 'LAD Table',
parent: ladTableSet.uuid
});

await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
parent: firstLadTable.uuid
});

const secondLadTable = await createDomainObjectWithDefaults(page, {
type: 'LAD Table',
parent: ladTableSet.uuid
});

await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
parent: secondLadTable.uuid
});

await page.goto(ladTableSet.url);
});

test('Ensure we have numbers in cells', async ({ page }) => {
const valueFromFirstSineWave = await page.locator('.js-third-data').first().innerText();
const firstSineWaveNumber = parseFloat(valueFromFirstSineWave);
// ensure we have a float value in the cell and it's finite
expect(Number.isFinite(firstSineWaveNumber)).toBeTruthy();

const valueFromSecondSineWave = await page.locator('.js-third-data').last().innerText();
const secondSineWaveNumber = parseFloat(valueFromSecondSineWave);
// ensure we have a float value in the cell and it's finite
expect(Number.isFinite(secondSineWaveNumber)).toBeTruthy();
});
});
5 changes: 3 additions & 2 deletions src/plugins/LADTable/LadTableSetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class LadTableSetView {
this.component = null;
}

show(element) {
show(element, isEditing, { renderWhenVisible }) {
let ladTableConfiguration = new LADTableConfiguration(this.domainObject, this.openmct);

const { vNode, destroy } = mount(
Expand All @@ -47,7 +47,8 @@ export default class LadTableSetView {
openmct: this.openmct,
objectPath: this.objectPath,
currentView: this,
ladTableConfiguration
ladTableConfiguration,
renderWhenVisible
},
data: () => {
return {
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/LADTable/components/LadTableConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ export default {
ladTable.domainObject = domainObject;
ladTable.key = this.openmct.objects.makeKeyString(domainObject.identifier);

if (!this.ladTelemetryObjects) {
this.ladTelemetryObjects = {};
}
this.ladTelemetryObjects[ladTable.key] = [];
this.ladTableObjects.push(ladTable);

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/LADTable/pluginSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ describe('The LAD Table Set', () => {
(viewProvider) => viewProvider.key === ladTableSetKey
);
ladTableSetView = ladTableSetViewProvider.view(mockObj.ladTableSet, [mockObj.ladTableSet]);
ladTableSetView.show(child);
ladTableSetView.show(child, false, { renderWhenVisible });

return nextTick();
});
Expand Down
12 changes: 5 additions & 7 deletions src/plugins/inspectorDataVisualization/TelemetryFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ export default {
this.showMenu = !this.showMenu;
},
async getTelemetryPath() {
let sourceTelem;
if (this.telemetryObject.type === 'yamcs.telemetry') {
sourceTelem = this.openmct.objects.makeKeyString(this.telemetryObject.identifier);
} else if (this.telemetryObject.type === 'yamcs.image') {
sourceTelem = this.openmct.objects.makeKeyString(this.telemetryObject.identifier);
}
const telemetryPath = await this.openmct.objects.getOriginalPath(sourceTelem);
const telemetryObjectKeyString = this.openmct.objects.makeKeyString(
this.telemetryObject.identifier
);

const telemetryPath = await this.openmct.objects.getOriginalPath(telemetryObjectKeyString);
return telemetryPath;
},
async openInNewTab() {
Expand Down