make clear data indicator a configurable option (#3206)

This commit is contained in:
Deep Tailor 2020-07-17 16:48:14 -07:00 committed by GitHub
parent 25bb9939d6
commit 7221dc1ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 15 deletions

View File

@ -113,7 +113,10 @@
openmct.install(openmct.plugins.LADTable()); openmct.install(openmct.plugins.LADTable());
openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay'])); openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay']));
openmct.install(openmct.plugins.ObjectMigration()); openmct.install(openmct.plugins.ObjectMigration());
openmct.install(openmct.plugins.ClearData(['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'])); openmct.install(openmct.plugins.ClearData(
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'],
{indicator: true}
));
openmct.start(); openmct.start();
</script> </script>
</html> </html>

View File

@ -29,24 +29,28 @@ define([
ClearDataAction, ClearDataAction,
Vue Vue
) { ) {
return function plugin(appliesToObjects) { return function plugin(appliesToObjects, options = {indicator: true}) {
let installIndicator = options.indicator;
appliesToObjects = appliesToObjects || []; appliesToObjects = appliesToObjects || [];
return function install(openmct) { return function install(openmct) {
let component = new Vue ({ if (installIndicator) {
provide: { let component = new Vue ({
openmct provide: {
}, openmct
components: { },
GlobalClearIndicator: GlobaClearIndicator.default components: {
}, GlobalClearIndicator: GlobaClearIndicator.default
template: '<GlobalClearIndicator></GlobalClearIndicator>' },
}), template: '<GlobalClearIndicator></GlobalClearIndicator>'
indicator = { }),
element: component.$mount().$el indicator = {
}; element: component.$mount().$el
};
openmct.indicators.add(indicator); openmct.indicators.add(indicator);
}
openmct.contextMenu.registerAction(new ClearDataAction.default(openmct, appliesToObjects)); openmct.contextMenu.registerAction(new ClearDataAction.default(openmct, appliesToObjects));
}; };