From 7221dc1ac6c4fdb77cd55a4245103956a90bf5cc Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Fri, 17 Jul 2020 16:48:14 -0700 Subject: [PATCH] make clear data indicator a configurable option (#3206) --- index.html | 5 ++++- src/plugins/clearData/plugin.js | 32 ++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 1034cd506e..3911020002 100644 --- a/index.html +++ b/index.html @@ -113,7 +113,10 @@ openmct.install(openmct.plugins.LADTable()); openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay'])); 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(); diff --git a/src/plugins/clearData/plugin.js b/src/plugins/clearData/plugin.js index d4a6689cdc..ecc4d2ef8a 100644 --- a/src/plugins/clearData/plugin.js +++ b/src/plugins/clearData/plugin.js @@ -29,24 +29,28 @@ define([ ClearDataAction, Vue ) { - return function plugin(appliesToObjects) { + return function plugin(appliesToObjects, options = {indicator: true}) { + let installIndicator = options.indicator; + appliesToObjects = appliesToObjects || []; return function install(openmct) { - let component = new Vue ({ - provide: { - openmct - }, - components: { - GlobalClearIndicator: GlobaClearIndicator.default - }, - template: '' - }), - indicator = { - element: component.$mount().$el - }; + if (installIndicator) { + let component = new Vue ({ + provide: { + openmct + }, + components: { + GlobalClearIndicator: GlobaClearIndicator.default + }, + template: '' + }), + indicator = { + element: component.$mount().$el + }; - openmct.indicators.add(indicator); + openmct.indicators.add(indicator); + } openmct.contextMenu.registerAction(new ClearDataAction.default(openmct, appliesToObjects)); };