Compare commits
18 Commits
plots-fix-
...
persistenc
Author | SHA1 | Date | |
---|---|---|---|
5de5ff347c | |||
2bfe632e7e | |||
4ac39a3990 | |||
169d148c58 | |||
40d2f3295f | |||
0e707150e0 | |||
2540d96617 | |||
1c8784fec5 | |||
2943d2b6ec | |||
4246a597a9 | |||
0af7965021 | |||
e9c0909415 | |||
0f0a3dc48f | |||
4c82680b87 | |||
c4734b8ad6 | |||
9786ff5de4 | |||
437154a5c0 | |||
2bd38dab9f |
3
.github/workflows/e2e-pr.yml
vendored
@ -30,7 +30,8 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
- run: npx playwright@1.21.1 install
|
- run: npx playwright@1.23.0 install
|
||||||
|
- run: npx playwright install chrome-beta
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run test:e2e:full
|
- run: npm run test:e2e:full
|
||||||
- name: Archive test results
|
- name: Archive test results
|
||||||
|
2
.github/workflows/e2e-visual.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '16'
|
||||||
- run: npx playwright@1.21.1 install
|
- run: npx playwright@1.23.0 install
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- name: Run the e2e visual tests
|
- name: Run the e2e visual tests
|
||||||
run: npm run test:e2e:visual
|
run: npm run test:e2e:visual
|
||||||
|
13
app.js
@ -12,6 +12,7 @@ const express = require('express');
|
|||||||
const app = express();
|
const app = express();
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const request = require('request');
|
const request = require('request');
|
||||||
|
const __DEV__ = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
options.port = options.port || options.p || 8080;
|
options.port = options.port || options.p || 8080;
|
||||||
@ -49,14 +50,18 @@ class WatchRunPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const webpackConfig = process.env.CI ? require('./webpack.coverage.js') : require('./webpack.dev.js');
|
let webpackConfig;
|
||||||
|
if (__DEV__) {
|
||||||
|
webpackConfig = require('./webpack.dev');
|
||||||
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||||
webpackConfig.plugins.push(new WatchRunPlugin());
|
|
||||||
|
|
||||||
webpackConfig.entry.openmct = [
|
webpackConfig.entry.openmct = [
|
||||||
'webpack-hot-middleware/client?reload=true',
|
'webpack-hot-middleware/client?reload=true',
|
||||||
webpackConfig.entry.openmct
|
webpackConfig.entry.openmct
|
||||||
];
|
];
|
||||||
|
webpackConfig.plugins.push(new WatchRunPlugin());
|
||||||
|
} else {
|
||||||
|
webpackConfig = require('./webpack.coverage');
|
||||||
|
}
|
||||||
|
|
||||||
const compiler = webpack(webpackConfig);
|
const compiler = webpack(webpackConfig);
|
||||||
|
|
||||||
@ -68,10 +73,12 @@ app.use(require('webpack-dev-middleware')(
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
if (__DEV__) {
|
||||||
app.use(require('webpack-hot-middleware')(
|
app.use(require('webpack-hot-middleware')(
|
||||||
compiler,
|
compiler,
|
||||||
{}
|
{}
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
|
||||||
// Expose index.html for development users.
|
// Expose index.html for development users.
|
||||||
app.get('/', function (req, res) {
|
app.get('/', function (req, res) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const { devices } = require('@playwright/test');
|
const { devices } = require('@playwright/test');
|
||||||
|
const MAX_FAILURES = 5;
|
||||||
|
const NUM_WORKERS = 2;
|
||||||
|
|
||||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
@ -12,20 +14,20 @@ const config = {
|
|||||||
testIgnore: '**/*.perf.spec.js', //Ignore performance tests and define in playwright-perfromance.config.js
|
testIgnore: '**/*.perf.spec.js', //Ignore performance tests and define in playwright-perfromance.config.js
|
||||||
timeout: 60 * 1000,
|
timeout: 60 * 1000,
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start',
|
command: 'cross-env NODE_ENV=test npm run start',
|
||||||
url: 'http://localhost:8080/#',
|
url: 'http://localhost:8080/#',
|
||||||
timeout: 200 * 1000,
|
timeout: 200 * 1000,
|
||||||
reuseExistingServer: !process.env.CI
|
reuseExistingServer: false
|
||||||
},
|
},
|
||||||
maxFailures: process.env.CI ? 5 : undefined, //Limits failures to 5 to reduce CI Waste
|
maxFailures: MAX_FAILURES, //Limits failures to 5 to reduce CI Waste
|
||||||
workers: 2, //Limit to 2 for CircleCI Agent
|
workers: NUM_WORKERS, //Limit to 2 for CircleCI Agent
|
||||||
use: {
|
use: {
|
||||||
baseURL: 'http://localhost:8080/',
|
baseURL: 'http://localhost:8080/',
|
||||||
headless: true,
|
headless: true,
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
screenshot: 'only-on-failure',
|
screenshot: 'only-on-failure',
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
video: 'on-first-retry'
|
video: 'off'
|
||||||
},
|
},
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
|
@ -12,10 +12,10 @@ const config = {
|
|||||||
testIgnore: '**/*.perf.spec.js',
|
testIgnore: '**/*.perf.spec.js',
|
||||||
timeout: 30 * 1000,
|
timeout: 30 * 1000,
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start',
|
command: 'cross-env NODE_ENV=test npm run start',
|
||||||
url: 'http://localhost:8080/#',
|
url: 'http://localhost:8080/#',
|
||||||
timeout: 120 * 1000,
|
timeout: 120 * 1000,
|
||||||
reuseExistingServer: !process.env.CI
|
reuseExistingServer: true
|
||||||
},
|
},
|
||||||
workers: 1,
|
workers: 1,
|
||||||
use: {
|
use: {
|
||||||
@ -25,7 +25,7 @@ const config = {
|
|||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
screenshot: 'only-on-failure',
|
screenshot: 'only-on-failure',
|
||||||
trace: 'retain-on-failure',
|
trace: 'retain-on-failure',
|
||||||
video: 'retain-on-failure'
|
video: 'off'
|
||||||
},
|
},
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// playwright.config.js
|
// playwright.config.js
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
|
const CI = process.env.CI === 'true';
|
||||||
|
|
||||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
retries: 1, //Only for debugging purposes because trace is enabled only on first retry
|
retries: 1, //Only for debugging purposes because trace is enabled only on first retry
|
||||||
@ -9,15 +11,15 @@ const config = {
|
|||||||
timeout: 60 * 1000,
|
timeout: 60 * 1000,
|
||||||
workers: 1, //Only run in serial with 1 worker
|
workers: 1, //Only run in serial with 1 worker
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start',
|
command: 'cross-env NODE_ENV=test npm run start',
|
||||||
url: 'http://localhost:8080/#',
|
url: 'http://localhost:8080/#',
|
||||||
timeout: 200 * 1000,
|
timeout: 200 * 1000,
|
||||||
reuseExistingServer: !process.env.CI
|
reuseExistingServer: !CI
|
||||||
},
|
},
|
||||||
use: {
|
use: {
|
||||||
browserName: "chromium",
|
browserName: "chromium",
|
||||||
baseURL: 'http://localhost:8080/',
|
baseURL: 'http://localhost:8080/',
|
||||||
headless: Boolean(process.env.CI), //Only if running locally
|
headless: CI, //Only if running locally
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
screenshot: 'off',
|
screenshot: 'off',
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
|
@ -9,7 +9,7 @@ const config = {
|
|||||||
timeout: 90 * 1000,
|
timeout: 90 * 1000,
|
||||||
workers: 1, // visual tests should never run in parallel due to test pollution
|
workers: 1, // visual tests should never run in parallel due to test pollution
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'npm run start',
|
command: 'cross-env NODE_ENV=test npm run start',
|
||||||
url: 'http://localhost:8080/#',
|
url: 'http://localhost:8080/#',
|
||||||
timeout: 200 * 1000,
|
timeout: 200 * 1000,
|
||||||
reuseExistingServer: !process.env.CI
|
reuseExistingServer: !process.env.CI
|
||||||
@ -21,7 +21,7 @@ const config = {
|
|||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
screenshot: 'on',
|
screenshot: 'on',
|
||||||
trace: 'off',
|
trace: 'off',
|
||||||
video: 'on'
|
video: 'off'
|
||||||
},
|
},
|
||||||
reporter: [
|
reporter: [
|
||||||
['list'],
|
['list'],
|
||||||
|
@ -36,7 +36,7 @@ test.describe('Branding tests', () => {
|
|||||||
await page.click('.l-shell__app-logo');
|
await page.click('.l-shell__app-logo');
|
||||||
|
|
||||||
// Verify that the NASA Logo Appears
|
// Verify that the NASA Logo Appears
|
||||||
await expect(await page.locator('.c-about__image')).toBeVisible();
|
await expect(page.locator('.c-about__image')).toBeVisible();
|
||||||
|
|
||||||
// Modify the Build information in 'about' Modal
|
// Modify the Build information in 'about' Modal
|
||||||
const versionInformationLocator = page.locator('ul.t-info.l-info.s-info');
|
const versionInformationLocator = page.locator('ul.t-info.l-info.s-info');
|
||||||
|
55
e2e/tests/framework.e2e.spec.js
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
This test suite is dedicated to testing our use of the playwright framework as it
|
||||||
|
relates to how we've extended it (i.e. ./e2e/fixtures.js) and assumptions made in our dev environment
|
||||||
|
(app.js and ./e2e/webpack-dev-middleware.js)
|
||||||
|
*/
|
||||||
|
|
||||||
|
const { test } = require('../fixtures.js');
|
||||||
|
|
||||||
|
test.describe('fixtures.js tests', () => {
|
||||||
|
test('Verify that tests fail if console.error is thrown', async ({ page }) => {
|
||||||
|
test.fail();
|
||||||
|
//Go to baseURL
|
||||||
|
await page.goto('/', { waitUntil: 'networkidle' });
|
||||||
|
|
||||||
|
//Verify that ../fixtures.js detects console log errors
|
||||||
|
await Promise.all([
|
||||||
|
page.evaluate(() => console.error('This should result in a failure')),
|
||||||
|
page.waitForEvent('console') // always wait for the event to happen while triggering it!
|
||||||
|
]);
|
||||||
|
|
||||||
|
});
|
||||||
|
test('Verify that tests pass if console.warn is thrown', async ({ page }) => {
|
||||||
|
//Go to baseURL
|
||||||
|
await page.goto('/', { waitUntil: 'networkidle' });
|
||||||
|
|
||||||
|
//Verify that ../fixtures.js detects console log errors
|
||||||
|
await Promise.all([
|
||||||
|
page.evaluate(() => console.warn('This should result in a pass')),
|
||||||
|
page.waitForEvent('console') // always wait for the event to happen while triggering it!
|
||||||
|
]);
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
@ -55,16 +55,13 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
await context.storageState({ path: './e2e/test-data/recycled_local_storage.json' });
|
await context.storageState({ path: './e2e/test-data/recycled_local_storage.json' });
|
||||||
|
|
||||||
//Set object identifier from url
|
//Set object identifier from url
|
||||||
conditionSetUrl = await page.url();
|
conditionSetUrl = page.url();
|
||||||
console.log('conditionSetUrl ' + conditionSetUrl);
|
console.log('conditionSetUrl ' + conditionSetUrl);
|
||||||
|
|
||||||
getConditionSetIdentifierFromUrl = await conditionSetUrl.split('/').pop().split('?')[0];
|
getConditionSetIdentifierFromUrl = conditionSetUrl.split('/').pop().split('?')[0];
|
||||||
console.debug('getConditionSetIdentifierFromUrl ' + getConditionSetIdentifierFromUrl);
|
console.debug('getConditionSetIdentifierFromUrl ' + getConditionSetIdentifierFromUrl);
|
||||||
await page.close();
|
|
||||||
});
|
|
||||||
test.afterAll(async ({ browser }) => {
|
|
||||||
await browser.close();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Load localStorage for subsequent tests
|
//Load localStorage for subsequent tests
|
||||||
test.use({ storageState: './e2e/test-data/recycled_local_storage.json' });
|
test.use({ storageState: './e2e/test-data/recycled_local_storage.json' });
|
||||||
//Begin suite of tests again localStorage
|
//Begin suite of tests again localStorage
|
||||||
@ -76,7 +73,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
||||||
|
|
||||||
//Assertions on loaded Condition Set in Inspector
|
//Assertions on loaded Condition Set in Inspector
|
||||||
await expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy;
|
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
|
||||||
|
|
||||||
//Reload Page
|
//Reload Page
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
@ -87,7 +84,7 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
//Re-verify after reload
|
//Re-verify after reload
|
||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
|
||||||
//Assertions on loaded Condition Set in Inspector
|
//Assertions on loaded Condition Set in Inspector
|
||||||
await expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy;
|
expect.soft(page.locator('_vue=item.name=Unnamed Condition Set')).toBeTruthy();
|
||||||
|
|
||||||
});
|
});
|
||||||
test('condition set object can be modified on @localStorage', async ({ page }) => {
|
test('condition set object can be modified on @localStorage', async ({ page }) => {
|
||||||
@ -113,18 +110,18 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
|
|
||||||
// Verify Inspector properties
|
// Verify Inspector properties
|
||||||
// Verify Inspector has updated Name property
|
// Verify Inspector has updated Name property
|
||||||
await expect.soft(page.locator('text=Renamed Condition Set').nth(1)).toBeTruthy();
|
expect.soft(page.locator('text=Renamed Condition Set').nth(1)).toBeTruthy();
|
||||||
// Verify Inspector Details has updated Name property
|
// Verify Inspector Details has updated Name property
|
||||||
await expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
||||||
|
|
||||||
// Verify Tree reflects updated Name proprety
|
// Verify Tree reflects updated Name proprety
|
||||||
// Expand Tree
|
// Expand Tree
|
||||||
await page.locator('text=Open MCT My Items >> span >> nth=3').click();
|
await page.locator('text=Open MCT My Items >> span >> nth=3').click();
|
||||||
// Verify Condition Set Object is renamed in Tree
|
// Verify Condition Set Object is renamed in Tree
|
||||||
await expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
||||||
// Verify Search Tree reflects renamed Name property
|
// Verify Search Tree reflects renamed Name property
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Renamed');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Renamed');
|
||||||
await expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
||||||
|
|
||||||
//Reload Page
|
//Reload Page
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
@ -137,18 +134,18 @@ test.describe.serial('Condition Set CRUD Operations on @localStorage', () => {
|
|||||||
|
|
||||||
// Verify Inspector properties
|
// Verify Inspector properties
|
||||||
// Verify Inspector has updated Name property
|
// Verify Inspector has updated Name property
|
||||||
await expect.soft(page.locator('text=Renamed Condition Set').nth(1)).toBeTruthy();
|
expect.soft(page.locator('text=Renamed Condition Set').nth(1)).toBeTruthy();
|
||||||
// Verify Inspector Details has updated Name property
|
// Verify Inspector Details has updated Name property
|
||||||
await expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
expect.soft(page.locator('text=Renamed Condition Set').nth(2)).toBeTruthy();
|
||||||
|
|
||||||
// Verify Tree reflects updated Name proprety
|
// Verify Tree reflects updated Name proprety
|
||||||
// Expand Tree
|
// Expand Tree
|
||||||
await page.locator('text=Open MCT My Items >> span >> nth=3').click();
|
await page.locator('text=Open MCT My Items >> span >> nth=3').click();
|
||||||
// Verify Condition Set Object is renamed in Tree
|
// Verify Condition Set Object is renamed in Tree
|
||||||
await expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
||||||
// Verify Search Tree reflects renamed Name property
|
// Verify Search Tree reflects renamed Name property
|
||||||
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Renamed');
|
await page.locator('[aria-label="OpenMCT Search"] input[type="search"]').fill('Renamed');
|
||||||
await expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
expect(page.locator('a:has-text("Renamed Condition Set")')).toBeTruthy();
|
||||||
});
|
});
|
||||||
test('condition set object can be deleted by Search Tree Actions menu on @localStorage', async ({ page }) => {
|
test('condition set object can be deleted by Search Tree Actions menu on @localStorage', async ({ page }) => {
|
||||||
//Navigate to baseURL
|
//Navigate to baseURL
|
||||||
|
@ -172,7 +172,8 @@ test.describe('Example Imagery Object', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can use the reset button to reset the image', async ({ page }) => {
|
test('Can use the reset button to reset the image', async ({ page }, testInfo) => {
|
||||||
|
test.slow(testInfo.project === 'chrome-beta', "This test is slow in chrome-beta");
|
||||||
// wait for zoom animation to finish
|
// wait for zoom animation to finish
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
await page.locator(backgroundImageSelector).hover({trial: true});
|
||||||
|
|
||||||
@ -191,16 +192,17 @@ test.describe('Example Imagery Object', () => {
|
|||||||
expect.soft(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height);
|
expect.soft(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height);
|
||||||
expect.soft(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width);
|
expect.soft(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width);
|
||||||
|
|
||||||
await zoomResetBtn.click();
|
|
||||||
// wait for zoom animation to finish
|
// wait for zoom animation to finish
|
||||||
await page.locator(backgroundImageSelector).hover({trial: true});
|
// FIXME: The zoom is flakey, sometimes not returning to original dimensions
|
||||||
|
// https://github.com/nasa/openmct/issues/5491
|
||||||
|
await expect.poll(async () => {
|
||||||
|
await zoomResetBtn.click();
|
||||||
|
const boundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
||||||
|
|
||||||
const resetBoundingBox = await page.locator(backgroundImageSelector).boundingBox();
|
return boundingBox;
|
||||||
expect.soft(resetBoundingBox.height).toBeLessThan(zoomedInBoundingBox.height);
|
}, {
|
||||||
expect.soft(resetBoundingBox.width).toBeLessThan(zoomedInBoundingBox.width);
|
timeout: 10 * 1000
|
||||||
|
}).toEqual(initialBoundingBox);
|
||||||
expect.soft(resetBoundingBox.height).toEqual(initialBoundingBox.height);
|
|
||||||
expect(resetBoundingBox.width).toEqual(initialBoundingBox.width);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Using the zoom features does not pause telemetry', async ({ page }) => {
|
test('Using the zoom features does not pause telemetry', async ({ page }) => {
|
||||||
|
@ -35,7 +35,7 @@ test.describe('Restricted Notebook', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Can be renamed @addInit', async ({ page }) => {
|
test('Can be renamed @addInit', async ({ page }) => {
|
||||||
await expect.soft(page.locator('.l-browse-bar__object-name')).toContainText(`Unnamed ${CUSTOM_NAME}`);
|
await expect(page.locator('.l-browse-bar__object-name')).toContainText(`Unnamed ${CUSTOM_NAME}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can be deleted if there are no locked pages @addInit', async ({ page }) => {
|
test('Can be deleted if there are no locked pages @addInit', async ({ page }) => {
|
||||||
@ -52,16 +52,15 @@ test.describe('Restricted Notebook', () => {
|
|||||||
// Click Remove Text
|
// Click Remove Text
|
||||||
await page.locator('text=Remove').click();
|
await page.locator('text=Remove').click();
|
||||||
|
|
||||||
//Wait until Save Banner is gone
|
// Click 'OK' on confirmation window and wait for save banner to appear
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForNavigation(),
|
page.waitForNavigation(),
|
||||||
page.locator('text=OK').click(),
|
page.locator('text=OK').click(),
|
||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
await page.locator('.c-message-banner__close-button').click();
|
|
||||||
|
|
||||||
// has been deleted
|
// has been deleted
|
||||||
expect.soft(await restrictedNotebookTreeObject.count()).toEqual(0);
|
expect(await restrictedNotebookTreeObject.count()).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can be locked if at least one page has one entry @addInit', async ({ page }) => {
|
test('Can be locked if at least one page has one entry @addInit', async ({ page }) => {
|
||||||
@ -69,7 +68,7 @@ test.describe('Restricted Notebook', () => {
|
|||||||
await enterTextEntry(page);
|
await enterTextEntry(page);
|
||||||
|
|
||||||
const commitButton = page.locator('button:has-text("Commit Entries")');
|
const commitButton = page.locator('button:has-text("Commit Entries")');
|
||||||
expect.soft(await commitButton.count()).toEqual(1);
|
expect(await commitButton.count()).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -81,11 +80,17 @@ test.describe('Restricted Notebook with at least one entry and with the page loc
|
|||||||
await enterTextEntry(page);
|
await enterTextEntry(page);
|
||||||
await lockPage(page);
|
await lockPage(page);
|
||||||
|
|
||||||
|
// FIXME: Give ample time for the mutation to happen
|
||||||
|
// https://github.com/nasa/openmct/issues/5409
|
||||||
|
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||||
|
await page.waitForTimeout(1 * 1000);
|
||||||
|
|
||||||
// open sidebar
|
// open sidebar
|
||||||
await page.locator('button.c-notebook__toggle-nav-button').click();
|
await page.locator('button.c-notebook__toggle-nav-button').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Locked page should now be in a locked state @addInit', async ({ page }) => {
|
test('Locked page should now be in a locked state @addInit', async ({ page }, testInfo) => {
|
||||||
|
test.fixme(testInfo.project === 'chrome-beta', "Test is unreliable on chrome-beta");
|
||||||
// main lock message on page
|
// main lock message on page
|
||||||
const lockMessage = page.locator('text=This page has been committed and cannot be modified or removed');
|
const lockMessage = page.locator('text=This page has been committed and cannot be modified or removed');
|
||||||
expect.soft(await lockMessage.count()).toEqual(1);
|
expect.soft(await lockMessage.count()).toEqual(1);
|
||||||
@ -96,11 +101,9 @@ test.describe('Restricted Notebook with at least one entry and with the page loc
|
|||||||
|
|
||||||
// no way to remove a restricted notebook with a locked page
|
// no way to remove a restricted notebook with a locked page
|
||||||
await openContextMenuRestrictedNotebook(page);
|
await openContextMenuRestrictedNotebook(page);
|
||||||
|
|
||||||
const menuOptions = page.locator('.c-menu ul');
|
const menuOptions = page.locator('.c-menu ul');
|
||||||
|
|
||||||
await expect.soft(menuOptions).not.toContainText('Remove');
|
await expect(menuOptions).not.toContainText('Remove');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can still: add page, rename, add entry, delete unlocked pages @addInit', async ({ page }) => {
|
test('Can still: add page, rename, add entry, delete unlocked pages @addInit', async ({ page }) => {
|
||||||
@ -139,7 +142,7 @@ test.describe('Restricted Notebook with at least one entry and with the page loc
|
|||||||
|
|
||||||
// deleted page, should no longer exist
|
// deleted page, should no longer exist
|
||||||
const deletedPageElement = page.locator(`text=${TEST_TEXT_NAME}`);
|
const deletedPageElement = page.locator(`text=${TEST_TEXT_NAME}`);
|
||||||
expect.soft(await deletedPageElement.count()).toEqual(0);
|
expect(await deletedPageElement.count()).toEqual(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -155,7 +158,7 @@ test.describe('Restricted Notebook with a page locked and with an embed @addInit
|
|||||||
await page.locator('.c-ne__embed__name .c-popup-menu-button').click(); // embed popup menu
|
await page.locator('.c-ne__embed__name .c-popup-menu-button').click(); // embed popup menu
|
||||||
|
|
||||||
const embedMenu = page.locator('body >> .c-menu');
|
const embedMenu = page.locator('body >> .c-menu');
|
||||||
await expect.soft(embedMenu).toContainText('Remove This Embed');
|
await expect(embedMenu).toContainText('Remove This Embed');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Disallows embeds to be deleted if page locked @addInit', async ({ page }) => {
|
test('Disallows embeds to be deleted if page locked @addInit', async ({ page }) => {
|
||||||
@ -164,7 +167,7 @@ test.describe('Restricted Notebook with a page locked and with an embed @addInit
|
|||||||
await page.locator('.c-ne__embed__name .c-popup-menu-button').click(); // embed popup menu
|
await page.locator('.c-ne__embed__name .c-popup-menu-button').click(); // embed popup menu
|
||||||
|
|
||||||
const embedMenu = page.locator('body >> .c-menu');
|
const embedMenu = page.locator('body >> .c-menu');
|
||||||
await expect.soft(embedMenu).not.toContainText('Remove This Embed');
|
await expect(embedMenu).not.toContainText('Remove This Embed');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -232,28 +235,18 @@ async function lockPage(page) {
|
|||||||
await commitButton.click();
|
await commitButton.click();
|
||||||
|
|
||||||
//Wait until Lock Banner is visible
|
//Wait until Lock Banner is visible
|
||||||
await Promise.all([
|
await page.locator('text=Lock Page').click();
|
||||||
page.locator('text=Lock Page').click(),
|
|
||||||
page.waitForSelector('.c-message-banner__message')
|
|
||||||
]);
|
|
||||||
// Close Lock Banner
|
|
||||||
await page.locator('.c-message-banner__close-button').click();
|
|
||||||
|
|
||||||
//artifically wait to avoid mutation delay TODO: https://github.com/nasa/openmct/issues/5409
|
|
||||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
|
||||||
await page.waitForTimeout(1 * 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
*/
|
*/
|
||||||
async function openContextMenuRestrictedNotebook(page) {
|
async function openContextMenuRestrictedNotebook(page) {
|
||||||
// Click text=Open MCT My Items (This expands the My Items folder to show it's chilren in the tree)
|
const myItemsFolder = page.locator('text=Open MCT My Items >> span').nth(3);
|
||||||
await page.locator('text=Open MCT My Items >> span').nth(3).click();
|
const className = await myItemsFolder.getAttribute('class');
|
||||||
|
if (!className.includes('c-disclosure-triangle--expanded')) {
|
||||||
//artifically wait to avoid mutation delay TODO: https://github.com/nasa/openmct/issues/5409
|
await myItemsFolder.click();
|
||||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
}
|
||||||
await page.waitForTimeout(1 * 1000);
|
|
||||||
|
|
||||||
// Click a:has-text("Unnamed CUSTOM_NAME")
|
// Click a:has-text("Unnamed CUSTOM_NAME")
|
||||||
await page.locator(`a:has-text("Unnamed ${CUSTOM_NAME}")`).click({
|
await page.locator(`a:has-text("Unnamed ${CUSTOM_NAME}")`).click({
|
||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 21 KiB |
@ -28,11 +28,12 @@ const { test } = require('../../../fixtures.js');
|
|||||||
const { expect } = require('@playwright/test');
|
const { expect } = require('@playwright/test');
|
||||||
|
|
||||||
test.describe('Handle missing object for plots', () => {
|
test.describe('Handle missing object for plots', () => {
|
||||||
test('Displays empty div for missing stacked plot item', async ({ page }) => {
|
test('Displays empty div for missing stacked plot item', async ({ page, browserName }) => {
|
||||||
|
test.fixme(browserName === 'firefox', 'Firefox failing due to console events being missed');
|
||||||
const errorLogs = [];
|
const errorLogs = [];
|
||||||
|
|
||||||
page.on("console", (message) => {
|
page.on("console", (message) => {
|
||||||
if (message.type() === 'warning') {
|
if (message.type() === 'warning' && message.text().includes('Missing domain object')) {
|
||||||
errorLogs.push(message.text());
|
errorLogs.push(message.text());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -71,7 +72,7 @@ test.describe('Handle missing object for plots', () => {
|
|||||||
//Check that there is only one stacked item plot with a plot, the missing one will be empty
|
//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);
|
await expect(page.locator(".c-plot--stacked-container:has(.gl-plot)")).toHaveCount(1);
|
||||||
//Verify that console.warn is thrown
|
//Verify that console.warn is thrown
|
||||||
await expect(errorLogs).toHaveLength(1);
|
expect(errorLogs).toHaveLength(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -94,10 +95,6 @@ async function makeStackedPlot(page) {
|
|||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//Wait until Save Banner is gone
|
|
||||||
await page.locator('.c-message-banner__close-button').click();
|
|
||||||
await page.waitForSelector('.c-message-banner__message', { state: 'detached'});
|
|
||||||
|
|
||||||
// save the stacked plot
|
// save the stacked plot
|
||||||
await saveStackedPlot(page);
|
await saveStackedPlot(page);
|
||||||
|
|
||||||
@ -155,7 +152,4 @@ async function createSineWaveGenerator(page) {
|
|||||||
//Wait for Save Banner to appear
|
//Wait for Save Banner to appear
|
||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
//Wait until Save Banner is gone
|
|
||||||
await page.locator('.c-message-banner__close-button').click();
|
|
||||||
await page.waitForSelector('.c-message-banner__message', { state: 'detached'});
|
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,7 @@ async function triggerTimer3dotMenuAction(page, action) {
|
|||||||
* @param {TimerViewAction} action
|
* @param {TimerViewAction} action
|
||||||
*/
|
*/
|
||||||
async function triggerTimerViewAction(page, action) {
|
async function triggerTimerViewAction(page, action) {
|
||||||
|
await page.locator('.c-timer').hover({trial: true});
|
||||||
const buttonTitle = buttonTitleFromAction(action);
|
const buttonTitle = buttonTitleFromAction(action);
|
||||||
await page.click(`button[title="${buttonTitle}"]`);
|
await page.click(`button[title="${buttonTitle}"]`);
|
||||||
assertTimerStateAfterAction(page, action);
|
assertTimerStateAfterAction(page, action);
|
||||||
|
@ -52,9 +52,6 @@ test('Generate Visual Test Data @localStorage', async ({ page, context }) => {
|
|||||||
//Wait for Save Banner to appear1
|
//Wait for Save Banner to appear1
|
||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
//Wait until Save Banner is gone
|
|
||||||
await page.locator('.c-message-banner__close-button').click();
|
|
||||||
await page.waitForSelector('.c-message-banner__message', { state: 'detached'});
|
|
||||||
|
|
||||||
// save (exit edit mode)
|
// save (exit edit mode)
|
||||||
await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1).click();
|
await page.locator('text=Snapshot Save and Finish Editing Save and Continue Editing >> button').nth(1).click();
|
||||||
@ -69,18 +66,12 @@ test('Generate Visual Test Data @localStorage', async ({ page, context }) => {
|
|||||||
//Add a 5000 ms Delay
|
//Add a 5000 ms Delay
|
||||||
await page.locator('[aria-label="Loading Delay \\(ms\\)"]').fill('5000');
|
await page.locator('[aria-label="Loading Delay \\(ms\\)"]').fill('5000');
|
||||||
|
|
||||||
// Click on My Items in Tree. Workaround for https://github.com/nasa/openmct/issues/5184
|
|
||||||
await page.click('form[name="mctForm"] a:has-text("Overlay Plot")');
|
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
page.waitForNavigation(),
|
page.waitForNavigation(),
|
||||||
page.locator('text=OK').click(),
|
page.locator('text=OK').click(),
|
||||||
//Wait for Save Banner to appear1
|
//Wait for Save Banner to appear1
|
||||||
page.waitForSelector('.c-message-banner__message')
|
page.waitForSelector('.c-message-banner__message')
|
||||||
]);
|
]);
|
||||||
//Wait until Save Banner is gone
|
|
||||||
await page.locator('.c-message-banner__close-button').click();
|
|
||||||
await page.waitForSelector('.c-message-banner__message', { state: 'detached'});
|
|
||||||
|
|
||||||
// focus the overlay plot
|
// focus the overlay plot
|
||||||
await page.locator('text=Open MCT My Items >> span').nth(3).click();
|
await page.locator('text=Open MCT My Items >> span').nth(3).click();
|
||||||
|
@ -31,7 +31,7 @@ const STATUSES = [{
|
|||||||
iconClassPoll: "icon-status-poll-question-mark"
|
iconClassPoll: "icon-status-poll-question-mark"
|
||||||
}, {
|
}, {
|
||||||
key: "GO",
|
key: "GO",
|
||||||
label: "GO",
|
label: "Go",
|
||||||
iconClass: "icon-check",
|
iconClass: "icon-check",
|
||||||
iconClassPoll: "icon-status-poll-question-mark",
|
iconClassPoll: "icon-status-poll-question-mark",
|
||||||
statusClass: "s-status-ok",
|
statusClass: "s-status-ok",
|
||||||
@ -39,7 +39,7 @@ const STATUSES = [{
|
|||||||
statusFgColor: "#000"
|
statusFgColor: "#000"
|
||||||
}, {
|
}, {
|
||||||
key: "MAYBE",
|
key: "MAYBE",
|
||||||
label: "MAYBE",
|
label: "Maybe",
|
||||||
iconClass: "icon-alert-triangle",
|
iconClass: "icon-alert-triangle",
|
||||||
iconClassPoll: "icon-status-poll-question-mark",
|
iconClassPoll: "icon-status-poll-question-mark",
|
||||||
statusClass: "s-status-warning",
|
statusClass: "s-status-warning",
|
||||||
@ -47,7 +47,7 @@ const STATUSES = [{
|
|||||||
statusFgColor: "#000"
|
statusFgColor: "#000"
|
||||||
}, {
|
}, {
|
||||||
key: "NO_GO",
|
key: "NO_GO",
|
||||||
label: "NO GO",
|
label: "No go",
|
||||||
iconClass: "icon-circle-slash",
|
iconClass: "icon-circle-slash",
|
||||||
iconClassPoll: "icon-status-poll-question-mark",
|
iconClassPoll: "icon-status-poll-question-mark",
|
||||||
statusClass: "s-status-error",
|
statusClass: "s-status-error",
|
||||||
|
@ -88,8 +88,8 @@
|
|||||||
"build:coverage": "webpack --config webpack.coverage.js",
|
"build:coverage": "webpack --config webpack.coverage.js",
|
||||||
"build:watch": "webpack --config webpack.dev.js --watch",
|
"build:watch": "webpack --config webpack.dev.js --watch",
|
||||||
"info": "npx envinfo --system --browsers --npmPackages --binaries --languages --markdown",
|
"info": "npx envinfo --system --browsers --npmPackages --binaries --languages --markdown",
|
||||||
"test": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run",
|
"test": "cross-env NODE_ENV=test NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run",
|
||||||
"test:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless",
|
"test:firefox": "cross-env NODE_ENV=test NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless",
|
||||||
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
|
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
|
||||||
"test:e2e": "npx playwright test",
|
"test:e2e": "npx playwright test",
|
||||||
"test:e2e:ci": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome smoke branding default condition timeConductor clock exampleImagery persistence performance grandsearch notebook/tags",
|
"test:e2e:ci": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome smoke branding default condition timeConductor clock exampleImagery persistence performance grandsearch notebook/tags",
|
||||||
@ -98,7 +98,7 @@
|
|||||||
"test:e2e:visual": "percy exec --config ./e2e/.percy.yml -- npx playwright test --config=e2e/playwright-visual.config.js",
|
"test:e2e:visual": "percy exec --config ./e2e/.percy.yml -- npx playwright test --config=e2e/playwright-visual.config.js",
|
||||||
"test:e2e:full": "npx playwright test --config=e2e/playwright-ci.config.js",
|
"test:e2e:full": "npx playwright test --config=e2e/playwright-ci.config.js",
|
||||||
"test:perf": "npx playwright test --config=e2e/playwright-performance.config.js",
|
"test:perf": "npx playwright test --config=e2e/playwright-performance.config.js",
|
||||||
"test:watch": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --no-single-run",
|
"test:watch": "cross-env NODE_ENV=test NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --no-single-run",
|
||||||
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
||||||
"update-about-dialog-copyright": "perl -pi -e 's/20\\d\\d\\-202\\d/2014\\-2022/gm' ./src/ui/layout/AboutDialog.vue",
|
"update-about-dialog-copyright": "perl -pi -e 's/20\\d\\d\\-202\\d/2014\\-2022/gm' ./src/ui/layout/AboutDialog.vue",
|
||||||
"update-copyright-date": "npm run update-about-dialog-copyright && grep -lr --null --include=*.{js,scss,vue,ts,sh,html,md,frag} 'Copyright (c) 20' . | xargs -r0 perl -pi -e 's/Copyright\\s\\(c\\)\\s20\\d\\d\\-20\\d\\d/Copyright \\(c\\)\\ 2014\\-2022/gm'",
|
"update-copyright-date": "npm run update-about-dialog-copyright && grep -lr --null --include=*.{js,scss,vue,ts,sh,html,md,frag} 'Copyright (c) 20' . | xargs -r0 perl -pi -e 's/Copyright\\s\\(c\\)\\s20\\d\\d\\-20\\d\\d/Copyright \\(c\\)\\ 2014\\-2022/gm'",
|
||||||
|
70
src/MCT.js
@ -96,11 +96,12 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = this.destroy.bind(this);
|
this.destroy = this.destroy.bind(this);
|
||||||
|
[
|
||||||
/**
|
/**
|
||||||
* Tracks current selection state of the application.
|
* Tracks current selection state of the application.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.selection = new Selection(this);
|
['selection', () => new Selection(this)],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MCT's time conductor, which may be used to synchronize view contents
|
* MCT's time conductor, which may be used to synchronize view contents
|
||||||
@ -109,7 +110,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name conductor
|
* @name conductor
|
||||||
*/
|
*/
|
||||||
this.time = new api.TimeAPI(this);
|
['time', () => new api.TimeAPI(this)],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface for interacting with the composition of domain objects.
|
* An interface for interacting with the composition of domain objects.
|
||||||
@ -124,7 +125,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name composition
|
* @name composition
|
||||||
*/
|
*/
|
||||||
this.composition = new api.CompositionAPI(this);
|
['composition', () => new api.CompositionAPI(this)],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry for views of domain objects which should appear in the
|
* Registry for views of domain objects which should appear in the
|
||||||
@ -134,7 +135,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name objectViews
|
* @name objectViews
|
||||||
*/
|
*/
|
||||||
this.objectViews = new ViewRegistry();
|
['objectViews', () => new ViewRegistry()],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry for views which should appear in the Inspector area.
|
* Registry for views which should appear in the Inspector area.
|
||||||
@ -144,7 +145,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name inspectorViews
|
* @name inspectorViews
|
||||||
*/
|
*/
|
||||||
this.inspectorViews = new InspectorViewRegistry();
|
['inspectorViews', () => new InspectorViewRegistry()],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry for views which should appear in Edit Properties
|
* Registry for views which should appear in Edit Properties
|
||||||
@ -155,15 +156,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name propertyEditors
|
* @name propertyEditors
|
||||||
*/
|
*/
|
||||||
this.propertyEditors = new ViewRegistry();
|
['propertyEditors', () => new ViewRegistry()],
|
||||||
|
|
||||||
/**
|
|
||||||
* Registry for views which should appear in the status indicator area.
|
|
||||||
* @type {module:openmct.ViewRegistry}
|
|
||||||
* @memberof module:openmct.MCT#
|
|
||||||
* @name indicators
|
|
||||||
*/
|
|
||||||
this.indicators = new ViewRegistry();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry for views which should appear in the toolbar area while
|
* Registry for views which should appear in the toolbar area while
|
||||||
@ -173,7 +166,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name toolbars
|
* @name toolbars
|
||||||
*/
|
*/
|
||||||
this.toolbars = new ToolbarRegistry();
|
['toolbars', () => new ToolbarRegistry()],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry for domain object types which may exist within this
|
* Registry for domain object types which may exist within this
|
||||||
@ -183,7 +176,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name types
|
* @name types
|
||||||
*/
|
*/
|
||||||
this.types = new api.TypeRegistry();
|
['types', () => new api.TypeRegistry()],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface for interacting with domain objects and the domain
|
* An interface for interacting with domain objects and the domain
|
||||||
@ -193,7 +186,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name objects
|
* @name objects
|
||||||
*/
|
*/
|
||||||
this.objects = new api.ObjectAPI.default(this.types, this);
|
['objects', () => new api.ObjectAPI.default(this.types, this)],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface for retrieving and interpreting telemetry data associated
|
* An interface for retrieving and interpreting telemetry data associated
|
||||||
@ -203,7 +196,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name telemetry
|
* @name telemetry
|
||||||
*/
|
*/
|
||||||
this.telemetry = new api.TelemetryAPI.default(this);
|
['telemetry', () => new api.TelemetryAPI.default(this)],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface for creating new indicators and changing them dynamically.
|
* An interface for creating new indicators and changing them dynamically.
|
||||||
@ -212,7 +205,7 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name indicators
|
* @name indicators
|
||||||
*/
|
*/
|
||||||
this.indicators = new api.IndicatorAPI(this);
|
['indicators', () => new api.IndicatorAPI(this)],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MCT's user awareness management, to enable user and
|
* MCT's user awareness management, to enable user and
|
||||||
@ -221,27 +214,29 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name user
|
* @name user
|
||||||
*/
|
*/
|
||||||
this.user = new api.UserAPI(this);
|
['user', () => new api.UserAPI(this)],
|
||||||
|
|
||||||
this.notifications = new api.NotificationAPI();
|
['notifications', () => new api.NotificationAPI()],
|
||||||
|
|
||||||
this.editor = new api.EditorAPI.default(this);
|
['editor', () => new api.EditorAPI.default(this)],
|
||||||
|
|
||||||
this.overlays = new OverlayAPI.default();
|
['overlays', () => new OverlayAPI.default()],
|
||||||
|
|
||||||
this.menus = new api.MenuAPI(this);
|
['menus', () => new api.MenuAPI(this)],
|
||||||
|
|
||||||
this.actions = new api.ActionsAPI(this);
|
['actions', () => new api.ActionsAPI(this)],
|
||||||
|
|
||||||
this.status = new api.StatusAPI(this);
|
['status', () => new api.StatusAPI(this)],
|
||||||
|
|
||||||
this.priority = api.PriorityAPI;
|
['priority', () => api.PriorityAPI],
|
||||||
|
|
||||||
this.router = new ApplicationRouter(this);
|
['router', () => new ApplicationRouter(this)],
|
||||||
this.faults = new api.FaultManagementAPI.default(this);
|
|
||||||
this.forms = new api.FormsAPI.default(this);
|
|
||||||
|
|
||||||
this.branding = BrandingAPI.default;
|
['faults', () => new api.FaultManagementAPI.default(this)],
|
||||||
|
|
||||||
|
['forms', () => new api.FormsAPI.default(this)],
|
||||||
|
|
||||||
|
['branding', () => BrandingAPI.default],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MCT's annotation API that enables
|
* MCT's annotation API that enables
|
||||||
@ -250,7 +245,18 @@ define([
|
|||||||
* @memberof module:openmct.MCT#
|
* @memberof module:openmct.MCT#
|
||||||
* @name annotation
|
* @name annotation
|
||||||
*/
|
*/
|
||||||
this.annotation = new api.AnnotationAPI(this);
|
['annotation', () => new api.AnnotationAPI(this)]
|
||||||
|
].forEach(apiEntry => {
|
||||||
|
const apiName = apiEntry[0];
|
||||||
|
const apiObject = apiEntry[1]();
|
||||||
|
|
||||||
|
Object.defineProperty(this, apiName, {
|
||||||
|
value: apiObject,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: false,
|
||||||
|
writable: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Plugins that are installed by default
|
// Plugins that are installed by default
|
||||||
this.install(this.plugins.Plot());
|
this.install(this.plugins.Plot());
|
||||||
|
@ -230,10 +230,15 @@ export default class ObjectAPI {
|
|||||||
return result;
|
return result;
|
||||||
}).catch((result) => {
|
}).catch((result) => {
|
||||||
console.warn(`Failed to retrieve ${keystring}:`, result);
|
console.warn(`Failed to retrieve ${keystring}:`, result);
|
||||||
|
this.openmct.notifications.error(`Failed to retrieve object ${keystring}`);
|
||||||
|
|
||||||
delete this.cache[keystring];
|
delete this.cache[keystring];
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
//no result means resource either doesn't exist or is missing
|
||||||
|
//otherwise it's an error, and we shouldn't apply interceptors
|
||||||
result = this.applyGetInterceptors(identifier);
|
result = this.applyGetInterceptors(identifier);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
@ -383,7 +388,13 @@ export default class ObjectAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result.catch((error) => {
|
||||||
|
if (error instanceof this.errors.Conflict) {
|
||||||
|
this.openmct.notifications.error(`Conflict detected while saving ${this.makeKeyString(domainObject.identifier)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +61,7 @@ export default class TelemetryAPI {
|
|||||||
* @returns {CustomStringFormatter}
|
* @returns {CustomStringFormatter}
|
||||||
*/
|
*/
|
||||||
customStringFormatter(valueMetadata, format) {
|
customStringFormatter(valueMetadata, format) {
|
||||||
return new CustomStringFormatter.default(this.openmct, valueMetadata, format);
|
return new CustomStringFormatter(this.openmct, valueMetadata, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,7 +170,6 @@ export default class TelemetryCollection extends EventEmitter {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_processNewTelemetry(telemetryData) {
|
_processNewTelemetry(telemetryData) {
|
||||||
performance.mark('tlm:process:start');
|
|
||||||
if (telemetryData === undefined) {
|
if (telemetryData === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -389,7 +388,6 @@ export default class TelemetryCollection extends EventEmitter {
|
|||||||
* @todo handle subscriptions more granually
|
* @todo handle subscriptions more granually
|
||||||
*/
|
*/
|
||||||
_reset() {
|
_reset() {
|
||||||
performance.mark('tlm:reset');
|
|
||||||
this.boundedTelemetry = [];
|
this.boundedTelemetry = [];
|
||||||
this.futureBuffer = [];
|
this.futureBuffer = [];
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setUnit() {
|
setUnit() {
|
||||||
this.unit = this.valueMetadata.unit || '';
|
this.unit = this.valueMetadata ? this.valueMetadata.unit : '';
|
||||||
},
|
},
|
||||||
firstNonDomainAttribute(metadata) {
|
firstNonDomainAttribute(metadata) {
|
||||||
return metadata
|
return metadata
|
||||||
|
@ -83,6 +83,8 @@ export default {
|
|||||||
for (let ladTable of ladTables) {
|
for (let ladTable of ladTables) {
|
||||||
for (let telemetryObject of ladTable) {
|
for (let telemetryObject of ladTable) {
|
||||||
let metadata = this.openmct.telemetry.getMetadata(telemetryObject.domainObject);
|
let metadata = this.openmct.telemetry.getMetadata(telemetryObject.domainObject);
|
||||||
|
|
||||||
|
if (metadata) {
|
||||||
for (let metadatum of metadata.valueMetadatas) {
|
for (let metadatum of metadata.valueMetadatas) {
|
||||||
if (metadatum.unit) {
|
if (metadatum.unit) {
|
||||||
return true;
|
return true;
|
||||||
@ -90,6 +92,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -178,6 +178,26 @@ export default {
|
|||||||
this.requestDataFor(telemetryObject);
|
this.requestDataFor(telemetryObject);
|
||||||
this.subscribeToObject(telemetryObject);
|
this.subscribeToObject(telemetryObject);
|
||||||
},
|
},
|
||||||
|
setTrace(key, name, axisMetadata, xValues, yValues) {
|
||||||
|
let trace = {
|
||||||
|
key,
|
||||||
|
name: name,
|
||||||
|
x: xValues,
|
||||||
|
y: yValues,
|
||||||
|
xAxisMetadata: {},
|
||||||
|
yAxisMetadata: axisMetadata.yAxisMetadata,
|
||||||
|
type: this.domainObject.configuration.useBar ? 'bar' : 'scatter',
|
||||||
|
mode: 'lines',
|
||||||
|
line: {
|
||||||
|
shape: this.domainObject.configuration.useInterpolation
|
||||||
|
},
|
||||||
|
marker: {
|
||||||
|
color: this.domainObject.configuration.barStyles.series[key].color
|
||||||
|
},
|
||||||
|
hoverinfo: this.domainObject.configuration.useBar ? 'skip' : 'x+y'
|
||||||
|
};
|
||||||
|
this.addTrace(trace, key);
|
||||||
|
},
|
||||||
addTrace(trace, key) {
|
addTrace(trace, key) {
|
||||||
if (!this.trace.length) {
|
if (!this.trace.length) {
|
||||||
this.trace = this.trace.concat([trace]);
|
this.trace = this.trace.concat([trace]);
|
||||||
@ -236,7 +256,15 @@ export default {
|
|||||||
refreshData(bounds, isTick) {
|
refreshData(bounds, isTick) {
|
||||||
if (!isTick) {
|
if (!isTick) {
|
||||||
const telemetryObjects = Object.values(this.telemetryObjects);
|
const telemetryObjects = Object.values(this.telemetryObjects);
|
||||||
telemetryObjects.forEach(this.requestDataFor);
|
telemetryObjects.forEach((telemetryObject) => {
|
||||||
|
//clear existing data
|
||||||
|
const key = this.openmct.objects.makeKeyString(telemetryObject.identifier);
|
||||||
|
const axisMetadata = this.getAxisMetadata(telemetryObject);
|
||||||
|
this.setTrace(key, telemetryObject.name, axisMetadata, [], []);
|
||||||
|
//request new data
|
||||||
|
this.requestDataFor(telemetryObject);
|
||||||
|
this.subscribeToObject(telemetryObject);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeAllSubscriptions() {
|
removeAllSubscriptions() {
|
||||||
@ -320,25 +348,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let trace = {
|
this.setTrace(key, telemetryObject.name, axisMetadata, xValues, yValues);
|
||||||
key,
|
|
||||||
name: telemetryObject.name,
|
|
||||||
x: xValues,
|
|
||||||
y: yValues,
|
|
||||||
xAxisMetadata: xAxisMetadata,
|
|
||||||
yAxisMetadata: axisMetadata.yAxisMetadata,
|
|
||||||
type: this.domainObject.configuration.useBar ? 'bar' : 'scatter',
|
|
||||||
mode: 'lines',
|
|
||||||
line: {
|
|
||||||
shape: this.domainObject.configuration.useInterpolation
|
|
||||||
},
|
|
||||||
marker: {
|
|
||||||
color: this.domainObject.configuration.barStyles.series[key].color
|
|
||||||
},
|
|
||||||
hoverinfo: this.domainObject.configuration.useBar ? 'skip' : 'x+y'
|
|
||||||
};
|
|
||||||
|
|
||||||
this.addTrace(trace, key);
|
|
||||||
},
|
},
|
||||||
isDataInTimeRange(datum, key, telemetryObject) {
|
isDataInTimeRange(datum, key, telemetryObject) {
|
||||||
const timeSystemKey = this.timeContext.timeSystem().key;
|
const timeSystemKey = this.timeContext.timeSystem().key;
|
||||||
|
@ -66,12 +66,15 @@ export default function BarGraphViewProvider(openmct) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
template: '<bar-graph-view :options="options"></bar-graph-view>'
|
template: '<bar-graph-view ref="graphComponent" :options="options"></bar-graph-view>'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
component.$destroy();
|
component.$destroy();
|
||||||
component = undefined;
|
component = undefined;
|
||||||
|
},
|
||||||
|
onClearData() {
|
||||||
|
component.$refs.graphComponent.refreshData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -316,6 +316,10 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.yKey === undefined) {
|
if (this.yKey === undefined) {
|
||||||
|
if (metadataValues.length && metadataArrayValues.length === 0) {
|
||||||
|
update = true;
|
||||||
|
this.yKey = 'none';
|
||||||
|
} else {
|
||||||
yKeyOptionIndex = this.yKeyOptions.findIndex((option, index) => index !== xKeyOptionIndex);
|
yKeyOptionIndex = this.yKeyOptions.findIndex((option, index) => index !== xKeyOptionIndex);
|
||||||
if (yKeyOptionIndex > -1) {
|
if (yKeyOptionIndex > -1) {
|
||||||
update = true;
|
update = true;
|
||||||
@ -324,6 +328,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.yKeyOptions = this.yKeyOptions.map((option, index) => {
|
this.yKeyOptions = this.yKeyOptions.map((option, index) => {
|
||||||
if (index === xKeyOptionIndex) {
|
if (index === xKeyOptionIndex) {
|
||||||
|
@ -28,9 +28,9 @@ export default function () {
|
|||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
openmct.types.addType(BAR_GRAPH_KEY, {
|
openmct.types.addType(BAR_GRAPH_KEY, {
|
||||||
key: BAR_GRAPH_KEY,
|
key: BAR_GRAPH_KEY,
|
||||||
name: "Graph (Bar or Line)",
|
name: "Graph",
|
||||||
cssClass: "icon-bar-chart",
|
cssClass: "icon-bar-chart",
|
||||||
description: "View data as a bar graph. Can be added to Display Layouts.",
|
description: "Visualize data as a bar or line graph.",
|
||||||
creatable: true,
|
creatable: true,
|
||||||
initialize: function (domainObject) {
|
initialize: function (domainObject) {
|
||||||
domainObject.composition = [];
|
domainObject.composition = [];
|
||||||
|
@ -300,8 +300,11 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
return this.compositionLoad.then(() => {
|
return this.compositionLoad.then(() => {
|
||||||
let latestTimestamp;
|
let latestTimestamp;
|
||||||
let conditionResults = {};
|
let conditionResults = {};
|
||||||
|
let nextLegOptions = {...options};
|
||||||
|
delete nextLegOptions.onPartialResponse;
|
||||||
|
|
||||||
const conditionRequests = this.conditions
|
const conditionRequests = this.conditions
|
||||||
.map(condition => condition.requestLADConditionResult(options));
|
.map(condition => condition.requestLADConditionResult(nextLegOptions));
|
||||||
|
|
||||||
return Promise.all(conditionRequests)
|
return Promise.all(conditionRequests)
|
||||||
.then((results) => {
|
.then((results) => {
|
||||||
|
@ -23,12 +23,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="c-fault-mgmt__list data-selectable"
|
class="c-fault-mgmt__list data-selectable"
|
||||||
:class="[
|
:class="classesFromState"
|
||||||
{'is-selected': isSelected},
|
|
||||||
{'is-unacknowledged': !fault.acknowledged},
|
|
||||||
{'is-shelved': fault.shelved},
|
|
||||||
{'is-acknowledged': fault.acknowledged}
|
|
||||||
]"
|
|
||||||
>
|
>
|
||||||
<div class="c-fault-mgmt-item c-fault-mgmt__list-checkbox">
|
<div class="c-fault-mgmt-item c-fault-mgmt__list-checkbox">
|
||||||
<input
|
<input
|
||||||
@ -113,6 +108,36 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
classesFromState() {
|
||||||
|
const exclusiveStates = [
|
||||||
|
{
|
||||||
|
className: 'is-shelved',
|
||||||
|
test: () => this.fault.shelved
|
||||||
|
},
|
||||||
|
{
|
||||||
|
className: 'is-unacknowledged',
|
||||||
|
test: () => !this.fault.acknowledged && !this.fault.shelved
|
||||||
|
},
|
||||||
|
{
|
||||||
|
className: 'is-acknowledged',
|
||||||
|
test: () => this.fault.acknowledged && !this.fault.shelved
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const classes = [];
|
||||||
|
|
||||||
|
if (this.isSelected) {
|
||||||
|
classes.push('is-selected');
|
||||||
|
}
|
||||||
|
|
||||||
|
const matchingState = exclusiveStates.find(stateDefinition => stateDefinition.test());
|
||||||
|
|
||||||
|
if (matchingState !== undefined) {
|
||||||
|
classes.push(matchingState.className);
|
||||||
|
}
|
||||||
|
|
||||||
|
return classes;
|
||||||
|
},
|
||||||
liveValueClassname() {
|
liveValueClassname() {
|
||||||
const currentValueInfo = this.fault?.currentValueInfo;
|
const currentValueInfo = this.fault?.currentValueInfo;
|
||||||
if (!currentValueInfo || currentValueInfo.monitoringResult === 'IN_LIMITS') {
|
if (!currentValueInfo || currentValueInfo.monitoringResult === 'IN_LIMITS') {
|
||||||
|
@ -96,17 +96,19 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
filteredFaultsList() {
|
filteredFaultsList() {
|
||||||
const filterName = FILTER_ITEMS[this.filterIndex];
|
const filterName = FILTER_ITEMS[this.filterIndex];
|
||||||
let list = this.faultsList.filter(fault => !fault.shelved);
|
let list = this.faultsList;
|
||||||
|
|
||||||
|
// Exclude shelved alarms from all views except the Shelved view
|
||||||
|
if (filterName !== 'Shelved') {
|
||||||
|
list = list.filter(fault => fault.shelved !== true);
|
||||||
|
}
|
||||||
|
|
||||||
if (filterName === 'Acknowledged') {
|
if (filterName === 'Acknowledged') {
|
||||||
list = this.faultsList.filter(fault => fault.acknowledged);
|
list = list.filter(fault => fault.acknowledged);
|
||||||
}
|
} else if (filterName === 'Unacknowledged') {
|
||||||
|
list = list.filter(fault => !fault.acknowledged);
|
||||||
if (filterName === 'Unacknowledged') {
|
} else if (filterName === 'Shelved') {
|
||||||
list = this.faultsList.filter(fault => !fault.acknowledged);
|
list = list.filter(fault => fault.shelved);
|
||||||
}
|
|
||||||
|
|
||||||
if (filterName === 'Shelved') {
|
|
||||||
list = this.faultsList.filter(fault => fault.shelved);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.searchTerm.length > 0) {
|
if (this.searchTerm.length > 0) {
|
||||||
|
@ -169,6 +169,7 @@
|
|||||||
</g>
|
</g>
|
||||||
<g class="c-dial__text">
|
<g class="c-dial__text">
|
||||||
<text
|
<text
|
||||||
|
v-if="displayUnits"
|
||||||
x="50%"
|
x="50%"
|
||||||
y="70%"
|
y="70%"
|
||||||
text-anchor="middle"
|
text-anchor="middle"
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<div class="c-form__row">
|
<div class="c-form__row">
|
||||||
<span class="req-indicator req">
|
<span class="req-indicator req">
|
||||||
</span>
|
</span>
|
||||||
<label>Range minimum value</label>
|
<label>Minimum value</label>
|
||||||
<input
|
<input
|
||||||
ref="min"
|
ref="min"
|
||||||
v-model.number="min"
|
v-model.number="min"
|
||||||
@ -53,7 +53,7 @@
|
|||||||
<div class="c-form__row">
|
<div class="c-form__row">
|
||||||
<span class="req-indicator">
|
<span class="req-indicator">
|
||||||
</span>
|
</span>
|
||||||
<label>Range low limit</label>
|
<label>Low limit</label>
|
||||||
<input
|
<input
|
||||||
ref="limitLow"
|
ref="limitLow"
|
||||||
v-model.number="limitLow"
|
v-model.number="limitLow"
|
||||||
@ -64,26 +64,26 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="c-form__row">
|
<div class="c-form__row">
|
||||||
<span class="req-indicator req">
|
<span class="req-indicator">
|
||||||
</span>
|
</span>
|
||||||
<label>Range maximum value</label>
|
<label>High limit</label>
|
||||||
<input
|
<input
|
||||||
ref="max"
|
ref="limitHigh"
|
||||||
v-model.number="max"
|
v-model.number="limitHigh"
|
||||||
data-field-name="max"
|
data-field-name="limitHigh"
|
||||||
type="number"
|
type="number"
|
||||||
@input="onChange"
|
@input="onChange"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="c-form__row">
|
<div class="c-form__row">
|
||||||
<span class="req-indicator">
|
<span class="req-indicator req">
|
||||||
</span>
|
</span>
|
||||||
<label>Range high limit</label>
|
<label>Maximum value</label>
|
||||||
<input
|
<input
|
||||||
ref="limitHigh"
|
ref="max"
|
||||||
v-model.number="limitHigh"
|
v-model.number="max"
|
||||||
data-field-name="limitHigh"
|
data-field-name="max"
|
||||||
type="number"
|
type="number"
|
||||||
@input="onChange"
|
@input="onChange"
|
||||||
>
|
>
|
||||||
|
@ -210,9 +210,10 @@
|
|||||||
border-radius: $controlCr;
|
border-radius: $controlCr;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: $interiorMargin;
|
padding: $interiorMargin;
|
||||||
width: min-content;
|
width: max-content;
|
||||||
|
|
||||||
> * + * {
|
> * + * {
|
||||||
margin-left: $interiorMargin;
|
margin-left: $interiorMargin;
|
||||||
@ -338,7 +339,6 @@
|
|||||||
&__input {
|
&__input {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
color: rgba($colorMenuFg, 0.5);
|
color: rgba($colorMenuFg, 0.5);
|
||||||
@ -353,13 +353,16 @@
|
|||||||
|
|
||||||
&--filters {
|
&--filters {
|
||||||
// Styles specific to the brightness and contrast controls
|
// Styles specific to the brightness and contrast controls
|
||||||
|
|
||||||
.c-image-controls {
|
.c-image-controls {
|
||||||
|
&__controls {
|
||||||
|
width: 80px; // About the minimum this element can be; cannot size based on % due to markup structure
|
||||||
|
}
|
||||||
|
|
||||||
&__sliders {
|
&__sliders {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-width: 80px;
|
width: 100%;
|
||||||
|
|
||||||
> * + * {
|
> * + * {
|
||||||
margin-top: 11px;
|
margin-top: 11px;
|
||||||
|
@ -76,7 +76,10 @@ export default {
|
|||||||
dataRemoved(dataToRemove) {
|
dataRemoved(dataToRemove) {
|
||||||
this.imageHistory = this.imageHistory.filter(existingDatum => {
|
this.imageHistory = this.imageHistory.filter(existingDatum => {
|
||||||
const shouldKeep = dataToRemove.some(datumToRemove => {
|
const shouldKeep = dataToRemove.some(datumToRemove => {
|
||||||
return (existingDatum.utc !== datumToRemove.utc);
|
const existingDatumTimestamp = this.parseTime(existingDatum);
|
||||||
|
const datumToRemoveTimestamp = this.parseTime(datumToRemove);
|
||||||
|
|
||||||
|
return (existingDatumTimestamp !== datumToRemoveTimestamp);
|
||||||
});
|
});
|
||||||
|
|
||||||
return shouldKeep;
|
return shouldKeep;
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
&__content {
|
&__content {
|
||||||
$m: $interiorMargin;
|
$m: $interiorMargin;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: min-content 1fr;
|
grid-template-columns: max-content 1fr;
|
||||||
grid-column-gap: $m;
|
grid-column-gap: $m;
|
||||||
grid-row-gap: $m;
|
grid-row-gap: $m;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
<div class="c-status-poll__section c-status-poll-panel__content c-spq">
|
<div class="c-status-poll__section c-status-poll-panel__content c-spq">
|
||||||
<!-- Grid layout -->
|
<!-- Grid layout -->
|
||||||
<div class="c-spq__label">Current:</div>
|
<div class="c-spq__label">Current poll:</div>
|
||||||
<div class="c-spq__value c-status-poll-panel__poll-question">{{ currentPollQuestion }}</div>
|
<div class="c-spq__value c-status-poll-panel__poll-question">{{ currentPollQuestion }}</div>
|
||||||
|
|
||||||
<template v-if="statusCountViewModel.length > 0">
|
<template v-if="statusCountViewModel.length > 0">
|
||||||
@ -43,6 +43,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="entry in statusCountViewModel"
|
v-for="entry in statusCountViewModel"
|
||||||
:key="entry.status.key"
|
:key="entry.status.key"
|
||||||
|
:title="entry.status.label"
|
||||||
class="c-status-poll-report__count"
|
class="c-status-poll-report__count"
|
||||||
:style="[{
|
:style="[{
|
||||||
background: entry.status.statusBgColor,
|
background: entry.status.statusBgColor,
|
||||||
@ -69,6 +70,7 @@
|
|||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="c-button"
|
class="c-button"
|
||||||
|
title="Publish a new poll question and reset previous responses"
|
||||||
@click="updatePollQuestion"
|
@click="updatePollQuestion"
|
||||||
>Update</button>
|
>Update</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,8 +45,7 @@ export default function CouchDocument(id, model, rev, markDeleted) {
|
|||||||
"category": "domain object",
|
"category": "domain object",
|
||||||
"type": model.type,
|
"type": model.type,
|
||||||
"owner": "admin",
|
"owner": "admin",
|
||||||
"name": model.name,
|
"name": model.name
|
||||||
"created": Date.now()
|
|
||||||
},
|
},
|
||||||
"model": model
|
"model": model
|
||||||
};
|
};
|
||||||
|
@ -215,9 +215,13 @@ class CouchObjectProvider {
|
|||||||
// Network error, CouchDB unreachable.
|
// Network error, CouchDB unreachable.
|
||||||
if (response === null) {
|
if (response === null) {
|
||||||
this.indicator.setIndicatorToState(DISCONNECTED);
|
this.indicator.setIndicatorToState(DISCONNECTED);
|
||||||
}
|
|
||||||
|
|
||||||
console.error(error.message);
|
console.error(error.message);
|
||||||
|
throw new Error(`CouchDB Error - No response"`);
|
||||||
|
} else {
|
||||||
|
console.error(error.message);
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,6 +383,8 @@ class CouchObjectProvider {
|
|||||||
return this.request(ALL_DOCS, 'POST', query, signal).then((response) => {
|
return this.request(ALL_DOCS, 'POST', query, signal).then((response) => {
|
||||||
if (response && response.rows !== undefined) {
|
if (response && response.rows !== undefined) {
|
||||||
return response.rows.reduce((map, row) => {
|
return response.rows.reduce((map, row) => {
|
||||||
|
//row.doc === null if the document does not exist.
|
||||||
|
//row.doc === undefined if the document is not found.
|
||||||
if (row.doc !== undefined) {
|
if (row.doc !== undefined) {
|
||||||
map[row.key] = this.#getModel(row.doc);
|
map[row.key] = this.#getModel(row.doc);
|
||||||
}
|
}
|
||||||
@ -647,8 +653,8 @@ class CouchObjectProvider {
|
|||||||
this.objectQueue[key].pending = true;
|
this.objectQueue[key].pending = true;
|
||||||
const queued = this.objectQueue[key].dequeue();
|
const queued = this.objectQueue[key].dequeue();
|
||||||
let document = new CouchDocument(key, queued.model);
|
let document = new CouchDocument(key, queued.model);
|
||||||
|
document.metadata.created = Date.now();
|
||||||
this.request(key, "PUT", document).then((response) => {
|
this.request(key, "PUT", document).then((response) => {
|
||||||
console.log('create check response', key);
|
|
||||||
this.#checkResponse(response, queued.intermediateResponse, key);
|
this.#checkResponse(response, queued.intermediateResponse, key);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
queued.intermediateResponse.reject(error);
|
queued.intermediateResponse.reject(error);
|
||||||
|
@ -25,7 +25,7 @@ const exportPNG = {
|
|||||||
name: 'Export as PNG',
|
name: 'Export as PNG',
|
||||||
key: 'export-as-png',
|
key: 'export-as-png',
|
||||||
description: 'Export This View\'s Data as PNG',
|
description: 'Export This View\'s Data as PNG',
|
||||||
cssClass: 'c-icon-button icon-download',
|
cssClass: 'icon-download',
|
||||||
group: 'view',
|
group: 'view',
|
||||||
invoke(objectPath, view) {
|
invoke(objectPath, view) {
|
||||||
view.getViewContext().exportPNG();
|
view.getViewContext().exportPNG();
|
||||||
@ -36,7 +36,7 @@ const exportJPG = {
|
|||||||
name: 'Export as JPG',
|
name: 'Export as JPG',
|
||||||
key: 'export-as-jpg',
|
key: 'export-as-jpg',
|
||||||
description: 'Export This View\'s Data as JPG',
|
description: 'Export This View\'s Data as JPG',
|
||||||
cssClass: 'c-icon-button icon-download',
|
cssClass: 'icon-download',
|
||||||
group: 'view',
|
group: 'view',
|
||||||
invoke(objectPath, view) {
|
invoke(objectPath, view) {
|
||||||
view.getViewContext().exportJPG();
|
view.getViewContext().exportJPG();
|
||||||
|
@ -34,6 +34,12 @@ export default class Model extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super();
|
super();
|
||||||
|
Object.defineProperty(this, '_events', {
|
||||||
|
value: this._events,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: false,
|
||||||
|
writable: true
|
||||||
|
});
|
||||||
|
|
||||||
//need to do this as we're already extending EventEmitter
|
//need to do this as we're already extending EventEmitter
|
||||||
eventHelpers.extend(this);
|
eventHelpers.extend(this);
|
||||||
|
@ -27,6 +27,7 @@ import OverlayPlotCompositionPolicy from './overlayPlot/OverlayPlotCompositionPo
|
|||||||
import StackedPlotCompositionPolicy from './stackedPlot/StackedPlotCompositionPolicy';
|
import StackedPlotCompositionPolicy from './stackedPlot/StackedPlotCompositionPolicy';
|
||||||
import PlotViewActions from "./actions/ViewActions";
|
import PlotViewActions from "./actions/ViewActions";
|
||||||
import StackedPlotsInspectorViewProvider from "./inspector/StackedPlotsInspectorViewProvider";
|
import StackedPlotsInspectorViewProvider from "./inspector/StackedPlotsInspectorViewProvider";
|
||||||
|
import stackedPlotConfigurationInterceptor from "./stackedPlot/stackedPlotConfigurationInterceptor";
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
@ -64,6 +65,8 @@ export default function () {
|
|||||||
priority: 890
|
priority: 890
|
||||||
});
|
});
|
||||||
|
|
||||||
|
stackedPlotConfigurationInterceptor(openmct);
|
||||||
|
|
||||||
openmct.objectViews.addProvider(new StackedPlotViewProvider(openmct));
|
openmct.objectViews.addProvider(new StackedPlotViewProvider(openmct));
|
||||||
openmct.objectViews.addProvider(new OverlayPlotViewProvider(openmct));
|
openmct.objectViews.addProvider(new OverlayPlotViewProvider(openmct));
|
||||||
openmct.objectViews.addProvider(new PlotViewProvider(openmct));
|
openmct.objectViews.addProvider(new PlotViewProvider(openmct));
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
export default function stackedPlotConfigurationInterceptor(openmct) {
|
||||||
|
|
||||||
|
openmct.objects.addGetInterceptor({
|
||||||
|
appliesTo: (identifier, domainObject) => {
|
||||||
|
return domainObject && domainObject.type === 'telemetry.plot.stacked';
|
||||||
|
},
|
||||||
|
invoke: (identifier, object) => {
|
||||||
|
|
||||||
|
if (object && object.configuration && object.configuration.series === undefined) {
|
||||||
|
object.configuration.series = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
@ -35,8 +35,8 @@ function remoteClockRequestInterceptor(openmct, remoteClockIdentifier, waitForBo
|
|||||||
invoke: async (request) => {
|
invoke: async (request) => {
|
||||||
const { start, end } = await waitForBounds();
|
const { start, end } = await waitForBounds();
|
||||||
remoteClockLoaded = true;
|
remoteClockLoaded = true;
|
||||||
request[1].start = start;
|
request.start = start;
|
||||||
request[1].end = end;
|
request.end = end;
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
@ -225,9 +225,7 @@ define(
|
|||||||
sortBy(sortOptions) {
|
sortBy(sortOptions) {
|
||||||
if (arguments.length > 0) {
|
if (arguments.length > 0) {
|
||||||
this.sortOptions = sortOptions;
|
this.sortOptions = sortOptions;
|
||||||
performance.mark('table:row:sort:start');
|
|
||||||
this.rows = _.orderBy(this.rows, (row) => row.getParsedValue(sortOptions.key), sortOptions.direction);
|
this.rows = _.orderBy(this.rows, (row) => row.getParsedValue(sortOptions.key), sortOptions.direction);
|
||||||
performance.mark('table:row:sort:stop');
|
|
||||||
this.emit('sort');
|
this.emit('sort');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,7 +612,6 @@ export default {
|
|||||||
this.calculateScrollbarWidth();
|
this.calculateScrollbarWidth();
|
||||||
},
|
},
|
||||||
sortBy(columnKey) {
|
sortBy(columnKey) {
|
||||||
performance.mark('table:sort');
|
|
||||||
// If sorting by the same column, flip the sort direction.
|
// If sorting by the same column, flip the sort direction.
|
||||||
if (this.sortOptions.key === columnKey) {
|
if (this.sortOptions.key === columnKey) {
|
||||||
if (this.sortOptions.direction === 'asc') {
|
if (this.sortOptions.direction === 'asc') {
|
||||||
@ -669,7 +668,6 @@ export default {
|
|||||||
this.setHeight();
|
this.setHeight();
|
||||||
},
|
},
|
||||||
rowsAdded(rows) {
|
rowsAdded(rows) {
|
||||||
performance.mark('row:added');
|
|
||||||
this.setHeight();
|
this.setHeight();
|
||||||
|
|
||||||
let sizingRow;
|
let sizingRow;
|
||||||
@ -691,7 +689,6 @@ export default {
|
|||||||
this.updateVisibleRows();
|
this.updateVisibleRows();
|
||||||
},
|
},
|
||||||
rowsRemoved(rows) {
|
rowsRemoved(rows) {
|
||||||
performance.mark('row:removed');
|
|
||||||
this.setHeight();
|
this.setHeight();
|
||||||
this.updateVisibleRows();
|
this.updateVisibleRows();
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// <a> tag and draggable element that holds type icon and name.
|
// <a> tag and draggable element that holds type icon and name.
|
||||||
// Used mostly in trees and lists
|
// Used mostly in trees and lists
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline; // Provides better vertical alignment than center
|
align-items: center;
|
||||||
flex: 0 1 auto;
|
flex: 0 1 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -107,7 +107,12 @@ export default {
|
|||||||
this.preview();
|
this.preview();
|
||||||
} else {
|
} else {
|
||||||
const objectPath = this.result.originalPath;
|
const objectPath = this.result.originalPath;
|
||||||
const resultUrl = objectPathToUrl(this.openmct, objectPath);
|
let resultUrl = objectPathToUrl(this.openmct, objectPath);
|
||||||
|
// get rid of ROOT if extant
|
||||||
|
if (resultUrl.includes('/ROOT')) {
|
||||||
|
resultUrl = resultUrl.split('/ROOT').join('');
|
||||||
|
}
|
||||||
|
|
||||||
this.openmct.router.navigate(resultUrl);
|
this.openmct.router.navigate(resultUrl);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -50,6 +50,10 @@ class ApplicationRouter extends EventEmitter {
|
|||||||
this.started = false;
|
this.started = false;
|
||||||
|
|
||||||
this.setHash = _.debounce(this.setHash.bind(this), 300);
|
this.setHash = _.debounce(this.setHash.bind(this), 300);
|
||||||
|
|
||||||
|
openmct.once('destroy', () => {
|
||||||
|
this.destroy();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public Methods
|
// Public Methods
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
// instrumentation using babel-plugin-istanbul (see babel.coverage.js)
|
// instrumentation using babel-plugin-istanbul (see babel.coverage.js)
|
||||||
|
|
||||||
const config = require('./webpack.dev');
|
const config = require('./webpack.dev');
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const vueLoaderRule = config.module.rules.find(r => r.use === 'vue-loader');
|
const vueLoaderRule = config.module.rules.find(r => r.use === 'vue-loader');
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const CI = process.env.CI === 'true';
|
||||||
|
|
||||||
|
config.devtool = CI ? false : undefined;
|
||||||
|
|
||||||
vueLoaderRule.use = {
|
vueLoaderRule.use = {
|
||||||
loader: 'vue-loader'
|
loader: 'vue-loader'
|
||||||
|