Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .cspell/omm-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ mslsol
# names
dsanto
peterr
smap

# TODO fix
# remove dismissable when implementing https://github.com/NASA-AMMOS/openmct-mcws/issues/209
dismissable
smap
5 changes: 3 additions & 2 deletions .webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ const config = {
__OMM_BUILD_DATE__: `'${new Date()}'`,
__OMM_REVISION__: `'${gitRevision}'`,
__OMM_BUILD_BRANCH__: `'${gitBranch}'`,
__VUE_OPTIONS_API__: true, // enable/disable Options API support, default: true
__VUE_PROD_DEVTOOLS__: false // enable/disable devtools support in production, default: false
__VUE_OPTIONS_API__: true, // Options API support, default: true
__VUE_PROD_DEVTOOLS__: false, // devtools support in production, default: false
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false // detailed hydration mismatch support when using esm-bundler, default: false
}),
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
Expand Down
7 changes: 5 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,15 @@
/**
* Enable/disable summary widgets. Added in R3.4.0.
*/
summaryWidgets: {
enabled: true
SummaryWidget: {
enabled: false
},
BarChart: {
enabled: false
},
CorrelationTelemetry: {
enabled: false
},
ScatterPlot: {
enabled: false
},
Expand Down
21 changes: 9 additions & 12 deletions loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,20 @@ define([
});
}

