diff --git a/README.md b/README.md index c19be6ee1db..b9486dad3c8 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Differences between the two APIs include a move away from a declarative system o ## Building and Running Open MCT Locally Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website. +(These instructions assume you are installing as a non-root user; developers have [reported issues](https://github.com/nasa/openmct/issues/1151) running these steps with root privileges.) 1. Clone the source code diff --git a/app.js b/app.js index 20429a3a5f4..6b7b1bb6350 100644 --- a/app.js +++ b/app.js @@ -67,14 +67,10 @@ }); app.use('/proxyUrl', function proxyRequest(req, res, next) { - var targetUrl = req.query.url; - var queryParameters = req.query; - console.log('Proxying request to: ', targetUrl); - delete queryParameters['url']; + console.log('Proxying request to: ', req.query.url); req.pipe(request({ - url: targetUrl, - strictSSL: false, - qs: queryParameters + url: req.query.url, + strictSSL: false }).on('error', next)).pipe(res); }); diff --git a/bower.json b/bower.json index 1ebf5953a51..641d5486dac 100644 --- a/bower.json +++ b/bower.json @@ -21,7 +21,6 @@ "zepto": "^1.1.6", "eventemitter3": "^1.2.0", "d3": "~4.1.0", - "html2canvas": "^0.4.1", - "jspdf": "^1.2.61" + "html2canvas": "^0.4.1" } } diff --git a/build-docs.sh b/build-docs.sh index 73d387bcff3..29841f921e4 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -32,7 +32,7 @@ WEBSITE_DIRECTORY="website" BUILD_SHA=`git rev-parse HEAD` # A remote will be created for the git repository we are pushing to. -# Don't worry, as this entire directory will get trashed inbetween builds. +# Don't worry, as this entire directory will get trashed in between builds. REMOTE_NAME="documentation" WEBSITE_BRANCH="master" diff --git a/docs/src/architecture/platform.md b/docs/src/architecture/platform.md index f7f0c48cdab..48ceebb9efa 100644 --- a/docs/src/architecture/platform.md +++ b/docs/src/architecture/platform.md @@ -616,7 +616,7 @@ follows: part of an action's extension definition. * `CreateActionProvider` provides the various Create actions which populate the Create menu. These are driven by the available types, - so do not map easily ot extension category `actions`; instead, these + so do not map easily to extension category `actions`; instead, these are generated after looking up which actions are available from the [`TypeService`](#type-service). * `ActionAggregator` merges together actions from multiple providers. diff --git a/docs/src/design/proposals/APIRedesign.md b/docs/src/design/proposals/APIRedesign.md index e6230823ed6..03ce2f212fe 100644 --- a/docs/src/design/proposals/APIRedesign.md +++ b/docs/src/design/proposals/APIRedesign.md @@ -98,7 +98,7 @@ Worked on bug fixes in the platform and a plugin for search. It is hard to figure out what the difference between the various ways of dealing with telemetry are. e.g., what is the difference between just "Telemetry" and the "Telemetry Service"? There are many - "Telemetry Thing"s which seem related, but in an unclear way. + "Telemetry Things" which seem related, but in an unclear way. ### Developer Intern 2 @@ -456,7 +456,7 @@ Instead, propose that: For parity with actions, a `View` would be a constructor which takes an `ActionContext` as a parameter (with similarly-defined properties) and exposes a method to retrieve the HTML elements -associateed with it. +associated with it. The platform would then additionally expose an `AngularView` implementation to improve compatibility with existing diff --git a/docs/src/design/proposals/APIRedesign_PeteRichards.md b/docs/src/design/proposals/APIRedesign_PeteRichards.md index dce80c41aec..517d61cc505 100644 --- a/docs/src/design/proposals/APIRedesign_PeteRichards.md +++ b/docs/src/design/proposals/APIRedesign_PeteRichards.md @@ -99,7 +99,7 @@ To reduce interface depth, we can replace our own provider and registry patterns ## More angular: for all services -Increasing our commitment to angular would mean using more of the angular factorys, services, etc, and less of our home grown tools. We'd implement our services and extension points as angular providers, and make them configurable via app.config. +Increasing our commitment to angular would mean using more of the angular factories, services, etc, and less of our home grown tools. We'd implement our services and extension points as angular providers, and make them configurable via app.config. As an example, registering a specific type of model provider in angular would look like: diff --git a/docs/src/tutorials/index.md b/docs/src/tutorials/index.md index 0e48fcf11fc..d8842de9d77 100644 --- a/docs/src/tutorials/index.md +++ b/docs/src/tutorials/index.md @@ -3238,7 +3238,7 @@ define( __tutorials/telemetry/src/ExampleTelemetryServerAdapter.js__ Here, we have added `subscribe` and `unsubscribe` methods which issue the -corresponding requests to the server. Seperately, we introduce the ability to +corresponding requests to the server. Separately, we introduce the ability to listen for `data` messages as they come in: These will contain the data associated with these subscriptions. diff --git a/example/eventGenerator/data/transcript.json b/example/eventGenerator/data/transcript.json index 0416220e71d..ce787353303 100644 --- a/example/eventGenerator/data/transcript.json +++ b/example/eventGenerator/data/transcript.json @@ -10,7 +10,7 @@ "LMP: 47 degrees.", "CC: Eagle, looking great. You're GO.", "CC: Roger. 1202. We copy it.", - "O1: LMP 35 degrees. 35 degrees. 750. Coming aown to 23.fl", + "O1: LMP 35 degrees. 35 degrees. 750. Coming down to 23.fl", "LMP: 700 feet, 21 down, 33 degrees.", "LMP: 600 feet, down at 19.", "LMP: 540 feet, down at - 30. Down at 15.", diff --git a/gulpfile.js b/gulpfile.js index bf522248635..ff994c6a2c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -103,11 +103,6 @@ gulp.task('stylesheets', function () { .pipe(gulp.dest(__dirname)); }); -gulp.task('nsp', function (done) { - var nsp = require('gulp-nsp'); - nsp({package: __dirname + '/package.json'}, done); -}); - gulp.task('lint', function () { var nonspecs = paths.specs.map(function (glob) { return "!" + glob; @@ -157,6 +152,6 @@ gulp.task('develop', ['serve', 'stylesheets', 'watch']); gulp.task('install', [ 'static', 'scripts' ]); -gulp.task('verify', [ 'lint', 'test', 'checkstyle', 'nsp' ]); +gulp.task('verify', [ 'lint', 'test', 'checkstyle' ]); gulp.task('build', [ 'verify', 'install' ]); diff --git a/main.js b/main.js index c7f5ae1e445..76512d36f42 100644 --- a/main.js +++ b/main.js @@ -30,7 +30,6 @@ requirejs.config({ "EventEmitter": "bower_components/eventemitter3/index", "es6-promise": "bower_components/es6-promise/es6-promise.min", "html2canvas": "bower_components/html2canvas/build/html2canvas.min", - "jsPDF": "bower_components/jspdf/dist/jspdf.min", "moment": "bower_components/moment/moment", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "saveAs": "bower_components/FileSaver.js/FileSaver.min", @@ -50,9 +49,6 @@ requirejs.config({ "html2canvas": { "exports": "html2canvas" }, - "jsPDF": { - "exports": "jsPDF" - }, "EventEmitter": { "exports": "EventEmitter" }, diff --git a/package.json b/package.json index 5563f65c82a..e47a64e50e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "0.11.3-SNAPSHOT", + "version": "0.12.0-SNAPSHOT", "description": "The Open MCT core platform", "dependencies": { "express": "^4.13.1", @@ -15,7 +15,6 @@ "gulp-jscs": "^3.0.2", "gulp-jshint": "^2.0.0", "gulp-jshint-html-reporter": "^0.1.3", - "gulp-nsp": "^2.4.2", "gulp-rename": "^1.2.2", "gulp-replace-task": "^0.11.0", "gulp-requirejs-optimize": "^0.3.1", diff --git a/platform/commonUI/browse/src/navigation/NavigateAction.js b/platform/commonUI/browse/src/navigation/NavigateAction.js index b3d935812a3..6121213a51e 100644 --- a/platform/commonUI/browse/src/navigation/NavigateAction.js +++ b/platform/commonUI/browse/src/navigation/NavigateAction.js @@ -48,20 +48,35 @@ define( */ NavigateAction.prototype.perform = function () { var self = this, - navigationAllowed = true; + navigateTo = this.domainObject, + currentObject = self.navigationService.getNavigation(); function allow() { - self.policyService.allow("navigation", self.navigationService.getNavigation(), self.domainObject, function (message) { + var navigationAllowed = true; + self.policyService.allow("navigation", currentObject, navigateTo, function (message) { navigationAllowed = self.$window.confirm(message + "\r\n\r\n" + " Are you sure you want to continue?"); }); return navigationAllowed; } - // Set navigation, and wrap like a promise - return this.$q.when( - allow() && this.navigationService.setNavigation(this.domainObject) - ); + function cancelIfEditing() { + var editing = currentObject.hasCapability('editor') && + currentObject.getCapability('editor').isEditContextRoot(); + + return self.$q.when(editing && currentObject.getCapability("editor").finish()); + } + + function navigate() { + return self.navigationService.setNavigation(navigateTo); + } + + if (allow()) { + return cancelIfEditing().then(navigate); + } else { + return this.$q.when(false); + } + }; /** diff --git a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js index 003012372bf..f9b756eeaa3 100644 --- a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js +++ b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js @@ -32,7 +32,9 @@ define( mockQ, mockDomainObject, mockPolicyService, + mockNavigatedObject, mockWindow, + capabilities, action; function mockPromise(value) { @@ -44,6 +46,29 @@ define( } beforeEach(function () { + capabilities = {}; + + mockQ = { when: mockPromise }; + mockNavigatedObject = jasmine.createSpyObj( + "domainObject", + [ + "getId", + "getModel", + "hasCapability", + "getCapability" + ] + ); + + capabilities.editor = jasmine.createSpyObj("editorCapability", [ + "isEditContextRoot", + "finish" + ]); + + mockNavigatedObject.getCapability.andCallFake(function (capability) { + return capabilities[capability]; + }); + mockNavigatedObject.hasCapability.andReturn(false); + mockNavigationService = jasmine.createSpyObj( "navigationService", [ @@ -51,11 +76,14 @@ define( "getNavigation" ] ); - mockNavigationService.getNavigation.andReturn({}); - mockQ = { when: mockPromise }; + mockNavigationService.getNavigation.andReturn(mockNavigatedObject); + mockDomainObject = jasmine.createSpyObj( "domainObject", - ["getId", "getModel", "getCapability"] + [ + "getId", + "getModel" + ] ); mockPolicyService = jasmine.createSpyObj("policyService", @@ -112,6 +140,21 @@ define( }); }); + describe("in edit mode", function () { + beforeEach(function () { + mockNavigatedObject.hasCapability.andCallFake(function (capability) { + return capability === "editor"; + }); + capabilities.editor.isEditContextRoot.andReturn(true); + }); + + it("finishes editing if in edit mode", function () { + action.perform(); + expect(capabilities.editor.finish) + .toHaveBeenCalled(); + }); + }); + it("is only applicable when a domain object is in context", function () { expect(NavigateAction.appliesTo({})).toBeFalsy(); expect(NavigateAction.appliesTo({ diff --git a/platform/commonUI/dialog/res/templates/overlay.html b/platform/commonUI/dialog/res/templates/overlay.html index 825d8fe4f46..215fe97aac5 100644 --- a/platform/commonUI/dialog/res/templates/overlay.html +++ b/platform/commonUI/dialog/res/templates/overlay.html @@ -19,7 +19,7 @@ this source code distribution or the Licensing information page available at runtime from the About dialog for additional information. --> -