Compare commits

...

22 Commits

Author SHA1 Message Date
35062b164a Merge branch 'eslint-updates3' of https://github.com/nasa/openmct into eslint-updates3 2020-07-09 11:32:45 -07:00
976d070402 resolved conflicts 2020-07-09 11:31:56 -07:00
d2161d692c resolved conflict 2020-07-09 11:21:56 -07:00
aa3aa23b95 resolved conflict 2020-07-09 11:21:00 -07:00
3fc20995c7 Merge branch 'master' into eslint-updates3 2020-07-07 16:56:20 -07:00
b378b6e465 completed changes for one-var rule 2020-07-07 16:40:01 -07:00
3a4c205f55 about half of one-var violations fixed 2020-07-07 09:19:51 -07:00
5071328c90 first big chunk of one-var fixes 2020-07-06 23:35:31 -07:00
04c258ccd3 Merge branch 'eslint-updates2' of https://github.com/nasa/openmct into eslint-updates2 2020-07-06 15:08:24 -07:00
6d37adde0e addressed review comments 2020-07-06 15:08:11 -07:00
25aad22562 Merge branch 'master' of https://github.com/nasa/openmct into eslint-updates2 2020-07-06 15:06:52 -07:00
6e3e7a50d7 Merge branch 'master' into eslint-updates2 2020-07-06 11:37:35 -07:00
cfcfb31193 resolve merge conflict 2020-07-06 11:34:39 -07:00
db0d5bd974 added rule func-style 2020-07-06 11:29:32 -07:00
01407ffbe2 changed isNotEqual to arrow function 2020-07-06 08:46:35 -07:00
26d3fce0c8 restored xdescribe in spec 2020-07-06 08:41:48 -07:00
539e0773f8 Merge branch 'eslint-updates2' of https://github.com/nasa/openmct into eslint-updates2 2020-07-06 08:36:28 -07:00
4d34fad8db restored default port, removed additional rule 2020-07-06 08:35:34 -07:00
bfea0e89e6 Merge branch 'master' into eslint-updates2 2020-07-06 08:29:23 -07:00
8e04a9c550 fixed invalid-this issues 2020-07-02 16:42:12 -07:00
e6cd94123c satisfying no-invalid-this rule 2020-06-30 09:56:46 -07:00
1be7927303 satisfied array-callback-return rule 2020-06-30 09:02:36 -07:00
448 changed files with 3815 additions and 3728 deletions

View File

