Skip to content

Commit

Permalink
Merge branch 'master' into collapse-recents
Browse files Browse the repository at this point in the history
  • Loading branch information
ozyx authored Feb 21, 2024
2 parents 3f63820 + 5894c66 commit c3190f4
Show file tree
Hide file tree
Showing 31 changed files with 224 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Closes <!--- Insert Issue Number(s) this PR addresses. Start by typing # will op

* [ ] Have you followed the guidelines in our [Contributing document](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md)?
* [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/nasa/openmct/pulls) for the same update/change?
* [ ] Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.
* [ ] Is this a notable change that will require a special callout in the release notes [Notable Change](../docs/src/process/release.md) ? For example, will this break compatibility with existing APIs or projects which source these plugins?

### Author Checklist

Expand Down
5 changes: 4 additions & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
changelog:
categories:
- title: 💥 Notable Changes
labels:
- notable_change
- title: 🏕 Features
labels:
- type:feature
Expand All @@ -20,4 +23,4 @@ changelog:
- dependencies
- title: 🐛 Bug Fixes
labels:
- '*'
- "*"
30 changes: 30 additions & 0 deletions docs/src/process/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Release of NASA Open MCT NPM Package

This document outlines the process and key considerations for releasing a new version of the NASA Open MCT project as an NPM (Node Package Manager) package.

## 1. Pre-requisites

Before releasing a new version of the NASA Open MCT NPM package, ensure all dependencies are updated, and comprehensive tests are performed. This ensures compatibility and performance of the Open MCT within the Node.js ecosystem.

## 2. Versioning

Versioning is a critical step for package release. The Open MCT team follows [Semantic Versioning (SemVer)](https://semver.org) that consists of three major components: MAJOR.MINOR.PATCH. These ensure a structured process for updating, bug fixes, backward compatibility, and software progress.

## 3. Changelog Maintenance

A comprehensive changelog file, `CHANGELOG.md`, documents any changes, adding a high level of transparencies for anyone desiring to look into the status of new and past progress. It includes the summation of any major new enhancements, changes, bug fixes, and the credits to the users responsible for each unique progress.

## 4. Notable Changes Labels on GitHub PRs

For the Open MCT package, we leverage GitHub's Pull Request (PR) mechanisms extensively, with three important PR labels dedicated to signifying 'notable_changes':

- **Breaking Change** Highlights the integration of changes that are suspected to break, or without a doubt will break, backward compatibility. These should signal to users the upgrade might be seamless only if dependency and integration factors are properly managed, if not, one should expect to manage atypical technical snags.
- **API change** Signifies when a contribution makes any complete or under layer changes to the communication or its supporting access processes. This label flags required see-through insight on how the web-based control panel sees and manipulates any value and or network logs.
- **Default Behavior Change:** In the incident an update either adjusts a form to or integrates a not previously kept setting or plugin. i.e. autoscale is enabled by default when working with plots.

## 6. Community & Contributions

A flat community and the rounded center are kept in continuous celebration, with the given station open for two open-specifying dialogues, research, and all-for development probing. State the ownership for a handed looped, a welcome for even structure-core and architectural draft and impend.

Thank you for your collaboration and commitment to moving the project onto a text big club.
33 changes: 0 additions & 33 deletions e2e/tests/functional/plugins/preview/preview.e2e.spec.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const defaultFrameBorderColor = '#e6b8af'; //default border color
const defaultBorderTargetColor = '#acacac';
const defaultTextColor = '#acacac'; // default text color
const inheritedColor = '#acacac'; // inherited from the body style
const pukeGreen = '#6aa84f'; //Ugliest green known to man
const pukeGreen = '#6aa84f'; //Ugliest green known to man 🤮
const NO_STYLE_RGBA = 'rgba(0, 0, 0, 0)'; //default background color value

test.describe('Flexible Layout styling', () => {
Expand Down Expand Up @@ -411,4 +411,39 @@ test.describe('Flexible Layout styling', () => {
page.getByLabel('StackedPlot1 Frame').getByLabel('Stacked Plot Style Target')
);
});

test('Styling, and then canceling reverts to previous style', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/7233'
});

await page.goto(flexibleLayout.url);

await page.getByLabel('Edit Object').click();
await page.getByRole('tab', { name: 'Styles' }).click();
await setStyles(
page,
setBorderColor,
setBackgroundColor,
setTextColor,
page.getByLabel('Flexible Layout Column')
);
await page.getByLabel('Cancel Editing').click();
await page.getByRole('button', { name: 'OK', exact: true }).click();
await checkStyles(
hexToRGB(defaultBorderTargetColor),
NO_STYLE_RGBA,
hexToRGB(inheritedColor),
page.getByLabel('Flexible Layout Column')
);

await page.reload();
await checkStyles(
hexToRGB(defaultBorderTargetColor),
NO_STYLE_RGBA,
hexToRGB(inheritedColor),
page.getByLabel('Flexible Layout Column')
);
});
});
73 changes: 73 additions & 0 deletions e2e/tests/functional/plugins/telemetryTable/preview.e2e.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2024, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*
* This test suite is dedicated to testing the preview plugin.
*/

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

