mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 14:48:13 +00:00
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:
@ -34,7 +34,10 @@ define(
|
||||
key: "cancel"
|
||||
}
|
||||
],
|
||||
OK_OPTIONS = [{ name: "OK", key: "ok" }];
|
||||
OK_OPTIONS = [{
|
||||
name: "OK",
|
||||
key: "ok"
|
||||
}];
|
||||
|
||||
/**
|
||||
* Populates a `dialogModel` to pass to `dialogService.getUserChoise`
|
||||
@ -49,8 +52,8 @@ define(
|
||||
// Place this failure into an appropriate group
|
||||
function categorizeFailure(failure) {
|
||||
// Check if the error is due to object revision
|
||||
var isRevisionError = ((failure || {}).error || {}).key ===
|
||||
PersistenceFailureConstants.REVISION_ERROR_KEY;
|
||||
var isRevisionError = ((failure || {}).error || {}).key
|
||||
=== PersistenceFailureConstants.REVISION_ERROR_KEY;
|
||||
// Push the failure into the appropriate group
|
||||
(isRevisionError ? revisionErrors : otherErrors).push(failure);
|
||||
}
|
||||
@ -65,8 +68,8 @@ define(
|
||||
revised: revisionErrors,
|
||||
unrecoverable: otherErrors
|
||||
},
|
||||
options: revisionErrors.length > 0 ?
|
||||
OVERWRITE_CANCEL_OPTIONS : OK_OPTIONS
|
||||
options: revisionErrors.length > 0
|
||||
? OVERWRITE_CANCEL_OPTIONS : OK_OPTIONS
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ define(
|
||||
function discard(failure) {
|
||||
var persistence =
|
||||
failure.domainObject.getCapability('persistence');
|
||||
|
||||
return persistence.refresh();
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@ define(
|
||||
PersistenceFailureHandler
|
||||
) {
|
||||
|
||||
|
||||
/**
|
||||
* The PersistenceQueue is used by the QueuingPersistenceCapability
|
||||
* to aggregate calls for object persistence. These are then issued
|
||||
|
@ -87,6 +87,7 @@ define(
|
||||
requeue: requeue,
|
||||
error: error
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -97,9 +98,9 @@ define(
|
||||
|
||||
// Handle any failures from the full operation
|
||||
function handleFailure(value) {
|
||||
return failures.length > 0 ?
|
||||
failureHandler.handle(failures) :
|
||||
value;
|
||||
return failures.length > 0
|
||||
? failureHandler.handle(failures)
|
||||
: value;
|
||||
}
|
||||
|
||||
// Try to persist everything, then handle any failures
|
||||
|
@ -66,8 +66,8 @@ define(
|
||||
|
||||
// Check if the queue's size has stopped increasing)
|
||||
function quiescent() {
|
||||
return Object.keys(self.persistences).length ===
|
||||
self.lastObservedSize;
|
||||
return Object.keys(self.persistences).length
|
||||
=== self.lastObservedSize;
|
||||
}
|
||||
|
||||
// Persist all queued objects
|
||||
@ -82,6 +82,7 @@ define(
|
||||
function clearFlushPromise(value) {
|
||||
self.flushPromise = undefined;
|
||||
flushingDefer.resolve(value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -109,6 +110,7 @@ define(
|
||||
} else {
|
||||
self.scheduleFlush();
|
||||
}
|
||||
|
||||
// Update lastObservedSize to detect quiescence
|
||||
self.lastObservedSize = Object.keys(self.persistences).length;
|
||||
}
|
||||
@ -120,14 +122,13 @@ define(
|
||||
} else {
|
||||
// Otherwise, schedule a flush on a timeout (to give
|
||||
// a window for other updates to get aggregated)
|
||||
self.pendingTimeout = self.pendingTimeout ||
|
||||
$timeout(maybeFlush, self.delay, false);
|
||||
self.pendingTimeout = self.pendingTimeout
|
||||
|| $timeout(maybeFlush, self.delay, false);
|
||||
}
|
||||
|
||||
return self.activeDefer.promise;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Queue persistence of a domain object.
|
||||
* @param {DomainObject} domainObject the domain object
|
||||
@ -139,6 +140,7 @@ define(
|
||||
var id = domainObject.getId();
|
||||
this.persistences[id] = persistence;
|
||||
this.objects[id] = domainObject;
|
||||
|
||||
return this.scheduleFlush();
|
||||
};
|
||||
|
||||
|
@ -60,9 +60,9 @@ define(
|
||||
capabilities.persistence = function (domainObject) {
|
||||
// Get/instantiate the original
|
||||
var original =
|
||||
(typeof originalPersistence === 'function') ?
|
||||
originalPersistence(domainObject) :
|
||||
originalPersistence;
|
||||
(typeof originalPersistence === 'function')
|
||||
? originalPersistence(domainObject)
|
||||
: originalPersistence;
|
||||
|
||||
// Provide a decorated version
|
||||
return new QueuingPersistenceCapability(
|
||||
@ -72,6 +72,7 @@ define(
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user