New eslint rules auto fix (#3058)

* no-implicit-coercion and no-unneeded-ternary

* End every line with a semicolon

* Spacing and formatting

* Enabled semi-spacing

* Applies npm run lint:fix to code after master merge

* Fix merge issues

* Switched operator-linebreak to 'before'

Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
Andrew Henry
2020-07-31 12:11:03 -07:00
committed by GitHub
parent 573a63d359
commit a09da30768
739 changed files with 4660 additions and 2339 deletions

View File

@ -58,7 +58,7 @@ export default {
isEditing: this.openmct.editor.isEditing(),
telemetryFormat: undefined,
nonMixedFormat: false
}
};
},
mounted() {
this.openmct.editor.on('isEditing', this.toggleEdit);
@ -99,6 +99,6 @@ export default {
this.telemetryFormat = this.nonMixedFormat ? format : '';
}
}
}
};
</script>

View File

@ -37,7 +37,7 @@
</template>
<script>
import LayoutFrame from './LayoutFrame.vue'
import LayoutFrame from './LayoutFrame.vue';
import conditionalStylesMixin from '../mixins/objectStyles-mixin';
export default {
@ -118,5 +118,5 @@ export default {
this.removeSelectable();
}
}
}
};
</script>

View File

@ -74,14 +74,14 @@
<script>
import uuid from 'uuid';
import SubobjectView from './SubobjectView.vue'
import TelemetryView from './TelemetryView.vue'
import BoxView from './BoxView.vue'
import TextView from './TextView.vue'
import LineView from './LineView.vue'
import ImageView from './ImageView.vue'
import EditMarquee from './EditMarquee.vue'
import _ from 'lodash'
import SubobjectView from './SubobjectView.vue';
import TelemetryView from './TelemetryView.vue';
import BoxView from './BoxView.vue';
import TextView from './TextView.vue';
import LineView from './LineView.vue';
import ImageView from './ImageView.vue';
import EditMarquee from './EditMarquee.vue';
import _ from 'lodash';
const TELEMETRY_IDENTIFIER_FUNCTIONS = {
'table': (domainObject) => {
@ -102,10 +102,11 @@ const TELEMETRY_IDENTIFIER_FUNCTIONS = {
identifiers.push(object.identifier);
}
});
return Promise.resolve(identifiers);
});
}
}
};
const ITEM_TYPE_VIEW_MAP = {
'subobject-view': SubobjectView,
@ -151,6 +152,7 @@ export default {
},
data() {
let domainObject = JSON.parse(JSON.stringify(this.domainObject));
return {
internalDomainObject: domainObject,
initSelectIndex: undefined,
@ -171,8 +173,9 @@ export default {
},
showMarquee() {
let selectionPath = this.selection[0];
let singleSelectedLine = this.selection.length === 1 &&
selectionPath[0].context.layoutItem && selectionPath[0].context.layoutItem.type === 'line-view';
let singleSelectedLine = this.selection.length === 1
&& selectionPath[0].context.layoutItem && selectionPath[0].context.layoutItem.type === 'line-view';
return this.isEditing && selectionPath && selectionPath.length > 1 && !singleSelectedLine;
}
},
@ -210,7 +213,9 @@ export default {
if ($event) {
$event.stopImmediatePropagation();
}
this.dragInProgress = false;
return;
}
},
@ -364,6 +369,7 @@ export default {
if (this.internalDomainObject.locked) {
return;
}
// Get the ID of the dragged object
let draggedKeyString = $event.dataTransfer.types
.filter(type => type.startsWith(DRAG_OBJECT_TRANSFER_PREFIX))
@ -376,8 +382,8 @@ export default {
}
},
isTelemetry(domainObject) {
if (this.openmct.telemetry.isTelemetryObject(domainObject) &&
!this.options.showAsView.includes(domainObject.type)) {
if (this.openmct.telemetry.isTelemetryObject(domainObject)
&& !this.options.showAsView.includes(domainObject.type)) {
return true;
} else {
return false;
@ -467,6 +473,7 @@ export default {
if (itemKeyString === keyString) {
found = true;
return;
}
}
@ -545,9 +552,9 @@ export default {
let newIndex = -1;
indices.forEach((itemIndex, index) => {
let isAdjacentItemSelected = position === 'up' ?
itemIndex + 1 === previousItemIndex :
itemIndex - 1 === previousItemIndex;
let isAdjacentItemSelected = position === 'up'
? itemIndex + 1 === previousItemIndex
: itemIndex - 1 === previousItemIndex;
if (index > 0 && isAdjacentItemSelected) {
if (position === 'up') {
@ -639,7 +646,7 @@ export default {
shiftKey: true,
cancelable: true,
view: window
})
});
selectItemsArray.forEach((id) => {
let refId = `layout-item-${id}`,
@ -679,7 +686,7 @@ export default {
}
offsetKeys.forEach(key => {
copy[key] += DUPLICATE_OFFSET
copy[key] += DUPLICATE_OFFSET;
});
if (layoutItemStyle) {
@ -787,5 +794,5 @@ export default {
this.initSelectIndex = this.layoutItems.length - 1; //restore selection
}
}
}
};
</script>

View File

@ -46,7 +46,7 @@
</template>
<script>
import LayoutDrag from './../LayoutDrag'
import LayoutDrag from './../LayoutDrag';
export default {
inject: ['openmct'],
@ -65,7 +65,7 @@ export default {
data() {
return {
dragPosition: undefined
}
};
},
computed: {
marqueePosition() {
@ -109,7 +109,7 @@ export default {
y: y,
width: width,
height: height
}
};
},
marqueeStyle() {
return {
@ -159,8 +159,8 @@ export default {
let marqueeEndWidth = this.dragPosition.dimensions[0];
let marqueeEndHeight = this.dragPosition.dimensions[1];
let scaleWidth = marqueeEndWidth / marqueeStartWidth;
let scaleHeight = marqueeEndHeight / marqueeStartHeight;
let scaleWidth = marqueeEndWidth / marqueeStartWidth;
let scaleHeight = marqueeEndHeight / marqueeStartHeight;
let marqueeStart = {
x: marqueeStartX,
@ -187,5 +187,5 @@ export default {
event.preventDefault();
}
}
}
};
</script>

View File

@ -37,7 +37,7 @@
</template>
<script>
import LayoutFrame from './LayoutFrame.vue'
import LayoutFrame from './LayoutFrame.vue';
import conditionalStylesMixin from "../mixins/objectStyles-mixin";
export default {
@ -85,8 +85,10 @@ export default {
if (this.itemStyle.imageUrl !== undefined) {
backgroundImage = 'url(' + this.itemStyle.imageUrl + ')';
}
border = this.itemStyle.border;
}
return {
backgroundImage,
border
@ -122,5 +124,5 @@ export default {
this.removeSelectable();
}
}
}
};
</script>

View File

@ -39,8 +39,8 @@
</template>
<script>
import LayoutDrag from './../LayoutDrag'
import _ from 'lodash'
import LayoutDrag from './../LayoutDrag';
import _ from 'lodash';
export default {
inject: ['openmct'],
@ -63,6 +63,7 @@ export default {
computed: {
size() {
let {width, height} = this.item;
return {
width: (this.gridSize[0] * width),
height: (this.gridSize[1] * height)
@ -70,6 +71,7 @@ export default {
},
style() {
let {x, y, width, height} = this.item;
return {
left: (this.gridSize[0] * x) + 'px',
top: (this.gridSize[1] * y) + 'px',
@ -127,5 +129,5 @@ export default {
});
}
}
}
};
</script>

View File

@ -129,6 +129,7 @@ export default {
computed: {
showFrameEdit() {
let layoutItem = this.selection.length > 0 && this.selection[0][0].context.layoutItem;
return !this.multiSelect && layoutItem && layoutItem.id === this.item.id;
},
position() {
@ -136,13 +137,20 @@ export default {
if (this.dragging && this.dragPosition) {
({x, y, x2, y2} = this.dragPosition);
}
return {x, y, x2, y2};
return {
x,
y,
x2,
y2
};
},
stroke() {
if (this.itemStyle) {
if (this.itemStyle.border) {
return this.itemStyle.border.replace('1px solid ', '');
}
return '';
} else {
return this.item.stroke;
@ -154,6 +162,7 @@ export default {
let height = Math.max(this.gridSize[1] * Math.abs(y - y2), 1);
let left = this.gridSize[0] * Math.min(x, x2);
let top = this.gridSize[1] * Math.min(y, y2);
return {
left: `${left}px`,
top: `${top}px`,
@ -172,41 +181,67 @@ export default {
if (x2 === x) {
return 5; // Vertical line
}
if (y2 === y) {
return 6; // Horizontal line
}
if (x2 > x) {
if (y2 < y) {
return 1;
}
return 4;
}
if (y2 < y) {
return 2;
}
return 3;
},
linePosition() {
let pos = {};
switch(this.vectorQuadrant) {
switch (this.vectorQuadrant) {
case 1:
case 3:
// slopes up
pos = {x1: '0%', y1: '100%', x2: '100%', y2: '0%'};
pos = {
x1: '0%',
y1: '100%',
x2: '100%',
y2: '0%'
};
break;
case 5:
// vertical
pos = {x1: '0%', y1: '0%', x2: '0%', y2: '100%'};
pos = {
x1: '0%',
y1: '0%',
x2: '0%',
y2: '100%'
};
break;
case 6:
// horizontal
pos = {x1: '0%', y1: '0%', x2: '100%', y2: '0%'};
pos = {
x1: '0%',
y1: '0%',
x2: '100%',
y2: '0%'
};
break;
default:
// slopes down
pos = {x1: '0%', y1: '0%', x2: '100%', y2: '100%'};
pos = {
x1: '0%',
y1: '0%',
x2: '100%',
y2: '100%'
};
break;
}
return pos;
}
},
@ -238,6 +273,7 @@ export default {
if (this.removeSelectable) {
this.removeSelectable();
}
this.openmct.selection.off('change', this.setSelection);
},
methods: {
@ -247,7 +283,12 @@ export default {
document.body.addEventListener('mouseup', this.endDrag);
this.startPosition = [event.pageX, event.pageY];
let {x, y, x2, y2} = this.item;
this.dragPosition = {x, y, x2, y2};
this.dragPosition = {
x,
y,
x2,
y2
};
if (x === x2 || y === y2) {
if (y > y2 || x < x2) {
if (this.dragging === 'start') {
@ -257,6 +298,7 @@ export default {
}
}
}
event.preventDefault();
},
continueDrag(event) {
@ -282,8 +324,14 @@ export default {
if (!this.dragging) {
this.$emit('endMove');
} else {
this.$emit('endLineResize', this.item, {x, y, x2, y2});
this.$emit('endLineResize', this.item, {
x,
y,
x2,
y2
});
}
this.dragPosition = undefined;
this.dragging = undefined;
event.preventDefault();
@ -292,7 +340,12 @@ export default {
let gridDeltaX = Math.round(pxDeltaX / this.gridSize[0]);
let gridDeltaY = Math.round(pxDeltaY / this.gridSize[1]);
let {x, y, x2, y2} = this.item;
let dragPosition = {x, y, x2, y2};
let dragPosition = {
x,
y,
x2,
y2
};
if (this.dragging === 'start') {
dragPosition.x -= gridDeltaX;
@ -307,6 +360,7 @@ export default {
dragPosition.x2 -= gridDeltaX;
dragPosition.y2 -= gridDeltaY;
}
return dragPosition;
},
setSelection(selection) {
@ -318,5 +372,5 @@ export default {
});
}
}
}
};
</script>

View File

@ -40,8 +40,8 @@
</template>
<script>
import ObjectFrame from '../../../ui/components/ObjectFrame.vue'
import LayoutFrame from './LayoutFrame.vue'
import ObjectFrame from '../../../ui/components/ObjectFrame.vue';
import LayoutFrame from './LayoutFrame.vue';
const MINIMUM_FRAME_SIZE = [320, 180],
DEFAULT_DIMENSIONS = [10, 10],
@ -106,7 +106,7 @@ export default {
return {
domainObject: undefined,
currentObjectPath: []
}
};
},
watch: {
index(newIndex) {
@ -149,5 +149,5 @@ export default {
});
}
}
}
};
</script>

View File

@ -65,8 +65,8 @@
</template>
<script>
import LayoutFrame from './LayoutFrame.vue'
import printj from 'printj'
import LayoutFrame from './LayoutFrame.vue';
import printj from 'printj';
import conditionalStylesMixin from "../mixins/objectStyles-mixin";
const DEFAULT_TELEMETRY_DIMENSIONS = [10, 5],
@ -124,15 +124,17 @@ export default {
formats: undefined,
domainObject: undefined,
currentObjectPath: undefined
}
};
},
computed: {
showLabel() {
let displayMode = this.item.displayMode;
return displayMode === 'all' || displayMode === 'label';
},
showValue() {
let displayMode = this.item.displayMode;
return displayMode === 'all' || displayMode === 'value';
},
styleObject() {
@ -167,6 +169,7 @@ export default {
}
let alarm = this.limitEvaluator && this.limitEvaluator.evaluate(this.datum, this.valueMetadata);
return alarm && alarm.cssClass;
}
},
@ -267,6 +270,6 @@ export default {
this.openmct.contextMenu._showContextMenuForObjectPath(this.currentObjectPath, event.x, event.y, CONTEXT_MENU_ACTIONS);
}
}
}
};
</script>

View File

@ -39,7 +39,7 @@
</template>
<script>
import LayoutFrame from './LayoutFrame.vue'
import LayoutFrame from './LayoutFrame.vue';
import conditionalStylesMixin from "../mixins/objectStyles-mixin";
export default {
@ -118,5 +118,5 @@ export default {
this.removeSelectable();
}
}
}
};
</script>