Skip to content
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

Prevent Metadata Time System Error for Missing Objects #7565

Merged
merged 19 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .webpack/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default merge(common, {
__OPENMCT_ROOT_RELATIVE__: '""'
})
],
devtool: 'source-map'
devtool: 'eval-source-map'
});
35 changes: 18 additions & 17 deletions e2e/tests/functional/plugins/plot/missingPlotObj.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
Tests to verify log plot functionality when objects are missing
*/

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

test.describe('Handle missing object for plots', () => {
test('Displays empty div for missing stacked plot item @unstable', async ({
test('Displays empty div for missing stacked plot item', async ({
page,
browserName,
openmctConfig
Expand Down Expand Up @@ -66,12 +67,6 @@ test.describe('Handle missing object for plots', () => {
.soft(page.locator('.l-browse-bar__object-name'))
.toContainText('Unnamed Stacked Plot');

await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await Promise.all([
page.waitForNavigation(),
page.locator('text=Unnamed Stacked Plot').first().click()
]);

//Check that there is only one stacked item plot with a plot, the missing one will be empty
await expect(page.locator('.c-plot--stacked-container:has(.gl-plot)')).toHaveCount(1);
//Verify that console.warn is thrown
Expand Down Expand Up @@ -101,25 +96,31 @@ async function makeStackedPlot(page, myItemsFolderName) {
// save the stacked plot
await saveStackedPlot(page);

// expand My Items
await expandTreePaneItemByName(page, myItemsFolderName);

const stackedPlotTreeItem = page
.getByRole('tree', {
name: 'Main Tree'
})
.getByRole('treeitem', {
name: 'Unnamed Stacked Plot'
});

// click on stacked plot
await stackedPlotTreeItem.click();

// create a sinewave generator
await createSineWaveGenerator(page);

// click on stacked plot
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await Promise.all([
page.waitForNavigation(),
page.locator('text=Unnamed Stacked Plot').first().click()
]);
await stackedPlotTreeItem.click();

// create a second sinewave generator
await createSineWaveGenerator(page);

// click on stacked plot
await page.locator(`text=Open MCT ${myItemsFolderName} >> span`).nth(3).click();
await Promise.all([
page.waitForNavigation(),
page.locator('text=Unnamed Stacked Plot').first().click()
]);
await stackedPlotTreeItem.click();
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/api/telemetry/TelemetryCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@
} else {
this.timeKey = undefined;

this._warn(TIMESYSTEM_KEY_WARNING);
this.openmct.notifications.alert(TIMESYSTEM_KEY_NOTIFICATION);
if (!this.openmct.objects.isMissing(this.domainObject)) {
this._warn(TIMESYSTEM_KEY_WARNING);
this.openmct.notifications.alert(TIMESYSTEM_KEY_NOTIFICATION);

Check warning on line 447 in src/api/telemetry/TelemetryCollection.js

View check run for this annotation

Codecov / codecov/patch

src/api/telemetry/TelemetryCollection.js#L445-L447

Added lines #L445 - L447 were not covered by tests
}
}

let valueFormatter = this.openmct.telemetry.getValueFormatter(metadataValue);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plot/configuration/SeriesCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class SeriesCollection extends Collection {
const domainObject = this.plot.get('domainObject');
if (domainObject.telemetry) {
this.addTelemetryObject(domainObject);
} else {
} else if (!this.openmct.objects.isMissing(domainObject)) {
this.watchTelemetryContainer(domainObject);
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/plot/stackedPlot/StackedPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ export default {
},

addChild(child) {
if (!this.openmct.objects.isMissing(child)) {
return;
}

const id = this.openmct.objects.makeKeyString(child.identifier);

this.tickWidthMap[id] = {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plot/stackedPlot/StackedPlotItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default {

if (this.openmct.telemetry.isTelemetryObject(plotObject)) {
this.subscribeToStaleness(plotObject);
} else {
} else if (!this.openmct.objects.isMissing(plotObject)) {
// possibly overlay or other composition based plot
this.composition = this.openmct.composition.get(plotObject);

Expand Down
Loading