Compare commits
	
		
			22 Commits
		
	
	
		
			v1.4.0-rc3
			...
			eslint-upd
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 35062b164a | ||
|   | 976d070402 | ||
|   | d2161d692c | ||
|   | aa3aa23b95 | ||
|   | 3fc20995c7 | ||
|   | b378b6e465 | ||
|   | 3a4c205f55 | ||
|   | 5071328c90 | ||
|   | 04c258ccd3 | ||
|   | 6d37adde0e | ||
|   | 25aad22562 | ||
|   | 6e3e7a50d7 | ||
|   | cfcfb31193 | ||
|   | db0d5bd974 | ||
|   | 01407ffbe2 | ||
|   | 26d3fce0c8 | ||
|   | 539e0773f8 | ||
|   | 4d34fad8db | ||
|   | bfea0e89e6 | ||
|   | 8e04a9c550 | ||
|   | e6cd94123c | ||
|   | 1be7927303 | 
| @@ -120,6 +120,8 @@ module.exports = { | ||||
|         "no-useless-computed-key": "error", | ||||
|         // https://eslint.org/docs/rules/rest-spread-spacing | ||||
|         "rest-spread-spacing": ["error"], | ||||
|         // https://eslint.org/docs/rules/one-var | ||||
|         "one-var": ["error", "never"], | ||||
|  | ||||
|         "vue/html-indent": [ | ||||
|             "error", | ||||
|   | ||||
| @@ -35,9 +35,9 @@ define( | ||||
|  | ||||
|         function EventTelemetry(request, interval) { | ||||
|  | ||||
|             var latestObservedTime = Date.now(), | ||||
|                 count = Math.floor((latestObservedTime - firstObservedTime) / interval), | ||||
|                 generatorData = {}; | ||||
|             var latestObservedTime = Date.now(); | ||||
|             var count = Math.floor((latestObservedTime - firstObservedTime) / interval); | ||||
|             var generatorData = {}; | ||||
|  | ||||
|             generatorData.getPointCount = function () { | ||||
|                 return count; | ||||
| @@ -49,8 +49,8 @@ define( | ||||
|             }; | ||||
|  | ||||
|             generatorData.getRangeValue = function (i, range) { | ||||
|                 var domainDelta = this.getDomainValue(i) - firstObservedTime, | ||||
|                     ind = i % messages.length; | ||||
|                 var domainDelta = this.getDomainValue(i) - firstObservedTime; | ||||
|                 var ind = i % messages.length; | ||||
|                 return messages[ind] + " - [" + domainDelta.toString() + "]"; | ||||
|             }; | ||||
|  | ||||
|   | ||||
| @@ -34,9 +34,9 @@ define( | ||||
|          * @constructor | ||||
|          */ | ||||
|         function EventTelemetryProvider($q, $timeout) { | ||||
|             var subscriptions = [], | ||||
|                 genInterval = 1000, | ||||
|                 generating = false; | ||||
|             var subscriptions = []; | ||||
|             var genInterval = 1000; | ||||
|             var generating = false; | ||||
|  | ||||
|             // | ||||
|             function matchesSource(request) { | ||||
|   | ||||
| @@ -40,23 +40,23 @@ define([], function () { | ||||
|     } | ||||
|  | ||||
|     ExportTelemetryAsCSVAction.prototype.perform = function () { | ||||
|         var context = this.context, | ||||
|             domainObject = context.domainObject, | ||||
|             telemetry = domainObject.getCapability("telemetry"), | ||||
|             metadata = telemetry.getMetadata(), | ||||
|             domains = metadata.domains, | ||||
|             ranges = metadata.ranges, | ||||
|             exportService = this.exportService; | ||||
|         var context = this.context; | ||||
|         var domainObject = context.domainObject; | ||||
|         var telemetry = domainObject.getCapability("telemetry"); | ||||
|         var metadata = telemetry.getMetadata(); | ||||
|         var domains = metadata.domains; | ||||
|         var ranges = metadata.ranges; | ||||
|         var exportService = this.exportService; | ||||
|  | ||||
|         function getName(domainOrRange) { | ||||
|             return domainOrRange.name; | ||||
|         } | ||||
|  | ||||
|         telemetry.requestData({}).then(function (series) { | ||||
|             var headers = domains.map(getName).concat(ranges.map(getName)), | ||||
|                 rows = [], | ||||
|                 row, | ||||
|                 i; | ||||
|             var headers = domains.map(getName).concat(ranges.map(getName)); | ||||
|             var rows = []; | ||||
|             var row; | ||||
|             var i; | ||||
|  | ||||
|             function copyDomainsToRow(telemetryRow, index) { | ||||
|                 domains.forEach(function (domain) { | ||||
|   | ||||
| @@ -28,39 +28,39 @@ define([ | ||||
| ) { | ||||
|  | ||||
|     var RED = { | ||||
|             sin: 0.9, | ||||
|             cos: 0.9 | ||||
|         sin: 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 = { | ||||
|             sin: 0.5, | ||||
|             cos: 0.5 | ||||
|         rl: { | ||||
|             cssClass: "is-limit--lwr is-limit--red", | ||||
|             high: -RED, | ||||
|             low: Number.NEGATIVE_INFINITY, | ||||
|             name: "Red Low" | ||||
|         }, | ||||
|         LIMITS = { | ||||
|             rh: { | ||||
|                 cssClass: "is-limit--upr is-limit--red", | ||||
|                 low: RED, | ||||
|                 high: Number.POSITIVE_INFINITY, | ||||
|                 name: "Red High" | ||||
|             }, | ||||
|             rl: { | ||||
|                 cssClass: "is-limit--lwr is-limit--red", | ||||
|                 high: -RED, | ||||
|                 low: Number.NEGATIVE_INFINITY, | ||||
|                 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" | ||||
|             } | ||||
|         }; | ||||
|         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() { | ||||
|  | ||||
|   | ||||
| @@ -25,24 +25,24 @@ define( | ||||
|     function () { | ||||
|         "use strict"; | ||||
|  | ||||
|         var DEFAULT_IDENTITY = { key: "user", name: "Example User" }, | ||||
|             DIALOG_STRUCTURE = { | ||||
|                 name: "Identify Yourself", | ||||
|                 sections: [{ rows: [ | ||||
|                     { | ||||
|                         name: "User ID", | ||||
|                         control: "textfield", | ||||
|                         key: "key", | ||||
|                         required: true | ||||
|                     }, | ||||
|                     { | ||||
|                         name: "Human name", | ||||
|                         control: "textfield", | ||||
|                         key: "name", | ||||
|                         required: true | ||||
|                     } | ||||
|                 ]}] | ||||
|             }; | ||||
|         var DEFAULT_IDENTITY = { key: "user", name: "Example User" }; | ||||
|         var DIALOG_STRUCTURE = { | ||||
|             name: "Identify Yourself", | ||||
|             sections: [{ rows: [ | ||||
|                 { | ||||
|                     name: "User ID", | ||||
|                     control: "textfield", | ||||
|                     key: "key", | ||||
|                     required: true | ||||
|                 }, | ||||
|                 { | ||||
|                     name: "Human name", | ||||
|                     control: "textfield", | ||||
|                     key: "name", | ||||
|                     required: true | ||||
|                 } | ||||
|             ]}] | ||||
|         }; | ||||
|  | ||||
|  | ||||
|         /** | ||||
|   | ||||
| @@ -25,12 +25,12 @@ define( | ||||
|     function () { | ||||
|         "use strict"; | ||||
|  | ||||
|         var PREFIX = "msl_tlm:", | ||||
|             FORMAT_MAPPINGS = { | ||||
|                 float: "number", | ||||
|                 integer: "number", | ||||
|                 string: "string" | ||||
|             }; | ||||
|         var PREFIX = "msl_tlm:"; | ||||
|         var FORMAT_MAPPINGS = { | ||||
|             float: "number", | ||||
|             integer: "number", | ||||
|             string: "string" | ||||
|         }; | ||||
|  | ||||
|         function RemsTelemetryModelProvider(adapter) { | ||||
|  | ||||
| @@ -64,8 +64,8 @@ define( | ||||
|                 } | ||||
|  | ||||
|                 function addInstrument(subsystem, spacecraftId) { | ||||
|                     var measurements = (subsystem.measurements || []), | ||||
|                         instrumentId = makeId(subsystem); | ||||
|                     var measurements = (subsystem.measurements || []); | ||||
|                     var instrumentId = makeId(subsystem); | ||||
|  | ||||
|                     models[instrumentId] = { | ||||
|                         type: "msl.instrument", | ||||
|   | ||||
| @@ -42,9 +42,9 @@ define ( | ||||
|          * object that wraps the telemetry returned from the telemetry source. | ||||
|          */ | ||||
|         RemsTelemetryProvider.prototype.requestTelemetry = function (requests) { | ||||
|             var packaged = {}, | ||||
|                 relevantReqs, | ||||
|                 adapter = this.adapter; | ||||
|             var packaged = {}; | ||||
|             var relevantReqs; | ||||
|             var adapter = this.adapter; | ||||
|  | ||||
|             function matchesSource(request) { | ||||
|                 return (request.source === SOURCE); | ||||
|   | ||||
| @@ -30,8 +30,8 @@ define( | ||||
|     function (MSLDataDictionary, module) { | ||||
|         "use strict"; | ||||
|  | ||||
|         var TERRESTRIAL_DATE = "terrestrial_date", | ||||
|             LOCAL_DATA = "../data/rems.json"; | ||||
|         var TERRESTRIAL_DATE = "terrestrial_date"; | ||||
|         var LOCAL_DATA = "../data/rems.json"; | ||||
|  | ||||
|         /** | ||||
|          * Fetches historical data from the REMS instrument on the Curiosity | ||||
| @@ -69,8 +69,8 @@ define( | ||||
|          * @private | ||||
|          */ | ||||
|         RemsTelemetryServerAdapter.prototype.requestHistory = function (request) { | ||||
|             var self = this, | ||||
|                 id = request.key; | ||||
|             var self = this; | ||||
|             var id = request.key; | ||||
|  | ||||
|             var dataTransforms = this.dataTransforms; | ||||
|  | ||||
|   | ||||
| @@ -44,31 +44,31 @@ define( | ||||
|              periodically with the progress of an ongoing process. | ||||
|              */ | ||||
|             $scope.launchProgress = function (knownProgress) { | ||||
|                 var dialog, | ||||
|                     model = { | ||||
|                         title: "Progress Dialog Example", | ||||
|                         progress: 0, | ||||
|                         hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.", | ||||
|                         actionText: "Calculating...", | ||||
|                         unknownProgress: !knownProgress, | ||||
|                         unknownDuration: false, | ||||
|                         severity: "info", | ||||
|                         options: [ | ||||
|                             { | ||||
|                                 label: "Cancel Operation", | ||||
|                                 callback: function () { | ||||
|                                     $log.debug("Operation cancelled"); | ||||
|                                     dialog.dismiss(); | ||||
|                                 } | ||||
|                             }, | ||||
|                             { | ||||
|                                 label: "Do something else...", | ||||
|                                 callback: function () { | ||||
|                                     $log.debug("Something else pressed"); | ||||
|                                 } | ||||
|                 var dialog; | ||||
|                 var model = { | ||||
|                     title: "Progress Dialog Example", | ||||
|                     progress: 0, | ||||
|                     hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.", | ||||
|                     actionText: "Calculating...", | ||||
|                     unknownProgress: !knownProgress, | ||||
|                     unknownDuration: false, | ||||
|                     severity: "info", | ||||
|                     options: [ | ||||
|                         { | ||||
|                             label: "Cancel Operation", | ||||
|                             callback: function () { | ||||
|                                 $log.debug("Operation cancelled"); | ||||
|                                 dialog.dismiss(); | ||||
|                             } | ||||
|                         ] | ||||
|                     }; | ||||
|                         }, | ||||
|                         { | ||||
|                             label: "Do something else...", | ||||
|                             callback: function () { | ||||
|                                 $log.debug("Something else pressed"); | ||||
|                             } | ||||
|                         } | ||||
|                     ] | ||||
|                 }; | ||||
|  | ||||
|                 function incrementProgress() { | ||||
|                     model.progress = Math.min(100, Math.floor(model.progress + Math.random() * 30)); | ||||
| @@ -96,28 +96,28 @@ define( | ||||
|              Demonstrates launching an error dialog | ||||
|              */ | ||||
|             $scope.launchError = function () { | ||||
|                 var dialog, | ||||
|                     model = { | ||||
|                         title: "Error Dialog Example", | ||||
|                         actionText: "Something happened, and it was not good.", | ||||
|                         severity: "error", | ||||
|                         options: [ | ||||
|                             { | ||||
|                                 label: "Try Again", | ||||
|                                 callback: function () { | ||||
|                                     $log.debug("Try Again Pressed"); | ||||
|                                     dialog.dismiss(); | ||||
|                                 } | ||||
|                             }, | ||||
|                             { | ||||
|                                 label: "Cancel", | ||||
|                                 callback: function () { | ||||
|                                     $log.debug("Cancel Pressed"); | ||||
|                                     dialog.dismiss(); | ||||
|                                 } | ||||
|                 var dialog; | ||||
|                 var model = { | ||||
|                     title: "Error Dialog Example", | ||||
|                     actionText: "Something happened, and it was not good.", | ||||
|                     severity: "error", | ||||
|                     options: [ | ||||
|                         { | ||||
|                             label: "Try Again", | ||||
|                             callback: function () { | ||||
|                                 $log.debug("Try Again Pressed"); | ||||
|                                 dialog.dismiss(); | ||||
|                             } | ||||
|                         ] | ||||
|                     }; | ||||
|                         }, | ||||
|                         { | ||||
|                             label: "Cancel", | ||||
|                             callback: function () { | ||||
|                                 $log.debug("Cancel Pressed"); | ||||
|                                 dialog.dismiss(); | ||||
|                             } | ||||
|                         } | ||||
|                     ] | ||||
|                 }; | ||||
|                 dialog = dialogService.showBlockingMessage(model); | ||||
|  | ||||
|                 if (!dialog) { | ||||
| @@ -129,21 +129,21 @@ define( | ||||
|              Demonstrates launching an error dialog | ||||
|              */ | ||||
|             $scope.launchInfo = function () { | ||||
|                 var dialog, | ||||
|                     model = { | ||||
|                         title: "Info Dialog Example", | ||||
|                         actionText: "This is an example of a blocking info" + | ||||
|                         " dialog. This dialog can be used to draw the user's" + | ||||
|                         " attention to an event.", | ||||
|                         severity: "info", | ||||
|                         primaryOption: { | ||||
|                             label: "OK", | ||||
|                             callback: function () { | ||||
|                                 $log.debug("OK Pressed"); | ||||
|                                 dialog.dismiss(); | ||||
|                             } | ||||
|                 var dialog; | ||||
|                 var model = { | ||||
|                     title: "Info Dialog Example", | ||||
|                     actionText: "This is an example of a blocking info" + | ||||
|                     " dialog. This dialog can be used to draw the user's" + | ||||
|                     " attention to an event.", | ||||
|                     severity: "info", | ||||
|                     primaryOption: { | ||||
|                         label: "OK", | ||||
|                         callback: function () { | ||||
|                             $log.debug("OK Pressed"); | ||||
|                             dialog.dismiss(); | ||||
|                         } | ||||
|                     }; | ||||
|                     } | ||||
|                 }; | ||||
|  | ||||
|                 dialog = dialogService.showBlockingMessage(model); | ||||
|  | ||||
|   | ||||
| @@ -33,13 +33,13 @@ define( | ||||
|  | ||||
|  | ||||
|         function BrowserPersistenceProvider($q, SPACE) { | ||||
|             var spaces = SPACE ? [SPACE] : [], | ||||
|                 caches = {}, | ||||
|                 promises = { | ||||
|                     as: function (value) { | ||||
|                         return $q.when(value); | ||||
|                     } | ||||
|                 }; | ||||
|             var spaces = SPACE ? [SPACE] : []; | ||||
|             var caches = {}; | ||||
|             var promises = { | ||||
|                 as: function (value) { | ||||
|                     return $q.when(value); | ||||
|                 } | ||||
|             }; | ||||
|  | ||||
|             spaces.forEach(function (space) { | ||||
|                 caches[space] = {}; | ||||
|   | ||||
| @@ -33,10 +33,10 @@ define( | ||||
|                  * "foo." | ||||
|                  */ | ||||
|                 allow: function (action, context) { | ||||
|                     var domainObject = (context || {}).domainObject, | ||||
|                         model = (domainObject && domainObject.getModel()) || {}, | ||||
|                         name = model.name || "", | ||||
|                         metadata = action.getMetadata() || {}; | ||||
|                     var domainObject = (context || {}).domainObject; | ||||
|                     var model = (domainObject && domainObject.getModel()) || {}; | ||||
|                     var name = model.name || ""; | ||||
|                     var metadata = action.getMetadata() || {}; | ||||
|                     return metadata.key !== 'remove' || name.indexOf('foo') < 0; | ||||
|                 } | ||||
|             }; | ||||
|   | ||||
| @@ -34,13 +34,13 @@ define( | ||||
|          * @implements {Indicator} | ||||
|          */ | ||||
|         function DigestIndicator($interval, $rootScope) { | ||||
|             var digests = 0, | ||||
|                 displayed = 0, | ||||
|                 start = Date.now(); | ||||
|             var digests = 0; | ||||
|             var displayed = 0; | ||||
|             var start = Date.now(); | ||||
|  | ||||
|             function update() { | ||||
|                 var now = Date.now(), | ||||
|                     secs = (now - start) / 1000; | ||||
|                 var now = Date.now(); | ||||
|                 var secs = (now - start) / 1000; | ||||
|                 displayed = Math.round(digests / secs); | ||||
|                 start = now; | ||||
|                 digests = 0; | ||||
|   | ||||
| @@ -25,9 +25,9 @@ define( | ||||
|     function (AboutController) { | ||||
|  | ||||
|         describe("The About controller", function () { | ||||
|             var testVersions, | ||||
|                 mockWindow, | ||||
|                 controller; | ||||
|             var testVersions; | ||||
|             var mockWindow; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 testVersions = [ | ||||
|   | ||||
| @@ -25,8 +25,8 @@ define( | ||||
|     function (LicenseController) { | ||||
|  | ||||
|         describe("The License controller", function () { | ||||
|             var testLicenses, | ||||
|                 controller; | ||||
|             var testLicenses; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 testLicenses = [ | ||||
|   | ||||
| @@ -25,8 +25,8 @@ define( | ||||
|     function (LogoController) { | ||||
|  | ||||
|         describe("The About controller", function () { | ||||
|             var mockOverlayService, | ||||
|                 controller; | ||||
|             var mockOverlayService; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockOverlayService = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -30,9 +30,9 @@ define([ | ||||
| ) { | ||||
|  | ||||
|     describe("The navigate action", function () { | ||||
|         var mockNavigationService, | ||||
|             mockDomainObject, | ||||
|             action; | ||||
|         var mockNavigationService; | ||||
|         var mockDomainObject; | ||||
|         var action; | ||||
|  | ||||
|         beforeEach(function () { | ||||
|             mockNavigationService = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -28,8 +28,8 @@ define( | ||||
|     function (NavigationService) { | ||||
|  | ||||
|         describe("The navigation service", function () { | ||||
|             var $window, | ||||
|                 navigationService; | ||||
|             let $window; | ||||
|             let navigationService; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 $window = jasmine.createSpyObj('$window', ['confirm']); | ||||
| @@ -37,8 +37,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("stores navigation state", function () { | ||||
|                 var testObject = { someKey: 42 }, | ||||
|                     otherObject = { someKey: "some value" }; | ||||
|                 var testObject = { someKey: 42 }; | ||||
|                 var otherObject = { someKey: "some value" }; | ||||
|                 expect(navigationService.getNavigation()) | ||||
|                     .toBeUndefined(); | ||||
|                 navigationService.setNavigation(testObject); | ||||
| @@ -52,8 +52,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("notifies listeners on change", function () { | ||||
|                 var testObject = { someKey: 42 }, | ||||
|                     callback = jasmine.createSpy("callback"); | ||||
|                 var testObject = { someKey: 42 }; | ||||
|                 var callback = jasmine.createSpy("callback"); | ||||
|  | ||||
|                 navigationService.addListener(callback); | ||||
|                 expect(callback).not.toHaveBeenCalled(); | ||||
| @@ -63,8 +63,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("does not notify listeners when no changes occur", function () { | ||||
|                 var testObject = { someKey: 42 }, | ||||
|                     callback = jasmine.createSpy("callback"); | ||||
|                 var testObject = { someKey: 42 }; | ||||
|                 var callback = jasmine.createSpy("callback"); | ||||
|  | ||||
|                 navigationService.addListener(callback); | ||||
|                 navigationService.setNavigation(testObject); | ||||
| @@ -73,8 +73,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("stops notifying listeners after removal", function () { | ||||
|                 var testObject = { someKey: 42 }, | ||||
|                     callback = jasmine.createSpy("callback"); | ||||
|                 var testObject = { someKey: 42 }; | ||||
|                 var callback = jasmine.createSpy("callback"); | ||||
|  | ||||
|                 navigationService.addListener(callback); | ||||
|                 navigationService.removeListener(callback); | ||||
|   | ||||
| @@ -24,18 +24,18 @@ define([ | ||||
|     '../../src/navigation/OrphanNavigationHandler' | ||||
| ], function (OrphanNavigationHandler) { | ||||
|     describe("OrphanNavigationHandler", function () { | ||||
|         var mockTopic, | ||||
|             mockThrottle, | ||||
|             mockMutationTopic, | ||||
|             mockNavigationService, | ||||
|             mockDomainObject, | ||||
|             mockParentObject, | ||||
|             mockContext, | ||||
|             mockActionCapability, | ||||
|             mockEditor, | ||||
|             testParentComposition, | ||||
|             testId, | ||||
|             mockThrottledFns; | ||||
|         var mockTopic; | ||||
|         var mockThrottle; | ||||
|         var mockMutationTopic; | ||||
|         var mockNavigationService; | ||||
|         var mockDomainObject; | ||||
|         var mockParentObject; | ||||
|         var mockContext; | ||||
|         var mockActionCapability; | ||||
|         var mockEditor; | ||||
|         var testParentComposition; | ||||
|         var testId; | ||||
|         var mockThrottledFns; | ||||
|  | ||||
|         beforeEach(function () { | ||||
|             testId = 'some-identifier'; | ||||
|   | ||||
| @@ -25,12 +25,12 @@ define( | ||||
|     function (NewTabAction) { | ||||
|  | ||||
|         describe("The new tab action", function () { | ||||
|             var actionSelected, | ||||
|                 actionCurrent, | ||||
|                 mockWindow, | ||||
|                 mockContextCurrent, | ||||
|                 mockContextSelected, | ||||
|                 mockUrlService; | ||||
|             var actionSelected; | ||||
|             var actionCurrent; | ||||
|             var mockWindow; | ||||
|             var mockContextCurrent; | ||||
|             var mockContextSelected; | ||||
|             var mockUrlService; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockWindow = jasmine.createSpyObj("$window", ["open", "location"]); | ||||
|   | ||||
| @@ -62,10 +62,10 @@ define( | ||||
|         DialogService.prototype.getDialogResponse = function (key, model, resultGetter, typeClass) { | ||||
|             // We will return this result as a promise, because user | ||||
|             // input is asynchronous. | ||||
|             var deferred = this.$q.defer(), | ||||
|                 self = this, | ||||
|                 overlay, | ||||
|                 handleEscKeydown; | ||||
|             var deferred = this.$q.defer(); | ||||
|             var self = this; | ||||
|             var overlay; | ||||
|             var handleEscKeydown; | ||||
|  | ||||
|             // Confirm function; this will be passed in to the | ||||
|             // overlay-dialog template and associated with a | ||||
| @@ -247,12 +247,12 @@ define( | ||||
|             if (this.canShowDialog(dialogModel)) { | ||||
|                 // Add the overlay using the OverlayService, which | ||||
|                 // will handle actual insertion into the DOM | ||||
|                 var self = this, | ||||
|                     overlay = this.overlayService.createOverlay( | ||||
|                         "overlay-blocking-message", | ||||
|                         dialogModel, | ||||
|                         "t-dialog-sm" | ||||
|                     ); | ||||
|                 var self = this; | ||||
|                 var overlay = this.overlayService.createOverlay( | ||||
|                     "overlay-blocking-message", | ||||
|                     dialogModel, | ||||
|                     "t-dialog-sm" | ||||
|                 ); | ||||
|  | ||||
|                 this.activeOverlay = overlay; | ||||
|  | ||||
|   | ||||
| @@ -76,8 +76,8 @@ define( | ||||
|          */ | ||||
|         OverlayService.prototype.createOverlay = function (key, overlayModel, typeClass) { | ||||
|             // Create a new scope for this overlay | ||||
|             var scope = this.newScope(), | ||||
|                 element; | ||||
|             var scope = this.newScope(); | ||||
|             var element; | ||||
|  | ||||
|             // Stop showing the overlay; additionally, release the scope | ||||
|             // that it uses. | ||||
|   | ||||
| @@ -28,14 +28,14 @@ define( | ||||
|     function (DialogService) { | ||||
|  | ||||
|         describe("The dialog service", function () { | ||||
|             var mockOverlayService, | ||||
|                 mockQ, | ||||
|                 mockLog, | ||||
|                 mockOverlay, | ||||
|                 mockDeferred, | ||||
|                 mockDocument, | ||||
|                 mockBody, | ||||
|                 dialogService; | ||||
|             var mockOverlayService; | ||||
|             var mockQ; | ||||
|             var mockLog; | ||||
|             var mockOverlay; | ||||
|             var mockDeferred; | ||||
|             var mockDocument; | ||||
|             var mockBody; | ||||
|             var dialogService; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockOverlayService = jasmine.createSpyObj( | ||||
| @@ -188,8 +188,8 @@ define( | ||||
|                 }); | ||||
|  | ||||
|                 it("individual dialogs can be dismissed", function () { | ||||
|                     var secondDialogHandle, | ||||
|                         secondMockOverlay; | ||||
|                     var secondDialogHandle; | ||||
|                     var secondMockOverlay; | ||||
|  | ||||
|                     dialogHandle.dismiss(); | ||||
|  | ||||
|   | ||||
| @@ -28,15 +28,15 @@ define( | ||||
|     function (OverlayService) { | ||||
|  | ||||
|         describe("The overlay service", function () { | ||||
|             var mockDocument, | ||||
|                 mockCompile, | ||||
|                 mockRootScope, | ||||
|                 mockBody, | ||||
|                 mockTemplate, | ||||
|                 mockElement, | ||||
|                 mockScope, | ||||
|                 mockTimeout, | ||||
|                 overlayService; | ||||
|             var mockDocument; | ||||
|             var mockCompile; | ||||
|             var mockRootScope; | ||||
|             var mockBody; | ||||
|             var mockTemplate; | ||||
|             var mockElement; | ||||
|             var mockScope; | ||||
|             var mockTimeout; | ||||
|             var overlayService; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockDocument = jasmine.createSpyObj("$document", ["find"]); | ||||
|   | ||||
| @@ -86,8 +86,8 @@ define( | ||||
|          *        will be performed; should contain a `domainObject` property | ||||
|          */ | ||||
|         EditAction.appliesTo = function (context) { | ||||
|             var domainObject = (context || {}).domainObject, | ||||
|                 type = domainObject && domainObject.getCapability('type'); | ||||
|             var domainObject = (context || {}).domainObject; | ||||
|             var type = domainObject && domainObject.getCapability('type'); | ||||
|  | ||||
|             // Only allow editing of types that support it and are not already | ||||
|             // being edited | ||||
|   | ||||
| @@ -37,8 +37,8 @@ define( | ||||
|         } | ||||
|  | ||||
|         EditAndComposeAction.prototype.perform = function () { | ||||
|             var self = this, | ||||
|                 editAction = this.domainObject.getCapability('action').getActions("edit")[0]; | ||||
|             var self = this; | ||||
|             var editAction = this.domainObject.getCapability('action').getActions("edit")[0]; | ||||
|  | ||||
|             // Link these objects | ||||
|             function doLink() { | ||||
|   | ||||
| @@ -46,9 +46,9 @@ define( | ||||
|         } | ||||
|  | ||||
|         PropertiesAction.prototype.perform = function () { | ||||
|             var type = this.domainObject.getCapability('type'), | ||||
|                 domainObject = this.domainObject, | ||||
|                 dialogService = this.dialogService; | ||||
|             var type = this.domainObject.getCapability('type'); | ||||
|             var domainObject = this.domainObject; | ||||
|             var dialogService = this.dialogService; | ||||
|  | ||||
|             // Update the domain object model based on user input | ||||
|             function updateModel(userInput, dialog) { | ||||
| @@ -82,9 +82,9 @@ define( | ||||
|          */ | ||||
|         PropertiesAction.appliesTo = function (context) { | ||||
|  | ||||
|             var domainObject = (context || {}).domainObject, | ||||
|                 type = domainObject && domainObject.getCapability('type'), | ||||
|                 creatable = type && type.hasFeature('creation'); | ||||
|             var domainObject = (context || {}).domainObject; | ||||
|             var type = domainObject && domainObject.getCapability('type'); | ||||
|             var creatable = type && type.hasFeature('creation'); | ||||
|  | ||||
|             if (domainObject && domainObject.model && domainObject.model.locked) { | ||||
|                 return false; | ||||
|   | ||||
| @@ -49,9 +49,9 @@ define( | ||||
|          * @memberof platform/commonUI/edit.SaveAction# | ||||
|          */ | ||||
|         SaveAction.prototype.perform = function () { | ||||
|             var self = this, | ||||
|                 domainObject = this.domainObject, | ||||
|                 dialog = new SaveInProgressDialog(this.dialogService); | ||||
|             var self = this; | ||||
|             var domainObject = this.domainObject; | ||||
|             var dialog = new SaveInProgressDialog(this.dialogService); | ||||
|  | ||||
|             // Invoke any save behavior introduced by the editor capability; | ||||
|             // this is introduced by EditableDomainObject which is | ||||
|   | ||||
| @@ -50,8 +50,8 @@ define( | ||||
|          * @memberof platform/commonUI/edit.SaveAndStopEditingAction# | ||||
|          */ | ||||
|         SaveAndStopEditingAction.prototype.perform = function () { | ||||
|             var domainObject = this.domainObject, | ||||
|                 saveAction = new SaveAction(this.dialogService, this.notificationService, this.context); | ||||
|             var domainObject = this.domainObject; | ||||
|             var saveAction = new SaveAction(this.dialogService, this.notificationService, this.context); | ||||
|  | ||||
|             function closeEditor() { | ||||
|                 return domainObject.getCapability("editor").finish(); | ||||
|   | ||||
| @@ -99,11 +99,11 @@ function ( | ||||
|          * @private | ||||
|          */ | ||||
|     SaveAsAction.prototype.save = function () { | ||||
|         var self = this, | ||||
|             domainObject = this.domainObject, | ||||
|             copyService = this.copyService, | ||||
|             dialog = new SaveInProgressDialog(this.dialogService), | ||||
|             toUndirty = []; | ||||
|         var self = this; | ||||
|         var domainObject = this.domainObject; | ||||
|         var copyService = this.copyService; | ||||
|         var dialog = new SaveInProgressDialog(this.dialogService); | ||||
|         var toUndirty = []; | ||||
|  | ||||
|         function doWizardSave(parent) { | ||||
|             var wizard = self.createWizard(parent); | ||||
|   | ||||
| @@ -49,10 +49,10 @@ define( | ||||
|          * transaction is in progress. | ||||
|          */ | ||||
|         TransactionCapabilityDecorator.prototype.getCapabilities = function () { | ||||
|             var self = this, | ||||
|                 capabilities = this.capabilityService.getCapabilities | ||||
|                     .apply(this.capabilityService, arguments), | ||||
|                 persistenceCapability = capabilities.persistence; | ||||
|             var self = this; | ||||
|             var capabilities = this.capabilityService.getCapabilities | ||||
|                 .apply(this.capabilityService, arguments); | ||||
|             var persistenceCapability = capabilities.persistence; | ||||
|  | ||||
|             capabilities.persistence = function (domainObject) { | ||||
|                 var original = | ||||
|   | ||||
| @@ -29,8 +29,8 @@ define( | ||||
|     function () { | ||||
|  | ||||
|         function cancelEditing(domainObject) { | ||||
|             var navigatedObject = domainObject, | ||||
|                 editorCapability = navigatedObject && | ||||
|             var navigatedObject = domainObject; | ||||
|             var editorCapability = navigatedObject && | ||||
|                     navigatedObject.getCapability("editor"); | ||||
|  | ||||
|             return editorCapability && | ||||
|   | ||||
| @@ -34,12 +34,12 @@ define( | ||||
|  | ||||
|             // Update root object based on represented object | ||||
|             function updateRoot(domainObject) { | ||||
|                 var root = self.rootDomainObject, | ||||
|                     context = domainObject && | ||||
|                         domainObject.getCapability('context'), | ||||
|                     newRoot = context && context.getTrueRoot(), | ||||
|                     oldId = root && root.getId(), | ||||
|                     newId = newRoot && newRoot.getId(); | ||||
|                 var root = self.rootDomainObject; | ||||
|                 var context = domainObject && | ||||
|                         domainObject.getCapability('context'); | ||||
|                 var newRoot = context && context.getTrueRoot(); | ||||
|                 var oldId = root && root.getId(); | ||||
|                 var newId = newRoot && newRoot.getId(); | ||||
|  | ||||
|                 // Only update if this has actually changed, | ||||
|                 // to avoid excessive refreshing. | ||||
|   | ||||
| @@ -63,9 +63,9 @@ define( | ||||
|          * This will prompt for user input first. | ||||
|          */ | ||||
|         CreateAction.prototype.perform = function () { | ||||
|             var newModel = this.type.getInitialModel(), | ||||
|                 openmct = this.openmct, | ||||
|                 newObject; | ||||
|             var newModel = this.type.getInitialModel(); | ||||
|             var openmct = this.openmct; | ||||
|             var newObject; | ||||
|  | ||||
|             function onCancel() { | ||||
|                 openmct.editor.cancel(); | ||||
| @@ -78,13 +78,13 @@ define( | ||||
|             } | ||||
|  | ||||
|             function navigateAndEdit(object) { | ||||
|                 let objectPath = object.getCapability('context').getPath(), | ||||
|                     url = '#/browse/' + objectPath | ||||
|                         .slice(1) | ||||
|                         .map(function (o) { | ||||
|                             return o && openmct.objects.makeKeyString(o.getId()); | ||||
|                         }) | ||||
|                         .join('/'); | ||||
|                 let objectPath = object.getCapability('context').getPath(); | ||||
|                 let url = '#/browse/' + objectPath | ||||
|                     .slice(1) | ||||
|                     .map(function (o) { | ||||
|                         return o && openmct.objects.makeKeyString(o.getId()); | ||||
|                     }) | ||||
|                     .join('/'); | ||||
|  | ||||
|                 window.location.href = url; | ||||
|  | ||||
|   | ||||
| @@ -50,10 +50,10 @@ define( | ||||
|         } | ||||
|  | ||||
|         CreateActionProvider.prototype.getActions = function (actionContext) { | ||||
|             var context = actionContext || {}, | ||||
|                 key = context.key, | ||||
|                 destination = context.domainObject, | ||||
|                 self = this; | ||||
|             var context = actionContext || {}; | ||||
|             var key = context.key; | ||||
|             var destination = context.domainObject; | ||||
|             var self = this; | ||||
|  | ||||
|             // We only provide Create actions, and we need a | ||||
|             // domain object to serve as the container for the | ||||
|   | ||||
| @@ -55,8 +55,14 @@ define( | ||||
|          *         show in the create dialog | ||||
|          */ | ||||
|         CreateWizard.prototype.getFormStructure = function (includeLocation) { | ||||
| <<<<<<< HEAD | ||||
|             var sections = []; | ||||
|             var domainObject = this.domainObject; | ||||
|             var self = this; | ||||
| ======= | ||||
|             var sections = [], | ||||
|                 domainObject = this.domainObject; | ||||
| >>>>>>> parent of e6cd94123... satisfying no-invalid-this rule | ||||
|  | ||||
|             function validateLocation(parent) { | ||||
|                 return parent && this.openmct.composition.checkPolicy(parent.useCapability('adapter'), domainObject.useCapability('adapter')); | ||||
| @@ -107,8 +113,8 @@ define( | ||||
|          * @returns {DomainObject} | ||||
|          */ | ||||
|         CreateWizard.prototype.populateObjectFromInput = function (formValue) { | ||||
|             var parent = this.getLocation(formValue), | ||||
|                 formModel = this.createModel(formValue); | ||||
|             var parent = this.getLocation(formValue); | ||||
|             var formModel = this.createModel(formValue); | ||||
|  | ||||
|             formModel.location = parent.getId(); | ||||
|             this.domainObject.useCapability("mutation", function () { | ||||
| @@ -126,10 +132,10 @@ define( | ||||
|          */ | ||||
|         CreateWizard.prototype.getInitialFormValue = function () { | ||||
|             // Start with initial values for properties | ||||
|             var model = this.model, | ||||
|                 formValue = this.properties.map(function (property) { | ||||
|                     return property.getValue(model); | ||||
|                 }); | ||||
|             var model = this.model; | ||||
|             var formValue = this.properties.map(function (property) { | ||||
|                 return property.getValue(model); | ||||
|             }); | ||||
|  | ||||
|             // Include the createParent | ||||
|             formValue.createParent = this.parent; | ||||
|   | ||||
| @@ -63,17 +63,17 @@ define( | ||||
|          *         object has been created | ||||
|          */ | ||||
|         CreationService.prototype.createObject = function (model, parent) { | ||||
|             var persistence = parent.getCapability("persistence"), | ||||
|                 newObject = parent.useCapability("instantiation", model), | ||||
|                 newObjectPersistence = newObject.getCapability("persistence"), | ||||
|                 self = this; | ||||
|             var persistence = parent.getCapability("persistence"); | ||||
|             var newObject = parent.useCapability("instantiation", model); | ||||
|             var newObjectPersistence = newObject.getCapability("persistence"); | ||||
|             var self = this; | ||||
|  | ||||
|             // Add the newly-created object's id to the parent's | ||||
|             // composition, so that it will subsequently appear | ||||
|             // as a child contained by that parent. | ||||
|             function addToComposition() { | ||||
|                 var compositionCapability = parent.getCapability('composition'), | ||||
|                     addResult = compositionCapability && | ||||
|                 var compositionCapability = parent.getCapability('composition'); | ||||
|                 var addResult = compositionCapability && | ||||
|                         compositionCapability.add(newObject); | ||||
|  | ||||
|                 return self.$q.when(addResult).then(function (result) { | ||||
|   | ||||
| @@ -39,8 +39,8 @@ define( | ||||
|             //              used for bi-directional object selection. | ||||
|             function setLocatingObject(domainObject, priorObject) { | ||||
|                 var context = domainObject && | ||||
|                     domainObject.getCapability("context"), | ||||
|                     contextRoot = context && context.getRoot(); | ||||
|                     domainObject.getCapability("context"); | ||||
|                 var contextRoot = context && context.getRoot(); | ||||
|  | ||||
|                 if (contextRoot && contextRoot !== $scope.rootObject) { | ||||
|                     $scope.rootObject = undefined; | ||||
|   | ||||
| @@ -58,9 +58,9 @@ define( | ||||
|          * @param {String} message a message to log with the commit message. | ||||
|          */ | ||||
|         EditRepresenter.prototype.commit = function (message) { | ||||
|             var model = this.$scope.model, | ||||
|                 configuration = this.$scope.configuration, | ||||
|                 domainObject = this.domainObject; | ||||
|             var model = this.$scope.model; | ||||
|             var configuration = this.$scope.configuration; | ||||
|             var domainObject = this.domainObject; | ||||
|  | ||||
|             this.$log.debug([ | ||||
|                 "Committing ", | ||||
|   | ||||
| @@ -25,12 +25,12 @@ define( | ||||
|     function (CancelAction) { | ||||
|  | ||||
|         describe("The Cancel action", function () { | ||||
|             var mockDomainObject, | ||||
|                 mockParentObject, | ||||
|                 capabilities = {}, | ||||
|                 parentCapabilities = {}, | ||||
|                 actionContext, | ||||
|                 action; | ||||
|             var mockDomainObject; | ||||
|             var mockParentObject; | ||||
|             var capabilities = {}; | ||||
|             var parentCapabilities = {}; | ||||
|             var actionContext; | ||||
|             var action; | ||||
|  | ||||
|             function mockPromise(value) { | ||||
|                 return { | ||||
|   | ||||
| @@ -25,15 +25,15 @@ define( | ||||
|     function (EditAction) { | ||||
|  | ||||
|         describe("The Edit action", function () { | ||||
|             var mockLocation, | ||||
|                 mockNavigationService, | ||||
|                 mockLog, | ||||
|                 mockDomainObject, | ||||
|                 mockType, | ||||
|                 mockEditor, | ||||
|                 actionContext, | ||||
|                 capabilities, | ||||
|                 action; | ||||
|             var mockLocation; | ||||
|             var mockNavigationService; | ||||
|             var mockLog; | ||||
|             var mockDomainObject; | ||||
|             var mockType; | ||||
|             var mockEditor; | ||||
|             var actionContext; | ||||
|             var capabilities; | ||||
|             var action; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockLocation = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -25,17 +25,17 @@ define( | ||||
|     function (EditAndComposeAction) { | ||||
|  | ||||
|         describe("The Link action", function () { | ||||
|             var mockDomainObject, | ||||
|                 mockParent, | ||||
|                 mockContext, | ||||
|                 mockComposition, | ||||
|                 mockActionCapability, | ||||
|                 mockEditAction, | ||||
|                 mockType, | ||||
|                 actionContext, | ||||
|                 model, | ||||
|                 capabilities, | ||||
|                 action; | ||||
|             var mockDomainObject; | ||||
|             var mockParent; | ||||
|             var mockContext; | ||||
|             var mockComposition; | ||||
|             var mockActionCapability; | ||||
|             var mockEditAction; | ||||
|             var mockType; | ||||
|             var actionContext; | ||||
|             var model; | ||||
|             var capabilities; | ||||
|             var action; | ||||
|  | ||||
|             function mockPromise(value) { | ||||
|                 return { | ||||
|   | ||||
| @@ -25,7 +25,13 @@ define( | ||||
|     function (PropertiesAction) { | ||||
|  | ||||
|         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) { | ||||
|                 return { | ||||
|   | ||||
| @@ -26,7 +26,10 @@ define( | ||||
|  | ||||
|         describe("Properties dialog", function () { | ||||
|  | ||||
|             var type, properties, model, dialog; | ||||
|             var type; | ||||
|             var properties; | ||||
|             var model; | ||||
|             var dialog; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 type = { | ||||
|   | ||||
| @@ -26,14 +26,14 @@ define( | ||||
|     function (SaveAction) { | ||||
|  | ||||
|         describe("The Save action", function () { | ||||
|             var mockDomainObject, | ||||
|                 mockEditorCapability, | ||||
|                 actionContext, | ||||
|                 mockDialogService, | ||||
|                 mockNotificationService, | ||||
|                 mockActionCapability, | ||||
|                 capabilities = {}, | ||||
|                 action; | ||||
|             var mockDomainObject; | ||||
|             var mockEditorCapability; | ||||
|             var actionContext; | ||||
|             var mockDialogService; | ||||
|             var mockNotificationService; | ||||
|             var mockActionCapability; | ||||
|             var capabilities = {}; | ||||
|             var action; | ||||
|  | ||||
|             function mockPromise(value) { | ||||
|                 return { | ||||
|   | ||||
| @@ -32,14 +32,14 @@ define( | ||||
|             // depends on is not mocked, so we mock some | ||||
|             // of SaveAction's own dependencies to make | ||||
|             // it run. | ||||
|             var mockDomainObject, | ||||
|                 mockEditorCapability, | ||||
|                 actionContext, | ||||
|                 dialogService, | ||||
|                 notificationService, | ||||
|                 mockActionCapability, | ||||
|                 capabilities = {}, | ||||
|                 action; | ||||
|             var mockDomainObject; | ||||
|             var mockEditorCapability; | ||||
|             var actionContext; | ||||
|             var dialogService; | ||||
|             var notificationService; | ||||
|             var mockActionCapability; | ||||
|             var capabilities = {}; | ||||
|             var action; | ||||
|  | ||||
|             function mockPromise(value) { | ||||
|                 return { | ||||
|   | ||||
| @@ -26,18 +26,18 @@ define( | ||||
|     function (SaveAsAction) { | ||||
|  | ||||
|         xdescribe("The Save As action", function () { | ||||
|             var mockDomainObject, | ||||
|                 mockClonedObject, | ||||
|                 mockEditorCapability, | ||||
|                 mockActionCapability, | ||||
|                 mockObjectService, | ||||
|                 mockDialogService, | ||||
|                 mockCopyService, | ||||
|                 mockNotificationService, | ||||
|                 mockParent, | ||||
|                 actionContext, | ||||
|                 capabilities = {}, | ||||
|                 action; | ||||
|             var mockDomainObject; | ||||
|             var mockClonedObject; | ||||
|             var mockEditorCapability; | ||||
|             var mockActionCapability; | ||||
|             var mockObjectService; | ||||
|             var mockDialogService; | ||||
|             var mockCopyService; | ||||
|             var mockNotificationService; | ||||
|             var mockParent; | ||||
|             var actionContext; | ||||
|             var capabilities = {}; | ||||
|             var action; | ||||
|  | ||||
|             function noop() {} | ||||
|  | ||||
|   | ||||
| @@ -25,14 +25,14 @@ define( | ||||
|     function (EditorCapability) { | ||||
|  | ||||
|         xdescribe("The editor capability", function () { | ||||
|             var mockDomainObject, | ||||
|                 capabilities, | ||||
|                 mockParentObject, | ||||
|                 mockTransactionService, | ||||
|                 mockStatusCapability, | ||||
|                 mockParentStatus, | ||||
|                 mockContextCapability, | ||||
|                 capability; | ||||
|             var mockDomainObject; | ||||
|             var capabilities; | ||||
|             var mockParentObject; | ||||
|             var mockTransactionService; | ||||
|             var mockStatusCapability; | ||||
|             var mockParentStatus; | ||||
|             var mockContextCapability; | ||||
|             var capability; | ||||
|  | ||||
|             function fastPromise(val) { | ||||
|                 return { | ||||
|   | ||||
| @@ -28,10 +28,10 @@ define( | ||||
|     function (TransactionalPersistenceCapability, TransactionCapabilityDecorator) { | ||||
|  | ||||
|         describe("The transaction capability decorator", function () { | ||||
|             var mockQ, | ||||
|                 mockTransactionService, | ||||
|                 mockCapabilityService, | ||||
|                 provider; | ||||
|             var mockQ; | ||||
|             var mockTransactionService; | ||||
|             var mockCapabilityService; | ||||
|             var provider; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockQ = {}; | ||||
|   | ||||
| @@ -36,12 +36,12 @@ define( | ||||
|         } | ||||
|  | ||||
|         describe("The transactional persistence decorator", function () { | ||||
|             var mockQ, | ||||
|                 mockTransactionManager, | ||||
|                 mockPersistence, | ||||
|                 mockDomainObject, | ||||
|                 testId, | ||||
|                 capability; | ||||
|             var mockQ; | ||||
|             var mockTransactionManager; | ||||
|             var mockPersistence; | ||||
|             var mockDomainObject; | ||||
|             var testId; | ||||
|             var capability; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 testId = "test-id"; | ||||
|   | ||||
| @@ -48,9 +48,9 @@ define( | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             var mockScope, | ||||
|                 mockActions, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockActions; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockActions = jasmine.createSpyObj("action", ["getActions"]); | ||||
|   | ||||
| @@ -25,16 +25,16 @@ define( | ||||
|     function (EditObjectController) { | ||||
|  | ||||
|         describe("The Edit Object controller", function () { | ||||
|             var mockScope, | ||||
|                 mockObject, | ||||
|                 testViews, | ||||
|                 mockEditorCapability, | ||||
|                 mockLocation, | ||||
|                 mockNavigationService, | ||||
|                 removeCheck, | ||||
|                 mockStatusCapability, | ||||
|                 mockCapabilities, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockObject; | ||||
|             var testViews; | ||||
|             var mockEditorCapability; | ||||
|             var mockLocation; | ||||
|             var mockNavigationService; | ||||
|             var removeCheck; | ||||
|             var mockStatusCapability; | ||||
|             var mockCapabilities; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockScope = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -25,10 +25,10 @@ define( | ||||
|     function (EditPanesController) { | ||||
|  | ||||
|         describe("The Edit Panes controller", function () { | ||||
|             var mockScope, | ||||
|                 mockDomainObject, | ||||
|                 mockContext, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockDomainObject; | ||||
|             var mockContext; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockScope = jasmine.createSpyObj("$scope", ["$watch"]); | ||||
|   | ||||
| @@ -28,12 +28,12 @@ define( | ||||
|     function (CreateActionProvider) { | ||||
|  | ||||
|         describe("The create action provider", function () { | ||||
|             var mockTypeService, | ||||
|                 mockPolicyService, | ||||
|                 mockCreationPolicy, | ||||
|                 mockPolicyMap = {}, | ||||
|                 mockTypes, | ||||
|                 provider; | ||||
|             var mockTypeService; | ||||
|             var mockPolicyService; | ||||
|             var mockCreationPolicy; | ||||
|             var mockPolicyMap = {}; | ||||
|             var mockTypes; | ||||
|             var provider; | ||||
|  | ||||
|             function createMockType(name) { | ||||
|                 var mockType = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -28,13 +28,13 @@ define( | ||||
|     function (CreateAction) { | ||||
|  | ||||
|         xdescribe("The create action", function () { | ||||
|             var mockType, | ||||
|                 mockParent, | ||||
|                 mockContext, | ||||
|                 mockDomainObject, | ||||
|                 capabilities = {}, | ||||
|                 mockEditAction, | ||||
|                 action; | ||||
|             var mockType; | ||||
|             var mockParent; | ||||
|             var mockContext; | ||||
|             var mockDomainObject; | ||||
|             var capabilities = {}; | ||||
|             var mockEditAction; | ||||
|             var action; | ||||
|  | ||||
|             function mockPromise(value) { | ||||
|                 return { | ||||
|   | ||||
| @@ -28,9 +28,9 @@ define( | ||||
|     function (CreateMenuController) { | ||||
|  | ||||
|         describe("The create menu controller", function () { | ||||
|             var mockScope, | ||||
|                 mockActions, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockActions; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockActions = jasmine.createSpyObj("action", ["getActions"]); | ||||
|   | ||||
| @@ -28,6 +28,15 @@ define( | ||||
|     function (CreateWizard) { | ||||
|  | ||||
|         xdescribe("The create wizard", function () { | ||||
| <<<<<<< HEAD | ||||
|             var mockType; | ||||
|             var mockParent; | ||||
|             var mockProperties; | ||||
|             var mockPolicyService; | ||||
|             var testModel; | ||||
|             var mockDomainObject; | ||||
|             var wizard; | ||||
| ======= | ||||
|             var mockType, | ||||
|                 mockParent, | ||||
|                 mockProperties, | ||||
| @@ -35,6 +44,7 @@ define( | ||||
|                 testModel, | ||||
|                 mockDomainObject, | ||||
|                 wizard; | ||||
| >>>>>>> parent of e6cd94123... satisfying no-invalid-this rule | ||||
|  | ||||
|             function createMockProperty(name) { | ||||
|                 var mockProperty = jasmine.createSpyObj( | ||||
| @@ -142,11 +152,11 @@ define( | ||||
|  | ||||
|             it("populates the model on the associated object", function () { | ||||
|                 var formValue = { | ||||
|                         "A": "ValueA", | ||||
|                         "B": "ValueB", | ||||
|                         "C": "ValueC" | ||||
|                     }, | ||||
|                     compareModel = wizard.createModel(formValue); | ||||
|                     "A": "ValueA", | ||||
|                     "B": "ValueB", | ||||
|                     "C": "ValueC" | ||||
|                 }; | ||||
|                 var compareModel = wizard.createModel(formValue); | ||||
|                 //populateObjectFromInput adds a .location attribute that is not added by createModel. | ||||
|                 compareModel.location = undefined; | ||||
|                 wizard.populateObjectFromInput(formValue); | ||||
| @@ -156,19 +166,19 @@ define( | ||||
|  | ||||
|             it("validates selection types using policy", function () { | ||||
|                 var mockDomainObj = jasmine.createSpyObj( | ||||
|                         'domainObject', | ||||
|                         ['getCapability'] | ||||
|                     ), | ||||
|                     mockOtherType = jasmine.createSpyObj( | ||||
|                         'otherType', | ||||
|                         ['getKey'] | ||||
|                     ), | ||||
|                     'domainObject', | ||||
|                     ['getCapability'] | ||||
|                 ); | ||||
|                 var mockOtherType = jasmine.createSpyObj( | ||||
|                     'otherType', | ||||
|                     ['getKey'] | ||||
|                 ); | ||||
|  | ||||
|                     //Create a form structure with location | ||||
|                     structure = wizard.getFormStructure(true), | ||||
|                     sections = structure.sections, | ||||
|                     rows = structure.sections[sections.length - 1].rows, | ||||
|                     locationRow = rows[rows.length - 1]; | ||||
|                 //Create a form structure with location | ||||
|                 var structure = wizard.getFormStructure(true); | ||||
|                 var sections = structure.sections; | ||||
|                 var rows = structure.sections[sections.length - 1].rows; | ||||
|                 var locationRow = rows[rows.length - 1]; | ||||
|  | ||||
|                 mockDomainObj.getCapability.and.returnValue(mockOtherType); | ||||
|                 locationRow.validate(mockDomainObj); | ||||
|   | ||||
| @@ -25,8 +25,8 @@ define( | ||||
|     function (CreationPolicy) { | ||||
|  | ||||
|         describe("The creation policy", function () { | ||||
|             var mockType, | ||||
|                 policy; | ||||
|             var mockType; | ||||
|             var policy; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockType = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -28,18 +28,18 @@ define( | ||||
|     function (CreationService) { | ||||
|  | ||||
|         describe("The creation service", function () { | ||||
|             var mockQ, | ||||
|                 mockLog, | ||||
|                 mockParentObject, | ||||
|                 mockNewObject, | ||||
|                 mockMutationCapability, | ||||
|                 mockPersistenceCapability, | ||||
|                 mockCompositionCapability, | ||||
|                 mockContextCapability, | ||||
|                 mockCreationCapability, | ||||
|                 mockCapabilities, | ||||
|                 mockNewPersistenceCapability, | ||||
|                 creationService; | ||||
|             var mockQ; | ||||
|             var mockLog; | ||||
|             var mockParentObject; | ||||
|             var mockNewObject; | ||||
|             var mockMutationCapability; | ||||
|             var mockPersistenceCapability; | ||||
|             var mockCompositionCapability; | ||||
|             var mockContextCapability; | ||||
|             var mockCreationCapability; | ||||
|             var mockCapabilities; | ||||
|             var mockNewPersistenceCapability; | ||||
|             var creationService; | ||||
|  | ||||
|             function mockPromise(value) { | ||||
|                 return (value && value.then) ? value : { | ||||
| @@ -157,10 +157,10 @@ define( | ||||
|  | ||||
|             it("provides the newly-created object", function () { | ||||
|                 var mockDomainObject = jasmine.createSpyObj( | ||||
|                         'newDomainObject', | ||||
|                         ['getId', 'getModel', 'getCapability'] | ||||
|                     ), | ||||
|                     mockCallback = jasmine.createSpy('callback'); | ||||
|                     'newDomainObject', | ||||
|                     ['getId', 'getModel', 'getCapability'] | ||||
|                 ); | ||||
|                 var mockCallback = jasmine.createSpy('callback'); | ||||
|  | ||||
|                 // Act as if the object had been created | ||||
|                 mockCompositionCapability.add.and.callFake(function (id) { | ||||
| @@ -180,8 +180,8 @@ define( | ||||
|  | ||||
|             it("warns if parent has no persistence capability", function () { | ||||
|                 // Callbacks | ||||
|                 var success = jasmine.createSpy("success"), | ||||
|                     failure = jasmine.createSpy("failure"); | ||||
|                 var success = jasmine.createSpy("success"); | ||||
|                 var failure = jasmine.createSpy("failure"); | ||||
|  | ||||
|                 mockCapabilities.persistence = undefined; | ||||
|                 creationService.createObject({}, mockParentObject).then( | ||||
|   | ||||
| @@ -28,14 +28,14 @@ define( | ||||
|     function (LocatorController) { | ||||
|  | ||||
|         describe("The locator controller", function () { | ||||
|             var mockScope, | ||||
|                 mockTimeout, | ||||
|                 mockDomainObject, | ||||
|                 mockRootObject, | ||||
|                 mockContext, | ||||
|                 mockObjectService, | ||||
|                 getObjectsPromise, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockTimeout; | ||||
|             var mockDomainObject; | ||||
|             var mockRootObject; | ||||
|             var mockContext; | ||||
|             var mockObjectService; | ||||
|             var getObjectsPromise; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockScope = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -25,14 +25,14 @@ define( | ||||
|     function (EditPersistableObjectsPolicy) { | ||||
|  | ||||
|         describe("The Edit persistable objects policy", function () { | ||||
|             var mockDomainObject, | ||||
|                 mockEditAction, | ||||
|                 mockPropertiesAction, | ||||
|                 mockOtherAction, | ||||
|                 mockAPI, | ||||
|                 mockObjectAPI, | ||||
|                 testContext, | ||||
|                 policy; | ||||
|             var mockDomainObject; | ||||
|             var mockEditAction; | ||||
|             var mockPropertiesAction; | ||||
|             var mockOtherAction; | ||||
|             var mockAPI; | ||||
|             var mockObjectAPI; | ||||
|             var testContext; | ||||
|             var policy; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockDomainObject = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -26,9 +26,9 @@ define([ | ||||
|     EditRepresenter | ||||
| ) { | ||||
|     describe('EditRepresenter', function () { | ||||
|         var $log, | ||||
|             $scope, | ||||
|             representer; | ||||
|         var $log; | ||||
|         var $scope; | ||||
|         var representer; | ||||
|  | ||||
|  | ||||
|         beforeEach(function () { | ||||
| @@ -42,8 +42,8 @@ define([ | ||||
|         }); | ||||
|  | ||||
|         describe('representation', function () { | ||||
|             var domainObject, | ||||
|                 representation; | ||||
|             var domainObject; | ||||
|             var representation; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 domainObject = jasmine.createSpyObj('domainObject', [ | ||||
|   | ||||
| @@ -25,8 +25,8 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) { | ||||
|     var TRANSACTION_METHODS = ['add', 'commit', 'cancel', 'size']; | ||||
|  | ||||
|     describe("A NestedTransaction", function () { | ||||
|         var mockTransaction, | ||||
|             nestedTransaction; | ||||
|         var mockTransaction; | ||||
|         var nestedTransaction; | ||||
|  | ||||
|         beforeEach(function () { | ||||
|             mockTransaction = | ||||
| @@ -42,8 +42,8 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) { | ||||
|         }); | ||||
|  | ||||
|         describe("when callbacks are added", function () { | ||||
|             var mockCommit, | ||||
|                 mockCancel; | ||||
|             var mockCommit; | ||||
|             var mockCancel; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockCommit = jasmine.createSpy('commit'); | ||||
|   | ||||
| @@ -25,13 +25,13 @@ define( | ||||
|     ["../../src/services/TransactionManager"], | ||||
|     function (TransactionManager) { | ||||
|         describe("TransactionManager", function () { | ||||
|             var mockTransactionService, | ||||
|                 testId, | ||||
|                 mockOnCommit, | ||||
|                 mockOnCancel, | ||||
|                 mockRemoves, | ||||
|                 mockPromise, | ||||
|                 manager; | ||||
|             var mockTransactionService; | ||||
|             var testId; | ||||
|             var mockOnCommit; | ||||
|             var mockOnCancel; | ||||
|             var mockRemoves; | ||||
|             var mockPromise; | ||||
|             var manager; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockRemoves = []; | ||||
|   | ||||
| @@ -26,9 +26,9 @@ define( | ||||
|     function (TransactionService) { | ||||
|  | ||||
|         describe("The Transaction Service", function () { | ||||
|             var mockQ, | ||||
|                 mockLog, | ||||
|                 transactionService; | ||||
|             var mockQ; | ||||
|             var mockLog; | ||||
|             var transactionService; | ||||
|  | ||||
|             function fastPromise(val) { | ||||
|                 return { | ||||
| @@ -52,8 +52,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("addToTransaction queues onCommit and onCancel functions", function () { | ||||
|                 var onCommit = jasmine.createSpy('onCommit'), | ||||
|                     onCancel = jasmine.createSpy('onCancel'); | ||||
|                 var onCommit = jasmine.createSpy('onCommit'); | ||||
|                 var onCancel = jasmine.createSpy('onCancel'); | ||||
|  | ||||
|                 transactionService.startTransaction(); | ||||
|                 transactionService.addToTransaction(onCommit, onCancel); | ||||
| @@ -61,8 +61,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("size function returns size of commit and cancel queues", function () { | ||||
|                 var onCommit = jasmine.createSpy('onCommit'), | ||||
|                     onCancel = jasmine.createSpy('onCancel'); | ||||
|                 var onCommit = jasmine.createSpy('onCommit'); | ||||
|                 var onCancel = jasmine.createSpy('onCancel'); | ||||
|  | ||||
|                 transactionService.startTransaction(); | ||||
|                 transactionService.addToTransaction(onCommit, onCancel); | ||||
|   | ||||
| @@ -26,8 +26,8 @@ define( | ||||
|     function (Transaction) { | ||||
|  | ||||
|         describe("A Transaction", function () { | ||||
|             var mockLog, | ||||
|                 transaction; | ||||
|             var mockLog; | ||||
|             var transaction; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockLog = jasmine.createSpyObj( | ||||
| @@ -42,9 +42,9 @@ define( | ||||
|             }); | ||||
|  | ||||
|             describe("when callbacks are added", function () { | ||||
|                 var mockCommit, | ||||
|                     mockCancel, | ||||
|                     remove; | ||||
|                 var mockCommit; | ||||
|                 var mockCancel; | ||||
|                 var remove; | ||||
|  | ||||
|                 beforeEach(function () { | ||||
|                     mockCommit = jasmine.createSpy('commit'); | ||||
|   | ||||
| @@ -26,10 +26,10 @@ define([ | ||||
|     moment | ||||
| ) { | ||||
|  | ||||
|     var DATE_FORMAT = "HH:mm:ss", | ||||
|         DATE_FORMATS = [ | ||||
|             DATE_FORMAT | ||||
|         ]; | ||||
|     var DATE_FORMAT = "HH:mm:ss"; | ||||
|     var DATE_FORMATS = [ | ||||
|         DATE_FORMAT | ||||
|     ]; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -26,14 +26,14 @@ define([ | ||||
|     moment | ||||
| ) { | ||||
|  | ||||
|     var DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS", | ||||
|         DATE_FORMATS = [ | ||||
|             DATE_FORMAT, | ||||
|             DATE_FORMAT + "Z", | ||||
|             "YYYY-MM-DD HH:mm:ss", | ||||
|             "YYYY-MM-DD HH:mm", | ||||
|             "YYYY-MM-DD" | ||||
|         ]; | ||||
|     var DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS"; | ||||
|     var DATE_FORMATS = [ | ||||
|         DATE_FORMAT, | ||||
|         DATE_FORMAT + "Z", | ||||
|         "YYYY-MM-DD HH:mm:ss", | ||||
|         "YYYY-MM-DD HH:mm", | ||||
|         "YYYY-MM-DD" | ||||
|     ]; | ||||
|  | ||||
|     /** | ||||
|      * @typedef Scale | ||||
|   | ||||
| @@ -27,9 +27,9 @@ define( | ||||
|         var KEYS = ['a', 'b', 'c']; | ||||
|  | ||||
|         describe("The FormatProvider", function () { | ||||
|             var mockFormats, | ||||
|                 mockFormatInstances, | ||||
|                 provider; | ||||
|             var mockFormats; | ||||
|             var mockFormatInstances; | ||||
|             var provider; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockFormatInstances = KEYS.map(function (k) { | ||||
|   | ||||
| @@ -41,19 +41,19 @@ define( | ||||
|          *        stylesheets will be found | ||||
|          */ | ||||
|         function StyleSheetLoader(stylesheets, $document, activeTheme, assetPath) { | ||||
|             var head = $document.find('head'), | ||||
|                 document = $document[0]; | ||||
|             var head = $document.find('head'); | ||||
|             var document = $document[0]; | ||||
|  | ||||
|             // Procedure for adding a single stylesheet | ||||
|             function addStyleSheet(stylesheet) { | ||||
|                 // Create a link element, and construct full path | ||||
|                 var link = document.createElement('link'), | ||||
|                     path = [ | ||||
|                         assetPath, | ||||
|                         stylesheet.bundle.path, | ||||
|                         stylesheet.bundle.resources, | ||||
|                         stylesheet.stylesheetUrl | ||||
|                     ].join("/"); | ||||
|                 var link = document.createElement('link'); | ||||
|                 var path = [ | ||||
|                     assetPath, | ||||
|                     stylesheet.bundle.path, | ||||
|                     stylesheet.bundle.resources, | ||||
|                     stylesheet.stylesheetUrl | ||||
|                 ].join("/"); | ||||
|  | ||||
|                 // Initialize attributes on the link | ||||
|                 link.setAttribute("rel", "stylesheet"); | ||||
|   | ||||
| @@ -48,12 +48,12 @@ define( | ||||
|             // Separate out the actions that have been retrieved | ||||
|             // into groups, and populate scope with this. | ||||
|             function groupActions(actions) { | ||||
|                 var groups = {}, | ||||
|                     ungrouped = []; | ||||
|                 var groups = {}; | ||||
|                 var ungrouped = []; | ||||
|  | ||||
|                 function assignToGroup(action) { | ||||
|                     var metadata = action.getMetadata(), | ||||
|                         group = metadata.group; | ||||
|                     var metadata = action.getMetadata(); | ||||
|                     var group = metadata.group; | ||||
|                     if (group) { | ||||
|                         groups[group] = groups[group] || []; | ||||
|                         groups[group].push(action); | ||||
| @@ -73,9 +73,9 @@ define( | ||||
|             // Callback for when state which might influence action groupings | ||||
|             // changes. | ||||
|             function updateGroups() { | ||||
|                 var actionCapability = $scope.action, | ||||
|                     params = $scope.parameters || {}, | ||||
|                     category = params.category; | ||||
|                 var actionCapability = $scope.action; | ||||
|                 var params = $scope.parameters || {}; | ||||
|                 var category = params.category; | ||||
|  | ||||
|                 if (actionCapability && category) { | ||||
|                     // Get actions by capability, and group them | ||||
|   | ||||
| @@ -25,22 +25,22 @@ define( | ||||
|     function (moment) { | ||||
|  | ||||
|         var TIME_NAMES = { | ||||
|                 'hours': "Hour", | ||||
|                 'minutes': "Minute", | ||||
|                 'seconds': "Second" | ||||
|             }, | ||||
|             MONTHS = moment.months(), | ||||
|             TIME_OPTIONS = (function makeRanges() { | ||||
|                 var arr = []; | ||||
|                 while (arr.length < 60) { | ||||
|                     arr.push(arr.length); | ||||
|                 } | ||||
|                 return { | ||||
|                     hours: arr.slice(0, 24), | ||||
|                     minutes: arr, | ||||
|                     seconds: arr | ||||
|                 }; | ||||
|             }()); | ||||
|             'hours': "Hour", | ||||
|             'minutes': "Minute", | ||||
|             'seconds': "Second" | ||||
|         }; | ||||
|         var MONTHS = moment.months(); | ||||
|         var TIME_OPTIONS = (function makeRanges() { | ||||
|             var arr = []; | ||||
|             while (arr.length < 60) { | ||||
|                 arr.push(arr.length); | ||||
|             } | ||||
|             return { | ||||
|                 hours: arr.slice(0, 24), | ||||
|                 minutes: arr, | ||||
|                 seconds: arr | ||||
|             }; | ||||
|         }()); | ||||
|  | ||||
|         /** | ||||
|          * Controller to support the date-time picker. | ||||
| @@ -65,15 +65,15 @@ define( | ||||
|          * Months are zero-indexed, day-of-months are one-indexed. | ||||
|          */ | ||||
|         function DateTimePickerController($scope, now) { | ||||
|             var year, | ||||
|                 month, // For picker state, not model state | ||||
|                 interacted = false; | ||||
|             var year; | ||||
|             var month; // For picker state, not model state | ||||
|             var interacted = false; | ||||
|  | ||||
|             function generateTable() { | ||||
|                 var m = moment.utc({ year: year, month: month }).day(0), | ||||
|                     table = [], | ||||
|                     row, | ||||
|                     col; | ||||
|                 var m = moment.utc({ year: year, month: month }).day(0); | ||||
|                 var table = []; | ||||
|                 var row; | ||||
|                 var col; | ||||
|  | ||||
|                 for (row = 0; row < 6; row += 1) { | ||||
|                     table.push([]); | ||||
|   | ||||
| @@ -40,9 +40,9 @@ define( | ||||
|  | ||||
|             // Gets an array of the contextual parents/ancestors of the selected object | ||||
|             function getContextualPath() { | ||||
|                 var currentObj = $scope.domainObject, | ||||
|                     currentParent, | ||||
|                     parents = []; | ||||
|                 var currentObj = $scope.domainObject; | ||||
|                 var currentParent; | ||||
|                 var parents = []; | ||||
|  | ||||
|                 currentParent = currentObj && | ||||
|                     currentObj.hasCapability('context') && | ||||
|   | ||||
| @@ -35,10 +35,10 @@ define( | ||||
|          * @param $scope Angular scope for this controller | ||||
|          */ | ||||
|         function SelectorController(objectService, $scope) { | ||||
|             var treeModel = {}, | ||||
|                 listModel = {}, | ||||
|                 previousSelected, | ||||
|                 self = this; | ||||
|             var treeModel = {}; | ||||
|             var listModel = {}; | ||||
|             var previousSelected; | ||||
|             var self = this; | ||||
|  | ||||
|             // For watch; look at the user's selection in the tree | ||||
|             function getTreeSelection() { | ||||
| @@ -126,8 +126,8 @@ define( | ||||
|          * @param {DomainObject} the domain object to select | ||||
|          */ | ||||
|         SelectorController.prototype.select = function (domainObject) { | ||||
|             var id = domainObject && domainObject.getId(), | ||||
|                 list = this.getField() || []; | ||||
|             var id = domainObject && domainObject.getId(); | ||||
|             var list = this.getField() || []; | ||||
|             // Only select if we have a valid id, | ||||
|             // and it isn't already selected | ||||
|             if (id && list.indexOf(id) === -1) { | ||||
| @@ -140,8 +140,8 @@ define( | ||||
|          * @param {DomainObject} the domain object to select | ||||
|          */ | ||||
|         SelectorController.prototype.deselect = function (domainObject) { | ||||
|             var id = domainObject && domainObject.getId(), | ||||
|                 list = this.getField() || []; | ||||
|             var id = domainObject && domainObject.getId(); | ||||
|             var list = this.getField() || []; | ||||
|             // Only change if this was a valid id, | ||||
|             // for an object which was already selected | ||||
|             if (id && list.indexOf(id) !== -1) { | ||||
|   | ||||
| @@ -101,7 +101,12 @@ define([ | ||||
|     }; | ||||
|  | ||||
|     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; | ||||
|         start = this.$scope.ngModel.outer.start; | ||||
|         span = end - start; | ||||
| @@ -197,9 +202,9 @@ define([ | ||||
|     }; | ||||
|  | ||||
|     TimeRangeController.prototype.middleDrag = function (pixels) { | ||||
|         var delta = this.toMillis(pixels), | ||||
|             edge = delta < 0 ? 'start' : 'end', | ||||
|             opposite = delta < 0 ? 'end' : 'start'; | ||||
|         var delta = this.toMillis(pixels); | ||||
|         var edge = delta < 0 ? 'start' : 'end'; | ||||
|         var opposite = delta < 0 ? 'end' : 'start'; | ||||
|  | ||||
|         // Adjust the position of the edge in the direction of drag | ||||
|         this.$scope.ngModel.inner[edge] = clamp( | ||||
|   | ||||
| @@ -59,8 +59,8 @@ define( | ||||
|          * @constructor | ||||
|          */ | ||||
|         function TreeNodeController($scope, $timeout) { | ||||
|             var self = this, | ||||
|                 selectedObject = ($scope.ngModel || {}).selectedObject; | ||||
|             var self = this; | ||||
|             var selectedObject = ($scope.ngModel || {}).selectedObject; | ||||
|  | ||||
|             // Look up the id for a domain object. A convenience | ||||
|             // for mapping; additionally does some undefined-checking. | ||||
| @@ -86,14 +86,14 @@ define( | ||||
|             // Consider the currently-navigated object and update | ||||
|             // parameters which support display. | ||||
|             function checkSelection() { | ||||
|                 var nodeObject = $scope.domainObject, | ||||
|                     navObject = selectedObject, | ||||
|                     nodeContext = nodeObject && | ||||
|                         nodeObject.getCapability('context'), | ||||
|                     navContext = navObject && | ||||
|                         navObject.getCapability('context'), | ||||
|                     nodePath, | ||||
|                     navPath; | ||||
|                 var nodeObject = $scope.domainObject; | ||||
|                 var navObject = selectedObject; | ||||
|                 var nodeContext = nodeObject && | ||||
|                         nodeObject.getCapability('context'); | ||||
|                 var navContext = navObject && | ||||
|                         navObject.getCapability('context'); | ||||
|                 var nodePath; | ||||
|                 var navPath; | ||||
|  | ||||
|                 // Deselect; we will reselect below, iff we are | ||||
|                 // exactly at the end of the path. | ||||
|   | ||||
| @@ -42,13 +42,13 @@ define( | ||||
|                 var body = $document.find('body'); | ||||
|  | ||||
|                 function clickBody(event) { | ||||
|                     var x = event.clientX, | ||||
|                         y = event.clientY, | ||||
|                         rect = element[0].getBoundingClientRect(), | ||||
|                         xMin = rect.left, | ||||
|                         xMax = xMin + rect.width, | ||||
|                         yMin = rect.top, | ||||
|                         yMax = yMin + rect.height; | ||||
|                     var x = event.clientX; | ||||
|                     var y = event.clientY; | ||||
|                     var rect = element[0].getBoundingClientRect(); | ||||
|                     var xMin = rect.left; | ||||
|                     var xMax = xMin + rect.width; | ||||
|                     var yMin = rect.top; | ||||
|                     var yMax = yMin + rect.height; | ||||
|  | ||||
|                     if (x < xMin || x > xMax || y < yMin || y > yMax) { | ||||
|                         scope.$apply(function () { | ||||
|   | ||||
| @@ -62,10 +62,10 @@ define( | ||||
|                 // Populate initial scope based on attributes requested | ||||
|                 // by the container definition | ||||
|                 link: function (scope, element, attrs) { | ||||
|                     var key = attrs.key, | ||||
|                         container = containerMap[key], | ||||
|                         alias = "container", | ||||
|                         copiedAttributes = {}; | ||||
|                     var key = attrs.key; | ||||
|                     var container = containerMap[key]; | ||||
|                     var alias = "container"; | ||||
|                     var copiedAttributes = {}; | ||||
|  | ||||
|                     if (container) { | ||||
|                         alias = container.alias || alias; | ||||
| @@ -78,8 +78,8 @@ define( | ||||
|                 }, | ||||
|  | ||||
|                 template: function (element, attrs) { | ||||
|                     var key = attrs.key, | ||||
|                         container = containerMap[key]; | ||||
|                     var key = attrs.key; | ||||
|                     var container = containerMap[key]; | ||||
|                     return container ? container.template : ""; | ||||
|                 } | ||||
|             }; | ||||
|   | ||||
| @@ -54,12 +54,12 @@ define( | ||||
|                 // mouse event handlers; mousedown and mouseup cannot | ||||
|                 // only be attached to the element being linked, as the | ||||
|                 // mouse may leave this element during the drag. | ||||
|                 var body = $document.find('body'), | ||||
|                     isMobile = agentService.isMobile(), | ||||
|                     touchEvents, | ||||
|                     initialPosition, | ||||
|                     $event, | ||||
|                     delta; | ||||
|                 var body = $document.find('body'); | ||||
|                 var isMobile = agentService.isMobile(); | ||||
|                 var touchEvents; | ||||
|                 var initialPosition; | ||||
|                 var $event; | ||||
|                 var delta; | ||||
|  | ||||
|                 if (isMobile) { | ||||
|                     touchEvents = { | ||||
|   | ||||
| @@ -44,10 +44,10 @@ define( | ||||
|          */ | ||||
|         function MCTPopup($compile, popupService) { | ||||
|             function link(scope, element, attrs, ctrl, transclude) { | ||||
|                 var div = $compile(TEMPLATE)(scope), | ||||
|                     rect = element.parent()[0].getBoundingClientRect(), | ||||
|                     position = [rect.left, rect.top], | ||||
|                     popup = popupService.display(div, position); | ||||
|                 var div = $compile(TEMPLATE)(scope); | ||||
|                 var rect = element.parent()[0].getBoundingClientRect(); | ||||
|                 var position = [rect.left, rect.top]; | ||||
|                 var popup = popupService.display(div, position); | ||||
|  | ||||
|                 div.addClass('t-popup'); | ||||
|                 transclude(function (clone) { | ||||
|   | ||||
| @@ -55,9 +55,9 @@ define( | ||||
|  | ||||
|             // Link; start listening for changes to an element's size | ||||
|             function link(scope, element, attrs) { | ||||
|                 var lastBounds, | ||||
|                     linking = true, | ||||
|                     active = true; | ||||
|                 var lastBounds; | ||||
|                 var linking = true; | ||||
|                 var active = true; | ||||
|  | ||||
|                 // Determine how long to wait before the next update | ||||
|                 function currentInterval() { | ||||
|   | ||||
| @@ -44,8 +44,8 @@ define( | ||||
|          */ | ||||
|         function MCTScroll($parse, property, attribute) { | ||||
|             function link(scope, element, attrs) { | ||||
|                 var expr = attrs[attribute], | ||||
|                     parsed = $parse(expr); | ||||
|                 var expr = attrs[attribute]; | ||||
|                 var parsed = $parse(expr); | ||||
|  | ||||
|                 // Set the element's scroll to match the scope's state | ||||
|                 function updateElement(value) { | ||||
|   | ||||
| @@ -25,47 +25,47 @@ define( | ||||
|     function () { | ||||
|  | ||||
|         // Pixel width to allocate for the splitter itself | ||||
|         var DEFAULT_ANCHOR = 'left', | ||||
|             POLLING_INTERVAL = 15, // milliseconds | ||||
|             CHILDREN_WARNING_MESSAGE = [ | ||||
|                 "Invalid mct-split-pane contents.", | ||||
|                 "This element should contain exactly three", | ||||
|                 "child elements, where the middle-most element", | ||||
|                 "is an mct-splitter." | ||||
|             ].join(" "), | ||||
|             ANCHOR_WARNING_MESSAGE = [ | ||||
|                 "Unknown anchor provided to mct-split-pane,", | ||||
|                 "defaulting to", | ||||
|                 DEFAULT_ANCHOR + "." | ||||
|             ].join(" "), | ||||
|             ANCHORS = { | ||||
|                 left: { | ||||
|                     edge: "left", | ||||
|                     opposite: "right", | ||||
|                     dimension: "width", | ||||
|                     orientation: "vertical" | ||||
|                 }, | ||||
|                 right: { | ||||
|                     edge: "right", | ||||
|                     opposite: "left", | ||||
|                     dimension: "width", | ||||
|                     orientation: "vertical", | ||||
|                     reversed: true | ||||
|                 }, | ||||
|                 top: { | ||||
|                     edge: "top", | ||||
|                     opposite: "bottom", | ||||
|                     dimension: "height", | ||||
|                     orientation: "horizontal" | ||||
|                 }, | ||||
|                 bottom: { | ||||
|                     edge: "bottom", | ||||
|                     opposite: "top", | ||||
|                     dimension: "height", | ||||
|                     orientation: "horizontal", | ||||
|                     reversed: true | ||||
|                 } | ||||
|             }; | ||||
|         var DEFAULT_ANCHOR = 'left'; | ||||
|         var POLLING_INTERVAL = 15; // milliseconds | ||||
|         var CHILDREN_WARNING_MESSAGE = [ | ||||
|             "Invalid mct-split-pane contents.", | ||||
|             "This element should contain exactly three", | ||||
|             "child elements, where the middle-most element", | ||||
|             "is an mct-splitter." | ||||
|         ].join(" "); | ||||
|         var ANCHOR_WARNING_MESSAGE = [ | ||||
|             "Unknown anchor provided to mct-split-pane;", | ||||
|             "defaulting to", | ||||
|             DEFAULT_ANCHOR + "." | ||||
|         ].join(" "); | ||||
|         var ANCHORS = { | ||||
|             left: { | ||||
|                 edge: "left", | ||||
|                 opposite: "right", | ||||
|                 dimension: "width", | ||||
|                 orientation: "vertical" | ||||
|             }, | ||||
|             right: { | ||||
|                 edge: "right", | ||||
|                 opposite: "left", | ||||
|                 dimension: "width", | ||||
|                 orientation: "vertical", | ||||
|                 reversed: true | ||||
|             }, | ||||
|             top: { | ||||
|                 edge: "top", | ||||
|                 opposite: "bottom", | ||||
|                 dimension: "height", | ||||
|                 orientation: "horizontal" | ||||
|             }, | ||||
|             bottom: { | ||||
|                 edge: "bottom", | ||||
|                 opposite: "top", | ||||
|                 dimension: "height", | ||||
|                 orientation: "horizontal", | ||||
|                 reversed: true | ||||
|             } | ||||
|         }; | ||||
|  | ||||
|         /** | ||||
|          * Implements `mct-split-pane` directive. | ||||
| @@ -95,19 +95,19 @@ define( | ||||
|          */ | ||||
|         function MCTSplitPane($parse, $log, $interval, $window) { | ||||
|             function controller($scope, $element, $attrs) { | ||||
|                 var anchorKey = $attrs.anchor || DEFAULT_ANCHOR, | ||||
|                     positionParsed = $parse($attrs.position), | ||||
|                     anchor, | ||||
|                     activeInterval, | ||||
|                     position, | ||||
|                     splitterSize, | ||||
|                 var anchorKey = $attrs.anchor || DEFAULT_ANCHOR; | ||||
|                 var positionParsed = $parse($attrs.position); | ||||
|                 var anchor; | ||||
|                 var activeInterval; | ||||
|                 var position; | ||||
|                 var splitterSize; | ||||
|  | ||||
|                     alias = $attrs.alias !== undefined ? | ||||
|                         "mctSplitPane-" + $attrs.alias : undefined, | ||||
|                 var alias = $attrs.alias !== undefined ? | ||||
|                     "mctSplitPane-" + $attrs.alias : undefined; | ||||
|  | ||||
|                     //convert string to number from localStorage | ||||
|                     userWidthPreference = $window.localStorage.getItem(alias) === null ? | ||||
|                         undefined : Number($window.localStorage.getItem(alias)); | ||||
|                 //convert string to number from localStorage | ||||
|                 var userWidthPreference = $window.localStorage.getItem(alias) === null ? | ||||
|                     undefined : Number($window.localStorage.getItem(alias)); | ||||
|  | ||||
|                 // Get relevant size (height or width) of DOM element | ||||
|                 function getSize(domElement) { | ||||
| @@ -121,10 +121,10 @@ define( | ||||
|  | ||||
|                     // Pick out correct elements to update, flowing from | ||||
|                     // selected anchor edge. | ||||
|                     var first = children.eq(anchor.reversed ? 2 : 0), | ||||
|                         splitter = children.eq(1), | ||||
|                         last = children.eq(anchor.reversed ? 0 : 2), | ||||
|                         firstSize; | ||||
|                     var first = children.eq(anchor.reversed ? 2 : 0); | ||||
|                     var splitter = children.eq(1); | ||||
|                     var last = children.eq(anchor.reversed ? 0 : 2); | ||||
|                     var firstSize; | ||||
|  | ||||
|                     splitterSize = getSize(splitter[0]); | ||||
|                     first.css(anchor.edge, "0px"); | ||||
|   | ||||
| @@ -37,8 +37,8 @@ define( | ||||
|          */ | ||||
|         function MCTSplitter() { | ||||
|             function link(scope, element, attrs, mctSplitPane) { | ||||
|                 var initialPosition, | ||||
|                     newPosition; | ||||
|                 var initialPosition; | ||||
|                 var newPosition; | ||||
|  | ||||
|                 element.addClass("splitter"); | ||||
|  | ||||
| @@ -50,9 +50,9 @@ define( | ||||
|                     }, | ||||
|                     // Handle user changes to splitter position | ||||
|                     move: function (delta) { | ||||
|                         var anchor = mctSplitPane.anchor(), | ||||
|                             index = anchor.orientation === "vertical" ? 0 : 1, | ||||
|                             pixelDelta = delta[index] * | ||||
|                         var anchor = mctSplitPane.anchor(); | ||||
|                         var index = anchor.orientation === "vertical" ? 0 : 1; | ||||
|                         var pixelDelta = delta[index] * | ||||
|                                 (anchor.reversed ? -1 : 1); | ||||
|  | ||||
|                         // Update the position of this splitter | ||||
|   | ||||
| @@ -75,13 +75,13 @@ define( | ||||
|          * @returns {platform/commonUI/general.Popup} the popup | ||||
|          */ | ||||
|         PopupService.prototype.display = function (element, position, options) { | ||||
|             var $document = this.$document, | ||||
|                 $window = this.$window, | ||||
|                 body = $document.find('body'), | ||||
|                 winDim = [$window.innerWidth, $window.innerHeight], | ||||
|                 styles = { position: 'absolute' }, | ||||
|                 margin, | ||||
|                 offset; | ||||
|             var $document = this.$document; | ||||
|             var $window = this.$window; | ||||
|             var body = $document.find('body'); | ||||
|             var winDim = [$window.innerWidth, $window.innerHeight]; | ||||
|             var styles = { position: 'absolute' }; | ||||
|             var margin; | ||||
|             var offset; | ||||
|  | ||||
|             function adjustNegatives(value, index) { | ||||
|                 return value < 0 ? (value + winDim[index]) : value; | ||||
|   | ||||
| @@ -48,11 +48,11 @@ define( | ||||
|          */ | ||||
|         UrlService.prototype.urlForLocation = function (mode, domainObject) { | ||||
|             var context = domainObject && | ||||
|                     domainObject.getCapability('context'), | ||||
|                 objectPath = context ? context.getPath() : [], | ||||
|                 ids = objectPath.map(function (domainObj) { | ||||
|                     return domainObj.getId(); | ||||
|                 }); | ||||
|                     domainObject.getCapability('context'); | ||||
|             var objectPath = context ? context.getPath() : []; | ||||
|             var ids = objectPath.map(function (domainObj) { | ||||
|                 return domainObj.getId(); | ||||
|             }); | ||||
|  | ||||
|             // Parses the path together. Starts with the | ||||
|             // default index.html file, then the mode passed | ||||
| @@ -73,15 +73,15 @@ define( | ||||
|          * @returns {string} URL for the domain object | ||||
|          */ | ||||
|         UrlService.prototype.urlForNewTab = function (mode, domainObject) { | ||||
|             var search = this.$location.search(), | ||||
|                 arr = []; | ||||
|             var search = this.$location.search(); | ||||
|             var arr = []; | ||||
|             for (var key in search) { | ||||
|                 if (search.hasOwnProperty(key)) { | ||||
|                     arr.push(key + '=' + search[key]); | ||||
|                 } | ||||
|             } | ||||
|             var searchPath = "?" + arr.join('&'), | ||||
|                 newTabPath = | ||||
|             var searchPath = "?" + arr.join('&'); | ||||
|             var newTabPath = | ||||
|                     "#" + this.urlForLocation(mode, domainObject) + | ||||
|                             searchPath; | ||||
|             return newTabPath; | ||||
|   | ||||
| @@ -47,8 +47,8 @@ define([ | ||||
|     } | ||||
|  | ||||
|     TreeLabelView.prototype.updateView = function (domainObject) { | ||||
|         var titleEl = this.el.find('.t-title-label'), | ||||
|             iconEl = this.el.find('.t-item-icon'); | ||||
|         var titleEl = this.el.find('.t-title-label'); | ||||
|         var iconEl = this.el.find('.t-item-icon'); | ||||
|  | ||||
|         removePreviousIconClass(iconEl); | ||||
|  | ||||
|   | ||||
| @@ -116,8 +116,8 @@ define([ | ||||
|     } | ||||
|  | ||||
|     TreeNodeView.prototype.value = function (domainObject) { | ||||
|         var activeIdPath = getIdPath(this.activeObject), | ||||
|             selectedIdPath = getIdPath(domainObject); | ||||
|         var activeIdPath = getIdPath(this.activeObject); | ||||
|         var selectedIdPath = getIdPath(domainObject); | ||||
|  | ||||
|         if (this.onSelectionPath) { | ||||
|             this.li.find('.js-tree__item').eq(0).removeClass('is-selected'); | ||||
|   | ||||
| @@ -61,8 +61,8 @@ define([ | ||||
|     }; | ||||
|  | ||||
|     TreeView.prototype.loadComposition = function () { | ||||
|         var self = this, | ||||
|             domainObject = this.activeObject; | ||||
|         var self = this; | ||||
|         var domainObject = this.activeObject; | ||||
|  | ||||
|         function addNode(domainObj, index) { | ||||
|             self.nodeViews[index].model(domainObj); | ||||
|   | ||||
| @@ -25,8 +25,8 @@ define([ | ||||
| ], function (SplashScreenManager) { | ||||
|  | ||||
|     describe('SplashScreenManager', function () { | ||||
|         var $document, | ||||
|             splashElement; | ||||
|         var $document; | ||||
|         var splashElement; | ||||
|  | ||||
|         beforeEach(function () { | ||||
|             $document = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -25,13 +25,13 @@ define( | ||||
|     function (StyleSheetLoader) { | ||||
|  | ||||
|         describe("The style sheet loader", function () { | ||||
|             var testStyleSheets, | ||||
|                 mockDocument, | ||||
|                 mockPlainDocument, | ||||
|                 mockHead, | ||||
|                 mockElement, | ||||
|                 testBundle, | ||||
|                 loader; // eslint-disable-line | ||||
|             var testStyleSheets; | ||||
|             var mockDocument; | ||||
|             var mockPlainDocument; | ||||
|             var mockHead; | ||||
|             var mockElement; | ||||
|             var testBundle; | ||||
|             var loader; // eslint-disable-line | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 testBundle = { | ||||
|   | ||||
| @@ -25,9 +25,9 @@ define( | ||||
|     function (ActionGroupController) { | ||||
|  | ||||
|         describe("The action group controller", function () { | ||||
|             var mockScope, | ||||
|                 mockActions, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockActions; | ||||
|             var controller; | ||||
|  | ||||
|             function mockAction(metadata, index) { | ||||
|                 var action = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -25,9 +25,9 @@ define( | ||||
|     function (ClickAwayController) { | ||||
|  | ||||
|         describe("The click-away controller", function () { | ||||
|             var mockDocument, | ||||
|                 mockTimeout, | ||||
|                 controller; | ||||
|             var mockDocument; | ||||
|             var mockTimeout; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockDocument = jasmine.createSpyObj( | ||||
| @@ -77,7 +77,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             it("deactivates and detaches listener on document click", function () { | ||||
|                 var callback, timeout; | ||||
|                 var callback; | ||||
|                 var timeout; | ||||
|                 controller.setState(true); | ||||
|                 callback = mockDocument.on.calls.mostRecent().args[1]; | ||||
|                 callback(); | ||||
|   | ||||
| @@ -27,10 +27,10 @@ define( | ||||
|         var TEST_FORMAT = "YYYY-MM-DD HH:mm:ss"; | ||||
|  | ||||
|         describe("The DateTimeFieldController", function () { | ||||
|             var mockScope, | ||||
|                 mockFormatService, | ||||
|                 mockFormat, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockFormatService; | ||||
|             var mockFormat; | ||||
|             var controller; | ||||
|  | ||||
|             function fireWatch(expr, value) { | ||||
|                 mockScope.$watch.calls.all().forEach(function (call) { | ||||
| @@ -124,7 +124,9 @@ define( | ||||
|             }); | ||||
|  | ||||
|             describe("when user input is invalid", function () { | ||||
|                 var newText, oldText, oldValue; | ||||
|                 var newText | ||||
|                 var oldText; | ||||
|                 var oldValue; | ||||
|  | ||||
|                 beforeEach(function () { | ||||
|                     newText = "Not a date"; | ||||
| @@ -156,8 +158,8 @@ define( | ||||
|                 // Don't want the controller "fixing" bad or | ||||
|                 // irregularly-formatted input out from under | ||||
|                 // the user's fingertips. | ||||
|                 var newText = "2015-3-3 01:02:04", | ||||
|                     oldValue = mockScope.ngModel.testField; | ||||
|                 var newText = "2015-3-3 01:02:04"; | ||||
|                 var oldValue = mockScope.ngModel.testField; | ||||
|  | ||||
|                 mockFormat.validate.and.returnValue(true); | ||||
|                 mockFormat.parse.and.returnValue(42); | ||||
| @@ -183,8 +185,8 @@ define( | ||||
|             }); | ||||
|  | ||||
|             describe("using the obtained format", function () { | ||||
|                 var testValue = 1234321, | ||||
|                     testText = "some text"; | ||||
|                 var testValue = 1234321; | ||||
|                 var testText = "some text"; | ||||
|  | ||||
|                 beforeEach(function () { | ||||
|                     mockFormat.validate.and.returnValue(true); | ||||
|   | ||||
| @@ -25,9 +25,9 @@ define( | ||||
|     function (DateTimePickerController, moment) { | ||||
|  | ||||
|         describe("The DateTimePickerController", function () { | ||||
|             var mockScope, | ||||
|                 mockNow, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockNow; | ||||
|             var controller; | ||||
|  | ||||
|             function fireWatch(expr, value) { | ||||
|                 mockScope.$watch.calls.all().forEach(function (call) { | ||||
| @@ -143,7 +143,8 @@ define( | ||||
|                     // Around the edges of the displayed calendar we | ||||
|                     // may be in previous or subsequent month, so | ||||
|                     // test around the middle. | ||||
|                     var i, originalMonth = mockScope.table[2][0].month; | ||||
|                     var i; | ||||
|                     var originalMonth = mockScope.table[2][0].month; | ||||
|  | ||||
|                     function mod12(month) { | ||||
|                         return ((month % 12) + 12) % 12; | ||||
|   | ||||
| @@ -25,9 +25,9 @@ define( | ||||
|     function (GetterSetterController) { | ||||
|  | ||||
|         describe("The getter-setter controller", function () { | ||||
|             var mockScope, | ||||
|                 mockModel, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockModel; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockScope = jasmine.createSpyObj("$scope", ["$watch"]); | ||||
|   | ||||
| @@ -28,13 +28,13 @@ define( | ||||
|     function (ObjectInspectorController) { | ||||
|  | ||||
|         describe("The object inspector controller ", function () { | ||||
|             var mockScope, | ||||
|                 mockObjectService, | ||||
|                 mockPromise, | ||||
|                 mockDomainObject, | ||||
|                 mockContextCapability, | ||||
|                 mockLocationCapability, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockObjectService; | ||||
|             var mockPromise; | ||||
|             var mockDomainObject; | ||||
|             var mockContextCapability; | ||||
|             var mockLocationCapability; | ||||
|             var controller; | ||||
|  | ||||
|             beforeEach(function () { | ||||
|                 mockScope = jasmine.createSpyObj( | ||||
|   | ||||
| @@ -25,12 +25,12 @@ define( | ||||
|     function (SelectorController) { | ||||
|  | ||||
|         describe("The controller for the 'selector' control", function () { | ||||
|             var mockObjectService, | ||||
|                 mockScope, | ||||
|                 mockDomainObject, | ||||
|                 mockType, | ||||
|                 mockDomainObjects, | ||||
|                 controller; | ||||
|             var mockObjectService; | ||||
|             var mockScope; | ||||
|             var mockDomainObject; | ||||
|             var mockType; | ||||
|             var mockDomainObjects; | ||||
|             var controller; | ||||
|  | ||||
|             function promiseOf(v) { | ||||
|                 return (v || {}).then ? v : { | ||||
|   | ||||
| @@ -24,19 +24,19 @@ define( | ||||
|     ["../../src/controllers/TimeRangeController", "moment"], | ||||
|     function (TimeRangeController, moment) { | ||||
|  | ||||
|         var SEC = 1000, | ||||
|             MIN = 60 * SEC, | ||||
|             HOUR = 60 * MIN, | ||||
|             DAY = 24 * HOUR; | ||||
|         var SEC = 1000; | ||||
|         var MIN = 60 * SEC; | ||||
|         var HOUR = 60 * MIN; | ||||
|         var DAY = 24 * HOUR; | ||||
|  | ||||
|         describe("The TimeRangeController", function () { | ||||
|             var mockScope, | ||||
|                 mockFormatService, | ||||
|                 testDefaultFormat, | ||||
|                 mockTimeout, | ||||
|                 mockNow, | ||||
|                 mockFormat, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockFormatService; | ||||
|             var testDefaultFormat; | ||||
|             var mockTimeout; | ||||
|             var mockNow; | ||||
|             var mockFormat; | ||||
|             var controller; | ||||
|  | ||||
|             function fireWatch(expr, value) { | ||||
|                 mockScope.$watch.calls.all().forEach(function (call) { | ||||
|   | ||||
| @@ -25,10 +25,10 @@ define( | ||||
|     function (TreeNodeController) { | ||||
|  | ||||
|         describe("The tree node controller", function () { | ||||
|             var mockScope, | ||||
|                 mockTimeout, | ||||
|                 mockDomainObject, | ||||
|                 controller; | ||||
|             var mockScope; | ||||
|             var mockTimeout; | ||||
|             var mockDomainObject; | ||||
|             var controller; | ||||
|  | ||||
|             function TestObject(id, context) { | ||||
|                 return { | ||||
| @@ -72,10 +72,10 @@ define( | ||||
|             it("tracks whether or not the represented object is currently navigated-to", function () { | ||||
|                 // This is needed to highlight the current selection | ||||
|                 var mockContext = jasmine.createSpyObj( | ||||
|                         "context", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     obj = new TestObject("test-object", mockContext); | ||||
|                     "context", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var obj = new TestObject("test-object", mockContext); | ||||
|  | ||||
|                 mockContext.getPath.and.returnValue([obj]); | ||||
|  | ||||
| @@ -93,15 +93,15 @@ define( | ||||
|  | ||||
|             it("expands a node if it is on the navigation path", function () { | ||||
|                 var mockParentContext = jasmine.createSpyObj( | ||||
|                         "parentContext", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     mockChildContext = jasmine.createSpyObj( | ||||
|                         "childContext", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     parent = new TestObject("parent", mockParentContext), | ||||
|                     child = new TestObject("child", mockChildContext); | ||||
|                     "parentContext", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var mockChildContext = jasmine.createSpyObj( | ||||
|                     "childContext", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var parent = new TestObject("parent", mockParentContext); | ||||
|                 var child = new TestObject("child", mockChildContext); | ||||
|  | ||||
|                 mockChildContext.getParent.and.returnValue(parent); | ||||
|                 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 () { | ||||
|                 var mockParentContext = jasmine.createSpyObj( | ||||
|                         "parentContext", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     mockChildContext = jasmine.createSpyObj( | ||||
|                         "childContext", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     parent = new TestObject("parent", mockParentContext), | ||||
|                     child = new TestObject("child", mockChildContext); | ||||
|                     "parentContext", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var mockChildContext = jasmine.createSpyObj( | ||||
|                     "childContext", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var parent = new TestObject("parent", mockParentContext); | ||||
|                 var child = new TestObject("child", mockChildContext); | ||||
|  | ||||
|                 mockChildContext.getParent.and.returnValue(parent); | ||||
|                 mockChildContext.getPath.and.returnValue([child, child]); | ||||
| @@ -162,15 +162,15 @@ define( | ||||
|  | ||||
|             it("does not expand a node if no context is available", function () { | ||||
|                 var mockParentContext = jasmine.createSpyObj( | ||||
|                         "parentContext", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     mockChildContext = jasmine.createSpyObj( | ||||
|                         "childContext", | ||||
|                         ["getParent", "getPath", "getRoot"] | ||||
|                     ), | ||||
|                     parent = new TestObject("parent", mockParentContext), | ||||
|                     child = new TestObject("child", undefined); | ||||
|                     "parentContext", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var mockChildContext = jasmine.createSpyObj( | ||||
|                     "childContext", | ||||
|                     ["getParent", "getPath", "getRoot"] | ||||
|                 ); | ||||
|                 var parent = new TestObject("parent", mockParentContext); | ||||
|                 var child = new TestObject("child", undefined); | ||||
|  | ||||
|                 mockChildContext.getParent.and.returnValue(parent); | ||||
|                 mockChildContext.getPath.and.returnValue([parent, child]); | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user