mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
ESLint one-var, no-var rules (#3239)
* fixed issues for eslint one-var and no-var rules Co-authored-by: Joshi <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
@ -41,90 +41,92 @@ define(['lodash'], function (_) {
|
||||
},
|
||||
toolbar: function (selectedObjects) {
|
||||
const DIALOG_FORM = {
|
||||
'text': {
|
||||
name: "Text Element Properties",
|
||||
sections: [
|
||||
{
|
||||
rows: [
|
||||
{
|
||||
key: "text",
|
||||
control: "textfield",
|
||||
name: "Text",
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
'image': {
|
||||
name: "Image Properties",
|
||||
sections: [
|
||||
{
|
||||
rows: [
|
||||
{
|
||||
key: "url",
|
||||
control: "textfield",
|
||||
name: "Image URL",
|
||||
"cssClass": "l-input-lg",
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
VIEW_TYPES = {
|
||||
'telemetry-view': {
|
||||
value: 'telemetry-view',
|
||||
name: 'Alphanumeric',
|
||||
class: 'icon-alphanumeric'
|
||||
},
|
||||
'telemetry.plot.overlay': {
|
||||
value: 'telemetry.plot.overlay',
|
||||
name: 'Overlay Plot',
|
||||
class: "icon-plot-overlay"
|
||||
},
|
||||
'telemetry.plot.stacked': {
|
||||
value: "telemetry.plot.stacked",
|
||||
name: "Stacked Plot",
|
||||
class: "icon-plot-stacked"
|
||||
},
|
||||
'table': {
|
||||
value: 'table',
|
||||
name: 'Table',
|
||||
class: 'icon-tabular-realtime'
|
||||
}
|
||||
},
|
||||
APPLICABLE_VIEWS = {
|
||||
'telemetry-view': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES.table
|
||||
],
|
||||
'telemetry.plot.overlay': [
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES.table,
|
||||
VIEW_TYPES['telemetry-view']
|
||||
],
|
||||
'telemetry.plot.stacked': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES.table,
|
||||
VIEW_TYPES['telemetry-view']
|
||||
],
|
||||
'table': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES['telemetry-view']
|
||||
],
|
||||
'telemetry-view-multi': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES.table
|
||||
],
|
||||
'telemetry.plot.overlay-multi': [
|
||||
VIEW_TYPES['telemetry.plot.stacked']
|
||||
'text': {
|
||||
name: "Text Element Properties",
|
||||
sections: [
|
||||
{
|
||||
rows: [
|
||||
{
|
||||
key: "text",
|
||||
control: "textfield",
|
||||
name: "Text",
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
'image': {
|
||||
name: "Image Properties",
|
||||
sections: [
|
||||
{
|
||||
rows: [
|
||||
{
|
||||
key: "url",
|
||||
control: "textfield",
|
||||
name: "Image URL",
|
||||
"cssClass": "l-input-lg",
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
const VIEW_TYPES = {
|
||||
'telemetry-view': {
|
||||
value: 'telemetry-view',
|
||||
name: 'Alphanumeric',
|
||||
class: 'icon-alphanumeric'
|
||||
},
|
||||
'telemetry.plot.overlay': {
|
||||
value: 'telemetry.plot.overlay',
|
||||
name: 'Overlay Plot',
|
||||
class: "icon-plot-overlay"
|
||||
},
|
||||
'telemetry.plot.stacked': {
|
||||
value: "telemetry.plot.stacked",
|
||||
name: "Stacked Plot",
|
||||
class: "icon-plot-stacked"
|
||||
},
|
||||
'table': {
|
||||
value: 'table',
|
||||
name: 'Table',
|
||||
class: 'icon-tabular-realtime'
|
||||
}
|
||||
};
|
||||
|
||||
const APPLICABLE_VIEWS = {
|
||||
'telemetry-view': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES.table
|
||||
],
|
||||
'telemetry.plot.overlay': [
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES.table,
|
||||
VIEW_TYPES['telemetry-view']
|
||||
],
|
||||
'telemetry.plot.stacked': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES.table,
|
||||
VIEW_TYPES['telemetry-view']
|
||||
],
|
||||
'table': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES['telemetry-view']
|
||||
],
|
||||
'telemetry-view-multi': [
|
||||
VIEW_TYPES['telemetry.plot.overlay'],
|
||||
VIEW_TYPES['telemetry.plot.stacked'],
|
||||
VIEW_TYPES.table
|
||||
],
|
||||
'telemetry.plot.overlay-multi': [
|
||||
VIEW_TYPES['telemetry.plot.stacked']
|
||||
]
|
||||
};
|
||||
|
||||
function getUserInput(form) {
|
||||
return openmct.$injector.get('dialogService').getUserInput(form, {});
|
||||
@ -494,8 +496,8 @@ define(['lodash'], function (_) {
|
||||
}
|
||||
|
||||
function getPropertyFromPath(object, path) {
|
||||
let splitPath = path.split('.'),
|
||||
property = Object.assign({}, object);
|
||||
let splitPath = path.split('.');
|
||||
let property = Object.assign({}, object);
|
||||
|
||||
while (splitPath.length && property) {
|
||||
property = property[splitPath.shift()];
|
||||
@ -568,9 +570,9 @@ define(['lodash'], function (_) {
|
||||
|
||||
function getViewSwitcherMenu(selectedParent, selectionPath, selection) {
|
||||
if (selection.length === 1) {
|
||||
let displayLayoutContext = selectionPath[1].context,
|
||||
selectedItemContext = selectionPath[0].context,
|
||||
selectedItemType = selectedItemContext.item.type;
|
||||
let displayLayoutContext = selectionPath[1].context;
|
||||
let selectedItemContext = selectionPath[0].context;
|
||||
let selectedItemType = selectedItemContext.item.type;
|
||||
|
||||
if (selectedItemContext.layoutItem.type === 'telemetry-view') {
|
||||
selectedItemType = 'telemetry-view';
|
||||
|
Reference in New Issue
Block a user