mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
docs: Mission Status and more (#7521)
* chore: update tsconfig to target modern ES * docs: update UserProvider * docs: update UserAPI, make openmct private * docs: update StatusAPI * refactor: convert ViewRegistry to ES6 class * docs: finish type imports for openmct api * docs: minor doc improvements * docs: add UserIndicator readme * docs: add User API section to API docs * docs: document Mission Status * docs(JSDoc): primitive types should be lowercase, otherwise TitleCase
This commit is contained in:
parent
986da5782b
commit
6e264517f8
10
API.md
10
API.md
@ -1305,6 +1305,16 @@ View provider Example:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## User API
|
||||||
|
|
||||||
|
Open MCT provides a User API which can be used to define providers for user information. The API
|
||||||
|
can be used to manage user information and roles.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Open MCT provides an example [user](example/exampleUser/exampleUserCreator.js) and [user provider](example/exampleUser/ExampleUserProvider.js) which
|
||||||
|
can be used as a starting point for creating a custom user provider.
|
||||||
|
|
||||||
## Visibility-Based Rendering in View Providers
|
## Visibility-Based Rendering in View Providers
|
||||||
|
|
||||||
To enhance performance and resource efficiency in OpenMCT, a visibility-based rendering feature has been added. This feature is designed to defer the execution of rendering logic for views that are not currently visible. It ensures that views are only updated when they are in the viewport, similar to how modern browsers handle rendering of inactive tabs but optimized for the OpenMCT tabbed display. It also works when views are scrolled outside the viewport (e.g., in a Display Layout).
|
To enhance performance and resource efficiency in OpenMCT, a visibility-based rendering feature has been added. This feature is designed to defer the execution of rendering logic for views that are not currently visible. It ensures that views are only updated when they are in the viewport, similar to how modern browsers handle rendering of inactive tabs but optimized for the OpenMCT tabbed display. It also works when views are scrolled outside the viewport (e.g., in a Display Layout).
|
||||||
|
@ -46,7 +46,7 @@ const TEST_RESULTS_DIR = './test-results';
|
|||||||
* Scans for accessibility violations on a page and writes a report to disk if violations are found.
|
* Scans for accessibility violations on a page and writes a report to disk if violations are found.
|
||||||
* Automatically asserts that no violations should be present.
|
* Automatically asserts that no violations should be present.
|
||||||
*
|
*
|
||||||
* @typedef {object} GenerateReportOptions
|
* @typedef {Object} GenerateReportOptions
|
||||||
* @property {string} [reportName] - The name for the report file.
|
* @property {string} [reportName] - The name for the report file.
|
||||||
*
|
*
|
||||||
* @param {import('playwright').Page} page - The page object from Playwright.
|
* @param {import('playwright').Page} page - The page object from Playwright.
|
||||||
|
@ -40,7 +40,7 @@ import { v4 as uuid } from 'uuid';
|
|||||||
* @see {@link https://github.com/microsoft/playwright/discussions/11690 Github Discussion}
|
* @see {@link https://github.com/microsoft/playwright/discussions/11690 Github Discussion}
|
||||||
* @private
|
* @private
|
||||||
* @param {import('@playwright/test').ConsoleMessage} msg
|
* @param {import('@playwright/test').ConsoleMessage} msg
|
||||||
* @returns {String} formatted string with message type, text, url, and line and column numbers
|
* @returns {string} formatted string with message type, text, url, and line and column numbers
|
||||||
*/
|
*/
|
||||||
function _consoleMessageToString(msg) {
|
function _consoleMessageToString(msg) {
|
||||||
const { url, lineNumber, columnNumber } = msg.location();
|
const { url, lineNumber, columnNumber } = msg.location();
|
||||||
|
@ -29,7 +29,7 @@ import { expect } from '../pluginFixtures.js';
|
|||||||
* for each activity in the plan data per group, using the earliest activity's
|
* for each activity in the plan data per group, using the earliest activity's
|
||||||
* start time as the start bound and the current activity's end time as the end bound.
|
* start time as the start bound and the current activity's end time as the end bound.
|
||||||
* @param {import('@playwright/test').Page} page the page
|
* @param {import('@playwright/test').Page} page the page
|
||||||
* @param {object} plan The raw plan json to assert against
|
* @param {Object} plan The raw plan json to assert against
|
||||||
* @param {string} objectUrl The URL of the object to assert against (plan or gantt chart)
|
* @param {string} objectUrl The URL of the object to assert against (plan or gantt chart)
|
||||||
*/
|
*/
|
||||||
export async function assertPlanActivities(page, plan, objectUrl) {
|
export async function assertPlanActivities(page, plan, objectUrl) {
|
||||||
@ -86,7 +86,7 @@ function activitiesWithinTimeBounds(start1, end1, start2, end2) {
|
|||||||
* Asserts that the swim lanes / groups in the plan view matches the order of
|
* Asserts that the swim lanes / groups in the plan view matches the order of
|
||||||
* groups in the plan data.
|
* groups in the plan data.
|
||||||
* @param {import('@playwright/test').Page} page the page
|
* @param {import('@playwright/test').Page} page the page
|
||||||
* @param {object} plan The raw plan json to assert against
|
* @param {Object} plan The raw plan json to assert against
|
||||||
* @param {string} objectUrl The URL of the object to assert against (plan or gantt chart)
|
* @param {string} objectUrl The URL of the object to assert against (plan or gantt chart)
|
||||||
*/
|
*/
|
||||||
export async function assertPlanOrderedSwimLanes(page, plan, objectUrl) {
|
export async function assertPlanOrderedSwimLanes(page, plan, objectUrl) {
|
||||||
@ -110,7 +110,7 @@ export async function assertPlanOrderedSwimLanes(page, plan, objectUrl) {
|
|||||||
* Navigate to the plan view, switch to fixed time mode,
|
* Navigate to the plan view, switch to fixed time mode,
|
||||||
* and set the bounds to span all activities.
|
* and set the bounds to span all activities.
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {object} planJson
|
* @param {Object} planJson
|
||||||
* @param {string} planObjectUrl
|
* @param {string} planObjectUrl
|
||||||
*/
|
*/
|
||||||
export async function setBoundsToSpanAllActivities(page, planJson, planObjectUrl) {
|
export async function setBoundsToSpanAllActivities(page, planJson, planObjectUrl) {
|
||||||
@ -125,7 +125,7 @@ export async function setBoundsToSpanAllActivities(page, planJson, planObjectUrl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {object} planJson
|
* @param {Object} planJson
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
export function getEarliestStartTime(planJson) {
|
export function getEarliestStartTime(planJson) {
|
||||||
@ -135,7 +135,7 @@ export function getEarliestStartTime(planJson) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} planJson
|
* @param {Object} planJson
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
export function getLatestEndTime(planJson) {
|
export function getLatestEndTime(planJson) {
|
||||||
|
@ -27,8 +27,8 @@ import { expect } from '../pluginFixtures.js';
|
|||||||
* Given a canvas and a set of points, tags the points on the canvas.
|
* Given a canvas and a set of points, tags the points on the canvas.
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {HTMLCanvasElement} canvas a telemetry item with a plot
|
* @param {HTMLCanvasElement} canvas a telemetry item with a plot
|
||||||
* @param {Number} xEnd a telemetry item with a plot
|
* @param {number} xEnd a telemetry item with a plot
|
||||||
* @param {Number} yEnd a telemetry item with a plot
|
* @param {number} yEnd a telemetry item with a plot
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
export async function createTags({ page, canvas, xEnd = 700, yEnd = 520 }) {
|
export async function createTags({ page, canvas, xEnd = 700, yEnd = 520 }) {
|
||||||
|
@ -773,7 +773,7 @@ async function dragContrastSliderAndAssertFilterValues(page) {
|
|||||||
* Gets the filter:brightness value of the current background-image and
|
* Gets the filter:brightness value of the current background-image and
|
||||||
* asserts against an expected value
|
* asserts against an expected value
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {String} expected The expected brightness value
|
* @param {string} expected The expected brightness value
|
||||||
*/
|
*/
|
||||||
async function assertBackgroundImageBrightness(page, expected) {
|
async function assertBackgroundImageBrightness(page, expected) {
|
||||||
const backgroundImage = page.locator('.c-imagery__main-image__background-image');
|
const backgroundImage = page.locator('.c-imagery__main-image__background-image');
|
||||||
@ -938,7 +938,7 @@ async function buttonZoomOnImageAndAssert(page) {
|
|||||||
* Gets the filter:contrast value of the current background-image and
|
* Gets the filter:contrast value of the current background-image and
|
||||||
* asserts against an expected value
|
* asserts against an expected value
|
||||||
* @param {import('@playwright/test').Page} page
|
* @param {import('@playwright/test').Page} page
|
||||||
* @param {String} expected The expected contrast value
|
* @param {string} expected The expected contrast value
|
||||||
*/
|
*/
|
||||||
async function assertBackgroundImageContrast(page, expected) {
|
async function assertBackgroundImageContrast(page, expected) {
|
||||||
const backgroundImage = page.locator('.c-imagery__main-image__background-image');
|
const backgroundImage = page.locator('.c-imagery__main-image__background-image');
|
||||||
|
18
openmct.js
18
openmct.js
@ -30,23 +30,22 @@ if (document.currentScript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} BuildInfo
|
* @typedef {Object} BuildInfo
|
||||||
* @property {string} version
|
* @property {string} version
|
||||||
* @property {string} buildDate
|
* @property {string} buildDate
|
||||||
* @property {string} revision
|
* @property {string} revision
|
||||||
* @property {string} branch
|
* @property {string} branch
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} OpenMCT
|
* @typedef {Object} OpenMCT
|
||||||
* @property {BuildInfo} buildInfo
|
* @property {BuildInfo} buildInfo
|
||||||
* @property {*} selection
|
* @property {import('./src/selection/Selection').default} selection
|
||||||
* @property {import('./src/api/time/TimeAPI').default} time
|
* @property {import('./src/api/time/TimeAPI').default} time
|
||||||
* @property {import('./src/api/composition/CompositionAPI').default} composition
|
* @property {import('./src/api/composition/CompositionAPI').default} composition
|
||||||
* @property {*} objectViews
|
* @property {import('./src/ui/registries/ViewRegistry').default} objectViews
|
||||||
* @property {*} inspectorViews
|
* @property {import('./src/ui/registries/InspectorViewRegistry').default} inspectorViews
|
||||||
* @property {*} propertyEditors
|
* @property {import('./src/ui/registries/ViewRegistry').default} propertyEditors
|
||||||
* @property {*} toolbars
|
* @property {import('./src/ui/registries/ToolbarRegistry').default} toolbars
|
||||||
* @property {import('./src/api/types/TypeRegistry').default} types
|
* @property {import('./src/api/types/TypeRegistry').default} types
|
||||||
* @property {import('./src/api/objects/ObjectAPI').default} objects
|
* @property {import('./src/api/objects/ObjectAPI').default} objects
|
||||||
* @property {import('./src/api/telemetry/TelemetryAPI').default} telemetry
|
* @property {import('./src/api/telemetry/TelemetryAPI').default} telemetry
|
||||||
@ -59,7 +58,7 @@ if (document.currentScript) {
|
|||||||
* @property {import('./src/api/menu/MenuAPI').default} menus
|
* @property {import('./src/api/menu/MenuAPI').default} menus
|
||||||
* @property {import('./src/api/actions/ActionsAPI').default} actions
|
* @property {import('./src/api/actions/ActionsAPI').default} actions
|
||||||
* @property {import('./src/api/status/StatusAPI').default} status
|
* @property {import('./src/api/status/StatusAPI').default} status
|
||||||
* @property {*} priority
|
* @property {import('./src/api/priority/PriorityAPI').default} priority
|
||||||
* @property {import('./src/ui/router/ApplicationRouter')} router
|
* @property {import('./src/ui/router/ApplicationRouter')} router
|
||||||
* @property {import('./src/api/faultmanagement/FaultManagementAPI').default} faults
|
* @property {import('./src/api/faultmanagement/FaultManagementAPI').default} faults
|
||||||
* @property {import('./src/api/forms/FormsAPI').default} forms
|
* @property {import('./src/api/forms/FormsAPI').default} forms
|
||||||
@ -74,7 +73,6 @@ if (document.currentScript) {
|
|||||||
* @property {OpenMCTPlugin[]} plugins
|
* @property {OpenMCTPlugin[]} plugins
|
||||||
* @property {OpenMCTComponent[]} components
|
* @property {OpenMCTComponent[]} components
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { MCT } from './src/MCT.js';
|
import { MCT } from './src/MCT.js';
|
||||||
|
|
||||||
/** @type {OpenMCT} */
|
/** @type {OpenMCT} */
|
||||||
|
@ -74,6 +74,7 @@ import Browse from './ui/router/Browse.js';
|
|||||||
* or registering extensions before the application is started.
|
* or registering extensions before the application is started.
|
||||||
* @constructor
|
* @constructor
|
||||||
* @memberof module:openmct
|
* @memberof module:openmct
|
||||||
|
* @extends EventEmitter
|
||||||
*/
|
*/
|
||||||
export class MCT extends EventEmitter {
|
export class MCT extends EventEmitter {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
let brandingOptions = {};
|
let brandingOptions = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} BrandingOptions
|
* @typedef {Object} BrandingOptions
|
||||||
* @property {string} smallLogoImage URL to the image to use as the applications logo.
|
* @property {string} smallLogoImage URL to the image to use as the applications logo.
|
||||||
* This logo will appear on every screen and when clicked will launch the about dialog.
|
* This logo will appear on every screen and when clicked will launch the about dialog.
|
||||||
* @property {string} aboutHtml Custom content for the about screen. When defined the
|
* @property {string} aboutHtml Custom content for the about screen. When defined the
|
||||||
|
@ -26,12 +26,12 @@ import { v4 as uuid } from 'uuid';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @readonly
|
* @readonly
|
||||||
* @enum {String} AnnotationType
|
* @enum {string} AnnotationType
|
||||||
* @property {String} NOTEBOOK The notebook annotation type
|
* @property {string} NOTEBOOK The notebook annotation type
|
||||||
* @property {String} GEOSPATIAL The geospatial annotation type
|
* @property {string} GEOSPATIAL The geospatial annotation type
|
||||||
* @property {String} PIXEL_SPATIAL The pixel-spatial annotation type
|
* @property {string} PIXEL_SPATIAL The pixel-spatial annotation type
|
||||||
* @property {String} TEMPORAL The temporal annotation type
|
* @property {string} TEMPORAL The temporal annotation type
|
||||||
* @property {String} PLOT_SPATIAL The plot-spatial annotation type
|
* @property {string} PLOT_SPATIAL The plot-spatial annotation type
|
||||||
*/
|
*/
|
||||||
const ANNOTATION_TYPES = Object.freeze({
|
const ANNOTATION_TYPES = Object.freeze({
|
||||||
NOTEBOOK: 'NOTEBOOK',
|
NOTEBOOK: 'NOTEBOOK',
|
||||||
@ -47,9 +47,9 @@ const ANNOTATION_LAST_CREATED = 'annotationLastCreated';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Tag
|
* @typedef {Object} Tag
|
||||||
* @property {String} key a unique identifier for the tag
|
* @property {string} key a unique identifier for the tag
|
||||||
* @property {String} backgroundColor eg. "#cc0000"
|
* @property {string} backgroundColor eg. "#cc0000"
|
||||||
* @property {String} foregroundColor eg. "#ffffff"
|
* @property {string} foregroundColor eg. "#ffffff"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,11 +112,11 @@ export default class AnnotationAPI extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Creates an annotation on a given domain object (e.g., a plot) and a set of targets (e.g., telemetry objects)
|
* Creates an annotation on a given domain object (e.g., a plot) and a set of targets (e.g., telemetry objects)
|
||||||
* @typedef {Object} CreateAnnotationOptions
|
* @typedef {Object} CreateAnnotationOptions
|
||||||
* @property {String} name a name for the new annotation (e.g., "Plot annnotation")
|
* @property {string} name a name for the new annotation (e.g., "Plot annnotation")
|
||||||
* @property {DomainObject} domainObject the domain object this annotation was created with
|
* @property {DomainObject} domainObject the domain object this annotation was created with
|
||||||
* @property {ANNOTATION_TYPES} annotationType the type of annotation to create (e.g., PLOT_SPATIAL)
|
* @property {ANNOTATION_TYPES} annotationType the type of annotation to create (e.g., PLOT_SPATIAL)
|
||||||
* @property {Tag[]} tags tags to add to the annotation, e.g., SCIENCE for science related annotations
|
* @property {Tag[]} tags tags to add to the annotation, e.g., SCIENCE for science related annotations
|
||||||
* @property {String} contentText Some text to add to the annotation, e.g. ("This annotation is about science")
|
* @property {string} contentText Some text to add to the annotation, e.g. ("This annotation is about science")
|
||||||
* @property {Array<Object>} targets The targets ID keystrings and their specific properties.
|
* @property {Array<Object>} targets The targets ID keystrings and their specific properties.
|
||||||
* For plots, this will be a bounding box, e.g.: {keyString: "d8385009-789d-457b-acc7-d50ba2fd55ea", maxY: 100, minY: 0, maxX: 100, minX: 0}
|
* For plots, this will be a bounding box, e.g.: {keyString: "d8385009-789d-457b-acc7-d50ba2fd55ea", maxY: 100, minY: 0, maxX: 100, minX: 0}
|
||||||
* For notebooks, this will be an entry ID, e.g.: {entryId: "entry-ecb158f5-d23c-45e1-a704-649b382622ba"}
|
* For notebooks, this will be an entry ID, e.g.: {entryId: "entry-ecb158f5-d23c-45e1-a704-649b382622ba"}
|
||||||
@ -208,7 +208,7 @@ export default class AnnotationAPI extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method defineTag
|
* @method defineTag
|
||||||
* @param {String} key a unique identifier for the tag
|
* @param {string} key a unique identifier for the tag
|
||||||
* @param {Tag} tagsDefinition the definition of the tag to add
|
* @param {Tag} tagsDefinition the definition of the tag to add
|
||||||
*/
|
*/
|
||||||
defineTag(tagKey, tagsDefinition) {
|
defineTag(tagKey, tagsDefinition) {
|
||||||
@ -217,7 +217,7 @@ export default class AnnotationAPI extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method setNamespaceToSaveAnnotations
|
* @method setNamespaceToSaveAnnotations
|
||||||
* @param {String} namespace the namespace to save new annotations to
|
* @param {string} namespace the namespace to save new annotations to
|
||||||
*/
|
*/
|
||||||
setNamespaceToSaveAnnotations(namespace) {
|
setNamespaceToSaveAnnotations(namespace) {
|
||||||
this.namespaceToSaveAnnotations = namespace;
|
this.namespaceToSaveAnnotations = namespace;
|
||||||
@ -226,7 +226,7 @@ export default class AnnotationAPI extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* @method isAnnotation
|
* @method isAnnotation
|
||||||
* @param {DomainObject} domainObject the domainObject in question
|
* @param {DomainObject} domainObject the domainObject in question
|
||||||
* @returns {Boolean} Returns true if the domain object is an annotation
|
* @returns {boolean} Returns true if the domain object is an annotation
|
||||||
*/
|
*/
|
||||||
isAnnotation(domainObject) {
|
isAnnotation(domainObject) {
|
||||||
return domainObject && domainObject.type === ANNOTATION_TYPE;
|
return domainObject && domainObject.type === ANNOTATION_TYPE;
|
||||||
@ -442,7 +442,7 @@ export default class AnnotationAPI extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @method searchForTags
|
* @method searchForTags
|
||||||
* @param {String} query A query to match against tags. E.g., "dr" will match the tags "drilling" and "driving"
|
* @param {string} query A query to match against tags. E.g., "dr" will match the tags "drilling" and "driving"
|
||||||
* @param {Object} [abortController] An optional abort method to stop the query
|
* @param {Object} [abortController] An optional abort method to stop the query
|
||||||
* @returns {Promise} returns a model of matching tags with their target domain objects attached
|
* @returns {Promise} returns a model of matching tags with their target domain objects attached
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} ListenerMap
|
* @typedef {Object} ListenerMap
|
||||||
* @property {Array.<any>} add
|
* @property {Array.<any>} add
|
||||||
* @property {Array.<any>} remove
|
* @property {Array.<any>} remove
|
||||||
* @property {Array.<any>} load
|
* @property {Array.<any>} load
|
||||||
@ -271,7 +271,7 @@ export default class CompositionCollection {
|
|||||||
/**
|
/**
|
||||||
* Handle reorder from provider.
|
* Handle reorder from provider.
|
||||||
* @private
|
* @private
|
||||||
* @param {object} reorderMap
|
* @param {Object} reorderMap
|
||||||
*/
|
*/
|
||||||
#onProviderReorder(reorderMap) {
|
#onProviderReorder(reorderMap) {
|
||||||
this.#emit('reorder', reorderMap);
|
this.#emit('reorder', reorderMap);
|
||||||
|
@ -88,21 +88,21 @@ export default class FaultManagementAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} TriggerValueInfo
|
* @typedef {Object} TriggerValueInfo
|
||||||
* @property {number} value
|
* @property {number} value
|
||||||
* @property {string} rangeCondition
|
* @property {string} rangeCondition
|
||||||
* @property {string} monitoringResult
|
* @property {string} monitoringResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} CurrentValueInfo
|
* @typedef {Object} CurrentValueInfo
|
||||||
* @property {number} value
|
* @property {number} value
|
||||||
* @property {string} rangeCondition
|
* @property {string} rangeCondition
|
||||||
* @property {string} monitoringResult
|
* @property {string} monitoringResult
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} Fault
|
* @typedef {Object} Fault
|
||||||
* @property {boolean} acknowledged
|
* @property {boolean} acknowledged
|
||||||
* @property {CurrentValueInfo} currentValueInfo
|
* @property {CurrentValueInfo} currentValueInfo
|
||||||
* @property {string} id
|
* @property {string} id
|
||||||
@ -117,7 +117,7 @@ export default class FaultManagementAPI {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} FaultAPIResponse
|
* @typedef {Object} FaultAPIResponse
|
||||||
* @property {string} type
|
* @property {string} type
|
||||||
* @property {Fault} fault
|
* @property {Fault} fault
|
||||||
*/
|
*/
|
||||||
|
@ -48,7 +48,7 @@ export default class FormsAPI {
|
|||||||
* this formControlViewProvider is used inside form overlay to show/render a form row
|
* this formControlViewProvider is used inside form overlay to show/render a form row
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param {String} controlName a form structure, array of section
|
* @param {string} controlName a form structure, array of section
|
||||||
* @param {ControlViewProvider} controlViewProvider
|
* @param {ControlViewProvider} controlViewProvider
|
||||||
*/
|
*/
|
||||||
addNewFormControl(controlName, controlViewProvider) {
|
addNewFormControl(controlName, controlViewProvider) {
|
||||||
@ -59,7 +59,7 @@ export default class FormsAPI {
|
|||||||
* Get a ControlViewProvider for a given/stored form controlName
|
* Get a ControlViewProvider for a given/stored form controlName
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param {String} controlName a form structure, array of section
|
* @param {string} controlName a form structure, array of section
|
||||||
* @return {ControlViewProvider}
|
* @return {ControlViewProvider}
|
||||||
*/
|
*/
|
||||||
getFormControl(controlName) {
|
getFormControl(controlName) {
|
||||||
@ -69,7 +69,7 @@ export default class FormsAPI {
|
|||||||
/**
|
/**
|
||||||
* Section definition for formStructure
|
* Section definition for formStructure
|
||||||
* @typedef Section
|
* @typedef Section
|
||||||
* @property {object} name Name of the section to display on Form
|
* @property {Object} name Name of the section to display on Form
|
||||||
* @property {string} cssClass class name for styling section
|
* @property {string} cssClass class name for styling section
|
||||||
* @property {array<Row>} rows collection of rows inside a section
|
* @property {array<Row>} rows collection of rows inside a section
|
||||||
*/
|
*/
|
||||||
|
@ -25,7 +25,7 @@ import Menu, { MENU_PLACEMENT } from './menu.js';
|
|||||||
/**
|
/**
|
||||||
* Popup Menu options
|
* Popup Menu options
|
||||||
* @typedef {Object} MenuOptions
|
* @typedef {Object} MenuOptions
|
||||||
* @property {String} menuClass Class for popup menu
|
* @property {string} menuClass Class for popup menu
|
||||||
* @property {MENU_PLACEMENT} placement Placement for menu relative to click
|
* @property {MENU_PLACEMENT} placement Placement for menu relative to click
|
||||||
* @property {Function} onDestroy callback function: invoked when menu is destroyed
|
* @property {Function} onDestroy callback function: invoked when menu is destroyed
|
||||||
*/
|
*/
|
||||||
@ -33,10 +33,10 @@ import Menu, { MENU_PLACEMENT } from './menu.js';
|
|||||||
/**
|
/**
|
||||||
* Popup Menu Item/action
|
* Popup Menu Item/action
|
||||||
* @typedef {Object} Action
|
* @typedef {Object} Action
|
||||||
* @property {String} cssClass Class for menu item
|
* @property {string} cssClass Class for menu item
|
||||||
* @property {Boolean} isDisabled adds disable class if true
|
* @property {boolean} isDisabled adds disable class if true
|
||||||
* @property {String} name Menu item text
|
* @property {string} name Menu item text
|
||||||
* @property {String} description Menu item description
|
* @property {string} description Menu item description
|
||||||
* @property {Function} onItemClicked callback function: invoked when item is clicked
|
* @property {Function} onItemClicked callback function: invoked when item is clicked
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import EventEmitter from 'eventemitter3';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} NotificationProperties
|
* @typedef {Object} NotificationProperties
|
||||||
* @property {function} dismiss Dismiss the notification
|
* @property {function} dismiss Dismiss the notification
|
||||||
* @property {NotificationModel} model The Notification model
|
* @property {NotificationModel} model The Notification model
|
||||||
* @property {(progressPerc: number, progressText: string) => void} [progress] Update the progress of the notification
|
* @property {(progressPerc: number, progressText: string) => void} [progress] Update the progress of the notification
|
||||||
@ -45,14 +45,14 @@ import moment from 'moment';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} NotificationLink
|
* @typedef {Object} NotificationLink
|
||||||
* @property {function} onClick The function to be called when the link is clicked
|
* @property {function} onClick The function to be called when the link is clicked
|
||||||
* @property {string} cssClass A CSS class name to style the link
|
* @property {string} cssClass A CSS class name to style the link
|
||||||
* @property {string} text The text to be displayed for the link
|
* @property {string} text The text to be displayed for the link
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} NotificationOptions
|
* @typedef {Object} NotificationOptions
|
||||||
* @property {number} [autoDismissTimeout] Milliseconds to wait before automatically dismissing the notification
|
* @property {number} [autoDismissTimeout] Milliseconds to wait before automatically dismissing the notification
|
||||||
* @property {boolean} [minimized] Allows for a notification to be minimized into the indicator by default
|
* @property {boolean} [minimized] Allows for a notification to be minimized into the indicator by default
|
||||||
* @property {NotificationLink} [link] A link for the notification
|
* @property {NotificationLink} [link] A link for the notification
|
||||||
@ -66,7 +66,7 @@ import moment from 'moment';
|
|||||||
* and then minimized to a banner notification if needed, or vice-versa.
|
* and then minimized to a banner notification if needed, or vice-versa.
|
||||||
*
|
*
|
||||||
* @see DialogModel
|
* @see DialogModel
|
||||||
* @typedef {object} NotificationModel
|
* @typedef {Object} NotificationModel
|
||||||
* @property {string} message The message to be displayed by the notification
|
* @property {string} message The message to be displayed by the notification
|
||||||
* @property {number | 'unknown'} [progress] The progress of some ongoing task. Should be a number between 0 and 100, or
|
* @property {number | 'unknown'} [progress] The progress of some ongoing task. Should be a number between 0 and 100, or
|
||||||
* with the string literal 'unknown'.
|
* with the string literal 'unknown'.
|
||||||
|
@ -391,7 +391,7 @@ class InMemorySearchProvider {
|
|||||||
* Dispatch a search query to the worker and return a queryId.
|
* Dispatch a search query to the worker and return a queryId.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @returns {String} a unique query Id for the query.
|
* @returns {string} a unique query Id for the query.
|
||||||
*/
|
*/
|
||||||
#dispatchSearchToWorker({ queryId, searchType, query, maxResults }) {
|
#dispatchSearchToWorker({ queryId, searchType, query, maxResults }) {
|
||||||
const message = {
|
const message = {
|
||||||
|
@ -34,7 +34,7 @@ import Transaction from './Transaction.js';
|
|||||||
/**
|
/**
|
||||||
* Uniquely identifies a domain object.
|
* Uniquely identifies a domain object.
|
||||||
*
|
*
|
||||||
* @typedef {object} Identifier
|
* @typedef {Object} Identifier
|
||||||
* @property {string} namespace the namespace to/from which this domain
|
* @property {string} namespace the namespace to/from which this domain
|
||||||
* object should be loaded/stored.
|
* object should be loaded/stored.
|
||||||
* @property {string} key a unique identifier for the domain object
|
* @property {string} key a unique identifier for the domain object
|
||||||
@ -51,7 +51,7 @@ import Transaction from './Transaction.js';
|
|||||||
* A few common properties are defined for domain objects. Beyond these,
|
* A few common properties are defined for domain objects. Beyond these,
|
||||||
* individual types of domain objects may add more as they see fit.
|
* individual types of domain objects may add more as they see fit.
|
||||||
*
|
*
|
||||||
* @typedef {object} DomainObject
|
* @typedef {Object} DomainObject
|
||||||
* @property {Identifier} identifier a key/namespace pair which
|
* @property {Identifier} identifier a key/namespace pair which
|
||||||
* uniquely identifies this domain object
|
* uniquely identifies this domain object
|
||||||
* @property {string} type the type of domain object
|
* @property {string} type the type of domain object
|
||||||
@ -572,8 +572,8 @@ export default class ObjectAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return path of telemetry objects in the object composition
|
* Return path of telemetry objects in the object composition
|
||||||
* @param {object} identifier the identifier for the domain object to query for
|
* @param {Object} identifier the identifier for the domain object to query for
|
||||||
* @param {object} [telemetryIdentifier] the specific identifier for the telemetry
|
* @param {Object} [telemetryIdentifier] the specific identifier for the telemetry
|
||||||
* to look for in the composition, uses first object in composition otherwise
|
* to look for in the composition, uses first object in composition otherwise
|
||||||
* @returns {Array} path of telemetry object in object composition
|
* @returns {Array} path of telemetry object in object composition
|
||||||
*/
|
*/
|
||||||
|
@ -107,7 +107,7 @@ class OverlayAPI {
|
|||||||
* displaying messages that require the user's
|
* displaying messages that require the user's
|
||||||
* immediate attention.
|
* immediate attention.
|
||||||
* @param {model} options defines options for the dialog
|
* @param {model} options defines options for the dialog
|
||||||
* @returns {object} with an object with a dismiss function that can be called from the calling code
|
* @returns {Object} with an object with a dismiss function that can be called from the calling code
|
||||||
* to dismiss/destroy the dialog
|
* to dismiss/destroy the dialog
|
||||||
*
|
*
|
||||||
* A description of the model options that may be passed to the
|
* A description of the model options that may be passed to the
|
||||||
@ -134,7 +134,7 @@ class OverlayAPI {
|
|||||||
* Displays a blocking (modal) progress dialog. This dialog can be used for
|
* Displays a blocking (modal) progress dialog. This dialog can be used for
|
||||||
* displaying messages that require the user's attention, and show progress
|
* displaying messages that require the user's attention, and show progress
|
||||||
* @param {model} options defines options for the dialog
|
* @param {model} options defines options for the dialog
|
||||||
* @returns {object} with an object with a dismiss function that can be called from the calling code
|
* @returns {Object} with an object with a dismiss function that can be called from the calling code
|
||||||
* to dismiss/destroy the dialog and an updateProgress function that takes progressPercentage(Number 0-100)
|
* to dismiss/destroy the dialog and an updateProgress function that takes progressPercentage(Number 0-100)
|
||||||
* and progressText (string)
|
* and progressText (string)
|
||||||
*
|
*
|
||||||
|
@ -156,7 +156,7 @@ class BatchingWebSocket extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Number} maxBatchSize the maximum length of a batch of messages. For example,
|
* @param {number} maxBatchSize the maximum length of a batch of messages. For example,
|
||||||
* the maximum number of telemetry values to batch before dropping them
|
* the maximum number of telemetry values to batch before dropping them
|
||||||
* Note that this is a fail-safe that is only invoked if performance drops to the
|
* Note that this is a fail-safe that is only invoked if performance drops to the
|
||||||
* point where Open MCT cannot keep up with the amount of telemetry it is receiving.
|
* point where Open MCT cannot keep up with the amount of telemetry it is receiving.
|
||||||
|
@ -38,19 +38,19 @@ import TelemetryValueFormatter from './TelemetryValueFormatter.js';
|
|||||||
* Describes and bounds requests for telemetry data.
|
* Describes and bounds requests for telemetry data.
|
||||||
*
|
*
|
||||||
* @typedef TelemetryRequestOptions
|
* @typedef TelemetryRequestOptions
|
||||||
* @property {String} [sort] the key of the property to sort by. This may
|
* @property {string} [sort] the key of the property to sort by. This may
|
||||||
* be prefixed with a "+" or a "-" sign to sort in ascending
|
* be prefixed with a "+" or a "-" sign to sort in ascending
|
||||||
* or descending order respectively. If no prefix is present,
|
* or descending order respectively. If no prefix is present,
|
||||||
* ascending order will be used.
|
* ascending order will be used.
|
||||||
* @property {Number} [start] the lower bound for values of the sorting property
|
* @property {number} [start] the lower bound for values of the sorting property
|
||||||
* @property {Number} [end] the upper bound for values of the sorting property
|
* @property {number} [end] the upper bound for values of the sorting property
|
||||||
* @property {String} [strategy] symbolic identifier for strategies
|
* @property {string} [strategy] symbolic identifier for strategies
|
||||||
* (such as `latest` or `minmax`) which may be recognized by providers;
|
* (such as `latest` or `minmax`) which may be recognized by providers;
|
||||||
* these will be tried in order until an appropriate provider
|
* these will be tried in order until an appropriate provider
|
||||||
* is found
|
* is found
|
||||||
* @property {AbortController} [signal] an AbortController which can be used
|
* @property {AbortController} [signal] an AbortController which can be used
|
||||||
* to cancel a telemetry request
|
* to cancel a telemetry request
|
||||||
* @property {String} [domain] the domain key of the request
|
* @property {string} [domain] the domain key of the request
|
||||||
* @property {TimeContext} [timeContext] the time context to use for this request
|
* @property {TimeContext} [timeContext] the time context to use for this request
|
||||||
* @memberof module:openmct.TelemetryAPI~
|
* @memberof module:openmct.TelemetryAPI~
|
||||||
*/
|
*/
|
||||||
@ -59,7 +59,7 @@ import TelemetryValueFormatter from './TelemetryValueFormatter.js';
|
|||||||
* Describes and bounds requests for telemetry data.
|
* Describes and bounds requests for telemetry data.
|
||||||
*
|
*
|
||||||
* @typedef TelemetrySubscriptionOptions
|
* @typedef TelemetrySubscriptionOptions
|
||||||
* @property {String} [strategy] symbolic identifier directing providers on how
|
* @property {string} [strategy] symbolic identifier directing providers on how
|
||||||
* to handle telemetry subscriptions. The default behavior is 'latest' which will
|
* to handle telemetry subscriptions. The default behavior is 'latest' which will
|
||||||
* always return a single telemetry value with each callback, and in the event
|
* always return a single telemetry value with each callback, and in the event
|
||||||
* of throttling will always prioritize the latest data, meaning intermediate
|
* of throttling will always prioritize the latest data, meaning intermediate
|
||||||
@ -936,7 +936,7 @@ export default class TelemetryAPI {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} LimitsResponseObject
|
* @typedef {Object} LimitsResponseObject
|
||||||
* @memberof {module:openmct.TelemetryAPI~}
|
* @memberof {module:openmct.TelemetryAPI~}
|
||||||
* @property {LimitDefinition} limitLevel the level name and it's limit definition
|
* @property {LimitDefinition} limitLevel the level name and it's limit definition
|
||||||
* @example {
|
* @example {
|
||||||
@ -966,7 +966,7 @@ export default class TelemetryAPI {
|
|||||||
* @typedef LimitDefinitionValue
|
* @typedef LimitDefinitionValue
|
||||||
* @memberof {module:openmct.TelemetryAPI~}
|
* @memberof {module:openmct.TelemetryAPI~}
|
||||||
* @property {string} color color to represent this limit
|
* @property {string} color color to represent this limit
|
||||||
* @property {Number} value the limit value
|
* @property {number} value the limit value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1050,9 +1050,9 @@ export default class TelemetryAPI {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} StalenessResponseObject
|
* @typedef {Object} StalenessResponseObject
|
||||||
* @property {Boolean} isStale boolean representing the staleness state
|
* @property {boolean} isStale boolean representing the staleness state
|
||||||
* @property {Number} timestamp Unix timestamp in milliseconds
|
* @property {number} timestamp Unix timestamp in milliseconds
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ export default function installWorker() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Establish a new WebSocket connection to the given URL
|
* Establish a new WebSocket connection to the given URL
|
||||||
* @param {String} url
|
* @param {string} url
|
||||||
*/
|
*/
|
||||||
connect(url) {
|
connect(url) {
|
||||||
this.#wsUrl = url;
|
this.#wsUrl = url;
|
||||||
|
@ -62,7 +62,7 @@ class TimeAPI extends GlobalTimeContext {
|
|||||||
* another time system might be "sols" for a Martian mission. TimeSystems do
|
* another time system might be "sols" for a Martian mission. TimeSystems do
|
||||||
* not address the issue of converting between time systems.
|
* not address the issue of converting between time systems.
|
||||||
*
|
*
|
||||||
* @typedef {object} TimeSystem
|
* @typedef {Object} TimeSystem
|
||||||
* @property {string} key A unique identifier
|
* @property {string} key A unique identifier
|
||||||
* @property {string} name A human-readable descriptor
|
* @property {string} name A human-readable descriptor
|
||||||
* @property {string} [cssClass] Specify a css class defining an icon for
|
* @property {string} [cssClass] Specify a css class defining an icon for
|
||||||
@ -95,7 +95,7 @@ class TimeAPI extends GlobalTimeContext {
|
|||||||
* Clocks provide a timing source that is used to
|
* Clocks provide a timing source that is used to
|
||||||
* automatically update the time bounds of the data displayed in Open MCT.
|
* automatically update the time bounds of the data displayed in Open MCT.
|
||||||
*
|
*
|
||||||
* @typedef {object} Clock
|
* @typedef {Object} Clock
|
||||||
* @memberof openmct.timeAPI
|
* @memberof openmct.timeAPI
|
||||||
* @property {string} key A unique identifier
|
* @property {string} key A unique identifier
|
||||||
* @property {string} name A human-readable name. The name will be used to
|
* @property {string} name A human-readable name. The name will be used to
|
||||||
|
@ -122,7 +122,7 @@ class TimeContext extends EventEmitter {
|
|||||||
* Clock offsets are used to calculate temporal bounds when the system is
|
* Clock offsets are used to calculate temporal bounds when the system is
|
||||||
* ticking on a clock source.
|
* ticking on a clock source.
|
||||||
*
|
*
|
||||||
* @typedef {object} ValidationResult
|
* @typedef {Object} ValidationResult
|
||||||
* @property {boolean} valid Result of the validation - true or false.
|
* @property {boolean} valid Result of the validation - true or false.
|
||||||
* @property {string} message An error message if valid is false.
|
* @property {string} message An error message if valid is false.
|
||||||
*/
|
*/
|
||||||
@ -241,7 +241,7 @@ class TimeContext extends EventEmitter {
|
|||||||
* Clock offsets are used to calculate temporal bounds when the system is
|
* Clock offsets are used to calculate temporal bounds when the system is
|
||||||
* ticking on a clock source.
|
* ticking on a clock source.
|
||||||
*
|
*
|
||||||
* @typedef {object} ClockOffsets
|
* @typedef {Object} ClockOffsets
|
||||||
* @property {number} start A time span relative to the current value of the
|
* @property {number} start A time span relative to the current value of the
|
||||||
* ticking clock, from which start bounds will be calculated. This value must
|
* ticking clock, from which start bounds will be calculated. This value must
|
||||||
* be < 0. When a clock is active, bounds will be calculated automatically
|
* be < 0. When a clock is active, bounds will be calculated automatically
|
||||||
|
@ -24,12 +24,12 @@ import Tooltip from './ToolTip.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @readonly
|
* @readonly
|
||||||
* @enum {String} TooltipLocation
|
* @enum {string} TooltipLocation
|
||||||
* @property {String} ABOVE The string for locating tooltips above an element
|
* @property {string} ABOVE The string for locating tooltips above an element
|
||||||
* @property {String} BELOW The string for locating tooltips below an element
|
* @property {string} BELOW The string for locating tooltips below an element
|
||||||
* @property {String} RIGHT The pixel-spatial annotation type
|
* @property {string} RIGHT The pixel-spatial annotation type
|
||||||
* @property {String} LEFT The temporal annotation type
|
* @property {string} LEFT The temporal annotation type
|
||||||
* @property {String} CENTER The plot-spatial annotation type
|
* @property {string} CENTER The plot-spatial annotation type
|
||||||
*/
|
*/
|
||||||
const TOOLTIP_LOCATIONS = Object.freeze({
|
const TOOLTIP_LOCATIONS = Object.freeze({
|
||||||
ABOVE: 'above',
|
ABOVE: 'above',
|
||||||
|
@ -21,10 +21,23 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
import EventEmitter from 'EventEmitter';
|
import EventEmitter from 'EventEmitter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The StatusAPI is used to get and set various statuses linked to the current logged in user.
|
||||||
|
* This includes the ability to set the status of the current user as a response to a poll question,
|
||||||
|
* set the poll question itself, and the ability to set the status of mission actions.
|
||||||
|
*
|
||||||
|
* @augments EventEmitter
|
||||||
|
*/
|
||||||
export default class StatusAPI extends EventEmitter {
|
export default class StatusAPI extends EventEmitter {
|
||||||
|
/** @type {UserAPI} */
|
||||||
#userAPI;
|
#userAPI;
|
||||||
|
/** @type {OpenMCT} */
|
||||||
#openmct;
|
#openmct;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {UserAPI} userAPI
|
||||||
|
* @param {OpenMCT} openmct
|
||||||
|
*/
|
||||||
constructor(userAPI, openmct) {
|
constructor(userAPI, openmct) {
|
||||||
super();
|
super();
|
||||||
this.#userAPI = userAPI;
|
this.#userAPI = userAPI;
|
||||||
@ -64,7 +77,7 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a poll question for operators to respond to. When presented with a status poll question, all operators will reply with their current status.
|
* Set a poll question for operators to respond to. When presented with a status poll question, all operators will reply with their current status.
|
||||||
* @param {String} questionText - The text of the question
|
* @param {string} questionText - The text of the question
|
||||||
* @returns {Promise<Boolean>} true if operation was successful, otherwise false.
|
* @returns {Promise<Boolean>} true if operation was successful, otherwise false.
|
||||||
*/
|
*/
|
||||||
async setPollQuestion(questionText) {
|
async setPollQuestion(questionText) {
|
||||||
@ -316,7 +329,7 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private internal function that cannot be made #private because it needs to be registered as a callback to the user provider
|
* Listen to status events from the UserProvider
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
listenToStatusEvents(provider) {
|
listenToStatusEvents(provider) {
|
||||||
@ -328,6 +341,7 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Emit a status change event
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onProviderStatusChange(newStatus) {
|
onProviderStatusChange(newStatus) {
|
||||||
@ -335,6 +349,7 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Emit a poll question change event
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onProviderPollQuestionChange(pollQuestion) {
|
onProviderPollQuestionChange(pollQuestion) {
|
||||||
@ -342,6 +357,7 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Emit a mission action status change event
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onMissionActionStatusChange({ action, status }) {
|
onMissionActionStatusChange({ action, status }) {
|
||||||
@ -349,6 +365,14 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {import('./UserAPI').default} UserAPI
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {import('../../../openmct').OpenMCT} OpenMCT
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('./UserProvider')} UserProvider
|
* @typedef {import('./UserProvider')} UserProvider
|
||||||
*/
|
*/
|
||||||
@ -360,27 +384,29 @@ export default class StatusAPI extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* The PollQuestion type
|
* The PollQuestion type
|
||||||
* @typedef {Object} PollQuestion
|
* @typedef {Object} PollQuestion
|
||||||
* @property {String} question - The question to be presented to users
|
* @property {string} question - The question to be presented to users
|
||||||
* @property {Number} timestamp - The time that the poll question was set.
|
* @property {number} timestamp - The time that the poll question was set.
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The MissionStatus type
|
|
||||||
* @typedef {Object} MissionStatusOption
|
|
||||||
* @extends {Status}
|
|
||||||
* @property {String} color A color to be used when displaying the mission status
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} MissionAction
|
* @typedef {Object} MissionAction
|
||||||
* @property {String} key A unique identifier for this action
|
* @property {string} key A unique identifier for this action
|
||||||
* @property {String} label A human readable label for this action
|
* @property {string} label A human readable label for this action
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The MissionStatusOption type, extends Status.
|
||||||
|
* @typedef {Object} MissionStatusOption
|
||||||
|
* @property {string} key - A unique identifier for this status.
|
||||||
|
* @property {string} label - A human-readable label for this status.
|
||||||
|
* @property {number} timestamp - The time that the status was set.
|
||||||
|
* @property {string} color - A color to be used when displaying the mission status.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Status type
|
* The Status type
|
||||||
* @typedef {Object} Status
|
* @typedef {Object} Status
|
||||||
* @property {String} key - A unique identifier for this status
|
* @property {string} key - A unique identifier for this status
|
||||||
* @property {String} label - A human readable label for this status
|
* @property {string} label - A human readable label for this status
|
||||||
* @property {Number} timestamp - The time that the status was set.
|
* @property {number} timestamp - The time that the status was set.
|
||||||
*/
|
*/
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The example User class.
|
||||||
|
*/
|
||||||
export default class User {
|
export default class User {
|
||||||
constructor(id, name) {
|
constructor(id, name) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -28,6 +28,8 @@ import StoragePersistance from './StoragePersistance.js';
|
|||||||
import User from './User.js';
|
import User from './User.js';
|
||||||
|
|
||||||
class UserAPI extends EventEmitter {
|
class UserAPI extends EventEmitter {
|
||||||
|
/** @type {OpenMCT} */
|
||||||
|
#openmct;
|
||||||
/**
|
/**
|
||||||
* @param {OpenMCT} openmct
|
* @param {OpenMCT} openmct
|
||||||
* @param {UserAPIConfiguration} config
|
* @param {UserAPIConfiguration} config
|
||||||
@ -35,7 +37,7 @@ class UserAPI extends EventEmitter {
|
|||||||
constructor(openmct, config) {
|
constructor(openmct, config) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this._openmct = openmct;
|
this.#openmct = openmct;
|
||||||
this._provider = undefined;
|
this._provider = undefined;
|
||||||
|
|
||||||
this.User = User;
|
this.User = User;
|
||||||
@ -134,7 +136,7 @@ class UserAPI extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Will return if a role can provide a operator status response
|
* Will return if a role can provide a operator status response
|
||||||
* @memberof module:openmct.UserApi#
|
* @memberof module:openmct.UserApi#
|
||||||
* @returns {Boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
canProvideStatusForRole() {
|
canProvideStatusForRole() {
|
||||||
if (!this.hasProvider()) {
|
if (!this.hasProvider()) {
|
||||||
@ -166,7 +168,7 @@ class UserAPI extends EventEmitter {
|
|||||||
* 'hasRole' method
|
* 'hasRole' method
|
||||||
*
|
*
|
||||||
* @memberof module:openmct.UserAPI#
|
* @memberof module:openmct.UserAPI#
|
||||||
* @returns {Function|Boolean} user provider 'isLoggedIn' method
|
* @returns {Function|boolean} user provider 'isLoggedIn' method
|
||||||
* @param {string} roleId id of role to check for
|
* @param {string} roleId id of role to check for
|
||||||
* @throws Will throw an error if no user provider is set
|
* @throws Will throw an error if no user provider is set
|
||||||
*/
|
*/
|
||||||
@ -201,20 +203,28 @@ class UserAPI extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default UserAPI;
|
export default UserAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {String} Role
|
* @typedef {string} Role
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} OpenMCT
|
* @typedef {import('../../../openmct.js').OpenMCT} OpenMCT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{statusStyles: Object.<string, StatusStyleDefinition>}} UserAPIConfiguration
|
* @typedef {{statusStyles: Object.<string, StatusStyleDefinition>}} UserAPIConfiguration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} StatusStyleDefinition
|
* @typedef {Object} StatusStyleDefinition
|
||||||
* @property {String} iconClass The icon class to apply to the status indicator when this status is active "icon-circle-slash",
|
* @property {string} iconClass The icon class to apply to the status indicator when this status is active "icon-circle-slash",
|
||||||
* @property {String} iconClassPoll The icon class to apply to the poll question indicator when this style is active eg. "icon-status-poll-question-mark"
|
* @property {string} iconClassPoll The icon class to apply to the poll question indicator when this style is active eg. "icon-status-poll-question-mark"
|
||||||
* @property {String} statusClass The class to apply to the indicator when this status is active eg. "s-status-error"
|
* @property {string} statusClass The class to apply to the indicator when this status is active eg. "s-status-error"
|
||||||
* @property {String} statusBgColor The background color to apply in the status summary section of the poll question popup for this status eg."#9900cc"
|
* @property {string} statusBgColor The background color to apply in the status summary section of the poll question popup for this status eg."#9900cc"
|
||||||
* @property {String} statusFgColor The foreground color to apply in the status summary section of the poll question popup for this status eg. "#fff"
|
* @property {string} statusFgColor The foreground color to apply in the status summary section of the poll question popup for this status eg. "#fff"
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} UserProvider
|
||||||
*/
|
*/
|
||||||
|
@ -19,18 +19,24 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A user provider is responsible for providing information about the currently
|
||||||
|
* logged in user. This includes information about the user's roles, and whether
|
||||||
|
* the user is currently logged in.
|
||||||
|
*/
|
||||||
export default class UserProvider {
|
export default class UserProvider {
|
||||||
/**
|
/**
|
||||||
* @returns {Promise<User>} A promise that resolves with the currently logged in user
|
* @returns {Promise<User>} A promise that resolves with the currently logged in user
|
||||||
*/
|
*/
|
||||||
getCurrentUser() {}
|
getCurrentUser() {}
|
||||||
/**
|
/**
|
||||||
* @returns {Boolean} true if a user is currently logged in, otherwise false
|
* @returns {boolean} true if a user is currently logged in, otherwise false
|
||||||
*/
|
*/
|
||||||
isLoggedIn() {}
|
isLoggedIn() {}
|
||||||
/**
|
/**
|
||||||
* @param {String} role
|
* @param {string} role
|
||||||
* @returns {Promise<Boolean>} true if the current user has the given role
|
* @returns {Promise<boolean>} true if the current user has the given role
|
||||||
*/
|
*/
|
||||||
hasRole(role) {}
|
hasRole(role) {}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ class ImageExporter {
|
|||||||
* Converts an HTML element into a PNG or JPG Blob.
|
* Converts an HTML element into a PNG or JPG Blob.
|
||||||
* @private
|
* @private
|
||||||
* @param {node} element that will be converted to an image
|
* @param {node} element that will be converted to an image
|
||||||
* @param {object} options Image options.
|
* @param {Object} options Image options.
|
||||||
* @returns {promise}
|
* @returns {promise}
|
||||||
*/
|
*/
|
||||||
renderElement(element, { imageType, className, thumbnailSize }) {
|
renderElement(element, { imageType, className, thumbnailSize }) {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
import { ACTIVITY_STATES_KEY } from './createActivityStatesIdentifier.js';
|
import { ACTIVITY_STATES_KEY } from './createActivityStatesIdentifier.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} ActivityStatesInterceptorOptions
|
* @typedef {Object} ActivityStatesInterceptorOptions
|
||||||
* @property {import('../../api/objects/ObjectAPI').Identifier} identifier the {namespace, key} to use for the activity states object.
|
* @property {import('../../api/objects/ObjectAPI').Identifier} identifier the {namespace, key} to use for the activity states object.
|
||||||
* @property {string} name The name of the activity states model.
|
* @property {string} name The name of the activity states model.
|
||||||
* @property {number} priority the priority of the interceptor. By default, it is low.
|
* @property {number} priority the priority of the interceptor. By default, it is low.
|
||||||
@ -34,7 +34,7 @@ import { ACTIVITY_STATES_KEY } from './createActivityStatesIdentifier.js';
|
|||||||
* This will only get invoked when an attempt is made to save the state for an activity and no activity states object exists in the store.
|
* This will only get invoked when an attempt is made to save the state for an activity and no activity states object exists in the store.
|
||||||
* @param {import('../../../openmct').OpenMCT} openmct
|
* @param {import('../../../openmct').OpenMCT} openmct
|
||||||
* @param {ActivityStatesInterceptorOptions} options
|
* @param {ActivityStatesInterceptorOptions} options
|
||||||
* @returns {object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
const ACTIVITY_STATES_TYPE = 'activity-states';
|
const ACTIVITY_STATES_TYPE = 'activity-states';
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export default function AutoflowTabularController(domainObject, data, openmct) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the "Last Updated" value to be displayed.
|
* Set the "Last Updated" value to be displayed.
|
||||||
* @param {String} value the value to display
|
* @param {string} value the value to display
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
AutoflowTabularController.prototype.trackLastUpdated = function (value) {
|
AutoflowTabularController.prototype.trackLastUpdated = function (value) {
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
* with the mouse while the horizontal dimensions shrink in
|
* with the mouse while the horizontal dimensions shrink in
|
||||||
* kind (and vertical properties remain unmodified.)
|
* kind (and vertical properties remain unmodified.)
|
||||||
*
|
*
|
||||||
* @param {object} rawPosition the initial position/dimensions
|
* @param {Object} rawPosition the initial position/dimensions
|
||||||
* of the frame being interacted with
|
* of the frame being interacted with
|
||||||
* @param {number[]} posFactor the position factor
|
* @param {number[]} posFactor the position factor
|
||||||
* @param {number[]} dimFactor the dimensions factor
|
* @param {number[]} dimFactor the dimensions factor
|
||||||
|
@ -59,7 +59,7 @@ export default class ExportAsJSONAction {
|
|||||||
// Public
|
// Public
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} objectPath
|
* @param {Object} objectPath
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
appliesTo(objectPath) {
|
appliesTo(objectPath) {
|
||||||
@ -191,9 +191,9 @@ export default class ExportAsJSONAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} child
|
* @param {Object} child
|
||||||
* @param {object} parent
|
* @param {Object} parent
|
||||||
* @returns {object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
#rewriteLink(child, parent) {
|
#rewriteLink(child, parent) {
|
||||||
const originalKeyString = this.#getKeystring(child);
|
const originalKeyString = this.#getKeystring(child);
|
||||||
@ -266,7 +266,7 @@ export default class ExportAsJSONAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} domainObject
|
* @param {Object} domainObject
|
||||||
* @returns {string} A string representation of the given identifier, including namespace and key
|
* @returns {string} A string representation of the given identifier, including namespace and key
|
||||||
*/
|
*/
|
||||||
#getKeystring(domainObject) {
|
#getKeystring(domainObject) {
|
||||||
@ -275,7 +275,7 @@ export default class ExportAsJSONAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} domainObject
|
* @param {Object} domainObject
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
#isCreatableAndPersistable(domainObject) {
|
#isCreatableAndPersistable(domainObject) {
|
||||||
@ -287,8 +287,8 @@ export default class ExportAsJSONAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} child
|
* @param {Object} child
|
||||||
* @param {object} parent
|
* @param {Object} parent
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
#isLinkedObject(child, parent) {
|
#isLinkedObject(child, parent) {
|
||||||
@ -376,14 +376,14 @@ export default class ExportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} completedTree
|
* @param {Object} completedTree
|
||||||
*/
|
*/
|
||||||
saveAs(completedTree) {
|
saveAs(completedTree) {
|
||||||
this.JSONExportService.export(completedTree, { filename: this.root.name + '.json' });
|
this.JSONExportService.export(completedTree, { filename: this.root.name + '.json' });
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @returns {object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
#wrapTree() {
|
#wrapTree() {
|
||||||
return {
|
return {
|
||||||
|
@ -39,7 +39,7 @@ export default class ImportAsJSONAction {
|
|||||||
// Public
|
// Public
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} objectPath
|
* @param {Object} objectPath
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
appliesTo(objectPath) {
|
appliesTo(objectPath) {
|
||||||
@ -58,15 +58,15 @@ export default class ImportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} objectPath
|
* @param {Object} objectPath
|
||||||
*/
|
*/
|
||||||
invoke(objectPath) {
|
invoke(objectPath) {
|
||||||
this._showForm(objectPath[0]);
|
this._showForm(objectPath[0]);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} object
|
* @param {Object} object
|
||||||
* @param {object} changes
|
* @param {Object} changes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
onSave(object, changes) {
|
onSave(object, changes) {
|
||||||
@ -79,9 +79,9 @@ export default class ImportAsJSONAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} parent
|
* @param {Object} parent
|
||||||
* @param {object} tree
|
* @param {Object} tree
|
||||||
* @param {object} seen
|
* @param {Object} seen
|
||||||
* @param {Array} objectsToCreate tracks objects from import json that will need to be created
|
* @param {Array} objectsToCreate tracks objects from import json that will need to be created
|
||||||
*/
|
*/
|
||||||
_deepInstantiate(parent, tree, seen, objectsToCreate) {
|
_deepInstantiate(parent, tree, seen, objectsToCreate) {
|
||||||
@ -112,7 +112,7 @@ export default class ImportAsJSONAction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} parent
|
* @param {Object} parent
|
||||||
* @returns [identifiers]
|
* @returns [identifiers]
|
||||||
*/
|
*/
|
||||||
_getObjectReferenceIds(parent) {
|
_getObjectReferenceIds(parent) {
|
||||||
@ -146,9 +146,9 @@ export default class ImportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} tree
|
* @param {Object} tree
|
||||||
* @param {string} namespace
|
* @param {string} namespace
|
||||||
* @returns {object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
_generateNewIdentifiers(tree, newNamespace) {
|
_generateNewIdentifiers(tree, newNamespace) {
|
||||||
// For each domain object in the file, generate new ID, replace in tree
|
// For each domain object in the file, generate new ID, replace in tree
|
||||||
@ -166,8 +166,8 @@ export default class ImportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} domainObject
|
* @param {Object} domainObject
|
||||||
* @param {object} objTree
|
* @param {Object} objTree
|
||||||
*/
|
*/
|
||||||
async _importObjectTree(domainObject, objTree) {
|
async _importObjectTree(domainObject, objTree) {
|
||||||
const objectsToCreate = [];
|
const objectsToCreate = [];
|
||||||
@ -211,18 +211,18 @@ export default class ImportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} model
|
* @param {Object} model
|
||||||
* @returns {object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
_instantiate(model) {
|
_instantiate(model) {
|
||||||
return this.openmct.objects.save(model);
|
return this.openmct.objects.save(model);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} oldId
|
* @param {Object} oldId
|
||||||
* @param {object} newId
|
* @param {Object} newId
|
||||||
* @param {object} tree
|
* @param {Object} tree
|
||||||
* @returns {object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
_rewriteId(oldId, newId, tree) {
|
_rewriteId(oldId, newId, tree) {
|
||||||
let newIdKeyString = this.openmct.objects.makeKeyString(newId);
|
let newIdKeyString = this.openmct.objects.makeKeyString(newId);
|
||||||
@ -256,7 +256,7 @@ export default class ImportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} domainObject
|
* @param {Object} domainObject
|
||||||
*/
|
*/
|
||||||
_showForm(domainObject) {
|
_showForm(domainObject) {
|
||||||
const formStructure = {
|
const formStructure = {
|
||||||
@ -285,7 +285,7 @@ export default class ImportAsJSONAction {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {object} data
|
* @param {Object} data
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
_validateJSON(data) {
|
_validateJSON(data) {
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* @memberof platform/persistence/couch
|
* @memberof platform/persistence/couch
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {string} id the id under which to store this mode
|
* @param {string} id the id under which to store this mode
|
||||||
* @param {object} model the model to store
|
* @param {Object} model the model to store
|
||||||
* @param {string} rev the revision to include (or undefined,
|
* @param {string} rev the revision to include (or undefined,
|
||||||
* if no revision should be noted for couch)
|
* if no revision should be noted for couch)
|
||||||
* @param {boolean} whether or not to mark this document as
|
* @param {boolean} whether or not to mark this document as
|
||||||
|
@ -30,11 +30,11 @@ import PlanViewProvider from './PlanViewProvider.js';
|
|||||||
|
|
||||||
const ACTIVITY_STATES_DEFAULT_NAME = 'Activity States';
|
const ACTIVITY_STATES_DEFAULT_NAME = 'Activity States';
|
||||||
/**
|
/**
|
||||||
* @typedef {object} PlanOptions
|
* @typedef {Object} PlanOptions
|
||||||
* @property {boolean} creatable true/false to allow creation of a plan via the Create menu.
|
* @property {boolean} creatable true/false to allow creation of a plan via the Create menu.
|
||||||
* @property {string} name The name of the activity states model.
|
* @property {string} name The name of the activity states model.
|
||||||
* @property {string} namespace the namespace to use for the activity states object.
|
* @property {string} namespace the namespace to use for the activity states object.
|
||||||
* @property {Number} priority the priority of the interceptor. By default, it is low.
|
* @property {number} priority the priority of the interceptor. By default, it is low.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,15 +22,15 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The SourceMap allows mapping specific implementations of plan domain objects to those expected by Open MCT.
|
* The SourceMap allows mapping specific implementations of plan domain objects to those expected by Open MCT.
|
||||||
* @typedef {object} SourceMapOption
|
* @typedef {Object} SourceMapOption
|
||||||
* @property {string} orderedGroups the property of the plan that lists groups/swim lanes specifying what order they will be displayed in Open MCT.
|
* @property {string} orderedGroups the property of the plan that lists groups/swim lanes specifying what order they will be displayed in Open MCT.
|
||||||
* @property {string} activities the property of the plan that has the list of activities to be displayed.
|
* @property {string} activities the property of the plan that has the list of activities to be displayed.
|
||||||
* @property {string} groupId the property of the activity that maps to the group/swim lane it should be displayed in.
|
* @property {string} groupId the property of the activity that maps to the group/swim lane it should be displayed in.
|
||||||
* @property {string} start The start time property of the activity
|
* @property {string} start The start time property of the activity
|
||||||
* @property {string} end The end time property of the activity
|
* @property {string} end The end time property of the activity
|
||||||
* @property {string} id The unique id of the activity. This is required to allow setting activity states
|
* @property {string} id The unique id of the activity. This is required to allow setting activity states
|
||||||
* @property {object} displayProperties a list of key: value pairs that specifies which properties of the activity should be displayed when it is selected. Ex. {'location': 'Location', 'metadata.length_in_meters', 'Length (meters)'}
|
* @property {Object} displayProperties a list of key: value pairs that specifies which properties of the activity should be displayed when it is selected. Ex. {'location': 'Location', 'metadata.length_in_meters', 'Length (meters)'}
|
||||||
* @property {object} filterMetadata a list of strings that specifies which properties of the activity be included for filtering. Ex. {'description','properties.length_in_meters'}
|
* @property {Object} filterMetadata a list of strings that specifies which properties of the activity be included for filtering. Ex. {'description','properties.length_in_meters'}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
import Model from './Model.js';
|
import Model from './Model.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template {object} T
|
* @template {Object} T
|
||||||
* @template {object} O
|
* @template {Object} O
|
||||||
* @extends {Model<T, O>}
|
* @extends {Model<T, O>}
|
||||||
*/
|
*/
|
||||||
export default class Collection extends Model {
|
export default class Collection extends Model {
|
||||||
|
@ -26,8 +26,8 @@ import _ from 'lodash';
|
|||||||
import eventHelpers from '../lib/eventHelpers.js';
|
import eventHelpers from '../lib/eventHelpers.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template {object} T
|
* @template {Object} T
|
||||||
* @template {object} O
|
* @template {Object} O
|
||||||
*/
|
*/
|
||||||
export default class Model extends EventEmitter {
|
export default class Model extends EventEmitter {
|
||||||
/**
|
/**
|
||||||
@ -144,15 +144,15 @@ export default class Model extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@template {object} T
|
@template {Object} T
|
||||||
@typedef {{
|
@typedef {{
|
||||||
id?: string
|
id?: string
|
||||||
} & T} ModelType
|
} & T} ModelType
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@template {object} T
|
@template {Object} T
|
||||||
@template {object} O
|
@template {Object} O
|
||||||
@typedef {{
|
@typedef {{
|
||||||
model?: ModelType<T>
|
model?: ModelType<T>
|
||||||
models?: T[]
|
models?: T[]
|
||||||
|
@ -422,7 +422,7 @@ export default class PlotSeries extends Model {
|
|||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} newData a telemetry datum.
|
* @param {Object} newData a telemetry datum.
|
||||||
* @param {Boolean} [sorted] default false, if true will append
|
* @param {boolean} [sorted] default false, if true will append
|
||||||
* a point to the end without dupe checking.
|
* a point to the end without dupe checking.
|
||||||
*/
|
*/
|
||||||
add(newData, sorted = false) {
|
add(newData, sorted = false) {
|
||||||
|
@ -302,7 +302,7 @@ export default class YAxisModel extends Model {
|
|||||||
* For a given series collection, get the metadata of the current yKey for each series.
|
* For a given series collection, get the metadata of the current yKey for each series.
|
||||||
* Then return first available value of the given property from the metadata.
|
* Then return first available value of the given property from the metadata.
|
||||||
* @param {import('./SeriesCollection').default} series
|
* @param {import('./SeriesCollection').default} series
|
||||||
* @param {String} property
|
* @param {string} property
|
||||||
*/
|
*/
|
||||||
getMetadataValueByProperty(series, property) {
|
getMetadataValueByProperty(series, property) {
|
||||||
return series
|
return series
|
||||||
|
@ -315,9 +315,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} PlotYTickData
|
* @typedef {Object} PlotYTickData
|
||||||
* @property {Number} leftTickWidth the width of the ticks for all the y axes on the left of the plot.
|
* @property {number} leftTickWidth the width of the ticks for all the y axes on the left of the plot.
|
||||||
* @property {Number} rightTickWidth the width of the ticks for all the y axes on the right of the plot.
|
* @property {number} rightTickWidth the width of the ticks for all the y axes on the right of the plot.
|
||||||
* @property {Boolean} hasMultipleLeftAxes whether or not there is more than one left y axis.
|
* @property {boolean} hasMultipleLeftAxes whether or not there is more than one left y axis.
|
||||||
*/
|
*/
|
||||||
onYTickWidthChange(data, plotId) {
|
onYTickWidthChange(data, plotId) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(this.tickWidthMap, plotId)) {
|
if (!Object.prototype.hasOwnProperty.call(this.tickWidthMap, plotId)) {
|
||||||
|
@ -464,7 +464,7 @@ ConditionEvaluator.prototype.getInputTypeById = function (dataType) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the test data cache used by this rule evaluator
|
* Set the test data cache used by this rule evaluator
|
||||||
* @param {object} testCache A mock cache following the format of the real
|
* @param {Object} testCache A mock cache following the format of the real
|
||||||
* subscription cache
|
* subscription cache
|
||||||
*/
|
*/
|
||||||
ConditionEvaluator.prototype.setTestDataCache = function (testCache) {
|
ConditionEvaluator.prototype.setTestDataCache = function (testCache) {
|
||||||
|
@ -241,7 +241,7 @@ ConditionManager.prototype.onCompositionAdd = function (obj) {
|
|||||||
/**
|
/**
|
||||||
* Invoked on a remove event in this Summary Widget's composition. Removes
|
* Invoked on a remove event in this Summary Widget's composition. Removes
|
||||||
* the object from the local composition, and untracks it
|
* the object from the local composition, and untracks it
|
||||||
* @param {object} identifier The identifier of the object to be removed
|
* @param {Object} identifier The identifier of the object to be removed
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ConditionManager.prototype.onCompositionRemove = function (identifier) {
|
ConditionManager.prototype.onCompositionRemove = function (identifier) {
|
||||||
|
@ -377,7 +377,7 @@ SummaryWidget.prototype.reorder = function (event) {
|
|||||||
/**
|
/**
|
||||||
* Apply a list of css properties to an element
|
* Apply a list of css properties to an element
|
||||||
* @param {element} elem The DOM element to which the rules will be applied
|
* @param {element} elem The DOM element to which the rules will be applied
|
||||||
* @param {object} style an object representing the style
|
* @param {Object} style an object representing the style
|
||||||
*/
|
*/
|
||||||
SummaryWidget.prototype.applyStyle = function (elem, style) {
|
SummaryWidget.prototype.applyStyle = function (elem, style) {
|
||||||
Object.keys(style).forEach(function (propId) {
|
Object.keys(style).forEach(function (propId) {
|
||||||
|
@ -8,7 +8,7 @@ import ObjectSelect from './input/ObjectSelect.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An object representing a single mock telemetry value
|
* An object representing a single mock telemetry value
|
||||||
* @param {object} itemConfig the configuration for this item, consisting of
|
* @param {Object} itemConfig the configuration for this item, consisting of
|
||||||
* object, key, and value fields
|
* object, key, and value fields
|
||||||
* @param {number} index the index of this TestDataItem object in the data
|
* @param {number} index the index of this TestDataItem object in the data
|
||||||
* model of its parent {TestDataManager} o be injected into callbacks
|
* model of its parent {TestDataManager} o be injected into callbacks
|
||||||
|
@ -268,7 +268,7 @@ export default class TableRowCollection extends EventEmitter {
|
|||||||
* collection.sort("timestamp.text");
|
* collection.sort("timestamp.text");
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param {object} sortOptions An object specifying a sort key, and direction.
|
* @param {Object} sortOptions An object specifying a sort key, and direction.
|
||||||
*/
|
*/
|
||||||
sortBy(sortOptions) {
|
sortBy(sortOptions) {
|
||||||
if (arguments.length > 0) {
|
if (arguments.length > 0) {
|
||||||
|
55
src/plugins/userIndicator/README.md
Normal file
55
src/plugins/userIndicator/README.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# User Indicator
|
||||||
|
|
||||||
|
This plugin provides a user indicator for the top status bar that displays user information as
|
||||||
|
defined by a User Provider. A User Provider must be registered as a prerequisite for this plugin.
|
||||||
|
|
||||||
|
If the User Provider supports role-based access control, the user indicator will display the user's
|
||||||
|
current role and, if the user has multiple roles, allow the user to switch between them.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To use this plugin, first register a custom User Provider with the `openmct` API, or install the example
|
||||||
|
User Provider plugin:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
openmct.install(openmct.plugins.example.ExampleUser());
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, install the User Indicator plugin:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
openmct.install(openmct.plugins.UserIndicator());
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The User Indicator plugin does not require any configuration itself.
|
||||||
|
|
||||||
|
## Mission Status
|
||||||
|
|
||||||
|
"Mission Status" is a feature that is used to indicate the current state of a mission with regards to
|
||||||
|
one or more "Mission Actions". A mission action defines a verb that may be, for example, a task
|
||||||
|
for a spacecraft (such as "Drive" or "Imagery"), a change in the state of a ground system, or any
|
||||||
|
other event that is relevant to the mission. Example states for a mission action might include
|
||||||
|
"Go" or "No Go", indicating whether a particular action is currently cleared for execution.
|
||||||
|
|
||||||
|
A user with the appropriate permissions may set the mission status by clicking on either the
|
||||||
|
User Indicator itself, or the "Mission Status" button next to the User Indicator. This will
|
||||||
|
open a dialog that allows the user to set the status of each mission action.
|
||||||
|
|
||||||
|
### Provider Configuration
|
||||||
|
|
||||||
|
In order to use the Mission Status feature, a registered User Provider must define the following
|
||||||
|
methods:
|
||||||
|
|
||||||
|
* `canSetMissionStatus`: A method that returns a boolean indicating whether the current user has
|
||||||
|
permission to set the mission status.
|
||||||
|
* `getPossibleMissionActions`: A method that returns an array of mission actions that the user
|
||||||
|
may set the status of. Each mission action should have a `key` and a `name` property.
|
||||||
|
* `getPossibleMissionActionStatuses`: A method that returns an array of `MissionStatusOption` objects,
|
||||||
|
which define the possible statuses for each mission action.
|
||||||
|
* `getStatusForMissionAction`: A method that returns the current status for a given mission action.
|
||||||
|
* `setStatusForMissionAction`: A method that sets the status for a given mission action.
|
||||||
|
|
||||||
|
The [Example User Provider](../../../example/exampleUser/ExampleUserProvider.js) provides an example
|
||||||
|
implementation of these methods.
|
@ -63,8 +63,7 @@ export default class Selection extends EventEmitter {
|
|||||||
* Selects the selectable object and emits the 'change' event.
|
* Selects the selectable object and emits the 'change' event.
|
||||||
*
|
*
|
||||||
* @param {Selectable|Selectable[]} selectable An object or array of objects with element and context properties
|
* @param {Selectable|Selectable[]} selectable An object or array of objects with element and context properties
|
||||||
* @param {object} selectable an object with element and context properties
|
* @param {boolean} isMultiSelectEvent flag indication shift key is pressed or not
|
||||||
* @param {Boolean} isMultiSelectEvent flag indication shift key is pressed or not
|
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
select(selectable, isMultiSelectEvent) {
|
select(selectable, isMultiSelectEvent) {
|
||||||
|
@ -140,7 +140,7 @@ export default {
|
|||||||
* @param {import('../../api/objects/ObjectAPI').DomainObject[]} objectPath
|
* @param {import('../../api/objects/ObjectAPI').DomainObject[]} objectPath
|
||||||
*/
|
*/
|
||||||
navigateToPath(objectPath) {
|
navigateToPath(objectPath) {
|
||||||
/** @type {String} */
|
/** @type {string} */
|
||||||
const path = `/browse/${this.openmct.objects.getRelativePath(objectPath)}`;
|
const path = `/browse/${this.openmct.objects.getRelativePath(objectPath)}`;
|
||||||
|
|
||||||
return path.replace('ROOT/', '');
|
return path.replace('ROOT/', '');
|
||||||
|
@ -36,7 +36,7 @@ export default class InspectorViewRegistry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {object} selection the object to be viewed
|
* @param {Object} selection the object to be viewed
|
||||||
* @returns {module:openmct.InspectorViewRegistry[]} any providers
|
* @returns {module:openmct.InspectorViewRegistry[]} any providers
|
||||||
* which can provide views of this object
|
* which can provide views of this object
|
||||||
* @private for platform-internal use
|
* @private for platform-internal use
|
||||||
|
@ -33,7 +33,7 @@ export default function ToolbarRegistry() {
|
|||||||
/**
|
/**
|
||||||
* Gets toolbar controls from providers which can provide a toolbar for this selection.
|
* Gets toolbar controls from providers which can provide a toolbar for this selection.
|
||||||
*
|
*
|
||||||
* @param {object} selection the selection object
|
* @param {Object} selection the selection object
|
||||||
* @returns {Object[]} an array of objects defining controls for the toolbar
|
* @returns {Object[]} an array of objects defining controls for the toolbar
|
||||||
* @private for platform-internal use
|
* @private for platform-internal use
|
||||||
*/
|
*/
|
||||||
@ -112,6 +112,6 @@ ToolbarRegistry.prototype.addProvider = function (provider) {
|
|||||||
*
|
*
|
||||||
* @method toolbar
|
* @method toolbar
|
||||||
* @memberof module:openmct.ToolbarProvider#
|
* @memberof module:openmct.ToolbarProvider#
|
||||||
* @param {object} selection the selection object
|
* @param {Object} selection the selection object
|
||||||
* @returns {Object[]} an array of objects defining controls for the toolbar.
|
* @returns {Object[]} an array of objects defining controls for the toolbar.
|
||||||
*/
|
*/
|
||||||
|
@ -30,97 +30,93 @@ const DEFAULT_VIEW_PRIORITY = 100;
|
|||||||
* @interface ViewRegistry
|
* @interface ViewRegistry
|
||||||
* @memberof module:openmct
|
* @memberof module:openmct
|
||||||
*/
|
*/
|
||||||
export default function ViewRegistry() {
|
export default class ViewRegistry extends EventEmitter {
|
||||||
EventEmitter.apply(this);
|
constructor() {
|
||||||
this.providers = {};
|
super();
|
||||||
}
|
EventEmitter.apply(this);
|
||||||
|
this.providers = {};
|
||||||
ViewRegistry.prototype = Object.create(EventEmitter.prototype);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private for platform-internal use
|
|
||||||
* @param {*} item the object to be viewed
|
|
||||||
* @param {array} objectPath - The current contextual object path of the view object
|
|
||||||
* eg current domainObject is located under MyItems which is under Root
|
|
||||||
* @returns {module:openmct.ViewProvider[]} any providers
|
|
||||||
* which can provide views of this object
|
|
||||||
*/
|
|
||||||
ViewRegistry.prototype.get = function (item, objectPath) {
|
|
||||||
if (objectPath === undefined) {
|
|
||||||
throw 'objectPath must be provided to get applicable views for an object';
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @private for platform-internal use
|
||||||
|
* @param {*} item the object to be viewed
|
||||||
|
* @param {array} objectPath - The current contextual object path of the view object
|
||||||
|
* eg current domainObject is located under MyItems which is under Root
|
||||||
|
* @returns {module:openmct.ViewProvider[]} any providers
|
||||||
|
* which can provide views of this object
|
||||||
|
*/
|
||||||
|
get(item, objectPath) {
|
||||||
|
if (objectPath === undefined) {
|
||||||
|
throw 'objectPath must be provided to get applicable views for an object';
|
||||||
|
}
|
||||||
|
|
||||||
function byPriority(providerA, providerB) {
|
function byPriority(providerA, providerB) {
|
||||||
let priorityA = providerA.priority ? providerA.priority(item) : DEFAULT_VIEW_PRIORITY;
|
let priorityA = providerA.priority ? providerA.priority(item) : DEFAULT_VIEW_PRIORITY;
|
||||||
let priorityB = providerB.priority ? providerB.priority(item) : DEFAULT_VIEW_PRIORITY;
|
let priorityB = providerB.priority ? providerB.priority(item) : DEFAULT_VIEW_PRIORITY;
|
||||||
|
|
||||||
return priorityB - priorityA;
|
return priorityB - priorityA;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.getAllProviders()
|
||||||
|
.filter(function (provider) {
|
||||||
|
return provider.canView(item, objectPath);
|
||||||
|
})
|
||||||
|
.sort(byPriority);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
return this.getAllProviders()
|
* @private
|
||||||
.filter(function (provider) {
|
*/
|
||||||
return provider.canView(item, objectPath);
|
getAllProviders() {
|
||||||
})
|
return Object.values(this.providers);
|
||||||
.sort(byPriority);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
ViewRegistry.prototype.getAllProviders = function () {
|
|
||||||
return Object.values(this.providers);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register a new type of view.
|
|
||||||
*
|
|
||||||
* @param {module:openmct.ViewProvider} provider the provider for this view
|
|
||||||
* @method addProvider
|
|
||||||
* @memberof module:openmct.ViewRegistry#
|
|
||||||
*/
|
|
||||||
ViewRegistry.prototype.addProvider = function (provider) {
|
|
||||||
const key = provider.key;
|
|
||||||
if (key === undefined) {
|
|
||||||
throw "View providers must have a unique 'key' property defined";
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Register a new type of view.
|
||||||
|
*
|
||||||
|
* @param {module:openmct.ViewProvider} provider the provider for this view
|
||||||
|
* @method addProvider
|
||||||
|
* @memberof module:openmct.ViewRegistry#
|
||||||
|
*/
|
||||||
|
addProvider(provider) {
|
||||||
|
const key = provider.key;
|
||||||
|
if (key === undefined) {
|
||||||
|
throw "View providers must have a unique 'key' property defined";
|
||||||
|
}
|
||||||
|
|
||||||
if (this.providers[key] !== undefined) {
|
if (this.providers[key] !== undefined) {
|
||||||
console.warn("Provider already defined for key '%s'. Provider keys must be unique.", key);
|
console.warn(`Provider already defined for key '${key}'. Provider keys must be unique.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const wrappedView = provider.view.bind(provider);
|
const wrappedView = provider.view.bind(provider);
|
||||||
provider.view = (domainObject, objectPath) => {
|
provider.view = (domainObject, objectPath) => {
|
||||||
const viewObject = wrappedView(domainObject, objectPath);
|
const viewObject = wrappedView(domainObject, objectPath);
|
||||||
const wrappedShow = viewObject.show.bind(viewObject);
|
const wrappedShow = viewObject.show.bind(viewObject);
|
||||||
viewObject.key = key; // provide access to provider key on view object
|
viewObject.key = key; // provide access to provider key on view object
|
||||||
viewObject.show = (element, isEditing, viewOptions) => {
|
viewObject.show = (element, isEditing, viewOptions) => {
|
||||||
viewObject.parentElement = element.parentElement;
|
viewObject.parentElement = element.parentElement;
|
||||||
wrappedShow(element, isEditing, viewOptions);
|
wrappedShow(element, isEditing, viewOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
return viewObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
return viewObject;
|
this.providers[key] = provider;
|
||||||
};
|
}
|
||||||
|
/**
|
||||||
this.providers[key] = provider;
|
* @private
|
||||||
};
|
*/
|
||||||
|
getByProviderKey(key) {
|
||||||
/**
|
return this.providers[key];
|
||||||
* @private
|
}
|
||||||
*/
|
/**
|
||||||
ViewRegistry.prototype.getByProviderKey = function (key) {
|
* Used internally to support seamless usage of new views with old
|
||||||
return this.providers[key];
|
* views.
|
||||||
};
|
* @private
|
||||||
|
*/
|
||||||
/**
|
getByVPID(vpid) {
|
||||||
* Used internally to support seamless usage of new views with old
|
return this.providers.filter(function (p) {
|
||||||
* views.
|
return p.vpid === vpid;
|
||||||
* @private
|
})[0];
|
||||||
*/
|
}
|
||||||
ViewRegistry.prototype.getByVPID = function (vpid) {
|
}
|
||||||
return this.providers.filter(function (p) {
|
|
||||||
return p.vpid === vpid;
|
|
||||||
})[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A View is used to provide displayable content, and to react to
|
* A View is used to provide displayable content, and to react to
|
||||||
@ -248,7 +244,7 @@ ViewRegistry.prototype.getByVPID = function (vpid) {
|
|||||||
* Provide a view of this object.
|
* Provide a view of this object.
|
||||||
*
|
*
|
||||||
* When called by Open MCT, the following arguments will be passed to it:
|
* When called by Open MCT, the following arguments will be passed to it:
|
||||||
* @param {object} domainObject - the domainObject that the view is provided for
|
* @param {Object} domainObject - the domainObject that the view is provided for
|
||||||
* @param {array} objectPath - The current contextual object path of the view object
|
* @param {array} objectPath - The current contextual object path of the view object
|
||||||
* eg current domainObject is located under MyItems which is under Root
|
* eg current domainObject is located under MyItems which is under Root
|
||||||
*
|
*
|
||||||
|
@ -89,7 +89,7 @@ class ApplicationRouter extends EventEmitter {
|
|||||||
* @property {URL} url current url location
|
* @property {URL} url current url location
|
||||||
* @property {string} path current url location pathname
|
* @property {string} path current url location pathname
|
||||||
* @property {string} getQueryString a function which returns url search query
|
* @property {string} getQueryString a function which returns url search query
|
||||||
* @property {object} params object representing url searchParams
|
* @property {Object} params object representing url searchParams
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,7 +113,7 @@ class ApplicationRouter extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Get current location URL Object searchParams
|
* Get current location URL Object searchParams
|
||||||
*
|
*
|
||||||
* @returns {object} object representing current url searchParams
|
* @returns {Object} object representing current url searchParams
|
||||||
*/
|
*/
|
||||||
getParams() {
|
getParams() {
|
||||||
return this.currentLocation.params;
|
return this.currentLocation.params;
|
||||||
@ -143,7 +143,7 @@ class ApplicationRouter extends EventEmitter {
|
|||||||
*
|
*
|
||||||
* @param {Array<Object>} objectPath Object path of a given Domain Object
|
* @param {Array<Object>} objectPath Object path of a given Domain Object
|
||||||
*
|
*
|
||||||
* @returns {Boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isNavigatedObject(objectPath) {
|
isNavigatedObject(objectPath) {
|
||||||
let targetObject = objectPath[0];
|
let targetObject = objectPath[0];
|
||||||
@ -329,8 +329,8 @@ class ApplicationRouter extends EventEmitter {
|
|||||||
* @private
|
* @private
|
||||||
* Compare new and old params and on change emit event 'change:params'
|
* Compare new and old params and on change emit event 'change:params'
|
||||||
*
|
*
|
||||||
* @param {object} newParams new params of url
|
* @param {Object} newParams new params of url
|
||||||
* @param {object} oldParams old params of url
|
* @param {Object} oldParams old params of url
|
||||||
* @returns {boolean} true if params changed, false otherwise
|
* @returns {boolean} true if params changed, false otherwise
|
||||||
*/
|
*/
|
||||||
doParamsChange(newParams, oldParams) {
|
doParamsChange(newParams, oldParams) {
|
||||||
|
@ -13,10 +13,12 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
|
"noImplicitAny": false,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
"target": "ES2015",
|
||||||
"paths": {
|
"paths": {
|
||||||
// matches the alias in webpack config, so that types for those imports are visible.
|
// matches the alias in webpack config, so that types for those imports are visible.
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
|
Loading…
Reference in New Issue
Block a user