test.describe('Preview mode', () => {
test('all context menu items are available for a telemetry table', async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });
// Create a Display Layout
const displayLayout = await createDomainObjectWithDefaults(page, {
type: 'Display Layout'
});
// Create a Telemetry Table
const telemetryTable = await createDomainObjectWithDefaults(page, {
type: 'Telemetry Table',
parent: displayLayout.uuid
});
// Create a Sinewave Generator
await createDomainObjectWithDefaults(page, {
type: 'Sine Wave Generator',
parent: telemetryTable.uuid
});

await page.goto(displayLayout.url);
await page.getByLabel('View menu items').click();
await expect(page.getByLabel('Export Marked Rows')).toBeVisible();

await page.getByRole('menuitem', { name: 'Large View' }).click();
await page.getByLabel('Overlay').getByLabel('More actions').click();
await expect(page.getByLabel('Export Table Data')).toBeVisible();
await expect(page.getByLabel('Export Marked Rows')).toBeVisible();
await page.getByRole('menuitem', { name: 'Pause' }).click();
await page.getByLabel('Close').click();

await expandEntireTree(page);

await page.getByLabel('Edit Object').click();

const treePane = page.getByRole('tree', {
name: 'Main Tree'
});
const telemetryTableTreeItem = treePane.getByRole('treeitem', {
name: new RegExp(telemetryTable.name)
});
await telemetryTableTreeItem.locator('a').click();
await page.getByLabel('Overlay').getByLabel('More actions').click();
await expect(page.getByLabel('Export Table Data')).toBeVisible();
await expect(page.getByLabel('Export Marked Rows')).toBeVisible();
});
});
3 changes: 2 additions & 1 deletion openmct.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (document.currentScript) {
* @property {*} inspectorViews
* @property {*} propertyEditors
* @property {*} toolbars
* @property {*} types
* @property {import('./src/api/types/TypeRegistry').default} types
* @property {import('./src/api/objects/ObjectAPI').default} objects
* @property {import('./src/api/telemetry/TelemetryAPI').default} telemetry
* @property {import('./src/api/indicators/IndicatorAPI').default} indicators
Expand All @@ -67,6 +67,7 @@ if (document.currentScript) {
* @property {import('./src/api/annotation/AnnotationAPI').default} annotation
* @property {{(plugin: OpenMCTPlugin) => void}} install
* @property {{() => string}} getAssetPath
* @property {{(assetPath: string) => void}} setAssetPath
* @property {{(domElement: HTMLElement, isHeadlessMode: boolean) => void}} start
* @property {{() => void}} startHeadless
* @property {{() => void}} destroy
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openmct",
"version": "3.3.0-next",
"version": "4.0.0-next",
"description": "The Open MCT core platform",
"type": "module",
"main": "dist/openmct.js",
Expand Down
6 changes: 4 additions & 2 deletions src/api/objects/ObjectAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,12 @@ export default class ObjectAPI {
/**
* Updates a domain object based on its latest persisted state. Note that this will mutate the provided object.
* @param {module:openmct.DomainObject} domainObject an object to refresh from its persistence store
* @param {boolean} [forceRemote=false] defaults to false. If true, will skip cached and
* dirty/in-transaction objects use and the provider.get method
* @returns {Promise} the provided object, updated to reflect the latest persisted state of the object.
*/
async refresh(domainObject) {
const refreshedObject = await this.get(domainObject.identifier);
async refresh(domainObject, forceRemote = false) {
const refreshedObject = await this.get(domainObject.identifier, null, forceRemote);

if (domainObject.isMutable) {
domainObject.$refresh(refreshedObject);
Expand Down
2 changes: 1 addition & 1 deletion src/api/objects/ObjectAPISpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ describe('The Object API', () => {
expect(objectAPI.get).not.toHaveBeenCalled();

return objectAPI.refresh(testObject).then(() => {
expect(objectAPI.get).toHaveBeenCalledWith(testObject.identifier);
expect(objectAPI.get).toHaveBeenCalledWith(testObject.identifier, null, false);

expect(testObject.otherAttribute).toEqual(OTHER_ATTRIBUTE_VALUE);
expect(testObject.newAttribute).toEqual(NEW_ATTRIBUTE_VALUE);
Expand Down
8 changes: 4 additions & 4 deletions src/api/objects/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export default class Transaction {
return Promise.all(promiseArray);
}

createDirtyObjectPromise(object, action) {
createDirtyObjectPromise(object, action, ...args) {
return new Promise((resolve, reject) => {
action(object)
action(object, ...args)
.then((success) => {
const key = this.objectAPI.makeKeyString(object.identifier);

Expand All @@ -75,10 +75,10 @@ export default class Transaction {

_clear() {
const promiseArray = [];
const refresh = this.objectAPI.refresh.bind(this.objectAPI);
const action = (obj) => this.objectAPI.refresh(obj, true);

Object.values(this.dirtyObjects).forEach((object) => {
promiseArray.push(this.createDirtyObjectPromise(object, refresh));
promiseArray.push(this.createDirtyObjectPromise(object, action));
});

return Promise.all(promiseArray);
Expand Down
1 change: 1 addition & 0 deletions src/plugins/LADTable/LADTableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ export default class LADTableView {
if (this._destroy) {
this._destroy();
}
this.component = null;
}
}
1 change: 1 addition & 0 deletions src/plugins/condition/ConditionSetViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default class ConditionSetViewProvider {
if (_destroy) {
_destroy();
}
component = null;
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/displayLayout/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class DisplayLayoutView {
destroy() {
if (this._destroy) {
this._destroy();
this.component = undefined;
this.component = null;
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/plugins/operatorStatus/operatorStatus/OperatorStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
this.role = activeRole;
const status = await this.openmct.user.status.getStatusForRole(activeRole);
if (status !== undefined) {
this.setStatus({ status });
this.setStatus({ role: this.role, status });
}
},
subscribeToMyStatus() {
Expand All @@ -141,7 +141,11 @@ export default {
subscribeToRoleChange() {
this.openmct.user.on('roleChanged', this.fetchMyStatus);
},
setStatus({ status }) {
setStatus({ role, status }) {
if (role !== this.role) {
// not my role
return;
}
status = this.applyStyling(status);
this.selectedStatus = status.key;
this.indicator.iconClass(status.iconClassPoll);
Expand Down
Loading

0 comments on commit c3190f4

Please sign in to comment.