tweak priorities for inspector views, added new priority constants HIGHEST/LOWEST, update docs

This commit is contained in:
Jamie V 2025-04-10 10:43:01 -07:00
parent 6b6afbdead
commit d4354e7e22
13 changed files with 29 additions and 12 deletions

12
API.md
View File

@ -31,6 +31,10 @@
- [`latest` request strategy](#latest-request-strategy)
- [`minmax` request strategy](#minmax-request-strategy)
- [Telemetry Formats](#telemetry-formats)
- [Built-in Formats](#built-in-formats)
- [**Number Format (default):**](#number-format-default)
- [**String Format**](#string-format)
- [**Enum Format**](#enum-format)
- [Registering Formats](#registering-formats)
- [Telemetry Data](#telemetry-data)
- [Telemetry Datums](#telemetry-datums)
@ -59,6 +63,12 @@
- [Custom Indicators](#custom-indicators)
- [Priority API](#priority-api)
- [Priority Types](#priority-types)
- [User API](#user-api)
- [Example](#example)
- [Visibility-Based Rendering in View Providers](#visibility-based-rendering-in-view-providers)
- [Overview](#overview)
- [Implementing Visibility-Based Rendering](#implementing-visibility-based-rendering)
- [Example](#example-1)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@ -1301,9 +1311,11 @@ Open MCT provides some built-in priority values that can be used in the applicat
Currently, the Open MCT Priority API provides (type: numeric value):
- HIGHEST: Infinity
- HIGH: 1000
- Default: 0
- LOW: -1000
- LOWEST: -Infinity
View provider Example:

View File

@ -65,9 +65,11 @@ test.describe('Tagging in Notebooks @addInit', () => {
});
test('Can add tags with blank entry', async ({ page }) => {
await createDomainObjectWithDefaults(page, { type: 'Notebook' });
await page.getByRole('tab', { name: 'Annotations' }).click();
await enterTextEntry(page, '');
await page.getByRole('tab', { name: 'Annotations' }).click();
await page.hover(`button:has-text("Add Tag")`);
await page.locator(`button:has-text("Add Tag")`).click();

View File

@ -21,8 +21,11 @@
*****************************************************************************/
const PRIORITIES = Object.freeze({
HIGHEST: Infinity,
HIGH: 1000,
DEFAULT: 0,
LOW: -1000
LOW: -1000,
LOWEST: -Infinity
});
export default PRIORITIES;

View File

@ -40,7 +40,7 @@ export default function ScatterPlotInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.editor.isEditing() ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
return openmct.editor.isEditing() ? openmct.priority.HIGH : openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {

View File

@ -63,7 +63,7 @@ export default function FaultManagementInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.priority.HIGH + 1;
return openmct.priority.HIGH;
},
destroy: function () {
if (_destroy) {

View File

@ -77,7 +77,7 @@ export default function AnnotationsViewProvider(openmct) {
},
priority: function () {
if (isNotebookEntry) {
return openmct.priority.HIGH + 1;
return openmct.priority.HIGHEST;
}
if (isConditionSet) {

View File

@ -58,7 +58,7 @@ export default function PropertiesViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.editor.isEditing() ? openmct.priority.LOW : openmct.priority.HIGH + 2;
return openmct.editor.isEditing() ? openmct.priority.LOW : openmct.priority.HIGH;
},
destroy: function () {
if (_destroy) {

View File

@ -62,7 +62,7 @@ export default function ActivityInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.priority.HIGH + 1;
return openmct.priority.HIGH;
},
destroy: function () {
if (_destroy) {

View File

@ -62,7 +62,7 @@ export default function GanttChartInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.editor.isEditing() ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
return openmct.editor.isEditing() ? openmct.priority.HIGH : openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {

View File

@ -52,7 +52,7 @@ export default function PlotsInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.priority.HIGH + 1;
return openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {

View File

@ -50,7 +50,7 @@ export default function StackedPlotsInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.editor.isEditing() ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
return openmct.editor.isEditing() ? openmct.priority.HIGH : openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {

View File

@ -69,7 +69,7 @@ export default function TableConfigurationViewProvider(openmct, options) {
return true;
},
priority: function () {
return openmct.editor.isEditing() ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
return openmct.editor.isEditing() ? openmct.priority.HIGH : openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {

View File

@ -63,7 +63,7 @@ export default function TimeListInspectorViewProvider(openmct) {
_destroy = destroy;
},
priority: function () {
return openmct.editor.isEditing() ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT;
return openmct.editor.isEditing() ? openmct.priority.HIGH : openmct.priority.DEFAULT;
},
destroy: function () {
if (_destroy) {