Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full angular removal #170

Merged
merged 44 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
caba717
update historical sessions indicator to remove angular
jvigliotta Jan 31, 2024
95283c2
moving global staleness to a regular service, not angular
jvigliotta Feb 14, 2024
7a0af0f
Merge branch 'main' into full-angular-removal
jvigliotta Mar 27, 2024
58c3e29
ignoring some stuff AND removing angular from our data cell preview
jvigliotta Mar 29, 2024
43d94bf
wrong path
jvigliotta Mar 29, 2024
29cb585
lint
jvigliotta Mar 29, 2024
abadb72
missed a period
jvigliotta Mar 29, 2024
8cae7b0
move order around to show loader and switch to small view to be more …
jvigliotta Mar 29, 2024
4b610b9
actually making the overlay small
jvigliotta Mar 29, 2024
5cef269
updating time plugin and time systems to not use angular
jvigliotta Mar 29, 2024
926ec57
missed some spots
jvigliotta Mar 29, 2024
c1ec596
convert venue template and controller to vue file and venue plugin to…
jvigliotta Apr 2, 2024
0df0501
convert venue service to es6
jvigliotta Apr 2, 2024
3c79340
created the venue dialog component to replace the angular version
jvigliotta Apr 2, 2024
7aa274f
convert venue.js to es6
jvigliotta Apr 2, 2024
dc78d96
created vue components for historical, active venue and active sessio…
jvigliotta Apr 2, 2024
1548e94
swapping over venues
jvigliotta Apr 10, 2024
1e87c10
Updated venues to Vue, starting on remaining legacy code
jvigliotta Apr 18, 2024
4d09fa0
removing old venue files
jvigliotta Apr 18, 2024
a9a7fdc
update types from legacy composition model
jvigliotta Apr 18, 2024
3e62ca3
remove legacy from taxonomy
jvigliotta Apr 18, 2024
330c364
moving styles out of legacy folder
jvigliotta Apr 18, 2024
9de99c1
remove legacy products bundle and associated files
jvigliotta Apr 18, 2024
53a37ca
updating export data action
jvigliotta Apr 24, 2024
6b32f7d
removed legacy folder
jvigliotta Apr 24, 2024
2559364
removing openmct w/maps repo
jvigliotta Apr 25, 2024
7125b65
reverting webpack changes
jvigliotta Apr 25, 2024
578d640
moving import back to where it was
jvigliotta Apr 25, 2024
773a1b2
removed development settings
jvigliotta Apr 25, 2024
7b4e170
removing old commented code
jvigliotta Apr 25, 2024
0539ba3
changed openmct package name back to normal
jvigliotta Apr 25, 2024
9ecc559
syntax cleanup
jvigliotta Apr 25, 2024
5857625
removing redundant check
jvigliotta Apr 25, 2024
7e0e95a
remvoing unnecessary await
jvigliotta Apr 25, 2024
d79adb9
syntax
jvigliotta Apr 25, 2024
b6509fc
safe check the type
davetsay Apr 30, 2024
7be0f2b
config is already passed
davetsay Apr 30, 2024
7d607a7
removing axios... for good
jvigliotta Apr 30, 2024
772e01f
removing _openmct use
jvigliotta Apr 30, 2024
5d0f689
removing old commented code
jvigliotta Apr 30, 2024
1f3ddd5
addressing PR comments
jvigliotta May 3, 2024
7313277
xdescribing tests that need updates
jvigliotta May 3, 2024
2376ec6
removing unnecessary checks
jvigliotta May 3, 2024
85e175d
final updates
jvigliotta May 3, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ npm-debug.log
# auto-env files for those that use them.
.env
dist
package-lock.json
test_data/
3 changes: 2 additions & 1 deletion .webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module.exports = merge(common, {
// for dev, we serve out of dist/ so we need to replace any reference
return content.toString().replace(/"dist\//g, '"');
}
}
},
{ from: './ExampleVenueDefinitions.json', to: 'ExampleVenueDefinitions.json' }
]
})
],
Expand Down
21 changes: 1 addition & 20 deletions loader.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
define([
'openmct',
'./src/AMMOSPlugins',
'./src/legacy/export/bundle',
'./src/legacy/products/bundle',
'./src/legacy/table/bundle',
'./src/legacy/general/res/sass/vista.scss',
'./src/styles/sass/vista.scss',
'./src/commandEventsView/plugin',
'./src/messagesView/plugin',
'./src/product-status/plugin',
'./about.html',
'./src/metadataAction/plugin',
'./src/clearDataIndicator/plugin',
'./src/globalStaleness/plugin',
'./src/dictionaryView/plugin',
'./src/packetSummary/plugin',
'./src/containerView/plugin',
'openmct-legacy-support',
davetsay marked this conversation as resolved.
Show resolved Hide resolved
'services/identity/MCWSIdentityProvider',
'./src/persistence/plugin'
], function (
openmct,
AMMOSPlugins,
exportBundle,
productsBundle,
legacyTablesBundle,
VistaStyles, /** Do not delete, needed for webpack to compile scss file*/
CommandEventsViewPlugin,
MessagesPlugin,
ProductStatusPlugin,
AboutTemplate,
MetadataActionPlugin,
ClearDataIndicator,
GlobalStalenessPlugin,
DictionaryViewPlugin,
PacketSummaryPlugin,
ContainerViewPlugin,
LegacySupport,
IdentityProvider,
MCWSPersistenceProviderPlugin
) {
Expand All @@ -47,8 +37,6 @@ define([
});
openmct.setAssetPath(config.assetPath);

openmct.install(LegacySupport.default());

//Optional Themes
if (config.theme) {
openmct.install(openmct.plugins[config.theme]());
Expand Down Expand Up @@ -82,7 +70,6 @@ define([
}
));
openmct.install(ClearDataIndicator.default(config.globalStalenessInterval));
openmct.install(GlobalStalenessPlugin.default(config.globalStalenessInterval));
openmct.install(CommandEventsViewPlugin.default());
openmct.install(MessagesPlugin.default());
openmct.install(ProductStatusPlugin.default());
Expand Down Expand Up @@ -112,12 +99,6 @@ define([
});
}

[
exportBundle,
productsBundle,
legacyTablesBundle
].forEach(openmct.install, openmct);

if (config.plugins) {
if (config.plugins.summaryWidgets) {
openmct.install(openmct.plugins.SummaryWidget());
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"moment": "2.29.4",
"node-bourbon": "^4.2.3",
"openmct": "nasa/openmct#omm-r5.2.0-rc2",
"openmct-legacy-support": "akhenry/openmct-legacy-support#omm-r5.1.0-rc1",
"printj": "^1.2.1",
"raw-loader": "^0.5.1",
"resolve-url-loader": "5.0.0",
Expand Down
26 changes: 20 additions & 6 deletions src/AMMOSPlugins.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
define([
'services/dataset/DatasetCache',
'services/session/SessionService',
'services/globalStaleness/globalStaleness',
'./types/plugin',
'./taxonomy/plugin',
'./time/plugin',
Expand Down Expand Up @@ -30,10 +31,12 @@ define([
'./mcwsIndicator/plugin',
'./multipleHistoricalSessions/plugin',
'./realtimeSessions/plugin',
'./globalFilters/plugin'
'./globalFilters/plugin',
'./exportDataAction/plugin'
], function (
DatasetCache,
SessionService,
GlobalStaleness,
TypePlugin,
TaxonomyPlugin,
TimePlugin,
Expand Down Expand Up @@ -63,18 +66,20 @@ define([
MCWSIndicatorPlugin,
MultipleHistoricalSessions,
RealtimeSessions,
GlobalFilters
GlobalFilters,
ExportDataAction
) {

function AMMOSPlugins(options) {
return function install(openmct) {
// initialze session service and datasetCache service
// initialze session service, datasetCache service, global staleness
SessionService.default(openmct, options);
DatasetCache.default(openmct);
GlobalStaleness.default(openmct, window.openmctMCWSConfig.globalStalenessInterval);
davetsay marked this conversation as resolved.
Show resolved Hide resolved

openmct.install(new FormatPlugin(options));

const timePlugin = new TimePlugin(options.time);
const timePlugin = new TimePlugin(openmct, options.time);
openmct.install(timePlugin);

const formatKey = options.time.utcFormat;
Expand All @@ -97,10 +102,10 @@ define([

openmct.install(new HistoricalTelemetryPlugin(options));
openmct.install(new RealtimeTelemetryPlugin(vistaTime, options));
openmct.install(new TypePlugin(options));
openmct.install(new TypePlugin.default());
openmct.install(new TaxonomyPlugin(options.taxonomy));
openmct.install(new LinkPlugin(options));
openmct.install(new VenuePlugin(options));
openmct.install(new VenuePlugin.default(options));
openmct.install(FrameWatchViewPlugin.default());
openmct.install(FrameEventFilterViewPlugin.default());
openmct.install(new ChannelTablePlugin.default());
Expand Down Expand Up @@ -128,6 +133,15 @@ define([
openmct.install(CustomFormsPlugin.default());

openmct.install(openmct.plugins.DefaultRootName('VISTA'));
openmct.install(new ExportDataAction.default([
'telemetry.plot.overlay',
'telemetry.plot.stacked',
'vista.channel',
'vista.channelGroup',
'vista.chanTableGroup',
'vista.evr',
'vista.evrView'
]));
openmct.install(ActionModifiersPlugin.default());
openmct.install(new PacketQueryPlugin.default());
if (options.globalFilters) {
Expand Down
66 changes: 66 additions & 0 deletions src/exportDataAction/ExportDataAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import ExportDataTask from './ExportDataTask';

/**
* Implements the "Export Data" action, allowing data for Channels, EVRs,
* or grouped containers of these to be exported as CSV using ES6 class syntax.
*
* @param {openmct} openmct instance
* @memberof vista/export
*/
class ExportDataAction {
constructor(openmct, validTypes) {
this.name = 'Export Historical Data';
this.key = 'vista.export';
this.description = 'Export channel or EVR data as CSV';
this.cssClass = 'icon-download';
this.group = 'view';
this.priority = 1;
this.validTypes = validTypes;

this._openmct = openmct;
}

appliesTo(objectPath) {
const domainObject = objectPath[0];
const isValidType = this.validTypes.includes(domainObject.type);
davetsay marked this conversation as resolved.
Show resolved Hide resolved
if (!isValidType) {
return false;
}

const hasComposition = this._openmct.composition.get(domainObject) !== undefined;
jvigliotta marked this conversation as resolved.
Show resolved Hide resolved
const hasHistoricalTelemetry = this._openmct.telemetry.isTelemetryObject(domainObject) &&
!domainObject.telemetry.realtimeOnly;

return hasHistoricalTelemetry || !hasHistoricalTelemetry && hasComposition;
jvigliotta marked this conversation as resolved.
Show resolved Hide resolved
}

invoke(objectPath) {
const domainObject = objectPath[0];
const progressDialog = this._openmct.notifications.progress('Exporting CSV', 'unknown');
const runTask = (domainObjects) => new ExportDataTask(this._openmct, domainObject.name, domainObjects).invoke();
const exportData = async (object) => {
if (this._openmct.telemetry.isTelemetryObject(object)) {
runTask([object]);
} else {
const compositionCollection = this._openmct.composition.get(object);
const composition = await compositionCollection.load();
runTask(composition);
}
}

const success = (value) => {
progressDialog.dismiss();
return value;
};

const failure = (error) => {
progressDialog.dismiss();
console.error(error);
this._openmct.notifications.error('Error exporting CSV');
};

return exportData(domainObject).then(success, failure);
}
}

export default ExportDataAction;
63 changes: 63 additions & 0 deletions src/exportDataAction/ExportDataTask.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import CSV from 'comma-separated-values';
import {saveAs} from 'saveAs';

export default class ExportDataTask {
/**
* Exports telemetry data to CSV for a group of domain objects.
* Used to support the "Export Data" action.
* @see {vista/export.ExportDataAction}
* @param {DomainObject[]} domainObjects the domain object for which
* telemetry data should be exported
*/
constructor(openmct, filename, domainObjects) {
this._openmct = openmct;
this.filename = filename;
this.domainObjects = domainObjects;
}

/**
* Query for telemetry data and export it to CSV.
* @returns {Promise} a promise which will resolve when the export is
* successfully completed, or be rejected if an error occurs
*/
async invoke() {
const headers = [];
const headerSet = {};
const requestTelemetry = async (domainObject) => {
davetsay marked this conversation as resolved.
Show resolved Hide resolved
const telemetry = await this._openmct.telemetry.request(domainObject);

return telemetry;
};
const pullHeaders = (dataArray) => {
jvigliotta marked this conversation as resolved.
Show resolved Hide resolved
dataArray.forEach((data) => {
const datum = data[0] || {};
Object.keys(datum).forEach((key) => {
if (!headerSet[key]) {
headerSet[key] = true;
headers.push(key);
}
});
});

return dataArray;
};
const exportAsCSV = (rows) => this.exportCSV(rows, {
headers,
filename: this.filename
});
const telemetry = await Promise.all(this.domainObjects.map(requestTelemetry));
pullHeaders(telemetry);
const allTelemetry = telemetry.flat();

return exportAsCSV(allTelemetry);
}

exportCSV(rows, options) {
let headers = (options && options.headers)
|| (Object.keys((rows[0] || {})).sort());
let filename = `${(options && options.filename) || 'export'}.csv`;
let csvText = new CSV(rows, { header: headers }).encode();
let blob = new Blob([csvText], { type: "text/csv" });
saveAs(blob, filename);
}
}
8 changes: 8 additions & 0 deletions src/exportDataAction/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import ExportDataAction from './ExportDataAction';

export default function (validTypes) {
return function (openmct) {
openmct.actions.register(new ExportDataAction(openmct, validTypes));
};
}

24 changes: 0 additions & 24 deletions src/globalStaleness/globalStaleness.js

This file was deleted.

28 changes: 0 additions & 28 deletions src/globalStaleness/plugin.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/legacy/README.md

This file was deleted.

Loading
Loading