// install optional plugins, summary widget is handled separately as it was added long ago
// install optional plugins
if (config.plugins) {
if (
config.plugins.summaryWidgets === true ||
config.plugins.summaryWidgets?.enabled === true
) {
openmct.install(openmct.plugins.SummaryWidget());
}

Object.entries(config.plugins).forEach(([plugin, pluginConfig]) => {
const pluginExists = openmct.plugins[plugin] || openmct.plugins.example[plugin];
const examplePluginExists = openmct.plugins.example[plugin];
const pluginExists = openmct.plugins[plugin] || examplePluginExists;
const pluginEnabled = pluginConfig?.enabled;
const isSummaryWidget = plugin === 'summaryWidgets';
const installPlugin = pluginExists && pluginEnabled && !isSummaryWidget;
const installPlugin = pluginExists && pluginEnabled;

if (installPlugin) {
openmct.install(openmct.plugins[plugin](...(pluginConfig.configuration ?? [])));
if (examplePluginExists) {
openmct.install(openmct.plugins.example[plugin](...(pluginConfig.configuration ?? [])));
} else {
openmct.install(openmct.plugins[plugin](...(pluginConfig.configuration ?? [])));
}
} else if (!pluginExists) {
console.warn(`Plugin ${plugin} does not exist. Check the plugin name and try again.`);
}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openmct-mcws",
"version": "2512.02-next",
"version": "v5.4.0-rc6",
"description": "Open MCT for MCWS",
"devDependencies": {
"@babel/eslint-parser": "7.26.8",
Expand Down Expand Up @@ -40,7 +40,7 @@
"mini-css-extract-plugin": "2.7.6",
"moment": "2.30.1",
"node-bourbon": "^4.2.3",
"openmct": "github:nasa/openmct#omm-r5.4.0-rc1",
"openmct": "github:nasa/openmct#omm-r5.4.0-rc8",
"prettier": "3.4.2",
"printj": "1.3.1",
"raw-loader": "^0.5.1",
Expand Down Expand Up @@ -75,11 +75,11 @@
"url": "https://github.com/NASA-AMMOS/openmct-mcws"
},
"engines": {
"node": ">=18.18.0"
"node": ">=18.18.0 <23"
},
"overrides": {
"core-js": "3.21.1"
},
"author": "",
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>gov.nasa.arc.wtd</groupId>
<artifactId>openmct-client</artifactId>
<name>Open MCT for MCWS Client</name>
<version>2512.02-next</version>
<version>v5.4.0-rc6</version>
<packaging>war</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/alarmsView/AlarmsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class AlarmsTable extends TelemetryTable {

//If no persisted sort order, default to sorting by time system, ascending.
sortOptions = sortOptions || {
key: this.openmct.time.timeSystem().key,
key: this.openmct.time.getTimeSystem().key,
direction: 'asc'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class ChannelTableRowCollection extends TableRowCollection {

this.openmct = openmct;
this.ladMap = new Map();
this.timeColumn = openmct.time.timeSystem().key;
this.timeColumn = openmct.time.getTimeSystem().key;
this.addOrUpdateRow = this.addOrUpdateRow.bind(this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/channelTable/channelTableSetPlugin/ChannelRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export default {
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
// this.timeContext = this.openmct.time.getContextForView(this.objectPath);
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(this.domainObject);
this.openmct.time.on('timeSystem', this.updateTimeSystem);
this.timestampKey = this.openmct.time.timeSystem().key;
this.openmct.time.on('timeSystemChanged', this.updateTimeSystem);
this.timestampKey = this.openmct.time.getTimeSystem().key;
this.valueMetadata = undefined;
if (this.metadata) {
this.valueMetadata =
Expand All @@ -96,7 +96,7 @@ export default {
this.telemetryCollection.load();
},
beforeUnmount() {
this.openmct.time.off('timeSystem', this.updateTimeSystem);
this.openmct.time.off('timeSystemChanged', this.updateTimeSystem);
this.telemetryCollection.off('add', this.setLatestValues);
this.telemetryCollection.off('clear', this.resetValues);
this.telemetryCollection.destroy();
Expand Down
8 changes: 4 additions & 4 deletions src/channelTable/channelTableSetPlugin/ChannelTableSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export default {
this.composition.on('add', this.addLadTable);
this.composition.on('remove', this.removeLadTable);
this.composition.on('reorder', this.reorderLadTables);
this.openmct.time.on('timeSystem', this.setTimesystem);
this.setTimesystem(this.openmct.time.timeSystem());
this.openmct.time.on('timeSystemChanged', this.setTimeSystem);
this.setTimeSystem(this.openmct.time.getTimeSystem());
this.composition.load();
},
beforeUnmount() {
Expand All @@ -66,7 +66,7 @@ export default {
c.composition.off('add', c.addCallback);
c.composition.off('remove', c.removeCallback);
});
this.openmct.time.off('timeSystem', this.setTimesystem);
this.openmct.time.off('timeSystemChanged', this.setTimeSystem);
},
methods: {
addLadTable(domainObject) {
Expand Down Expand Up @@ -102,7 +102,7 @@ export default {
this.ladTableObjects[reorderEvent.newIndex] = oldComposition[reorderEvent.oldIndex];
});
},
setTimesystem(timesystem) {
setTimeSystem(timesystem) {
this.timesystem = timesystem.name;
},
addTelemetryObject(ladTable) {
Expand Down
90 changes: 47 additions & 43 deletions src/formats/UTCDayOfYearFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,56 +49,60 @@
* @implements {Format}
* @constructor
*/
function UTCDayOfYearFormat() {
this.key = 'utc.day-of-year';
}

UTCDayOfYearFormat.prototype.FORMAT = 'YYYY-DDDDTHH:mm:ss.SSS';
UTCDayOfYearFormat.prototype.ACCEPTABLE_FORMATS = [
UTCDayOfYearFormat.prototype.FORMAT,
'YYYY-DDDTHH:mm:ss',
'YYYY-DDDTHH:mm',
'YYYY-DDDTHH',
'YYYY-DDD',
'YYYY-MM-DDTHH:mm:ss.SSS',
'YYYY-MM-DDTHH:mm:ss',
'YYYY-MM-DDTHH:mm',
'YYYY-MM-DDTHH',
'YYYY-MM-DD'
];

UTCDayOfYearFormat.prototype.format = function (value, scale) {
if (value === undefined || value === '') {
return value;
export default class UTCDayOfYearFormat {
constructor() {
this.key = 'utc.day-of-year';

Check warning on line 54 in src/formats/UTCDayOfYearFormat.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer class field declaration over `this` assignment in constructor for static values.

See more on https://sonarcloud.io/project/issues?id=NASA-AMMOS_openmct-mcws&issues=AZq3xp4wMRocZF1iciCO&open=AZq3xp4wMRocZF1iciCO&pullRequest=364
this.FORMAT = 'YYYY-DDDDTHH:mm:ss.SSS';
this.ACCEPTABLE_FORMATS = [
this.FORMAT,
'YYYY-DDDTHH:mm:ss',
'YYYY-DDDTHH:mm',
'YYYY-DDDTHH',
'YYYY-DDD',
'YYYY-MM-DDTHH:mm:ss.SSS',
'YYYY-MM-DDTHH:mm:ss',
'YYYY-MM-DDTHH:mm',
'YYYY-MM-DDTHH',
'YYYY-MM-DD'
];
}
var m = moment.utc(value);
if (typeof scale !== 'undefined') {
var scaledFormat = getScaledFormat(m);
if (scaledFormat) {
return m.format(scaledFormat);

format(value, scale) {
if (value === undefined || value === '') {
return value;
}
var m = moment.utc(value);
if (typeof scale !== 'undefined') {
var scaledFormat = getScaledFormat(m);
if (scaledFormat) {
return m.format(scaledFormat);
}
}
return m.format(this.FORMAT);
}
return m.format(this.FORMAT);
};

UTCDayOfYearFormat.prototype.endOfDay = function (value) {
return moment.utc(value).endOf('day').valueOf();
};

UTCDayOfYearFormat.prototype.parse = function (text) {
if (text === undefined || typeof text === 'number') {
return text;
formatDate(value) {
const m = moment.utc(value);
return m.format('YYYY-DDD');
}

if (DOY_PATTERN.test(text)) {
return +inlineParseDOYString(text);
endOfDay(value) {
return moment.utc(value).endOf('day').valueOf();
}

return moment.utc(text, this.ACCEPTABLE_FORMATS, true).valueOf();
};
parse = function (text) {
if (text === undefined || typeof text === 'number') {
return text;
}

if (DOY_PATTERN.test(text)) {
return +inlineParseDOYString(text);
}

UTCDayOfYearFormat.prototype.validate = function (text) {
return text !== undefined && moment.utc(text, this.ACCEPTABLE_FORMATS, true).isValid();
};
return moment.utc(text, this.ACCEPTABLE_FORMATS, true).valueOf();
};

export default UTCDayOfYearFormat;
validate(text) {
return text !== undefined && moment.utc(text, this.ACCEPTABLE_FORMATS, true).isValid();
}
}
80 changes: 42 additions & 38 deletions src/formats/UTCFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,49 +55,53 @@
* @implements {Format}
* @constructor
*/
function UTCFormat() {
this.key = 'utc';
}

UTCFormat.prototype.FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS';
UTCFormat.prototype.ACCEPTABLE_FORMATS = [
UTCFormat.prototype.FORMAT,
'YYYY-MM-DDTHH:mm:ss',
'YYYY-MM-DDTHH:mm',
'YYYY-MM-DDTHH',
'YYYY-MM-DD',
'YYYY-DDDDTHH:mm:ss.SSS',
'YYYY-DDDTHH:mm:ss',
'YYYY-DDDTHH:mm',
'YYYY-DDDTHH',
'YYYY-DDD'
];

UTCFormat.prototype.format = function (value, scale) {
var m = moment.utc(value);
if (typeof scale !== 'undefined') {
var scaledFormat = getScaledFormat(m);
if (scaledFormat) {
return m.format(scaledFormat);
}
export default class UTCFormat {
constructor() {
this.key = 'utc';

Check warning on line 60 in src/formats/UTCFormat.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer class field declaration over `this` assignment in constructor for static values.

See more on https://sonarcloud.io/project/issues?id=NASA-AMMOS_openmct-mcws&issues=AZq3xp56MRocZF1iciCP&open=AZq3xp56MRocZF1iciCP&pullRequest=364
this.FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS';
this.ACCEPTABLE_FORMATS = [
this.FORMAT,
'YYYY-MM-DDTHH:mm:ss',
'YYYY-MM-DDTHH:mm',
'YYYY-MM-DDTHH',
'YYYY-MM-DD',
'YYYY-DDDDTHH:mm:ss.SSS',
'YYYY-DDDTHH:mm:ss',
'YYYY-DDDTHH:mm',
'YYYY-DDDTHH',
'YYYY-DDD'
];
}
return m.format(this.FORMAT);
};

UTCFormat.prototype.parse = function (text) {
if (text === undefined || typeof text === 'number') {
return text;
formatDate(value) {
const m = moment.utc(value);
return m.format('YYYY-MM-DD');
}

if (DOY_PATTERN.test(text)) {
return +inlineParseDOYString(text);
format(value, scale) {
var m = moment.utc(value);
if (typeof scale !== 'undefined') {
var scaledFormat = getScaledFormat(m);
if (scaledFormat) {
return m.format(scaledFormat);
}
}
return m.format(this.FORMAT);
}

return moment.utc(text, this.ACCEPTABLE_FORMATS, true).valueOf();
};
parse(text) {
if (text === undefined || typeof text === 'number') {
return text;
}

if (DOY_PATTERN.test(text)) {
return +inlineParseDOYString(text);
}

UTCFormat.prototype.validate = function (text) {
return text !== undefined && moment.utc(text, this.ACCEPTABLE_FORMATS, true).isValid();
};
return moment.utc(text, this.ACCEPTABLE_FORMATS, true).valueOf();
}

export default UTCFormat;
validate(text) {
return text !== undefined && moment.utc(text, this.ACCEPTABLE_FORMATS, true).isValid();
}
}
2 changes: 1 addition & 1 deletion src/globalFilters/GlobalFilterSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default {
this.overlay = this.openmct.overlays.overlay({
element: this.$el,
size: 'fit',
dismissable: true,
dismissible: true,
onDestroy: () => {
this.$emit('close-filter-selector');
}
Expand Down
2 changes: 1 addition & 1 deletion src/metadataAction/metadataAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class MetadataAction {
this.openmct.overlays.overlay({
element: el,
size: 'large',
dismissable: true,
dismissible: true,
onDestroy: () => {
destroy();
}
Expand Down
Loading
Loading