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:
@@ -87,7 +87,7 @@ import DropHint from './dropHint.vue';
|
||||
const MIN_FRAME_SIZE = 5;
|
||||
|
||||
export default {
|
||||
inject:['openmct'],
|
||||
inject: ['openmct'],
|
||||
components: {
|
||||
FrameComponent,
|
||||
ResizeHandle,
|
||||
@@ -121,7 +121,7 @@ export default {
|
||||
return this.container.frames;
|
||||
},
|
||||
sizeString() {
|
||||
return `${Math.round(this.container.size)}%`
|
||||
return `${Math.round(this.container.size)}%`;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
addContainer: this.addContainer,
|
||||
type: 'container',
|
||||
containerId: this.container.id
|
||||
}
|
||||
};
|
||||
|
||||
this.unsubscribeSelection = this.openmct.selection.selectable(this.$el, context, false);
|
||||
},
|
||||
@@ -146,6 +146,7 @@ export default {
|
||||
if (event.dataTransfer.types.includes('openmct/domain-object-path')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let frameId = event.dataTransfer.getData('frameid'),
|
||||
containerIndex = Number(event.dataTransfer.getData('containerIndex'));
|
||||
|
||||
@@ -160,7 +161,7 @@ export default {
|
||||
if (index === -1) {
|
||||
return framePos !== 0;
|
||||
} else {
|
||||
return framePos !== index && (framePos - 1) !== index
|
||||
return framePos !== index && (framePos - 1) !== index;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
@@ -173,8 +174,10 @@ export default {
|
||||
this.index,
|
||||
insertIndex
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// move frame.
|
||||
let frameId = event.dataTransfer.getData('frameid');
|
||||
let containerIndex = Number(event.dataTransfer.getData('containerIndex'));
|
||||
@@ -212,7 +215,7 @@ export default {
|
||||
},
|
||||
getFrameSize(size) {
|
||||
if (size < MIN_FRAME_SIZE) {
|
||||
return MIN_FRAME_SIZE
|
||||
return MIN_FRAME_SIZE;
|
||||
} else if (size > (this.maxMoveSize - MIN_FRAME_SIZE)) {
|
||||
return (this.maxMoveSize - MIN_FRAME_SIZE);
|
||||
} else {
|
||||
@@ -226,5 +229,5 @@ export default {
|
||||
event.dataTransfer.setData('containerid', this.container.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
props: {
|
||||
index: {
|
||||
type: Number,
|
||||
required: true
|
||||
@@ -49,7 +49,7 @@ export default {
|
||||
return {
|
||||
isMouseOver: false,
|
||||
isValidTarget: false
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('dragstart', this.dragstart);
|
||||
@@ -79,5 +79,5 @@ export default {
|
||||
this.isValidTarget = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -89,10 +89,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ContainerComponent from './container.vue';
|
||||
import ContainerComponent from './container.vue';
|
||||
import Container from '../utils/container';
|
||||
import Frame from '../utils/frame';
|
||||
import ResizeHandle from './resizeHandle.vue';
|
||||
import ResizeHandle from './resizeHandle.vue';
|
||||
import DropHint from './dropHint.vue';
|
||||
import RemoveAction from '../../remove/RemoveAction.js';
|
||||
|
||||
@@ -108,6 +108,7 @@ function sizeItems(items, newItem) {
|
||||
if (!newItem.size || newItem.size === 100) {
|
||||
newItem.size = Math.round(100 / items.length);
|
||||
}
|
||||
|
||||
let oldItems = items.filter(item => item !== newItem);
|
||||
// Resize oldItems to fit inside remaining space;
|
||||
let remainder = 100 - newItem.size;
|
||||
@@ -127,6 +128,7 @@ function sizeToFill(items) {
|
||||
if (items.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let oldTotal = items.reduce((total, item) => total + item.size, 0);
|
||||
items.forEach((item) => {
|
||||
item.size = Math.round(item.size * 100 / oldTotal);
|
||||
@@ -151,14 +153,14 @@ export default {
|
||||
return {
|
||||
domainObject: this.layoutObject,
|
||||
newFrameLocation: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
layoutDirectionStr() {
|
||||
if (this.rowsLayout) {
|
||||
return 'Rows'
|
||||
return 'Rows';
|
||||
} else {
|
||||
return 'Columns'
|
||||
return 'Columns';
|
||||
}
|
||||
},
|
||||
containers() {
|
||||
@@ -254,7 +256,7 @@ export default {
|
||||
|
||||
this.removeFromComposition(frame.domainObjectIdentifier)
|
||||
.then(() => {
|
||||
sizeToFill(container.frames)
|
||||
sizeToFill(container.frames);
|
||||
this.setSelectionToParent();
|
||||
});
|
||||
},
|
||||
@@ -278,7 +280,7 @@ export default {
|
||||
if (index === -1) {
|
||||
return containerPos !== 0;
|
||||
} else {
|
||||
return containerPos !== index && (containerPos - 1) !== index
|
||||
return containerPos !== index && (containerPos - 1) !== index;
|
||||
}
|
||||
},
|
||||
persist(index) {
|
||||
@@ -314,7 +316,7 @@ export default {
|
||||
},
|
||||
getContainerSize(size) {
|
||||
if (size < MIN_CONTAINER_SIZE) {
|
||||
return MIN_CONTAINER_SIZE
|
||||
return MIN_CONTAINER_SIZE;
|
||||
} else if (size > (this.maxMoveSize - MIN_CONTAINER_SIZE)) {
|
||||
return (this.maxMoveSize - MIN_CONTAINER_SIZE);
|
||||
} else {
|
||||
@@ -334,6 +336,7 @@ export default {
|
||||
} else {
|
||||
this.containers.splice(toIndex, 0, container);
|
||||
}
|
||||
|
||||
this.persist();
|
||||
},
|
||||
removeChildObject(identifier) {
|
||||
@@ -350,5 +353,5 @@ export default {
|
||||
this.persist();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
return {
|
||||
domainObject: undefined,
|
||||
currentObjectPath: undefined
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasFrame() {
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
if (this.frame.domainObjectIdentifier) {
|
||||
this.openmct.objects.get(this.frame.domainObjectIdentifier).then((object)=>{
|
||||
this.openmct.objects.get(this.frame.domainObjectIdentifier).then((object) => {
|
||||
this.setDomainObject(object);
|
||||
});
|
||||
}
|
||||
@@ -143,5 +143,5 @@ export default {
|
||||
event.dataTransfer.setData('containerIndex', this.containerIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -49,7 +49,7 @@ export default {
|
||||
return {
|
||||
initialPos: 0,
|
||||
isDragging: false
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('dragstart', this.setDragging);
|
||||
@@ -100,5 +100,5 @@ export default {
|
||||
this.isDragging = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -43,7 +43,7 @@ define([
|
||||
|
||||
return {
|
||||
show: function (element, isEditing) {
|
||||
component = new Vue({
|
||||
component = new Vue({
|
||||
provide: {
|
||||
openmct,
|
||||
objectPath,
|
||||
@@ -56,7 +56,7 @@ define([
|
||||
data() {
|
||||
return {
|
||||
isEditing: isEditing
|
||||
}
|
||||
};
|
||||
},
|
||||
template: '<flexible-layout-component ref="flexibleLayout" :isEditing="isEditing"></flexible-layout-component>'
|
||||
});
|
||||
@@ -84,5 +84,6 @@ define([
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return FlexibleLayoutViewProvider;
|
||||
});
|
||||
|
||||
@@ -29,8 +29,8 @@ function ToolbarProvider(openmct) {
|
||||
forSelection: function (selection) {
|
||||
let context = selection[0][0].context;
|
||||
|
||||
return (context && context.type &&
|
||||
(context.type === 'flexible-layout' || context.type === 'container' || context.type === 'frame'));
|
||||
return (context && context.type
|
||||
&& (context.type === 'flexible-layout' || context.type === 'container' || context.type === 'frame'));
|
||||
},
|
||||
toolbar: function (selection) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user