@ -120,6 +120,8 @@ module.exports = {
"no-useless-computed-key": "error", "no-useless-computed-key": "error",
// https://eslint.org/docs/rules/rest-spread-spacing // https://eslint.org/docs/rules/rest-spread-spacing
"rest-spread-spacing": ["error"], "rest-spread-spacing": ["error"],
// https://eslint.org/docs/rules/one-var
"one-var": ["error", "never"],
"vue/html-indent": [ "vue/html-indent": [
"error", "error",

View File

@ -35,9 +35,9 @@ define(
function EventTelemetry(request, interval) { function EventTelemetry(request, interval) {
var latestObservedTime = Date.now(), var latestObservedTime = Date.now();
count = Math.floor((latestObservedTime - firstObservedTime) / interval), var count = Math.floor((latestObservedTime - firstObservedTime) / interval);
generatorData = {}; var generatorData = {};
generatorData.getPointCount = function () { generatorData.getPointCount = function () {
return count; return count;
@ -49,8 +49,8 @@ define(
}; };
generatorData.getRangeValue = function (i, range) { generatorData.getRangeValue = function (i, range) {
var domainDelta = this.getDomainValue(i) - firstObservedTime, var domainDelta = this.getDomainValue(i) - firstObservedTime;
ind = i % messages.length; var ind = i % messages.length;
return messages[ind] + " - [" + domainDelta.toString() + "]"; return messages[ind] + " - [" + domainDelta.toString() + "]";
}; };

View File

@ -34,9 +34,9 @@ define(
* @constructor * @constructor
*/ */
function EventTelemetryProvider($q, $timeout) { function EventTelemetryProvider($q, $timeout) {
var subscriptions = [], var subscriptions = [];
genInterval = 1000, var genInterval = 1000;
generating = false; var generating = false;
// //
function matchesSource(request) { function matchesSource(request) {

View File

@ -40,23 +40,23 @@ define([], function () {
} }
ExportTelemetryAsCSVAction.prototype.perform = function () { ExportTelemetryAsCSVAction.prototype.perform = function () {
var context = this.context, var context = this.context;
domainObject = context.domainObject, var domainObject = context.domainObject;
telemetry = domainObject.getCapability("telemetry"), var telemetry = domainObject.getCapability("telemetry");
metadata = telemetry.getMetadata(), var metadata = telemetry.getMetadata();
domains = metadata.domains, var domains = metadata.domains;
ranges = metadata.ranges, var ranges = metadata.ranges;
exportService = this.exportService; var exportService = this.exportService;
function getName(domainOrRange) { function getName(domainOrRange) {
return domainOrRange.name; return domainOrRange.name;
} }
telemetry.requestData({}).then(function (series) { telemetry.requestData({}).then(function (series) {
var headers = domains.map(getName).concat(ranges.map(getName)), var headers = domains.map(getName).concat(ranges.map(getName));
rows = [], var rows = [];
row, var row;
i; var i;
function copyDomainsToRow(telemetryRow, index) { function copyDomainsToRow(telemetryRow, index) {
domains.forEach(function (domain) { domains.forEach(function (domain) {

View File

@ -28,39 +28,39 @@ define([
) { ) {
var RED = { var RED = {
sin: 0.9, sin: 0.9,
cos: 0.9 cos: 0.9
};
var YELLOW = {
sin: 0.5,
cos: 0.5
};
var LIMITS = {
rh: {
cssClass: "is-limit--upr is-limit--red",
low: RED,
high: Number.POSITIVE_INFINITY,
name: "Red High"
}, },
YELLOW = { rl: {
sin: 0.5, cssClass: "is-limit--lwr is-limit--red",
cos: 0.5 high: -RED,
low: Number.NEGATIVE_INFINITY,
name: "Red Low"
}, },
LIMITS = { yh: {
rh: { cssClass: "is-limit--upr is-limit--yellow",
cssClass: "is-limit--upr is-limit--red", low: YELLOW,
low: RED, high: RED,
high: Number.POSITIVE_INFINITY, name: "Yellow High"
name: "Red High" },
}, yl: {
rl: { cssClass: "is-limit--lwr is-limit--yellow",
cssClass: "is-limit--lwr is-limit--red", low: -RED,
high: -RED, high: -YELLOW,
low: Number.NEGATIVE_INFINITY, name: "Yellow Low"
name: "Red Low" }
}, };
yh: {
cssClass: "is-limit--upr is-limit--yellow",
low: YELLOW,
high: RED,
name: "Yellow High"
},
yl: {
cssClass: "is-limit--lwr is-limit--yellow",
low: -RED,
high: -YELLOW,
name: "Yellow Low"
}
};
function SinewaveLimitProvider() { function SinewaveLimitProvider() {

View File

@ -25,24 +25,24 @@ define(
function () { function () {
"use strict"; "use strict";
var DEFAULT_IDENTITY = { key: "user", name: "Example User" }, var DEFAULT_IDENTITY = { key: "user", name: "Example User" };
DIALOG_STRUCTURE = { var DIALOG_STRUCTURE = {
name: "Identify Yourself", name: "Identify Yourself",
sections: [{ rows: [ sections: [{ rows: [
{ {
name: "User ID", name: "User ID",
control: "textfield", control: "textfield",
key: "key", key: "key",
required: true required: true
}, },
{ {
name: "Human name", name: "Human name",
control: "textfield", control: "textfield",
key: "name", key: "name",
required: true required: true
} }
]}] ]}]
}; };
/** /**

View File

@ -25,12 +25,12 @@ define(
function () { function () {
"use strict"; "use strict";
var PREFIX = "msl_tlm:", var PREFIX = "msl_tlm:";
FORMAT_MAPPINGS = { var FORMAT_MAPPINGS = {
float: "number", float: "number",
integer: "number", integer: "number",
string: "string" string: "string"
}; };
function RemsTelemetryModelProvider(adapter) { function RemsTelemetryModelProvider(adapter) {
@ -64,8 +64,8 @@ define(
} }
function addInstrument(subsystem, spacecraftId) { function addInstrument(subsystem, spacecraftId) {
var measurements = (subsystem.measurements || []), var measurements = (subsystem.measurements || []);
instrumentId = makeId(subsystem); var instrumentId = makeId(subsystem);
models[instrumentId] = { models[instrumentId] = {
type: "msl.instrument", type: "msl.instrument",

View File

@ -42,9 +42,9 @@ define (
* object that wraps the telemetry returned from the telemetry source. * object that wraps the telemetry returned from the telemetry source.
*/ */
RemsTelemetryProvider.prototype.requestTelemetry = function (requests) { RemsTelemetryProvider.prototype.requestTelemetry = function (requests) {
var packaged = {}, var packaged = {};
relevantReqs, var relevantReqs;
adapter = this.adapter; var adapter = this.adapter;
function matchesSource(request) { function matchesSource(request) {
return (request.source === SOURCE); return (request.source === SOURCE);

View File

@ -30,8 +30,8 @@ define(
function (MSLDataDictionary, module) { function (MSLDataDictionary, module) {
"use strict"; "use strict";
var TERRESTRIAL_DATE = "terrestrial_date", var TERRESTRIAL_DATE = "terrestrial_date";
LOCAL_DATA = "../data/rems.json"; var LOCAL_DATA = "../data/rems.json";
/** /**
* Fetches historical data from the REMS instrument on the Curiosity * Fetches historical data from the REMS instrument on the Curiosity
@ -69,8 +69,8 @@ define(
* @private * @private
*/ */
RemsTelemetryServerAdapter.prototype.requestHistory = function (request) { RemsTelemetryServerAdapter.prototype.requestHistory = function (request) {
var self = this, var self = this;
id = request.key; var id = request.key;
var dataTransforms = this.dataTransforms; var dataTransforms = this.dataTransforms;

View File

@ -44,31 +44,31 @@ define(
periodically with the progress of an ongoing process. periodically with the progress of an ongoing process.
*/ */
$scope.launchProgress = function (knownProgress) { $scope.launchProgress = function (knownProgress) {
var dialog, var dialog;
model = { var model = {
title: "Progress Dialog Example", title: "Progress Dialog Example",
progress: 0, progress: 0,
hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.", hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.",
actionText: "Calculating...", actionText: "Calculating...",
unknownProgress: !knownProgress, unknownProgress: !knownProgress,
unknownDuration: false, unknownDuration: false,
severity: "info", severity: "info",
options: [ options: [
{ {
label: "Cancel Operation", label: "Cancel Operation",
callback: function () { callback: function () {
$log.debug("Operation cancelled"); $log.debug("Operation cancelled");
dialog.dismiss(); dialog.dismiss();
}
},
{
label: "Do something else...",
callback: function () {
$log.debug("Something else pressed");
}
} }
] },
}; {
label: "Do something else...",
callback: function () {
$log.debug("Something else pressed");
}
}
]
};
function incrementProgress() { function incrementProgress() {
model.progress = Math.min(100, Math.floor(model.progress + Math.random() * 30)); model.progress = Math.min(100, Math.floor(model.progress + Math.random() * 30));
@ -96,28 +96,28 @@ define(
Demonstrates launching an error dialog Demonstrates launching an error dialog
*/ */
$scope.launchError = function () { $scope.launchError = function () {
var dialog, var dialog;
model = { var model = {
title: "Error Dialog Example", title: "Error Dialog Example",
actionText: "Something happened, and it was not good.", actionText: "Something happened, and it was not good.",
severity: "error", severity: "error",
options: [ options: [
{ {
label: "Try Again", label: "Try Again",
callback: function () { callback: function () {
$log.debug("Try Again Pressed"); $log.debug("Try Again Pressed");
dialog.dismiss(); dialog.dismiss();
}
},
{
label: "Cancel",
callback: function () {
$log.debug("Cancel Pressed");
dialog.dismiss();
}
} }
] },
}; {
label: "Cancel",
callback: function () {
$log.debug("Cancel Pressed");
dialog.dismiss();
}
}
]
};
dialog = dialogService.showBlockingMessage(model); dialog = dialogService.showBlockingMessage(model);
if (!dialog) { if (!dialog) {
@ -129,21 +129,21 @@ define(
Demonstrates launching an error dialog Demonstrates launching an error dialog
*/ */
$scope.launchInfo = function () { $scope.launchInfo = function () {
var dialog, var dialog;
model = { var model = {
title: "Info Dialog Example", title: "Info Dialog Example",
actionText: "This is an example of a blocking info" + actionText: "This is an example of a blocking info" +
" dialog. This dialog can be used to draw the user's" + " dialog. This dialog can be used to draw the user's" +
" attention to an event.", " attention to an event.",
severity: "info", severity: "info",
primaryOption: { primaryOption: {
label: "OK", label: "OK",
callback: function () { callback: function () {
$log.debug("OK Pressed"); $log.debug("OK Pressed");
dialog.dismiss(); dialog.dismiss();
}
} }
}; }
};
dialog = dialogService.showBlockingMessage(model); dialog = dialogService.showBlockingMessage(model);

View File

@ -33,13 +33,13 @@ define(
function BrowserPersistenceProvider($q, SPACE) { function BrowserPersistenceProvider($q, SPACE) {
var spaces = SPACE ? [SPACE] : [], var spaces = SPACE ? [SPACE] : [];
caches = {}, var caches = {};
promises = { var promises = {
as: function (value) { as: function (value) {
return $q.when(value); return $q.when(value);
} }
}; };
spaces.forEach(function (space) { spaces.forEach(function (space) {
caches[space] = {}; caches[space] = {};

View File

@ -33,10 +33,10 @@ define(
* "foo." * "foo."
*/ */
allow: function (action, context) { allow: function (action, context) {
var domainObject = (context || {}).domainObject, var domainObject = (context || {}).domainObject;
model = (domainObject && domainObject.getModel()) || {}, var model = (domainObject && domainObject.getModel()) || {};
name = model.name || "", var name = model.name || "";
metadata = action.getMetadata() || {}; var metadata = action.getMetadata() || {};
return metadata.key !== 'remove' || name.indexOf('foo') < 0; return metadata.key !== 'remove' || name.indexOf('foo') < 0;
} }
}; };

View File

@ -34,13 +34,13 @@ define(
* @implements {Indicator} * @implements {Indicator}
*/ */
function DigestIndicator($interval, $rootScope) { function DigestIndicator($interval, $rootScope) {
var digests = 0, var digests = 0;
displayed = 0, var displayed = 0;
start = Date.now(); var start = Date.now();
function update() { function update() {
var now = Date.now(), var now = Date.now();
secs = (now - start) / 1000; var secs = (now - start) / 1000;
displayed = Math.round(digests / secs); displayed = Math.round(digests / secs);
start = now; start = now;
digests = 0; digests = 0;

View File

@ -25,9 +25,9 @@ define(
function (AboutController) { function (AboutController) {
describe("The About controller", function () { describe("The About controller", function () {
var testVersions, var testVersions;
mockWindow, var mockWindow;
controller; var controller;
beforeEach(function () { beforeEach(function () {
testVersions = [ testVersions = [

View File

@ -25,8 +25,8 @@ define(
function (LicenseController) { function (LicenseController) {
describe("The License controller", function () { describe("The License controller", function () {
var testLicenses, var testLicenses;
controller; var controller;
beforeEach(function () { beforeEach(function () {
testLicenses = [ testLicenses = [

View File

@ -25,8 +25,8 @@ define(
function (LogoController) { function (LogoController) {
describe("The About controller", function () { describe("The About controller", function () {
var mockOverlayService, var mockOverlayService;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockOverlayService = jasmine.createSpyObj( mockOverlayService = jasmine.createSpyObj(

View File

@ -30,9 +30,9 @@ define([
) { ) {
describe("The navigate action", function () { describe("The navigate action", function () {
var mockNavigationService, var mockNavigationService;
mockDomainObject, var mockDomainObject;
action; var action;
beforeEach(function () { beforeEach(function () {
mockNavigationService = jasmine.createSpyObj( mockNavigationService = jasmine.createSpyObj(

View File

@ -28,8 +28,8 @@ define(
function (NavigationService) { function (NavigationService) {
describe("The navigation service", function () { describe("The navigation service", function () {
var $window, let $window;
navigationService; let navigationService;
beforeEach(function () { beforeEach(function () {
$window = jasmine.createSpyObj('$window', ['confirm']); $window = jasmine.createSpyObj('$window', ['confirm']);
@ -37,8 +37,8 @@ define(
}); });
it("stores navigation state", function () { it("stores navigation state", function () {
var testObject = { someKey: 42 }, var testObject = { someKey: 42 };
otherObject = { someKey: "some value" }; var otherObject = { someKey: "some value" };
expect(navigationService.getNavigation()) expect(navigationService.getNavigation())
.toBeUndefined(); .toBeUndefined();
navigationService.setNavigation(testObject); navigationService.setNavigation(testObject);
@ -52,8 +52,8 @@ define(
}); });
it("notifies listeners on change", function () { it("notifies listeners on change", function () {
var testObject = { someKey: 42 }, var testObject = { someKey: 42 };
callback = jasmine.createSpy("callback"); var callback = jasmine.createSpy("callback");
navigationService.addListener(callback); navigationService.addListener(callback);
expect(callback).not.toHaveBeenCalled(); expect(callback).not.toHaveBeenCalled();
@ -63,8 +63,8 @@ define(
}); });
it("does not notify listeners when no changes occur", function () { it("does not notify listeners when no changes occur", function () {
var testObject = { someKey: 42 }, var testObject = { someKey: 42 };
callback = jasmine.createSpy("callback"); var callback = jasmine.createSpy("callback");
navigationService.addListener(callback); navigationService.addListener(callback);
navigationService.setNavigation(testObject); navigationService.setNavigation(testObject);
@ -73,8 +73,8 @@ define(
}); });
it("stops notifying listeners after removal", function () { it("stops notifying listeners after removal", function () {
var testObject = { someKey: 42 }, var testObject = { someKey: 42 };
callback = jasmine.createSpy("callback"); var callback = jasmine.createSpy("callback");
navigationService.addListener(callback); navigationService.addListener(callback);
navigationService.removeListener(callback); navigationService.removeListener(callback);

View File

@ -24,18 +24,18 @@ define([
'../../src/navigation/OrphanNavigationHandler' '../../src/navigation/OrphanNavigationHandler'
], function (OrphanNavigationHandler) { ], function (OrphanNavigationHandler) {
describe("OrphanNavigationHandler", function () { describe("OrphanNavigationHandler", function () {
var mockTopic, var mockTopic;
mockThrottle, var mockThrottle;
mockMutationTopic, var mockMutationTopic;
mockNavigationService, var mockNavigationService;
mockDomainObject, var mockDomainObject;
mockParentObject, var mockParentObject;
mockContext, var mockContext;
mockActionCapability, var mockActionCapability;
mockEditor, var mockEditor;
testParentComposition, var testParentComposition;
testId, var testId;
mockThrottledFns; var mockThrottledFns;
beforeEach(function () { beforeEach(function () {
testId = 'some-identifier'; testId = 'some-identifier';

View File

@ -25,12 +25,12 @@ define(
function (NewTabAction) { function (NewTabAction) {
describe("The new tab action", function () { describe("The new tab action", function () {
var actionSelected, var actionSelected;
actionCurrent, var actionCurrent;
mockWindow, var mockWindow;
mockContextCurrent, var mockContextCurrent;
mockContextSelected, var mockContextSelected;
mockUrlService; var mockUrlService;
beforeEach(function () { beforeEach(function () {
mockWindow = jasmine.createSpyObj("$window", ["open", "location"]); mockWindow = jasmine.createSpyObj("$window", ["open", "location"]);

View File

@ -62,10 +62,10 @@ define(
DialogService.prototype.getDialogResponse = function (key, model, resultGetter, typeClass) { DialogService.prototype.getDialogResponse = function (key, model, resultGetter, typeClass) {
// We will return this result as a promise, because user // We will return this result as a promise, because user
// input is asynchronous. // input is asynchronous.
var deferred = this.$q.defer(), var deferred = this.$q.defer();
self = this, var self = this;
overlay, var overlay;
handleEscKeydown; var handleEscKeydown;
// Confirm function; this will be passed in to the // Confirm function; this will be passed in to the
// overlay-dialog template and associated with a // overlay-dialog template and associated with a
@ -247,12 +247,12 @@ define(
if (this.canShowDialog(dialogModel)) { if (this.canShowDialog(dialogModel)) {
// Add the overlay using the OverlayService, which // Add the overlay using the OverlayService, which
// will handle actual insertion into the DOM // will handle actual insertion into the DOM
var self = this, var self = this;
overlay = this.overlayService.createOverlay( var overlay = this.overlayService.createOverlay(
"overlay-blocking-message", "overlay-blocking-message",
dialogModel, dialogModel,
"t-dialog-sm" "t-dialog-sm"
); );
this.activeOverlay = overlay; this.activeOverlay = overlay;

View File

@ -76,8 +76,8 @@ define(
*/ */
OverlayService.prototype.createOverlay = function (key, overlayModel, typeClass) { OverlayService.prototype.createOverlay = function (key, overlayModel, typeClass) {
// Create a new scope for this overlay // Create a new scope for this overlay
var scope = this.newScope(), var scope = this.newScope();
element; var element;
// Stop showing the overlay; additionally, release the scope // Stop showing the overlay; additionally, release the scope
// that it uses. // that it uses.

View File

@ -28,14 +28,14 @@ define(
function (DialogService) { function (DialogService) {
describe("The dialog service", function () { describe("The dialog service", function () {
var mockOverlayService, var mockOverlayService;
mockQ, var mockQ;
mockLog, var mockLog;
mockOverlay, var mockOverlay;
mockDeferred, var mockDeferred;
mockDocument, var mockDocument;
mockBody, var mockBody;
dialogService; var dialogService;
beforeEach(function () { beforeEach(function () {
mockOverlayService = jasmine.createSpyObj( mockOverlayService = jasmine.createSpyObj(
@ -188,8 +188,8 @@ define(
}); });
it("individual dialogs can be dismissed", function () { it("individual dialogs can be dismissed", function () {
var secondDialogHandle, var secondDialogHandle;
secondMockOverlay; var secondMockOverlay;
dialogHandle.dismiss(); dialogHandle.dismiss();

View File

@ -28,15 +28,15 @@ define(
function (OverlayService) { function (OverlayService) {
describe("The overlay service", function () { describe("The overlay service", function () {
var mockDocument, var mockDocument;
mockCompile, var mockCompile;
mockRootScope, var mockRootScope;
mockBody, var mockBody;
mockTemplate, var mockTemplate;
mockElement, var mockElement;
mockScope, var mockScope;
mockTimeout, var mockTimeout;
overlayService; var overlayService;
beforeEach(function () { beforeEach(function () {
mockDocument = jasmine.createSpyObj("$document", ["find"]); mockDocument = jasmine.createSpyObj("$document", ["find"]);

View File

@ -86,8 +86,8 @@ define(
* will be performed; should contain a `domainObject` property * will be performed; should contain a `domainObject` property
*/ */
EditAction.appliesTo = function (context) { EditAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject, var domainObject = (context || {}).domainObject;
type = domainObject && domainObject.getCapability('type'); var type = domainObject && domainObject.getCapability('type');
// Only allow editing of types that support it and are not already // Only allow editing of types that support it and are not already
// being edited // being edited

View File

@ -37,8 +37,8 @@ define(
} }
EditAndComposeAction.prototype.perform = function () { EditAndComposeAction.prototype.perform = function () {
var self = this, var self = this;
editAction = this.domainObject.getCapability('action').getActions("edit")[0]; var editAction = this.domainObject.getCapability('action').getActions("edit")[0];
// Link these objects // Link these objects
function doLink() { function doLink() {

View File

@ -46,9 +46,9 @@ define(
} }
PropertiesAction.prototype.perform = function () { PropertiesAction.prototype.perform = function () {
var type = this.domainObject.getCapability('type'), var type = this.domainObject.getCapability('type');
domainObject = this.domainObject, var domainObject = this.domainObject;
dialogService = this.dialogService; var dialogService = this.dialogService;
// Update the domain object model based on user input // Update the domain object model based on user input
function updateModel(userInput, dialog) { function updateModel(userInput, dialog) {
@ -82,9 +82,9 @@ define(
*/ */
PropertiesAction.appliesTo = function (context) { PropertiesAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject, var domainObject = (context || {}).domainObject;
type = domainObject && domainObject.getCapability('type'), var type = domainObject && domainObject.getCapability('type');
creatable = type && type.hasFeature('creation'); var creatable = type && type.hasFeature('creation');
if (domainObject && domainObject.model && domainObject.model.locked) { if (domainObject && domainObject.model && domainObject.model.locked) {
return false; return false;

View File

@ -49,9 +49,9 @@ define(
* @memberof platform/commonUI/edit.SaveAction# * @memberof platform/commonUI/edit.SaveAction#
*/ */
SaveAction.prototype.perform = function () { SaveAction.prototype.perform = function () {
var self = this, var self = this;
domainObject = this.domainObject, var domainObject = this.domainObject;
dialog = new SaveInProgressDialog(this.dialogService); var dialog = new SaveInProgressDialog(this.dialogService);
// Invoke any save behavior introduced by the editor capability; // Invoke any save behavior introduced by the editor capability;
// this is introduced by EditableDomainObject which is // this is introduced by EditableDomainObject which is

View File

@ -50,8 +50,8 @@ define(
* @memberof platform/commonUI/edit.SaveAndStopEditingAction# * @memberof platform/commonUI/edit.SaveAndStopEditingAction#
*/ */
SaveAndStopEditingAction.prototype.perform = function () { SaveAndStopEditingAction.prototype.perform = function () {
var domainObject = this.domainObject, var domainObject = this.domainObject;
saveAction = new SaveAction(this.dialogService, this.notificationService, this.context); var saveAction = new SaveAction(this.dialogService, this.notificationService, this.context);
function closeEditor() { function closeEditor() {
return domainObject.getCapability("editor").finish(); return domainObject.getCapability("editor").finish();

View File

@ -99,11 +99,11 @@ function (
* @private * @private
*/ */
SaveAsAction.prototype.save = function () { SaveAsAction.prototype.save = function () {
var self = this, var self = this;
domainObject = this.domainObject, var domainObject = this.domainObject;
copyService = this.copyService, var copyService = this.copyService;
dialog = new SaveInProgressDialog(this.dialogService), var dialog = new SaveInProgressDialog(this.dialogService);
toUndirty = []; var toUndirty = [];
function doWizardSave(parent) { function doWizardSave(parent) {
var wizard = self.createWizard(parent); var wizard = self.createWizard(parent);

View File

@ -49,10 +49,10 @@ define(
* transaction is in progress. * transaction is in progress.
*/ */
TransactionCapabilityDecorator.prototype.getCapabilities = function () { TransactionCapabilityDecorator.prototype.getCapabilities = function () {
var self = this, var self = this;
capabilities = this.capabilityService.getCapabilities var capabilities = this.capabilityService.getCapabilities
.apply(this.capabilityService, arguments), .apply(this.capabilityService, arguments);
persistenceCapability = capabilities.persistence; var persistenceCapability = capabilities.persistence;
capabilities.persistence = function (domainObject) { capabilities.persistence = function (domainObject) {
var original = var original =

View File

@ -29,8 +29,8 @@ define(
function () { function () {
function cancelEditing(domainObject) { function cancelEditing(domainObject) {
var navigatedObject = domainObject, var navigatedObject = domainObject;
editorCapability = navigatedObject && var editorCapability = navigatedObject &&
navigatedObject.getCapability("editor"); navigatedObject.getCapability("editor");
return editorCapability && return editorCapability &&

View File

@ -34,12 +34,12 @@ define(
// Update root object based on represented object // Update root object based on represented object
function updateRoot(domainObject) { function updateRoot(domainObject) {
var root = self.rootDomainObject, var root = self.rootDomainObject;
context = domainObject && var context = domainObject &&
domainObject.getCapability('context'), domainObject.getCapability('context');
newRoot = context && context.getTrueRoot(), var newRoot = context && context.getTrueRoot();
oldId = root && root.getId(), var oldId = root && root.getId();
newId = newRoot && newRoot.getId(); var newId = newRoot && newRoot.getId();
// Only update if this has actually changed, // Only update if this has actually changed,
// to avoid excessive refreshing. // to avoid excessive refreshing.

View File

@ -63,9 +63,9 @@ define(
* This will prompt for user input first. * This will prompt for user input first.
*/ */
CreateAction.prototype.perform = function () { CreateAction.prototype.perform = function () {
var newModel = this.type.getInitialModel(), var newModel = this.type.getInitialModel();
openmct = this.openmct, var openmct = this.openmct;
newObject; var newObject;
function onCancel() { function onCancel() {
openmct.editor.cancel(); openmct.editor.cancel();
@ -78,13 +78,13 @@ define(
} }
function navigateAndEdit(object) { function navigateAndEdit(object) {
let objectPath = object.getCapability('context').getPath(), let objectPath = object.getCapability('context').getPath();
url = '#/browse/' + objectPath let url = '#/browse/' + objectPath
.slice(1) .slice(1)
.map(function (o) { .map(function (o) {
return o && openmct.objects.makeKeyString(o.getId()); return o && openmct.objects.makeKeyString(o.getId());
}) })
.join('/'); .join('/');
window.location.href = url; window.location.href = url;

View File

@ -50,10 +50,10 @@ define(
} }
CreateActionProvider.prototype.getActions = function (actionContext) { CreateActionProvider.prototype.getActions = function (actionContext) {
var context = actionContext || {}, var context = actionContext || {};
key = context.key, var key = context.key;
destination = context.domainObject, var destination = context.domainObject;
self = this; var self = this;
// We only provide Create actions, and we need a // We only provide Create actions, and we need a
// domain object to serve as the container for the // domain object to serve as the container for the

View File

@ -55,8 +55,14 @@ define(
* show in the create dialog * show in the create dialog
*/ */
CreateWizard.prototype.getFormStructure = function (includeLocation) { CreateWizard.prototype.getFormStructure = function (includeLocation) {
<<<<<<< HEAD
var sections = [];
var domainObject = this.domainObject;
var self = this;
=======
var sections = [], var sections = [],
domainObject = this.domainObject; domainObject = this.domainObject;
>>>>>>> parent of e6cd94123... satisfying no-invalid-this rule
function validateLocation(parent) { function validateLocation(parent) {
return parent && this.openmct.composition.checkPolicy(parent.useCapability('adapter'), domainObject.useCapability('adapter')); return parent && this.openmct.composition.checkPolicy(parent.useCapability('adapter'), domainObject.useCapability('adapter'));
@ -107,8 +113,8 @@ define(
* @returns {DomainObject} * @returns {DomainObject}
*/ */
CreateWizard.prototype.populateObjectFromInput = function (formValue) { CreateWizard.prototype.populateObjectFromInput = function (formValue) {
var parent = this.getLocation(formValue), var parent = this.getLocation(formValue);
formModel = this.createModel(formValue); var formModel = this.createModel(formValue);
formModel.location = parent.getId(); formModel.location = parent.getId();
this.domainObject.useCapability("mutation", function () { this.domainObject.useCapability("mutation", function () {
@ -126,10 +132,10 @@ define(
*/ */
CreateWizard.prototype.getInitialFormValue = function () { CreateWizard.prototype.getInitialFormValue = function () {
// Start with initial values for properties // Start with initial values for properties
var model = this.model, var model = this.model;
formValue = this.properties.map(function (property) { var formValue = this.properties.map(function (property) {
return property.getValue(model); return property.getValue(model);
}); });
// Include the createParent // Include the createParent
formValue.createParent = this.parent; formValue.createParent = this.parent;

View File

@ -63,17 +63,17 @@ define(
* object has been created * object has been created
*/ */
CreationService.prototype.createObject = function (model, parent) { CreationService.prototype.createObject = function (model, parent) {
var persistence = parent.getCapability("persistence"), var persistence = parent.getCapability("persistence");
newObject = parent.useCapability("instantiation", model), var newObject = parent.useCapability("instantiation", model);
newObjectPersistence = newObject.getCapability("persistence"), var newObjectPersistence = newObject.getCapability("persistence");
self = this; var self = this;
// Add the newly-created object's id to the parent's // Add the newly-created object's id to the parent's
// composition, so that it will subsequently appear // composition, so that it will subsequently appear
// as a child contained by that parent. // as a child contained by that parent.
function addToComposition() { function addToComposition() {
var compositionCapability = parent.getCapability('composition'), var compositionCapability = parent.getCapability('composition');
addResult = compositionCapability && var addResult = compositionCapability &&
compositionCapability.add(newObject); compositionCapability.add(newObject);
return self.$q.when(addResult).then(function (result) { return self.$q.when(addResult).then(function (result) {

View File

@ -39,8 +39,8 @@ define(
// used for bi-directional object selection. // used for bi-directional object selection.
function setLocatingObject(domainObject, priorObject) { function setLocatingObject(domainObject, priorObject) {
var context = domainObject && var context = domainObject &&
domainObject.getCapability("context"), domainObject.getCapability("context");
contextRoot = context && context.getRoot(); var contextRoot = context && context.getRoot();
if (contextRoot && contextRoot !== $scope.rootObject) { if (contextRoot && contextRoot !== $scope.rootObject) {
$scope.rootObject = undefined; $scope.rootObject = undefined;

View File

@ -58,9 +58,9 @@ define(
* @param {String} message a message to log with the commit message. * @param {String} message a message to log with the commit message.
*/ */
EditRepresenter.prototype.commit = function (message) { EditRepresenter.prototype.commit = function (message) {
var model = this.$scope.model, var model = this.$scope.model;
configuration = this.$scope.configuration, var configuration = this.$scope.configuration;
domainObject = this.domainObject; var domainObject = this.domainObject;
this.$log.debug([ this.$log.debug([
"Committing ", "Committing ",

View File

@ -25,12 +25,12 @@ define(
function (CancelAction) { function (CancelAction) {
describe("The Cancel action", function () { describe("The Cancel action", function () {
var mockDomainObject, var mockDomainObject;
mockParentObject, var mockParentObject;
capabilities = {}, var capabilities = {};
parentCapabilities = {}, var parentCapabilities = {};
actionContext, var actionContext;
action; var action;
function mockPromise(value) { function mockPromise(value) {
return { return {

View File

@ -25,15 +25,15 @@ define(
function (EditAction) { function (EditAction) {
describe("The Edit action", function () { describe("The Edit action", function () {
var mockLocation, var mockLocation;
mockNavigationService, var mockNavigationService;
mockLog, var mockLog;
mockDomainObject, var mockDomainObject;
mockType, var mockType;
mockEditor, var mockEditor;
actionContext, var actionContext;
capabilities, var capabilities;
action; var action;
beforeEach(function () { beforeEach(function () {
mockLocation = jasmine.createSpyObj( mockLocation = jasmine.createSpyObj(

View File

@ -25,17 +25,17 @@ define(
function (EditAndComposeAction) { function (EditAndComposeAction) {
describe("The Link action", function () { describe("The Link action", function () {
var mockDomainObject, var mockDomainObject;
mockParent, var mockParent;
mockContext, var mockContext;
mockComposition, var mockComposition;
mockActionCapability, var mockActionCapability;
mockEditAction, var mockEditAction;
mockType, var mockType;
actionContext, var actionContext;
model, var model;
capabilities, var capabilities;
action; var action;
function mockPromise(value) { function mockPromise(value) {
return { return {

View File

@ -25,7 +25,13 @@ define(
function (PropertiesAction) { function (PropertiesAction) {
describe("Properties action", function () { describe("Properties action", function () {
var capabilities, model, object, context, input, dialogService, action; var capabilities;
var model;
var object;
var context;
var input;
var dialogService;
var action;
function mockPromise(value) { function mockPromise(value) {
return { return {

View File

@ -26,7 +26,10 @@ define(
describe("Properties dialog", function () { describe("Properties dialog", function () {
var type, properties, model, dialog; var type;
var properties;
var model;
var dialog;
beforeEach(function () { beforeEach(function () {
type = { type = {

View File

@ -26,14 +26,14 @@ define(
function (SaveAction) { function (SaveAction) {
describe("The Save action", function () { describe("The Save action", function () {
var mockDomainObject, var mockDomainObject;
mockEditorCapability, var mockEditorCapability;
actionContext, var actionContext;
mockDialogService, var mockDialogService;
mockNotificationService, var mockNotificationService;
mockActionCapability, var mockActionCapability;
capabilities = {}, var capabilities = {};
action; var action;
function mockPromise(value) { function mockPromise(value) {
return { return {

View File

@ -32,14 +32,14 @@ define(
// depends on is not mocked, so we mock some // depends on is not mocked, so we mock some
// of SaveAction's own dependencies to make // of SaveAction's own dependencies to make
// it run. // it run.
var mockDomainObject, var mockDomainObject;
mockEditorCapability, var mockEditorCapability;
actionContext, var actionContext;
dialogService, var dialogService;
notificationService, var notificationService;
mockActionCapability, var mockActionCapability;
capabilities = {}, var capabilities = {};
action; var action;
function mockPromise(value) { function mockPromise(value) {
return { return {

View File

@ -26,18 +26,18 @@ define(
function (SaveAsAction) { function (SaveAsAction) {
xdescribe("The Save As action", function () { xdescribe("The Save As action", function () {
var mockDomainObject, var mockDomainObject;
mockClonedObject, var mockClonedObject;
mockEditorCapability, var mockEditorCapability;
mockActionCapability, var mockActionCapability;
mockObjectService, var mockObjectService;
mockDialogService, var mockDialogService;
mockCopyService, var mockCopyService;
mockNotificationService, var mockNotificationService;
mockParent, var mockParent;
actionContext, var actionContext;
capabilities = {}, var capabilities = {};
action; var action;
function noop() {} function noop() {}

View File

@ -25,14 +25,14 @@ define(
function (EditorCapability) { function (EditorCapability) {
xdescribe("The editor capability", function () { xdescribe("The editor capability", function () {
var mockDomainObject, var mockDomainObject;
capabilities, var capabilities;
mockParentObject, var mockParentObject;
mockTransactionService, var mockTransactionService;
mockStatusCapability, var mockStatusCapability;
mockParentStatus, var mockParentStatus;
mockContextCapability, var mockContextCapability;
capability; var capability;
function fastPromise(val) { function fastPromise(val) {
return { return {

View File

@ -28,10 +28,10 @@ define(
function (TransactionalPersistenceCapability, TransactionCapabilityDecorator) { function (TransactionalPersistenceCapability, TransactionCapabilityDecorator) {
describe("The transaction capability decorator", function () { describe("The transaction capability decorator", function () {
var mockQ, var mockQ;
mockTransactionService, var mockTransactionService;
mockCapabilityService, var mockCapabilityService;
provider; var provider;
beforeEach(function () { beforeEach(function () {
mockQ = {}; mockQ = {};

View File

@ -36,12 +36,12 @@ define(
} }
describe("The transactional persistence decorator", function () { describe("The transactional persistence decorator", function () {
var mockQ, var mockQ;
mockTransactionManager, var mockTransactionManager;
mockPersistence, var mockPersistence;
mockDomainObject, var mockDomainObject;
testId, var testId;
capability; var capability;
beforeEach(function () { beforeEach(function () {
testId = "test-id"; testId = "test-id";

View File

@ -48,9 +48,9 @@ define(
} }
} }
var mockScope, var mockScope;
mockActions, var mockActions;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockActions = jasmine.createSpyObj("action", ["getActions"]); mockActions = jasmine.createSpyObj("action", ["getActions"]);

View File

@ -25,16 +25,16 @@ define(
function (EditObjectController) { function (EditObjectController) {
describe("The Edit Object controller", function () { describe("The Edit Object controller", function () {
var mockScope, var mockScope;
mockObject, var mockObject;
testViews, var testViews;
mockEditorCapability, var mockEditorCapability;
mockLocation, var mockLocation;
mockNavigationService, var mockNavigationService;
removeCheck, var removeCheck;
mockStatusCapability, var mockStatusCapability;
mockCapabilities, var mockCapabilities;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(

View File

@ -25,10 +25,10 @@ define(
function (EditPanesController) { function (EditPanesController) {
describe("The Edit Panes controller", function () { describe("The Edit Panes controller", function () {
var mockScope, var mockScope;
mockDomainObject, var mockDomainObject;
mockContext, var mockContext;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", ["$watch"]); mockScope = jasmine.createSpyObj("$scope", ["$watch"]);

View File

@ -28,12 +28,12 @@ define(
function (CreateActionProvider) { function (CreateActionProvider) {
describe("The create action provider", function () { describe("The create action provider", function () {
var mockTypeService, var mockTypeService;
mockPolicyService, var mockPolicyService;
mockCreationPolicy, var mockCreationPolicy;
mockPolicyMap = {}, var mockPolicyMap = {};
mockTypes, var mockTypes;
provider; var provider;
function createMockType(name) { function createMockType(name) {
var mockType = jasmine.createSpyObj( var mockType = jasmine.createSpyObj(

View File

@ -28,13 +28,13 @@ define(
function (CreateAction) { function (CreateAction) {
xdescribe("The create action", function () { xdescribe("The create action", function () {
var mockType, var mockType;
mockParent, var mockParent;
mockContext, var mockContext;
mockDomainObject, var mockDomainObject;
capabilities = {}, var capabilities = {};
mockEditAction, var mockEditAction;
action; var action;
function mockPromise(value) { function mockPromise(value) {
return { return {

View File

@ -28,9 +28,9 @@ define(
function (CreateMenuController) { function (CreateMenuController) {
describe("The create menu controller", function () { describe("The create menu controller", function () {
var mockScope, var mockScope;
mockActions, var mockActions;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockActions = jasmine.createSpyObj("action", ["getActions"]); mockActions = jasmine.createSpyObj("action", ["getActions"]);

View File

@ -28,6 +28,15 @@ define(
function (CreateWizard) { function (CreateWizard) {
xdescribe("The create wizard", function () { xdescribe("The create wizard", function () {
<<<<<<< HEAD
var mockType;
var mockParent;
var mockProperties;
var mockPolicyService;
var testModel;
var mockDomainObject;
var wizard;
=======
var mockType, var mockType,
mockParent, mockParent,
mockProperties, mockProperties,
@ -35,6 +44,7 @@ define(
testModel, testModel,
mockDomainObject, mockDomainObject,
wizard; wizard;
>>>>>>> parent of e6cd94123... satisfying no-invalid-this rule
function createMockProperty(name) { function createMockProperty(name) {
var mockProperty = jasmine.createSpyObj( var mockProperty = jasmine.createSpyObj(
@ -142,11 +152,11 @@ define(
it("populates the model on the associated object", function () { it("populates the model on the associated object", function () {
var formValue = { var formValue = {
"A": "ValueA", "A": "ValueA",
"B": "ValueB", "B": "ValueB",
"C": "ValueC" "C": "ValueC"
}, };
compareModel = wizard.createModel(formValue); var compareModel = wizard.createModel(formValue);
//populateObjectFromInput adds a .location attribute that is not added by createModel. //populateObjectFromInput adds a .location attribute that is not added by createModel.
compareModel.location = undefined; compareModel.location = undefined;
wizard.populateObjectFromInput(formValue); wizard.populateObjectFromInput(formValue);
@ -156,19 +166,19 @@ define(
it("validates selection types using policy", function () { it("validates selection types using policy", function () {
var mockDomainObj = jasmine.createSpyObj( var mockDomainObj = jasmine.createSpyObj(
'domainObject', 'domainObject',
['getCapability'] ['getCapability']
), );
mockOtherType = jasmine.createSpyObj( var mockOtherType = jasmine.createSpyObj(
'otherType', 'otherType',
['getKey'] ['getKey']
), );
//Create a form structure with location //Create a form structure with location
structure = wizard.getFormStructure(true), var structure = wizard.getFormStructure(true);
sections = structure.sections, var sections = structure.sections;
rows = structure.sections[sections.length - 1].rows, var rows = structure.sections[sections.length - 1].rows;
locationRow = rows[rows.length - 1]; var locationRow = rows[rows.length - 1];
mockDomainObj.getCapability.and.returnValue(mockOtherType); mockDomainObj.getCapability.and.returnValue(mockOtherType);
locationRow.validate(mockDomainObj); locationRow.validate(mockDomainObj);

View File

@ -25,8 +25,8 @@ define(
function (CreationPolicy) { function (CreationPolicy) {
describe("The creation policy", function () { describe("The creation policy", function () {
var mockType, var mockType;
policy; var policy;
beforeEach(function () { beforeEach(function () {
mockType = jasmine.createSpyObj( mockType = jasmine.createSpyObj(

View File

@ -28,18 +28,18 @@ define(
function (CreationService) { function (CreationService) {
describe("The creation service", function () { describe("The creation service", function () {
var mockQ, var mockQ;
mockLog, var mockLog;
mockParentObject, var mockParentObject;
mockNewObject, var mockNewObject;
mockMutationCapability, var mockMutationCapability;
mockPersistenceCapability, var mockPersistenceCapability;
mockCompositionCapability, var mockCompositionCapability;
mockContextCapability, var mockContextCapability;
mockCreationCapability, var mockCreationCapability;
mockCapabilities, var mockCapabilities;
mockNewPersistenceCapability, var mockNewPersistenceCapability;
creationService; var creationService;
function mockPromise(value) { function mockPromise(value) {
return (value && value.then) ? value : { return (value && value.then) ? value : {
@ -157,10 +157,10 @@ define(
it("provides the newly-created object", function () { it("provides the newly-created object", function () {
var mockDomainObject = jasmine.createSpyObj( var mockDomainObject = jasmine.createSpyObj(
'newDomainObject', 'newDomainObject',
['getId', 'getModel', 'getCapability'] ['getId', 'getModel', 'getCapability']
), );
mockCallback = jasmine.createSpy('callback'); var mockCallback = jasmine.createSpy('callback');
// Act as if the object had been created // Act as if the object had been created
mockCompositionCapability.add.and.callFake(function (id) { mockCompositionCapability.add.and.callFake(function (id) {
@ -180,8 +180,8 @@ define(
it("warns if parent has no persistence capability", function () { it("warns if parent has no persistence capability", function () {
// Callbacks // Callbacks
var success = jasmine.createSpy("success"), var success = jasmine.createSpy("success");
failure = jasmine.createSpy("failure"); var failure = jasmine.createSpy("failure");
mockCapabilities.persistence = undefined; mockCapabilities.persistence = undefined;
creationService.createObject({}, mockParentObject).then( creationService.createObject({}, mockParentObject).then(

View File

@ -28,14 +28,14 @@ define(
function (LocatorController) { function (LocatorController) {
describe("The locator controller", function () { describe("The locator controller", function () {
var mockScope, var mockScope;
mockTimeout, var mockTimeout;
mockDomainObject, var mockDomainObject;
mockRootObject, var mockRootObject;
mockContext, var mockContext;
mockObjectService, var mockObjectService;
getObjectsPromise, var getObjectsPromise;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(

View File

@ -25,14 +25,14 @@ define(
function (EditPersistableObjectsPolicy) { function (EditPersistableObjectsPolicy) {
describe("The Edit persistable objects policy", function () { describe("The Edit persistable objects policy", function () {
var mockDomainObject, var mockDomainObject;
mockEditAction, var mockEditAction;
mockPropertiesAction, var mockPropertiesAction;
mockOtherAction, var mockOtherAction;
mockAPI, var mockAPI;
mockObjectAPI, var mockObjectAPI;
testContext, var testContext;
policy; var policy;
beforeEach(function () { beforeEach(function () {
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(

View File

@ -26,9 +26,9 @@ define([
EditRepresenter EditRepresenter
) { ) {
describe('EditRepresenter', function () { describe('EditRepresenter', function () {
var $log, var $log;
$scope, var $scope;
representer; var representer;
beforeEach(function () { beforeEach(function () {
@ -42,8 +42,8 @@ define([
}); });
describe('representation', function () { describe('representation', function () {
var domainObject, var domainObject;
representation; var representation;
beforeEach(function () { beforeEach(function () {
domainObject = jasmine.createSpyObj('domainObject', [ domainObject = jasmine.createSpyObj('domainObject', [

View File

@ -25,8 +25,8 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) {
var TRANSACTION_METHODS = ['add', 'commit', 'cancel', 'size']; var TRANSACTION_METHODS = ['add', 'commit', 'cancel', 'size'];
describe("A NestedTransaction", function () { describe("A NestedTransaction", function () {
var mockTransaction, var mockTransaction;
nestedTransaction; var nestedTransaction;
beforeEach(function () { beforeEach(function () {
mockTransaction = mockTransaction =
@ -42,8 +42,8 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) {
}); });
describe("when callbacks are added", function () { describe("when callbacks are added", function () {
var mockCommit, var mockCommit;
mockCancel; var mockCancel;
beforeEach(function () { beforeEach(function () {
mockCommit = jasmine.createSpy('commit'); mockCommit = jasmine.createSpy('commit');

View File

@ -25,13 +25,13 @@ define(
["../../src/services/TransactionManager"], ["../../src/services/TransactionManager"],
function (TransactionManager) { function (TransactionManager) {
describe("TransactionManager", function () { describe("TransactionManager", function () {
var mockTransactionService, var mockTransactionService;
testId, var testId;
mockOnCommit, var mockOnCommit;
mockOnCancel, var mockOnCancel;
mockRemoves, var mockRemoves;
mockPromise, var mockPromise;
manager; var manager;
beforeEach(function () { beforeEach(function () {
mockRemoves = []; mockRemoves = [];

View File

@ -26,9 +26,9 @@ define(
function (TransactionService) { function (TransactionService) {
describe("The Transaction Service", function () { describe("The Transaction Service", function () {
var mockQ, var mockQ;
mockLog, var mockLog;
transactionService; var transactionService;
function fastPromise(val) { function fastPromise(val) {
return { return {
@ -52,8 +52,8 @@ define(
}); });
it("addToTransaction queues onCommit and onCancel functions", function () { it("addToTransaction queues onCommit and onCancel functions", function () {
var onCommit = jasmine.createSpy('onCommit'), var onCommit = jasmine.createSpy('onCommit');
onCancel = jasmine.createSpy('onCancel'); var onCancel = jasmine.createSpy('onCancel');
transactionService.startTransaction(); transactionService.startTransaction();
transactionService.addToTransaction(onCommit, onCancel); transactionService.addToTransaction(onCommit, onCancel);
@ -61,8 +61,8 @@ define(
}); });
it("size function returns size of commit and cancel queues", function () { it("size function returns size of commit and cancel queues", function () {
var onCommit = jasmine.createSpy('onCommit'), var onCommit = jasmine.createSpy('onCommit');
onCancel = jasmine.createSpy('onCancel'); var onCancel = jasmine.createSpy('onCancel');
transactionService.startTransaction(); transactionService.startTransaction();
transactionService.addToTransaction(onCommit, onCancel); transactionService.addToTransaction(onCommit, onCancel);

View File

@ -26,8 +26,8 @@ define(
function (Transaction) { function (Transaction) {
describe("A Transaction", function () { describe("A Transaction", function () {
var mockLog, var mockLog;
transaction; var transaction;
beforeEach(function () { beforeEach(function () {
mockLog = jasmine.createSpyObj( mockLog = jasmine.createSpyObj(
@ -42,9 +42,9 @@ define(
}); });
describe("when callbacks are added", function () { describe("when callbacks are added", function () {
var mockCommit, var mockCommit;
mockCancel, var mockCancel;
remove; var remove;
beforeEach(function () { beforeEach(function () {
mockCommit = jasmine.createSpy('commit'); mockCommit = jasmine.createSpy('commit');

View File

@ -26,10 +26,10 @@ define([
moment moment
) { ) {
var DATE_FORMAT = "HH:mm:ss", var DATE_FORMAT = "HH:mm:ss";
DATE_FORMATS = [ var DATE_FORMATS = [
DATE_FORMAT DATE_FORMAT
]; ];
/** /**

View File

@ -26,14 +26,14 @@ define([
moment moment
) { ) {
var DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS", var DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS";
DATE_FORMATS = [ var DATE_FORMATS = [
DATE_FORMAT, DATE_FORMAT,
DATE_FORMAT + "Z", DATE_FORMAT + "Z",
"YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm:ss",
"YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm",
"YYYY-MM-DD" "YYYY-MM-DD"
]; ];
/** /**
* @typedef Scale * @typedef Scale

View File

@ -27,9 +27,9 @@ define(
var KEYS = ['a', 'b', 'c']; var KEYS = ['a', 'b', 'c'];
describe("The FormatProvider", function () { describe("The FormatProvider", function () {
var mockFormats, var mockFormats;
mockFormatInstances, var mockFormatInstances;
provider; var provider;
beforeEach(function () { beforeEach(function () {
mockFormatInstances = KEYS.map(function (k) { mockFormatInstances = KEYS.map(function (k) {

View File

@ -41,19 +41,19 @@ define(
* stylesheets will be found * stylesheets will be found
*/ */
function StyleSheetLoader(stylesheets, $document, activeTheme, assetPath) { function StyleSheetLoader(stylesheets, $document, activeTheme, assetPath) {
var head = $document.find('head'), var head = $document.find('head');
document = $document[0]; var document = $document[0];
// Procedure for adding a single stylesheet // Procedure for adding a single stylesheet
function addStyleSheet(stylesheet) { function addStyleSheet(stylesheet) {
// Create a link element, and construct full path // Create a link element, and construct full path
var link = document.createElement('link'), var link = document.createElement('link');
path = [ var path = [
assetPath, assetPath,
stylesheet.bundle.path, stylesheet.bundle.path,
stylesheet.bundle.resources, stylesheet.bundle.resources,
stylesheet.stylesheetUrl stylesheet.stylesheetUrl
].join("/"); ].join("/");
// Initialize attributes on the link // Initialize attributes on the link
link.setAttribute("rel", "stylesheet"); link.setAttribute("rel", "stylesheet");

View File

@ -48,12 +48,12 @@ define(
// Separate out the actions that have been retrieved // Separate out the actions that have been retrieved
// into groups, and populate scope with this. // into groups, and populate scope with this.
function groupActions(actions) { function groupActions(actions) {
var groups = {}, var groups = {};
ungrouped = []; var ungrouped = [];
function assignToGroup(action) { function assignToGroup(action) {
var metadata = action.getMetadata(), var metadata = action.getMetadata();
group = metadata.group; var group = metadata.group;
if (group) { if (group) {
groups[group] = groups[group] || []; groups[group] = groups[group] || [];
groups[group].push(action); groups[group].push(action);
@ -73,9 +73,9 @@ define(
// Callback for when state which might influence action groupings // Callback for when state which might influence action groupings
// changes. // changes.
function updateGroups() { function updateGroups() {
var actionCapability = $scope.action, var actionCapability = $scope.action;
params = $scope.parameters || {}, var params = $scope.parameters || {};
category = params.category; var category = params.category;
if (actionCapability && category) { if (actionCapability && category) {
// Get actions by capability, and group them // Get actions by capability, and group them

View File

@ -25,22 +25,22 @@ define(
function (moment) { function (moment) {
var TIME_NAMES = { var TIME_NAMES = {
'hours': "Hour", 'hours': "Hour",
'minutes': "Minute", 'minutes': "Minute",
'seconds': "Second" 'seconds': "Second"
}, };
MONTHS = moment.months(), var MONTHS = moment.months();
TIME_OPTIONS = (function makeRanges() { var TIME_OPTIONS = (function makeRanges() {
var arr = []; var arr = [];
while (arr.length < 60) { while (arr.length < 60) {
arr.push(arr.length); arr.push(arr.length);
} }
return { return {
hours: arr.slice(0, 24), hours: arr.slice(0, 24),
minutes: arr, minutes: arr,
seconds: arr seconds: arr
}; };
}()); }());
/** /**
* Controller to support the date-time picker. * Controller to support the date-time picker.
@ -65,15 +65,15 @@ define(
* Months are zero-indexed, day-of-months are one-indexed. * Months are zero-indexed, day-of-months are one-indexed.
*/ */
function DateTimePickerController($scope, now) { function DateTimePickerController($scope, now) {
var year, var year;
month, // For picker state, not model state var month; // For picker state, not model state
interacted = false; var interacted = false;
function generateTable() { function generateTable() {
var m = moment.utc({ year: year, month: month }).day(0), var m = moment.utc({ year: year, month: month }).day(0);
table = [], var table = [];
row, var row;
col; var col;
for (row = 0; row < 6; row += 1) { for (row = 0; row < 6; row += 1) {
table.push([]); table.push([]);

View File

@ -40,9 +40,9 @@ define(
// Gets an array of the contextual parents/ancestors of the selected object // Gets an array of the contextual parents/ancestors of the selected object
function getContextualPath() { function getContextualPath() {
var currentObj = $scope.domainObject, var currentObj = $scope.domainObject;
currentParent, var currentParent;
parents = []; var parents = [];
currentParent = currentObj && currentParent = currentObj &&
currentObj.hasCapability('context') && currentObj.hasCapability('context') &&

View File

@ -35,10 +35,10 @@ define(
* @param $scope Angular scope for this controller * @param $scope Angular scope for this controller
*/ */
function SelectorController(objectService, $scope) { function SelectorController(objectService, $scope) {
var treeModel = {}, var treeModel = {};
listModel = {}, var listModel = {};
previousSelected, var previousSelected;
self = this; var self = this;
// For watch; look at the user's selection in the tree // For watch; look at the user's selection in the tree
function getTreeSelection() { function getTreeSelection() {
@ -126,8 +126,8 @@ define(
* @param {DomainObject} the domain object to select * @param {DomainObject} the domain object to select
*/ */
SelectorController.prototype.select = function (domainObject) { SelectorController.prototype.select = function (domainObject) {
var id = domainObject && domainObject.getId(), var id = domainObject && domainObject.getId();
list = this.getField() || []; var list = this.getField() || [];
// Only select if we have a valid id, // Only select if we have a valid id,
// and it isn't already selected // and it isn't already selected
if (id && list.indexOf(id) === -1) { if (id && list.indexOf(id) === -1) {
@ -140,8 +140,8 @@ define(
* @param {DomainObject} the domain object to select * @param {DomainObject} the domain object to select
*/ */
SelectorController.prototype.deselect = function (domainObject) { SelectorController.prototype.deselect = function (domainObject) {
var id = domainObject && domainObject.getId(), var id = domainObject && domainObject.getId();
list = this.getField() || []; var list = this.getField() || [];
// Only change if this was a valid id, // Only change if this was a valid id,
// for an object which was already selected // for an object which was already selected
if (id && list.indexOf(id) !== -1) { if (id && list.indexOf(id) !== -1) {

View File

@ -101,7 +101,12 @@ define([
}; };
TimeRangeController.prototype.updateTicks = function () { TimeRangeController.prototype.updateTicks = function () {
var i, p, ts, start, end, span; var i;
var p;
var ts;
var start;
var end;
var span;
end = this.$scope.ngModel.outer.end; end = this.$scope.ngModel.outer.end;
start = this.$scope.ngModel.outer.start; start = this.$scope.ngModel.outer.start;
span = end - start; span = end - start;
@ -197,9 +202,9 @@ define([
}; };
TimeRangeController.prototype.middleDrag = function (pixels) { TimeRangeController.prototype.middleDrag = function (pixels) {
var delta = this.toMillis(pixels), var delta = this.toMillis(pixels);
edge = delta < 0 ? 'start' : 'end', var edge = delta < 0 ? 'start' : 'end';
opposite = delta < 0 ? 'end' : 'start'; var opposite = delta < 0 ? 'end' : 'start';
// Adjust the position of the edge in the direction of drag // Adjust the position of the edge in the direction of drag
this.$scope.ngModel.inner[edge] = clamp( this.$scope.ngModel.inner[edge] = clamp(

View File

@ -59,8 +59,8 @@ define(
* @constructor * @constructor
*/ */
function TreeNodeController($scope, $timeout) { function TreeNodeController($scope, $timeout) {
var self = this, var self = this;
selectedObject = ($scope.ngModel || {}).selectedObject; var selectedObject = ($scope.ngModel || {}).selectedObject;
// Look up the id for a domain object. A convenience // Look up the id for a domain object. A convenience
// for mapping; additionally does some undefined-checking. // for mapping; additionally does some undefined-checking.
@ -86,14 +86,14 @@ define(
// Consider the currently-navigated object and update // Consider the currently-navigated object and update
// parameters which support display. // parameters which support display.
function checkSelection() { function checkSelection() {
var nodeObject = $scope.domainObject, var nodeObject = $scope.domainObject;
navObject = selectedObject, var navObject = selectedObject;
nodeContext = nodeObject && var nodeContext = nodeObject &&
nodeObject.getCapability('context'), nodeObject.getCapability('context');
navContext = navObject && var navContext = navObject &&
navObject.getCapability('context'), navObject.getCapability('context');
nodePath, var nodePath;
navPath; var navPath;
// Deselect; we will reselect below, iff we are // Deselect; we will reselect below, iff we are
// exactly at the end of the path. // exactly at the end of the path.

View File

@ -42,13 +42,13 @@ define(
var body = $document.find('body'); var body = $document.find('body');
function clickBody(event) { function clickBody(event) {
var x = event.clientX, var x = event.clientX;
y = event.clientY, var y = event.clientY;
rect = element[0].getBoundingClientRect(), var rect = element[0].getBoundingClientRect();
xMin = rect.left, var xMin = rect.left;
xMax = xMin + rect.width, var xMax = xMin + rect.width;
yMin = rect.top, var yMin = rect.top;
yMax = yMin + rect.height; var yMax = yMin + rect.height;
if (x < xMin || x > xMax || y < yMin || y > yMax) { if (x < xMin || x > xMax || y < yMin || y > yMax) {
scope.$apply(function () { scope.$apply(function () {

View File

@ -62,10 +62,10 @@ define(
// Populate initial scope based on attributes requested // Populate initial scope based on attributes requested
// by the container definition // by the container definition
link: function (scope, element, attrs) { link: function (scope, element, attrs) {
var key = attrs.key, var key = attrs.key;
container = containerMap[key], var container = containerMap[key];
alias = "container", var alias = "container";
copiedAttributes = {}; var copiedAttributes = {};
if (container) { if (container) {
alias = container.alias || alias; alias = container.alias || alias;
@ -78,8 +78,8 @@ define(
}, },
template: function (element, attrs) { template: function (element, attrs) {
var key = attrs.key, var key = attrs.key;
container = containerMap[key]; var container = containerMap[key];
return container ? container.template : ""; return container ? container.template : "";
} }
}; };

View File

@ -54,12 +54,12 @@ define(
// mouse event handlers; mousedown and mouseup cannot // mouse event handlers; mousedown and mouseup cannot
// only be attached to the element being linked, as the // only be attached to the element being linked, as the
// mouse may leave this element during the drag. // mouse may leave this element during the drag.
var body = $document.find('body'), var body = $document.find('body');
isMobile = agentService.isMobile(), var isMobile = agentService.isMobile();
touchEvents, var touchEvents;
initialPosition, var initialPosition;
$event, var $event;
delta; var delta;
if (isMobile) { if (isMobile) {
touchEvents = { touchEvents = {

View File

@ -44,10 +44,10 @@ define(
*/ */
function MCTPopup($compile, popupService) { function MCTPopup($compile, popupService) {
function link(scope, element, attrs, ctrl, transclude) { function link(scope, element, attrs, ctrl, transclude) {
var div = $compile(TEMPLATE)(scope), var div = $compile(TEMPLATE)(scope);
rect = element.parent()[0].getBoundingClientRect(), var rect = element.parent()[0].getBoundingClientRect();
position = [rect.left, rect.top], var position = [rect.left, rect.top];
popup = popupService.display(div, position); var popup = popupService.display(div, position);
div.addClass('t-popup'); div.addClass('t-popup');
transclude(function (clone) { transclude(function (clone) {

View File

@ -55,9 +55,9 @@ define(
// Link; start listening for changes to an element's size // Link; start listening for changes to an element's size
function link(scope, element, attrs) { function link(scope, element, attrs) {
var lastBounds, var lastBounds;
linking = true, var linking = true;
active = true; var active = true;
// Determine how long to wait before the next update // Determine how long to wait before the next update
function currentInterval() { function currentInterval() {

View File

@ -44,8 +44,8 @@ define(
*/ */
function MCTScroll($parse, property, attribute) { function MCTScroll($parse, property, attribute) {
function link(scope, element, attrs) { function link(scope, element, attrs) {
var expr = attrs[attribute], var expr = attrs[attribute];
parsed = $parse(expr); var parsed = $parse(expr);
// Set the element's scroll to match the scope's state // Set the element's scroll to match the scope's state
function updateElement(value) { function updateElement(value) {

View File

@ -25,47 +25,47 @@ define(
function () { function () {
// Pixel width to allocate for the splitter itself // Pixel width to allocate for the splitter itself
var DEFAULT_ANCHOR = 'left', var DEFAULT_ANCHOR = 'left';
POLLING_INTERVAL = 15, // milliseconds var POLLING_INTERVAL = 15; // milliseconds
CHILDREN_WARNING_MESSAGE = [ var CHILDREN_WARNING_MESSAGE = [
"Invalid mct-split-pane contents.", "Invalid mct-split-pane contents.",
"This element should contain exactly three", "This element should contain exactly three",
"child elements, where the middle-most element", "child elements, where the middle-most element",
"is an mct-splitter." "is an mct-splitter."
].join(" "), ].join(" ");
ANCHOR_WARNING_MESSAGE = [ var ANCHOR_WARNING_MESSAGE = [
"Unknown anchor provided to mct-split-pane,", "Unknown anchor provided to mct-split-pane;",
"defaulting to", "defaulting to",
DEFAULT_ANCHOR + "." DEFAULT_ANCHOR + "."
].join(" "), ].join(" ");
ANCHORS = { var ANCHORS = {
left: { left: {
edge: "left", edge: "left",
opposite: "right", opposite: "right",
dimension: "width", dimension: "width",
orientation: "vertical" orientation: "vertical"
}, },
right: { right: {
edge: "right", edge: "right",
opposite: "left", opposite: "left",
dimension: "width", dimension: "width",
orientation: "vertical", orientation: "vertical",
reversed: true reversed: true
}, },
top: { top: {
edge: "top", edge: "top",
opposite: "bottom", opposite: "bottom",
dimension: "height", dimension: "height",
orientation: "horizontal" orientation: "horizontal"
}, },
bottom: { bottom: {
edge: "bottom", edge: "bottom",
opposite: "top", opposite: "top",
dimension: "height", dimension: "height",
orientation: "horizontal", orientation: "horizontal",
reversed: true reversed: true
} }
}; };
/** /**
* Implements `mct-split-pane` directive. * Implements `mct-split-pane` directive.
@ -95,19 +95,19 @@ define(
*/ */
function MCTSplitPane($parse, $log, $interval, $window) { function MCTSplitPane($parse, $log, $interval, $window) {
function controller($scope, $element, $attrs) { function controller($scope, $element, $attrs) {
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR, var anchorKey = $attrs.anchor || DEFAULT_ANCHOR;
positionParsed = $parse($attrs.position), var positionParsed = $parse($attrs.position);
anchor, var anchor;
activeInterval, var activeInterval;
position, var position;
splitterSize, var splitterSize;
alias = $attrs.alias !== undefined ? var alias = $attrs.alias !== undefined ?
"mctSplitPane-" + $attrs.alias : undefined, "mctSplitPane-" + $attrs.alias : undefined;
//convert string to number from localStorage //convert string to number from localStorage
userWidthPreference = $window.localStorage.getItem(alias) === null ? var userWidthPreference = $window.localStorage.getItem(alias) === null ?
undefined : Number($window.localStorage.getItem(alias)); undefined : Number($window.localStorage.getItem(alias));
// Get relevant size (height or width) of DOM element // Get relevant size (height or width) of DOM element
function getSize(domElement) { function getSize(domElement) {
@ -121,10 +121,10 @@ define(
// Pick out correct elements to update, flowing from // Pick out correct elements to update, flowing from
// selected anchor edge. // selected anchor edge.
var first = children.eq(anchor.reversed ? 2 : 0), var first = children.eq(anchor.reversed ? 2 : 0);
splitter = children.eq(1), var splitter = children.eq(1);
last = children.eq(anchor.reversed ? 0 : 2), var last = children.eq(anchor.reversed ? 0 : 2);
firstSize; var firstSize;
splitterSize = getSize(splitter[0]); splitterSize = getSize(splitter[0]);
first.css(anchor.edge, "0px"); first.css(anchor.edge, "0px");

View File

@ -37,8 +37,8 @@ define(
*/ */
function MCTSplitter() { function MCTSplitter() {
function link(scope, element, attrs, mctSplitPane) { function link(scope, element, attrs, mctSplitPane) {
var initialPosition, var initialPosition;
newPosition; var newPosition;
element.addClass("splitter"); element.addClass("splitter");
@ -50,9 +50,9 @@ define(
}, },
// Handle user changes to splitter position // Handle user changes to splitter position
move: function (delta) { move: function (delta) {
var anchor = mctSplitPane.anchor(), var anchor = mctSplitPane.anchor();
index = anchor.orientation === "vertical" ? 0 : 1, var index = anchor.orientation === "vertical" ? 0 : 1;
pixelDelta = delta[index] * var pixelDelta = delta[index] *
(anchor.reversed ? -1 : 1); (anchor.reversed ? -1 : 1);
// Update the position of this splitter // Update the position of this splitter

View File

@ -75,13 +75,13 @@ define(
* @returns {platform/commonUI/general.Popup} the popup * @returns {platform/commonUI/general.Popup} the popup
*/ */
PopupService.prototype.display = function (element, position, options) { PopupService.prototype.display = function (element, position, options) {
var $document = this.$document, var $document = this.$document;
$window = this.$window, var $window = this.$window;
body = $document.find('body'), var body = $document.find('body');
winDim = [$window.innerWidth, $window.innerHeight], var winDim = [$window.innerWidth, $window.innerHeight];
styles = { position: 'absolute' }, var styles = { position: 'absolute' };
margin, var margin;
offset; var offset;
function adjustNegatives(value, index) { function adjustNegatives(value, index) {
return value < 0 ? (value + winDim[index]) : value; return value < 0 ? (value + winDim[index]) : value;

View File

@ -48,11 +48,11 @@ define(
*/ */
UrlService.prototype.urlForLocation = function (mode, domainObject) { UrlService.prototype.urlForLocation = function (mode, domainObject) {
var context = domainObject && var context = domainObject &&
domainObject.getCapability('context'), domainObject.getCapability('context');
objectPath = context ? context.getPath() : [], var objectPath = context ? context.getPath() : [];
ids = objectPath.map(function (domainObj) { var ids = objectPath.map(function (domainObj) {
return domainObj.getId(); return domainObj.getId();
}); });
// Parses the path together. Starts with the // Parses the path together. Starts with the
// default index.html file, then the mode passed // default index.html file, then the mode passed
@ -73,15 +73,15 @@ define(
* @returns {string} URL for the domain object * @returns {string} URL for the domain object
*/ */
UrlService.prototype.urlForNewTab = function (mode, domainObject) { UrlService.prototype.urlForNewTab = function (mode, domainObject) {
var search = this.$location.search(), var search = this.$location.search();
arr = []; var arr = [];
for (var key in search) { for (var key in search) {
if (search.hasOwnProperty(key)) { if (search.hasOwnProperty(key)) {
arr.push(key + '=' + search[key]); arr.push(key + '=' + search[key]);
} }
} }
var searchPath = "?" + arr.join('&'), var searchPath = "?" + arr.join('&');
newTabPath = var newTabPath =
"#" + this.urlForLocation(mode, domainObject) + "#" + this.urlForLocation(mode, domainObject) +
searchPath; searchPath;
return newTabPath; return newTabPath;

View File

@ -47,8 +47,8 @@ define([
} }
TreeLabelView.prototype.updateView = function (domainObject) { TreeLabelView.prototype.updateView = function (domainObject) {
var titleEl = this.el.find('.t-title-label'), var titleEl = this.el.find('.t-title-label');
iconEl = this.el.find('.t-item-icon'); var iconEl = this.el.find('.t-item-icon');
removePreviousIconClass(iconEl); removePreviousIconClass(iconEl);

View File

@ -116,8 +116,8 @@ define([
} }
TreeNodeView.prototype.value = function (domainObject) { TreeNodeView.prototype.value = function (domainObject) {
var activeIdPath = getIdPath(this.activeObject), var activeIdPath = getIdPath(this.activeObject);
selectedIdPath = getIdPath(domainObject); var selectedIdPath = getIdPath(domainObject);
if (this.onSelectionPath) { if (this.onSelectionPath) {
this.li.find('.js-tree__item').eq(0).removeClass('is-selected'); this.li.find('.js-tree__item').eq(0).removeClass('is-selected');

View File

@ -61,8 +61,8 @@ define([
}; };
TreeView.prototype.loadComposition = function () { TreeView.prototype.loadComposition = function () {
var self = this, var self = this;
domainObject = this.activeObject; var domainObject = this.activeObject;
function addNode(domainObj, index) { function addNode(domainObj, index) {
self.nodeViews[index].model(domainObj); self.nodeViews[index].model(domainObj);

View File

@ -25,8 +25,8 @@ define([
], function (SplashScreenManager) { ], function (SplashScreenManager) {
describe('SplashScreenManager', function () { describe('SplashScreenManager', function () {
var $document, var $document;
splashElement; var splashElement;
beforeEach(function () { beforeEach(function () {
$document = jasmine.createSpyObj( $document = jasmine.createSpyObj(

View File

@ -25,13 +25,13 @@ define(
function (StyleSheetLoader) { function (StyleSheetLoader) {
describe("The style sheet loader", function () { describe("The style sheet loader", function () {
var testStyleSheets, var testStyleSheets;
mockDocument, var mockDocument;
mockPlainDocument, var mockPlainDocument;
mockHead, var mockHead;
mockElement, var mockElement;
testBundle, var testBundle;
loader; // eslint-disable-line var loader; // eslint-disable-line
beforeEach(function () { beforeEach(function () {
testBundle = { testBundle = {

View File

@ -25,9 +25,9 @@ define(
function (ActionGroupController) { function (ActionGroupController) {
describe("The action group controller", function () { describe("The action group controller", function () {
var mockScope, var mockScope;
mockActions, var mockActions;
controller; var controller;
function mockAction(metadata, index) { function mockAction(metadata, index) {
var action = jasmine.createSpyObj( var action = jasmine.createSpyObj(

View File

@ -25,9 +25,9 @@ define(
function (ClickAwayController) { function (ClickAwayController) {
describe("The click-away controller", function () { describe("The click-away controller", function () {
var mockDocument, var mockDocument;
mockTimeout, var mockTimeout;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockDocument = jasmine.createSpyObj( mockDocument = jasmine.createSpyObj(
@ -77,7 +77,8 @@ define(
}); });
it("deactivates and detaches listener on document click", function () { it("deactivates and detaches listener on document click", function () {
var callback, timeout; var callback;
var timeout;
controller.setState(true); controller.setState(true);
callback = mockDocument.on.calls.mostRecent().args[1]; callback = mockDocument.on.calls.mostRecent().args[1];
callback(); callback();

View File

@ -27,10 +27,10 @@ define(
var TEST_FORMAT = "YYYY-MM-DD HH:mm:ss"; var TEST_FORMAT = "YYYY-MM-DD HH:mm:ss";
describe("The DateTimeFieldController", function () { describe("The DateTimeFieldController", function () {
var mockScope, var mockScope;
mockFormatService, var mockFormatService;
mockFormat, var mockFormat;
controller; var controller;
function fireWatch(expr, value) { function fireWatch(expr, value) {
mockScope.$watch.calls.all().forEach(function (call) { mockScope.$watch.calls.all().forEach(function (call) {
@ -124,7 +124,9 @@ define(
}); });
describe("when user input is invalid", function () { describe("when user input is invalid", function () {
var newText, oldText, oldValue; var newText
var oldText;
var oldValue;
beforeEach(function () { beforeEach(function () {
newText = "Not a date"; newText = "Not a date";
@ -156,8 +158,8 @@ define(
// Don't want the controller "fixing" bad or // Don't want the controller "fixing" bad or
// irregularly-formatted input out from under // irregularly-formatted input out from under
// the user's fingertips. // the user's fingertips.
var newText = "2015-3-3 01:02:04", var newText = "2015-3-3 01:02:04";
oldValue = mockScope.ngModel.testField; var oldValue = mockScope.ngModel.testField;
mockFormat.validate.and.returnValue(true); mockFormat.validate.and.returnValue(true);
mockFormat.parse.and.returnValue(42); mockFormat.parse.and.returnValue(42);
@ -183,8 +185,8 @@ define(
}); });
describe("using the obtained format", function () { describe("using the obtained format", function () {
var testValue = 1234321, var testValue = 1234321;
testText = "some text"; var testText = "some text";
beforeEach(function () { beforeEach(function () {
mockFormat.validate.and.returnValue(true); mockFormat.validate.and.returnValue(true);

View File

@ -25,9 +25,9 @@ define(
function (DateTimePickerController, moment) { function (DateTimePickerController, moment) {
describe("The DateTimePickerController", function () { describe("The DateTimePickerController", function () {
var mockScope, var mockScope;
mockNow, var mockNow;
controller; var controller;
function fireWatch(expr, value) { function fireWatch(expr, value) {
mockScope.$watch.calls.all().forEach(function (call) { mockScope.$watch.calls.all().forEach(function (call) {
@ -143,7 +143,8 @@ define(
// Around the edges of the displayed calendar we // Around the edges of the displayed calendar we
// may be in previous or subsequent month, so // may be in previous or subsequent month, so
// test around the middle. // test around the middle.
var i, originalMonth = mockScope.table[2][0].month; var i;
var originalMonth = mockScope.table[2][0].month;
function mod12(month) { function mod12(month) {
return ((month % 12) + 12) % 12; return ((month % 12) + 12) % 12;

View File

@ -25,9 +25,9 @@ define(
function (GetterSetterController) { function (GetterSetterController) {
describe("The getter-setter controller", function () { describe("The getter-setter controller", function () {
var mockScope, var mockScope;
mockModel, var mockModel;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", ["$watch"]); mockScope = jasmine.createSpyObj("$scope", ["$watch"]);

View File

@ -28,13 +28,13 @@ define(
function (ObjectInspectorController) { function (ObjectInspectorController) {
describe("The object inspector controller ", function () { describe("The object inspector controller ", function () {
var mockScope, var mockScope;
mockObjectService, var mockObjectService;
mockPromise, var mockPromise;
mockDomainObject, var mockDomainObject;
mockContextCapability, var mockContextCapability;
mockLocationCapability, var mockLocationCapability;
controller; var controller;
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(

View File

@ -25,12 +25,12 @@ define(
function (SelectorController) { function (SelectorController) {
describe("The controller for the 'selector' control", function () { describe("The controller for the 'selector' control", function () {
var mockObjectService, var mockObjectService;
mockScope, var mockScope;
mockDomainObject, var mockDomainObject;
mockType, var mockType;
mockDomainObjects, var mockDomainObjects;
controller; var controller;
function promiseOf(v) { function promiseOf(v) {
return (v || {}).then ? v : { return (v || {}).then ? v : {

View File

@ -24,19 +24,19 @@ define(
["../../src/controllers/TimeRangeController", "moment"], ["../../src/controllers/TimeRangeController", "moment"],
function (TimeRangeController, moment) { function (TimeRangeController, moment) {
var SEC = 1000, var SEC = 1000;
MIN = 60 * SEC, var MIN = 60 * SEC;
HOUR = 60 * MIN, var HOUR = 60 * MIN;
DAY = 24 * HOUR; var DAY = 24 * HOUR;
describe("The TimeRangeController", function () { describe("The TimeRangeController", function () {
var mockScope, var mockScope;
mockFormatService, var mockFormatService;
testDefaultFormat, var testDefaultFormat;
mockTimeout, var mockTimeout;
mockNow, var mockNow;
mockFormat, var mockFormat;
controller; var controller;
function fireWatch(expr, value) { function fireWatch(expr, value) {
mockScope.$watch.calls.all().forEach(function (call) { mockScope.$watch.calls.all().forEach(function (call) {

View File

@ -25,10 +25,10 @@ define(
function (TreeNodeController) { function (TreeNodeController) {
describe("The tree node controller", function () { describe("The tree node controller", function () {
var mockScope, var mockScope;
mockTimeout, var mockTimeout;
mockDomainObject, var mockDomainObject;
controller; var controller;
function TestObject(id, context) { function TestObject(id, context) {
return { return {
@ -72,10 +72,10 @@ define(
it("tracks whether or not the represented object is currently navigated-to", function () { it("tracks whether or not the represented object is currently navigated-to", function () {
// This is needed to highlight the current selection // This is needed to highlight the current selection
var mockContext = jasmine.createSpyObj( var mockContext = jasmine.createSpyObj(
"context", "context",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
obj = new TestObject("test-object", mockContext); var obj = new TestObject("test-object", mockContext);
mockContext.getPath.and.returnValue([obj]); mockContext.getPath.and.returnValue([obj]);
@ -93,15 +93,15 @@ define(
it("expands a node if it is on the navigation path", function () { it("expands a node if it is on the navigation path", function () {
var mockParentContext = jasmine.createSpyObj( var mockParentContext = jasmine.createSpyObj(
"parentContext", "parentContext",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
mockChildContext = jasmine.createSpyObj( var mockChildContext = jasmine.createSpyObj(
"childContext", "childContext",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
parent = new TestObject("parent", mockParentContext), var parent = new TestObject("parent", mockParentContext);
child = new TestObject("child", mockChildContext); var child = new TestObject("child", mockChildContext);
mockChildContext.getParent.and.returnValue(parent); mockChildContext.getParent.and.returnValue(parent);
mockChildContext.getPath.and.returnValue([parent, child]); mockChildContext.getPath.and.returnValue([parent, child]);
@ -129,15 +129,15 @@ define(
it("does not expand a node if it is not on the navigation path", function () { it("does not expand a node if it is not on the navigation path", function () {
var mockParentContext = jasmine.createSpyObj( var mockParentContext = jasmine.createSpyObj(
"parentContext", "parentContext",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
mockChildContext = jasmine.createSpyObj( var mockChildContext = jasmine.createSpyObj(
"childContext", "childContext",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
parent = new TestObject("parent", mockParentContext), var parent = new TestObject("parent", mockParentContext);
child = new TestObject("child", mockChildContext); var child = new TestObject("child", mockChildContext);
mockChildContext.getParent.and.returnValue(parent); mockChildContext.getParent.and.returnValue(parent);
mockChildContext.getPath.and.returnValue([child, child]); mockChildContext.getPath.and.returnValue([child, child]);
@ -162,15 +162,15 @@ define(
it("does not expand a node if no context is available", function () { it("does not expand a node if no context is available", function () {
var mockParentContext = jasmine.createSpyObj( var mockParentContext = jasmine.createSpyObj(
"parentContext", "parentContext",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
mockChildContext = jasmine.createSpyObj( var mockChildContext = jasmine.createSpyObj(
"childContext", "childContext",
["getParent", "getPath", "getRoot"] ["getParent", "getPath", "getRoot"]
), );
parent = new TestObject("parent", mockParentContext), var parent = new TestObject("parent", mockParentContext);
child = new TestObject("child", undefined); var child = new TestObject("child", undefined);
mockChildContext.getParent.and.returnValue(parent); mockChildContext.getParent.and.returnValue(parent);
mockChildContext.getPath.and.returnValue([parent, child]); mockChildContext.getPath.and.returnValue([parent, child]);

Some files were not shown because too many files have changed in this diff Show More