From acdd9622d2ababa4a59ee1d0d04a816791f5d795 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 9 Nov 2015 16:51:39 -0800 Subject: [PATCH 01/10] [Topic] Add test case ...which specifies desired behavior for nasa/openmctweb#231. --- platform/core/test/services/TopicSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/platform/core/test/services/TopicSpec.js b/platform/core/test/services/TopicSpec.js index b389b19579..e3732cc240 100644 --- a/platform/core/test/services/TopicSpec.js +++ b/platform/core/test/services/TopicSpec.js @@ -65,6 +65,21 @@ define( expect(mockCallback).toHaveBeenCalledWith(testMessage); }); + it("is robust against errors thrown by listeners", function () { + var mockBadCallback = jasmine.createSpy("bad-callback"), + t = topic(); + + mockBadCallback.andCallFake(function () { + throw new Error("I'm afraid I can't do that."); + }); + + t.listen(mockBadCallback); + t.listen(mockCallback); + + t.notify(testMessage); + expect(mockCallback).toHaveBeenCalledWith(testMessage); + }); + }); } ); From e3e44f74d662832dac90a8c3a00805a867eb3ae0 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 9 Nov 2015 16:55:22 -0800 Subject: [PATCH 02/10] [Topic] Catch errors from listeners --- platform/core/bundle.json | 3 ++- platform/core/src/services/Topic.js | 10 ++++++++-- platform/core/test/services/TopicSpec.js | 7 ++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/platform/core/bundle.json b/platform/core/bundle.json index 330ac1c2b9..12cedd9a5a 100644 --- a/platform/core/bundle.json +++ b/platform/core/bundle.json @@ -207,7 +207,8 @@ }, { "key": "topic", - "implementation": "services/Topic.js" + "implementation": "services/Topic.js", + "depends": [ "$log" ] }, { "key": "contextualize", diff --git a/platform/core/src/services/Topic.js b/platform/core/src/services/Topic.js index ca38dfcde7..99f042cd43 100644 --- a/platform/core/src/services/Topic.js +++ b/platform/core/src/services/Topic.js @@ -26,6 +26,8 @@ define( function () { "use strict"; + var ERROR_PREFIX = "Error when notifying listener: "; + /** * The `topic` service provides a way to create both named, * shared listeners and anonymous, private listeners. @@ -46,7 +48,7 @@ define( * @returns {Function} * @memberof platform/core */ - function Topic() { + function Topic($log) { var topics = {}; function createTopic() { @@ -63,7 +65,11 @@ define( }, notify: function (message) { listeners.forEach(function (listener) { - listener(message); + try { + listener(message); + } catch (e) { + $log.error(ERROR_PREFIX + e.message); + } }); } }; diff --git a/platform/core/test/services/TopicSpec.js b/platform/core/test/services/TopicSpec.js index e3732cc240..22865a2571 100644 --- a/platform/core/test/services/TopicSpec.js +++ b/platform/core/test/services/TopicSpec.js @@ -28,13 +28,18 @@ define( describe("The 'topic' service", function () { var topic, + mockLog, testMessage, mockCallback; beforeEach(function () { testMessage = { someKey: "some value"}; + mockLog = jasmine.createSpyObj( + '$log', + [ 'error', 'warn', 'info', 'debug' ] + ); mockCallback = jasmine.createSpy('callback'); - topic = new Topic(); + topic = new Topic(mockLog); }); it("notifies listeners on a topic", function () { From fdf61488115d010ccb5da8efaf93216f626e2696 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 9 Nov 2015 17:48:58 -0800 Subject: [PATCH 03/10] [Layout] Enforce minimum size on drop Addresses nasa/openmctweb#271, ensuring frames in a layout are not too tiny to use, even if the grid size is small. --- .../features/layout/src/LayoutController.js | 2 +- .../layout/test/LayoutControllerSpec.js | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/platform/features/layout/src/LayoutController.js b/platform/features/layout/src/LayoutController.js index 89364a1bb2..d7906dd0fa 100644 --- a/platform/features/layout/src/LayoutController.js +++ b/platform/features/layout/src/LayoutController.js @@ -113,7 +113,7 @@ define( Math.floor(position.x / self.gridSize[0]), Math.floor(position.y / self.gridSize[1]) ], - dimensions: DEFAULT_DIMENSIONS + dimensions: self.defaultDimensions() }; // Mark change as persistable if ($scope.commit) { diff --git a/platform/features/layout/test/LayoutControllerSpec.js b/platform/features/layout/test/LayoutControllerSpec.js index b0ab7a13fb..085f7766a2 100644 --- a/platform/features/layout/test/LayoutControllerSpec.js +++ b/platform/features/layout/test/LayoutControllerSpec.js @@ -192,6 +192,29 @@ define( expect(parseInt(styleB.width, 10)).toBeGreaterThan(63); expect(parseInt(styleB.width, 10)).toBeGreaterThan(31); }); + + it("ensures a minimum frame size on drop", function () { + var style; + + // Start with a very small frame size + testModel.layoutGrid = [ 1, 1 ]; + mockScope.$watch.calls[0].args[1](testModel.layoutGrid); + + // Notify that a drop occurred + testModel.composition.push('d'); + mockScope.$on.mostRecentCall.args[1]( + mockEvent, + 'd', + { x: 300, y: 100 } + ); + mockScope.$watch.calls[0].args[1](['d']); + + style = controller.getFrameStyle("d"); + + // Resulting size should still be reasonably large pixel-size + expect(parseInt(style.width, 10)).toBeGreaterThan(63); + expect(parseInt(style.height, 10)).toBeGreaterThan(31); + }); }); } ); From c5736cafb14ded5e49263ef70583f8f5c12fdbb4 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 10 Nov 2015 17:27:43 -0800 Subject: [PATCH 04/10] [Documentation] Add process documentation Bring over process documentation (except for calendar), nasa/openmctweb#223. --- docs/src/index.html | 1 + docs/src/process/index.md | 107 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 docs/src/process/index.md diff --git a/docs/src/index.html b/docs/src/index.html index e80a6138b2..727523eda3 100644 --- a/docs/src/index.html +++ b/docs/src/index.html @@ -32,6 +32,7 @@
  • Architecture Overview
  • Developer Guide
  • Tutorials
  • +
  • Development Process
  • diff --git a/docs/src/process/index.md b/docs/src/process/index.md new file mode 100644 index 0000000000..0ea54eeb4d --- /dev/null +++ b/docs/src/process/index.md @@ -0,0 +1,107 @@ +# Development Cycle + +Development of Open MCT Web occurs on an iterative cycle of +sprints and releases. + +* A _sprint_ is three weeks in duration, and represents a + set of improvements that can be completed and tested by the + development team. Software at the end of the sprint is + "semi-stable"; it will have undergone reduced testing and may carry + defects or usability issues of lower severity, particularly if + there are workarounds. +* A _release_ occurs every four sprints. Releases are stable, and + will have undergone full acceptance testing to ensure that the + software behaves correctly and usably. + +## Roles + +The sprint process assumes the presence of a __project manager.__ +The project manager is responsible for +making tactical decisions about what development work will be +performed, and for coordinating with stakeholders to arrive at +higher-level strategic decisions about desired functionality +and characteristics of the software, major external milestones, +and so forth. + +In the absence of a dedicated project manager, this role may be rotated +among members of the development team on a per-sprint basis. + +Responsibilities of the project manager including: + +* Maintaining (with agreement of stakeholders) a "road map" of work + planned for future releases/sprints; this should be higher-level, + usually expressed as "themes", + with just enough specificity to gauge feasibility of plans, + relate work back to milestones, and identify longer-term + dependencies. +* Determining (with assistance from the rest of the team) which + issues to work on in a given sprint and how they shall be + assigned. +* Pre-planning subsequent sprints to ensure that all members of the + team always have a clear direction. +* Scheduling and/or ensuring adherance to + [process points](#process-points). +* Responding to changes within the sprint (shifting priorities, + new issues) and re-allocating work for the sprint as needed. + +## Sprint Calendar + +## Process Points + +* __Sprint plan.__ Project manager allocates issues based on + theme(s) for sprint, then reviews with team. Each team member + should have roughly two weeks of work allocated (to allow time + in the third week for testing of work completed.) + * Project manager should also sketch out subsequent sprint so + that team may begin work for that sprint during the + third week, since testing and blocker resolution is unlikely + to require all available resources. +* __Tag-up.__ Check in and status update among development team. + May amend plan for sprint as-needed. +* __Code freeze.__ Any new work from this sprint + (features, bug fixes, enhancements) must be integrated by the + end of the second week of the sprint. After code freeze + (and until the end of the sprint) the only changes that should be + merged into the master branch should directly address issues + needed to pass acceptance testing. +* __Acceptance Testing.__ Structured testing with predefined + success criteria. No release should ship without passing + acceptance tests. Time is allocated in each sprint for subsequent + rounds of acceptance testing if issues are identified during a + prior round. Specific details of acceptance testing need to be + agreed-upon with relevant stakeholders and delivery recipients, + and should be flexible enough to allow changes to plans + (e.g. deferring delivery of some feature in order to ensure + stability of other features.) Baseline testing includes: + * __Testathon.__ Multi-user testing, involving as many users as + is feasible, plus development team. Open-ended; should verify + completed work from this sprint, test exploratorily for + regressions, et cetera. + * __24-Hour Test.__ A test to verify that the software remains + stable after running for longer durations. May include some + combination of automated testing and user verification (e.g. + checking to verify that software remains subjectively + responsive at conclusion of test.) + * __Automated Testing.__ Automated testing integrated into the + build. (These tests are verified to pass more often than once + per sprint, as they run before any merge to master, but still + play an important role in acceptance testing.) +* __Sprint Acceptance Testing.__ Subset of Acceptance Testing + which should be performed before shipping at the end of any + sprint. Time is allocated for a second round of + Sprint Acceptance Testing if the first round is not passed. +* __Triage.__ Team reviews issues from acceptance testing and uses + success criteria to determine whether or not they should block + release, then formulates a plan to address these issues before + the next round of acceptance testing. Focus here should be on + ensuring software passes that testing in order to ship on time; + may prefer to disable malfunctioning components and fix them + in a subsequent sprint, for example. +* __Ship.__ Tag a code snapshot that has passed acceptance + testing and deploy that version. (Only true if acceptance + testing has passed by this point; if acceptance testing has not + been passed, will need to make ad hoc decisions with stakeholders, + e.g. “extend the sprint” or “defer shipment until end of next + sprint.”) + + From 646df818747294bad3a07875a54069a3b54ebfdb Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 12 Nov 2015 09:52:47 -0800 Subject: [PATCH 05/10] [Documentation] Add sprint calendars ...and fix quotes copied from original sketch of document. --- docs/src/process/index.md | 52 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/docs/src/process/index.md b/docs/src/process/index.md index 0ea54eeb4d..12b2ea229d 100644 --- a/docs/src/process/index.md +++ b/docs/src/process/index.md @@ -46,6 +46,54 @@ Responsibilities of the project manager including: ## Sprint Calendar +Certain process points are regularly scheduled in the sprint cycle. + +### Sprints by Release + +Allocation of work among sprints should be planned relative to release +goals and milestones. As a general guideline, higher-risk work (large +new features which may carry new defects, major refactoring, design +changes with uncertain effects on usability) should be allocated to +earlier sprints, allowing for time in later sprints to ensure stability. + +| Sprint | Focus | +|:------:|:--------------------------------------------------------| +| __1__ | Prototyping, design, experimentation. | +| __2__ | New features, refinements, enhancements. | +| __3__ | Feature completion, low-risk enhancements, bug fixing. | +| __4__ | Stability & quality assurance. | + +### Sprints 1-3 + +The first three sprints of a release are primarily centered around +development work, with regular acceptance testing in the third +week. During this third week, the top priority should be passing +acceptance testing (e.g. by resolving any blockers found); any +resources not needed for this effort should be used to begin work +for the subsequent sprint. + +| Week | Mon | Tue | Wed | Thu | Fri | +|:-----:|:-------------------------:|:------:|:---:|:----------------------------:|:-----------:| +| __1__ | Sprint plan | Tag-up | | | | +| __2__ | | Tag-up | | | Code freeze | +| __3__ | Sprint acceptance testing | Triage | | _Sprint acceptance testing*_ | Ship | + +* If necessary. + +### Sprint 4 + +The software must be stable at the end of the fourth sprint; because of +this, the fourth sprint is scheduled differently, with a heightened +emphasis on testing. + +| | Mon | Tue | Wed | Thu | Fri | +|-------:|:-------------------------:|:------:|:---:|:----------------------------:|:-----------:| +| Week 1 | Sprint plan | Tag-up | | | Code freeze | +| Week 2 | Acceptance testing | Triage | | | | +| Week 3 | _Acceptance testing*_ | Triage | | _Acceptance testing*_ | Ship | + +* If necessary. + ## Process Points * __Sprint plan.__ Project manager allocates issues based on @@ -101,7 +149,7 @@ Responsibilities of the project manager including: testing and deploy that version. (Only true if acceptance testing has passed by this point; if acceptance testing has not been passed, will need to make ad hoc decisions with stakeholders, - e.g. “extend the sprint” or “defer shipment until end of next - sprint.”) + e.g. "extend the sprint" or "defer shipment until end of next + sprint.") From 49a5ac833bab9df1a9f9fc8549f22a33176e1a21 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 12 Nov 2015 09:57:06 -0800 Subject: [PATCH 06/10] [Documentation] Use consistent row headers --- docs/src/process/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/process/index.md b/docs/src/process/index.md index 12b2ea229d..39ebc4082a 100644 --- a/docs/src/process/index.md +++ b/docs/src/process/index.md @@ -86,11 +86,11 @@ The software must be stable at the end of the fourth sprint; because of this, the fourth sprint is scheduled differently, with a heightened emphasis on testing. -| | Mon | Tue | Wed | Thu | Fri | +| Week | Mon | Tue | Wed | Thu | Fri | |-------:|:-------------------------:|:------:|:---:|:----------------------------:|:-----------:| -| Week 1 | Sprint plan | Tag-up | | | Code freeze | -| Week 2 | Acceptance testing | Triage | | | | -| Week 3 | _Acceptance testing*_ | Triage | | _Acceptance testing*_ | Ship | +| __1__ | Sprint plan | Tag-up | | | Code freeze | +| __2__ | Acceptance testing | Triage | | | | +| __3__ | _Acceptance testing*_ | Triage | | _Acceptance testing*_ | Ship | * If necessary. From 99512f41b923063a1b7b4e5f2823931814fed6dc Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 12 Nov 2015 12:23:38 -0800 Subject: [PATCH 07/10] [Documentation] Handle review feedback Fix spelling error, add link, per code review nasa/openmctweb#294 --- docs/src/process/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/process/index.md b/docs/src/process/index.md index 39ebc4082a..4a39513a91 100644 --- a/docs/src/process/index.md +++ b/docs/src/process/index.md @@ -39,14 +39,15 @@ Responsibilities of the project manager including: assigned. * Pre-planning subsequent sprints to ensure that all members of the team always have a clear direction. -* Scheduling and/or ensuring adherance to +* Scheduling and/or ensuring adherence to [process points](#process-points). * Responding to changes within the sprint (shifting priorities, new issues) and re-allocating work for the sprint as needed. ## Sprint Calendar -Certain process points are regularly scheduled in the sprint cycle. +Certain [process points](#process-points) are regularly scheduled in +the sprint cycle. ### Sprints by Release From 9f2303face15822aae00c95993e76dad0c1d3bff Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 12 Nov 2015 14:49:19 -0800 Subject: [PATCH 08/10] [Time Conductor] Fix date picker toggle nasa/openmctweb#297; avoid flag toggled to display date-time picker becoming lost in a child scope. --- .../general/res/templates/controls/datetime-field.html | 6 +++--- .../general/src/controllers/DateTimeFieldController.js | 3 +++ .../general/test/controllers/DateTimeFieldControllerSpec.js | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/platform/commonUI/general/res/templates/controls/datetime-field.html b/platform/commonUI/general/res/templates/controls/datetime-field.html index 6ba8cbf901..2c0423c32b 100644 --- a/platform/commonUI/general/res/templates/controls/datetime-field.html +++ b/platform/commonUI/general/res/templates/controls/datetime-field.html @@ -6,10 +6,10 @@ + ng-click="picker.active = !picker.active"> - -
    + +
    Date: Thu, 12 Nov 2015 14:52:09 -0800 Subject: [PATCH 09/10] [Common UI] Add z-index to popups Temporary workaround for nasa/openmctweb#298 --- platform/commonUI/general/src/directives/MCTPopup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/commonUI/general/src/directives/MCTPopup.js b/platform/commonUI/general/src/directives/MCTPopup.js index d5ced4129e..2d20317f7a 100644 --- a/platform/commonUI/general/src/directives/MCTPopup.js +++ b/platform/commonUI/general/src/directives/MCTPopup.js @@ -51,6 +51,8 @@ define( position = [ rect.left, rect.top ], popup = popupService.display(div, position); + div.css('z-index', 75); + transclude(function (clone) { div.append(clone); }); From 46b110e12f4eb53516689ef1cace513583fd5002 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 12 Nov 2015 16:38:01 -0800 Subject: [PATCH 10/10] [Common UI] Add note about TODO item Add note about temporary work around, per code review from nasa/openmctweb#299 --- platform/commonUI/general/src/directives/MCTPopup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/commonUI/general/src/directives/MCTPopup.js b/platform/commonUI/general/src/directives/MCTPopup.js index 2d20317f7a..254a41d1eb 100644 --- a/platform/commonUI/general/src/directives/MCTPopup.js +++ b/platform/commonUI/general/src/directives/MCTPopup.js @@ -51,6 +51,8 @@ define( position = [ rect.left, rect.top ], popup = popupService.display(div, position); + // TODO: Handle in CSS; + // https://github.com/nasa/openmctweb/issues/298 div.css('z-index', 75); transclude(function (clone) {