From d73cb2ef70e1bcc56cb5c097e052720c894f63c2 Mon Sep 17 00:00:00 2001 From: Nuno Guedelha Date: Tue, 23 Aug 2022 19:06:23 +0200 Subject: [PATCH] [CLA Approved] Fix references to telemetry data "unit" in the plot LEGEND form, top legend display and documentation (#5546) * [Plot] Rename the `units` attribute to `unit` (#5540) Rename the `units` attribute to `unit` when referencing the telemetry data "unit" within: - the legend-form vue for setting the `valueToShowWhenCollapsed` and `showUnitsWhenExpanded` and displaying the available choices in write mode, - the plot-options-browse vue for displaying the selected choices within the form in read mode, - the plot-legend-item-collapsed when checking which field to display. * [Documentation] Update API documentation (#3562) --- API.md | 6 +++--- src/plugins/plot/inspector/PlotOptionsBrowse.vue | 2 +- src/plugins/plot/inspector/forms/LegendForm.vue | 4 ++-- src/plugins/plot/legend/PlotLegendItemCollapsed.vue | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/API.md b/API.md index a56a0de187..5c3c1afd51 100644 --- a/API.md +++ b/API.md @@ -390,7 +390,7 @@ A telemetry object is a domain object with a telemetry property. To take an exa { "key": "value", "name": "Value", - "units": "kilograms", + "unit": "kilograms", "format": "float", "min": 0, "max": 100, @@ -425,7 +425,7 @@ attribute | type | flags | notes `name` | string | optional | a human readable label for this field. If omitted, defaults to `key`. `source` | string | optional | identifies the property of a datum where this value is stored. If omitted, defaults to `key`. `format` | string | optional | a specific format identifier, mapping to a formatter. If omitted, uses a default formatter. For enumerations, use `enum`. For timestamps, use `utc` if you are using utc dates, otherwise use a key mapping to your custom date format. -`units` | string | optional | the units of this value, e.g. `km`, `seconds`, `parsecs` +`unit` | string | optional | the unit of this value, e.g. `km`, `seconds`, `parsecs` `min` | number | optional | the minimum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a min value. `max` | number | optional | the maximum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a max value. `enumerations` | array | optional | for objects where `format` is `"enum"`, this array tracks all possible enumerations of the value. Each entry in this array is an object, with a `value` property that is the numerical value of the enumeration, and a `string` property that is the text value of the enumeration. ex: `{"value": 0, "string": "OFF"}`. If you use an enumerations array, `min` and `max` will be set automatically for you. @@ -1082,4 +1082,4 @@ View provider Example: return openmct.priority.HIGH; } } -``` \ No newline at end of file +``` diff --git a/src/plugins/plot/inspector/PlotOptionsBrowse.vue b/src/plugins/plot/inspector/PlotOptionsBrowse.vue index c32536b015..99c9260f38 100644 --- a/src/plugins/plot/inspector/PlotOptionsBrowse.vue +++ b/src/plugins/plot/inspector/PlotOptionsBrowse.vue @@ -136,7 +136,7 @@ Value Min Max - Units + Unit diff --git a/src/plugins/plot/inspector/forms/LegendForm.vue b/src/plugins/plot/inspector/forms/LegendForm.vue index 370c1d52ea..6061996b3c 100644 --- a/src/plugins/plot/inspector/forms/LegendForm.vue +++ b/src/plugins/plot/inspector/forms/LegendForm.vue @@ -54,7 +54,7 @@ - + @@ -89,7 +89,7 @@ v-model="showUnitsWhenExpanded" type="checkbox" @change="updateForm('showUnitsWhenExpanded')" - > Units + > Unit diff --git a/src/plugins/plot/legend/PlotLegendItemCollapsed.vue b/src/plugins/plot/legend/PlotLegendItemCollapsed.vue index 197f9da9df..3c9c60ca8b 100644 --- a/src/plugins/plot/legend/PlotLegendItemCollapsed.vue +++ b/src/plugins/plot/legend/PlotLegendItemCollapsed.vue @@ -41,7 +41,7 @@ {{ nameWithUnit }}