ESLint rules: array-callback-return, no-invalid-this, func-style (#3151)
* satisfied array-callback-return rule * satisfying no-invalid-this rule * fixed invalid-this issues * changed isNotEqual to arrow function * added rule func-style * added return false to satisfy array-callback-return rule Co-authored-by: Joel McKinnon <jmckinnon@apple.com> Co-authored-by: Joshi <simplyrender@gmail.com> Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
@@ -169,28 +169,7 @@ export default {
|
||||
},
|
||||
dropCondition(targetIndex) {
|
||||
const oldIndexArr = Object.keys(this.conditionCollection);
|
||||
const move = function (arr, old_index, new_index) {
|
||||
while (old_index < 0) {
|
||||
old_index += arr.length;
|
||||
}
|
||||
|
||||
while (new_index < 0) {
|
||||
new_index += arr.length;
|
||||
}
|
||||
|
||||
if (new_index >= arr.length) {
|
||||
var k = new_index - arr.length;
|
||||
while ((k--) + 1) {
|
||||
arr.push(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
|
||||
|
||||
return arr;
|
||||
};
|
||||
|
||||
const newIndexArr = move(oldIndexArr, this.moveIndex, targetIndex);
|
||||
const newIndexArr = this.rearrangeIndices(oldIndexArr, this.moveIndex, targetIndex);
|
||||
const reorderPlan = [];
|
||||
|
||||
for (let i = 0; i < oldIndexArr.length; i++) {
|
||||
@@ -205,6 +184,26 @@ export default {
|
||||
dragComplete() {
|
||||
this.isDragging = false;
|
||||
},
|
||||
rearrangeIndices(arr, old_index, new_index) {
|
||||
while (old_index < 0) {
|
||||
old_index += arr.length;
|
||||
}
|
||||
|
||||
while (new_index < 0) {
|
||||
new_index += arr.length;
|
||||
}
|
||||
|
||||
if (new_index >= arr.length) {
|
||||
var k = new_index - arr.length;
|
||||
while ((k--) + 1) {
|
||||
arr.push(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
|
||||
|
||||
return arr;
|
||||
},
|
||||
addTelemetryObject(domainObject) {
|
||||
this.telemetryObjs.push(domainObject);
|
||||
this.$emit('telemetryUpdated', this.telemetryObjs);
|
||||
|
||||
@@ -223,20 +223,22 @@ export default {
|
||||
},
|
||||
addConditionSet() {
|
||||
let conditionSetDomainObject;
|
||||
const handleItemSelection = (item) => {
|
||||
let self = this;
|
||||
|
||||
function handleItemSelection(item) {
|
||||
if (item) {
|
||||
conditionSetDomainObject = item;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const dismissDialog = (overlay, initialize) => {
|
||||
function dismissDialog(overlay, initialize) {
|
||||
overlay.dismiss();
|
||||
if (initialize && conditionSetDomainObject) {
|
||||
this.conditionSetDomainObject = conditionSetDomainObject;
|
||||
this.conditionalStyles = [];
|
||||
this.initializeConditionalStyles();
|
||||
self.conditionSetDomainObject = conditionSetDomainObject;
|
||||
self.conditionalStyles = [];
|
||||
self.initializeConditionalStyles();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let vm = new Vue({
|
||||
provide: {
|
||||
|
||||
@@ -431,20 +431,22 @@ export default {
|
||||
},
|
||||
addConditionSet() {
|
||||
let conditionSetDomainObject;
|
||||
const handleItemSelection = (item) => {
|
||||
let self = this;
|
||||
function handleItemSelection(item) {
|
||||
if (item) {
|
||||
conditionSetDomainObject = item;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const dismissDialog = (overlay, initialize) => {
|
||||
function dismissDialog(overlay, initialize) {
|
||||
overlay.dismiss();
|
||||
|
||||
if (initialize && conditionSetDomainObject) {
|
||||
this.conditionSetDomainObject = conditionSetDomainObject;
|
||||
this.conditionalStyles = [];
|
||||
this.initializeConditionalStyles();
|
||||
self.conditionSetDomainObject = conditionSetDomainObject;
|
||||
self.conditionalStyles = [];
|
||||
self.initializeConditionalStyles();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let vm = new Vue({
|
||||
provide: {
|
||||
|
||||
Reference in New Issue
Block a user