From f0064fd91ff7928445fdaa6856b83ca671367bf5 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 29 Aug 2016 10:58:02 -0700 Subject: [PATCH 01/56] [README] Warn about root installation issues Mitigates #1151. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cce52a9921..3bdb9835d2 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 From e75146119417a3d4f6c51df836a2a55fc4bf277e Mon Sep 17 00:00:00 2001 From: steven mirecki Date: Sat, 3 Sep 2016 09:16:54 -0400 Subject: [PATCH 02/56] Typo corrections, I avoided making changes to words that have regional spelling differences. --- build-docs.sh | 2 +- docs/src/architecture/platform.md | 2 +- docs/src/design/proposals/APIRedesign.md | 4 ++-- docs/src/design/proposals/APIRedesign_PeteRichards.md | 2 +- docs/src/tutorials/index.md | 2 +- example/eventGenerator/data/transcript.json | 2 +- platform/commonUI/dialog/src/DialogService.js | 2 +- platform/commonUI/edit/test/creation/CreationServiceSpec.js | 2 +- .../commonUI/edit/test/representers/EditRepresenterSpec.js | 2 +- .../edit/test/representers/EditToolbarRepresenterSpec.js | 2 +- .../general/src/controllers/ObjectInspectorController.js | 4 ++-- platform/commonUI/general/src/filters/ReverseFilter.js | 2 +- platform/commonUI/general/src/services/PopupService.js | 2 +- .../general/test/controllers/ClickAwayControllerSpec.js | 2 +- .../general/test/controllers/ToggleControllerSpec.js | 2 +- platform/commonUI/mobile/test/MCTDeviceSpec.js | 2 +- platform/commonUI/notification/src/NotificationService.js | 2 +- platform/containment/test/CapabilityTableSpec.js | 2 +- platform/containment/test/ContainmentTableSpec.js | 2 +- platform/core/src/models/ModelCacheService.js | 2 +- platform/core/src/models/RootModelProvider.js | 2 +- platform/core/src/models/StaticModelProvider.js | 2 +- platform/core/src/types/TypePropertyConversion.js | 2 +- platform/core/src/types/TypeProvider.js | 2 +- platform/entanglement/README.md | 2 +- platform/features/layout/src/FixedDragHandle.js | 2 +- platform/features/layout/src/LayoutController.js | 2 +- platform/features/layout/test/LayoutControllerSpec.js | 2 +- platform/features/plot/test/Canvas2DChartSpec.js | 2 +- platform/features/plot/test/GLChartSpec.js | 2 +- .../timeline/src/controllers/TimelineGanttController.js | 2 +- .../timeline/src/controllers/TimelineTickController.js | 2 +- .../timeline/src/controllers/drag/TimelineDragHandler.js | 2 +- .../timeline/src/controllers/drag/TimelineSnapHandler.js | 2 +- platform/framework/src/load/Bundle.js | 2 +- platform/persistence/couch/src/CouchDocument.js | 4 ++-- platform/persistence/couch/test/CouchIndicatorSpec.js | 6 +++--- platform/persistence/elastic/src/ElasticSearchProvider.js | 2 +- platform/persistence/elastic/test/ElasticIndicatorSpec.js | 4 ++-- platform/persistence/queue/src/PersistenceQueue.js | 2 +- platform/persistence/queue/src/PersistenceQueueHandler.js | 2 +- platform/search/src/services/GenericSearchProvider.js | 2 +- platform/search/test/controllers/SearchControllerSpec.js | 4 ++-- .../search/test/controllers/SearchMenuControllerSpec.js | 2 +- platform/telemetry/src/TelemetrySubscriber.js | 2 +- platform/telemetry/src/TelemetrySubscription.js | 2 +- 46 files changed, 53 insertions(+), 53 deletions(-) diff --git a/build-docs.sh b/build-docs.sh index 73d387bcff..29841f921e 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 f7f0c48cda..48ceebb9ef 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 e6230823ed..03ce2f212f 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 dce80c41ae..517d61cc50 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 0e48fcf11f..d8842de9d7 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 0416220e71..ce78735330 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/platform/commonUI/dialog/src/DialogService.js b/platform/commonUI/dialog/src/DialogService.js index ca0a4b09b7..071710fb68 100644 --- a/platform/commonUI/dialog/src/DialogService.js +++ b/platform/commonUI/dialog/src/DialogService.js @@ -187,7 +187,7 @@ define( /** * A description of the model options that may be passed to the - * showBlockingMessage method. Note that the DialogModel desribed + * showBlockingMessage method. Note that the DialogModel described * here is shared with the Notifications framework. * @see NotificationService * diff --git a/platform/commonUI/edit/test/creation/CreationServiceSpec.js b/platform/commonUI/edit/test/creation/CreationServiceSpec.js index 1cc6d55e1b..090437b8c7 100644 --- a/platform/commonUI/edit/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/edit/test/creation/CreationServiceSpec.js @@ -195,7 +195,7 @@ define( expect(failure).toHaveBeenCalled(); }); - it("logs an error when mutaton fails", function () { + it("logs an error when mutation fails", function () { // If mutation of the parent fails, we've lost the // created object - this is an error. var model = { someKey: "some value" }; diff --git a/platform/commonUI/edit/test/representers/EditRepresenterSpec.js b/platform/commonUI/edit/test/representers/EditRepresenterSpec.js index 7cb2626e64..7af3740fd6 100644 --- a/platform/commonUI/edit/test/representers/EditRepresenterSpec.js +++ b/platform/commonUI/edit/test/representers/EditRepresenterSpec.js @@ -112,7 +112,7 @@ define( expect(mockPersistence.persist).toHaveBeenCalled(); // Finally, check that the provided mutation function - // includes both model and configuratioon + // includes both model and configuration expect( mockDomainObject.useCapability.mostRecentCall.args[1]() ).toEqual({ diff --git a/platform/commonUI/edit/test/representers/EditToolbarRepresenterSpec.js b/platform/commonUI/edit/test/representers/EditToolbarRepresenterSpec.js index 0147601d7d..7cc8314fc6 100644 --- a/platform/commonUI/edit/test/representers/EditToolbarRepresenterSpec.js +++ b/platform/commonUI/edit/test/representers/EditToolbarRepresenterSpec.js @@ -79,7 +79,7 @@ define( it("removes state from parent scope on destroy", function () { // Verify precondition expect(mockScope.$parent.testToolbar).toBeDefined(); - // Destroy the represeter + // Destroy the representer representer.destroy(); // Should have removed toolbar state from view expect(mockScope.$parent.testToolbar).toBeUndefined(); diff --git a/platform/commonUI/general/src/controllers/ObjectInspectorController.js b/platform/commonUI/general/src/controllers/ObjectInspectorController.js index eb164dc76b..ef066d6774 100644 --- a/platform/commonUI/general/src/controllers/ObjectInspectorController.js +++ b/platform/commonUI/general/src/controllers/ObjectInspectorController.js @@ -38,7 +38,7 @@ define( $scope.contextutalParents = []; //$scope.isLink = false; - // Gets an array of the contextual parents/anscestors of the selected object + // Gets an array of the contextual parents/ancestors of the selected object function getContextualPath() { var currentObj = $scope.ngModel.selectedObject, currentParent, @@ -61,7 +61,7 @@ define( $scope.contextutalParents = parents; } - // Gets an array of the parents/anscestors of the selected object's + // Gets an array of the parents/ancestors of the selected object's // primary location (locational of original non-link) function getPrimaryPath(current) { var location; diff --git a/platform/commonUI/general/src/filters/ReverseFilter.js b/platform/commonUI/general/src/filters/ReverseFilter.js index a951e940e4..775d9fca86 100644 --- a/platform/commonUI/general/src/filters/ReverseFilter.js +++ b/platform/commonUI/general/src/filters/ReverseFilter.js @@ -25,7 +25,7 @@ define(function () { /** * Implements the `reverse` filter, which reverses text strings. * Useful in cases where text should be reversed for presentational - * reasons (e.g. in conjunction with CSS tricks involing text direction), + * reasons (e.g. in conjunction with CSS tricks involving text direction), * allowing such behavior to be handled independently from the controller * layer. * diff --git a/platform/commonUI/general/src/services/PopupService.js b/platform/commonUI/general/src/services/PopupService.js index b87c553ccd..3f65106fb0 100644 --- a/platform/commonUI/general/src/services/PopupService.js +++ b/platform/commonUI/general/src/services/PopupService.js @@ -35,7 +35,7 @@ define( } /** - * Options controlling how the popup is displaed. + * Options controlling how the popup is displayed. * * @typedef PopupOptions * @memberof platform/commonUI/general diff --git a/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js b/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js index 22b4035919..8b114f9948 100644 --- a/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js +++ b/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js @@ -60,7 +60,7 @@ define( expect(controller.isActive()).toBe(false); }); - it("allows active state to be explictly specified", function () { + it("allows active state to be explicitly specified", function () { controller.setState(true); expect(controller.isActive()).toBe(true); controller.setState(true); diff --git a/platform/commonUI/general/test/controllers/ToggleControllerSpec.js b/platform/commonUI/general/test/controllers/ToggleControllerSpec.js index 32a9568200..b51e2f0920 100644 --- a/platform/commonUI/general/test/controllers/ToggleControllerSpec.js +++ b/platform/commonUI/general/test/controllers/ToggleControllerSpec.js @@ -46,7 +46,7 @@ define( expect(controller.isActive()).toBe(false); }); - it("allows active state to be explictly specified", function () { + it("allows active state to be explicitly specified", function () { controller.setState(true); expect(controller.isActive()).toBe(true); controller.setState(true); diff --git a/platform/commonUI/mobile/test/MCTDeviceSpec.js b/platform/commonUI/mobile/test/MCTDeviceSpec.js index 4d130c56ee..421d3d7aca 100644 --- a/platform/commonUI/mobile/test/MCTDeviceSpec.js +++ b/platform/commonUI/mobile/test/MCTDeviceSpec.js @@ -72,7 +72,7 @@ define( expect(directive.restrict).toEqual("A"); }); - it("transcludes at the elmeent level", function () { + it("transcludes at the element level", function () { expect(directive.transclude).toEqual('element'); }); diff --git a/platform/commonUI/notification/src/NotificationService.js b/platform/commonUI/notification/src/NotificationService.js index 5412eb951e..e37571759a 100644 --- a/platform/commonUI/notification/src/NotificationService.js +++ b/platform/commonUI/notification/src/NotificationService.js @@ -361,7 +361,7 @@ define( autodismiss specified), leave it to run. Otherwise force a timeout. - This notifcation has been added to queue and will be + This notification has been added to queue and will be serviced as soon as possible. */ this.active.timeout = this.$timeout(function () { diff --git a/platform/containment/test/CapabilityTableSpec.js b/platform/containment/test/CapabilityTableSpec.js index 851ac2f99f..646ef82882 100644 --- a/platform/containment/test/CapabilityTableSpec.js +++ b/platform/containment/test/CapabilityTableSpec.js @@ -45,7 +45,7 @@ define( ['getKey', 'getDefinition', 'getInitialModel'] ); mockType.getKey.andReturn(type); - // Return a model to drive apparant capabilities + // Return a model to drive apparent capabilities mockType.getInitialModel.andReturn({ id: type }); return mockType; }); diff --git a/platform/containment/test/ContainmentTableSpec.js b/platform/containment/test/ContainmentTableSpec.js index d0ab71b459..a83d9c1c82 100644 --- a/platform/containment/test/ContainmentTableSpec.js +++ b/platform/containment/test/ContainmentTableSpec.js @@ -50,7 +50,7 @@ define( // third one defines no containership rules contains: (index < 2) ? [{ has: 'b' }] : undefined }); - // Return a model to drive apparant capabilities + // Return a model to drive apparent capabilities mockType.getInitialModel.andReturn({ id: type }); return mockType; }); diff --git a/platform/core/src/models/ModelCacheService.js b/platform/core/src/models/ModelCacheService.js index a204ef0b87..783509a774 100644 --- a/platform/core/src/models/ModelCacheService.js +++ b/platform/core/src/models/ModelCacheService.js @@ -24,7 +24,7 @@ define([], function () { /** * Provides a cache for domain object models which exist in memory, - * but may or may not exist in backing persistene stores. + * but may or may not exist in backing persistence stores. * @constructor * @memberof platform/core */ diff --git a/platform/core/src/models/RootModelProvider.js b/platform/core/src/models/RootModelProvider.js index 0dfb656c31..205d41e66b 100644 --- a/platform/core/src/models/RootModelProvider.js +++ b/platform/core/src/models/RootModelProvider.js @@ -42,7 +42,7 @@ define( * @implements {ModelService} * @param {Array} roots all `roots[]` extensions * @param $q Angular's $q, for promises - * @param $log Anuglar's $log, for logging + * @param $log Angular's $log, for logging */ function RootModelProvider(roots, $q, $log) { // Pull out identifiers to used as ROOT's diff --git a/platform/core/src/models/StaticModelProvider.js b/platform/core/src/models/StaticModelProvider.js index 45d89dbe2f..e20f9232fb 100644 --- a/platform/core/src/models/StaticModelProvider.js +++ b/platform/core/src/models/StaticModelProvider.js @@ -49,7 +49,7 @@ define( } } - // Prepoulate maps with models to make subsequent lookup faster. + // Prepopulate maps with models to make subsequent lookup faster. models.forEach(addModelToMap); this.modelMap = modelMap; diff --git a/platform/core/src/types/TypePropertyConversion.js b/platform/core/src/types/TypePropertyConversion.js index 84fba54e02..fcf71b2011 100644 --- a/platform/core/src/types/TypePropertyConversion.js +++ b/platform/core/src/types/TypePropertyConversion.js @@ -43,7 +43,7 @@ define( }, ARRAY_SUFFIX = '[]'; - // Utility function to handle arrays of conversiions + // Utility function to handle arrays of conversions function ArrayConversion(conversion) { return { toModelValue: function (formValue) { diff --git a/platform/core/src/types/TypeProvider.js b/platform/core/src/types/TypeProvider.js index c3256c57ba..e8cf83f3e2 100644 --- a/platform/core/src/types/TypeProvider.js +++ b/platform/core/src/types/TypeProvider.js @@ -68,7 +68,7 @@ define( }) : array; } - // Reduce an array of type definitions to a single type definiton, + // Reduce an array of type definitions to a single type definition, // which has merged all properties in order. function collapse(typeDefs) { var collapsed = typeDefs.reduce(function (a, b) { diff --git a/platform/entanglement/README.md b/platform/entanglement/README.md index f3685bad05..aaf517decf 100644 --- a/platform/entanglement/README.md +++ b/platform/entanglement/README.md @@ -3,7 +3,7 @@ Entanglement is the process of moving, copying, and linking domain objects in such a way that their relationships are impossible to discern. -This bundle provides move, copy, and link functionality. Acheiving a state of +This bundle provides move, copy, and link functionality. Achieving a state of entanglement is left up to the end user. diff --git a/platform/features/layout/src/FixedDragHandle.js b/platform/features/layout/src/FixedDragHandle.js index de4b8ec92d..86fa4fb8c3 100644 --- a/platform/features/layout/src/FixedDragHandle.js +++ b/platform/features/layout/src/FixedDragHandle.js @@ -94,7 +94,7 @@ define( }; /** - * End a drag gesture. This should be callled when a drag + * End a drag gesture. This should be called when a drag * concludes to trigger commit of changes. */ FixedDragHandle.prototype.endDrag = function () { diff --git a/platform/features/layout/src/LayoutController.js b/platform/features/layout/src/LayoutController.js index 80470f25b3..88eae7462c 100644 --- a/platform/features/layout/src/LayoutController.js +++ b/platform/features/layout/src/LayoutController.js @@ -152,7 +152,7 @@ define( } // Convert from { positions: ..., dimensions: ... } to an - // apropriate ng-style argument, to position frames. + // appropriate ng-style argument, to position frames. LayoutController.prototype.convertPosition = function (raw) { var gridSize = this.gridSize; // Multiply position/dimensions by grid size diff --git a/platform/features/layout/test/LayoutControllerSpec.js b/platform/features/layout/test/LayoutControllerSpec.js index dbc79e2769..6a23a29c04 100644 --- a/platform/features/layout/test/LayoutControllerSpec.js +++ b/platform/features/layout/test/LayoutControllerSpec.js @@ -164,7 +164,7 @@ define( // Populate scope mockScope.$watchCollection.mostRecentCall.args[1](); - // Verify precondtion + // Verify precondition expect(testConfiguration.panels.b).not.toBeDefined(); // Do a drag diff --git a/platform/features/plot/test/Canvas2DChartSpec.js b/platform/features/plot/test/Canvas2DChartSpec.js index b20d7b9c70..446c07d841 100644 --- a/platform/features/plot/test/Canvas2DChartSpec.js +++ b/platform/features/plot/test/Canvas2DChartSpec.js @@ -59,7 +59,7 @@ define( expect(mock2d.clearRect).toHaveBeenCalled(); }); - it("doees not construct if 2D is unavailable", function () { + it("does not construct if 2D is unavailable", function () { mockCanvas.getContext.andReturn(undefined); expect(function () { return new Canvas2DChart(mockCanvas); diff --git a/platform/features/plot/test/GLChartSpec.js b/platform/features/plot/test/GLChartSpec.js index fb575d7709..1ab0e6ea0a 100644 --- a/platform/features/plot/test/GLChartSpec.js +++ b/platform/features/plot/test/GLChartSpec.js @@ -82,7 +82,7 @@ define( expect(mockGL.clear).toHaveBeenCalled(); }); - it("doees not construct if WebGL is unavailable", function () { + it("does not construct if WebGL is unavailable", function () { mockCanvas.getContext.andReturn(undefined); expect(function () { return new GLChart(mockCanvas); diff --git a/platform/features/timeline/src/controllers/TimelineGanttController.js b/platform/features/timeline/src/controllers/TimelineGanttController.js index 7c3ee03244..6153064ebe 100644 --- a/platform/features/timeline/src/controllers/TimelineGanttController.js +++ b/platform/features/timeline/src/controllers/TimelineGanttController.js @@ -26,7 +26,7 @@ define( /** * Control for Gantt bars in a timeline view. - * Primarily reesponsible for supporting the positioning of Gantt + * Primarily responsible for supporting the positioning of Gantt * bars; particularly, this ensures that the left and right edges * never go to far off screen, because in some environments this * will effect rendering performance without visible results. diff --git a/platform/features/timeline/src/controllers/TimelineTickController.js b/platform/features/timeline/src/controllers/TimelineTickController.js index 41c57dedbf..fb1f2ad6b8 100644 --- a/platform/features/timeline/src/controllers/TimelineTickController.js +++ b/platform/features/timeline/src/controllers/TimelineTickController.js @@ -28,7 +28,7 @@ define( /** * Provides labels for the tick mark area of a timeline view. - * Since the tick mark regin is potentially extremeley large, + * Since the tick mark reign is potentially extremely large, * only the subset of ticks which will actually be shown in * view are provided. * @constructor diff --git a/platform/features/timeline/src/controllers/drag/TimelineDragHandler.js b/platform/features/timeline/src/controllers/drag/TimelineDragHandler.js index 7a356d91dc..745c3cc5cf 100644 --- a/platform/features/timeline/src/controllers/drag/TimelineDragHandler.js +++ b/platform/features/timeline/src/controllers/drag/TimelineDragHandler.js @@ -148,7 +148,7 @@ define( var timespan = timespans[toId(id)]; // Use as setter if argument is present if ((typeof value === 'number') && timespan) { - // Set the end (ensuring it doesn't preceed start) + // Set the end (ensuring it doesn't precede start) timespan.setEnd( Math.max(value, timespan.getStart()) ); diff --git a/platform/features/timeline/src/controllers/drag/TimelineSnapHandler.js b/platform/features/timeline/src/controllers/drag/TimelineSnapHandler.js index 70d854d008..42d13b8681 100644 --- a/platform/features/timeline/src/controllers/drag/TimelineSnapHandler.js +++ b/platform/features/timeline/src/controllers/drag/TimelineSnapHandler.js @@ -41,7 +41,7 @@ define( ids, candidates; - // Filter an id for inclustion + // Filter an id for inclusion function include(id) { return id !== exclude; } diff --git a/platform/framework/src/load/Bundle.js b/platform/framework/src/load/Bundle.js index a97dc3af5b..91bd966754 100644 --- a/platform/framework/src/load/Bundle.js +++ b/platform/framework/src/load/Bundle.js @@ -174,7 +174,7 @@ define( * category. * * @param {string} category name of the extension category - * @returns {Array} extension definitions of that cataegory + * @returns {Array} extension definitions of that category */ Bundle.prototype.getExtensions = function (category) { var extensions = this.definition.extensions[category] || [], diff --git a/platform/persistence/couch/src/CouchDocument.js b/platform/persistence/couch/src/CouchDocument.js index 59fa3bfa3f..c16ca27f5c 100644 --- a/platform/persistence/couch/src/CouchDocument.js +++ b/platform/persistence/couch/src/CouchDocument.js @@ -27,7 +27,7 @@ define( /** * A CouchDocument describes domain object model in a format * which is easily read-written to CouchDB. This includes - * Couch's _id and _rev fields, as well as a sseparate + * Couch's _id and _rev fields, as well as a separate * metadata field which contains a subset of information found * in the model itself (to support search optimization with * CouchDB views.) @@ -37,7 +37,7 @@ define( * @param {object} model the model to store * @param {string} rev the revision to include (or undefined, * if no revision should be noted for couch) - * @param {boolean} whether or not to mark this documnet as + * @param {boolean} whether or not to mark this document as * deleted (see CouchDB docs for _deleted) */ function CouchDocument(id, model, rev, markDeleted) { diff --git a/platform/persistence/couch/test/CouchIndicatorSpec.js b/platform/persistence/couch/test/CouchIndicatorSpec.js index 01fb3d7d23..166b8fc82a 100644 --- a/platform/persistence/couch/test/CouchIndicatorSpec.js +++ b/platform/persistence/couch/test/CouchIndicatorSpec.js @@ -69,7 +69,7 @@ define( initialDescrption = indicator.getDescription(), initialGlyphClass = indicator.getGlyphClass(); - // Nominal just means getting back an objeect, without + // Nominal just means getting back an object, without // an error field. mockPromise.then.mostRecentCall.args[0]({ data: {} }); @@ -88,7 +88,7 @@ define( initialDescrption = indicator.getDescription(), initialGlyphClass = indicator.getGlyphClass(); - // Nominal just means getting back an objeect, with + // Nominal just means getting back an object, with // an error field. mockPromise.then.mostRecentCall.args[0]( { data: { error: "Uh oh." } } @@ -110,7 +110,7 @@ define( initialDescrption = indicator.getDescription(), initialGlyphClass = indicator.getGlyphClass(); - // Nominal just means getting back an objeect, without + // Nominal just means getting back an object, without // an error field. mockPromise.then.mostRecentCall.args[1]({ data: {} }); diff --git a/platform/persistence/elastic/src/ElasticSearchProvider.js b/platform/persistence/elastic/src/ElasticSearchProvider.js index 4bc0504760..c0930c7025 100644 --- a/platform/persistence/elastic/src/ElasticSearchProvider.js +++ b/platform/persistence/elastic/src/ElasticSearchProvider.js @@ -51,7 +51,7 @@ define([ * Search for domain objects using elasticsearch as a search provider. * * @param {String} searchTerm the term to search by. - * @param {Number} [maxResults] the max numer of results to return. + * @param {Number} [maxResults] the max number of results to return. * @returns {Promise} promise for a modelResults object. */ ElasticSearchProvider.prototype.query = function (searchTerm, maxResults) { diff --git a/platform/persistence/elastic/test/ElasticIndicatorSpec.js b/platform/persistence/elastic/test/ElasticIndicatorSpec.js index 3086b52c66..bfc3effcd0 100644 --- a/platform/persistence/elastic/test/ElasticIndicatorSpec.js +++ b/platform/persistence/elastic/test/ElasticIndicatorSpec.js @@ -71,7 +71,7 @@ define( initialDescrption = indicator.getDescription(), initialGlyphClass = indicator.getGlyphClass(); - // Nominal just means getting back an objeect, without + // Nominal just means getting back an object, without // an error field. mockPromise.then.mostRecentCall.args[0]({ data: {} }); @@ -90,7 +90,7 @@ define( initialDescrption = indicator.getDescription(), initialGlyphClass = indicator.getGlyphClass(); - // Nominal just means getting back an objeect, without + // Nominal just means getting back an object, without // an error field. mockPromise.then.mostRecentCall.args[1]({ data: {} }); diff --git a/platform/persistence/queue/src/PersistenceQueue.js b/platform/persistence/queue/src/PersistenceQueue.js index de9ede2cfe..d0d4671f72 100644 --- a/platform/persistence/queue/src/PersistenceQueue.js +++ b/platform/persistence/queue/src/PersistenceQueue.js @@ -35,7 +35,7 @@ define( /** * The PersistenceQueue is used by the QueuingPersistenceCapability - * to aggregrate calls for object persistence. These are then issued + * to aggregate calls for object persistence. These are then issued * in a group, such that if some or all are rejected, this result can * be shown to the user (again, in a group.) * diff --git a/platform/persistence/queue/src/PersistenceQueueHandler.js b/platform/persistence/queue/src/PersistenceQueueHandler.js index 958b954e8f..679fbbb8df 100644 --- a/platform/persistence/queue/src/PersistenceQueueHandler.js +++ b/platform/persistence/queue/src/PersistenceQueueHandler.js @@ -25,7 +25,7 @@ define( function () { /** - * Handles actual persistence invocations for queeud persistence + * Handles actual persistence invocations for queued persistence * attempts, in a group. Handling in a group in this manner * also allows failure to be handled in a group (e.g. in a single * summary dialog.) diff --git a/platform/search/src/services/GenericSearchProvider.js b/platform/search/src/services/GenericSearchProvider.js index 8e35373fbb..6c8ce257ef 100644 --- a/platform/search/src/services/GenericSearchProvider.js +++ b/platform/search/src/services/GenericSearchProvider.js @@ -246,7 +246,7 @@ define([ /** * @private - * @returns {Number} a unique, unusued query Id. + * @returns {Number} a unique, unused query Id. */ GenericSearchProvider.prototype.makeQueryId = function () { var queryId = Math.ceil(Math.random() * 100000); diff --git a/platform/search/test/controllers/SearchControllerSpec.js b/platform/search/test/controllers/SearchControllerSpec.js index bcb7b01dd0..b8c5c0c496 100644 --- a/platform/search/test/controllers/SearchControllerSpec.js +++ b/platform/search/test/controllers/SearchControllerSpec.js @@ -123,7 +123,7 @@ define([ expect(mockScope.results).toContain('a'); }); - it('is loading until the service\'s promise fufills', function () { + it('is loading until the service\'s promise fulfills', function () { expect(mockScope.loading).toBeTruthy(); // Then resolve the promises @@ -163,7 +163,7 @@ define([ // Flag should be true with nonempty input expect(mockScope.ngModel.search).toEqual(true); - // Flag should be flase with empty input + // Flag should be false with empty input mockScope.ngModel.input = ''; controller.search(); mockPromise.then.mostRecentCall.args[0]({hits: [], total: 0}); diff --git a/platform/search/test/controllers/SearchMenuControllerSpec.js b/platform/search/test/controllers/SearchMenuControllerSpec.js index 611f0d5a08..e4d566431c 100644 --- a/platform/search/test/controllers/SearchMenuControllerSpec.js +++ b/platform/search/test/controllers/SearchMenuControllerSpec.js @@ -54,7 +54,7 @@ define( controller = new SearchMenuController(mockScope, mockTypes); }); - it("gets types on initiliztion", function () { + it("gets types on initialization", function () { expect(mockScope.ngModel.types).toBeDefined(); }); diff --git a/platform/telemetry/src/TelemetrySubscriber.js b/platform/telemetry/src/TelemetrySubscriber.js index 9cf17b5fa7..6466566423 100644 --- a/platform/telemetry/src/TelemetrySubscriber.js +++ b/platform/telemetry/src/TelemetrySubscriber.js @@ -31,7 +31,7 @@ define( * `telemetrySubscriber`. * * Subscriptions may also be made directly using the - * `telemetry` capability of a domain objcet; the subscriber + * `telemetry` capability of a domain object; the subscriber * uses this as well, but additionally handles delegation * (e.g. for telemetry panels) as well as latest-value * extraction. diff --git a/platform/telemetry/src/TelemetrySubscription.js b/platform/telemetry/src/TelemetrySubscription.js index ca0f11125d..dd5e4d3191 100644 --- a/platform/telemetry/src/TelemetrySubscription.js +++ b/platform/telemetry/src/TelemetrySubscription.js @@ -57,7 +57,7 @@ define( * `telemetrySubscriber` service. * * Subscriptions may also be made directly using the - * `telemetry` capability of a domain objcet; the subscriber + * `telemetry` capability of a domain object; the subscriber * uses this as well, but additionally handles delegation * (e.g. for telemetry panels) as well as latest-value * extraction. From 9847c40e3421b2d580c360c893c10c0be83daf71 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 1 Sep 2016 23:01:57 +0300 Subject: [PATCH 03/56] [Edit] SaveAction not navigating anymore --- .../commonUI/edit/src/actions/SaveAction.js | 29 ++++--------------- .../edit/test/actions/SaveActionSpec.js | 6 ---- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAction.js b/platform/commonUI/edit/src/actions/SaveAction.js index 6f96e84192..8d3ea7f509 100644 --- a/platform/commonUI/edit/src/actions/SaveAction.js +++ b/platform/commonUI/edit/src/actions/SaveAction.js @@ -25,9 +25,8 @@ define( function (SaveInProgressDialog) { /** - * The "Save" action; the action triggered by clicking Save from - * Edit Mode. Exits the editing user interface and invokes object - * capabilities to persist the changes that have been made. + * The "Save" action; it invokes object capabilities to persist + * the changes that have been made. * @constructor * @implements {Action} * @memberof platform/commonUI/edit @@ -41,7 +40,7 @@ define( } /** - * Save changes and conclude editing. + * Save changes. * * @returns {Promise} a promise that will be fulfilled when * cancellation has completed @@ -51,40 +50,22 @@ define( var domainObject = this.domainObject, dialog = new SaveInProgressDialog(this.dialogService); - function resolveWith(object) { - return function () { - return object; - }; - } - // Invoke any save behavior introduced by the editor capability; // this is introduced by EditableDomainObject which is // used to insulate underlying objects from changes made // during editing. function doSave() { - return domainObject.getCapability("editor").save() - .then(resolveWith(domainObject)); + return domainObject.getCapability("editor").save(); } - // Discard the current root view (which will be the editing - // UI, which will have been pushed atop the Browse UI.) - function returnToBrowse(object) { - if (object) { - object.getCapability("action").perform("navigate"); - } - return object; - } - - function hideBlockingDialog(object) { + function hideBlockingDialog() { dialog.hide(); - return object; } dialog.show(); return doSave() .then(hideBlockingDialog) - .then(returnToBrowse) .catch(hideBlockingDialog); }; diff --git a/platform/commonUI/edit/test/actions/SaveActionSpec.js b/platform/commonUI/edit/test/actions/SaveActionSpec.js index 0243f89a11..7324b53085 100644 --- a/platform/commonUI/edit/test/actions/SaveActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveActionSpec.js @@ -105,12 +105,6 @@ define( expect(mockEditorCapability.save).toHaveBeenCalled(); }); - it("navigates to the object after saving", - function () { - action.perform(); - expect(mockActionCapability.perform).toHaveBeenCalledWith("navigate"); - }); - describe("a blocking dialog", function () { var mockDialogHandle; From 90c13a3959c695fd30e43c6a69a848fee692c2a7 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 1 Sep 2016 23:16:31 +0300 Subject: [PATCH 04/56] [Edit] EditorCapability continues edit on save --- .../commonUI/edit/src/capabilities/EditorCapability.js | 10 +++++----- .../edit/test/capabilities/EditorCapabilitySpec.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index aa7670d8aa..a997eb3033 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -81,14 +81,14 @@ define( }; /** - * Save any changes from this editing session. This will flush all - * pending persists and end the current transaction + * Save any unsaved changes from this editing session. This will + * end the current transaction and continue with a new one. * @returns {*} */ EditorCapability.prototype.save = function () { - var domainObject = this.domainObject; - return this.transactionService.commit().then(function () { - domainObject.getCapability('status').set('editing', false); + var transactionService = this.transactionService; + return transactionService.commit().then(function () { + transactionService.startTransaction(); }); }; diff --git a/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js b/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js index 3ffb81921d..e72793be53 100644 --- a/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js +++ b/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js @@ -134,8 +134,8 @@ define( it("commits the transaction", function () { expect(mockTransactionService.commit).toHaveBeenCalled(); }); - it("resets the edit state", function () { - expect(mockStatusCapability.set).toHaveBeenCalledWith('editing', false); + it("begins a new transaction", function () { + expect(mockTransactionService.startTransaction).toHaveBeenCalled(); }); }); From ab4ce0caba1cac308d0db3f2fc2334a490bf1e5f Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 3 Sep 2016 17:25:21 +0300 Subject: [PATCH 05/56] [Edit] Introduced SaveAndStopEditingAction It replaces SaveAction in the bundle. --- platform/commonUI/edit/bundle.js | 6 +- .../src/actions/SaveAndStopEditingAction.js | 73 +++++++++++ .../actions/SaveAndStopEditingActionSpec.js | 118 ++++++++++++++++++ 3 files changed, 194 insertions(+), 3 deletions(-) create mode 100644 platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js create mode 100644 platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 2c5a79bda3..b81e057764 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -30,7 +30,7 @@ define([ "./src/actions/EditAction", "./src/actions/PropertiesAction", "./src/actions/RemoveAction", - "./src/actions/SaveAction", + "./src/actions/SaveAndStopEditingAction", "./src/actions/SaveAsAction", "./src/actions/CancelAction", "./src/policies/EditActionPolicy", @@ -69,7 +69,7 @@ define([ EditAction, PropertiesAction, RemoveAction, - SaveAction, + SaveAndStopEditingAction, SaveAsAction, CancelAction, EditActionPolicy, @@ -205,7 +205,7 @@ define([ { "key": "save", "category": "conclude-editing", - "implementation": SaveAction, + "implementation": SaveAndStopEditingAction, "name": "Save", "cssclass": "icon-save labeled", "description": "Save changes made to these objects.", diff --git a/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js b/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js new file mode 100644 index 0000000000..a6a1eb9e62 --- /dev/null +++ b/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js @@ -0,0 +1,73 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2016, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + +define( + ["./SaveAction"], + function (SaveAction) { + + /** + * The "Save and Stop Editing" action performs a [Save action]{@link SaveAction} + * on the object under edit followed by exiting the edit user interface. + * @constructor + * @implements {Action} + * @memberof platform/commonUI/edit + */ + function SaveAndStopEditingAction( + dialogService, + context + ) { + this.context = context; + this.domainObject = (context || {}).domainObject; + this.dialogService = dialogService; + } + + /** + * Trigger a save operation and exit edit mode. + * + * @returns {Promise} a promise that will be fulfilled when + * cancellation has completed + * @memberof platform/commonUI/edit.SaveAndStopEditingAction# + */ + SaveAndStopEditingAction.prototype.perform = function () { + var domainObject = this.domainObject, + saveAction = new SaveAction(this.dialogService, this.context); + + function closeEditor() { + return domainObject.getCapability("editor").cancel(); + } + + return saveAction.perform() + .then(closeEditor) + .catch(closeEditor); + }; + + /** + * Check if this action is applicable in a given context. + * This will ensure that a domain object is present in the context, + * and that this domain object is in Edit mode. + * @returns true if applicable + */ + SaveAndStopEditingAction.appliesTo = SaveAction.appliesTo; + + return SaveAndStopEditingAction; + } +); \ No newline at end of file diff --git a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js new file mode 100644 index 0000000000..a5d14e3d6d --- /dev/null +++ b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js @@ -0,0 +1,118 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2016, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + +define( + ["../../src/actions/SaveAndStopEditingAction"], + function (SaveAndStopEditingAction) { + + describe("The Save and Stop Editing action", function () { + + var mockDomainObject, + mockEditorCapability, + actionContext, + dialogService, + mockActionCapability, + capabilities = {}, + action; + + function mockPromise(value) { + return { + then: function (callback) { + return mockPromise(callback(value)); + }, + catch: function (callback) { + return mockPromise(callback(value)); + } + }; + } + + beforeEach(function () { + mockDomainObject = jasmine.createSpyObj( + "domainObject", + [ + "getCapability", + "hasCapability", + "getModel", + "getOriginalObject" + ] + ); + mockEditorCapability = jasmine.createSpyObj( + "editor", + ["save", "cancel", "isEditContextRoot"] + ); + mockActionCapability = jasmine.createSpyObj( + "actionCapability", + ["perform"] + ); + capabilities.editor = mockEditorCapability; + capabilities.action = mockActionCapability; + + actionContext = { + domainObject: mockDomainObject + }; + dialogService = jasmine.createSpyObj( + "dialogService", + ["showBlockingMessage"] + ); + + mockDomainObject.hasCapability.andReturn(true); + mockDomainObject.getCapability.andCallFake(function (capability) { + return capabilities[capability]; + }); + mockDomainObject.getModel.andReturn({ persisted: 0 }); + mockEditorCapability.save.andReturn(mockPromise(true)); + mockEditorCapability.isEditContextRoot.andReturn(true); + + action = new SaveAndStopEditingAction(dialogService, actionContext); + }); + + + it("only applies to domain object with an editor capability", function () { + expect(SaveAndStopEditingAction.appliesTo(actionContext)).toBe(true); + expect(mockDomainObject.hasCapability).toHaveBeenCalledWith("editor"); + + mockDomainObject.hasCapability.andReturn(false); + mockDomainObject.getCapability.andReturn(undefined); + expect(SaveAndStopEditingAction.appliesTo(actionContext)).toBe(false); + }); + + it("only applies to domain object that has already been persisted", function () { + mockDomainObject.getModel.andReturn({ persisted: undefined }); + expect(SaveAndStopEditingAction.appliesTo(actionContext)).toBe(false); + }); + + it("does not close the editor before completing the save", function () { + mockEditorCapability.save.andReturn(new Promise(function () { + })); + action.perform(); + expect(mockEditorCapability.save).toHaveBeenCalled(); + expect(mockEditorCapability.cancel).not.toHaveBeenCalled(); + }); + + it("closes the editor after saving", function () { + action.perform(); + expect(mockEditorCapability.save).toHaveBeenCalled(); + expect(mockEditorCapability.cancel).toHaveBeenCalled(); + }); + }); + } +); \ No newline at end of file From ded52b8d199ec96c787db78e94d5920786836f9e Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 3 Sep 2016 17:45:23 +0300 Subject: [PATCH 06/56] [Edit] Rename cancel() to finish() --- platform/commonUI/edit/src/actions/CancelAction.js | 2 +- .../commonUI/edit/src/actions/SaveAndStopEditingAction.js | 2 +- .../commonUI/edit/src/capabilities/EditorCapability.js | 4 ++-- platform/commonUI/edit/test/actions/CancelActionSpec.js | 8 ++++---- .../edit/test/actions/SaveAndStopEditingActionSpec.js | 6 +++--- .../edit/test/capabilities/EditorCapabilitySpec.js | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/platform/commonUI/edit/src/actions/CancelAction.js b/platform/commonUI/edit/src/actions/CancelAction.js index 13b005958e..a48ceec996 100644 --- a/platform/commonUI/edit/src/actions/CancelAction.js +++ b/platform/commonUI/edit/src/actions/CancelAction.js @@ -62,7 +62,7 @@ define( } function cancel(allowed) { - return allowed && domainObject.getCapability("editor").cancel(); + return allowed && domainObject.getCapability("editor").finish(); } //Do navigation first in order to trigger unsaved changes dialog diff --git a/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js b/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js index a6a1eb9e62..6145ecd05b 100644 --- a/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js +++ b/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js @@ -52,7 +52,7 @@ define( saveAction = new SaveAction(this.dialogService, this.context); function closeEditor() { - return domainObject.getCapability("editor").cancel(); + return domainObject.getCapability("editor").finish(); } return saveAction.perform() diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index a997eb3033..53dea8c91c 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -95,11 +95,11 @@ define( EditorCapability.prototype.invoke = EditorCapability.prototype.edit; /** - * Cancel the current editing session. This will discard any pending + * Finish the current editing session. This will discard any pending * persist operations * @returns {*} */ - EditorCapability.prototype.cancel = function () { + EditorCapability.prototype.finish = function () { var domainObject = this.domainObject; return this.transactionService.cancel().then(function () { domainObject.getCapability("status").set("editing", false); diff --git a/platform/commonUI/edit/test/actions/CancelActionSpec.js b/platform/commonUI/edit/test/actions/CancelActionSpec.js index 3bd0cee72f..7fdc51b0e9 100644 --- a/platform/commonUI/edit/test/actions/CancelActionSpec.js +++ b/platform/commonUI/edit/test/actions/CancelActionSpec.js @@ -63,7 +63,7 @@ define( capabilities.editor = jasmine.createSpyObj( "editor", - ["save", "cancel", "isEditContextRoot"] + ["save", "finish", "isEditContextRoot"] ); capabilities.action = jasmine.createSpyObj( "actionCapability", @@ -105,7 +105,7 @@ define( return !!capabilities[name]; }); - capabilities.editor.cancel.andReturn(mockPromise(true)); + capabilities.editor.finish.andReturn(mockPromise(true)); action = new CancelAction(actionContext); @@ -130,8 +130,8 @@ define( capabilities.action.perform.andReturn(mockPromise(true)); action.perform(); - // Should have called cancel - expect(capabilities.editor.cancel).toHaveBeenCalled(); + // Should have called finish + expect(capabilities.editor.finish).toHaveBeenCalled(); // Definitely shouldn't call save! expect(capabilities.editor.save).not.toHaveBeenCalled(); diff --git a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js index a5d14e3d6d..6570dd6037 100644 --- a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js @@ -57,7 +57,7 @@ define( ); mockEditorCapability = jasmine.createSpyObj( "editor", - ["save", "cancel", "isEditContextRoot"] + ["save", "finish", "isEditContextRoot"] ); mockActionCapability = jasmine.createSpyObj( "actionCapability", @@ -105,13 +105,13 @@ define( })); action.perform(); expect(mockEditorCapability.save).toHaveBeenCalled(); - expect(mockEditorCapability.cancel).not.toHaveBeenCalled(); + expect(mockEditorCapability.finish).not.toHaveBeenCalled(); }); it("closes the editor after saving", function () { action.perform(); expect(mockEditorCapability.save).toHaveBeenCalled(); - expect(mockEditorCapability.cancel).toHaveBeenCalled(); + expect(mockEditorCapability.finish).toHaveBeenCalled(); }); }); } diff --git a/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js b/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js index e72793be53..77fbd9b74f 100644 --- a/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js +++ b/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js @@ -139,10 +139,10 @@ define( }); }); - describe("cancel", function () { + describe("finish", function () { beforeEach(function () { capability.edit(); - capability.cancel(); + capability.finish(); }); it("cancels the transaction", function () { expect(mockTransactionService.cancel).toHaveBeenCalled(); @@ -158,7 +158,7 @@ define( beforeEach(function () { mockDomainObject.getModel.andReturn(model); capability.edit(); - capability.cancel(); + capability.finish(); }); it("returns true if the object has been modified since it" + " was last persisted", function () { From 7d52d348b25a6f318de902bf953faf74b3a70bea Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 3 Sep 2016 18:33:27 +0300 Subject: [PATCH 07/56] [Edit] Fix style issues --- .../commonUI/edit/src/actions/SaveAndStopEditingAction.js | 4 ++-- platform/commonUI/edit/src/capabilities/EditorCapability.js | 2 +- .../edit/test/actions/SaveAndStopEditingActionSpec.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js b/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js index 6145ecd05b..a0a0583048 100644 --- a/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js +++ b/platform/commonUI/edit/src/actions/SaveAndStopEditingAction.js @@ -50,7 +50,7 @@ define( SaveAndStopEditingAction.prototype.perform = function () { var domainObject = this.domainObject, saveAction = new SaveAction(this.dialogService, this.context); - + function closeEditor() { return domainObject.getCapability("editor").finish(); } @@ -70,4 +70,4 @@ define( return SaveAndStopEditingAction; } -); \ No newline at end of file +); diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index 53dea8c91c..2280b04e0c 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -81,7 +81,7 @@ define( }; /** - * Save any unsaved changes from this editing session. This will + * Save any unsaved changes from this editing session. This will * end the current transaction and continue with a new one. * @returns {*} */ diff --git a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js index 6570dd6037..cfed63c0d3 100644 --- a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js @@ -115,4 +115,4 @@ define( }); }); } -); \ No newline at end of file +); From 3dee0821410becb0e89209c376a3051cd5f5f925 Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 3 Sep 2016 19:02:05 +0300 Subject: [PATCH 08/56] [Edit] Add reason for redundant mocks --- .../edit/test/actions/SaveAndStopEditingActionSpec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js index cfed63c0d3..1fb8fa6492 100644 --- a/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAndStopEditingActionSpec.js @@ -26,6 +26,11 @@ define( describe("The Save and Stop Editing action", function () { + // Some mocks appear unused because the + // underlying SaveAction that this action + // depends on is not mocked, so we mock some + // of SaveAction's own dependencies to make + // it run. var mockDomainObject, mockEditorCapability, actionContext, From 24cb72e5b53da4c19d151e7e5757134d3114854a Mon Sep 17 00:00:00 2001 From: David Hudson Date: Mon, 12 Sep 2016 15:28:04 +0900 Subject: [PATCH 09/56] [Frontend] Delay visibility of progress bar Resolves #1168 --- .../commonUI/general/res/sass/overlay/_overlay.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/commonUI/general/res/sass/overlay/_overlay.scss b/platform/commonUI/general/res/sass/overlay/_overlay.scss index 018197dac0..34bd1fd46f 100644 --- a/platform/commonUI/general/res/sass/overlay/_overlay.scss +++ b/platform/commonUI/general/res/sass/overlay/_overlay.scss @@ -19,8 +19,18 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ + .overlay { font-size: 90%; + z-index: 5; + @include keyframes(fadeInFromNone) { + 0% { display: none; opacity: 0; } + 1% { display: block; opacity: 0; } + 95% { display: block; opacity: 0; } + 100% { display: block; opacity: 1; } + } + @include animation(fadeInFromNone 100ms ease-in); + .blocker { background: $colorOvrBlocker; z-index: 100; From 2740b6f9572a8a209c7239fd6f5e290a1332e336 Mon Sep 17 00:00:00 2001 From: David Hudson Date: Tue, 13 Sep 2016 16:36:25 +0900 Subject: [PATCH 10/56] [Frontend] Add optional delay parameter to dialog service Issue #1168 --- .../commonUI/dialog/res/templates/overlay.html | 2 +- platform/commonUI/dialog/src/DialogService.js | 3 +++ .../edit/src/actions/SaveInProgressDialog.js | 3 ++- .../commonUI/general/res/sass/_constants.scss | 3 +++ .../general/res/sass/overlay/_overlay.scss | 15 +++++++-------- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/platform/commonUI/dialog/res/templates/overlay.html b/platform/commonUI/dialog/res/templates/overlay.html index 825d8fe4f4..dcc847029d 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. --> -
+
Date: Tue, 13 Sep 2016 21:24:20 +0300 Subject: [PATCH 11/56] [Edit] SaveAs now calls finish() --- platform/commonUI/edit/src/actions/SaveAsAction.js | 10 ++++++++-- .../commonUI/edit/test/actions/SaveAsActionSpec.js | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAsAction.js b/platform/commonUI/edit/src/actions/SaveAsAction.js index 57a055429a..402fccb86c 100644 --- a/platform/commonUI/edit/src/actions/SaveAsAction.js +++ b/platform/commonUI/edit/src/actions/SaveAsAction.js @@ -166,11 +166,16 @@ define([ .then(resolveWith(object)); } - function commitEditingAfterClone(clonedObject) { + function saveAfterClone(clonedObject) { return domainObject.getCapability("editor").save() .then(resolveWith(clonedObject)); } + function finishEditing(clonedObject) { + return domainObject.getCapability("editor").finish() + .then(resolveWith(clonedObject)); + } + function onFailure() { hideBlockingDialog(); return false; @@ -182,7 +187,8 @@ define([ .then(getParent) .then(cloneIntoParent) .then(undirtyOriginals) - .then(commitEditingAfterClone) + .then(saveAfterClone) + .then(finishEditing) .then(hideBlockingDialog) .catch(onFailure); }; diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index fd8ce18c07..6bf631feed 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -78,9 +78,8 @@ define( mockEditorCapability = jasmine.createSpyObj( "editor", - ["save", "cancel", "isEditContextRoot"] + ["save", "isEditContextRoot"] ); - mockEditorCapability.cancel.andReturn(mockPromise(undefined)); mockEditorCapability.save.andReturn(mockPromise(true)); mockEditorCapability.isEditContextRoot.andReturn(true); capabilities.editor = mockEditorCapability; From 438274501231e46a2049054312fa67e2085385d5 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 13 Sep 2016 22:35:11 +0300 Subject: [PATCH 12/56] [Edit] Final two actions now use finish() --- platform/commonUI/edit/src/actions/EditAction.js | 2 +- platform/commonUI/edit/src/creation/CreateAction.js | 2 +- platform/commonUI/edit/test/actions/EditActionSpec.js | 6 +++--- platform/commonUI/edit/test/creation/CreateActionSpec.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/commonUI/edit/src/actions/EditAction.js b/platform/commonUI/edit/src/actions/EditAction.js index bd30968289..9c14abad2a 100644 --- a/platform/commonUI/edit/src/actions/EditAction.js +++ b/platform/commonUI/edit/src/actions/EditAction.js @@ -71,7 +71,7 @@ define( EditAction.prototype.perform = function () { var self = this; function cancelEditing() { - self.domainObject.getCapability('editor').cancel(); + self.domainObject.getCapability('editor').finish(); self.navigationService.removeListener(cancelEditing); } //If this is not the currently navigated object, then navigate diff --git a/platform/commonUI/edit/src/creation/CreateAction.js b/platform/commonUI/edit/src/creation/CreateAction.js index 14b8443462..3cfbdb0ef9 100644 --- a/platform/commonUI/edit/src/creation/CreateAction.js +++ b/platform/commonUI/edit/src/creation/CreateAction.js @@ -72,7 +72,7 @@ define( } function onCancel() { - return editorCapability.cancel(); + return editorCapability.finish(); } newModel.type = this.type.getKey(); diff --git a/platform/commonUI/edit/test/actions/EditActionSpec.js b/platform/commonUI/edit/test/actions/EditActionSpec.js index c896e83dd1..5e54b67e15 100644 --- a/platform/commonUI/edit/test/actions/EditActionSpec.js +++ b/platform/commonUI/edit/test/actions/EditActionSpec.js @@ -58,7 +58,7 @@ define( ); mockEditor = jasmine.createSpyObj( "editorCapability", - ["edit", "isEditContextRoot", "cancel"] + ["edit", "isEditContextRoot", "finish"] ); capabilities = { @@ -98,11 +98,11 @@ define( expect(EditAction.appliesTo(actionContext)).toBe(false); }); - it ("cancels editing when user navigates away", function () { + it ("finishes editing when user navigates away", function () { action.perform(); expect(mockNavigationService.addListener).toHaveBeenCalled(); mockNavigationService.addListener.mostRecentCall.args[0](); - expect(mockEditor.cancel).toHaveBeenCalled(); + expect(mockEditor.finish).toHaveBeenCalled(); }); it ("invokes the Edit capability on the object", function () { diff --git a/platform/commonUI/edit/test/creation/CreateActionSpec.js b/platform/commonUI/edit/test/creation/CreateActionSpec.js index d65621f9a8..19dc46896f 100644 --- a/platform/commonUI/edit/test/creation/CreateActionSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionSpec.js @@ -103,7 +103,7 @@ define( [ "edit", "save", - "cancel" + "finish" ] ); @@ -178,10 +178,10 @@ define( expect(capabilities.editor.save).toHaveBeenCalled(); }); - it("to cancel the edit if user cancels dialog", function () { + it("to finish the edit if user cancels dialog", function () { action.perform(); promise.then.mostRecentCall.args[1](); - expect(capabilities.editor.cancel).toHaveBeenCalled(); + expect(capabilities.editor.finish).toHaveBeenCalled(); }); }); }); From d87ed1414e41e3a8fa4555c910aa615ac5da52c5 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 13 Sep 2016 22:36:27 +0300 Subject: [PATCH 13/56] [Edit] Update EditorCapability comments --- platform/commonUI/edit/src/capabilities/EditorCapability.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index 2280b04e0c..1cbf239d7d 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -28,8 +28,8 @@ define( * A capability that implements an editing 'session' for a domain * object. An editing session is initiated via a call to .edit(). * Once initiated, any persist operations will be queued pending a - * subsequent call to [.save()](@link #save) or [.cancel()](@link - * #cancel). + * subsequent call to [.save()](@link #save) or [.finish()](@link + * #finish). * @param transactionService * @param domainObject * @constructor @@ -45,7 +45,7 @@ define( /** * Initiate an editing session. This will start a transaction during * which any persist operations will be deferred until either save() - * or cancel() are called. + * or finish() are called. */ EditorCapability.prototype.edit = function () { this.transactionService.startTransaction(); From 0be84a4e5166d8f5eacc0b98df9bd1ddab3df2b1 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 13 Sep 2016 23:59:28 +0300 Subject: [PATCH 14/56] [Edit] CreateAction closes editor after save --- .../commonUI/edit/src/capabilities/EditorCapability.js | 1 - platform/commonUI/edit/src/creation/CreateAction.js | 9 +++++++-- platform/commonUI/edit/test/creation/CreateActionSpec.js | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index 1cbf239d7d..2ea532f6a6 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -103,7 +103,6 @@ define( var domainObject = this.domainObject; return this.transactionService.cancel().then(function () { domainObject.getCapability("status").set("editing", false); - return domainObject; }); }; diff --git a/platform/commonUI/edit/src/creation/CreateAction.js b/platform/commonUI/edit/src/creation/CreateAction.js index 3cfbdb0ef9..711e4001a6 100644 --- a/platform/commonUI/edit/src/creation/CreateAction.js +++ b/platform/commonUI/edit/src/creation/CreateAction.js @@ -67,12 +67,17 @@ define( editAction, editorCapability; + function closeEditor() { + return editorCapability.finish(); + } + function onSave() { - return editorCapability.save(); + return editorCapability.save() + .then(closeEditor); } function onCancel() { - return editorCapability.finish(); + return closeEditor(); } newModel.type = this.type.getKey(); diff --git a/platform/commonUI/edit/test/creation/CreateActionSpec.js b/platform/commonUI/edit/test/creation/CreateActionSpec.js index 19dc46896f..60040b5410 100644 --- a/platform/commonUI/edit/test/creation/CreateActionSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionSpec.js @@ -142,6 +142,7 @@ define( }); describe("the perform function", function () { + var promise = jasmine.createSpyObj("promise", ["then"]); beforeEach(function () { capabilities.action.getActions.andReturn([mockEditAction]); }); @@ -160,15 +161,16 @@ define( " available", function () { capabilities.action.getActions.andReturn([]); capabilities.action.perform.andReturn(mockPromise(undefined)); + capabilities.editor.save.andReturn(promise); action.perform(); expect(capabilities.action.perform).toHaveBeenCalledWith("save"); }); describe("uses to editor capability", function () { - var promise = jasmine.createSpyObj("promise", ["then"]); beforeEach(function () { capabilities.action.getActions.andReturn([]); capabilities.action.perform.andReturn(promise); + capabilities.editor.save.andReturn(promise); }); it("to save the edit if user saves dialog", function () { From c1afc34cfcd7a2753f9e70b9432e773d49577e50 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 14 Sep 2016 10:16:33 -0700 Subject: [PATCH 15/56] Revert "[Build] Check dependencies for vulnerabilities" --- gulpfile.js | 7 +------ package.json | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index bf52224863..ff994c6a2c 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/package.json b/package.json index 5563f65c82..555375007e 100644 --- a/package.json +++ b/package.json @@ -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", From 49d2d5500fb6668ddafe49792b552c8873248a85 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Thu, 15 Sep 2016 09:37:11 -0700 Subject: [PATCH 16/56] Revert "[proxyUrl] pass URL parameters to proxied URL" --- app.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 20429a3a5f..6b7b1bb635 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); }); From 1ea7fa30842dcaa387c9263939d3f1408d23814a Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 15 Sep 2016 20:28:29 +0300 Subject: [PATCH 17/56] [Edit] SaveAsAction tests cover save and finish --- .../edit/test/actions/SaveAsActionSpec.js | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index 6bf631feed..a51e165688 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,it,expect,beforeEach,jasmine*/ +/*global describe,it,expect,beforeEach,jasmine,runs,waitsFor,spyOn*/ define( ["../../src/actions/SaveAsAction"], @@ -78,9 +78,10 @@ define( mockEditorCapability = jasmine.createSpyObj( "editor", - ["save", "isEditContextRoot"] + ["save", "finish", "isEditContextRoot"] ); mockEditorCapability.save.andReturn(mockPromise(true)); + mockEditorCapability.finish.andReturn(mockPromise(true)); mockEditorCapability.isEditContextRoot.andReturn(true); capabilities.editor = mockEditorCapability; @@ -154,6 +155,28 @@ define( mockDomainObject.getModel.andReturn({persisted: 0}); expect(SaveAsAction.appliesTo(actionContext)).toBe(false); }); + + it("uses the editor capability to save the object", function () { + mockEditorCapability.save.andReturn(new Promise(function () {})); + runs(function () { + action.perform(); + }); + waitsFor(function () { + return mockEditorCapability.save.calls.length > 0; + }, "perform() should call EditorCapability.save"); + runs(function () { + expect(mockEditorCapability.finish).not.toHaveBeenCalled(); + }); + }); + + it("uses the editor capability to finish editing the object", function () { + runs(function () { + action.perform(); + }); + waitsFor(function () { + return mockEditorCapability.finish.calls.length > 0; + }, "perform() should call EditorCapability.finish"); + }); it("returns to browse after save", function () { spyOn(action, "save"); From 31ee92b7110b52ce432994a3dcc126eef2daf844 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 15 Sep 2016 20:39:02 +0300 Subject: [PATCH 18/56] [Edit] Remove editor.cancel from SaveActionSpec --- platform/commonUI/edit/test/actions/SaveActionSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/edit/test/actions/SaveActionSpec.js b/platform/commonUI/edit/test/actions/SaveActionSpec.js index 7324b53085..7230c09448 100644 --- a/platform/commonUI/edit/test/actions/SaveActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveActionSpec.js @@ -56,7 +56,7 @@ define( ); mockEditorCapability = jasmine.createSpyObj( "editor", - ["save", "cancel", "isEditContextRoot"] + ["save", "isEditContextRoot"] ); mockActionCapability = jasmine.createSpyObj( "actionCapability", From d1f67fd8b9f8eaa82cc1c1b04504a2c4210e1cd8 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 15 Sep 2016 22:40:02 +0300 Subject: [PATCH 19/56] [Edit] Introduce dropdown Save menu And fix style issues in SaveAsActionSpec --- platform/commonUI/edit/bundle.js | 24 +++++-- .../res/templates/edit-action-buttons.html | 23 ++++++- .../src/controllers/EditActionController.js | 30 +++++++-- .../edit/test/actions/SaveAsActionSpec.js | 2 +- .../controllers/EditActionControllerSpec.js | 66 +++++++++++++++++-- 5 files changed, 124 insertions(+), 21 deletions(-) diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 787f02d9c4..b1af2f6f50 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -30,6 +30,7 @@ define([ "./src/actions/EditAction", "./src/actions/PropertiesAction", "./src/actions/RemoveAction", + "./src/actions/SaveAction", "./src/actions/SaveAndStopEditingAction", "./src/actions/SaveAsAction", "./src/actions/CancelAction", @@ -69,6 +70,7 @@ define([ EditAction, PropertiesAction, RemoveAction, + SaveAction, SaveAndStopEditingAction, SaveAsAction, CancelAction, @@ -203,20 +205,30 @@ define([ ] }, { - "key": "save", - "category": "conclude-editing", + "key": "save-and-stop-editing", + "category": "save", "implementation": SaveAndStopEditingAction, - "name": "Save", + "name": "Save and Done Editing", "cssclass": "icon-save labeled", "description": "Save changes made to these objects.", "depends": [ "dialogService" - ], - "priority": "mandatory" + ] }, { "key": "save", - "category": "conclude-editing", + "category": "save", + "implementation": SaveAction, + "name": "Save and Continue Editing", + "cssclass": "icon-save labeled", + "description": "Save changes made to these objects.", + "depends": [ + "dialogService" + ] + }, + { + "key": "save-as", + "category": "save", "implementation": SaveAsAction, "name": "Save As...", "cssclass": "icon-save labeled", diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index fc46b31f57..7884373d18 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -20,11 +20,30 @@ at runtime from the About dialog for additional information. --> - + + + + {{saveActions[0].getMetadata().name}} + + + + + + + + + + ng-class="{ major: $index === 0 && saveActions.length === 0 }"> {{currentAction.getMetadata().name}} diff --git a/platform/commonUI/edit/src/controllers/EditActionController.js b/platform/commonUI/edit/src/controllers/EditActionController.js index 19fddf931d..7c33799ebb 100644 --- a/platform/commonUI/edit/src/controllers/EditActionController.js +++ b/platform/commonUI/edit/src/controllers/EditActionController.js @@ -27,7 +27,8 @@ define( [], function () { - var ACTION_CONTEXT = { category: 'conclude-editing' }; + var SAVE_ACTION_CONTEXT = { category: 'save' }; + var OTHERS_ACTION_CONTEXT = { category: 'conclude-editing' }; /** * Controller which supplies action instances for Save/Cancel. @@ -35,11 +36,30 @@ define( * @constructor */ function EditActionController($scope) { - // Maintain all "conclude-editing" actions in the present - // context. + + function actionToMenuOption(action) { + return { + key: action, + name: action.getMetadata().name, + cssclass: action.getMetadata().cssclass + }; + } + + // Maintain all "conclude-editing" and "save" actions in the + // present context. function updateActions() { - $scope.editActions = $scope.action ? - $scope.action.getActions(ACTION_CONTEXT) : + $scope.saveActions = $scope.action ? + $scope.action.getActions(SAVE_ACTION_CONTEXT) : + []; + + $scope.saveActionsAsMenuOptions = $scope.saveActions.map(actionToMenuOption); + + $scope.saveActionMenuClickHandler = function (clickedAction) { + clickedAction.perform(); + }; + + $scope.otherEditActions = $scope.action ? + $scope.action.getActions(OTHERS_ACTION_CONTEXT) : []; } diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index a51e165688..a175118f16 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -155,7 +155,7 @@ define( mockDomainObject.getModel.andReturn({persisted: 0}); expect(SaveAsAction.appliesTo(actionContext)).toBe(false); }); - + it("uses the editor capability to save the object", function () { mockEditorCapability.save.andReturn(new Promise(function () {})); runs(function () { diff --git a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js index 36faf7beb8..7905368e05 100644 --- a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js +++ b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js @@ -19,22 +19,54 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +/*global describe,it,expect,beforeEach,jasmine,spyOn*/ define( ["../../src/controllers/EditActionController"], function (EditActionController) { describe("The Edit Action controller", function () { + function FakeSaveAction() { + } + + var fakeSaveActionMetadata = { + name: "mocked-save-action", + cssclass: "mocked-save-action-css" + }; + + FakeSaveAction.prototype.getMetadata = function () { + return fakeSaveActionMetadata; + }; + + FakeSaveAction.prototype.perform = function () { + }; + + function fakeGetActions(actionContext) { + if (actionContext.category === "save") { + return [new FakeSaveAction(), new FakeSaveAction()]; + } else if (actionContext.category === "conclude-editing") { + return ["a", "b", "c"]; + } else { + throw "EditActionController uses a context that's not covered by tests."; + } + } + var mockScope, mockActions, controller; beforeEach(function () { mockActions = jasmine.createSpyObj("action", ["getActions"]); + mockActions.getActions.andCallFake(fakeGetActions); mockScope = jasmine.createSpyObj("$scope", ["$watch"]); + mockScope.action = mockActions; controller = new EditActionController(mockScope); }); + function makeControllerUpdateActions() { + mockScope.$watch.mostRecentCall.args[1](); + } + it("watches scope that may change applicable actions", function () { // The action capability expect(mockScope.$watch).toHaveBeenCalledWith( @@ -43,16 +75,36 @@ define( ); }); - it("populates the scope with grouped and ungrouped actions", function () { - mockScope.action = mockActions; + it("populates the scope with 'save' actions", function () { + makeControllerUpdateActions(); + expect(mockScope.saveActions.length).toEqual(2); + }); - mockActions.getActions.andReturn(["a", "b", "c"]); + it("converts 'save' actions to their menu counterparts", function () { + makeControllerUpdateActions(); + var menuOptions = mockScope.saveActionsAsMenuOptions; - // Call the watch - mockScope.$watch.mostRecentCall.args[1](); + expect(menuOptions.length).toEqual(2); + expect(menuOptions[0].key).toEqual(mockScope.saveActions[0]); + expect(menuOptions[1].key).toEqual(mockScope.saveActions[1]); + menuOptions.forEach(function (option) { + expect(option.name).toEqual(fakeSaveActionMetadata.name); + expect(option.cssclass).toEqual(fakeSaveActionMetadata.cssclass); + }); + }); - // Should have grouped and ungrouped actions in scope now - expect(mockScope.editActions.length).toEqual(3); + it("uses a click handler to perform the clicked action", function () { + makeControllerUpdateActions(); + var sampleSaveAction = mockScope.saveActions[0]; + + spyOn(sampleSaveAction, "perform"); + mockScope.saveActionMenuClickHandler(sampleSaveAction); + expect(sampleSaveAction.perform).toHaveBeenCalled(); + }); + + it("populates the scope with other 'conclude-editing' actions", function () { + makeControllerUpdateActions(); + expect(mockScope.otherEditActions).toEqual(["a", "b", "c"]); }); }); } From d3db26499c6cc3c7e5ff67c0b490c55988b9de48 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 15 Sep 2016 23:14:12 +0300 Subject: [PATCH 20/56] [Edit] CreateAction needs to perform("save-as") --- platform/commonUI/edit/src/creation/CreateAction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/edit/src/creation/CreateAction.js b/platform/commonUI/edit/src/creation/CreateAction.js index 711e4001a6..b83351544f 100644 --- a/platform/commonUI/edit/src/creation/CreateAction.js +++ b/platform/commonUI/edit/src/creation/CreateAction.js @@ -90,9 +90,9 @@ define( if (editAction) { return editAction.perform(); } else if (editorCapability) { - //otherwise, use the save action + //otherwise, use the save as action editorCapability.edit(); - return newObject.getCapability("action").perform("save").then(onSave, onCancel); + return newObject.getCapability("action").perform("save-as").then(onSave, onCancel); } }; From f03003b366c21c8e3aba882f7853c407deddd471 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 15 Sep 2016 23:18:53 +0300 Subject: [PATCH 21/56] [Edit] Fix CreateActionSpec --- platform/commonUI/edit/test/creation/CreateActionSpec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/edit/test/creation/CreateActionSpec.js b/platform/commonUI/edit/test/creation/CreateActionSpec.js index 60040b5410..cd3d3fbc91 100644 --- a/platform/commonUI/edit/test/creation/CreateActionSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionSpec.js @@ -157,13 +157,13 @@ define( expect(mockEditAction.perform).toHaveBeenCalled(); }); - it("uses the save action if object does not have an edit action" + + it("uses the save-as action if object does not have an edit action" + " available", function () { capabilities.action.getActions.andReturn([]); capabilities.action.perform.andReturn(mockPromise(undefined)); capabilities.editor.save.andReturn(promise); action.perform(); - expect(capabilities.action.perform).toHaveBeenCalledWith("save"); + expect(capabilities.action.perform).toHaveBeenCalledWith("save-as"); }); describe("uses to editor capability", function () { From 1446b16e77f1df668784e05c8047f591deba07c2 Mon Sep 17 00:00:00 2001 From: Alex M Date: Fri, 16 Sep 2016 03:15:10 +0300 Subject: [PATCH 22/56] [Edit] Using spy objects as save action mocks --- .../controllers/EditActionControllerSpec.js | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js index 7905368e05..6b7b52debc 100644 --- a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js +++ b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js @@ -26,24 +26,21 @@ define( function (EditActionController) { describe("The Edit Action controller", function () { - function FakeSaveAction() { - } - - var fakeSaveActionMetadata = { + var mockSaveActionMetadata = { name: "mocked-save-action", cssclass: "mocked-save-action-css" }; - FakeSaveAction.prototype.getMetadata = function () { - return fakeSaveActionMetadata; - }; - - FakeSaveAction.prototype.perform = function () { - }; - function fakeGetActions(actionContext) { if (actionContext.category === "save") { - return [new FakeSaveAction(), new FakeSaveAction()]; + var mockedSaveActions = [ + jasmine.createSpyObj("mockSaveAction", ["getMetadata", "perform"]), + jasmine.createSpyObj("mockSaveAction", ["getMetadata", "perform"]) + ]; + mockedSaveActions.forEach(function (action) { + action.getMetadata.andReturn(mockSaveActionMetadata); + }); + return mockedSaveActions; } else if (actionContext.category === "conclude-editing") { return ["a", "b", "c"]; } else { @@ -88,21 +85,19 @@ define( expect(menuOptions[0].key).toEqual(mockScope.saveActions[0]); expect(menuOptions[1].key).toEqual(mockScope.saveActions[1]); menuOptions.forEach(function (option) { - expect(option.name).toEqual(fakeSaveActionMetadata.name); - expect(option.cssclass).toEqual(fakeSaveActionMetadata.cssclass); + expect(option.name).toEqual(mockSaveActionMetadata.name); + expect(option.cssclass).toEqual(mockSaveActionMetadata.cssclass); }); }); it("uses a click handler to perform the clicked action", function () { makeControllerUpdateActions(); var sampleSaveAction = mockScope.saveActions[0]; - - spyOn(sampleSaveAction, "perform"); mockScope.saveActionMenuClickHandler(sampleSaveAction); expect(sampleSaveAction.perform).toHaveBeenCalled(); }); - it("populates the scope with other 'conclude-editing' actions", function () { + it("populates the scope with other editing actions", function () { makeControllerUpdateActions(); expect(mockScope.otherEditActions).toEqual(["a", "b", "c"]); }); From 2a2e9ef99df364a9b9c2780178caff40c174833f Mon Sep 17 00:00:00 2001 From: Alex M Date: Fri, 16 Sep 2016 03:24:00 +0300 Subject: [PATCH 23/56] [Edit] Make linter happy --- .../commonUI/edit/test/controllers/EditActionControllerSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js index 6b7b52debc..bd5c8a9524 100644 --- a/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js +++ b/platform/commonUI/edit/test/controllers/EditActionControllerSpec.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global describe,it,expect,beforeEach,jasmine,spyOn*/ +/*global describe,it,expect,beforeEach,jasmine*/ define( ["../../src/controllers/EditActionController"], From 0ec27350e09279de163d1c38a43a6882a1d415df Mon Sep 17 00:00:00 2001 From: smirecki Date: Fri, 16 Sep 2016 16:50:11 -0400 Subject: [PATCH 24/56] Update TimelineTickController.js One correction by @akhenry, "region, not reign". --- .../features/timeline/src/controllers/TimelineTickController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/features/timeline/src/controllers/TimelineTickController.js b/platform/features/timeline/src/controllers/TimelineTickController.js index fb1f2ad6b8..56275a6d16 100644 --- a/platform/features/timeline/src/controllers/TimelineTickController.js +++ b/platform/features/timeline/src/controllers/TimelineTickController.js @@ -28,7 +28,7 @@ define( /** * Provides labels for the tick mark area of a timeline view. - * Since the tick mark reign is potentially extremely large, + * Since the tick mark region is potentially extremely large, * only the subset of ticks which will actually be shown in * view are provided. * @constructor From ae89dcd62dd013db63dcda4e9a09ea1126003b5e Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 17 Sep 2016 00:39:49 +0300 Subject: [PATCH 25/56] [Edit] Make single save button use mct-control --- .../edit/res/templates/edit-action-buttons.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index 7884373d18..0cc21b02ca 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -22,11 +22,13 @@ - - {{saveActions[0].getMetadata().name}} - + + @@ -39,7 +41,7 @@ - + Date: Sat, 17 Sep 2016 01:05:46 +0300 Subject: [PATCH 26/56] [Edit] Rename action to Save and Finish Editing --- platform/commonUI/edit/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index b1af2f6f50..48f38d7ee9 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -208,7 +208,7 @@ define([ "key": "save-and-stop-editing", "category": "save", "implementation": SaveAndStopEditingAction, - "name": "Save and Done Editing", + "name": "Save and Finish Editing", "cssclass": "icon-save labeled", "description": "Save changes made to these objects.", "depends": [ From 48b25fe842756f871395903fe52b9ccd4bfc804b Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sat, 17 Sep 2016 16:32:26 +0900 Subject: [PATCH 27/56] [Formatting] Remove double negative logic Issue #1168 --- platform/commonUI/dialog/res/templates/overlay.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/dialog/res/templates/overlay.html b/platform/commonUI/dialog/res/templates/overlay.html index dcc847029d..215fe97aac 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. --> -
+
Date: Sat, 17 Sep 2016 16:36:55 +0900 Subject: [PATCH 28/56] [Frontend] Shorten overlay fade duration Issue #1168 --- platform/commonUI/general/res/sass/_constants.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/general/res/sass/_constants.scss b/platform/commonUI/general/res/sass/_constants.scss index 4cb240850b..1e609cc038 100644 --- a/platform/commonUI/general/res/sass/_constants.scss +++ b/platform/commonUI/general/res/sass/_constants.scss @@ -63,7 +63,7 @@ $ovrTopBarH: 45px; $ovrFooterH: 24px; $overlayMargin: 25px; /*************** Progress Overlay */ -$durEntryMs: 100ms; +$durEntryMs: 50ms; $delayEntryMs: 100ms; /*************** Items */ $ueBrowseGridItemLg: 200px; From 56e321f6d91c21d6bc2bbfc65b08455cbd12025f Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:18:02 +0900 Subject: [PATCH 29/56] [Forms] Add textarea template Issue #1184 --- platform/forms/bundle.js | 6 ++++ .../res/templates/controls/textarea.html | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 platform/forms/res/templates/controls/textarea.html diff --git a/platform/forms/bundle.js b/platform/forms/bundle.js index daa7063ffe..d3ee14f440 100644 --- a/platform/forms/bundle.js +++ b/platform/forms/bundle.js @@ -32,6 +32,7 @@ define([ "text!./res/templates/controls/datetime.html", "text!./res/templates/controls/select.html", "text!./res/templates/controls/textfield.html", + "text!./res/templates/controls/textarea.html", "text!./res/templates/controls/button.html", "text!./res/templates/controls/color.html", "text!./res/templates/controls/composite.html", @@ -51,6 +52,7 @@ define([ datetimeTemplate, selectTemplate, textfieldTemplate, + textareaTemplate, buttonTemplate, colorTemplate, compositeTemplate, @@ -103,6 +105,10 @@ define([ "key": "textfield", "template": textfieldTemplate }, + { + "key": "textarea", + "template": textareaTemplate + }, { "key": "button", "template": buttonTemplate diff --git a/platform/forms/res/templates/controls/textarea.html b/platform/forms/res/templates/controls/textarea.html new file mode 100644 index 0000000000..45c4db4e1e --- /dev/null +++ b/platform/forms/res/templates/controls/textarea.html @@ -0,0 +1,31 @@ + + + + + + From 4429e847e8d148ef01d999e8aa9523b588cf4eed Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:18:26 +0900 Subject: [PATCH 30/56] [Properties] Add notes field to all item types Issue #1184 --- platform/core/bundle.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/core/bundle.js b/platform/core/bundle.js index 8b4baf83ff..8567d11fc3 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -252,6 +252,12 @@ define([ "pattern": "\\S+", "required": true, "cssclass": "l-input-lg" + }, + { + "name": "Notes", + "control": "textarea", + "required": false, + "cssclass": "field-notes" } ] }, From f9ce27def3a6625e9f531adc252484ef7cc8159a Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:27:12 +0900 Subject: [PATCH 31/56] [Frontend] Add attributes for storing notes Issue #1184 --- platform/core/bundle.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/core/bundle.js b/platform/core/bundle.js index 8567d11fc3..0f2ba311c3 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -255,6 +255,8 @@ define([ }, { "name": "Notes", + "key": "notes", + "property": "notes", "control": "textarea", "required": false, "cssclass": "field-notes" From 56267095cba4425ddb70e2b70ab692db05db0132 Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:47:07 +0900 Subject: [PATCH 32/56] [Forms] Add style for small textareas Issue #1184. This allows for a generically sized text area in forms. I am anticipating some potential feedback on this given the approach and the sizing I chose may or may not be ideal for your requirements. --- platform/commonUI/general/res/sass/controls/_controls.scss | 1 + platform/core/bundle.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/general/res/sass/controls/_controls.scss b/platform/commonUI/general/res/sass/controls/_controls.scss index 7900739668..d1935d8ce0 100644 --- a/platform/commonUI/general/res/sass/controls/_controls.scss +++ b/platform/commonUI/general/res/sass/controls/_controls.scss @@ -216,6 +216,7 @@ input[type="search"] { .l-input-lg input[type="text"] { width: 100% !important; } .l-input-med input[type="text"] { width: 200px !important; } .l-input-sm input[type="text"] { width: 50px !important; } +.l-textarea-sm textarea { position: relative; height: 50px; } .l-numeric input[type="text"] { text-align: right; } .input-labeled { diff --git a/platform/core/bundle.js b/platform/core/bundle.js index 0f2ba311c3..4b9e2b9adb 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -259,7 +259,7 @@ define([ "property": "notes", "control": "textarea", "required": false, - "cssclass": "field-notes" + "cssclass": "l-textarea-sm" } ] }, From d913798d5b3c6a416a0a8857f4a6103f2155b6dd Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 22:52:41 +0900 Subject: [PATCH 33/56] [Timeline] Add battery starting state-of-charge Issue #1185 --- platform/features/timeline/bundle.js | 10 ++++++++++ .../timeline/src/capabilities/GraphCapability.js | 2 +- .../timeline/test/capabilities/GraphCapabilitySpec.js | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index 12effc50a3..145a496f08 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -182,6 +182,16 @@ define([ "capacity" ], "pattern": "^-?\\d+(\\.\\d*)?$" + }, + { + "name": "Battery Starting SOC", + "control": "textfield", + "required": false, + "conversion": "number", + "property": [ + "startingSOC" + ], + "pattern": "^-?\\d+(\\.\\d*)?$" } ], "model": { diff --git a/platform/features/timeline/src/capabilities/GraphCapability.js b/platform/features/timeline/src/capabilities/GraphCapability.js index d9810005a3..c4e5166f0e 100644 --- a/platform/features/timeline/src/capabilities/GraphCapability.js +++ b/platform/features/timeline/src/capabilities/GraphCapability.js @@ -60,7 +60,7 @@ define( result.power, 0, domainObject.getModel().capacity, // Watts - domainObject.getModel().capacity, + domainObject.getModel().startingSOC, 1 / 3600000 // millis-to-hour (since units are watt-hours) ); } diff --git a/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js b/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js index 71a6de2ade..e36724dbcb 100644 --- a/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js +++ b/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js @@ -101,6 +101,7 @@ define( it("provides a battery graph for timelines with capacity", function () { var mockCallback = jasmine.createSpy('callback'); testModel.capacity = 1000; + testModel.startingSOC = 1000; testModel.type = "timeline"; mockDomainObject.useCapability.andReturn(asPromise([ { key: "power", start: 0, end: 15 } From b50278e92fa6217bc4c890458b8f7a447045ed51 Mon Sep 17 00:00:00 2001 From: Alex M Date: Mon, 19 Sep 2016 20:22:46 +0300 Subject: [PATCH 34/56] [Edit] Remove mocked unused UrlService --- platform/commonUI/edit/test/actions/SaveAsActionSpec.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index a175118f16..c1b0eee003 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -33,7 +33,6 @@ define( mockDialogService, mockCopyService, mockParent, - mockUrlService, actionContext, capabilities = {}, action; @@ -112,12 +111,7 @@ define( "perform" ] ); - - mockUrlService = jasmine.createSpyObj( - "urlService", - ["urlForLocation"] - ); - + actionContext = { domainObject: mockDomainObject }; From f60fc2ebad09085fd71d80d1d900483c2999e025 Mon Sep 17 00:00:00 2001 From: Alex M Date: Mon, 19 Sep 2016 20:33:12 +0300 Subject: [PATCH 35/56] [Edit] EditorCapability.finish returns domainObj --- platform/commonUI/edit/src/capabilities/EditorCapability.js | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index 2ea532f6a6..1cbf239d7d 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -103,6 +103,7 @@ define( var domainObject = this.domainObject; return this.transactionService.cancel().then(function () { domainObject.getCapability("status").set("editing", false); + return domainObject; }); }; From e08704e6d30413cf5533e62be68f003334a3ff1c Mon Sep 17 00:00:00 2001 From: Alex M Date: Mon, 19 Sep 2016 20:39:54 +0300 Subject: [PATCH 36/56] [Edit] Make checkstyle happy --- platform/commonUI/edit/test/actions/SaveAsActionSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index c1b0eee003..95f0209800 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -111,7 +111,7 @@ define( "perform" ] ); - + actionContext = { domainObject: mockDomainObject }; From abfabc85b56f7b335484b4f30249362179d93371 Mon Sep 17 00:00:00 2001 From: Alex M Date: Mon, 19 Sep 2016 20:41:50 +0300 Subject: [PATCH 37/56] [Edit] Fix edit-action-buttons indent --- platform/commonUI/edit/res/templates/edit-action-buttons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index 0cc21b02ca..4bc020612f 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -41,7 +41,7 @@ - + Date: Mon, 19 Sep 2016 23:52:30 +0300 Subject: [PATCH 38/56] [Edit] Remove CreationService dep from SaveAs --- platform/commonUI/edit/bundle.js | 1 - platform/commonUI/edit/src/actions/SaveAsAction.js | 2 -- platform/commonUI/edit/test/actions/SaveAsActionSpec.js | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 48f38d7ee9..60da900176 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -237,7 +237,6 @@ define([ "$injector", "policyService", "dialogService", - "creationService", "copyService" ], "priority": "mandatory" diff --git a/platform/commonUI/edit/src/actions/SaveAsAction.js b/platform/commonUI/edit/src/actions/SaveAsAction.js index 402fccb86c..2befea07fd 100644 --- a/platform/commonUI/edit/src/actions/SaveAsAction.js +++ b/platform/commonUI/edit/src/actions/SaveAsAction.js @@ -42,7 +42,6 @@ define([ $injector, policyService, dialogService, - creationService, copyService, context ) { @@ -52,7 +51,6 @@ define([ }; this.policyService = policyService; this.dialogService = dialogService; - this.creationService = creationService; this.copyService = copyService; } diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index 95f0209800..f87cf4766f 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -116,7 +116,7 @@ define( domainObject: mockDomainObject }; - action = new SaveAsAction(undefined, undefined, mockDialogService, undefined, mockCopyService, actionContext); + action = new SaveAsAction(undefined, undefined, mockDialogService, mockCopyService, actionContext); spyOn(action, "getObjectService"); action.getObjectService.andReturn(mockObjectService); From 943e2ebe14fc076904ca2eb2832c08f8197efc1e Mon Sep 17 00:00:00 2001 From: David Hudson Date: Tue, 20 Sep 2016 17:40:08 +0900 Subject: [PATCH 39/56] [Timeline] Convert SOC to use percentages Also includes updated validation params which allow for floats to a maximum of 100 as well as a percentage sign which is later removed. --- platform/features/timeline/bundle.js | 4 ++-- .../features/timeline/src/capabilities/GraphCapability.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index 145a496f08..42b3c948f9 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -184,14 +184,14 @@ define([ "pattern": "^-?\\d+(\\.\\d*)?$" }, { - "name": "Battery Starting SOC", + "name": "Battery starting SOC (%)", "control": "textfield", "required": false, "conversion": "number", "property": [ "startingSOC" ], - "pattern": "^-?\\d+(\\.\\d*)?$" + "pattern": "^([0-9](\\.\\d*)?|[1-9][0-9](\\.\\d*)?|100)%?$" } ], "model": { diff --git a/platform/features/timeline/src/capabilities/GraphCapability.js b/platform/features/timeline/src/capabilities/GraphCapability.js index c4e5166f0e..86095b13ab 100644 --- a/platform/features/timeline/src/capabilities/GraphCapability.js +++ b/platform/features/timeline/src/capabilities/GraphCapability.js @@ -55,12 +55,14 @@ define( if (domainObject.getModel().type === 'timeline' && result.power && domainObject.getModel().capacity > 0) { + domainObject.getModel().startingSOC = + parseFloat(domainObject.getModel().startingSOC) || 100; result.battery = new CumulativeGraph( result.power, 0, domainObject.getModel().capacity, // Watts - domainObject.getModel().startingSOC, + (domainObject.getModel().startingSOC/100)*domainObject.getModel().capacity, 1 / 3600000 // millis-to-hour (since units are watt-hours) ); } From f1852541141857aafbb97b6bc02d168ede8067ee Mon Sep 17 00:00:00 2001 From: David Hudson Date: Tue, 20 Sep 2016 17:41:45 +0900 Subject: [PATCH 40/56] [Formatting] Fix missing spaces --- platform/features/timeline/src/capabilities/GraphCapability.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/features/timeline/src/capabilities/GraphCapability.js b/platform/features/timeline/src/capabilities/GraphCapability.js index 86095b13ab..4e9cce0c8c 100644 --- a/platform/features/timeline/src/capabilities/GraphCapability.js +++ b/platform/features/timeline/src/capabilities/GraphCapability.js @@ -62,7 +62,7 @@ define( result.power, 0, domainObject.getModel().capacity, // Watts - (domainObject.getModel().startingSOC/100)*domainObject.getModel().capacity, + (domainObject.getModel().startingSOC / 100) * domainObject.getModel().capacity, 1 / 3600000 // millis-to-hour (since units are watt-hours) ); } From 3d17435438c0d1c5e8c7647a0218b7e0718adc79 Mon Sep 17 00:00:00 2001 From: David Hudson Date: Tue, 20 Sep 2016 17:42:34 +0900 Subject: [PATCH 41/56] [Test] Update spec to use SOC percentage --- .../features/timeline/test/capabilities/GraphCapabilitySpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js b/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js index e36724dbcb..e2ccd376e2 100644 --- a/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js +++ b/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js @@ -101,7 +101,7 @@ define( it("provides a battery graph for timelines with capacity", function () { var mockCallback = jasmine.createSpy('callback'); testModel.capacity = 1000; - testModel.startingSOC = 1000; + testModel.startingSOC = 100; testModel.type = "timeline"; mockDomainObject.useCapability.andReturn(asPromise([ { key: "power", start: 0, end: 15 } From 3548cde9c44076c687038f20ebeec77939fd91e7 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 21 Sep 2016 16:12:09 -0700 Subject: [PATCH 42/56] [Edit Mode] Fixed issue with save dialog not being displayed for new objects after mutation. Fixes 1080 --- .../browse/src/navigation/NavigateAction.js | 26 +++++++--- .../test/navigation/NavigateActionSpec.js | 49 +++++++++++++++++-- .../commonUI/edit/src/actions/EditAction.js | 8 +-- .../edit/src/services/TransactionService.js | 2 +- .../edit/test/actions/EditActionSpec.js | 7 --- 5 files changed, 69 insertions(+), 23 deletions(-) diff --git a/platform/commonUI/browse/src/navigation/NavigateAction.js b/platform/commonUI/browse/src/navigation/NavigateAction.js index b3d935812a..efdfb270f4 100644 --- a/platform/commonUI/browse/src/navigation/NavigateAction.js +++ b/platform/commonUI/browse/src/navigation/NavigateAction.js @@ -48,20 +48,34 @@ define( */ NavigateAction.prototype.perform = function () { var self = this, - navigationAllowed = true; + navigateTo = this.domainObject, + currentObject = self.navigationService.getNavigation(), + editing = currentObject.hasCapability('editor') && + currentObject.getCapability('editor').isEditContextRoot(); 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() { + return self.$q.when(editing && currentObject.getCapability("editor").cancel()); + } + + 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 003012372b..b769d7dce1 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", + "cancel" + ]); + + 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 more", function () { + beforeEach(function () { + mockNavigatedObject.hasCapability.andCallFake(function (capability) { + return capability === "editor"; + }); + capabilities.editor.isEditContextRoot.andReturn(true); + }); + + it("cancels editing if in edit mode", function () { + action.perform(); + expect(capabilities.editor.cancel) + .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/edit/src/actions/EditAction.js b/platform/commonUI/edit/src/actions/EditAction.js index bd30968289..9c1afd3e28 100644 --- a/platform/commonUI/edit/src/actions/EditAction.js +++ b/platform/commonUI/edit/src/actions/EditAction.js @@ -69,18 +69,14 @@ define( * Enter edit mode. */ EditAction.prototype.perform = function () { - var self = this; - function cancelEditing() { - self.domainObject.getCapability('editor').cancel(); - self.navigationService.removeListener(cancelEditing); - } + //If this is not the currently navigated object, then navigate // to it. if (this.navigationService.getNavigation() !== this.domainObject) { this.navigationService.setNavigation(this.domainObject); } - this.navigationService.addListener(cancelEditing); + //this.navigationService.addListener(cancelEditing); this.domainObject.useCapability("editor"); }; diff --git a/platform/commonUI/edit/src/services/TransactionService.js b/platform/commonUI/edit/src/services/TransactionService.js index 119e314b17..df0a051f0d 100644 --- a/platform/commonUI/edit/src/services/TransactionService.js +++ b/platform/commonUI/edit/src/services/TransactionService.js @@ -138,7 +138,7 @@ define( try { results.push(onCancel()); } catch (error) { - this.$log.error("Error committing transaction."); + this.$log.error("Error cancelling transaction."); } } return this.$q.all(results).then(function () { diff --git a/platform/commonUI/edit/test/actions/EditActionSpec.js b/platform/commonUI/edit/test/actions/EditActionSpec.js index c896e83dd1..0e70e571c3 100644 --- a/platform/commonUI/edit/test/actions/EditActionSpec.js +++ b/platform/commonUI/edit/test/actions/EditActionSpec.js @@ -98,13 +98,6 @@ define( expect(EditAction.appliesTo(actionContext)).toBe(false); }); - it ("cancels editing when user navigates away", function () { - action.perform(); - expect(mockNavigationService.addListener).toHaveBeenCalled(); - mockNavigationService.addListener.mostRecentCall.args[0](); - expect(mockEditor.cancel).toHaveBeenCalled(); - }); - it ("invokes the Edit capability on the object", function () { action.perform(); expect(mockDomainObject.useCapability).toHaveBeenCalledWith("editor"); From 3c72eea9ef345310ff36043671347bd46e076762 Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Thu, 22 Sep 2016 10:41:14 -0700 Subject: [PATCH 43/56] [Frontend] Removed export buttons from objects when in layout Fixes #1202 CSS modded --- platform/commonUI/general/res/sass/_views.scss | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/platform/commonUI/general/res/sass/_views.scss b/platform/commonUI/general/res/sass/_views.scss index 357f9f3c7c..0a4cc651dd 100644 --- a/platform/commonUI/general/res/sass/_views.scss +++ b/platform/commonUI/general/res/sass/_views.scss @@ -31,23 +31,10 @@ .has-control-bar { $btnExportH: $btnFrameH; .l-control-bar { - @include trans-prop-nice(opacity, $dur: 50ms); - opacity: 0; + display: none; } .l-view-section { - @include trans-prop-nice(top, $dur: 150ms, $delay: 50ms); top: 0; } - &:hover { - .l-control-bar { - @include trans-prop-nice(opacity, 150ms, 100ms); - opacity: 1; - } - .l-view-section { - @include trans-prop-nice(top, $dur: 150ms); - top: $btnExportH + $interiorMargin; - } - } } - } \ No newline at end of file From 7a94efccbf2a35ef60f9fbf1f23acfc0287cfe46 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 22 Sep 2016 11:04:04 -0700 Subject: [PATCH 44/56] [Edit Mode] Fixed spelling mistake, moved variable declaration --- platform/commonUI/browse/src/navigation/NavigateAction.js | 7 ++++--- .../commonUI/browse/test/navigation/NavigateActionSpec.js | 2 +- platform/commonUI/edit/src/actions/EditAction.js | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/commonUI/browse/src/navigation/NavigateAction.js b/platform/commonUI/browse/src/navigation/NavigateAction.js index efdfb270f4..431ad8dadc 100644 --- a/platform/commonUI/browse/src/navigation/NavigateAction.js +++ b/platform/commonUI/browse/src/navigation/NavigateAction.js @@ -49,9 +49,7 @@ define( NavigateAction.prototype.perform = function () { var self = this, navigateTo = this.domainObject, - currentObject = self.navigationService.getNavigation(), - editing = currentObject.hasCapability('editor') && - currentObject.getCapability('editor').isEditContextRoot(); + currentObject = self.navigationService.getNavigation(); function allow() { var navigationAllowed = true; @@ -63,6 +61,9 @@ define( } function cancelIfEditing() { + var editing = currentObject.hasCapability('editor') && + currentObject.getCapability('editor').isEditContextRoot(); + return self.$q.when(editing && currentObject.getCapability("editor").cancel()); } diff --git a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js index b769d7dce1..509e7aef3d 100644 --- a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js +++ b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js @@ -140,7 +140,7 @@ define( }); }); - describe("in edit more", function () { + describe("in edit mode", function () { beforeEach(function () { mockNavigatedObject.hasCapability.andCallFake(function (capability) { return capability === "editor"; diff --git a/platform/commonUI/edit/src/actions/EditAction.js b/platform/commonUI/edit/src/actions/EditAction.js index 9c1afd3e28..e65f035edf 100644 --- a/platform/commonUI/edit/src/actions/EditAction.js +++ b/platform/commonUI/edit/src/actions/EditAction.js @@ -76,7 +76,6 @@ define( this.navigationService.setNavigation(this.domainObject); } - //this.navigationService.addListener(cancelEditing); this.domainObject.useCapability("editor"); }; From bad24d621361717e03de03d19670a480a3c83f9e Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 22 Sep 2016 15:48:48 -0700 Subject: [PATCH 45/56] [Build] Remove SNAPSHOT status ...to close sprint Pratchett, https://github.com/nasa/openmct/milestone/17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 555375007e..668b4de22b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "0.11.3-SNAPSHOT", + "version": "0.11.3", "description": "The Open MCT core platform", "dependencies": { "express": "^4.13.1", From 3f5388c2e893adc590d080dfaf11c0b6950b52e6 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 22 Sep 2016 16:20:18 -0700 Subject: [PATCH 46/56] [Build] Restore SNAPSHOT status ...and bump version number to open sprint Rajaniemi, https://github.com/nasa/openmct/milestone/18 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 668b4de22b..e47a64e50e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "0.11.3", + "version": "0.12.0-SNAPSHOT", "description": "The Open MCT core platform", "dependencies": { "express": "^4.13.1", From 98f387b605108d589a7b68ebac2632f1791302f9 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 22 Sep 2016 17:34:53 -0700 Subject: [PATCH 47/56] [Edit Mode] Renamed function from EditAction.cancel() to EditAction.finish() --- platform/commonUI/browse/src/navigation/NavigateAction.js | 2 +- .../commonUI/browse/test/navigation/NavigateActionSpec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/browse/src/navigation/NavigateAction.js b/platform/commonUI/browse/src/navigation/NavigateAction.js index 431ad8dadc..6121213a51 100644 --- a/platform/commonUI/browse/src/navigation/NavigateAction.js +++ b/platform/commonUI/browse/src/navigation/NavigateAction.js @@ -64,7 +64,7 @@ define( var editing = currentObject.hasCapability('editor') && currentObject.getCapability('editor').isEditContextRoot(); - return self.$q.when(editing && currentObject.getCapability("editor").cancel()); + return self.$q.when(editing && currentObject.getCapability("editor").finish()); } function navigate() { diff --git a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js index 509e7aef3d..f9b756eeaa 100644 --- a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js +++ b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js @@ -61,7 +61,7 @@ define( capabilities.editor = jasmine.createSpyObj("editorCapability", [ "isEditContextRoot", - "cancel" + "finish" ]); mockNavigatedObject.getCapability.andCallFake(function (capability) { @@ -148,9 +148,9 @@ define( capabilities.editor.isEditContextRoot.andReturn(true); }); - it("cancels editing if in edit mode", function () { + it("finishes editing if in edit mode", function () { action.perform(); - expect(capabilities.editor.cancel) + expect(capabilities.editor.finish) .toHaveBeenCalled(); }); }); From 4b51e604a75b167b0aa117095b5b9327d80d0ece Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 24 Sep 2016 20:43:35 +0300 Subject: [PATCH 48/56] [Edit] Switch other edit actions to mct-control --- platform/commonUI/edit/bundle.js | 4 +++- .../edit/res/templates/edit-action-buttons.html | 13 +++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 60da900176..1094abb864 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -245,7 +245,9 @@ define([ "key": "cancel", "category": "conclude-editing", "implementation": CancelAction, - "name": "Cancel", + // Because we use the name as label for edit buttons and mct-control buttons need + // the label to be set to undefined in order to not apply the labeled CSS rule. + "name": undefined, "cssclass": "icon-x no-label", "description": "Discard changes made to these objects.", "depends": [] diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index 4bc020612f..7c1017992a 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -42,11 +42,12 @@ - - {{currentAction.getMetadata().name}} - + + \ No newline at end of file From a34e89d56a8c33cde53bd37c59e25922e272e337 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 27 Sep 2016 21:19:25 +0300 Subject: [PATCH 49/56] [Edit] Bind action to .perform() inside mct-button --- .../commonUI/edit/res/templates/edit-action-buttons.html | 4 ++-- .../commonUI/edit/src/controllers/EditActionController.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/edit/res/templates/edit-action-buttons.html b/platform/commonUI/edit/res/templates/edit-action-buttons.html index 7c1017992a..2af47b6878 100644 --- a/platform/commonUI/edit/res/templates/edit-action-buttons.html +++ b/platform/commonUI/edit/res/templates/edit-action-buttons.html @@ -25,7 +25,7 @@ @@ -45,7 +45,7 @@ diff --git a/platform/commonUI/edit/src/controllers/EditActionController.js b/platform/commonUI/edit/src/controllers/EditActionController.js index 7c33799ebb..ba91b63e9d 100644 --- a/platform/commonUI/edit/src/controllers/EditActionController.js +++ b/platform/commonUI/edit/src/controllers/EditActionController.js @@ -61,6 +61,12 @@ define( $scope.otherEditActions = $scope.action ? $scope.action.getActions(OTHERS_ACTION_CONTEXT) : []; + + // Required because Angular does not allow 'bind' + // in expressions. + $scope.actionPerformer = function (action) { + return action.perform.bind(action); + }; } // Update set of actions whenever the action capability From 754d7b3cd76e2ddd2163efc94a4090a47d4c6649 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Sep 2016 16:47:35 -0700 Subject: [PATCH 50/56] [Build] Restore SNAPSHOT status ... for a patch build related to #1208 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 668b4de22b..fd45d23357 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "0.11.3", + "version": "0.11.4-SNAPSHOT", "description": "The Open MCT core platform", "dependencies": { "express": "^4.13.1", From 91b63f78eb9dd9882541b040092a62fa2b43fabc Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Sep 2016 16:40:29 -0700 Subject: [PATCH 51/56] [Build] Depend on non-minified jsPDF Fixes #1208 (for some reason) --- main.js | 2 +- test-main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 3fc2c4da36..34d1afeeeb 100644 --- a/main.js +++ b/main.js @@ -29,7 +29,7 @@ requirejs.config({ "csv": "bower_components/comma-separated-values/csv.min", "es6-promise": "bower_components/es6-promise/es6-promise.min", "html2canvas": "bower_components/html2canvas/build/html2canvas.min", - "jsPDF": "bower_components/jspdf/dist/jspdf.min", + "jsPDF": "bower_components/jspdf/dist/jspdf.debug", "moment": "bower_components/moment/moment", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "saveAs": "bower_components/FileSaver.js/FileSaver.min", diff --git a/test-main.js b/test-main.js index 43142766b9..ff8a50ca6b 100644 --- a/test-main.js +++ b/test-main.js @@ -55,7 +55,7 @@ requirejs.config({ "csv": "bower_components/comma-separated-values/csv.min", "es6-promise": "bower_components/es6-promise/es6-promise.min", "html2canvas": "bower_components/html2canvas/build/html2canvas.min", - "jsPDF": "bower_components/jspdf/dist/jspdf.min", + "jsPDF": "bower_components/jspdf/dist/jspdf.debug", "moment": "bower_components/moment/moment", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "saveAs": "bower_components/FileSaver.js/FileSaver.min", From d248dfe34674dc0a5e01631c5478aea36769711e Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Sep 2016 16:48:38 -0700 Subject: [PATCH 52/56] [Build] Remove SNAPSHOT status ...to tag a build which addresses release blocker #1208 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd45d23357..333b4258eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "0.11.4-SNAPSHOT", + "version": "0.11.4", "description": "The Open MCT core platform", "dependencies": { "express": "^4.13.1", From e1276e464debed1ba0fdfbfc3bfba3b1c2078315 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Sep 2016 16:49:09 -0700 Subject: [PATCH 53/56] [Build] Restore version identifier --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 333b4258eb..e47a64e50e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "0.11.4", + "version": "0.12.0-SNAPSHOT", "description": "The Open MCT core platform", "dependencies": { "express": "^4.13.1", From e077f9ee1845e1a551084e0239a65209ad395cae Mon Sep 17 00:00:00 2001 From: David Hudson Date: Fri, 30 Sep 2016 21:34:03 +0200 Subject: [PATCH 54/56] [Timeline] Fix logic error Issue #1185. Also removed direct modification of domain object. --- .../timeline/src/capabilities/GraphCapability.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/features/timeline/src/capabilities/GraphCapability.js b/platform/features/timeline/src/capabilities/GraphCapability.js index 4e9cce0c8c..181c909f79 100644 --- a/platform/features/timeline/src/capabilities/GraphCapability.js +++ b/platform/features/timeline/src/capabilities/GraphCapability.js @@ -37,7 +37,8 @@ define( // Build graphs for this group of utilizations function buildGraphs(utilizations) { var utilizationMap = {}, - result = {}; + result = {}, + startingSOC; // Bucket utilizations by type utilizations.forEach(function (u) { @@ -55,14 +56,14 @@ define( if (domainObject.getModel().type === 'timeline' && result.power && domainObject.getModel().capacity > 0) { - domainObject.getModel().startingSOC = - parseFloat(domainObject.getModel().startingSOC) || 100; + startingSOC = isNaN(parseFloat(domainObject.getModel().startingSOC)) ? + 100 : parseFloat(domainObject.getModel().startingSOC); result.battery = new CumulativeGraph( result.power, 0, domainObject.getModel().capacity, // Watts - (domainObject.getModel().startingSOC / 100) * domainObject.getModel().capacity, + (startingSOC / 100) * domainObject.getModel().capacity, 1 / 3600000 // millis-to-hour (since units are watt-hours) ); } From ed102492e5529c0d840f00f33121e0161fa7e4b9 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Fri, 30 Sep 2016 12:49:02 -0700 Subject: [PATCH 55/56] [Bower] specify jspdf minor version Specify jsPDF minor version to avoid updating to v1.3.0, which appears to have problems with requirejs bundling. Fixes https://github.com/nasa/openmct/issues/1214 --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 922eb905f3..7dbb8f9860 100644 --- a/bower.json +++ b/bower.json @@ -20,6 +20,6 @@ "FileSaver.js": "^0.0.2", "zepto": "^1.1.6", "html2canvas": "^0.4.1", - "jspdf": "^1.2.61" + "jspdf": "1.2.x" } } From ae6f6565fa61418406aafcad31d32e90c49fbb2f Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Fri, 30 Sep 2016 16:54:42 -0700 Subject: [PATCH 56/56] [export] remove pdf export Remove pdf export with extreme prejudice due to issues with build process. Fixes https://github.com/nasa/openmct/issues/1217 --- bower.json | 3 +-- main.js | 4 ---- platform/features/plot/bundle.js | 10 -------- .../features/plot/res/templates/plot.html | 5 ---- platform/features/plot/src/PlotController.js | 11 --------- .../plot/src/services/ExportImageService.js | 24 ++----------------- .../features/plot/test/PlotControllerSpec.js | 2 +- .../test/services/ExportImageServiceSpec.js | 21 ---------------- test-main.js | 1 - 9 files changed, 4 insertions(+), 77 deletions(-) diff --git a/bower.json b/bower.json index 7dbb8f9860..419871fe57 100644 --- a/bower.json +++ b/bower.json @@ -19,7 +19,6 @@ "comma-separated-values": "^3.6.4", "FileSaver.js": "^0.0.2", "zepto": "^1.1.6", - "html2canvas": "^0.4.1", - "jspdf": "1.2.x" + "html2canvas": "^0.4.1" } } diff --git a/main.js b/main.js index 34d1afeeeb..6968d8ff26 100644 --- a/main.js +++ b/main.js @@ -29,7 +29,6 @@ requirejs.config({ "csv": "bower_components/comma-separated-values/csv.min", "es6-promise": "bower_components/es6-promise/es6-promise.min", "html2canvas": "bower_components/html2canvas/build/html2canvas.min", - "jsPDF": "bower_components/jspdf/dist/jspdf.debug", "moment": "bower_components/moment/moment", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "saveAs": "bower_components/FileSaver.js/FileSaver.min", @@ -48,9 +47,6 @@ requirejs.config({ "html2canvas": { "exports": "html2canvas" }, - "jsPDF": { - "exports": "jsPDF" - }, "moment-duration-format": { "deps": ["moment"] }, diff --git a/platform/features/plot/bundle.js b/platform/features/plot/bundle.js index 691e310791..ec4e6f375a 100644 --- a/platform/features/plot/bundle.js +++ b/platform/features/plot/bundle.js @@ -146,16 +146,6 @@ define([ "copyright": "Copyright © 2012 Niklas von Hertzen.", "license": "license-mit", "link": "https://github.com/niklasvh/html2canvas/blob/master/LICENSE" - }, - { - "name": "jsPDF", - "version": "1.2.61", - "author": "James Hall", - "description": "JavaScript HTML renderer", - "website": "https://github.com/MrRio/jsPDF", - "copyright": "Copyright © 2010-2016 James Hall", - "license": "license-mit", - "link": "https://github.com/MrRio/jsPDF/blob/master/MIT-LICENSE.txt" } ] } diff --git a/platform/features/plot/res/templates/plot.html b/platform/features/plot/res/templates/plot.html index e25b582044..461389e2c1 100644 --- a/platform/features/plot/res/templates/plot.html +++ b/platform/features/plot/res/templates/plot.html @@ -23,11 +23,6 @@ class="abs holder holder-plot has-control-bar">
- - PDF - diff --git a/platform/features/plot/src/PlotController.js b/platform/features/plot/src/PlotController.js index 3b23bce34a..b5af440731 100644 --- a/platform/features/plot/src/PlotController.js +++ b/platform/features/plot/src/PlotController.js @@ -368,17 +368,6 @@ define( return this.pending; }; - /** - * Export the plot to PDF - */ - PlotController.prototype.exportPDF = function () { - var self = this; - self.hideExportButtons = true; - self.exportImageService.exportPDF(self.$element[0], "plot.pdf").finally(function () { - self.hideExportButtons = false; - }); - }; - /** * Export the plot to PNG */ diff --git a/platform/features/plot/src/services/ExportImageService.js b/platform/features/plot/src/services/ExportImageService.js index d49adc15ec..8fa02c8bf5 100644 --- a/platform/features/plot/src/services/ExportImageService.js +++ b/platform/features/plot/src/services/ExportImageService.js @@ -26,32 +26,29 @@ define( [ "html2canvas", - "jsPDF", "saveAs" ], function ( html2canvas, - jsPDF, saveAs ) { var self = this; /** * The export image service will export any HTML node to - * PDF, JPG, or PNG. + * JPG, or PNG. * @param {object} $q * @param {object} $timeout * @param {object} $log * @param {constant} EXPORT_IMAGE_TIMEOUT time in milliseconds before a timeout error is returned * @constructor */ - function ExportImageService($q, $timeout, $log, EXPORT_IMAGE_TIMEOUT, injHtml2Canvas, injJsPDF, injSaveAs, injFileReader) { + function ExportImageService($q, $timeout, $log, EXPORT_IMAGE_TIMEOUT, injHtml2Canvas, injSaveAs, injFileReader) { self.$q = $q; self.$timeout = $timeout; self.$log = $log; self.EXPORT_IMAGE_TIMEOUT = EXPORT_IMAGE_TIMEOUT; self.html2canvas = injHtml2Canvas || html2canvas; - self.jsPDF = injJsPDF || jsPDF; self.saveAs = injSaveAs || saveAs; self.reader = injFileReader || new FileReader(); } @@ -128,23 +125,6 @@ define( } } - /** - * Takes a screenshot of a DOM node and exports to PDF. - * @param {node} element to be exported - * @param {string} filename the exported image - * @returns {promise} - */ - ExportImageService.prototype.exportPDF = function (element, filename) { - return renderElement(element, "jpeg").then(function (img) { - self.reader.readAsDataURL(img); - self.reader.onloadend = function () { - var pdf = new self.jsPDF("l", "px", [element.offsetHeight, element.offsetWidth]); - pdf.addImage(self.reader.result, "JPEG", 0, 0, element.offsetWidth, element.offsetHeight); - pdf.save(filename); - }; - }); - }; - /** * Takes a screenshot of a DOM node and exports to JPG. * @param {node} element to be exported diff --git a/platform/features/plot/test/PlotControllerSpec.js b/platform/features/plot/test/PlotControllerSpec.js index 73a01d716a..482af047cb 100644 --- a/platform/features/plot/test/PlotControllerSpec.js +++ b/platform/features/plot/test/PlotControllerSpec.js @@ -72,7 +72,7 @@ define( mockElement = angular.element('
'); mockExportImageService = jasmine.createSpyObj( "ExportImageService", - ["exportJPG", "exportPNG", "exportPDF"] + ["exportJPG", "exportPNG"] ); mockFormatter = jasmine.createSpyObj( "formatter", diff --git a/platform/features/plot/test/services/ExportImageServiceSpec.js b/platform/features/plot/test/services/ExportImageServiceSpec.js index 111a8d3432..675429f4e2 100644 --- a/platform/features/plot/test/services/ExportImageServiceSpec.js +++ b/platform/features/plot/test/services/ExportImageServiceSpec.js @@ -33,8 +33,6 @@ define( mockLog, mockHtml2Canvas, mockCanvas, - mockJsPDF, - mockJsPDFSave, mockSaveAs, mockFileReader, mockExportTimeoutConstant, @@ -79,13 +77,6 @@ define( "canvas", ["toBlob"] ); - mockJsPDFSave = jasmine.createSpy("jsPDFSave"); - mockJsPDF = function () { - return { - "addImage": function () {}, - "save": mockJsPDFSave - }; - }; mockSaveAs = jasmine.createSpy("saveAs"); mockFileReader = jasmine.createSpyObj( "FileReader", @@ -100,23 +91,11 @@ define( mockLog, mockExportTimeoutConstant, mockHtml2Canvas, - mockJsPDF, mockSaveAs, mockFileReader ); }); - it("runs html2canvas and tries to save a pdf", function () { - exportImageService.exportPDF(testElement, "plot.pdf"); - mockFileReader.onloadend(); - - expect(mockHtml2Canvas).toHaveBeenCalledWith(testElement, { onrendered: jasmine.any(Function) }); - expect(mockCanvas.toBlob).toHaveBeenCalledWith(mockDeferred.resolve, "image/jpeg"); - expect(mockDeferred.reject).not.toHaveBeenCalled(); - expect(mockJsPDFSave).toHaveBeenCalled(); - expect(mockPromise.finally).toHaveBeenCalled(); - }); - it("runs html2canvas and tries to save a png", function () { exportImageService.exportPNG(testElement, "plot.png"); diff --git a/test-main.js b/test-main.js index ff8a50ca6b..e006094a24 100644 --- a/test-main.js +++ b/test-main.js @@ -55,7 +55,6 @@ requirejs.config({ "csv": "bower_components/comma-separated-values/csv.min", "es6-promise": "bower_components/es6-promise/es6-promise.min", "html2canvas": "bower_components/html2canvas/build/html2canvas.min", - "jsPDF": "bower_components/jspdf/dist/jspdf.debug", "moment": "bower_components/moment/moment", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "saveAs": "bower_components/FileSaver.js/FileSaver.min",