From 8d21d420ae6a3a706a5bf70a1d823c00888fc0b0 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Fri, 20 Jul 2018 14:14:01 -0700 Subject: [PATCH] Plot composition re-ordering support (#2120) * [Plot] Allow 0 in plot y axis bounds Allow 0 values in plot y axis bounds. Also properly re-do validation when changing from a bad value to the previously used good value. Fixes https://github.com/nasa/openmct/issues/2082 * [Plot] separate config index from composition index Locate the configuration index by checking identifiers instead of relying on order of composition to match order of configuration. Ensures that editing a plot after reordering composition does not edit wrong object. Fixes https://github.com/nasa/openmct/issues/2101 * [Plot] refactor form controllers, separate concerns Refactor form controllers to simplify the plot options inspector. Individual plot models each have a form controller which handles three way binding between the scope, model, and domain object configuration. Added support to linkFields for dynamic object paths so that mutations always find the right object in the configuration instead of breaking when indices change. * support deferred init for sub-object selection * Style fixes * Remove assignment to window --- src/plugins/plot/plugin.js | 33 ++++ .../plot/res/templates/plot-options-edit.html | 75 +++---- .../plot/src/configuration/PlotSeries.js | 11 ++ .../src/configuration/SeriesCollection.js | 34 ++-- .../src/inspector/PlotLegendFormController.js | 69 +++++++ .../src/inspector/PlotModelFormController.js | 173 ++++++++++++++++ .../src/inspector/PlotOptionsController.js | 185 +----------------- .../src/inspector/PlotSeriesFormController.js | 126 ++++++++++++ .../src/inspector/PlotYAxisFormController.js | 96 +++++++++ 9 files changed, 573 insertions(+), 229 deletions(-) create mode 100644 src/plugins/plot/src/inspector/PlotLegendFormController.js create mode 100644 src/plugins/plot/src/inspector/PlotModelFormController.js create mode 100644 src/plugins/plot/src/inspector/PlotSeriesFormController.js create mode 100644 src/plugins/plot/src/inspector/PlotYAxisFormController.js diff --git a/src/plugins/plot/plugin.js b/src/plugins/plot/plugin.js index 4d39f336eb..5220c984d0 100644 --- a/src/plugins/plot/plugin.js +++ b/src/plugins/plot/plugin.js @@ -31,6 +31,9 @@ define([ "./src/telemetry/StackedPlotController", "./src/inspector/PlotInspector", "./src/inspector/PlotOptionsController", + "./src/inspector/PlotLegendFormController", + "./src/inspector/PlotYAxisFormController", + "./src/inspector/PlotSeriesFormController", "./src/inspector/HideElementPoolDirective", "./src/services/ExportImageService", './src/PlotViewPolicy', @@ -48,6 +51,9 @@ define([ StackedPlotController, PlotInspector, PlotOptionsController, + PlotLegendFormController, + PlotYAxisFormController, + PlotSeriesFormController, HideElementPool, ExportImageService, PlotViewPolicy, @@ -171,6 +177,33 @@ define([ "openmct", "$timeout" ] + }, + { + key: "PlotLegendFormController", + implementation: PlotLegendFormController, + depends: [ + "$scope", + "openmct", + "$attrs" + ] + }, + { + key: "PlotYAxisFormController", + implementation: PlotYAxisFormController, + depends: [ + "$scope", + "openmct", + "$attrs" + ] + }, + { + key: "PlotSeriesFormController", + implementation: PlotSeriesFormController, + depends: [ + "$scope", + "openmct", + "$attrs" + ] } ], "services": [ diff --git a/src/plugins/plot/res/templates/plot-options-edit.html b/src/plugins/plot/res/templates/plot-options-edit.html index a6b6f99e44..42c3ede024 100644 --- a/src/plugins/plot/res/templates/plot-options-edit.html +++ b/src/plugins/plot/res/templates/plot-options-edit.html @@ -22,28 +22,30 @@