Skip to content

Commit

Permalink
Merge branch 'master' into mct5994
Browse files Browse the repository at this point in the history
  • Loading branch information
unlikelyzero committed Jan 26, 2023
2 parents 4972d8e + 3ae6290 commit b2b2276
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 25 deletions.
Expand Up @@ -32,8 +32,7 @@ test.describe('Display Layout', () => {

// Create Sine Wave Generator
sineWaveObject = await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
name: "Test Sine Wave Generator"
type: 'Sine Wave Generator'
});
});
test('alpha-numeric widget telemetry value exactly matches latest telemetry value received in real time', async ({ page }) => {
Expand Down Expand Up @@ -137,7 +136,7 @@ test.describe('Display Layout', () => {
await page.locator('.c-tree__item.is-navigated-object .c-disclosure-triangle').click();

// Bring up context menu and remove
await page.locator('.c-tree__item.is-alias .c-tree__item__name:text("Test Sine Wave Generator")').first().click({ button: 'right' });
await sineWaveGeneratorTreeItem.nth(1).click({ button: 'right' });
await page.locator('li[role="menuitem"]:has-text("Remove")').click();
await page.locator('button:has-text("OK")').click();

Expand All @@ -152,8 +151,7 @@ test.describe('Display Layout', () => {
});
// Create a Display Layout
const displayLayout = await createDomainObjectWithDefaults(page, {
type: 'Display Layout',
name: "Test Display Layout"
type: 'Display Layout'
});
// Edit Display Layout
await page.locator('[title="Edit"]').click();
Expand Down Expand Up @@ -181,7 +179,7 @@ test.describe('Display Layout', () => {
await page.goto(sineWaveObject.url);

// Bring up context menu and remove
await page.locator('.c-tree__item.is-alias .c-tree__item__name:text("Test Sine Wave Generator")').click({ button: 'right' });
await sineWaveGeneratorTreeItem.first().click({ button: 'right' });
await page.locator('li[role="menuitem"]:has-text("Remove")').click();
await page.locator('button:has-text("OK")').click();

Expand Down
Expand Up @@ -25,35 +25,40 @@ const { createDomainObjectWithDefaults } = require('../../../../appActions');

test.describe('Flexible Layout', () => {
let sineWaveObject;
let clockObject;
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'networkidle' });

// Create Sine Wave Generator
sineWaveObject = await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
name: "Test Sine Wave Generator"
type: 'Sine Wave Generator'
});

// Create Clock Object
await createDomainObjectWithDefaults(page, {
type: 'Clock',
name: "Test Clock"
clockObject = await createDomainObjectWithDefaults(page, {
type: 'Clock'
});
});
test('panes have the appropriate draggable attribute while in Edit and Browse modes', async ({ page }) => {
const treePane = page.locator('#tree-pane');
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
name: new RegExp(sineWaveObject.name)
});
const clockTreeItem = treePane.getByRole('treeitem', {
name: new RegExp(clockObject.name)
});
// Create a Flexible Layout
await createDomainObjectWithDefaults(page, {
type: 'Flexible Layout',
name: "Test Flexible Layout"
type: 'Flexible Layout'
});
// Edit Flexible Layout
await page.locator('[title="Edit"]').click();

// Expand the 'My Items' folder in the left tree
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click();
// Add the Sine Wave Generator and Clock to the Flexible Layout
await page.dragAndDrop('text=Test Sine Wave Generator', '.c-fl__container.is-empty');
await page.dragAndDrop('text=Test Clock', '.c-fl__container.is-empty');
await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first());
await clockTreeItem.dragTo(page.locator('.c-fl__container.is-empty'));
// Check that panes can be dragged while Flexible Layout is in Edit mode
let dragWrapper = page.locator('.c-fl-container__frames-holder .c-fl-frame__drag-wrapper').first();
await expect(dragWrapper).toHaveAttribute('draggable', 'true');
Expand All @@ -65,18 +70,21 @@ test.describe('Flexible Layout', () => {
await expect(dragWrapper).toHaveAttribute('draggable', 'false');
});
test('items in a flexible layout can be removed with object tree context menu when viewing the flexible layout', async ({ page }) => {
const treePane = page.locator('#tree-pane');
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
name: new RegExp(sineWaveObject.name)
});
// Create a Display Layout
await createDomainObjectWithDefaults(page, {
type: 'Flexible Layout',
name: "Test Flexible Layout"
type: 'Flexible Layout'
});
// Edit Flexible Layout
await page.locator('[title="Edit"]').click();

// Expand the 'My Items' folder in the left tree
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').first().click();
// Add the Sine Wave Generator to the Flexible Layout and save changes
await page.dragAndDrop('text=Test Sine Wave Generator', '.c-fl__container.is-empty');
await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first());
await page.locator('button[title="Save"]').click();
await page.locator('text=Save and Finish Editing').click();

Expand All @@ -86,7 +94,7 @@ test.describe('Flexible Layout', () => {
await page.locator('.c-tree__item.is-navigated-object .c-disclosure-triangle').click();

// Bring up context menu and remove
await page.locator('.c-tree__item.is-alias .c-tree__item__name:text("Test Sine Wave Generator")').first().click({ button: 'right' });
await sineWaveGeneratorTreeItem.first().click({ button: 'right' });
await page.locator('li[role="menuitem"]:has-text("Remove")').click();
await page.locator('button:has-text("OK")').click();

Expand All @@ -98,18 +106,22 @@ test.describe('Flexible Layout', () => {
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/3117'
});
const treePane = page.locator('#tree-pane');
const sineWaveGeneratorTreeItem = treePane.getByRole('treeitem', {
name: new RegExp(sineWaveObject.name)
});

// Create a Flexible Layout
const flexibleLayout = await createDomainObjectWithDefaults(page, {
type: 'Flexible Layout',
name: "Test Flexible Layout"
type: 'Flexible Layout'
});
// Edit Flexible Layout
await page.locator('[title="Edit"]').click();

// Expand the 'My Items' folder in the left tree
await page.locator('.c-tree__item__view-control.c-disclosure-triangle').click();
// Add the Sine Wave Generator to the Flexible Layout and save changes
await page.dragAndDrop('text=Test Sine Wave Generator', '.c-fl__container.is-empty');
await sineWaveGeneratorTreeItem.dragTo(page.locator('.c-fl__container.is-empty').first());
await page.locator('button[title="Save"]').click();
await page.locator('text=Save and Finish Editing').click();

Expand All @@ -122,7 +134,7 @@ test.describe('Flexible Layout', () => {
await page.goto(sineWaveObject.url);

// Bring up context menu and remove
await page.locator('.c-tree__item.is-alias .c-tree__item__name:text("Test Sine Wave Generator")').click({ button: 'right' });
await sineWaveGeneratorTreeItem.first().click({ button: 'right' });
await page.locator('li[role="menuitem"]:has-text("Remove")').click();
await page.locator('button:has-text("OK")').click();

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/plot/configuration/SeriesCollection.js
Expand Up @@ -56,6 +56,10 @@ export default class SeriesCollection extends Collection {
const series = this.byIdentifier(seriesConfig.identifier);
if (series) {
series.persistedConfig = seriesConfig;
if (!series.persistedConfig.yAxisId) {
return;
}

if (series.get('yAxisId') !== series.persistedConfig.yAxisId) {
series.set('yAxisId', series.persistedConfig.yAxisId);
}
Expand Down
5 changes: 3 additions & 2 deletions src/ui/layout/recent-objects.scss
Expand Up @@ -26,7 +26,7 @@
align-items: flex-start;

> * + * {
margin-left: $interiorMargin;
margin-left: $interiorMarginSm;
}

+ .c-recentobjects-listitem {
Expand Down Expand Up @@ -58,7 +58,7 @@

&__type-icon {
color: $colorItemTreeIcon;
font-size: 2.2em;
font-size: 1.25em;

// TEMP: uses object-label component, hide label part
.c-object-label__name {
Expand All @@ -72,6 +72,7 @@

&__body {
flex: 1 1 auto;
padding-top: 2px; // Align with type icon

> * + * {
margin-top: $interiorMarginSm;
Expand Down

0 comments on commit b2b2276

Please sign in to comment.