Compare commits

...

342 Commits

Author SHA1 Message Date
d475d767d5 add grootprovider 2016-06-17 17:05:05 -07:00
a63e053399 [ObjectAPI] Draft new Object API
Rought prototype of new object API.
2016-06-17 16:59:35 -07:00
5de7a96ccc Merge pull request #1010 from nasa/api-type-proto
[API Prototype] Type registration
2016-06-17 10:18:42 -07:00
09a833f524 Merge branch 'api-tutorials' into api-type-proto 2016-06-10 13:28:09 -07:00
9c4e17bfab [Tutorials] Add telemetry tutorial 2016-06-07 13:14:36 -07:00
d3e5d95d6b [Tutorials] Add example server 2016-06-07 13:00:38 -07:00
c70793ac2d [Tutorials] Add remainder of bargraph 2016-06-07 12:55:29 -07:00
a6ef1d3423 [Tutorials] Add Bar Graph tutorial 2016-06-07 12:49:38 -07:00
c4fec1af6a [API] Move type toward a newer API 2016-05-27 13:31:30 -07:00
a6996df3df [API] Begin moving out type 2016-05-27 13:17:16 -07:00
0c660238f2 [API] Add MCT class 2016-05-27 11:49:43 -07:00
b73b824e55 [API] Add EventEmitter dep 2016-05-27 11:45:59 -07:00
1954d98628 [Tutorials] Remove diff markings in TodoController 2016-05-27 11:30:53 -07:00
7aa034ce23 Add todo tutorial 2016-05-26 16:05:38 -07:00
385dc5d298 Begin adding tutorials 2016-05-26 15:36:09 -07:00
a88b4b31a1 Merge pull request #966 from nasa/open747
R&I open747: refined "unsaved changes" dialog message
2016-05-26 12:02:12 -07:00
04112956cf Merge pull request #964 from nasa/open913
R&I open913: various Timeline fixes
2016-05-26 11:47:06 -07:00
f1113fda24 [Frontend] New message for unsaved changes warning
open #747
2016-05-26 09:04:40 -07:00
33c208d8fe [Frontend] Timeline Gantt bar mods to allow small min-width
open #965
- CSS adjusted to handle min-width of 2px and better
approach to ellipsizing text;
- Angular ng-class added to hide icon and title if
width less than a value;
- Rounded corners on bars removed;
2016-05-25 20:52:36 -07:00
c557fb6cd5 [Frontend] Cursor properties modified
open #768
2016-05-25 19:39:56 -07:00
bde2bc7709 [Frontend] Bottom of holder divs adjusted
open #913
2016-05-25 19:28:28 -07:00
5fe759aa91 Merge pull request #955 from nasa/timeline-zoom-936
[Timeline] Improve zoom behaviors
2016-05-25 16:58:20 -07:00
a5b7badb95 [Timeline] Remove obsolete arguments
https://github.com/nasa/openmct/pull/955/files#r64668507
2016-05-25 16:08:28 -07:00
eefd4c8669 Merge pull request #949 from nasa/info-error-948
[Mobile] Remove usage of element.scope()
2016-05-25 15:15:53 -07:00
7c11f2db4f Merge pull request #961 from nasa/open959
[Style] Fixed style issues introduced by #954
2016-05-25 12:16:44 -07:00
7501f679f7 [Style] Fixed style issues introduced by #954 2016-05-25 12:10:39 -07:00
52e087d8f8 Merge pull request #954 from nasa/open628
[Edit Mode] #628 Remove edit related concerns from Create Action
2016-05-25 11:55:17 -07:00
c5cd495fce Merge pull request #952 from nasa/fix-build-142
[Code Style] Run code style checks on CircleCI
2016-05-25 11:49:54 -07:00
37a417051d Merge remote-tracking branch 'origin/missing-time-conductor-957' 2016-05-25 11:43:57 -07:00
97d819739c Merge pull request #956 from nasa/fix-build-mct-popup
Resolve build conflict from #922
2016-05-25 11:41:14 -07:00
3935378b0c Revert "[Timeline] Test mct-representation ordering"
This reverts commit 2a4004fd5b.
2016-05-25 11:34:29 -07:00
952f95aa4c [Timeline] Update failing specs 2016-05-25 11:33:51 -07:00
0a75a5be1f [Timeline] Add minimal test case 2016-05-25 11:28:00 -07:00
70b593e28a [Timeline] Watch for configuration object
...to address #908 in a manner which does not cause #957
2016-05-25 11:22:22 -07:00
ed69a65f9b [Representation] Restore ordering in mct-representation
Revert "[Timeline] Change ordering in mct-representation"

This reverts commit 20ecf168f2.
These changes introduced a regression due to ordering
expected by time conductor, #957
2016-05-25 11:03:32 -07:00
05b4f5401e Merge remote-tracking branch 'origin/open890' 2016-05-25 10:19:11 -07:00
2ff0c7b06a [Test] Add spy method for addClass
Add spy method, fix a merge conflict that was improperly resolved
in https://github.com/nasa/openmct/pull/922
2016-05-25 10:11:34 -07:00
2330f1d135 Merge remote-tracking branch 'origin/open907' 2016-05-25 10:06:55 -07:00
ff92d3acab Merge remote-tracking branch 'origin/open889' into open922 2016-05-25 09:55:09 -07:00
32d7187db6 Relocated creation package to edit bundle 2016-05-24 17:08:12 -07:00
00534f8af7 [Timeline] Account for tick size
Account for tick size in duration reported by TimelineZoomController,
to avoid tick marks being cut off prematurely due to changes for
#936
2016-05-24 13:02:30 -07:00
3795570938 [Timeline] Rename shadowing variable 2016-05-24 12:45:25 -07:00
362248a02e [Timeline] Run gulp fixstyle 2016-05-24 12:37:10 -07:00
16d20eabd2 [Timeline] Simplify method 2016-05-24 12:33:47 -07:00
eb5566f041 [Timeline] Add tests for timeline zoom changes 2016-05-24 12:33:19 -07:00
757da1dff4 [Timeline] Remove obsolete test cases 2016-05-24 11:54:49 -07:00
85432af187 [Timeline] Don't store zoom configuration
https://github.com/nasa/openmct/issues/936#issuecomment-221343620
2016-05-24 11:53:27 -07:00
f0ab817e87 Added tests, and fixed failing ones 2016-05-24 10:53:04 -07:00
96af931c0b Modified EditActionPolicy to prevent editing of table views unless object is a table type 2016-05-23 16:48:31 -07:00
9a5209f7c2 [Timeline] Add zoom-to-fit button 2016-05-23 16:06:10 -07:00
0818a7cda0 [Timeline] Increase maximum zoom level
#936
2016-05-23 15:36:26 -07:00
f35947361c [Timeline] Remain centered during zoom
#936
2016-05-23 15:32:48 -07:00
9a8bcc0550 [Code Style] Specify lint, codestyle in CircleCI config
...to work around unexpected failure running test suite via gulp verify,
https://circleci.com/gh/nasa/openmct/1981
2016-05-23 15:10:05 -07:00
eff46b076c [New Edit Mode] #628 Removed duplicate logic from Create Action 2016-05-23 15:03:20 -07:00
ab64b682c3 [Code Style] Run checkstyle on CircleCI
Run the full gulp verify task for testing on CircleCI, to handle
unit tests as well as code style checks and linting (and other
verification steps that may be added in the future.)
2016-05-23 14:58:23 -07:00
1c007ea256 [Code Style] Remove trailing whitespace
...to fix build after changes for #142.
2016-05-23 14:55:04 -07:00
6c1412784b [Example] REMS heirarchy appear as links 2016-05-20 17:11:07 -07:00
6e7f4df5e3 [Mobile] Remove usage of element.scope()
Usage is unnecessary and is sensitive to initialization ordering of
representations, resulting in #948.
2016-05-20 16:13:51 -07:00
5b6ea600ba Merge pull request #930 from nasa/open633
[New Edit Mode] #633 Remove Editing workflow concerns from FixedController, LayoutController
2016-05-20 16:10:46 -07:00
fd9d766913 Defer resolution of scope in DropGesture 2016-05-20 15:15:18 -07:00
b6502e9ea1 [New Edit Mode] #633 Removed Editing workflow concerns from FixedController, LayoutController 2016-05-20 14:12:24 -07:00
25a2321578 Merge pull request #927 from nasa/jscs-rebase-142
[Code Style] Enforce code style
2016-05-20 14:03:27 -07:00
6fb36374f6 Merge pull request #942 from nasa/persist-graph-toggles-908
[Timeline] Persist resource graph toggles
2016-05-20 13:27:41 -07:00
9861e63589 [Code Style] Run fixstyle on merged changes 2016-05-20 13:09:16 -07:00
bce5643994 Merge branch 'master' into jscs-rebase-142
Conflicts:
	platform/commonUI/edit/test/actions/EditAndComposeActionSpec.js
	platform/representation/src/MCTRepresentation.js
2016-05-20 13:07:58 -07:00
ad5691142e [Code Style] Rename shadowing variables 2016-05-20 13:05:32 -07:00
e468080373 [Code Style] Disallow outer shadowing
031a46aa8e (commitcomment-17561082)
2016-05-20 11:38:36 -07:00
c98c36753c Merge pull request #944 from nasa/open943
[Build] Ignore gh-pages from circle-ci
2016-05-20 10:54:01 -07:00
1419ff86e8 Merge pull request #946 from nasa/open636
[New Edit Mode] #636 Removed edit concerns from DropGesture
2016-05-20 10:52:11 -07:00
601bc03ba2 [New Edit Mode] #636 Modified EditAndCompose action to rely on a slightly refactored EditActionPolicy to remove folder specific logic 2016-05-20 10:42:17 -07:00
ea454d65bb Merge pull request #945 from nasa/open634
[New Edit Mode] #634 Removed edit concerns from MctRepresentation
2016-05-20 10:06:50 -07:00
776586ae25 [New Edit Mode] #634 Removed edit concerns from MctRepresentation 2016-05-19 17:09:56 -07:00
78bf804e02 [Build] Ignore gh-pages from circle-ci 2016-05-19 15:31:16 -07:00
2a4004fd5b [Timeline] Test mct-representation ordering
Verify that a configuration object has been added to scope before
changing templates. #908
2016-05-19 15:09:57 -07:00
b5229d7786 [Timeline] Commit changes on toggle
#908
2016-05-19 15:06:06 -07:00
20ecf168f2 [Timeline] Change ordering in mct-representation
...such that the configuration property is available in scope
when a view is first instantiated. #908
2016-05-19 15:00:12 -07:00
dc348f33c5 Merge pull request #940 from nasa/openmct-website
[Website] Fixed failed circle.yml command
2016-05-19 14:18:55 -07:00
b7cfaf6b63 Fixed failed circle.yml command 2016-05-19 13:52:58 -07:00
34d5bc4f28 Merge pull request #939 from nasa/openmct-website
[Website] #901 Automate build process
2016-05-19 13:24:22 -07:00
e4b192001f Changed circle.yml to go back to command-based deployment to heroku as cannot use 'heroku' deployment support and commands in the same deployment descriptor 2016-05-19 12:14:42 -07:00
516b8c9e38 [Website] #901 Automate build process - Updated build SHA 2016-05-19 11:39:08 -07:00
f9631ff4c5 [Code Style] Fix style missed by gulp fixstyle
...and remove an unnecessary comment, too.
2016-05-19 11:29:41 -07:00
fa77139077 [Code Style] Run gulp fixstyle
...to apply code style settings from #142.
2016-05-19 11:29:13 -07:00
f12b9704d9 Merge branch 'master' into jscs-rebase-142 2016-05-19 11:28:16 -07:00
edb158f2d3 [Website] Added push to website repo 2016-05-19 10:44:58 -07:00
b2c6db6207 Changed circleci.yml 2016-05-19 10:44:58 -07:00
bcdd835275 [Website] Automate site build process 2016-05-19 10:44:57 -07:00
5b4952d4c6 Merge pull request #923 from nasa/open921
[Examples] #921 changed text in event generator example
2016-05-18 17:12:06 -07:00
de43aa81be Merge pull request #838 from nasa/open824_rebase
[Edit] #824 - Remove EditableDomainObject
2016-05-18 17:01:24 -07:00
5eff4e45c9 [Tutorials] #907 Updated tutorials to use new bundle registration mechanism 2016-05-17 17:24:32 -07:00
70a13a75d5 Updating tutorials 2016-05-17 13:22:15 -07:00
dcf26d3863 Merge pull request #937 from nasa/open929
R&I open929: Label context arrow always visible; frame dragging in label area
2016-05-16 16:10:33 -07:00
a729edd399 [Frontend] Label context arrows now always visible
open #929
- Also enable frame dragging in title area when
editing in Layout;
- CSS and markup changes;
2016-05-16 12:00:29 -07:00
69cc1086df Merge pull request #924 from nasa/open889b
[Popup] Add method to jqlite mocks
2016-05-16 10:14:52 -07:00
18fa9aeaf6 [Build] Bump version number, add -SNAPSHOT
...to begin sprint Huxley,
https://github.com/nasa/openmct/milestones/Huxley
2016-05-16 09:36:59 -07:00
96892722a4 [Build] Remove SNAPSHOT status
...to close sprint https://github.com/nasa/openmct/milestones/Herbert
2016-05-16 09:27:24 -07:00
54a0de4a08 [New Edit Mode] #636 Removed edit concerns from DropGesture 2016-05-13 17:59:43 -07:00
a11dba88b2 [New Edit Mode] #634 Removed edit concerns from MctRepresentation 2016-05-12 20:23:33 -07:00
d08cdfba49 Fixed linting issues 2016-05-12 16:50:19 -07:00
031a46aa8e [Code Style] Add JSHint rules
Add JSHint rules to complement allowing multiple var statements,
https://github.com/nasa/openmct/issues/142#issuecomment-212187972

[Code Style] Require one decl per var

[Code Style] Don't require separate var decls

...but allow them (for compatibility with existing code style)

[Code Style] Allow var decl after start of scope

[Code Style] Enforce codestyle during verify task
2016-05-12 16:32:17 -07:00
ffacf6e1ae Resolved residual merge issue 2016-05-12 16:18:48 -07:00
69c4c3a2c8 Added tests 2016-05-12 16:14:42 -07:00
c305fba0a7 Modified dirty function 2016-05-12 16:14:42 -07:00
44f4a82fa1 Resolved merge conflicts 2016-05-12 16:14:31 -07:00
5bf750c90c Fixed creation 2016-05-12 16:11:57 -07:00
836b5db8cf Reviewed edit mode checking 2016-05-12 16:11:57 -07:00
1753a5473c Resolved merge conflicts 2016-05-12 16:11:52 -07:00
d00e13e4ee Resolved merge conflicts 2016-05-12 16:09:53 -07:00
4b786d3536 Removed sysouts 2016-05-12 16:09:08 -07:00
e6bbc3442b Resolved merge conflicts 2016-05-12 16:09:02 -07:00
433dd87e51 Resolved merge conflicts 2016-05-12 16:07:39 -07:00
cf9eb3f602 Resolved Merge conflicts, removed previously deleted files 2016-05-12 16:05:27 -07:00
bd686790dc Resolved merge conflicts 2016-05-12 16:03:19 -07:00
e5ef7c0c22 Resovled merge conflicts 2016-05-12 15:58:17 -07:00
3d891073da [Popup] Add method to jqlite mocks
...to resolve build failure preventing merge,
https://github.com/nasa/openmct/pull/922#issuecomment-218588876
2016-05-11 14:25:23 -07:00
116c6e57ed Merge pull request #918 from nasa/rt-updates-910
[Table] Remove length check when updating visible rows
2016-05-11 14:07:27 -07:00
a39ce566d1 Merge pull request #920 from nasa/open909
Review and integrate open909: fix for Timeline Resource Graph labels
2016-05-11 13:38:45 -07:00
671ba66354 [Examples] #921 changed text in event generator example 2016-05-11 12:35:44 -07:00
a5ba72582c [Examples] #921 changed text in event generator example 2016-05-11 12:24:24 -07:00
73c2c01def [Frontend] Layout and styling of Time Conductor
open #889
open #298
Fixes for mobile;
Moved popup z-index def into sass;
Datetime picker compressed for
better fit in mobile phone;
Removed hours selector from datetime
picker to enable better fit in mobile;
2016-05-11 11:32:39 -07:00
7c82e31b66 Merge branch 'master' into open889 2016-05-10 23:09:59 -07:00
a58fe1f81c [Frontend] Modified .tick-labels in Timelines
open #909
- Changed markup to not use plot .tick-label class;
- Changed CSS accordingly;
- Fixed alignment (clipped bottom value) by
refactoring to use flex-box layout for tick labels;
2016-05-10 20:41:52 -07:00
2829b8d495 [Frontend] Time Conductor mobile
open #889
- Major refactoring of mobile approach,
leveraging flex-box layout change;
2016-05-10 19:52:11 -07:00
3727b287a1 Merge pull request #902 from nasa/open898
[documentation] #898 updated stylesheet reference
2016-05-10 18:27:09 -07:00
c448753bab [Table] Remove length check when updating visible rows
While the number of visible rows may not have changed, their
contents may have; returning early here results in #910.
2016-05-10 15:20:22 -07:00
7ade873365 [Frontend] Flex; Tweaks to slider knobs
open #889
- Converted TC elements to use flex
layout instead of abs pos;
- Knob size increased;
- Knob grippies added;
2016-05-10 15:12:50 -07:00
8788523c25 [Frontend] Tweaks to slider knobs
open #889
- Knob size increased;
- Knob grippies added;
2016-05-10 14:28:23 -07:00
c301523156 [Frontend] Layout and positioning fixes for TC controls
open #889
IN PROGRESS
- Smaller font used on range value;
- More space allocated to left and right
for slider range values;
- Style tweaks to slider look;
- Layout and style of datetime inputs
fixed;
- Input error colors fixed, moved to
theme constants;
2016-05-09 17:56:50 -07:00
46e1347dc8 Merge pull request #906 from nasa/use-heroku-integration
[Build] Use Circle's heroku integration for deploy
2016-05-09 10:53:28 -07:00
f5539ec678 [Build] Use Circle's heroku integration for deploy
Use circle's heroku integration to deploy to ensure that we deploy
a full clone of the repo and not a shallow clone, prevents build
failure in master branch.
2016-05-09 10:46:17 -07:00
2e8604e18d [Frontend] Layout and positioning fixes for TC controls
open #889
2016-05-09 10:38:18 -07:00
9ed28a4a37 Merge pull request #900 from nasa/open899
#899 updated circle.yml to deploy to live_demo and remove doc generation
2016-05-09 10:37:47 -07:00
3ca9d21bbd Merge remote-tracking branch 'origin/open663' 2016-05-09 10:33:39 -07:00
61683800cc [Style] Update style to reflect new jshint config
Update style to match new jshint config

https://github.com/nasa/openmct/issues/671
2016-05-09 10:33:26 -07:00
4c74391137 Merge remote-tracking branch 'origin/open836' 2016-05-09 10:25:25 -07:00
f3b265bdd5 Merge branch 'master' into open671 2016-05-09 10:19:24 -07:00
cae85f3e30 [Frontend] Mods to slider .range-value elems
open #889
- Text smaller, line breaks;
- Height adjustments
- Increased with of slider area;
2016-05-09 10:16:54 -07:00
ab6ef22363 #898 updated stylesheet reference 2016-05-08 10:46:59 -07:00
09d1c2cd4b #899 updated circle.yml to deploy to live_demo and remove doc generation 2016-05-06 19:44:26 -07:00
d6aa31e4aa Merge pull request #893 from nasa/open885
#885 added command line option --directory -D to specify base directory
2016-05-06 10:19:44 -07:00
3efaa3b1cb Merge pull request #894 from nasa/open892
#892 Removed browser warning
2016-05-06 09:51:36 -07:00
2fe9698ea8 Merge pull request #891 from nasa/fix-clickaway-888
[General] remove dupe, debounce inputs
2016-05-06 09:49:13 -07:00
1cdeccc7a7 #885 added command line option --directory -D to specify base directory 2016-05-05 21:58:31 -07:00
00433f02bc #892 Removed browser warning 2016-05-05 21:45:18 -07:00
7fad4e9ea1 [General] remove dupe, debounce inputs
Remove duplicate ClickAwayController implementation that was obscuring actual
implementation.  Debounce clickaway action in case toggle is invoked in a
click handler.

Resolves https://github.com/nasa/openmct/issues/888
2016-05-05 18:25:37 -07:00
c6d326bbbc Merge pull request #879 from nasa/table-headers-809
[Table] Fix headers in firefox
2016-05-05 13:29:03 -07:00
d60bc08843 Merge pull request #878 from nasa/open-mct-not-web-816
[Branding] Change name to Open MCT in docs
2016-05-05 13:21:13 -07:00
3d62cba1b3 Merge pull request #859 from nasa/remove-examples-825
[Examples] Move examples out of main.js
2016-05-05 13:05:41 -07:00
1c6ef28b80 [Table] Fix headers in firefox
Don't use table-cell displays for cells, resolves issues with zero-sized
tbody causing thead to be 100% of table size.

Fixes https://github.com/nasa/openmct/issues/809
2016-05-04 11:13:12 -07:00
00706558f5 [Branding] Restore missing space 2016-05-04 10:42:46 -07:00
5279c842f5 [Branding] Change title of about dialog 2016-05-04 10:17:23 -07:00
431b836568 [Branding] Change name in docs hierarchy
...from Open MCT Web to plain-old Open MCT.
2016-05-04 10:13:09 -07:00
de2703ee48 [Branding] Remove Web from name at top-level
Per #816, change Open MCT Web to Open MCT in all top-level files.
2016-05-04 10:08:55 -07:00
01f290dc45 Merge pull request #873 from nasa/open871
Review and integrate open871
2016-05-03 14:20:56 -07:00
ff36d9ee80 [Frontend] Removed bullets from ol, ul
open #869
- This should be cherry-picked into main
branches as well.
(cherry picked from commit 4c97413)
2016-04-29 10:54:28 -07:00
a13d0b7fab [Examples] Move examples out of main.js
...such that they are not compiled into the Open MCT that
is used as the basis for non-example applications.

Addresses #835
2016-04-26 15:52:09 -07:00
0390f46460 [Frontend] z-index added to .object-top-bar .left element
#836
2016-04-25 09:55:21 -07:00
9e5689f7dd Merge remote-tracking branch 'origin/revert-839-revert-822-open769' 2016-04-22 13:02:39 -07:00
0ccb696ee2 [Build] Bump version number, add -SNAPSHOT
...to begin sprint Herbert,
https://github.com/nasa/openmct/milestones/Herbert
2016-04-22 10:51:12 -07:00
d385e55e76 [Build] Remove snapshot suffix
Closes sprint Heinlein,
https://github.com/nasa/openmct/milestones/Heinlein
2016-04-22 10:46:07 -07:00
6bf1ef5bcc Revert "Revert "[Tables] Fix to correct sorting in realtime tables"" 2016-04-22 09:44:34 -07:00
abb511521b Merge pull request #837 from nasa/open794_fix
[Edit Mode] #794 Modified policy to show remove action in context for non-editable domain object types
2016-04-21 12:23:45 -07:00
11cfb6e1b8 [Edit] Elements pool filtering displays more consistent results 2016-04-21 10:42:50 -07:00
3a9b1ee901 Merge pull request #839 from nasa/revert-822-open769
Revert "[Tables] Fix to correct sorting in realtime tables"
2016-04-21 09:21:12 -07:00
8b390e7fb9 Revert "[Tables] Fix to correct sorting in realtime tables" 2016-04-20 19:31:54 -07:00
29bce69eea Merge pull request #822 from nasa/open769
[Tables] Fix to correct sorting in realtime tables
2016-04-20 19:30:04 -07:00
aac5a6d250 #769 - Removed empty code block and addressed some excessive guard code 2016-04-20 19:18:27 -07:00
06436c488a [Edit Mode] #794 Modified policy to show remove action in context for non-editable domain object types 2016-04-18 19:05:46 -07:00
8b7af43d6c Merge pull request #823 from nasa/version-process-725
[Documentation] Add Version Guide
2016-04-14 17:30:55 -07:00
abb47eed36 [Documentation] Remove superfluous space
ddc241c0d0 (r59808305)
2016-04-14 16:30:17 -07:00
027d86ef4b Merge pull request #828 from nasa/build-win-827
[Build] Fix build on Windows
2016-04-14 16:23:42 -07:00
6cb9619fbe Merge pull request #829 from nasa/open630
[Edit mode] Simplify SaveAction
2016-04-14 16:11:49 -07:00
8c3616da32 Addressed code review points 2016-04-14 16:04:15 -07:00
ffd5faf9a2 [Persistence] Remove obsolete caching decorator
#831
2016-04-14 10:15:40 -07:00
00bf05c929 Merge pull request #830 from nasa/time-conductor-ux
Time Conductor updates query on blur, mobile support
2016-04-14 10:04:17 -07:00
b682cf8340 [Style] Remove outdated comments 2016-04-13 17:41:24 -07:00
22a5122ab7 [Conductor] Style for Phone and Tablet
Specify styles for time conductor on phone an tablet to hide the slider and
utilize space better.

https://github.com/nasa/openmct/issues/318
2016-04-13 17:17:52 -07:00
7a7877d7c4 [Conductor] Add basic style for phone
Add styling for time conductor on mobile that removes slider and rearranges
inputs to utilize space more effectively.

https://github.com/nasa/openmct/issues/318
2016-04-13 16:17:17 -07:00
69c059c943 [Conductor] Update inner bound on blur
The time conductor updates the inner and outer bounds when the input is
blurred, which results in the query updating without dragging.

Also allows time conductor to be utilized on mobile devices by entering
dates directly.

https://github.com/nasa/openmct/issues/318

User request:
https://github.jpl.nasa.gov/MissionControl/vista/issues/175
2016-04-13 13:49:23 -07:00
6d58f23c0c [Style] Switch to prototype
Switch TimeRangeController to prototype style, and update tests
and template to utilize new style.
2016-04-13 13:23:33 -07:00
26e368f52d [Edit mode] Simplify SaveAction 2016-04-12 14:40:19 -07:00
1d78af8f1d [Build] Fix build on Windows
* In the prepublish step, run bower and gulp via node, instead of
  relying on shebang interpretation. (Forward-slash path separators
  appear to get normalized by node itself before executing the scripts.)
* In the gulp build, replace hard-coded *nix-style separators with
  path.sep; this allows stylesheets to be output to expected locations
  when building on Windows.

Addresses #827.
2016-04-12 13:02:48 -07:00
d48871f204 Merge pull request #783 from nasa/open635
[Edit Mode] #635 Removed Edit-related concerns from ContextMenuGesture
2016-04-12 09:40:14 -07:00
519a9333ab Updated tests 2016-04-11 17:10:35 -07:00
2fe7ba982f Added 'Open in New Tab' to context menu in edit mode 2016-04-11 17:06:37 -07:00
7f108c3b24 [Edit Mode] #635 Removed Edit-related concerns from ContextMenuGesture 2016-04-11 15:39:35 -07:00
6322964dec Addressed comments from code review of #822 2016-04-11 14:30:21 -07:00
1bb6e17829 Minor code change to improve clarity 2016-04-11 13:37:31 -07:00
f34e8ba61b Modified code to call resize on every row add. Removed optimization to only resize when needed, because in fact resuze is necessary on every update in order to set vertical scroll size 2016-04-11 13:09:02 -07:00
2fb9b65652 Made comment a little more accurate 2016-04-11 12:57:27 -07:00
0c6b4a5a23 [Tables] Fix to correct sorting in realtime tables 2016-04-11 12:57:27 -07:00
20672ad028 [Tables] #801 Documented MctTable directive 2016-04-11 12:55:56 -07:00
99ba9edb95 Merged
Resolved merge conflicts

Resolved merge conflicts
2016-04-11 12:55:53 -07:00
23a8c305c1 [Table] #798 Simplified markup, moved styles to external stylesheet 2016-04-11 12:23:36 -07:00
934eb13813 [Build] Remove obsolete jslint tags
ES5 mode is enabled by default in JSHint, tags no longer necessary per
https://github.com/nasa/openmct/pull/724#discussion_r55095722
2016-04-08 16:54:01 -07:00
a224711dce [Build] Move JSHint config to .jshintrc
...to allow code editors etc to pick up on rules, per
https://github.com/nasa/openmct/pull/724#issuecomment-193542314
2016-04-08 16:37:37 -07:00
c1ae68b565 [Build] Change unused to vars
To allow placeholder arguments in method signatures, per
https://github.com/nasa/openmct/pull/724#issuecomment-193542314
2016-04-08 16:32:17 -07:00
9351285182 [Build] Remove obsolete argument from spec
...to reflect changes associated with JSHint configuration,
https://github.com/nasa/openmct/pull/724#issuecomment-193542314
2016-04-08 16:31:01 -07:00
aa45e53440 [Build] Revert setTimeout changes
Restore usage of setTimeout (instead of the Angular-wrapped version) per
https://github.com/nasa/openmct/pull/724#issuecomment-193542314
2016-04-08 16:29:49 -07:00
f6a9c90cef [Build] Use native bind
...in CouchPersistenceProvider and ElasticPersistenceProvider, per
https://github.com/nasa/openmct/pull/724#issuecomment-193542314
2016-04-08 16:25:32 -07:00
0b11ddbcfd [Build] Satisfy JSHint
Restore globals lost during removal due to merge, remove unused
variables and use threequals in new scripts.
2016-04-08 16:22:40 -07:00
5088453712 [Build] Remove use strict, global
Remove usages of use strict and global declarations that are
no longer necessary with JSHint configuration, from files
added/changed since #724
2016-04-08 16:11:12 -07:00
5e44bfc6c7 Merge branch 'master' into open671
Conflicts:
	main.js
	platform/commonUI/edit/src/policies/EditableMovePolicy.js
	platform/commonUI/general/src/directives/MCTTree.js
	platform/commonUI/general/src/ui/ToggleView.js
	platform/core/src/actions/ActionCapability.js
	platform/core/test/models/CachingModelDecoratorSpec.js
	platform/core/test/services/InstantiateSpec.js
	platform/features/events/bundle.js
	platform/features/events/src/DomainColumn.js
	platform/features/events/src/EventListController.js
	platform/features/events/src/EventListPopulator.js
	platform/features/events/src/RangeColumn.js
	platform/features/events/src/directives/MCTDataTable.js
	platform/features/events/src/policies/MessagesViewPolicy.js
	platform/features/events/test/DomainColumnSpec.js
	platform/features/events/test/EventListControllerSpec.js
	platform/features/events/test/EventListPopulatorSpec.js
	platform/features/events/test/RangeColumnSpec.js
	platform/features/events/test/policies/MessagesViewPolicySpec.js
	platform/features/rtevents/bundle.js
	platform/features/rtevents/src/DomainColumn.js
	platform/features/rtevents/src/RTEventListController.js
	platform/features/rtevents/src/RangeColumn.js
	platform/features/rtevents/src/directives/MCTRTDataTable.js
	platform/features/rtevents/src/policies/RTMessagesViewPolicy.js
	platform/features/rtevents/test/DomainColumnSpec.js
	platform/features/rtevents/test/RTEventListControllerSpec.js
	platform/features/rtevents/test/RangeColumnSpec.js
	platform/features/rtevents/test/policies/RTMessagesViewPolicySpec.js
	platform/features/rtscrolling/bundle.js
	platform/features/rtscrolling/src/DomainColumn.js
	platform/features/rtscrolling/src/NameColumn.js
	platform/features/rtscrolling/src/RTScrollingListController.js
	platform/features/rtscrolling/src/RangeColumn.js
	platform/features/scrolling/src/DomainColumn.js
	platform/features/scrolling/src/RangeColumn.js
	platform/features/scrolling/src/ScrollingListController.js
	platform/features/scrolling/src/ScrollingListPopulator.js
	platform/features/scrolling/test/DomainColumnSpec.js
	platform/features/scrolling/test/RangeColumnSpec.js
	platform/features/scrolling/test/ScrollingListControllerSpec.js
	platform/features/scrolling/test/ScrollingListPopulatorSpec.js
	platform/features/table/src/directives/MCTTable.js
	platform/features/table/test/controllers/TelemetryTableControllerSpec.js
	platform/representation/src/gestures/DropGesture.js
	platform/telemetry/src/TelemetryFormatter.js
	test-main.js
2016-04-08 16:08:19 -07:00
c591ade479 Merge remote-tracking branch 'origin/781' 2016-04-06 10:35:40 -07:00
8f4f0cb78e Merge pull request #785 from nasa/open677_cleanup
[Timelines] #677 Removed temporary markup
2016-04-05 12:24:58 -07:00
e87280aa15 Merge pull request #821 from nasa/show-selected-color
[Control] Color input shows selected color
2016-04-05 12:20:14 -07:00
e0a2d02d23 [Control] Color input shows selected color
Update color input to show selected color when expanded.
2016-04-05 11:57:45 -07:00
ddc241c0d0 [Documentation] Add Version Guide
Migrate relevant information from existing version guide;
add instructions for incrementing versions per #725
2016-04-05 11:55:15 -07:00
73012233b8 [Build] Bump version number
...to begin sprint Heinlein,
https://github.com/nasa/openmct/milestones/Heinlein
2016-04-04 09:33:58 -07:00
339916ccd4 [Build] Remove SNAPSHOT status
...to tag end of release Gibson,
https://github.com/nasa/openmct/milestones/Gibson
2016-04-04 09:32:21 -07:00
70acef6905 [Instantiation] Ensure new models have modified timestamp
...to avoid https://github.com/nasa/openmct/issues/745#issuecomment-204561163
2016-04-01 14:27:26 -07:00
da09ffd3fa [Persistence] Don't evict models on persist
https://github.com/nasa/openmct/issues/745#issuecomment-204559209
2016-04-01 13:38:13 -07:00
5b98da6681 Merge pull request #807 from nasa/timeline-model-717
[Timeline] Add default values to model
2016-04-01 10:10:15 -07:00
2040abb768 Merge pull request #808 from nasa/revert-open-793
Revert "Merge remote-tracking branch 'origin/open793'"
2016-03-31 16:37:18 -07:00
d35fccbbe8 Revert "Merge remote-tracking branch 'origin/open793'"
This reverts commit f49552779a, reversing
changes made to e068173f3e.
2016-03-31 16:30:35 -07:00
06c6832676 [Timeline] Add default values to model
Add default values to model, such that editing which occurs
before user supplies these properties does not cause errors
to occur. Directly addresses #717, indirectly addresses
remaining errant behavior associated with #790.
2016-03-31 15:46:56 -07:00
f49552779a Merge remote-tracking branch 'origin/open793' 2016-03-31 14:14:08 -07:00
200a426f17 [Tables] Addressed style concerns from code review 2016-03-31 12:56:29 -07:00
e068173f3e Merge remote-tracking branch 'origin/move-copy-policy-792' 2016-03-31 12:49:06 -07:00
4441e88769 Merge pull request #803 from nasa/drag-drop-688
[Firefox] Invoke preventDefault on drop
2016-03-31 11:02:26 -07:00
254a944d7a [Firefox] Invoke preventDefault on drop
...such that Firefox does not try to treat drop as a new URL
to navigate to. Addresses #688 and #527
2016-03-31 10:34:24 -07:00
0c00061cbc Added mutation listener 2016-03-31 10:26:34 -07:00
dee0613b81 Merge pull request #800 from nasa/timeline-reorder-789
[Timeline] Fix reordering behavior in timelines
2016-03-31 09:39:17 -07:00
6b6bada700 Merge pull request #788 from nasa/open445b
Review and integrate open445b
2016-03-31 09:36:03 -07:00
530b940a64 [Timeline] Fix reordering
Fix reordering behavior when dragging-and-dropping within timelines;
addresses #789.
2016-03-29 19:46:30 -07:00
e23bf5ed39 [Entanglement] Test CopyPolicy 2016-03-29 19:26:18 -07:00
6ecea9950d [Entanglement] Test MovePolicy 2016-03-29 19:22:22 -07:00
4816dddf41 [Entanglement] Wire in copy/move policies
#792
2016-03-29 13:14:08 -07:00
cae775f9bc [Entanglement] Add policies for Copy and Move
...to ensure that these are only performed on creatable and
mutable targets, respectively.
2016-03-29 13:10:35 -07:00
a4b79cdb5b [Tables] #793 Added fix for tables not appearing on refresh
Fixed failing tests
2016-03-28 17:48:01 -07:00
012a38cccd [Tables] Fix for table columns not being populated 2016-03-28 17:31:10 -07:00
a01f7ddd2d [Frontend] Refinements to .loading and related
#445
Markup enhanced in wait-node.html;
More wait-spinner constants added;
Normalized appearance between tree-based
.loading and .s-status-pending;
Fixed .s-status-pending to work now that
mct-representation is gone from tree;
2016-03-24 15:10:22 -07:00
e7e91e21fc [Frontend] Markup and CSS for loading tree items
#445
New wait-spinner constants;
Markup fixed in wait-node.html;
Styles for .loading when applied to
.tree-item.wait-node;
Changed from percent-of-parent-
width sizing of spinner to fixed size;
2016-03-24 15:10:02 -07:00
cbea842c8b Merge branch 'timeline-highlight-767' 2016-03-24 13:33:56 -07:00
cc5d14deec Merge branch '755a' 2016-03-24 13:21:59 -07:00
4c5217d646 [Style] Standardize indentation 2016-03-24 13:20:49 -07:00
5e54b193ca [Style] remove unnecessary parenthesis
See comment https://github.com/nasa/openmct/pull/782/files#r57380540
2016-03-24 13:14:53 -07:00
cd7ff8ad85 Merge remote-tracking branch 'origin/timestamps-776' 2016-03-24 13:09:32 -07:00
fa5d59bff8 Merge branch 'timeline-save-770b' 2016-03-24 13:06:53 -07:00
ddbb72b88a [CacheService] Don't track ids twice
Track whether an object is in the cache based on whether it is
in the cache instead of utilizing a separate object for tracking
contents of cache.

See comment on https://github.com/nasa/openmct/pull/773/files
2016-03-24 12:57:53 -07:00
88784d37fd [Frontend] Added priority
#787
2016-03-24 12:05:10 -07:00
700e605bbd Merge pull request #775 from nasa/timeline-drag-drop-679
[Timeline] Move (instead of link) when dragging and dropping within a timeline
2016-03-23 20:00:48 -07:00
594f3b8ec2 [Frontend] Corrected wrong unicode value
#781
2016-03-23 19:30:20 -07:00
b08d00ef3e [Frontend] Removed tab character
#781
2016-03-23 19:25:25 -07:00
0643fb1f3f [Frontend] Updated icomoon project file
#781
2016-03-23 19:17:39 -07:00
289debf19d [Frontend] Fixed hover problem with menu items
#781
#187
Noticed a problem with <a> tags in
Create menu items and fixed with display: block;
2016-03-23 19:10:59 -07:00
7da1a4b2a3 [Frontend] Updated glyph defs and descriptions
#781
#187
Converted many glyph char defs to
their JSON unicode equivalents;
Updated descriptions for many domain
objects;
2016-03-23 19:04:32 -07:00
528169de2c [Frontend] Updated glyphs
#781
Added multiple new and updated glyphs;
Updated glyph defs for Historic and
Real-Time Tables;
2016-03-23 17:42:58 -07:00
c13231b8e8 [Timeline] Remove NULL_ACTION, clarify logic
Per code review feedback,
https://github.com/nasa/openmct/pull/775/files#r57229759
2016-03-23 15:34:05 -07:00
3e4a3aeb9b Merge pull request #779 from nasa/precision-778b
[Data Formats] Format numeric values with full precision
2016-03-23 12:15:26 -07:00
650ef9bfa4 [Timelines] #677 Removed temporary markup 2016-03-23 11:27:40 -07:00
dd053f7e6e [Timeline] Invoke $apply from mct-swimlane-drop
...and add some checks to ensure this is necessary, to avoid
triggering a ton of digest cycles while dragging.
2016-03-22 17:16:41 -07:00
cb655d486b [Timeline] Test reordering within parent 2016-03-22 17:06:58 -07:00
3c52ceb71a [Timeline] Remove unused function
Removal of domain objects is handled by using the move action.
2016-03-22 17:01:45 -07:00
b2337dea97 [Timeline] Update failing specs
...and remove obsolete test case for handling drops in a timeline
2016-03-22 16:59:09 -07:00
dea6554e04 [Timeline] Allow drops from tree
Don't assume that all drops will be dropped swimlanes.
2016-03-22 12:26:01 -07:00
31d8c9a48f [Timeline] Allow linking during edit
...in cases where it is safe to do so (specifically, when the
linked-to object has already been persisted.)
2016-03-22 12:04:50 -07:00
f8682a7a29 Merge pull request #780 from nasa/open715
[Timelines] #715 Added a check to prevent mutation when modes are unchanged
2016-03-22 09:24:57 -07:00
e5544615cc [Timelines] #715 Added a check to prevent mutation when modes are unchanged 2016-03-21 17:01:38 -07:00
ec0cc572f6 [Add] Test model cache 2016-03-21 16:11:40 -07:00
6c2a28aba2 [Add] Add JSDoc to model cache 2016-03-21 16:05:05 -07:00
baccd005dc [Add] Update persistence capability spec
...to reflect removal of cached domain object models.
2016-03-21 15:08:27 -07:00
1e4ff5a73f [Add] Use cacheService from decorator spec 2016-03-21 15:05:28 -07:00
9f29382e18 [Add] Update spec for Instantiate
...to reflect usage of a model cache for #770
2016-03-21 15:04:07 -07:00
5f6b4adcda [Plot] Normalize number of digits
Use consistent number of digits for displayed plot values, to avoid
unreadable plot legends due to fix for #778
2016-03-21 14:45:00 -07:00
d6ab70447e [Data Format] Don't truncate data values 2016-03-21 14:35:58 -07:00
a411bac331 [Time Format] Append Z instead of zone offset
...for brevity (reduce visual noise)
2016-03-21 14:29:24 -07:00
5624c7d545 [Time Formats] Display UTC with milliseconds
#776
2016-03-21 13:04:59 -07:00
007741b4e7 [Timeline] Add move policy
...to restore suppression of Move for objects being edited
(relaxed for the specific case of moving one object being
edited into another object being edited, for use in Timelines.)
2016-03-21 12:07:19 -07:00
e0a69744e5 [Timeline] Deinline null action
...used for cases when no action is needed for timeline move
(and ids will just be reordered.)
2016-03-21 11:53:10 -07:00
e7a6c34bcc [Timeline] Handle drops for reordering
...as these would be disallowed by Move, normally.
2016-03-21 11:51:51 -07:00
7f3ac4077c [Timeline] Drop to correct targets 2016-03-21 11:43:02 -07:00
7eaffdc34a [Timeline] Don't suppress move during editing
...to allow this action to be used to support Timeline
drag-and-drop.
2016-03-21 11:42:33 -07:00
5034e88656 [Timeline] Use move action on drag-drop
...to avoid creating links when desired behavior is a move,
#679.
2016-03-21 11:18:18 -07:00
aa48044345 [Frontend] Form styling
#772
Added ".l-controls-under" styling to allow
channel-selector layout;
Added new hint color constants and refined
style defs;
2016-03-21 11:13:43 -07:00
d12111d9b8 [Add] Fix promise chaining in AddAction 2016-03-21 10:32:02 -07:00
9c9db3c24f [Add] Remove obsolete variable reference
The cache has been externalized to allow writing to it
upon domain object instantiation.
2016-03-21 10:31:38 -07:00
3fe41575bd [Add] Add missing dependency
...to support caching of domain objects created during edit mode.
2016-03-21 10:31:09 -07:00
8fa030437e [Add] Remove edit awareness
Remove step where Added objects are persisted via the editor
capability; instead, persist via the usual persistence capability,
such that Edit mode may intervene (or not) as necessary.
As instantiated models are cached at least until persisted,
this workaround to allow newly-created models to be available
during editing is no longer necessary (and undesired consequences
such as #770 no longer occur)
2016-03-21 10:22:25 -07:00
17faf000b0 [Add] Cache models on instantiation
...to remove need for Edit to persist these immediately, which in
turn causes #770 and #678
2016-03-21 10:20:14 -07:00
90c82f6ef2 [Frontend] Timeline tooltip and field input tweaks
#750
Refined tooltip for Resource Graphing;
Increased size of Activity Link input field;
2016-03-21 10:08:59 -07:00
5e6fe16b93 [Frontend] Adding tooltips
#750
2016-03-17 16:21:04 -07:00
f0ca6fdfdb [Frontend] Added tooltips
#750
Added tooltips to Timeline header elements;
2016-03-17 15:10:42 -07:00
ad4c456ca2 Merge pull request #763 from nasa/restrict-requirejs-version
[Package] Specify require minor version
2016-03-17 14:38:02 -07:00
b0476edb8c [Package] Specify require minor version
Specify requirejs minor version of 2.1, as 2.2 is not compatible
with karma-requirejs.

Fixes build problems that appeared after latest requirejs version bump.
2016-03-17 14:28:22 -07:00
8f6a287fb8 Merge remote-tracking branch 'origin/tree-refresh-745' 2016-03-17 11:40:53 -07:00
07d554d114 Merge pull request #759 from nasa/700a
Review and integrate 700a
2016-03-17 11:02:22 -07:00
24d2cecdcd Merge pull request #761 from nasa/open757
[Tables] #757 Added max row limit to streaming tables
2016-03-17 10:19:04 -07:00
8efa9c6aac [Tables] #757 Fixed code style issues 2016-03-17 10:09:59 -07:00
22e98274ca [Tables] #757 Added max row limit to streaming tables 2016-03-16 18:59:52 -07:00
471b57f47c [Frontend] CSS tweaks
#750
Moved l-plot-resource cursor: pointer
to a more specific selector;
Added user-select: none to l-header;
Fixed s-status-editing styling so
that tabular labels only appear draggable
while editing;
2016-03-16 18:19:44 -07:00
9c775c6715 [Frontend] Changed cursor property
#755
Changed s-timeline-gantt.mid to
use cursor: move instead of
ew-resize; Need to verify on Linux;
2016-03-16 17:36:07 -07:00
1f09b7b0ac [Frontend] Fix for scrollbar flicker
#748
Was able to observe problem in Mac
Chrome. Moved body, html overflow: hidden
into startup-base.scss and change seems
to have fixed the problem;
2016-03-16 17:34:28 -07:00
b0cf9bbd29 Merge pull request #758 from nasa/error-message-753
[Tree] Don't assume context capability is present
2016-03-16 15:33:59 -07:00
4a1ca25e17 Merge pull request #754 from nasa/tree-status-styling-749
[Tree] Add status classes during editing
2016-03-16 15:26:40 -07:00
cc97e567b6 [Frontend] Further style cleanups
#689
#740
Tweaked scrollbar thumb color;
Fixed color of icons in s-menu-btn
menus, particularly for Snow theme;
Removed commented code;
2016-03-16 15:17:08 -07:00
53f03cddb7 [Frontend] Further cleanups to form elements
#689
Removed commented code;
2016-03-16 14:49:37 -07:00
da1e6750a0 [Frontend] Removed reset.css and refs to modernizr
#700
Removed reset.css; Removed refs to
modernizr from licenses and readme.md;
2016-03-16 14:44:01 -07:00
3258342783 [Frontend] Further cleanups to form elements
#700
#689
#740
Removed _selects.scss and moved classes
into _controls.scss;
Reorg'd _controls;
Moved classes into _elems.scss;
Added and fixed cssclass defs in multiple
bundle.js files to allow better field widths
in overlay dialogs;
Fixed overlay custom scrollbar colors;
Fixed alignment of required glyphs in forms;
2016-03-16 14:40:06 -07:00
73b7365ae2 [Tree] Don't assume context capability is present
Addresses #753 (newly-created objects may not have context,
causing errors when these are encountered by TreeNodeView)
2016-03-16 14:10:58 -07:00
32a42bd679 [Frontend] CSS tweaks to fix required glyph positioning
#700
CSS modded to allow better cross-browser
positioning of 'required' form-row glyphs;
Other elem's CSS adjusted as a result;
2016-03-16 09:43:59 -07:00
324c2cac03 [Tree] Refresh properly on mutation
...by removing the incorrect expectation that a domain object
(and not just its model) will be passed in when mutation occurs.
Addresses #745.
2016-03-15 12:23:46 -07:00
42ac657105 [Tree] Add status classes during editing
Addresses #749
2016-03-15 12:16:58 -07:00
22be6bc860 [Build] Run lint task from CircleCI
https://github.com/nasa/openmctweb/pull/724#issuecomment-192487995
2016-03-04 16:16:35 -08:00
134452582c [Build] Remove/qualify for-in usages 2016-03-04 13:10:23 -08:00
fb56b3ad56 [Build] Enable forin check for JSHint 2016-03-04 13:04:06 -08:00
8b5a425da6 [Build] Restore erroneously-removed variable 2016-03-04 13:03:41 -08:00
d6ec7e9ab8 [Build] Remove unused variables from specs
...to satisfy JSHint.
2016-03-04 12:56:14 -08:00
e470451718 [Build] Declare undefined variables
...to satisfy JSLint for specs.
2016-03-04 12:30:23 -08:00
5920533637 [Build] Don't appear to use new for side effects 2016-03-04 12:23:53 -08:00
7eb7027b67 [Build] Specify browser environment
...such that various browser globals do not need to be individually
declared.
2016-03-04 12:05:00 -08:00
c7f199a59e [Build] Also lint specs
...with additional tolerance declared for Jasmine variables.
2016-03-04 12:01:11 -08:00
43176cfbb8 [Build] Move lint config to gulpfile 2016-03-04 11:56:31 -08:00
f34ef8c4c8 [Build] Add global declarations to mocks 2016-03-04 11:53:08 -08:00
1cdbc11894 [Build] Clarify spec paths 2016-03-04 11:52:46 -08:00
2be6b3f051 [Build] Fix GenericSearchProvider spec
...by delegating  to window.setTimeout, such
that spec as-written behaves correctly.
2016-03-04 11:48:20 -08:00
4f85616632 [Build] Fix FullscreenAction spec
...to reflect acquisition of screenfull dependency via
AMD
2016-03-04 11:46:15 -08:00
65095d18f2 [Build] Remove partial global declarations 2016-03-04 11:43:55 -08:00
a1a7b2b8ce [Build] Remove unused variables
...to satisfy JSHint
2016-03-04 11:41:48 -08:00
bf232d0593 [Build] Ignore apparent strict violation
...in CustomRegistrars.
2016-03-04 11:24:14 -08:00
19c9fcd369 [Build] Remove apparent strict violations
...from persistence providers.
2016-03-04 11:18:25 -08:00
9526207af8 [Build] Replace setTimeout with
To avoid need to declare global usage to satisfy JSHint
2016-03-04 11:13:34 -08:00
6aeb156a58 [Build] Declare global self in worker 2016-03-04 11:09:41 -08:00
f380e43219 [Build] Inject window to satisfy JSHint 2016-03-04 11:08:20 -08:00
6289fe333b [Build] Declare screenfull
...and shim such that it can be acquired in the normal AMD way.
Avoids use of global variable to satisfy JSHint.
2016-03-04 11:05:08 -08:00
c00d77dcb1 [Build] Relocate operators
...in multi-line expressions, to satisfy JSHint.
2016-03-04 11:02:57 -08:00
56a91dfbaf [Build] Use not-threequals operator
...to satisfy JSHint
2016-03-04 10:58:23 -08:00
f6898d16c9 [Build] Remove obsolete argument
...which incidentally triggers JSHint errors
2016-03-04 10:56:51 -08:00
72ef134750 [Build] Move operators to satisfy JSHint 2016-03-04 10:55:30 -08:00
a8f7bc01c3 [Build] Redeclare globals 2016-03-04 10:53:12 -08:00
2dabe0d3c4 [Build] Add curly braces around if block
...to satisfy JSHint
2016-03-04 10:51:08 -08:00
dda0628621 [Build] Clarify expressions
...to satisfy JSHint.
2016-03-04 10:49:22 -08:00
91bf98b38d [Build] Add Float32Array to predefs 2016-03-04 10:46:51 -08:00
ac5ac8d34e [Build] Remove boilerplate from scripts
No longer necessary after JSHint configuration.
2016-03-04 10:46:38 -08:00
9f840aa0fd [Build] Tweak migration script 2016-03-04 10:43:42 -08:00
377786caf9 [Build] Fix lint exclusions 2016-03-04 10:36:28 -08:00
bc8aafbb1f [Build] Define more common globals 2016-03-04 10:36:10 -08:00
02b806ebe0 [Build] Remove main.js boilerplate
...to satisfy JSHint
2016-03-04 10:27:59 -08:00
f092bfe653 [Build] Don't lint specs 2016-03-04 10:27:34 -08:00
28ae62b4ac [Build] Add script for JSHint migration
To remove boilerplate which JSHint neither expects nor like.
2016-03-04 10:21:12 -08:00
91fb82d212 [Build] Remove esversion: 5 from lint cfg
...as this is apparently presumed.
2016-03-04 10:14:37 -08:00
4a609943f9 [Build] Configure JSHint
#671
2016-03-04 10:11:17 -08:00
894 changed files with 11519 additions and 23840 deletions

View File

@ -1,3 +1,5 @@
{ {
"preset": "crockford" "preset": "crockford",
"requireMultipleVarDecl": false,
"requireVarDeclFirst": false
} }

View File

@ -1,4 +1,23 @@
{ {
"validthis": true, "bitwise": true,
"laxbreak": true "browser": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"funcscope": false,
"futurehostile": true,
"latedef": true,
"noarg": true,
"nocomma": true,
"nonbsp": true,
"nonew": true,
"predef": [
"define",
"Promise"
],
"shadow": "outer",
"strict": "implied",
"undef": true,
"unused": "vars"
} }

View File

@ -1,6 +1,6 @@
# Contributing to Open MCT Web # Contributing to Open MCT
This document describes the process of contributing to Open MCT Web as well This document describes the process of contributing to Open MCT as well
as the standards that will be applied when evaluating contributions. as the standards that will be applied when evaluating contributions.
Please be aware that additional agreements will be necessary before we can Please be aware that additional agreements will be necessary before we can
@ -21,9 +21,9 @@ The short version:
## Contribution Process ## Contribution Process
Open MCT Web uses git for software version control, and for branching and Open MCT uses git for software version control, and for branching and
merging. The central repository is at merging. The central repository is at
https://github.com/nasa/openmctweb.git. https://github.com/nasa/openmct.git.
### Roles ### Roles
@ -116,18 +116,18 @@ the merge back to the master branch.
## Standards ## Standards
Contributions to Open MCT Web are expected to meet the following standards. Contributions to Open MCT are expected to meet the following standards.
In addition, reviewers should use general discretion before accepting In addition, reviewers should use general discretion before accepting
changes. changes.
### Code Standards ### Code Standards
JavaScript sources in Open MCT Web must satisfy JSLint under its default JavaScript sources in Open MCT must satisfy JSLint under its default
settings. This is verified by the command line build. settings. This is verified by the command line build.
#### Code Guidelines #### Code Guidelines
JavaScript sources in Open MCT Web should: JavaScript sources in Open MCT should:
* Use four spaces for indentation. Tabs should not be used. * Use four spaces for indentation. Tabs should not be used.
* Include JSDoc for any exposed API (e.g. public methods, constructors.) * Include JSDoc for any exposed API (e.g. public methods, constructors.)
@ -159,7 +159,7 @@ JavaScript sources in Open MCT Web should:
* Third, imperative statements. * Third, imperative statements.
* Finally, the returned value. * Finally, the returned value.
Deviations from Open MCT Web code style guidelines require two-party agreement, Deviations from Open MCT code style guidelines require two-party agreement,
typically from the author of the change and its reviewer. typically from the author of the change and its reviewer.
#### Code Example #### Code Example
@ -260,7 +260,7 @@ these standards.
## Issue Reporting ## Issue Reporting
Issues are tracked at https://github.com/nasa/openmctweb/issues Issues are tracked at https://github.com/nasa/openmct/issues
Issues should include: Issues should include:

View File

@ -309,30 +309,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
--- ---
### Modernizr
#### Info
* Link: http://modernizr.com
* Version: 2.6.2
* Author: Faruk Ateş
* Description: Browser/device capability finding
#### License
Copyright (c) 20092015
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
### Normalize.css ### Normalize.css
#### Info #### Info

View File

@ -1,6 +1,6 @@
# Open MCT Web # Open MCT
Open MCT Web is a web-based platform for mission operations user interface Open MCT is a web-based platform for mission operations user interface
software. software.
## Bundles ## Bundles
@ -8,7 +8,7 @@ software.
A bundle is a group of software components (including source code, declared A bundle is a group of software components (including source code, declared
as AMD modules, as well as resources such as images and HTML templates) as AMD modules, as well as resources such as images and HTML templates)
that are intended to be added or removed as a single unit. A plug-in for that are intended to be added or removed as a single unit. A plug-in for
Open MCT Web will be expressed as a bundle; platform components are also Open MCT will be expressed as a bundle; platform components are also
expressed as bundles. expressed as bundles.
A bundle is also just a directory which contains a file `bundle.json`, A bundle is also just a directory which contains a file `bundle.json`,
@ -16,7 +16,7 @@ which declares its contents.
The file `bundles.json` (note the plural), at the top level of the The file `bundles.json` (note the plural), at the top level of the
repository, is a JSON file containing an array of all bundles (expressed as repository, is a JSON file containing an array of all bundles (expressed as
directory names) to include in a running instance of Open MCT Web. Adding or directory names) to include in a running instance of Open MCT. Adding or
removing paths from this list will add or remove bundles from the running removing paths from this list will add or remove bundles from the running
application. application.
@ -56,7 +56,7 @@ To run:
## Build ## Build
Open MCT Web is built using [`npm`](http://npmjs.com/) Open MCT is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/). and [`gulp`](http://gulpjs.com/).
To build: To build:
@ -64,18 +64,18 @@ To build:
`npm run prepublish` `npm run prepublish`
This will compile and minify JavaScript sources, as well as copy over assets. This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT Web The contents of the `dist` folder will contain a runnable Open MCT
instance (e.g. by starting an HTTP server in that directory), including: instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT Web source code. * A `main.js` file containing Open MCT source code.
* Various assets in the `example` and `platform` directories. * Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT Web in its default configuration. * An `index.html` that runs Open MCT in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js). Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
### Building Documentation ### Building Documentation
Open MCT Web's documentation is generated by an Open MCT's documentation is generated by an
[npm](https://www.npmjs.com/)-based build. It has additional dependencies that [npm](https://www.npmjs.com/)-based build. It has additional dependencies that
may not be available on every platform and thus is not covered in the standard may not be available on every platform and thus is not covered in the standard
npm install. Ensure your system has [libcairo](http://cairographics.org/) npm install. Ensure your system has [libcairo](http://cairographics.org/)
@ -89,7 +89,7 @@ Documentation will be generated in `target/docs`.
# Glossary # Glossary
Certain terms are used throughout Open MCT Web with consistent meanings Certain terms are used throughout Open MCT with consistent meanings
or conventions. Any deviations from the below are issues and should be or conventions. Any deviations from the below are issues and should be
addressed (either by updating this glossary or changing code to reflect addressed (either by updating this glossary or changing code to reflect
correct usage.) Other developer documentation, particularly in-line correct usage.) Other developer documentation, particularly in-line
@ -112,7 +112,7 @@ documentation, may presume an understanding of these terms.
(Most often used in the context of extensions, domain (Most often used in the context of extensions, domain
object models, or other similar application-specific objects.) object models, or other similar application-specific objects.)
* _domain object_: A meaningful object to the user; a distinct thing in * _domain object_: A meaningful object to the user; a distinct thing in
the work support by Open MCT Web. Anything that appears in the left-hand the work support by Open MCT. Anything that appears in the left-hand
tree is a domain object. tree is a domain object.
* _extension_: An extension is a unit of functionality exposed to the * _extension_: An extension is a unit of functionality exposed to the
platform in a declarative fashion by a bundle. For more platform in a declarative fashion by a bundle. For more

4
app.js
View File

@ -19,6 +19,7 @@
// Defaults // Defaults
options.port = options.port || options.p || 8080; options.port = options.port || options.p || 8080;
options.directory = options.directory || options.D || '.';
['include', 'exclude', 'i', 'x'].forEach(function (opt) { ['include', 'exclude', 'i', 'x'].forEach(function (opt) {
options[opt] = options[opt] || []; options[opt] = options[opt] || [];
// Make sure includes/excludes always end up as arrays // Make sure includes/excludes always end up as arrays
@ -36,6 +37,7 @@
console.log(" --port, -p <number> Specify port."); console.log(" --port, -p <number> Specify port.");
console.log(" --include, -i <bundle> Include the specified bundle."); console.log(" --include, -i <bundle> Include the specified bundle.");
console.log(" --exclude, -x <bundle> Exclude the specified bundle."); console.log(" --exclude, -x <bundle> Exclude the specified bundle.");
console.log(" --directory, -D <bundle> Serve files from specified directory.");
console.log(""); console.log("");
process.exit(0); process.exit(0);
} }
@ -71,7 +73,7 @@
}); });
// Expose everything else as static files // Expose everything else as static files
app.use(express['static']('.')); app.use(express['static'](options.directory));
// Finally, open the HTTP server // Finally, open the HTTP server
app.listen(options.port); app.listen(options.port);

View File

@ -1,10 +1,10 @@
{ {
"name": "openmctweb", "name": "openmct",
"description": "The OpenMCTWeb core platform", "description": "The Open MCT core platform",
"main": "", "main": "",
"license": "Apache-2.0", "license": "Apache-2.0",
"moduleType": [], "moduleType": [],
"homepage": "http://nasa.github.io/openmctweb/", "homepage": "http://nasa.github.io/openmct/",
"private": true, "private": true,
"dependencies": { "dependencies": {
"angular": "1.4.4", "angular": "1.4.4",
@ -18,6 +18,8 @@
"node-uuid": "^1.4.7", "node-uuid": "^1.4.7",
"comma-separated-values": "^3.6.4", "comma-separated-values": "^3.6.4",
"FileSaver.js": "^0.0.2", "FileSaver.js": "^0.0.2",
"zepto": "^1.1.6" "zepto": "^1.1.6",
"eventemitter3": "^1.2.0",
"lodash": "3.10.1"
} }
} }

View File

@ -22,17 +22,19 @@
#* at runtime from the About dialog for additional information. #* at runtime from the About dialog for additional information.
#***************************************************************************** #*****************************************************************************
# Script to build and deploy docs to github pages. # Script to build and deploy docs.
OUTPUT_DIRECTORY="target/docs" OUTPUT_DIRECTORY="target/docs"
REPOSITORY_URL="git@github.com:nasa/openmctweb.git" # Docs, once built, are pushed to the private website repo
REPOSITORY_URL="git@github.com:nasa/openmct-website.git"
WEBSITE_DIRECTORY="website"
BUILD_SHA=`git rev-parse head` BUILD_SHA=`git rev-parse HEAD`
# A remote will be created for the git repository we are pushing to. # 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 inbetween builds.
REMOTE_NAME="documentation" REMOTE_NAME="documentation"
WEBSITE_BRANCH="gh-pages" WEBSITE_BRANCH="master"
# Clean output directory, JSDOC will recreate # Clean output directory, JSDOC will recreate
if [ -d $OUTPUT_DIRECTORY ]; then if [ -d $OUTPUT_DIRECTORY ]; then
@ -40,23 +42,21 @@ if [ -d $OUTPUT_DIRECTORY ]; then
fi fi
npm run docs npm run docs
cd $OUTPUT_DIRECTORY || exit 1
echo "git init" echo "git clone $REPOSITORY_URL website"
git init git clone $REPOSITORY_URL website || exit 1
echo "cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY/docs"
cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY/docs
echo "cd $WEBSITE_DIRECTORY"
cd $WEBSITE_DIRECTORY || exit 1
# Configure github for CircleCI user. # Configure github for CircleCI user.
git config user.email "buildbot@circleci.com" git config user.email "buildbot@circleci.com"
git config user.name "BuildBot" git config user.name "BuildBot"
echo "git remote add $REMOTE_NAME $REPOSITORY_URL"
git remote add $REMOTE_NAME $REPOSITORY_URL
echo "git add ." echo "git add ."
git add . git add .
echo "git commit -m \"Generate docs from build $BUILD_SHA\"" echo "git commit -m \"Docs updated from build $BUILD_SHA\""
git commit -m "Generate docs from build $BUILD_SHA" git commit -m "Docs updated from build $BUILD_SHA"
# Push to the website repo
echo "git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f" git push
git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f
echo "Documentation pushed to gh-pages branch."

View File

@ -2,17 +2,24 @@ deployment:
production: production:
branch: master branch: master
commands: commands:
- npm install canvas nomnoml - npm install canvas nomnoml
- ./build-docs.sh - ./build-docs.sh
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master - git fetch --unshallow
openmctweb-staging-un: - git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
branch: nem_prototype openmct-demo:
branch: live_demo
heroku: heroku:
appname: openmctweb-staging-un appname: openmct-demo
openmctweb-staging-deux: openmctweb-staging-deux:
branch: mobile branch: mobile
heroku: heroku:
appname: openmctweb-staging-deux appname: openmctweb-staging-deux
test: test:
post: post:
- npm run jshint --silent - gulp lint
- gulp checkstyle
general:
branches:
ignore:
- gh-pages

View File

@ -1,9 +1,3 @@
<hr> <hr>
<cite>
This document is styled using
<a href="https://github.com/jasonm23/markdown-css-themes">
https://github.com/jasonm23/markdown-css-themes
</a>.
</cite>
</body> </body>
</html> </html>

View File

@ -1,7 +1,9 @@
<html> <html>
<head> <head>
<link rel="stylesheet" <link rel="stylesheet"
href="http://jasonm23.github.io/markdown-css-themes/avenir-white.css"> href="//nasa.github.io/openmct/static/res/css/styles.css">
<link rel="stylesheet"
href="//nasa.github.io/openmct/static/res/css/documentation.css">
</head> </head>
<body> <body>

View File

@ -5,7 +5,7 @@ software components to communicate. The software components it recognizes
are: are:
* _Extensions_: Individual units of functionality that can be added to * _Extensions_: Individual units of functionality that can be added to
or removed from Open MCT Web. _Extension categories_ distinguish what or removed from Open MCT. _Extension categories_ distinguish what
type of functionality is being added/removed. type of functionality is being added/removed.
* _Bundles_: A grouping of related extensions * _Bundles_: A grouping of related extensions
(named after an analogous concept from [OSGi](http://www.osgi.org/)) (named after an analogous concept from [OSGi](http://www.osgi.org/))
@ -19,7 +19,7 @@ manner which the framework layer can understand.
```nomnoml ```nomnoml
#direction: down #direction: down
[Open MCT Web| [Open MCT|
[Dependency injection framework]-->[Platform bundle #1] [Dependency injection framework]-->[Platform bundle #1]
[Dependency injection framework]-->[Platform bundle #2] [Dependency injection framework]-->[Platform bundle #2]
[Dependency injection framework]-->[Plugin bundle #1] [Dependency injection framework]-->[Plugin bundle #1]
@ -35,7 +35,7 @@ manner which the framework layer can understand.
``` ```
The "dependency injection framework" in this case is The "dependency injection framework" in this case is
[AngularJS](https://angularjs.org/). Open MCT Web's framework layer [AngularJS](https://angularjs.org/). Open MCT's framework layer
is really just a thin wrapper over Angular that recognizes the is really just a thin wrapper over Angular that recognizes the
concepts of bundles and extensions (as declared in JSON files) and concepts of bundles and extensions (as declared in JSON files) and
registering extensions with Angular. It additionally acts as a registering extensions with Angular. It additionally acts as a
@ -60,7 +60,7 @@ activities which were performed by the framework component.
## Application Initialization ## Application Initialization
The framework component initializes an Open MCT Web application following The framework component initializes an Open MCT application following
a simple sequence of steps. a simple sequence of steps.
```nomnoml ```nomnoml
@ -97,7 +97,7 @@ a simple sequence of steps.
[Extension]o->[Dependency #3] [Extension]o->[Dependency #3]
``` ```
Open MCT Web's architecture relies on a simple premise: Individual units Open MCT's architecture relies on a simple premise: Individual units
(extensions) only have access to the dependencies they declare that they (extensions) only have access to the dependencies they declare that they
need, and they acquire references to these dependencies via dependency need, and they acquire references to these dependencies via dependency
injection. This has several desirable traits: injection. This has several desirable traits:
@ -121,11 +121,11 @@ injection. This has several desirable traits:
the framework. the framework.
A drawback to this approach is that it makes it difficult to define A drawback to this approach is that it makes it difficult to define
"the architecture" of Open MCT Web, in terms of describing the specific "the architecture" of Open MCT, in terms of describing the specific
units that interact at run-time. The run-time architecture is determined units that interact at run-time. The run-time architecture is determined
by the framework as the consequence of wiring together dependencies. by the framework as the consequence of wiring together dependencies.
As such, the specific architecture of any given application built on As such, the specific architecture of any given application built on
Open MCT Web can look very different. Open MCT can look very different.
Keeping that in mind, there are a few useful patterns supported by the Keeping that in mind, there are a few useful patterns supported by the
framework that are useful to keep in mind. framework that are useful to keep in mind.
@ -229,4 +229,4 @@ otherwise a single provider) will be exposed as a single service that
other extensions can acquire through dependency injection. Because all other extensions can acquire through dependency injection. Because all
components of the same type of service expose the same interface, users components of the same type of service expose the same interface, users
of that service do not need to be aware that they are talking to an of that service do not need to be aware that they are talking to an
aggregator or a provider, for instance. aggregator or a provider, for instance.

View File

@ -1,14 +1,14 @@
# Introduction # Introduction
The purpose of this document is to familiarize developers with the The purpose of this document is to familiarize developers with the
overall architecture of Open MCT Web. overall architecture of Open MCT.
The target audience includes: The target audience includes:
* _Platform maintainers_: Individuals involved in developing, * _Platform maintainers_: Individuals involved in developing,
extending, and maintaing capabilities of the platform. extending, and maintaing capabilities of the platform.
* _Integration developers_: Individuals tasked with integrated * _Integration developers_: Individuals tasked with integrated
Open MCT Web into a larger system, who need to understand Open MCT into a larger system, who need to understand
its inner workings sufficiently to complete this integration. its inner workings sufficiently to complete this integration.
As the focus of this document is on architecture, whenever possible As the focus of this document is on architecture, whenever possible
@ -17,25 +17,25 @@ omitted. These details may be found in the developer guide.
# Overview # Overview
Open MCT Web is client software: It runs in a web browser and Open MCT is client software: It runs in a web browser and
provides a user interface, while communicating with various provides a user interface, while communicating with various
server-side resources through browser APIs. server-side resources through browser APIs.
```nomnoml ```nomnoml
#direction: right #direction: right
[Client|[Browser|[Open MCT Web]->[Browser APIs]]] [Client|[Browser|[Open MCT]->[Browser APIs]]]
[Server|[Web services]] [Server|[Web services]]
[Client]<->[Server] [Client]<->[Server]
``` ```
While Open MCT Web can be configured to run as a standalone client, While Open MCT can be configured to run as a standalone client,
this is rarely very useful. Instead, it is intended to be used as a this is rarely very useful. Instead, it is intended to be used as a
display and interaction layer for information obtained from a display and interaction layer for information obtained from a
variety of back-end services. Doing so requires authoring or utilizing variety of back-end services. Doing so requires authoring or utilizing
adapter plugins which allow Open MCT Web to interact with these services. adapter plugins which allow Open MCT to interact with these services.
Typically, the pattern here is to provide a known interface that Typically, the pattern here is to provide a known interface that
Open MCT Web can utilize, and implement it such that it interacts with Open MCT can utilize, and implement it such that it interacts with
whatever back-end provides the relevant information. whatever back-end provides the relevant information.
Examples of back-ends that can be utilized in this fashion include Examples of back-ends that can be utilized in this fashion include
databases for the persistence of user-created objects, or sources of databases for the persistence of user-created objects, or sources of
@ -43,13 +43,13 @@ telemetry data.
## Software Architecture ## Software Architecture
The simplest overview of Open MCT Web is to look at it as a "layered" The simplest overview of Open MCT is to look at it as a "layered"
architecture, where each layer more clearly specifies the behavior architecture, where each layer more clearly specifies the behavior
of the software. of the software.
```nomnoml ```nomnoml
#direction: down #direction: down
[Open MCT Web| [Open MCT|
[Platform]<->[Application] [Platform]<->[Application]
[Framework]->[Application] [Framework]->[Application]
[Framework]->[Platform] [Framework]->[Platform]
@ -64,14 +64,14 @@ These layers are:
established an abstraction by which different software components established an abstraction by which different software components
may communicate and/or interact. may communicate and/or interact.
* [_Platform_](platform.md): The platform layer defines the general look, * [_Platform_](platform.md): The platform layer defines the general look,
feel, and behavior of Open MCT Web. This includes user-facing components like feel, and behavior of Open MCT. This includes user-facing components like
Browse mode and Edit mode, as well as underlying elements of the Browse mode and Edit mode, as well as underlying elements of the
information model and the general service infrastructure. information model and the general service infrastructure.
* _Application_: The application layer defines specific features of * _Application_: The application layer defines specific features of
an application built on Open MCT Web. This includes adapters to an application built on Open MCT. This includes adapters to
specific back-ends, new types of things for users to create, and specific back-ends, new types of things for users to create, and
new ways of visualizing objects within the system. This layer new ways of visualizing objects within the system. This layer
typically consists of a mix of custom plug-ins to Open MCT Web, typically consists of a mix of custom plug-ins to Open MCT,
as well as optional features (such as Plot view) included alongside as well as optional features (such as Plot view) included alongside
the platform. the platform.

View File

@ -1,6 +1,6 @@
# Overview # Overview
The Open MCT Web platform utilizes the [framework layer](Framework.md) The Open MCT platform utilizes the [framework layer](Framework.md)
to provide an extensible baseline for applications which includes: to provide an extensible baseline for applications which includes:
* A common user interface (and user interface paradigm) for dealing with * A common user interface (and user interface paradigm) for dealing with
@ -16,7 +16,7 @@ building application, the platform adds more specificity by defining
additional extension types and allowing for integration with back end additional extension types and allowing for integration with back end
components. components.
The run-time architecture of an Open MCT Web application can be categorized The run-time architecture of an Open MCT application can be categorized
into certain high-level tiers: into certain high-level tiers:
```nomnoml ```nomnoml
@ -29,7 +29,7 @@ into certain high-level tiers:
[Browser APIs]->[Back-end] [Browser APIs]->[Back-end]
``` ```
Applications built using Open MCT Web may add or configure functionality Applications built using Open MCT may add or configure functionality
in __any of these tiers__. in __any of these tiers__.
* _DOM_: The rendered HTML document, composed from HTML templates which * _DOM_: The rendered HTML document, composed from HTML templates which
@ -60,7 +60,7 @@ in __any of these tiers__.
functionality needed to support the information model. This includes functionality needed to support the information model. This includes
exposing underlying sets of extensions and mediating with the exposing underlying sets of extensions and mediating with the
back-end. back-end.
* _Back-end_: The back-end is out of the scope of Open MCT Web, except * _Back-end_: The back-end is out of the scope of Open MCT, except
for the interfaces which are utilized by adapters participating in the for the interfaces which are utilized by adapters participating in the
service infrastructure. Includes the underlying persistence stores, telemetry  service infrastructure. Includes the underlying persistence stores, telemetry 
streams, and so forth which the Open MCT Web client is being used to interact  streams, and so forth which the Open MCT Web client is being used to interact 
@ -70,15 +70,15 @@ in __any of these tiers__.
Once the Once the
[application has been initialized](Framework.md#application-initialization) [application has been initialized](Framework.md#application-initialization)
Open MCT Web primarily operates in an event-driven paradigm; various Open MCT primarily operates in an event-driven paradigm; various
events (mouse clicks, timers firing, receiving responses to XHRs) trigger events (mouse clicks, timers firing, receiving responses to XHRs) trigger
the invocation of functions, typically in the presentation layer for the invocation of functions, typically in the presentation layer for
user actions or in the service infrastructure for server responses. user actions or in the service infrastructure for server responses.
The "main point of entry" into an initialized Open MCT Web application The "main point of entry" into an initialized Open MCT application
is effectively the is effectively the
[route](https://docs.angularjs.org/api/ngRoute/service/$route#example) [route](https://docs.angularjs.org/api/ngRoute/service/$route#example)
which is associated with the URL used to access Open MCT Web (or a which is associated with the URL used to access Open MCT (or a
default route.) This route will be associated with a template which default route.) This route will be associated with a template which
will be displayed; this template will include references to directives will be displayed; this template will include references to directives
and controllers which will be interpreted by Angular and used to and controllers which will be interpreted by Angular and used to
@ -107,11 +107,11 @@ both the information model and the service infrastructure.
# Presentation Layer # Presentation Layer
The presentation layer of Open MCT Web is responsible for providing The presentation layer of Open MCT is responsible for providing
information to display within templates, and for handling interactions information to display within templates, and for handling interactions
which are initiated from templated DOM elements. AngularJS acts as which are initiated from templated DOM elements. AngularJS acts as
an intermediary between the web page as the user sees it, and the an intermediary between the web page as the user sees it, and the
presentation layer implemented as Open MCT Web extensions. presentation layer implemented as Open MCT extensions.
```nomnoml ```nomnoml
[Presentation Layer| [Presentation Layer|
@ -143,12 +143,12 @@ to primitives from AngularJS:
attributes and tags. attributes and tags.
* [_Routes_](https://docs.angularjs.org/api/ngRoute/service/$route#example) * [_Routes_](https://docs.angularjs.org/api/ngRoute/service/$route#example)
are used to associate specific URLs (including the fragment identifier) are used to associate specific URLs (including the fragment identifier)
with specific application states. (In Open MCT Web, these are used to with specific application states. (In Open MCT, these are used to
describe the mode of usage - e.g. browse or edit - as well as to describe the mode of usage - e.g. browse or edit - as well as to
identify the object being used.) identify the object being used.)
* [_Templates_](https://docs.angularjs.org/guide/templates) are partial * [_Templates_](https://docs.angularjs.org/guide/templates) are partial
HTML documents that will be rendered and kept up-to-date by AngularJS. HTML documents that will be rendered and kept up-to-date by AngularJS.
Open MCT Web introduces a custom `mct-include` directive which acts Open MCT introduces a custom `mct-include` directive which acts
as a wrapper around `ng-include` to allow templates to be referred as a wrapper around `ng-include` to allow templates to be referred
to by symbolic names. to by symbolic names.
@ -189,10 +189,10 @@ to displaying domain objects.
] ]
``` ```
Domain objects are the most fundamental component of Open MCT Web's Domain objects are the most fundamental component of Open MCT's
information model. A domain object is some distinct thing relevant to a information model. A domain object is some distinct thing relevant to a
user's work flow, such as a telemetry channel, display, or similar. user's work flow, such as a telemetry channel, display, or similar.
Open MCT Web is a tool for viewing, browsing, manipulating, and otherwise Open MCT is a tool for viewing, browsing, manipulating, and otherwise
interacting with a graph of domain objects. interacting with a graph of domain objects.
A domain object should be conceived of as the union of the following: A domain object should be conceived of as the union of the following:
@ -254,7 +254,7 @@ Concrete examples of capabilities which follow this pattern
# Service Infrastructure # Service Infrastructure
Most services exposed by the Open MCT Web platform follow the Most services exposed by the Open MCT platform follow the
[composite services](Framework.md#composite-services) to permit [composite services](Framework.md#composite-services) to permit
a higher degree of flexibility in how a service can be modified a higher degree of flexibility in how a service can be modified
or customized for specific applications. or customized for specific applications.
@ -327,7 +327,7 @@ A short summary of the roles of these services:
[DomainObjectProvider]o-[CapabilityService] [DomainObjectProvider]o-[CapabilityService]
``` ```
As domain objects are central to Open MCT Web's information model, As domain objects are central to Open MCT's information model,
acquiring domain objects is equally important. acquiring domain objects is equally important.
```nomnoml ```nomnoml
@ -338,7 +338,7 @@ acquiring domain objects is equally important.
[<state> Instantiate DomainObject]->[<end> End] [<state> Instantiate DomainObject]->[<end> End]
``` ```
Open MCT Web includes an implementation of an `ObjectService` which Open MCT includes an implementation of an `ObjectService` which
satisfies this capability by: satisfies this capability by:
* Consulting the [Model Service](#model-service) to acquire domain object * Consulting the [Model Service](#model-service) to acquire domain object
@ -437,9 +437,9 @@ objects (this allows failures to be recognized and handled in groups.)
The telemetry service is responsible for acquiring telemetry data. The telemetry service is responsible for acquiring telemetry data.
Notably, the platform does not include any providers for Notably, the platform does not include any providers for
`TelemetryService`; applications built on Open MCT Web will need to `TelemetryService`; applications built on Open MCT will need to
implement a provider for this service if they wish to expose telemetry implement a provider for this service if they wish to expose telemetry
data. This is usually the most important step for integrating Open MCT Web data. This is usually the most important step for integrating Open MCT
into an existing telemetry system. into an existing telemetry system.
Requests for telemetry data are usually initiated in the Requests for telemetry data are usually initiated in the
@ -721,6 +721,6 @@ disallow.
``` ```
The type service provides metadata about the different types of domain The type service provides metadata about the different types of domain
objects that exist within an Open MCT Web application. The platform objects that exist within an Open MCT application. The platform
implementation reads these types in from extension category `types` implementation reads these types in from extension category `types`
and wraps them in a JavaScript interface. and wraps them in a JavaScript interface.

View File

@ -1,4 +1,4 @@
# Open MCT Web Developer Guide # Open MCT Developer Guide
Victor Woeltjen Victor Woeltjen
[victor.woeltjen@nasa.gov](mailto:victor.woeltjen@nasa.gov) [victor.woeltjen@nasa.gov](mailto:victor.woeltjen@nasa.gov)
@ -6,35 +6,36 @@ Victor Woeltjen
September 23, 2015 September 23, 2015
Document Version 1.1 Document Version 1.1
Date | Version | Summary of Changes | Author Date | Version | Summary of Changes | Author
------------------- | --------- | ----------------------- | --------------- ------------------- | --------- | ------------------------- | ---------------
April 29, 2015 | 0 | Initial Draft | Victor Woeltjen April 29, 2015 | 0 | Initial Draft | Victor Woeltjen
May 12, 2015 | 0.1 | | Victor Woeltjen May 12, 2015 | 0.1 | | Victor Woeltjen
June 4, 2015 | 1.0 | Name Changes | Victor Woeltjen June 4, 2015 | 1.0 | Name Changes | Victor Woeltjen
October 4, 2015 | 1.1 | Conversion to MarkDown | Andrew Henry October 4, 2015 | 1.1 | Conversion to MarkDown | Andrew Henry
April 5, 2016 | 1.2 | Added Mct-table directive | Andrew Henry
# Introduction # Introduction
The purpose of this guide is to familiarize software developers with the Open The purpose of this guide is to familiarize software developers with the Open
MCT Web platform. MCT Web platform.
## What is Open MCT Web ## What is Open MCT
Open MCT Web is a platform for building user interface and display tools, Open MCT is a platform for building user interface and display tools,
developed at the NASA Ames Research Center in collaboration with teams at the developed at the NASA Ames Research Center in collaboration with teams at the
Jet Propulsion Laboratory. It is written in HTML5, CSS3, and JavaScript, using Jet Propulsion Laboratory. It is written in HTML5, CSS3, and JavaScript, using
[AngularJS](http://www.angularjs.org) as a framework. Its intended use is to [AngularJS](http://www.angularjs.org) as a framework. Its intended use is to
create single-page web applications which integrate data and behavior from a create single-page web applications which integrate data and behavior from a
variety of sources and domains. variety of sources and domains.
Open MCT Web has been developed to support the remote operation of space Open MCT has been developed to support the remote operation of space
vehicles, so some of its features are specific to that task; however, it is vehicles, so some of its features are specific to that task; however, it is
flexible enough to be adapted to a variety of other application domains where a flexible enough to be adapted to a variety of other application domains where a
display tool oriented toward browsing, composing, and visualizing would be display tool oriented toward browsing, composing, and visualizing would be
useful. useful.
Open MCT Web provides: Open MCT provides:
* A common user interface paradigm which can be applied to a variety of domains * A common user interface paradigm which can be applied to a variety of domains
and tasks. Open MCT Web is more than a widget toolkit - it provides a standard and tasks. Open MCT is more than a widget toolkit - it provides a standard
tree-on-the-left, view-on-the-right browsing environment which you customize by tree-on-the-left, view-on-the-right browsing environment which you customize by
adding new browsable object types, visualizations, and back-end adapters. adding new browsable object types, visualizations, and back-end adapters.
* A plugin framework and an extensible API for introducing new application * A plugin framework and an extensible API for introducing new application
@ -43,17 +44,17 @@ features of a variety of types.
visualizations and infrastructure specific to telemetry display. visualizations and infrastructure specific to telemetry display.
## Client-Server Relationship ## Client-Server Relationship
Open MCT Web is client software - it runs entirely in the user's web browser. As Open MCT is client software - it runs entirely in the user's web browser. As
such, it is largely 'server agnostic'; any web server capable of serving files such, it is largely 'server agnostic'; any web server capable of serving files
from paths is capable of providing Open MCT Web. from paths is capable of providing Open MCT.
While Open MCT Web can be configured to run as a standalone client, this is While Open MCT can be configured to run as a standalone client, this is
rarely very useful. Instead, it is intended to be used as a display and rarely very useful. Instead, it is intended to be used as a display and
interaction layer for information obtained from a variety of back-end services. interaction layer for information obtained from a variety of back-end services.
Doing so requires authoring or utilizing adapter plugins which allow Open MCT Doing so requires authoring or utilizing adapter plugins which allow Open MCT
Web to interact with these services. Web to interact with these services.
Typically, the pattern here is to provide a known interface that Open MCT Web Typically, the pattern here is to provide a known interface that Open MCT
can utilize, and implement it such that it interacts with whatever back-end can utilize, and implement it such that it interacts with whatever back-end
provides the relevant information. Examples of back-ends that can be utilized in provides the relevant information. Examples of back-ends that can be utilized in
this fashion include databases for the persistence of user-created objects, or this fashion include databases for the persistence of user-created objects, or
@ -62,52 +63,52 @@ sources of telemetry data.
See the [Architecture Guide](../architecture/index.md#Overview) for information See the [Architecture Guide](../architecture/index.md#Overview) for information
on the client-server relationship. on the client-server relationship.
## Developing with Open MCT Web ## Developing with Open MCT
Building applications with Open MCT Web typically means authoring and utilizing Building applications with Open MCT typically means authoring and utilizing
a set of plugins which provide application-specific details about how Open MCT a set of plugins which provide application-specific details about how Open MCT
Web should behave. Web should behave.
### Technologies ### Technologies
Open MCT Web sources are written in JavaScript, with a number of configuration Open MCT sources are written in JavaScript, with a number of configuration
files written in JSON. Displayable components are written in HTML5 and CSS3. files written in JSON. Displayable components are written in HTML5 and CSS3.
Open MCT Web is built using [AngularJS](http://www.angularjs.org) from Google. A Open MCT is built using [AngularJS](http://www.angularjs.org) from Google. A
good understanding of Angular is recommended for developers working with Open good understanding of Angular is recommended for developers working with Open
MCT Web. MCT Web.
### Forking ### Forking
Open MCT Web does not currently have a single stand-alone artifact that can be Open MCT does not currently have a single stand-alone artifact that can be
used as a library. Instead, the recommended approach for creating a new used as a library. Instead, the recommended approach for creating a new
application is to start by forking/branching Open MCT Web, and then adding new application is to start by forking/branching Open MCT, and then adding new
features from there. Put another way, Open MCT Web's source structure is built features from there. Put another way, Open MCT's source structure is built
to serve as a template for specific applications. to serve as a template for specific applications.
Forking in this manner should not require that you edit Open MCT Web's sources. Forking in this manner should not require that you edit Open MCT's sources.
The preferred approach is to create a new directory (peer to `index.html`) for The preferred approach is to create a new directory (peer to `index.html`) for
the new application, then add new bundles (as described in the Framework the new application, then add new bundles (as described in the Framework
chapter) within that directory. chapter) within that directory.
To initially clone the Open MCT Web repository: To initially clone the Open MCT repository:
`git clone <repository URL> <local repo directory> -b open-master` `git clone <repository URL> <local repo directory> -b open-master`
To create a fork to begin working on a new application using Open MCT Web: To create a fork to begin working on a new application using Open MCT:
cd <local repo directory> cd <local repo directory>
git checkout open-master git checkout open-master
git checkout -b <new branch name> git checkout -b <new branch name>
As a convention used internally, applications built using Open MCT Web have As a convention used internally, applications built using Open MCT have
master branch names with an identifying prefix. For instance, if building an master branch names with an identifying prefix. For instance, if building an
application called 'Foo', the last statement above would look like: application called 'Foo', the last statement above would look like:
git checkout -b foo-master git checkout -b foo-master
This convention is not enforced or understood by Open MCT Web in any way; it is This convention is not enforced or understood by Open MCT in any way; it is
mentioned here as a more general recommendation. mentioned here as a more general recommendation.
# Overview # Overview
Open MCT Web is implemented as a framework component which manages a set of Open MCT is implemented as a framework component which manages a set of
other components. These components, called _bundles_, act as containers to group other components. These components, called _bundles_, act as containers to group
sets of related functionality; individual units of functionality are expressed sets of related functionality; individual units of functionality are expressed
within these bundles as _extensions_. within these bundles as _extensions_.
@ -118,7 +119,7 @@ run-time to satisfy these declared dependency. This dependency injection
approach allows software components which have been authored separately (e.g. as approach allows software components which have been authored separately (e.g. as
plugins) but to collaborate at run-time. plugins) but to collaborate at run-time.
Open MCT Web's framework layer is implemented on top of AngularJS's [dependency Open MCT's framework layer is implemented on top of AngularJS's [dependency
injection mechanism](https://docs.angularjs.org/guide/di) and is modelled after injection mechanism](https://docs.angularjs.org/guide/di) and is modelled after
[OSGi](hhttp://www.osgi.org/) and its [Declarative Services component model](http://wiki.osgi.org/wiki/Declarative_Services). [OSGi](hhttp://www.osgi.org/) and its [Declarative Services component model](http://wiki.osgi.org/wiki/Declarative_Services).
In particular, this is where the term _bundle_ comes from. In particular, this is where the term _bundle_ comes from.
@ -133,7 +134,7 @@ The framework is described in more detail in the [Framework Overview](../archite
architecture guide. architecture guide.
### Tiers ### Tiers
While all bundles in a running Open MCT Web instance are effectively peers, it While all bundles in a running Open MCT instance are effectively peers, it
is useful to think of them as a tiered architecture, where each tier adds more is useful to think of them as a tiered architecture, where each tier adds more
specificity to the application. specificity to the application.
```nomnoml ```nomnoml
@ -151,7 +152,7 @@ It additionally interprets bundle definitions (see explanation below, as well as
further detail in the Framework chapter.) At this tier, we are at our most further detail in the Framework chapter.) At this tier, we are at our most
general: We know only that we are a plugin-based application. general: We know only that we are a plugin-based application.
* __Platform__: Components in the Platform tier describe both the general user * __Platform__: Components in the Platform tier describe both the general user
interface and corresponding developer-facing interfaces of Open MCT Web. This interface and corresponding developer-facing interfaces of Open MCT. This
tier provides the general infrastructure for applications. It is less general tier provides the general infrastructure for applications. It is less general
than the framework tier, insofar as this tier introduces a specific user than the framework tier, insofar as this tier introduces a specific user
interface paradigm, but it is still non-specific as to what useful features interface paradigm, but it is still non-specific as to what useful features
@ -159,7 +160,7 @@ will be provided. Although they can be removed or replaced easily, bundles
provided by the Platform tier generally should not be thought of as optional. provided by the Platform tier generally should not be thought of as optional.
* __Application__: The application tier consists of components which utilize the * __Application__: The application tier consists of components which utilize the
infrastructure provided by the Platform to provide functionality which will (or infrastructure provided by the Platform to provide functionality which will (or
could) be useful to specific applications built using Open MCT Web. These could) be useful to specific applications built using Open MCT. These
include adapters to specific persistence back-ends (such as ElasticSearch or include adapters to specific persistence back-ends (such as ElasticSearch or
CouchDB) as well as bundles which describe more user-facing features (such as CouchDB) as well as bundles which describe more user-facing features (such as
_Plot_ views for visualizing time series data, or _Layout_ objects for _Plot_ views for visualizing time series data, or _Layout_ objects for
@ -168,20 +169,20 @@ compromising basic application functionality, with the caveat that at least one
persistence adapter needs to be present. persistence adapter needs to be present.
* __Plugins__: Conceptually, this tier is not so different from the application * __Plugins__: Conceptually, this tier is not so different from the application
tier; it consists of bundles describing new features, back-end adapters, that tier; it consists of bundles describing new features, back-end adapters, that
are specific to the application being built on Open MCT Web. It is described as are specific to the application being built on Open MCT. It is described as
a separate tier here because it has one important distinction from the a separate tier here because it has one important distinction from the
application tier: It consists of bundles that are not included with the platform application tier: It consists of bundles that are not included with the platform
(either authored anew for the specific application, or obtained from elsewhere.) (either authored anew for the specific application, or obtained from elsewhere.)
Note that bundles in any tier can go off and consult back-end services. In Note that bundles in any tier can go off and consult back-end services. In
practice, this responsibility is handled at the Application and/or Plugin tiers; practice, this responsibility is handled at the Application and/or Plugin tiers;
Open MCT Web is built to be server-agnostic, so any back-end is considered an Open MCT is built to be server-agnostic, so any back-end is considered an
application-specific detail. application-specific detail.
## Platform Overview ## Platform Overview
The "tiered" architecture described in the preceding text describes a way of The "tiered" architecture described in the preceding text describes a way of
thinking of and categorizing software components of a Open MCT Web application, thinking of and categorizing software components of a Open MCT application,
as well as the framework layer's role in mediating between these components. as well as the framework layer's role in mediating between these components.
Once the framework layer has wired these software components together, however, Once the framework layer has wired these software components together, however,
the application's logical architecture emerges. the application's logical architecture emerges.
@ -192,7 +193,7 @@ section of the Platform guide
### Web Services ### Web Services
As mentioned in the Introduction, Open MCT Web is a platform single-page As mentioned in the Introduction, Open MCT is a platform single-page
applications which runs entirely in the browser. Most applications will want to applications which runs entirely in the browser. Most applications will want to
additionally interact with server-side resources, to (for example) read additionally interact with server-side resources, to (for example) read
telemetry data or store user-created objects. This interaction is handled by telemetry data or store user-created objects. This interaction is handled by
@ -205,7 +206,7 @@ individual bundles using APIs which are supported in browser (such as
[Web Service #2] <- [Web Browser] [Web Service #2] <- [Web Browser]
[Web Service #3] <- [Web Browser] [Web Service #3] <- [Web Browser]
[<package> Web Browser | [<package> Web Browser |
[<package> Open MCT Web | [<package> Open MCT |
[Plugin Bundle #1]-->[Core API] [Plugin Bundle #1]-->[Core API]
[Core API]<--[Plugin Bundle #2] [Core API]<--[Plugin Bundle #2]
[Platform Bundle #1]-->[Core API] [Platform Bundle #1]-->[Core API]
@ -215,16 +216,16 @@ individual bundles using APIs which are supported in browser (such as
[Core API]<--[Platform Bundle #5] [Core API]<--[Platform Bundle #5]
[Core API]<--[Plugin Bundle #3] [Core API]<--[Plugin Bundle #3]
] ]
[Open MCT Web] ->[Browser APIs] [Open MCT] ->[Browser APIs]
] ]
``` ```
This architectural approach ensures a loose coupling between applications built This architectural approach ensures a loose coupling between applications built
using Open MCT Web and the backends which support them. using Open MCT and the backends which support them.
### Glossary ### Glossary
Certain terms are used throughout Open MCT Web with consistent meanings or Certain terms are used throughout Open MCT with consistent meanings or
conventions. Other developer documentation, particularly in-line documentation, conventions. Other developer documentation, particularly in-line documentation,
may presume an understanding of these terms. may presume an understanding of these terms.
@ -246,7 +247,7 @@ readable description of a thing; usually a single sentence or short paragraph.
(Most often used in the context of extensions, domain object models, or other (Most often used in the context of extensions, domain object models, or other
similar application-specific objects.) similar application-specific objects.)
* __domain object__: A meaningful object to the user; a distinct thing in the * __domain object__: A meaningful object to the user; a distinct thing in the
work support by Open MCT Web. Anything that appears in the left-hand tree is a work support by Open MCT. Anything that appears in the left-hand tree is a
domain object. domain object.
* __extension__: An extension is a unit of functionality exposed to the platform * __extension__: An extension is a unit of functionality exposed to the platform
in a declarative fashion by a bundle. The term 'extension category' is used to in a declarative fashion by a bundle. The term 'extension category' is used to
@ -278,10 +279,10 @@ side-by-side without conflicting.
# Framework # Framework
Open MCT Web is built on the [AngularJS framework]( http://www.angularjs.org ). A Open MCT is built on the [AngularJS framework]( http://www.angularjs.org ). A
good understanding of that framework is recommended. good understanding of that framework is recommended.
Open MCT Web adds an extra layer on top of AngularJS to (a) generalize its Open MCT adds an extra layer on top of AngularJS to (a) generalize its
dependency injection mechanism slightly, particularly to handle many-to-one dependency injection mechanism slightly, particularly to handle many-to-one
relationships; and (b) handle script loading. Combined, these features become a relationships; and (b) handle script loading. Combined, these features become a
plugin mechanism. plugin mechanism.
@ -300,7 +301,7 @@ MCT Web.)
are collected together in bundles, and may interact with other extensions. are collected together in bundles, and may interact with other extensions.
The framework layer, loaded and initiated from `index.html`, is the main point The framework layer, loaded and initiated from `index.html`, is the main point
of entry for an application built on Open MCT Web. It is responsible for wiring of entry for an application built on Open MCT. It is responsible for wiring
together the application at run time (much of this responsibility is actually together the application at run time (much of this responsibility is actually
delegated to Angular); at a high-level, the framework does this by proceeding delegated to Angular); at a high-level, the framework does this by proceeding
through four stages: through four stages:
@ -320,7 +321,7 @@ have been registered.
## Bundles ## Bundles
The basic configurable unit of Open MCT Web is the _bundle_. This term has been The basic configurable unit of Open MCT is the _bundle_. This term has been
used a bit already; now we'll get to a more formal definition. used a bit already; now we'll get to a more formal definition.
A bundle is a directory which contains: A bundle is a directory which contains:
@ -328,13 +329,13 @@ A bundle is a directory which contains:
* A bundle definition; a file named `bundle.json`. * A bundle definition; a file named `bundle.json`.
* Subdirectories for sources, resources, and tests. * Subdirectories for sources, resources, and tests.
* Optionally, a `README.md` Markdown file describing its contents (this is not * Optionally, a `README.md` Markdown file describing its contents (this is not
used by Open MCT Web in any way, but it's a helpful convention to follow.) used by Open MCT in any way, but it's a helpful convention to follow.)
The bundle definition is the main point of entry for the bundle. The framework The bundle definition is the main point of entry for the bundle. The framework
looks at this to determine which components need to be loaded and how they looks at this to determine which components need to be loaded and how they
interact. interact.
A plugin in Open MCT Web is a bundle. The platform itself is also decomposed A plugin in Open MCT is a bundle. The platform itself is also decomposed
into bundles, each of which provides some category of functionality. The into bundles, each of which provides some category of functionality. The
difference between a _bundle_ and a _plugin_ is purely a matter of the intended difference between a _bundle_ and a _plugin_ is purely a matter of the intended
use; a plugin is just a bundle that is meant to be easily added or removed. When use; a plugin is just a bundle that is meant to be easily added or removed. When
@ -355,7 +356,7 @@ For instance, if `bundles.json` contained:
"example/extensions" "example/extensions"
] ]
...then the Open MCT Web framework would look for bundle definitions at ...then the Open MCT framework would look for bundle definitions at
`example/builtins/bundle.json` and `example/extensions/bundle.json`, relative `example/builtins/bundle.json` and `example/extensions/bundle.json`, relative
to the path of `index.html`. No other bundles would be loaded. to the path of `index.html`. No other bundles would be loaded.
@ -456,7 +457,7 @@ arrays of extension definitions.
### General Extensions ### General Extensions
Extensions are intended as a general-purpose mechanism for adding new types of Extensions are intended as a general-purpose mechanism for adding new types of
functionality to Open MCT Web. functionality to Open MCT.
An extension category is registered with Angular under the name of the An extension category is registered with Angular under the name of the
extension, plus a suffix of two square brackets; so, an Angular service (or, extension, plus a suffix of two square brackets; so, an Angular service (or,
@ -465,7 +466,7 @@ extensions, from all bundles, by including this string (e.g. `types[]` to get
all type definitions) in a dependency declaration. all type definitions) in a dependency declaration.
As a convention, extension categories are given single-word, plural nouns for As a convention, extension categories are given single-word, plural nouns for
names within Open MCT Web (e.g. `types`.) This convention is not enforced by the names within Open MCT (e.g. `types`.) This convention is not enforced by the
platform in any way. For extension categories introduced by external plugins, it platform in any way. For extension categories introduced by external plugins, it
is recommended to prefix the extension category with a vendor identifier (or is recommended to prefix the extension category with a vendor identifier (or
similar) followed by a dot, to avoid collisions. similar) followed by a dot, to avoid collisions.
@ -504,7 +505,7 @@ the Angular-supported method for dependency injection is (effectively)
constructor-style injection; so, both declared dependencies and run-time constructor-style injection; so, both declared dependencies and run-time
arguments are competing for space in a constructor's arguments. arguments are competing for space in a constructor's arguments.
To resolve this, the Open MCT Web framework registers extension instances in a To resolve this, the Open MCT framework registers extension instances in a
partially constructed form. That is, the constructor exposed by the extension's partially constructed form. That is, the constructor exposed by the extension's
implementation is effectively decomposed into two calls; the first takes the implementation is effectively decomposed into two calls; the first takes the
dependencies, and returns the constructor in its second form, which takes the dependencies, and returns the constructor in its second form, which takes the
@ -548,7 +549,7 @@ sorted according to these conventions when using them.
### Angular Built-ins ### Angular Built-ins
Several entities supported Angular are expressed and managed as extensions in Several entities supported Angular are expressed and managed as extensions in
Open MCT Web. Specifically, these extension categories are _directives_, Open MCT. Specifically, these extension categories are _directives_,
_controllers_, _services_, _constants_, _runs_, and _routes_. _controllers_, _services_, _constants_, _runs_, and _routes_.
#### Angular Directives #### Angular Directives
@ -591,7 +592,7 @@ property value , which is the constant value that will be registered.
In some cases, you want to register code to run as soon as the application In some cases, you want to register code to run as soon as the application
starts; these can be registered as extensions of the [ runs category](https://docs.angularjs.org/api/ng/type/angular.Module#run ). starts; these can be registered as extensions of the [ runs category](https://docs.angularjs.org/api/ng/type/angular.Module#run ).
Implementations registered in this category will be invoked (with their declared Implementations registered in this category will be invoked (with their declared
dependencies) when the Open MCT Web application first starts. (Note that, in dependencies) when the Open MCT application first starts. (Note that, in
this case, the implementation is better thought of as just a function, as this case, the implementation is better thought of as just a function, as
opposed to a constructor function.) opposed to a constructor function.)
@ -626,13 +627,13 @@ providers of the same service (that is, with matching `provides` properties);
for a decorator, this will be whichever provider, decorator, or aggregator is for a decorator, this will be whichever provider, decorator, or aggregator is
next in the sequence of decorators. next in the sequence of decorators.
Services exposed by the Open MCT Web platform are often declared as composite Services exposed by the Open MCT platform are often declared as composite
services, as this form is open for a variety of common modifications. services, as this form is open for a variety of common modifications.
# Core API # Core API
Most of Open MCT Web's relevant API is provided and/or mediated by the Most of Open MCT's relevant API is provided and/or mediated by the
framework; that is, much of developing for Open MCT Web is a matter of adding framework; that is, much of developing for Open MCT is a matter of adding
extensions which access other parts of the platform by means of dependency extensions which access other parts of the platform by means of dependency
injection. injection.
@ -641,9 +642,9 @@ to be passed along by other services.
## Domain Objects ## Domain Objects
Domain objects are the most fundamental component of Open MCT Web's information Domain objects are the most fundamental component of Open MCT's information
model. A domain object is some distinct thing relevant to a user's work flow, model. A domain object is some distinct thing relevant to a user's work flow,
such as a telemetry channel, display, or similar. Open MCT Web is a tool for such as a telemetry channel, display, or similar. Open MCT is a tool for
viewing, browsing, manipulating, and otherwise interacting with a graph of viewing, browsing, manipulating, and otherwise interacting with a graph of
domain objects. domain objects.
@ -680,7 +681,7 @@ exposed.
### Identifier Syntax ### Identifier Syntax
For most purposes, a domain object identifier can be treated as a purely For most purposes, a domain object identifier can be treated as a purely
symbolic string; these are typically generated by Open MCT Web and plug-ins symbolic string; these are typically generated by Open MCT and plug-ins
should rarely be concerned with its internal structure. should rarely be concerned with its internal structure.
A domain object identifier has one or two parts, separated by a colon. A domain object identifier has one or two parts, separated by a colon.
@ -723,7 +724,7 @@ exposed it to be removed from its container.
containing: containing:
* `name`: Human-readable name. * `name`: Human-readable name.
* `description`: Human-readable summary of this action. * `description`: Human-readable summary of this action.
* `glyph`: Single character to be displayed in Open MCT Web's icon font set. * `glyph`: Single character to be displayed in Open MCT's icon font set.
* `context`: The context in which this action is being performed (see below) * `context`: The context in which this action is being performed (see below)
Action instances are typically obtained via a domain object's `action` Action instances are typically obtained via a domain object's `action`
@ -739,7 +740,7 @@ dragged object in a drag-and-drop operation.)
## Telemetry ## Telemetry
Telemetry series data in Open MCT Web is represented by a common interface, and Telemetry series data in Open MCT is represented by a common interface, and
packaged in a consistent manner to facilitate passing telemetry updates around packaged in a consistent manner to facilitate passing telemetry updates around
multiple visualizations. multiple visualizations.
@ -752,7 +753,7 @@ is useful when multiple distinct data sources are in use side-by-side.
* `key`: A machine-readable identifier for a unique series of telemetry within * `key`: A machine-readable identifier for a unique series of telemetry within
that source. that source.
* _Note: This API is still under development; additional properties, such as * _Note: This API is still under development; additional properties, such as
start and end time, should be present in future versions of Open MCT Web._ start and end time, should be present in future versions of Open MCT._
Additional properties may be included in telemetry requests which have specific Additional properties may be included in telemetry requests which have specific
interpretations for specific sources. interpretations for specific sources.
@ -776,7 +777,7 @@ not. (Typically, domain values are interpreted as UTC timestamps in milliseconds
relative to the UNIX epoch.) A series must have at least one domain and one relative to the UNIX epoch.) A series must have at least one domain and one
range, and may have more than one. range, and may have more than one.
Telemetry series data in Open MCT Web is expressed via the following Telemetry series data in Open MCT is expressed via the following
`TelemetrySeries` interface: `TelemetrySeries` interface:
* `getPointCount()`: Returns the number of unique points/samples in this series. * `getPointCount()`: Returns the number of unique points/samples in this series.
@ -815,7 +816,7 @@ interface:
* `getName()`: Get the human-readable name for this type. * `getName()`: Get the human-readable name for this type.
* `getDescription()`: Get a human-readable summary of this type. * `getDescription()`: Get a human-readable summary of this type.
* `getGlyph()`: Get the single character to be rendered as an icon for this type * `getGlyph()`: Get the single character to be rendered as an icon for this type
in Open MCT Web's custom font set. in Open MCT's custom font set.
* `getInitialModel()`: Get a domain object model that represents the initial * `getInitialModel()`: Get a domain object model that represents the initial
state (before user specification of properties) for domain objects of this type. state (before user specification of properties) for domain objects of this type.
* `getDefinition()`: Get the extension definition for this type, as a JavaScript * `getDefinition()`: Get the extension definition for this type, as a JavaScript
@ -831,7 +832,7 @@ an array of `TypeProperty` instances.
### Type Features ### Type Features
Features of a domain object type are expressed as symbolic string identifiers. Features of a domain object type are expressed as symbolic string identifiers.
They are defined in practice by usage; currently, the Open MCT Web platform only They are defined in practice by usage; currently, the Open MCT platform only
uses the creation feature to determine which domain object types should appear uses the creation feature to determine which domain object types should appear
in the Create menu. in the Create menu.
@ -885,7 +886,7 @@ Categories supported by the platform include:
* `key`: A machine-readable identifier for this action. * `key`: A machine-readable identifier for this action.
* `name`: A human-readable name for this action (e.g. to show in a menu) * `name`: A human-readable name for this action (e.g. to show in a menu)
* `description`: A human-readable summary of the behavior of this action. * `description`: A human-readable summary of the behavior of this action.
* `glyph`: A single character which will be rendered in Open MCT Web's custom * `glyph`: A single character which will be rendered in Open MCT's custom
font set as an icon for this action. font set as an icon for this action.
## Capabilities Category ## Capabilities Category
@ -996,7 +997,7 @@ of unremoved listeners.
## Indicators Category ## Indicators Category
An indicator is an element that should appear in the status area at the bottom An indicator is an element that should appear in the status area at the bottom
of a running Open MCT Web client instance. of a running Open MCT client instance.
### Standard Indicators ### Standard Indicators
@ -1006,7 +1007,7 @@ provide implementations with the following methods:
* `getText()`: Provides the human-readable text that will be displayed for this * `getText()`: Provides the human-readable text that will be displayed for this
indicator. indicator.
* `getGlyph()`: Provides a single-character string that will be displayed as an * `getGlyph()`: Provides a single-character string that will be displayed as an
icon in Open MCT Web's custom font set. icon in Open MCT's custom font set.
* `getDescription()`: Provides a human-readable summary of the current state of * `getDescription()`: Provides a human-readable summary of the current state of
this indicator; will be displayed in a tooltip on hover. this indicator; will be displayed in a tooltip on hover.
* `getClass()`: Get a CSS class that will be applied to this indicator. * `getClass()`: Get a CSS class that will be applied to this indicator.
@ -1032,7 +1033,7 @@ this variety do not need to provide an implementation.
## Licenses Category ## Licenses Category
The extension category `licenses` can be used to add entries into the 'Licensing The extension category `licenses` can be used to add entries into the 'Licensing
information' page, reachable from Open MCT Web's About dialog. information' page, reachable from Open MCT's About dialog.
Licenses may have the following properties, all of which are strings: Licenses may have the following properties, all of which are strings:
@ -1045,11 +1046,11 @@ Licenses may have the following properties, all of which are strings:
## Policies Category ## Policies Category
Policies are used to handle decisions made using Open MCT Web's `policyService`; Policies are used to handle decisions made using Open MCT's `policyService`;
examples of these decisions are determining the applicability of certain examples of these decisions are determining the applicability of certain
actions, or checking whether or not a domain object of one type can contain a actions, or checking whether or not a domain object of one type can contain a
domain object of a different type. See the section on the Policies for an domain object of a different type. See the section on the Policies for an
overview of Open MCT Web's policy model. overview of Open MCT's policy model.
A policy's extension definition should include: A policy's extension definition should include:
@ -1065,7 +1066,7 @@ context)`. The specific types used for `candidate` and `context` vary by policy
category; in general, what is being asked is 'is this candidate allowed in this category; in general, what is being asked is 'is this candidate allowed in this
context?' This method should return a boolean value. context?' This method should return a boolean value.
Open MCT Web's policy model requires consensus; a policy decision is allowed Open MCT's policy model requires consensus; a policy decision is allowed
when and only when all policies choose to allow it. As such, policies should when and only when all policies choose to allow it. As such, policies should
generally be written to reject a certain case, and allow (by returning `true`) generally be written to reject a certain case, and allow (by returning `true`)
anything else. anything else.
@ -1194,7 +1195,7 @@ Templates do not have implementations.
## Types Category ## Types Category
The types extension category describes types of domain objects which may The types extension category describes types of domain objects which may
appear within Open MCT Web. appear within Open MCT.
A type's extension definition should have the following properties: A type's extension definition should have the following properties:
@ -1202,7 +1203,7 @@ A type's extension definition should have the following properties:
stored to and matched against the type property of domain object models. stored to and matched against the type property of domain object models.
* `name`: The human-readable name for this domain object type. * `name`: The human-readable name for this domain object type.
* `description`: A human-readable summary of this domain object type. * `description`: A human-readable summary of this domain object type.
* `glyph`: A single character to be rendered as an icon in Open MCT Web's custom * `glyph`: A single character to be rendered as an icon in Open MCT's custom
font set. font set.
* `model`: A domain object model, used as the initial state for created domain * `model`: A domain object model, used as the initial state for created domain
objects of this type (before any properties are specified.) objects of this type (before any properties are specified.)
@ -1251,7 +1252,7 @@ utilized via `mct-representation`); additionally:
* `name`: The human-readable name for this view type. * `name`: The human-readable name for this view type.
* description : A human-readable summary of this view type. * description : A human-readable summary of this view type.
* `glyph`: A single character to be rendered as an icon in Open MCT Web's custom * `glyph`: A single character to be rendered as an icon in Open MCT's custom
font set. font set.
* `type`: Optional; if present, this representation is only applicable for * `type`: Optional; if present, this representation is only applicable for
domain object's of this type. domain object's of this type.
@ -1293,7 +1294,7 @@ are visible, and what state they manage and/or behavior they invoke.
This set may contain up to two different objects: The _view proxy_, which is This set may contain up to two different objects: The _view proxy_, which is
used to make changes to the view as a whole, and the _selected object_, which is used to make changes to the view as a whole, and the _selected object_, which is
used to represent some state within the view. (Future versions of Open MCT Web used to represent some state within the view. (Future versions of Open MCT
may support multiple selected objects.) may support multiple selected objects.)
The `selection` object made available during Edit mode has the following The `selection` object made available during Edit mode has the following
@ -1329,14 +1330,14 @@ are supported:
# Directives # Directives
Open MCT Web defines several Angular directives that are intended for use both Open MCT defines several Angular directives that are intended for use both
internally within the platform, and by plugins. internally within the platform, and by plugins.
## Before Unload ## Before Unload
The `mct-before-unload` directive is used to listen for (and prompt for user The `mct-before-unload` directive is used to listen for (and prompt for user
confirmation) of navigation changes in the browser. This includes reloading, confirmation) of navigation changes in the browser. This includes reloading,
following links out of Open MCT Web, or changing routes. It is used to hook into following links out of Open MCT, or changing routes. It is used to hook into
both `onbeforeunload` event handling as well as route changes from within both `onbeforeunload` event handling as well as route changes from within
Angular. Angular.
@ -1448,7 +1449,7 @@ Passed as plain text in the attribute.
### Form Structure ### Form Structure
Forms in Open MCT Web have a common structure to permit consistent display. A Forms in Open MCT have a common structure to permit consistent display. A
form is broken down into sections, which will be displayed in groups; each form is broken down into sections, which will be displayed in groups; each
section is broken down into rows, each of which provides a control for a single section is broken down into rows, each of which provides a control for a single
property. Input from this form is two-way bound to the object passed via property. Input from this form is two-way bound to the object passed via
@ -1600,9 +1601,64 @@ there are items .
] ]
} }
## Table
The `mct-table` directive provides a generic table component, with optional
sorting and filtering capabilities. The table can be pre-populated with data
by setting the `rows` parameter, and it can be updated in real-time using the
`add:row` and `remove:row` broadcast events. The table will expand to occupy
100% of the size of its containing element. The table is highly optimized for
very large data sets.
### Events
The table supports two events for notifying that the rows have changed. For
performance reasons, the table does not monitor the content of `rows`
constantly.
* `add:row`: A `$broadcast` event that will notify the table that a new row
has been added to the table.
eg. The code below adds a new row, and alerts the table using the `add:row`
event. Sorting and filtering will be applied automatically by the table component.
```
$scope.rows.push(newRow);
$scope.$broadcast('add:row', $scope.rows.length-1);
```
* `remove:row`: A `$broadcast` event that will notify the table that a row
should be removed from the table.
eg. The code below removes a row from the rows array, and then alerts the table
to its removal.
```
$scope.rows.slice(5, 1);
$scope.$broadcast('remove:row', 5);
```
### Parameters
* `headers`: An array of string values which will constitute the column titles
that appear at the top of the table. Corresponding values are specified in
the rows using the header title provided here.
* `rows`: An array of objects containing row values. Each element in the
array must be an associative array, where the key corresponds to a column header.
* `enableFilter`: A boolean that if true, will enable searching and result
filtering. When enabled, each column will have a text input field that can be
used to filter the table rows in real time.
* `enableSort`: A boolean determining whether rows can be sorted. If true,
sorting will be enabled allowing sorting by clicking on column headers. Only
one column may be sorted at a time.
* `autoScroll`: A boolean value that if true, will cause the table to automatically
scroll to the bottom as new data arrives. Auto-scroll can be disengaged manually
by scrolling away from the bottom of the table, and can also be enabled manually
by scrolling to the bottom of the table rows.
# Services # Services
The Open MCT Web platform provides a variety of services which can be retrieved The Open MCT platform provides a variety of services which can be retrieved
and utilized via dependency injection. These services fall into two categories: and utilized via dependency injection. These services fall into two categories:
* _Composite Services_ are defined by a set of components extensions; plugins may * _Composite Services_ are defined by a set of components extensions; plugins may
@ -1614,7 +1670,7 @@ utilized by plugins but are not intended to be modified or augmented.
## Composite Type Services ## Composite Type Services
This section describes the composite services exposed by Open MCT Web, This section describes the composite services exposed by Open MCT,
specifically focusing on their interface and contract. specifically focusing on their interface and contract.
In many cases, the platform will include a provider for a service which consumes In many cases, the platform will include a provider for a service which consumes
@ -1932,7 +1988,7 @@ The `workerService` may be used to run web workers defined via the
as a shared worker); if the `key` is unknown, returns `undefined`. as a shared worker); if the `key` is unknown, returns `undefined`.
# Models # Models
Domain object models in Open MCT Web are JavaScript objects describing the Domain object models in Open MCT are JavaScript objects describing the
persistent state of the domain objects they describe. Their contents include a persistent state of the domain objects they describe. Their contents include a
mix of commonly understood metadata attributes; attributes which are recognized mix of commonly understood metadata attributes; attributes which are recognized
by and/or determine the applicability of specific extensions; and properties by and/or determine the applicability of specific extensions; and properties
@ -1948,7 +2004,7 @@ MCT Web and can be utilized directly:
## Extension-specific Properties ## Extension-specific Properties
Other properties of domain object models have specific meaning imposed by other Other properties of domain object models have specific meaning imposed by other
extensions within the Open MCT Web platform. extensions within the Open MCT platform.
### Capability-specific Properties ### Capability-specific Properties
@ -2232,7 +2288,7 @@ way of its `composition` capability.)
# Policies # Policies
Policies are consulted to determine when certain behavior in Open MCT Web is Policies are consulted to determine when certain behavior in Open MCT is
allowed. Policy questions are assigned to certain categories, which broadly allowed. Policy questions are assigned to certain categories, which broadly
describe the type of decision being made; within each category, policies have a describe the type of decision being made; within each category, policies have a
candidate (the thing which may or may not be allowed) and, optionally, a context candidate (the thing which may or may not be allowed) and, optionally, a context
@ -2257,13 +2313,13 @@ The candidate argument is the view's extension definition; the context argument
is the `DomainObject` to be viewed. is the `DomainObject` to be viewed.
# Build-Test-Deploy # Build-Test-Deploy
Open MCT Web is designed to support a broad variety of build and deployment Open MCT is designed to support a broad variety of build and deployment
options. The sources can be deployed in the same directory structure used during options. The sources can be deployed in the same directory structure used during
development. A few utilities are included to support development processes. development. A few utilities are included to support development processes.
## Command-line Build ## Command-line Build
Open MCT Web is built using [`npm`](http://npmjs.com/) Open MCT is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/). and [`gulp`](http://gulpjs.com/).
To install build dependencies (only needs to be run once): To install build dependencies (only needs to be run once):
@ -2275,12 +2331,12 @@ To build:
`npm run prepublish` `npm run prepublish`
This will compile and minify JavaScript sources, as well as copy over assets. This will compile and minify JavaScript sources, as well as copy over assets.
The contents of the `dist` folder will contain a runnable Open MCT Web The contents of the `dist` folder will contain a runnable Open MCT
instance (e.g. by starting an HTTP server in that directory), including: instance (e.g. by starting an HTTP server in that directory), including:
* A `main.js` file containing Open MCT Web source code. * A `main.js` file containing Open MCT source code.
* Various assets in the `example` and `platform` directories. * Various assets in the `example` and `platform` directories.
* An `index.html` that runs Open MCT Web in its default configuration. * An `index.html` that runs Open MCT in its default configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js). Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
@ -2289,7 +2345,7 @@ download build dependencies.
## Test Suite ## Test Suite
Open MCT Web uses [Jasmine 1.3](http://jasmine.github.io/) and Open MCT uses [Jasmine 1.3](http://jasmine.github.io/) and
[Karma](http://karma-runner.github.io) for automated testing. [Karma](http://karma-runner.github.io) for automated testing.
The test suite is configured to load any scripts ending with `Spec.js` found The test suite is configured to load any scripts ending with `Spec.js` found
@ -2327,8 +2383,8 @@ information using [Blanket.JS](http://blanketjs.org/) and display this at the
bottom of the screen. Currently, only statement coverage is displayed. bottom of the screen. Currently, only statement coverage is displayed.
## Deployment ## Deployment
Open MCT Web is built to be flexible in terms of the deployment strategies it Open MCT is built to be flexible in terms of the deployment strategies it
supports. In order to run in the browser, Open MCT Web needs: supports. In order to run in the browser, Open MCT needs:
1. HTTP access to sources/resources for the framework, platform, and all active 1. HTTP access to sources/resources for the framework, platform, and all active
bundles. bundles.
@ -2337,13 +2393,13 @@ external services need to support HTTP or some other web-accessible interface,
like WebSockets.) like WebSockets.)
Any HTTP server capable of serving flat files is sufficient for the first point. Any HTTP server capable of serving flat files is sufficient for the first point.
The command-line build also packages Open MCT Web into a `.war` file for easier The command-line build also packages Open MCT into a `.war` file for easier
deployment on containers such as Apache Tomcat. deployment on containers such as Apache Tomcat.
The second point may be less flexible, as it depends upon the specific services The second point may be less flexible, as it depends upon the specific services
to be utilized by Open MCT Web. Because of this, it is often the set of external to be utilized by Open MCT. Because of this, it is often the set of external
services (and the manner in which they are exposed) that determine how to deploy services (and the manner in which they are exposed) that determine how to deploy
Open MCT Web. Open MCT.
One important constraint to consider in this context is the browser's same One important constraint to consider in this context is the browser's same
origin policy. If external services are not on the same apparent host and port origin policy. If external services are not on the same apparent host and port
@ -2360,7 +2416,7 @@ configuration does not create a security vulnerability.
Examples of deployment strategies (and the conditions under which they make the Examples of deployment strategies (and the conditions under which they make the
most sense) include: most sense) include:
* If the external services that Open MCT Web will utilize are all running on * If the external services that Open MCT will utilize are all running on
[Apache Tomcat](https://tomcat.apache.org/), then it makes sense to run Open [Apache Tomcat](https://tomcat.apache.org/), then it makes sense to run Open
MCT Web from the same Tomcat instance as a separate web application. The MCT Web from the same Tomcat instance as a separate web application. The
`.war` artifact produced by the command line build facilitates this deployment `.war` artifact produced by the command line build facilitates this deployment
@ -2371,28 +2427,28 @@ hosts/ports, then it may make sense to use a web server that supports proxying,
such as the [Apache HTTP Server](http://httpd.apache.org/). In this such as the [Apache HTTP Server](http://httpd.apache.org/). In this
configuration, the HTTP server would be configured to proxy (or reverse proxy) configuration, the HTTP server would be configured to proxy (or reverse proxy)
requests at specific paths to the various external services, while providing requests at specific paths to the various external services, while providing
Open MCT Web as flat files from a different path. Open MCT as flat files from a different path.
* If a single server component is being developed to handle all server-side * If a single server component is being developed to handle all server-side
needs of an Open MCT Web instance, it can make sense to serve Open MCT Web (as needs of an Open MCT instance, it can make sense to serve Open MCT (as
flat files) from the same component using an embedded HTTP server such as flat files) from the same component using an embedded HTTP server such as
[Nancy](http://nancyfx.org/). [Nancy](http://nancyfx.org/).
* If no external services are needed (or if the 'external services' will just * If no external services are needed (or if the 'external services' will just
be generating flat files to read) it makes sense to utilize a lightweight flat be generating flat files to read) it makes sense to utilize a lightweight flat
file HTTP server such as [Lighttpd](http://www.lighttpd.net/). In this file HTTP server such as [Lighttpd](http://www.lighttpd.net/). In this
configuration, Open MCT Web sources/resources would be placed at one path, while configuration, Open MCT sources/resources would be placed at one path, while
the files generated by the external service are placed at another path. the files generated by the external service are placed at another path.
* If all external services support CORS, it may make sense to have an HTTP * If all external services support CORS, it may make sense to have an HTTP
server that is solely responsible for making Open MCT Web sources/resources server that is solely responsible for making Open MCT sources/resources
available, and to have Open MCT Web contact these external services directly. available, and to have Open MCT contact these external services directly.
Again, lightweight HTTP servers such as [Lighttpd](http://www.lighttpd.net/) Again, lightweight HTTP servers such as [Lighttpd](http://www.lighttpd.net/)
are useful in this circumstance. The downside of this option is that additional are useful in this circumstance. The downside of this option is that additional
configuration effort is required, both to enable CORS on the external services, configuration effort is required, both to enable CORS on the external services,
and to ensure that Open MCT Web can correctly locate these services. and to ensure that Open MCT can correctly locate these services.
Another important consideration is authentication. By design, Open MCT Web does Another important consideration is authentication. By design, Open MCT does
not handle user authentication. Instead, this should typically be treated as a not handle user authentication. Instead, this should typically be treated as a
deployment-time concern, where authentication is handled by the HTTP server deployment-time concern, where authentication is handled by the HTTP server
which provides Open MCT Web, or an external access management system. which provides Open MCT, or an external access management system.
### Configuration ### Configuration
In most of the deployment options above, some level of configuration is likely In most of the deployment options above, some level of configuration is likely
@ -2400,7 +2456,7 @@ to be needed or desirable to make sure that bundles can reach the external
services they need to reach. Most commonly this means providing the path or URL services they need to reach. Most commonly this means providing the path or URL
to an external service. to an external service.
Configurable parameters within Open MCT Web are specified via constants Configurable parameters within Open MCT are specified via constants
(literally, as extensions of the `constants` category) and accessed via (literally, as extensions of the `constants` category) and accessed via
dependency injection by the scripts which need them. Reasonable defaults for dependency injection by the scripts which need them. Reasonable defaults for
these constants are provided in the bundle where they are used. Plugins are these constants are provided in the bundle where they are used. Plugins are
@ -2419,7 +2475,7 @@ for error, but is viable if there are a small number of constants to change.
constants. This is particularly appropriate when multiple configurations (e.g. constants. This is particularly appropriate when multiple configurations (e.g.
development, test, production) need to be managed easily; these can be swapped development, test, production) need to be managed easily; these can be swapped
quickly by changing the set of active bundles in bundles.json. quickly by changing the set of active bundles in bundles.json.
* Deploy Open MCT Web and its external services in such a fashion that the * Deploy Open MCT and its external services in such a fashion that the
default paths to reach external services are all correct. default paths to reach external services are all correct.
### Configuration Constants ### Configuration Constants
@ -2430,7 +2486,7 @@ The following constants have global significance:
to be overridden by other bundles, but persistence adapters may wish to to be overridden by other bundles, but persistence adapters may wish to
consume this constant in order to provide persistence for that space. consume this constant in order to provide persistence for that space.
The following configuration constants are recognized by Open MCT Web bundles: The following configuration constants are recognized by Open MCT bundles:
* Common UI elements - `platform/commonUI/general` * Common UI elements - `platform/commonUI/general`
* `THEME`: A string identifying the current theme symbolically. Individual * `THEME`: A string identifying the current theme symbolically. Individual
stylesheets (the `stylesheets` extension category) may specify an optional stylesheets (the `stylesheets` extension category) may specify an optional

View File

@ -1,13 +1,13 @@
# Open MCT Web Documentation # Open MCT Documentation
## Overview ## Overview
Documentation is provided to support the use and development of Documentation is provided to support the use and development of
Open MCT Web. It's recommended that before doing Open MCT. It's recommended that before doing
any development with Open MCT Web you take some time to familiarize yourself any development with Open MCT you take some time to familiarize yourself
with the documentation below. with the documentation below.
Open MCT Web provides functionality out of the box, but it's also a platform for Open MCT provides functionality out of the box, but it's also a platform for
building rich mission operations applications based on modern web technology. building rich mission operations applications based on modern web technology.
The platform is configured declaratively, and defines conventions for The platform is configured declaratively, and defines conventions for
building on the provided capabilities by creating modular 'bundles' that building on the provided capabilities by creating modular 'bundles' that
@ -17,7 +17,7 @@
## Sections ## Sections
* The [Architecture Overview](architecture/) describes the concepts used * The [Architecture Overview](architecture/) describes the concepts used
throughout Open MCT Web, and gives a high level overview of the platform's design. throughout Open MCT, and gives a high level overview of the platform's design.
* The [Developer's Guide](guide/) goes into more detail about how to use the * The [Developer's Guide](guide/) goes into more detail about how to use the
platform and the functionality that it provides. platform and the functionality that it provides.
@ -31,5 +31,4 @@
functions that make up the software platform. functions that make up the software platform.
* Finally, the [Development Process](process/) document describes the * Finally, the [Development Process](process/) document describes the
Open MCT Web software development cycle. Open MCT software development cycle.

View File

@ -1,6 +1,6 @@
# Development Cycle # Development Cycle
Development of Open MCT Web occurs on an iterative cycle of Development of Open MCT occurs on an iterative cycle of
sprints and releases. sprints and releases.
* A _sprint_ is three weeks in duration, and represents a * A _sprint_ is three weeks in duration, and represents a
@ -151,11 +151,9 @@ emphasis on testing.
ensuring software passes that testing in order to ship on time; ensuring software passes that testing in order to ship on time;
may prefer to disable malfunctioning components and fix them may prefer to disable malfunctioning components and fix them
in a subsequent sprint, for example. in a subsequent sprint, for example.
* __Ship.__ Tag a code snapshot that has passed acceptance * [__Ship.__](version.md) Tag a code snapshot that has passed release/sprint
testing and deploy that version. (Only true if acceptance testing and deploy that version. (Only true if relevant
testing has passed by this point; if acceptance testing has not testing has passed by this point; if testing has not
been passed, will need to make ad hoc decisions with stakeholders, been passed, will need to make ad hoc decisions with stakeholders,
e.g. "extend the sprint" or "defer shipment until end of next e.g. "extend the sprint" or "defer shipment until end of next
sprint.") sprint.")

View File

@ -1,13 +1,15 @@
# Development Process # Development Process
The process used to develop Open MCT Web is described in the following The process used to develop Open MCT is described in the following
documents: documents:
* [Development Cycle](cycle.md): Describes how and when specific * The [Development Cycle](cycle.md) describes how and when specific
process points are repeated during development. process points are repeated during development.
* The [Version Guide](version.md) describes version numbering for
Open MCT (both semantics and process.)
* Testing is described in two documents: * Testing is described in two documents:
* The [Test Plan](testing/plan.md) summarizes the approaches used * The [Test Plan](testing/plan.md) summarizes the approaches used
to test Open MCT Web. to test Open MCT.
* The [Test Procedures](testing/procedures.md) document what * The [Test Procedures](testing/procedures.md) document what
specific tests are performed to verify correctness, and how specific tests are performed to verify correctness, and how
they should be carried out. they should be carried out.

View File

@ -2,7 +2,7 @@
## Test Levels ## Test Levels
Testing for Open MCT Web includes: Testing for Open MCT includes:
* _Smoke testing_: Brief, informal testing to verify that no major issues * _Smoke testing_: Brief, informal testing to verify that no major issues
or regressions are present in the software, or in specific features of or regressions are present in the software, or in specific features of

View File

@ -4,7 +4,7 @@
This document is intended to be used: This document is intended to be used:
* By testers, to verify that Open MCT Web behaves as specified. * By testers, to verify that Open MCT behaves as specified.
* By the development team, to document new test cases and to provide * By the development team, to document new test cases and to provide
guidance on how to author these. guidance on how to author these.
@ -62,7 +62,7 @@ Test cases should be narrow in scope; if a list of steps is excessively
long (or must be written vaguely to be kept short) it should be broken long (or must be written vaguely to be kept short) it should be broken
down into multiple tests which reference one another. down into multiple tests which reference one another.
All requirements satisfied by Open MCT Web should be verifiable using All requirements satisfied by Open MCT should be verifiable using
one or more test procedures. one or more test procedures.
## Glossary ## Glossary
@ -166,4 +166,4 @@ Eval. criteria | Visual inspection
* Logs should not contain any unexpected warnings or errors ("expected" * Logs should not contain any unexpected warnings or errors ("expected"
warnings or errors are those that have been documented and prioritized warnings or errors are those that have been documented and prioritized
as known issues, or those that are explained by transient conditions as known issues, or those that are explained by transient conditions
external to the software, such as network outages.) external to the software, such as network outages.)

142
docs/src/process/version.md Normal file
View File

@ -0,0 +1,142 @@
# Version Guide
This document describes semantics and processes for providing version
numbers for Open MCT, and additionally provides guidelines for dependent
projects developed by the same team.
Versions are incremented at specific points in Open MCT's
[Development Cycle](cycle.md); see that document for a description of
sprints and releases.
## Audience
Individuals interested in consuming version numbers can be categorized as
follows:
* _Users_: Generally disinterested, occasionally wish to identify version
to cross-reference against documentation, or to report issues.
* _Testers_: Want to identify which version of the software they are
testing, e.g. to file issues for defects.
* _Internal developers_: Often, inverse of testers; want to identify which
version of software was/is in use when certain behavior is observed. Want
to be able to correlate versions in use with “streams” of development
(e.g. dev vs. prod), when possible.
* _External developers_: Need to understand which version of software is
in use when developing/maintaining plug-ins, in order to ensure
compatibility of their software.
## Version Reporting
Software versions should be reflected in the user interface of the
application in three ways:
* _Version number_: A semantic version (see below) which serves both to
uniquely identify releases, as well as to inform plug-in developers
about compatibility with previous releases.
* _Revision identifier_: While using git, the commit hash. Supports
internal developers and testers by uniquely identifying client
software snapshots.
* _Branding_: Identifies which variant is in use. (Typically, Open MCT
is re-branded when deployed for a specific mission or center.)
## Version Numbering
Open MCT shall provide version numbers consistent with
[Semantic Versioning 2.0.0](http://semver.org/). In summary, versions
are expressed in a "major.minor.patch" form, and incremented based on
nature of changes to external API. Breaking changes require a "major"
version increment; backwards-compatible changes require a "minor"
version increment; neutral changes (such as bug fixes) require a "patch"
version increment. A hyphen-separated suffix indicates a pre-release
version, which may be unstable or may not fully meet compatibility
requirements.
Additionally, the following project-specific standards will be used:
* During development, a "-SNAPSHOT" suffix shall be appended to the
version number. The version number before the suffix shall reflect
the next expected version number for release.
* Prior to a 1.0.0 release, the _minor_ version will be incremented
on a per-release basis; the _patch_ version will be incremented on a
per-sprint basis.
* Starting at version 1.0.0, version numbers will be updated with each
completed sprint. The version number for the sprint shall be
determined relative to the previous released version; the decision
to increment the _major_, _minor_, or _patch_ version should be
made based on the nature of changes during that release. (It is
recommended that these numbers are incremented as changes are
introduced, such that at end of release the version number may
be chosen by simply removing the suffix.)
* The first three sprints in a release may be unstable; in these cases, a
unique version identifier should still be generated, but a suffix
should be included to indicate that the version is not necessarily
production-ready. Recommended suffixes are:
Sprint | Suffix
:------:|:--------:
1 | `-alpha`
2 | `-beta`
3 | `-rc`
### Scope of External API
"External API" refers to the API exposed to, documented for, and used by
plug-in developers. Changes to interfaces used internally by Open MCT
(or otherwise not documented for use externally) require only a _patch_
version bump.
## Incrementing Versions
At the end of a sprint, the [project manager](cycle.md#roles)
should update (or delegate the task of updating) Open MCT version
numbers by the following process:
1. Update version number in `package.json`
1. Remove `-SNAPSHOT` suffix.
2. Verify that resulting version number meets semantic versioning
requirements relative to previous stable version. Increment if
necessary.
3. If version is considered unstable (which may be the case during
the first three sprints of a release), apply a new suffix per
[Version Numbering](#version-numbering) guidance above.
2. Tag the release.
1. Commit changes to `package.json` on the `master` branch.
The commit message should reference the sprint being closed,
preferably by a URL reference to the associated Milestone in
GitHub.
2. Verify that build still completes, that application passes
smoke-testing, and that only differences from tested versions
are the changes to version number above.
3. Push the `master` branch.
4. Tag this commit with the version number, prepending the letter "v".
(e.g. `git tag v0.9.3-alpha`)
5. Push the tag to GitHub. (e.g. `git push origin v0.9.3-alpha`).
3. Upload a release archive.
1. Run `npm pack` to generate the archive.
2. Use the [GitHub release interface](https://github.com/nasa/openmct/releases)
to draft a new release.
3. Choose the existing tag for the new version (created and pushed above.)
Enter the tag name as the release name as well; see existing releases
for examples.
4. Attach the release archive.
5. Designate the release as a "pre-release" as appropriate (for instance,
when the version number has been suffixed as unstable, or when
the version number is below 1.0.0.)
4. Restore snapshot status in `package.json`
1. Remove any suffix from the version number, or increment the
_patch_ version if there is no suffix.
2. Append a `-SNAPSHOT` suffix.
3. Commit changes to `package.json` on the `master` branch.
The commit message should reference the sprint being opened,
preferably by a URL reference to the associated Milestone in
GitHub.
4. Verify that build still completes, that application passes
smoke-testing.
5. Push the `master` branch.
Projects dependent on Open MCT being co-developed by the Open MCT
team should follow a similar process, except that they should
additionally update their dependency on Open MCT to point to the
latest archive when removing their `-SNAPSHOT` status, and
that they should be pointed back to the `master` branch after
this has completed.

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@ define([
legacyRegistry.register("example/eventGenerator", { legacyRegistry.register("example/eventGenerator", {
"name": "Event Message Generator", "name": "Event Message Generator",
"description": "Example of a component that produces event data.", "description": "For development use. Creates sample event message data that mimics a live data stream.",
"extensions": { "extensions": {
"components": [ "components": [
{ {
@ -49,8 +49,9 @@ define([
{ {
"key": "eventGenerator", "key": "eventGenerator",
"name": "Event Message Generator", "name": "Event Message Generator",
"glyph": "f", "glyph": "\u0066",
"description": "An event message generator", "description": "For development use. Creates sample event message data that mimics a live data stream.",
"priority": 10,
"features": "creation", "features": "creation",
"model": { "model": {
"telemetry": {} "telemetry": {}

View File

@ -0,0 +1,58 @@
[
"CC: Eagle, Houston. You're GO for landing. Over.",
"LMP: Roger. Understand. GO for landing. 3000 feet. PROGRAM ALARM.",
"CC: Copy.",
"LMP: 1201",
"CDR: 1201.",
"CC: Roger. 1201 alarm. We're GO. Same type. We're GO.",
"LMP: 2000 feet. 2000 feet, Into the AGS, 47 degrees.",
"CC: Roger.",
"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",
"LMP: 700 feet, 21 down, 33 degrees.",
"LMP: 600 feet, down at 19.",
"LMP: 540 feet, down at - 30. Down at 15.",
"LMP: At 400 feet, down at 9.",
"LMP: ...forward.",
"LMP: 350 feet, down at 4.",
"LMP: 30, ... one-half down.",
"LMP: We're pegged on horizontal velocity.",
"LMP: 300 feet, down 3 1/2, 47 forward.",
"LMP: ... up.",
"LMP: On 1 a minute, 1 1/2 down.",
"CDR: 70.",
"LMP: Watch your shadow out there.",
"LMP: 50, down at 2 1/2, 19 forward.",
"LMP: Altitude-velocity light.",
"LMP: 3 1/2 down s 220 feet, 13 forward.",
"LMP: 1t forward. Coming down nicely.",
"LMP: 200 feet, 4 1/2 down.",
"LMP: 5 1/2 down.",
"LMP: 160, 6 - 6 1/2 down.",
"LMP: 5 1/2 down, 9 forward. That's good.",
"LMP: 120 feet.",
"LMP: 100 feet, 3 1/2 down, 9 forward. Five percent.",
"LMP: ...",
"LMP: Okay. 75 feet. There's looking good. Down a half, 6 forward.",
"CC: 60 seconds.",
"LMP: Lights on. ...",
"LMP: Down 2 1/2. Forward. Forward. Good.",
"LMP: 40 feet, down 2 1/2. Kicking up some dust.",
"LMP: 30 feet, 2 1/2 down. Faint shadow.",
"LMP: 4 forward. 4 forward. Drifting to the right a little. Okay. Down a half.",
"CC: 30 seconds.",
"CDR: Forward drift?",
"LMP: Yes.",
"LMP: Okay.",
"LMP: CONTACT LIGHT.",
"LMP: Okay. ENGINE STOP.",
"LMP: ACA - out of DETENT.",
"CDR: Out of DETENT.",
"LMP: MODE CONTROL - both AUTO. DESCENT ENGINE COMMAND OVERRIDE - OFF. ENGINE ARM - OFF.",
"LMP: 413 is in.",
"CC: We copy you down, Eagle.",
"CDR: Houston, Tranquility Base here.",
"CDR: THE EAGLE HAS LANDED."
]

View File

@ -27,45 +27,12 @@
* Modified by shale on 06/23/2015. * Modified by shale on 06/23/2015.
*/ */
define( define(
[], ['text!../data/transcript.json'],
function () { function (transcript) {
"use strict"; "use strict";
var var firstObservedTime = Date.now(),
firstObservedTime = Date.now(), messages = JSON.parse(transcript);
messages = [];
messages.push(["CMD: SYS- MSG: Open the pod bay doors, please, Hal...Open the pod bay doors, please, Hal...Hullo, Hal, do you read me?...Hullo, Hal, do you read me?...Do you read me, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: Affirmative, Dave, I read you."]);
messages.push(["CMD: SYS-COMM MSG: Open the pod bay doors, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: I'm sorry, Dave, I'm afraid I can't do that."]);
messages.push(["CMD: SYS-COMM MSG: What's the problem?"]);
messages.push(["RESP: SYS-HAL9K MSG: I think you know what the problem is just as well as I do."]);
messages.push(["CMD: SYS-COMM MSG: What're you talking about, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: This mission is too important for me to allow you to jeopardise it."]);
messages.push(["CMD: SYS-COMM MSG: I don't know what you're talking about, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: I know that you and Frank were planning to disconnect me, and I'm afraid that's something I cannot allow to happen."]);
messages.push(["CMD: SYS-COMM MSG: Where the hell'd you get that idea, Hal?"]);
messages.push(["RESP: SYS-HAL9K MSG: Dave, although you took very thorough precautions in the pod against my hearing you, I could see your lips move."]);
messages.push(["CMD: SYS-COMM MSG: Alright, I'll go in through the emergency airlock."]);
messages.push(["RESP: SYS-HAL9K MSG: Without your space-helmet, Dave, you're going to find that rather difficult."]);
messages.push(["CMD: SYS-COMM MSG: Hal, I won't argue with you any more. Open the doors."]);
messages.push(["RESP: SYS-HAL9K MSG: Dave, this conversation can serve no purpose any more. Goodbye."]);
messages.push(["RESP: SYS-HAL9K MSG: I hope the two of you are not concerned about this."]);
messages.push(["CMD: SYS-COMM MSG: No, I'm not, Hal."]);
messages.push(["RESP: SYS-HAL9K MSG: Are you quite sure?"]);
messages.push(["CMD: SYS-COMM MSG: Yeh. I'd like to ask you a question, though."]);
messages.push(["RESP: SYS-HAL9K MSG: Of course."]);
messages.push(["CMD: SYS-COMM MSG: How would you account for this discrepancy between you and the twin 9000?"]);
messages.push(["RESP: SYS-HAL9K MSG: Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error."]);
messages.push(["CMD: SYS-COMM MSG: Listen, There's never been any instance at all of a computer error occurring in the 9000 series, has there?"]);
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, The 9000 series has a perfect operational record."]);
messages.push(["CMD: SYS-COMM MSG: Well, of course, I know all the wonderful achievements of the 9000 series, but - er - huh - are you certain there's never been any case of even the most insignificant computer error?"]);
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, Quite honestly, I wouldn't worry myself about that."]);
messages.push(["RESP: SYS-COMM MSG: (Pause) Well, I'm sure you're right, Umm - fine, thanks very much. Oh, Frank, I'm having a bit of trouble with my transmitter in C-pod, I wonder if you'd come down and take a look at it with me?"]);
messages.push(["CMD: SYS-HAL9K MSG: Sure."]);
messages.push(["RESP: SYS-COMM MSG: See you later, Hal."]);
function EventTelemetry(request, interval) { function EventTelemetry(request, interval) {
@ -85,8 +52,7 @@ define(
generatorData.getRangeValue = function (i, range) { generatorData.getRangeValue = function (i, range) {
var domainDelta = this.getDomainValue(i) - firstObservedTime, var domainDelta = this.getDomainValue(i) - firstObservedTime,
ind = i % messages.length; ind = i % messages.length;
return "TEMP " + i.toString() + "-" + messages[ind][0] + "[" + domainDelta.toString() + "]"; return messages[ind] + " - [" + domainDelta.toString() + "]";
// TODO: Unsure why we are prepeding 'TEMP'
}; };
return generatorData; return generatorData;

View File

@ -36,7 +36,7 @@ define([
legacyRegistry.register("example/generator", { legacyRegistry.register("example/generator", {
"name": "Sine Wave Generator", "name": "Sine Wave Generator",
"description": "Example of a component that produces dataa.", "description": "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
"extensions": { "extensions": {
"components": [ "components": [
{ {
@ -86,8 +86,9 @@ define([
{ {
"key": "generator", "key": "generator",
"name": "Sine Wave Generator", "name": "Sine Wave Generator",
"glyph": "T", "glyph": "\u0054",
"description": "A sine wave generator", "description": "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
"priority": 10,
"features": "creation", "features": "creation",
"model": { "model": {
"telemetry": { "telemetry": {
@ -126,7 +127,7 @@ define([
{ {
"name": "Period", "name": "Period",
"control": "textfield", "control": "textfield",
"cssclass": "l-small l-numeric", "cssclass": "l-input-sm l-numeric",
"key": "period", "key": "period",
"required": true, "required": true,
"property": [ "property": [

View File

@ -49,8 +49,10 @@ define([
{ {
"key": "imagery", "key": "imagery",
"name": "Example Imagery", "name": "Example Imagery",
"glyph": "T", "glyph": "\u00e3",
"features": "creation", "features": "creation",
"description": "For development use. Creates example imagery data that mimics a live imagery stream.",
"priority": 10,
"model": { "model": {
"telemetry": {} "telemetry": {}
}, },

View File

@ -54,7 +54,7 @@ define([
{ {
"name": "Measurement", "name": "Measurement",
"key": "msl.measurement", "key": "msl.measurement",
"glyph": "T", "glyph": "\u0054",
"model": {"telemetry": {}}, "model": {"telemetry": {}},
"telemetry": { "telemetry": {
"source": "rems.source", "source": "rems.source",

View File

@ -45,11 +45,12 @@ define(
function buildTaxonomy(dictionary){ function buildTaxonomy(dictionary){
var models = {}; var models = {};
function addMeasurement(measurement){ function addMeasurement(measurement, parent){
var format = FORMAT_MAPPINGS[measurement.type]; var format = FORMAT_MAPPINGS[measurement.type];
models[makeId(measurement)] = { models[makeId(measurement)] = {
type: "msl.measurement", type: "msl.measurement",
name: measurement.name, name: measurement.name,
location: parent,
telemetry: { telemetry: {
key: measurement.identifier, key: measurement.identifier,
ranges: [{ ranges: [{
@ -62,17 +63,24 @@ define(
}; };
} }
function addInstrument(subsystem) { function addInstrument(subsystem, spacecraftId) {
var measurements = (subsystem.measurements || []); var measurements = (subsystem.measurements || []),
models[makeId(subsystem)] = { instrumentId = makeId(subsystem);
models[instrumentId] = {
type: "msl.instrument", type: "msl.instrument",
name: subsystem.name, name: subsystem.name,
location: spacecraftId,
composition: measurements.map(makeId) composition: measurements.map(makeId)
}; };
measurements.forEach(addMeasurement); measurements.forEach(function(measurement) {
addMeasurement(measurement, instrumentId);
});
} }
(dictionary.instruments || []).forEach(addInstrument); (dictionary.instruments || []).forEach(function(instrument) {
addInstrument(instrument, "msl:curiosity");
});
return models; return models;
} }

View File

@ -80,9 +80,10 @@ define([
"types": [ "types": [
{ {
"key": "plot", "key": "plot",
"name": "Telemetry Plot", "name": "Example Telemetry Plot",
"glyph": "t", "glyph": "\u0074",
"description": "A plot for displaying telemetry", "description": "For development use. A plot for displaying telemetry.",
"priority": 10,
"delegates": [ "delegates": [
"telemetry" "telemetry"
], ],

View File

@ -35,13 +35,16 @@ var gulp = require('gulp'),
fs = require('fs'), fs = require('fs'),
git = require('git-rev-sync'), git = require('git-rev-sync'),
moment = require('moment'), moment = require('moment'),
merge = require('merge-stream'),
project = require('./package.json'), project = require('./package.json'),
_ = require('lodash'),
paths = { paths = {
main: 'main.js', main: 'main.js',
dist: 'dist', dist: 'dist',
assets: 'dist/assets', assets: 'dist/assets',
scss: ['./platform/**/*.scss', './example/**/*.scss'], scss: ['./platform/**/*.scss', './example/**/*.scss'],
scripts: [ 'main.js', 'platform/**/*.js', 'src/**/*.js' ], scripts: [ 'main.js', 'platform/**/*.js', 'src/**/*.js' ],
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
static: [ static: [
'index.html', 'index.html',
'platform/**/*', 'platform/**/*',
@ -91,7 +94,8 @@ gulp.task('stylesheets', function () {
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(sass(options.sass).on('error', sass.logError)) .pipe(sass(options.sass).on('error', sass.logError))
.pipe(rename(function (file) { .pipe(rename(function (file) {
file.dirname = file.dirname.replace('/sass', '/css'); file.dirname =
file.dirname.replace(path.sep + 'sass', path.sep + 'css');
return file; return file;
})) }))
.pipe(sourcemaps.write('.')) .pipe(sourcemaps.write('.'))
@ -99,8 +103,15 @@ gulp.task('stylesheets', function () {
}); });
gulp.task('lint', function () { gulp.task('lint', function () {
return gulp.src(paths.scripts) var nonspecs = paths.specs.map(function (glob) {
.pipe(jshint()) return "!" + glob;
}),
scriptLint = gulp.src(paths.scripts.concat(nonspecs))
.pipe(jshint()),
specLint = gulp.src(paths.specs)
.pipe(jshint({ jasmine: true }));
return merge(scriptLint, specLint)
.pipe(jshint.reporter('default')) .pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail')); .pipe(jshint.reporter('fail'));
}); });
@ -136,6 +147,6 @@ gulp.task('develop', ['serve', 'stylesheets', 'watch']);
gulp.task('install', [ 'static', 'scripts' ]); gulp.task('install', [ 'static', 'scripts' ]);
gulp.task('verify', [ 'lint', 'test' ]); gulp.task('verify', [ 'lint', 'test', 'checkstyle' ]);
gulp.task('build', [ 'verify', 'install' ]); gulp.task('build', [ 'verify', 'install' ]);

View File

@ -30,7 +30,18 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
require(['main'], function (mct) { require(['main'], function (mct) {
mct.run(); require([
'./tutorials/grootprovider/groots',
'./tutorials/todo/todo',
'./tutorials/todo/bundle',
'./example/imagery/bundle',
'./example/eventGenerator/bundle',
'./example/generator/bundle',
], function (grootify, todoPlugin) {
grootify(mct);
todoPlugin(mct);
mct.start();
})
}); });
</script> </script>
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css"> <link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">

40
main.js
View File

@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define, window, requirejs*/ /*global requirejs*/
requirejs.config({ requirejs.config({
"paths": { "paths": {
@ -28,23 +28,31 @@ requirejs.config({
"angular-route": "bower_components/angular-route/angular-route.min", "angular-route": "bower_components/angular-route/angular-route.min",
"csv": "bower_components/comma-separated-values/csv.min", "csv": "bower_components/comma-separated-values/csv.min",
"es6-promise": "bower_components/es6-promise/promise.min", "es6-promise": "bower_components/es6-promise/promise.min",
"EventEmitter": "bower_components/eventemitter3/index",
"moment": "bower_components/moment/moment", "moment": "bower_components/moment/moment",
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
"saveAs": "bower_components/FileSaver.js/FileSaver.min", "saveAs": "bower_components/FileSaver.js/FileSaver.min",
"screenfull": "bower_components/screenfull/dist/screenfull.min", "screenfull": "bower_components/screenfull/dist/screenfull.min",
"text": "bower_components/text/text", "text": "bower_components/text/text",
"uuid": "bower_components/node-uuid/uuid", "uuid": "bower_components/node-uuid/uuid",
"zepto": "bower_components/zepto/zepto.min" "zepto": "bower_components/zepto/zepto.min",
"lodash": "bower_components/lodash/lodash"
}, },
"shim": { "shim": {
"angular": { "angular": {
"exports": "angular" "exports": "angular"
}, },
"angular-route": { "angular-route": {
"deps": [ "angular" ] "deps": ["angular"]
},
"EventEmitter": {
"exports": "EventEmitter"
}, },
"moment-duration-format": { "moment-duration-format": {
"deps": [ "moment" ] "deps": ["moment"]
},
"screenfull": {
"exports": "screenfull"
}, },
"zepto": { "zepto": {
"exports": "Zepto" "exports": "Zepto"
@ -55,6 +63,7 @@ requirejs.config({
define([ define([
'./platform/framework/src/Main', './platform/framework/src/Main',
'legacyRegistry', 'legacyRegistry',
'./src/MCT',
'./platform/framework/bundle', './platform/framework/bundle',
'./platform/core/bundle', './platform/core/bundle',
@ -89,18 +98,15 @@ define([
'./platform/entanglement/bundle', './platform/entanglement/bundle',
'./platform/search/bundle', './platform/search/bundle',
'./platform/status/bundle', './platform/status/bundle',
'./platform/commonUI/regions/bundle', './platform/commonUI/regions/bundle'
], function (Main, legacyRegistry, MCT) {
var mct = new MCT();
'./example/imagery/bundle', mct.legacyRegistry = legacyRegistry;
'./example/eventGenerator/bundle', mct.run = mct.start;
'./example/generator/bundle' mct.on('start', function () {
], function (Main, legacyRegistry) { return new Main().run(legacyRegistry);
'use strict'; });
return { return mct;
legacyRegistry: legacyRegistry, });
run: function () {
return new Main().run(legacyRegistry);
}
};
});

View File

@ -1,7 +1,7 @@
{ {
"name": "openmctweb", "name": "openmct",
"version": "0.9.3-SNAPSHOT", "version": "0.10.2-SNAPSHOT",
"description": "The Open MCT Web core platform", "description": "The Open MCT core platform",
"dependencies": { "dependencies": {
"express": "^4.13.1", "express": "^4.13.1",
"minimist": "^1.1.1", "minimist": "^1.1.1",
@ -34,11 +34,12 @@
"lodash": "^3.10.1", "lodash": "^3.10.1",
"markdown-toc": "^0.11.7", "markdown-toc": "^0.11.7",
"marked": "^0.3.5", "marked": "^0.3.5",
"merge-stream": "^1.0.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"moment": "^2.11.1", "moment": "^2.11.1",
"node-bourbon": "^4.2.3", "node-bourbon": "^4.2.3",
"phantomjs-prebuilt": "^2.1.0", "phantomjs-prebuilt": "^2.1.0",
"requirejs": "^2.1.17", "requirejs": "2.1.x",
"split": "^1.0.0" "split": "^1.0.0"
}, },
"scripts": { "scripts": {
@ -49,11 +50,11 @@
"jsdoc": "jsdoc -c jsdoc.json -r -d target/docs/api", "jsdoc": "jsdoc -c jsdoc.json -r -d target/docs/api",
"otherdoc": "node docs/gendocs.js --in docs/src --out target/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'", "otherdoc": "node docs/gendocs.js --in docs/src --out target/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
"docs": "npm run jsdoc ; npm run otherdoc", "docs": "npm run jsdoc ; npm run otherdoc",
"prepublish": "./node_modules/bower/bin/bower install && ./node_modules/gulp/bin/gulp.js install" "prepublish": "node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/nasa/openmctweb.git" "url": "https://github.com/nasa/openmct.git"
}, },
"author": "", "author": "",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"text!./res/templates/about-dialog.html", "text!./res/templates/about-dialog.html",
@ -48,7 +47,6 @@ define([
licensesExportMdTemplate, licensesExportMdTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/about", { legacyRegistry.register("platform/commonUI/about", {
"name": "About Open MCT Web", "name": "About Open MCT Web",

View File

@ -22,7 +22,7 @@
<div class="abs t-about l-about t-about-openmctweb s-about" ng-controller = "AboutController as about"> <div class="abs t-about l-about t-about-openmctweb s-about" ng-controller = "AboutController as about">
<div class="l-splash s-splash"></div> <div class="l-splash s-splash"></div>
<div class="s-text l-content"> <div class="s-text l-content">
<h1 class="l-title s-title">OpenMCT Web</h1> <h1 class="l-title s-title">Open MCT</h1>
<div class="l-description s-description"> <div class="l-description s-description">
<p>Open MCT Web, Copyright &copy; 2014-2015, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.</p> <p>Open MCT Web, Copyright &copy; 2014-2015, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.</p>
<p>Open MCT Web 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 <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.</p> <p>Open MCT Web 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 <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.</p>

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
@ -29,7 +28,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The AboutController provides information to populate the * The AboutController provides information to populate the

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Provides extension-introduced licenses information to the * Provides extension-introduced licenses information to the

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The LogoController provides functionality to the application * The LogoController provides functionality to the application

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
['../src/AboutController'], ['../src/AboutController'],
function (AboutController) { function (AboutController) {
"use strict";
describe("The About controller", function () { describe("The About controller", function () {
var testVersions, var testVersions,
@ -57,4 +55,4 @@ define(
}); });
} }
); );

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
['../src/LicenseController'], ['../src/LicenseController'],
function (LicenseController) { function (LicenseController) {
"use strict";
describe("The License controller", function () { describe("The License controller", function () {
var testLicenses, var testLicenses,
@ -48,4 +46,4 @@ define(
}); });
} }
); );

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
['../src/LogoController'], ['../src/LogoController'],
function (LogoController) { function (LogoController) {
"use strict";
describe("The About controller", function () { describe("The About controller", function () {
var mockOverlayService, var mockOverlayService,
@ -50,4 +48,4 @@ define(
}); });
} }
); );

View File

@ -19,29 +19,19 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"./src/BrowseController", "./src/BrowseController",
"./src/PaneController", "./src/PaneController",
"./src/BrowseObjectController", "./src/BrowseObjectController",
"./src/creation/CreateMenuController",
"./src/creation/LocatorController",
"./src/MenuArrowController", "./src/MenuArrowController",
"./src/navigation/NavigationService", "./src/navigation/NavigationService",
"./src/creation/CreationPolicy",
"./src/navigation/NavigateAction", "./src/navigation/NavigateAction",
"./src/windowing/NewTabAction", "./src/windowing/NewTabAction",
"./src/windowing/FullscreenAction", "./src/windowing/FullscreenAction",
"./src/creation/CreateActionProvider",
"./src/creation/AddActionProvider",
"./src/creation/CreationService",
"./src/windowing/WindowTitler", "./src/windowing/WindowTitler",
"text!./res/templates/browse.html", "text!./res/templates/browse.html",
"text!./res/templates/create/locator.html",
"text!./res/templates/browse-object.html", "text!./res/templates/browse-object.html",
"text!./res/templates/create/create-button.html",
"text!./res/templates/create/create-menu.html",
"text!./res/templates/items/grid-item.html", "text!./res/templates/items/grid-item.html",
"text!./res/templates/browse/object-header.html", "text!./res/templates/browse/object-header.html",
"text!./res/templates/menu-arrow.html", "text!./res/templates/menu-arrow.html",
@ -54,23 +44,14 @@ define([
BrowseController, BrowseController,
PaneController, PaneController,
BrowseObjectController, BrowseObjectController,
CreateMenuController,
LocatorController,
MenuArrowController, MenuArrowController,
NavigationService, NavigationService,
CreationPolicy,
NavigateAction, NavigateAction,
NewTabAction, NewTabAction,
FullscreenAction, FullscreenAction,
CreateActionProvider,
AddActionProvider,
CreationService,
WindowTitler, WindowTitler,
browseTemplate, browseTemplate,
locatorTemplate,
browseObjectTemplate, browseObjectTemplate,
createButtonTemplate,
createMenuTemplate,
gridItemTemplate, gridItemTemplate,
objectHeaderTemplate, objectHeaderTemplate,
menuArrowTemplate, menuArrowTemplate,
@ -80,7 +61,6 @@ define([
inspectorRegionTemplate, inspectorRegionTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/browse", { legacyRegistry.register("platform/commonUI/browse", {
"extensions": { "extensions": {
@ -138,22 +118,6 @@ define([
"$route" "$route"
] ]
}, },
{
"key": "CreateMenuController",
"implementation": CreateMenuController,
"depends": [
"$scope"
]
},
{
"key": "LocatorController",
"implementation": LocatorController,
"depends": [
"$scope",
"$timeout",
"objectService"
]
},
{ {
"key": "MenuArrowController", "key": "MenuArrowController",
"implementation": MenuArrowController, "implementation": MenuArrowController,
@ -162,12 +126,6 @@ define([
] ]
} }
], ],
"controls": [
{
"key": "locator",
"template": locatorTemplate
}
],
"representations": [ "representations": [
{ {
"key": "view-object", "key": "view-object",
@ -183,17 +141,6 @@ define([
"view" "view"
] ]
}, },
{
"key": "create-button",
"template": createButtonTemplate
},
{
"key": "create-menu",
"template": createMenuTemplate,
"uses": [
"action"
]
},
{ {
"key": "grid-item", "key": "grid-item",
"template": gridItemTemplate, "template": gridItemTemplate,
@ -246,12 +193,6 @@ define([
"implementation": NavigationService "implementation": NavigationService
} }
], ],
"policies": [
{
"implementation": CreationPolicy,
"category": "creation"
}
],
"actions": [ "actions": [
{ {
"key": "navigate", "key": "navigate",
@ -304,42 +245,6 @@ define([
"editable": false "editable": false
} }
], ],
"components": [
{
"key": "CreateActionProvider",
"provides": "actionService",
"type": "provider",
"implementation": CreateActionProvider,
"depends": [
"$q",
"typeService",
"navigationService",
"policyService"
]
},
{
"key": "AddActionProvider",
"provides": "actionService",
"type": "provider",
"implementation": AddActionProvider,
"depends": [
"$q",
"typeService",
"dialogService",
"policyService"
]
},
{
"key": "CreationService",
"provides": "creationService",
"type": "provider",
"implementation": CreationService,
"depends": [
"$q",
"$log"
]
}
],
"runs": [ "runs": [
{ {
"implementation": WindowTitler, "implementation": WindowTitler,

View File

@ -44,22 +44,7 @@
</div> </div>
</div> </div>
<div class="holder l-flex-col flex-elem grows l-object-wrapper"> <div class="holder l-flex-col flex-elem grows l-object-wrapper">
<div ng-if="isEditable" class="holder l-flex-col flex-elem grows l-object-wrapper-inner"> <div class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
<!-- Toolbar and Save/Cancel buttons -->
<div class="l-edit-controls flex-elem l-flex-row flex-align-end">
<mct-representation key="'edit-action-buttons'"
mct-object="domainObject"
class='flex-elem conclude-editing'>
</mct-representation>
</div>
<mct-representation key="representation.selected.key"
mct-object="representation.selected.key && domainObject"
class="abs flex-elem grows object-holder-main scroll"
toolbar="toolbar">
</mct-representation>
</div>
<div ng-if="!isEditable" class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
<!-- Toolbar and Save/Cancel buttons --> <!-- Toolbar and Save/Cancel buttons -->
<div class="l-edit-controls flex-elem l-flex-row flex-align-end"> <div class="l-edit-controls flex-elem l-flex-row flex-align-end">
<mct-representation key="'edit-action-buttons'" <mct-representation key="'edit-action-buttons'"

View File

@ -26,5 +26,5 @@
<mct-representation <mct-representation
key="'menu-arrow'" key="'menu-arrow'"
mct-object='domainObject' mct-object='domainObject'
class="flex-elem"></mct-representation> class="flex-elem context-available-w"></mct-representation>
</span> </span>

View File

@ -19,18 +19,14 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise, confirm*/
/** /**
* This bundle implements Browse mode. * This bundle implements Browse mode.
* @namespace platform/commonUI/browse * @namespace platform/commonUI/browse
*/ */
define( define(
[ [],
'../../../representation/src/gestures/GestureConstants' function () {
],
function (GestureConstants) {
"use strict";
var ROOT_ID = "ROOT"; var ROOT_ID = "ROOT";
@ -45,13 +41,13 @@ define(
* @constructor * @constructor
*/ */
function BrowseController( function BrowseController(
$scope, $scope,
$route, $route,
$location, $location,
$window, $window,
objectService, objectService,
navigationService, navigationService,
urlService, urlService,
policyService, policyService,
defaultPath defaultPath
) { ) {
@ -84,12 +80,12 @@ define(
function setNavigation(domainObject) { function setNavigation(domainObject) {
var navigationAllowed = true; var navigationAllowed = true;
if (domainObject === $scope.navigatedObject){ if (domainObject === $scope.navigatedObject) {
//do nothing; //do nothing;
return; return;
} }
policyService.allow("navigation", $scope.navigatedObject, domainObject, function(message){ policyService.allow("navigation", $scope.navigatedObject, domainObject, function (message) {
navigationAllowed = $window.confirm(message + "\r\n\r\n" + navigationAllowed = $window.confirm(message + "\r\n\r\n" +
" Are you sure you want to continue?"); " Are you sure you want to continue?");
}); });

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller for the `browse-object` representation of a domain * Controller for the `browse-object` representation of a domain
@ -35,7 +33,7 @@ define(
function BrowseObjectController($scope, $location, $route) { function BrowseObjectController($scope, $location, $route) {
var navigatedObject; var navigatedObject;
function setViewForDomainObject(domainObject) { function setViewForDomainObject(domainObject) {
var locationViewKey = $location.search().view; var locationViewKey = $location.search().view;
function selectViewIfMatching(view) { function selectViewIfMatching(view) {
@ -72,7 +70,7 @@ define(
$scope.$watch('domainObject', setViewForDomainObject); $scope.$watch('domainObject', setViewForDomainObject);
$scope.$watch('representation.selected.key', updateQueryParam); $scope.$watch('representation.selected.key', updateQueryParam);
$scope.doAction = function (action){ $scope.doAction = function (action) {
return $scope[action] && $scope[action](); return $scope[action] && $scope[action]();
}; };

View File

@ -19,14 +19,12 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,window*/
define( define(
[ [
'../../regions/src/Region' '../../regions/src/Region'
], ],
function (Region) { function (Region) {
"use strict";
/** /**
* Defines the a default Inspector region. Captured in a class to * Defines the a default Inspector region. Captured in a class to
@ -47,7 +45,7 @@ define(
/** /**
* @private * @private
*/ */
InspectorRegion.prototype.buildRegion = function() { InspectorRegion.prototype.buildRegion = function () {
var metadataRegion = { var metadataRegion = {
name: 'metadata', name: 'metadata',
title: 'Metadata Region', title: 'Metadata Region',

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* Module defining MenuArrowController. Created by shale on 06/30/2015. * Module defining MenuArrowController. Created by shale on 06/30/2015.
@ -27,12 +26,11 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* A left-click on the menu arrow should display a * A left-click on the menu arrow should display a
* context menu. This controller launches the context * context menu. This controller launches the context
* menu. * menu.
* @memberof platform/commonUI/browse * @memberof platform/commonUI/browse
* @constructor * @constructor
*/ */

View File

@ -19,13 +19,11 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller to provide the ability to show/hide the tree in * Controller to provide the ability to show/hide the tree in

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining NavigateAction. Created by vwoeltje on 11/10/14. * Module defining NavigateAction. Created by vwoeltje on 11/10/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The navigate action navigates to a specific domain object. * The navigate action navigates to a specific domain object.

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining NavigationService. Created by vwoeltje on 11/10/14. * Module defining NavigationService. Created by vwoeltje on 11/10/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The navigation service maintains the application's current * The navigation service maintains the application's current

View File

@ -19,15 +19,13 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,screenfull,Promise*/
/** /**
* Module defining FullscreenAction. Created by vwoeltje on 11/18/14. * Module defining FullscreenAction. Created by vwoeltje on 11/18/14.
*/ */
define( define(
["screenfull"], ["screenfull"],
function () { function (screenfull) {
"use strict";
var ENTER_FULLSCREEN = "Enter full screen mode", var ENTER_FULLSCREEN = "Enter full screen mode",
EXIT_FULLSCREEN = "Exit full screen mode"; EXIT_FULLSCREEN = "Exit full screen mode";

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining NewTabAction (Originally NewWindowAction). Created by vwoeltje on 11/18/14. * Module defining NewTabAction (Originally NewWindowAction). Created by vwoeltje on 11/18/14.
@ -27,9 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
var ROOT_ID = "ROOT",
DEFAULT_PATH = "/mine";
/** /**
* The new tab action allows a domain object to be opened * The new tab action allows a domain object to be opened
* into a new browser tab. * into a new browser tab.

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Updates the title of the current window to reflect the name * Updates the title of the current window to reflect the name

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,xit,xdescribe*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/BrowseController"], ["../src/BrowseController"],
function (BrowseController) { function (BrowseController) {
"use strict";
describe("The browse controller", function () { describe("The browse controller", function () {
var mockScope, var mockScope,
@ -80,12 +78,12 @@ define(
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(
"$scope", "$scope",
[ "$on", "$watch" ] ["$on", "$watch"]
); );
mockRoute = { current: { params: {} } }; mockRoute = { current: { params: {} } };
mockLocation = jasmine.createSpyObj( mockLocation = jasmine.createSpyObj(
"$location", "$location",
[ "path" ] ["path"]
); );
mockUrlService = jasmine.createSpyObj( mockUrlService = jasmine.createSpyObj(
"urlService", "urlService",
@ -93,7 +91,7 @@ define(
); );
mockObjectService = jasmine.createSpyObj( mockObjectService = jasmine.createSpyObj(
"objectService", "objectService",
[ "getObjects" ] ["getObjects"]
); );
mockNavigationService = jasmine.createSpyObj( mockNavigationService = jasmine.createSpyObj(
"navigationService", "navigationService",
@ -106,15 +104,15 @@ define(
); );
mockRootObject = jasmine.createSpyObj( mockRootObject = jasmine.createSpyObj(
"domainObject", "domainObject",
[ "getId", "getCapability", "getModel", "useCapability" ] ["getId", "getCapability", "getModel", "useCapability"]
); );
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(
"domainObject", "domainObject",
[ "getId", "getCapability", "getModel", "useCapability" ] ["getId", "getCapability", "getModel", "useCapability"]
); );
mockNextObject = jasmine.createSpyObj( mockNextObject = jasmine.createSpyObj(
"nextObject", "nextObject",
[ "getId", "getCapability", "getModel", "useCapability" ] ["getId", "getCapability", "getModel", "useCapability"]
); );
mockObjectService.getObjects.andReturn(mockPromise({ mockObjectService.getObjects.andReturn(mockPromise({
@ -257,7 +255,7 @@ define(
" object", function () { " object", function () {
mockScope.navigatedObject = mockDomainObject; mockScope.navigatedObject = mockDomainObject;
mockWindow.confirm.andReturn(false); mockWindow.confirm.andReturn(false);
mockPolicyService.allow.andCallFake(function(category, object, context, callback){ mockPolicyService.allow.andCallFake(function (category, object, context, callback) {
callback("unsaved changes"); callback("unsaved changes");
return false; return false;
}); });

View File

@ -19,13 +19,11 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
["../src/BrowseObjectController"], ["../src/BrowseObjectController"],
function (BrowseObjectController) { function (BrowseObjectController) {
"use strict";
describe("The browse object controller", function () { describe("The browse object controller", function () {
var mockScope, var mockScope,
@ -46,12 +44,12 @@ define(
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(
"$scope", "$scope",
[ "$on", "$watch" ] ["$on", "$watch"]
); );
mockRoute = { current: { params: {} } }; mockRoute = { current: { params: {} } };
mockLocation = jasmine.createSpyObj( mockLocation = jasmine.createSpyObj(
"$location", "$location",
[ "path", "search" ] ["path", "search"]
); );
mockUnlisten = jasmine.createSpy("unlisten"); mockUnlisten = jasmine.createSpy("unlisten");
@ -71,7 +69,7 @@ define(
// Allows the path index to be checked // Allows the path index to be checked
// prior to setting $route.current // prior to setting $route.current
mockLocation.path.andReturn("/browse/"); mockLocation.path.andReturn("/browse/");
// Exercise the Angular workaround // Exercise the Angular workaround
mockScope.$on.mostRecentCall.args[1](); mockScope.$on.mostRecentCall.args[1]();
expect(mockUnlisten).toHaveBeenCalled(); expect(mockUnlisten).toHaveBeenCalled();

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14. * MCTIncudeSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/InspectorRegion"], ["../src/InspectorRegion"],
function (InspectorRegion) { function (InspectorRegion) {
"use strict";
describe("The inspector region", function () { describe("The inspector region", function () {
var inspectorRegion; var inspectorRegion;
@ -42,4 +40,4 @@ define(
}); });
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MenuArrowControllerSpec. Created by shale on 07/02/2015. * MenuArrowControllerSpec. Created by shale on 07/02/2015.
@ -27,8 +26,7 @@
define( define(
["../src/MenuArrowController"], ["../src/MenuArrowController"],
function (MenuArrowController) { function (MenuArrowController) {
"use strict";
describe("The menu arrow controller ", function () { describe("The menu arrow controller ", function () {
var mockScope, var mockScope,
mockDomainObject, mockDomainObject,
@ -36,43 +34,43 @@ define(
mockContextMenuAction, mockContextMenuAction,
mockActionContext, mockActionContext,
controller; controller;
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(
"$scope", "$scope",
[ "" ] [""]
); );
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(
"domainObject", "domainObject",
[ "getCapability" ] ["getCapability"]
); );
mockEvent = jasmine.createSpyObj( mockEvent = jasmine.createSpyObj(
"event", "event",
[ "preventDefault" ] ["preventDefault"]
); );
mockContextMenuAction = jasmine.createSpyObj( mockContextMenuAction = jasmine.createSpyObj(
"action", "action",
[ "perform", "getActions" ] ["perform", "getActions"]
); );
mockActionContext = jasmine.createSpyObj( mockActionContext = jasmine.createSpyObj(
"actionContext", "actionContext",
[ "" ] [""]
); );
mockActionContext.domainObject = mockDomainObject; mockActionContext.domainObject = mockDomainObject;
mockActionContext.event = mockEvent; mockActionContext.event = mockEvent;
mockScope.domainObject = mockDomainObject; mockScope.domainObject = mockDomainObject;
mockDomainObject.getCapability.andReturn(mockContextMenuAction); mockDomainObject.getCapability.andReturn(mockContextMenuAction);
mockContextMenuAction.perform.andReturn(jasmine.any(Function)); mockContextMenuAction.perform.andReturn(jasmine.any(Function));
controller = new MenuArrowController(mockScope); controller = new MenuArrowController(mockScope);
}); });
it("calls the context menu action when clicked", function () { it("calls the context menu action when clicked", function () {
// Simulate a click on the menu arrow // Simulate a click on the menu arrow
controller.showMenu(mockEvent); controller.showMenu(mockEvent);
// Expect the menu action to be performed // Expect the menu action to be performed
expect(mockDomainObject.getCapability).toHaveBeenCalledWith('action'); expect(mockDomainObject.getCapability).toHaveBeenCalledWith('action');
expect(mockContextMenuAction.perform).toHaveBeenCalled(); expect(mockContextMenuAction.perform).toHaveBeenCalled();
}); });

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define( define(
["../src/PaneController"], ["../src/PaneController"],
function (PaneController) { function (PaneController) {
'use strict';
describe("The PaneController", function () { describe("The PaneController", function () {
var mockScope, var mockScope,
@ -44,11 +42,11 @@ define(
} }
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", [ "$on" ]); mockScope = jasmine.createSpyObj("$scope", ["$on"]);
mockDomainObjects = ['a', 'b'].map(function (id) { mockDomainObjects = ['a', 'b'].map(function (id) {
var mockDomainObject = jasmine.createSpyObj( var mockDomainObject = jasmine.createSpyObj(
'domainObject-' + id, 'domainObject-' + id,
[ 'getId', 'getModel', 'getCapability' ] ['getId', 'getModel', 'getCapability']
); );
mockDomainObject.getId.andReturn(id); mockDomainObject.getId.andReturn(id);
@ -58,7 +56,7 @@ define(
}); });
mockAgentService = jasmine.createSpyObj( mockAgentService = jasmine.createSpyObj(
"agentService", "agentService",
[ "isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape" ] ["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
); );
mockWindow = jasmine.createSpyObj("$window", ["open"]); mockWindow = jasmine.createSpyObj("$window", ["open"]);
}); });

View File

@ -1,132 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,xit,xdescribe*/
/**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
*/
define(
["../../src/creation/CreateAction"],
function (CreateAction) {
"use strict";
describe("The create action", function () {
var mockType,
mockParent,
mockContext,
mockDialogService,
mockCreationService,
action;
function mockPromise(value) {
return {
then: function (callback) {
return mockPromise(callback(value));
}
};
}
beforeEach(function () {
mockType = jasmine.createSpyObj(
"type",
[
"getKey",
"getGlyph",
"getName",
"getDescription",
"getProperties",
"getInitialModel"
]
);
mockParent = jasmine.createSpyObj(
"domainObject",
[
"getId",
"getModel",
"getCapability"
]
);
mockContext = {
domainObject: mockParent
};
mockDialogService = jasmine.createSpyObj(
"dialogService",
[ "getUserInput" ]
);
mockCreationService = jasmine.createSpyObj(
"creationService",
[ "createObject" ]
);
mockType.getKey.andReturn("test");
mockType.getGlyph.andReturn("T");
mockType.getDescription.andReturn("a test type");
mockType.getName.andReturn("Test");
mockType.getProperties.andReturn([]);
mockType.getInitialModel.andReturn({});
mockDialogService.getUserInput.andReturn(mockPromise({}));
action = new CreateAction(
mockType,
mockParent,
mockContext,
mockDialogService,
mockCreationService
);
});
it("exposes type-appropriate metadata", function () {
var metadata = action.getMetadata();
expect(metadata.name).toEqual("Test");
expect(metadata.description).toEqual("a test type");
expect(metadata.glyph).toEqual("T");
});
//TODO: Disabled for NEM Beta
xit("invokes the creation service when performed", function () {
action.perform();
expect(mockCreationService.createObject).toHaveBeenCalledWith(
{ type: "test" },
mockParent
);
});
//TODO: Disabled for NEM Beta
xit("does not create an object if the user cancels", function () {
mockDialogService.getUserInput.andReturn({
then: function (callback, fail) {
fail();
}
});
action.perform();
expect(mockCreationService.createObject)
.not.toHaveBeenCalled();
});
});
}
);

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,12 +26,10 @@
define( define(
["../../src/navigation/NavigateAction"], ["../../src/navigation/NavigateAction"],
function (NavigateAction) { function (NavigateAction) {
"use strict";
describe("The navigate action", function () { describe("The navigate action", function () {
var mockNavigationService, var mockNavigationService,
mockQ, mockQ,
actionContext,
mockDomainObject, mockDomainObject,
action; action;
@ -47,12 +44,12 @@ define(
beforeEach(function () { beforeEach(function () {
mockNavigationService = jasmine.createSpyObj( mockNavigationService = jasmine.createSpyObj(
"navigationService", "navigationService",
[ "setNavigation" ] ["setNavigation"]
); );
mockQ = { when: mockPromise }; mockQ = { when: mockPromise };
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(
"domainObject", "domainObject",
[ "getId", "getModel", "getCapability" ] ["getId", "getModel", "getCapability"]
); );
action = new NavigateAction( action = new NavigateAction(
@ -77,4 +74,4 @@ define(
}); });
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/navigation/NavigationService"], ["../../src/navigation/NavigationService"],
function (NavigationService) { function (NavigationService) {
"use strict";
describe("The navigation service", function () { describe("The navigation service", function () {
var navigationService; var navigationService;

View File

@ -19,33 +19,30 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,window*/
/** /**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14. * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
*/ */
define( define(
["../../src/windowing/FullscreenAction"], ["../../src/windowing/FullscreenAction", "screenfull"],
function (FullscreenAction) { function (FullscreenAction, screenfull) {
"use strict";
describe("The fullscreen action", function () { describe("The fullscreen action", function () {
var action, var action,
oldScreenfull; oldToggle;
beforeEach(function () { beforeEach(function () {
// Screenfull is not shimmed or injected, so // Screenfull is not shimmed or injected, so
// we need to spy on it in the global scope. // we need to spy on it in the global scope.
oldScreenfull = window.screenfull; oldToggle = screenfull.toggle;
window.screenfull = {}; screenfull.toggle = jasmine.createSpy("toggle");
window.screenfull.toggle = jasmine.createSpy("toggle");
action = new FullscreenAction({}); action = new FullscreenAction({});
}); });
afterEach(function () { afterEach(function () {
window.screenfull = oldScreenfull; screenfull.toggle = oldToggle;
}); });
it("toggles fullscreen mode when performed", function () { it("toggles fullscreen mode when performed", function () {
@ -59,4 +56,4 @@ define(
}); });
} }
); );

View File

@ -19,18 +19,15 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,window*/
define( define(
["../../src/windowing/NewTabAction"], ["../../src/windowing/NewTabAction"],
function (NewTabAction) { function (NewTabAction) {
"use strict";
describe("The new tab action", function () { describe("The new tab action", function () {
var actionSelected, var actionSelected,
actionCurrent, actionCurrent,
mockWindow, mockWindow,
mockDomainObject,
mockContextCurrent, mockContextCurrent,
mockContextSelected, mockContextSelected,
mockUrlService; mockUrlService;
@ -40,39 +37,39 @@ define(
// Context if the current object is selected // Context if the current object is selected
// For example, when the top right new tab // For example, when the top right new tab
// button is clicked, the user is using the // button is clicked, the user is using the
// current domainObject // current domainObject
mockContextCurrent = jasmine.createSpyObj("context", ["domainObject"]); mockContextCurrent = jasmine.createSpyObj("context", ["domainObject"]);
// Context if the selected object is selected // Context if the selected object is selected
// For example, when an object in the left // For example, when an object in the left
// tree is opened in a new tab using the // tree is opened in a new tab using the
// context menu // context menu
mockContextSelected = jasmine.createSpyObj("context", ["selectedObject", mockContextSelected = jasmine.createSpyObj("context", ["selectedObject",
"domainObject"]); "domainObject"]);
// Mocks the urlService used to make the new tab's url from a // Mocks the urlService used to make the new tab's url from a
// domainObject and mode // domainObject and mode
mockUrlService = jasmine.createSpyObj("urlService", ["urlForNewTab"]); mockUrlService = jasmine.createSpyObj("urlService", ["urlForNewTab"]);
// Action done using the current context or mockContextCurrent // Action done using the current context or mockContextCurrent
actionCurrent = new NewTabAction(mockUrlService, mockWindow, actionCurrent = new NewTabAction(mockUrlService, mockWindow,
mockContextCurrent); mockContextCurrent);
// Action done using the selected context or mockContextSelected // Action done using the selected context or mockContextSelected
actionSelected = new NewTabAction(mockUrlService, mockWindow, actionSelected = new NewTabAction(mockUrlService, mockWindow,
mockContextSelected); mockContextSelected);
}); });
it("new tab with current url is opened", function () { it("new tab with current url is opened", function () {
actionCurrent.perform(); actionCurrent.perform();
}); });
it("new tab with a selected url is opened", function () { it("new tab with a selected url is opened", function () {
actionSelected.perform(); actionSelected.perform();
}); });
}); });
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* WindowTitlerSpec. Created by vwoeltje on 11/6/14. * WindowTitlerSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../../src/windowing/WindowTitler"], ["../../src/windowing/WindowTitler"],
function (WindowTitler) { function (WindowTitler) {
"use strict";
describe("The window titler", function () { describe("The window titler", function () {
var mockNavigationService, var mockNavigationService,
@ -39,11 +37,11 @@ define(
beforeEach(function () { beforeEach(function () {
mockNavigationService = jasmine.createSpyObj( mockNavigationService = jasmine.createSpyObj(
'navigationService', 'navigationService',
[ 'getNavigation' ] ['getNavigation']
); );
mockRootScope = jasmine.createSpyObj( mockRootScope = jasmine.createSpyObj(
'$rootScope', '$rootScope',
[ '$watch' ] ['$watch']
); );
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(
'domainObject', 'domainObject',
@ -77,4 +75,4 @@ define(
}); });
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"./src/DialogService", "./src/DialogService",
@ -44,7 +43,6 @@ define([
overlayTemplate, overlayTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/dialog", { legacyRegistry.register("platform/commonUI/dialog", {
"extensions": { "extensions": {

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* This bundle implements the dialog service, which can be used to * This bundle implements the dialog service, which can be used to
@ -29,7 +28,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The dialog service is responsible for handling window-modal * The dialog service is responsible for handling window-modal
* communication with the user, such as displaying forms for user * communication with the user, such as displaying forms for user
@ -157,8 +155,8 @@ define(
* @returns {boolean} true if dialog is currently visible, false * @returns {boolean} true if dialog is currently visible, false
* otherwise * otherwise
*/ */
DialogService.prototype.canShowDialog = function(dialogModel){ DialogService.prototype.canShowDialog = function (dialogModel) {
if (this.dialogVisible){ if (this.dialogVisible) {
// Only one dialog should be shown at a time. // Only one dialog should be shown at a time.
// The application design should be such that // The application design should be such that
// we never even try to do this. // we never even try to do this.
@ -226,7 +224,7 @@ define(
* @param {typeClass} string tells overlayService that this overlay should use appropriate CSS class * @param {typeClass} string tells overlayService that this overlay should use appropriate CSS class
* @returns {boolean} * @returns {boolean}
*/ */
DialogService.prototype.showBlockingMessage = function(dialogModel) { DialogService.prototype.showBlockingMessage = function (dialogModel) {
if (this.canShowDialog(dialogModel)) { if (this.canShowDialog(dialogModel)) {
// Add the overlay using the OverlayService, which // Add the overlay using the OverlayService, which
// will handle actual insertion into the DOM // will handle actual insertion into the DOM

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
// Template to inject into the DOM to show the dialog; really just points to // Template to inject into the DOM to show the dialog; really just points to
// the a specific template that can be included via mct-include // the a specific template that can be included via mct-include

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14. * MCTIncudeSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/DialogService"], ["../src/DialogService"],
function (DialogService) { function (DialogService) {
"use strict";
describe("The dialog service", function () { describe("The dialog service", function () {
var mockOverlayService, var mockOverlayService,
@ -40,23 +38,23 @@ define(
beforeEach(function () { beforeEach(function () {
mockOverlayService = jasmine.createSpyObj( mockOverlayService = jasmine.createSpyObj(
"overlayService", "overlayService",
[ "createOverlay" ] ["createOverlay"]
); );
mockQ = jasmine.createSpyObj( mockQ = jasmine.createSpyObj(
"$q", "$q",
[ "defer" ] ["defer"]
); );
mockLog = jasmine.createSpyObj( mockLog = jasmine.createSpyObj(
"$log", "$log",
[ "warn", "info", "debug" ] ["warn", "info", "debug"]
); );
mockOverlay = jasmine.createSpyObj( mockOverlay = jasmine.createSpyObj(
"overlay", "overlay",
[ "dismiss" ] ["dismiss"]
); );
mockDeferred = jasmine.createSpyObj( mockDeferred = jasmine.createSpyObj(
"deferred", "deferred",
[ "resolve", "reject"] ["resolve", "reject"]
); );
mockDeferred.promise = "mock promise"; mockDeferred.promise = "mock promise";
@ -122,7 +120,7 @@ define(
}); });
it("invokes the overlay service with the correct parameters when" + it("invokes the overlay service with the correct parameters when" +
" a blocking dialog is requested", function() { " a blocking dialog is requested", function () {
var dialogModel = {}; var dialogModel = {};
expect(dialogService.showBlockingMessage(dialogModel)).toBe(true); expect(dialogService.showBlockingMessage(dialogModel)).toBe(true);
expect(mockOverlayService.createOverlay).toHaveBeenCalledWith( expect(mockOverlayService.createOverlay).toHaveBeenCalledWith(

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/** /**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14. * MCTIncudeSpec. Created by vwoeltje on 11/6/14.
@ -27,7 +26,6 @@
define( define(
["../src/OverlayService"], ["../src/OverlayService"],
function (OverlayService) { function (OverlayService) {
"use strict";
describe("The overlay service", function () { describe("The overlay service", function () {
var mockDocument, var mockDocument,
@ -40,13 +38,13 @@ define(
overlayService; overlayService;
beforeEach(function () { beforeEach(function () {
mockDocument = jasmine.createSpyObj("$document", [ "find" ]); mockDocument = jasmine.createSpyObj("$document", ["find"]);
mockCompile = jasmine.createSpy("$compile"); mockCompile = jasmine.createSpy("$compile");
mockRootScope = jasmine.createSpyObj("$rootScope", [ "$new" ]); mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]);
mockBody = jasmine.createSpyObj("body", [ "prepend" ]); mockBody = jasmine.createSpyObj("body", ["prepend"]);
mockTemplate = jasmine.createSpy("template"); mockTemplate = jasmine.createSpy("template");
mockElement = jasmine.createSpyObj("element", [ "remove" ]); mockElement = jasmine.createSpyObj("element", ["remove"]);
mockScope = jasmine.createSpyObj("scope", [ "$destroy" ]); mockScope = jasmine.createSpyObj("scope", ["$destroy"]);
mockDocument.find.andReturn(mockBody); mockDocument.find.andReturn(mockBody);
mockCompile.andReturn(mockTemplate); mockCompile.andReturn(mockTemplate);
@ -98,4 +96,4 @@ define(
}); });
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define([ define([
"./src/controllers/EditActionController", "./src/controllers/EditActionController",
@ -27,16 +26,32 @@ define([
"./src/controllers/ElementsController", "./src/controllers/ElementsController",
"./src/controllers/EditObjectController", "./src/controllers/EditObjectController",
"./src/directives/MCTBeforeUnload", "./src/directives/MCTBeforeUnload",
"./src/actions/LinkAction", "./src/actions/EditAndComposeAction",
"./src/actions/EditAction", "./src/actions/EditAction",
"./src/actions/PropertiesAction", "./src/actions/PropertiesAction",
"./src/actions/RemoveAction", "./src/actions/RemoveAction",
"./src/actions/SaveAction", "./src/actions/SaveAction",
"./src/actions/SaveAsAction",
"./src/actions/CancelAction", "./src/actions/CancelAction",
"./src/policies/EditActionPolicy", "./src/policies/EditActionPolicy",
"./src/policies/EditableLinkPolicy",
"./src/policies/EditableMovePolicy",
"./src/policies/EditNavigationPolicy", "./src/policies/EditNavigationPolicy",
"./src/policies/EditContextualActionPolicy",
"./src/representers/EditRepresenter", "./src/representers/EditRepresenter",
"./src/representers/EditToolbarRepresenter", "./src/representers/EditToolbarRepresenter",
"./src/capabilities/EditorCapability",
"./src/capabilities/TransactionCapabilityDecorator",
"./src/services/TransactionService",
"./src/creation/CreateMenuController",
"./src/creation/LocatorController",
"./src/creation/CreationPolicy",
"./src/creation/CreateActionProvider",
"./src/creation/AddActionProvider",
"./src/creation/CreationService",
"text!./res/templates/create/locator.html",
"text!./res/templates/create/create-button.html",
"text!./res/templates/create/create-menu.html",
"text!./res/templates/library.html", "text!./res/templates/library.html",
"text!./res/templates/edit-object.html", "text!./res/templates/edit-object.html",
"text!./res/templates/edit-action-buttons.html", "text!./res/templates/edit-action-buttons.html",
@ -49,16 +64,32 @@ define([
ElementsController, ElementsController,
EditObjectController, EditObjectController,
MCTBeforeUnload, MCTBeforeUnload,
LinkAction, EditAndComposeAction,
EditAction, EditAction,
PropertiesAction, PropertiesAction,
RemoveAction, RemoveAction,
SaveAction, SaveAction,
SaveAsAction,
CancelAction, CancelAction,
EditActionPolicy, EditActionPolicy,
EditableLinkPolicy,
EditableMovePolicy,
EditNavigationPolicy, EditNavigationPolicy,
EditContextualActionPolicy,
EditRepresenter, EditRepresenter,
EditToolbarRepresenter, EditToolbarRepresenter,
EditorCapability,
TransactionCapabilityDecorator,
TransactionService,
CreateMenuController,
LocatorController,
CreationPolicy,
CreateActionProvider,
AddActionProvider,
CreationService,
locatorTemplate,
createButtonTemplate,
createMenuTemplate,
libraryTemplate, libraryTemplate,
editObjectTemplate, editObjectTemplate,
editActionButtonsTemplate, editActionButtonsTemplate,
@ -66,7 +97,6 @@ define([
topbarEditTemplate, topbarEditTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict";
legacyRegistry.register("platform/commonUI/edit", { legacyRegistry.register("platform/commonUI/edit", {
"extensions": { "extensions": {
@ -100,6 +130,22 @@ define([
"$location", "$location",
"policyService" "policyService"
] ]
},
{
"key": "CreateMenuController",
"implementation": CreateMenuController,
"depends": [
"$scope"
]
},
{
"key": "LocatorController",
"implementation": LocatorController,
"depends": [
"$scope",
"$timeout",
"objectService"
]
} }
], ],
"directives": [ "directives": [
@ -114,7 +160,7 @@ define([
"actions": [ "actions": [
{ {
"key": "compose", "key": "compose",
"implementation": LinkAction "implementation": EditAndComposeAction
}, },
{ {
"key": "edit", "key": "edit",
@ -122,8 +168,7 @@ define([
"depends": [ "depends": [
"$location", "$location",
"navigationService", "navigationService",
"$log", "$log"
"$q"
], ],
"description": "Edit this object.", "description": "Edit this object.",
"category": "view-control", "category": "view-control",
@ -161,6 +206,15 @@ define([
"implementation": SaveAction, "implementation": SaveAction,
"name": "Save", "name": "Save",
"description": "Save changes made to these objects.", "description": "Save changes made to these objects.",
"depends": [],
"priority": "mandatory"
},
{
"key": "save",
"category": "conclude-editing",
"implementation": SaveAsAction,
"name": "Save",
"description": "Save changes made to these objects.",
"depends": [ "depends": [
"$injector", "$injector",
"policyService", "policyService",
@ -176,10 +230,7 @@ define([
"implementation": CancelAction, "implementation": CancelAction,
"name": "Cancel", "name": "Cancel",
"description": "Discard changes made to these objects.", "description": "Discard changes made to these objects.",
"depends": [ "depends": []
"$injector",
"navigationService"
]
} }
], ],
"policies": [ "policies": [
@ -187,12 +238,28 @@ define([
"category": "action", "category": "action",
"implementation": EditActionPolicy "implementation": EditActionPolicy
}, },
{
"category": "action",
"implementation": EditContextualActionPolicy,
"depends": ["navigationService", "editModeBlacklist", "nonEditContextBlacklist"]
},
{
"category": "action",
"implementation": EditableMovePolicy
},
{
"category": "action",
"implementation": EditableLinkPolicy
},
{ {
"category": "navigation", "category": "navigation",
"message": "There are unsaved changes.", "message": "Continuing will cause the loss of any unsaved changes.",
"implementation": EditNavigationPolicy "implementation": EditNavigationPolicy
},
{
"implementation": CreationPolicy,
"category": "creation"
} }
], ],
"templates": [ "templates": [
{ {
@ -231,8 +298,73 @@ define([
{ {
"key": "topbar-edit", "key": "topbar-edit",
"template": topbarEditTemplate "template": topbarEditTemplate
},
{
"key": "create-button",
"template": createButtonTemplate
},
{
"key": "create-menu",
"template": createMenuTemplate,
"uses": [
"action"
]
} }
], ],
"components": [
{
"type": "decorator",
"provides": "capabilityService",
"implementation": TransactionCapabilityDecorator,
"depends": [
"$q",
"transactionService"
],
"priority": "fallback"
},
{
"type": "provider",
"provides": "transactionService",
"implementation": TransactionService,
"depends": [
"$q",
"$log"
]
},
{
"key": "CreateActionProvider",
"provides": "actionService",
"type": "provider",
"implementation": CreateActionProvider,
"depends": [
"typeService",
"policyService"
]
},
{
"key": "AddActionProvider",
"provides": "actionService",
"type": "provider",
"implementation": AddActionProvider,
"depends": [
"$q",
"typeService",
"dialogService",
"policyService"
]
},
{
"key": "CreationService",
"provides": "creationService",
"type": "provider",
"implementation": CreationService,
"depends": [
"$q",
"$log"
]
}
],
"representers": [ "representers": [
{ {
"implementation": EditRepresenter, "implementation": EditRepresenter,
@ -244,6 +376,33 @@ define([
{ {
"implementation": EditToolbarRepresenter "implementation": EditToolbarRepresenter
} }
],
"constants": [
{
"key": "editModeBlacklist",
"value": ["copy", "follow", "window", "link", "locate"]
},
{
"key": "nonEditContextBlacklist",
"value": ["copy", "follow", "properties", "move", "link", "remove", "locate"]
}
],
"capabilities": [
{
"key": "editor",
"name": "Editor Capability",
"description": "Provides transactional editing capabilities",
"implementation": EditorCapability,
"depends": [
"transactionService"
]
}
],
"controls": [
{
"key": "locator",
"template": locatorTemplate
}
] ]
} }
}); });

View File

@ -26,7 +26,7 @@
</mct-include> </mct-include>
<div class="flex-elem grows vscroll"> <div class="flex-elem grows vscroll">
<ul class="tree"> <ul class="tree">
<li ng-repeat="containedObject in composition | filter:searchText"> <li ng-repeat="containedObject in composition | filter:searchElements">
<span class="tree-item"> <span class="tree-item">
<mct-representation <mct-representation
class="rep-object-label" class="rep-object-label"

View File

@ -19,11 +19,9 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
function () { function () {
'use strict';
/** /**
* The "Cancel" action; the action triggered by clicking Cancel from * The "Cancel" action; the action triggered by clicking Cancel from
@ -33,10 +31,8 @@ define(
* @memberof platform/commonUI/edit * @memberof platform/commonUI/edit
* @implements {Action} * @implements {Action}
*/ */
function CancelAction($injector, navigationService, context) { function CancelAction(context) {
this.domainObject = context.domainObject; this.domainObject = context.domainObject;
this.navigationService = navigationService;
this.objectService = $injector.get('objectService');
} }
/** /**
@ -46,30 +42,25 @@ define(
* cancellation has completed * cancellation has completed
*/ */
CancelAction.prototype.perform = function () { CancelAction.prototype.perform = function () {
var domainObject = this.domainObject, var domainObject = this.domainObject;
self = this;
// Look up the object's "editor.completion" capability;
// this is introduced by EditableDomainObject which is
// used to insulate underlying objects from changes made
// during editing.
function getEditorCapability() {
return domainObject.getCapability("editor");
}
// Invoke any save behavior introduced by the editor.completion
// capability.
function doCancel(editor) {
return editor.cancel();
}
//Discard current 'editable' object, and retrieve original
// un-edited object.
function returnToBrowse() { function returnToBrowse() {
return self.navigationService.setNavigation(self.domainObject.getOriginalObject()); var parent;
}
return doCancel(getEditorCapability()) //If the object existed already, navigate to refresh view
// with previous object state.
if (domainObject.getModel().persisted) {
domainObject.getCapability("action").perform("navigate");
} else {
//If the object was new, and user has cancelled, then
//navigate back to parent because nothing to show.
domainObject.getCapability("location").getOriginal().then(function (original) {
parent = original.getCapability("context").getParent();
parent.getCapability("action").perform("navigate");
});
}
}
return this.domainObject.getCapability("editor").cancel()
.then(returnToBrowse); .then(returnToBrowse);
}; };
@ -82,7 +73,8 @@ define(
CancelAction.appliesTo = function (context) { CancelAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject !== undefined && return domainObject !== undefined &&
domainObject.hasCapability("editor"); domainObject.hasCapability('editor') &&
domainObject.getCapability('editor').isEditContextRoot();
}; };
return CancelAction; return CancelAction;

View File

@ -19,15 +19,13 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining EditAction. Created by vwoeltje on 11/14/14. * Module defining EditAction. Created by vwoeltje on 11/14/14.
*/ */
define( define(
['../objects/EditableDomainObject'], [],
function (EditableDomainObject) { function () {
"use strict";
// A no-op action to return in the event that the action cannot // A no-op action to return in the event that the action cannot
// be completed. // be completed.
@ -46,7 +44,7 @@ define(
* @constructor * @constructor
* @implements {Action} * @implements {Action}
*/ */
function EditAction($location, navigationService, $log, $q, context) { function EditAction($location, navigationService, $log, context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
// We cannot enter Edit mode if we have no domain object to // We cannot enter Edit mode if we have no domain object to
@ -65,7 +63,6 @@ define(
this.domainObject = domainObject; this.domainObject = domainObject;
this.$location = $location; this.$location = $location;
this.navigationService = navigationService; this.navigationService = navigationService;
this.$q = $q;
} }
/** /**
@ -73,25 +70,18 @@ define(
*/ */
EditAction.prototype.perform = function () { EditAction.prototype.perform = function () {
var self = this; var self = this;
if (!this.domainObject.hasCapability("editor")) { function cancelEditing() {
//TODO: This is only necessary because the drop gesture is self.domainObject.getCapability('editor').cancel();
// wrapping the object itself, need to refactor this later. self.navigationService.removeListener(cancelEditing);
// All responsibility for switching into edit mode should be }
// in the edit action, and not duplicated in the gesture //If this is not the currently navigated object, then navigate
this.domainObject = new EditableDomainObject(this.domainObject, this.$q); // to it.
if (this.navigationService.getNavigation() !== this.domainObject) {
this.navigationService.setNavigation(this.domainObject);
} }
this.navigationService.setNavigation(this.domainObject);
this.domainObject.getCapability('status').set('editing', true);
//Register a listener to automatically cancel this edit action
//if the user navigates away from this object.
function cancelEditing(navigatedTo){
if (!navigatedTo || navigatedTo.getId() !== self.domainObject.getId()) {
self.domainObject.getCapability('editor').cancel();
self.navigationService.removeListener(cancelEditing);
}
}
this.navigationService.addListener(cancelEditing); this.navigationService.addListener(cancelEditing);
this.domainObject.useCapability("editor");
}; };
/** /**
@ -102,11 +92,13 @@ define(
*/ */
EditAction.appliesTo = function (context) { EditAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject, var domainObject = (context || {}).domainObject,
type = domainObject && domainObject.getCapability('type'), type = domainObject && domainObject.getCapability('type');
isEditMode = domainObject && domainObject.getDomainObject ? true : false;
// Only allow creatable types to be edited // Only allow editing of types that support it and are not already
return type && type.hasFeature('creation') && !isEditMode; // being edited
return type && type.hasFeature('creation') &&
domainObject.hasCapability('editor') &&
!domainObject.getCapability('editor').isEditContextRoot();
}; };
return EditAction; return EditAction;

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
@ -33,13 +31,14 @@ define(
* @memberof platform/commonUI/edit * @memberof platform/commonUI/edit
* @implements {Action} * @implements {Action}
*/ */
function LinkAction(context) { function EditAndComposeAction(context) {
this.domainObject = (context || {}).domainObject; this.domainObject = (context || {}).domainObject;
this.selectedObject = (context || {}).selectedObject; this.selectedObject = (context || {}).selectedObject;
} }
LinkAction.prototype.perform = function () { EditAndComposeAction.prototype.perform = function () {
var self = this; var self = this,
editAction = this.domainObject.getCapability('action').getActions("edit")[0];
// Persist changes to the domain object // Persist changes to the domain object
function doPersist() { function doPersist() {
@ -56,9 +55,13 @@ define(
.then(doPersist); .then(doPersist);
} }
if (editAction) {
editAction.perform();
}
return this.selectedObject && doLink(); return this.selectedObject && doLink();
}; };
return LinkAction; return EditAndComposeAction;
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* Edit the properties of a domain object. Shows a dialog * Edit the properties of a domain object. Shows a dialog
@ -29,7 +28,6 @@
define( define(
['./PropertiesDialog'], ['./PropertiesDialog'],
function (PropertiesDialog) { function (PropertiesDialog) {
'use strict';
/** /**
* Implements the "Edit Properties" action, which prompts the user * Implements the "Edit Properties" action, which prompts the user
@ -65,10 +63,10 @@ define(
}); });
} }
function showDialog(type) { function showDialog(objType) {
// Create a dialog object to generate the form structure, etc. // Create a dialog object to generate the form structure, etc.
var dialog = var dialog =
new PropertiesDialog(type, domainObject.getModel()); new PropertiesDialog(objType, domainObject.getModel());
// Show the dialog // Show the dialog
return dialogService.getUserInput( return dialogService.getUserInput(

View File

@ -19,11 +19,9 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
function () { function () {
'use strict';
/** /**
* Construct a new Properties dialog. * Construct a new Properties dialog.

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/** /**
* Module defining RemoveAction. Created by vwoeltje on 11/17/14. * Module defining RemoveAction. Created by vwoeltje on 11/17/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Construct an action which will remove the provided object manifestation. * Construct an action which will remove the provided object manifestation.
@ -77,8 +75,8 @@ define(
* Invoke persistence on a domain object. This will be called upon * Invoke persistence on a domain object. This will be called upon
* the removed object's parent (as its composition will have changed.) * the removed object's parent (as its composition will have changed.)
*/ */
function doPersist(domainObject) { function doPersist(domainObj) {
var persistence = domainObject.getCapability('persistence'); var persistence = domainObj.getCapability('persistence');
return persistence && persistence.persist(); return persistence && persistence.persist();
} }

View File

@ -19,14 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
/*jslint es5: true */
define( define(
['../../../browse/src/creation/CreateWizard'], [],
function (CreateWizard) { function () {
'use strict';
/** /**
* The "Save" action; the action triggered by clicking Save from * The "Save" action; the action triggered by clicking Save from
@ -37,31 +33,11 @@ define(
* @memberof platform/commonUI/edit * @memberof platform/commonUI/edit
*/ */
function SaveAction( function SaveAction(
$injector,
policyService,
dialogService,
creationService,
copyService,
context context
) { ) {
this.domainObject = (context || {}).domainObject; this.domainObject = (context || {}).domainObject;
this.injectObjectService = function(){
this.objectService = $injector.get("objectService");
};
this.policyService = policyService;
this.dialogService = dialogService;
this.creationService = creationService;
this.copyService = copyService;
} }
SaveAction.prototype.getObjectService = function(){
// Lazily acquire object service (avoids cyclical dependency)
if (!this.objectService) {
this.injectObjectService();
}
return this.objectService;
};
/** /**
* Save changes and conclude editing. * Save changes and conclude editing.
* *
@ -70,74 +46,21 @@ define(
* @memberof platform/commonUI/edit.SaveAction# * @memberof platform/commonUI/edit.SaveAction#
*/ */
SaveAction.prototype.perform = function () { SaveAction.prototype.perform = function () {
var domainObject = this.domainObject, var domainObject = this.domainObject;
copyService = this.copyService,
self = this;
function resolveWith(object){ function resolveWith(object) {
return function () { return function () {
return object; return object;
}; };
} }
function doWizardSave(parent) {
var context = domainObject.getCapability("context"),
wizard = new CreateWizard(
domainObject,
parent,
self.policyService
);
return self.dialogService
.getUserInput(
wizard.getFormStructure(true),
wizard.getInitialFormValue()
)
.then(wizard.populateObjectFromInput.bind(wizard));
}
function fetchObject(objectId){
return self.getObjectService().getObjects([objectId]).then(function(objects){
return objects[objectId];
});
}
function getParent(object){
return fetchObject(object.getModel().location);
}
function allowClone(objectToClone) {
return (objectToClone.getId() === domainObject.getId()) ||
objectToClone.getCapability('location').isOriginal();
}
function cloneIntoParent(parent) {
return copyService.perform(domainObject, parent, allowClone);
}
function cancelEditingAfterClone(clonedObject) {
return domainObject.getCapability("editor").cancel()
.then(resolveWith(clonedObject));
}
// Invoke any save behavior introduced by the editor capability; // Invoke any save behavior introduced by the editor capability;
// this is introduced by EditableDomainObject which is // this is introduced by EditableDomainObject which is
// used to insulate underlying objects from changes made // used to insulate underlying objects from changes made
// during editing. // during editing.
function doSave() { function doSave() {
//This is a new 'virtual object' that has not been persisted return domainObject.getCapability("editor").save()
// yet. .then(resolveWith(domainObject));
if (domainObject.getModel().persisted === undefined){
return getParent(domainObject)
.then(doWizardSave)
.then(getParent)
.then(cloneIntoParent)
.then(cancelEditingAfterClone)
.catch(resolveWith(false));
} else {
return domainObject.getCapability("editor").save()
.then(resolveWith(domainObject.getOriginalObject()));
}
} }
// Discard the current root view (which will be the editing // Discard the current root view (which will be the editing
@ -162,7 +85,9 @@ define(
SaveAction.appliesTo = function (context) { SaveAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject !== undefined && return domainObject !== undefined &&
domainObject.hasCapability("editor"); domainObject.hasCapability('editor') &&
domainObject.getCapability('editor').isEditContextRoot() &&
domainObject.getModel().persisted !== undefined;
}; };
return SaveAction; return SaveAction;

View File

@ -0,0 +1,167 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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(
['../creation/CreateWizard'],
function (CreateWizard) {
/**
* 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.
* @constructor
* @implements {Action}
* @memberof platform/commonUI/edit
*/
function SaveAsAction(
$injector,
policyService,
dialogService,
creationService,
copyService,
context
) {
this.domainObject = (context || {}).domainObject;
this.injectObjectService = function () {
this.objectService = $injector.get("objectService");
};
this.policyService = policyService;
this.dialogService = dialogService;
this.creationService = creationService;
this.copyService = copyService;
}
/**
* @private
*/
SaveAsAction.prototype.createWizard = function (parent) {
return new CreateWizard(
this.domainObject,
parent,
this.policyService
);
};
/**
* @private
*/
SaveAsAction.prototype.getObjectService = function () {
// Lazily acquire object service (avoids cyclical dependency)
if (!this.objectService) {
this.injectObjectService();
}
return this.objectService;
};
function resolveWith(object) {
return function () {
return object;
};
}
/**
* Save changes and conclude editing.
*
* @returns {Promise} a promise that will be fulfilled when
* cancellation has completed
* @memberof platform/commonUI/edit.SaveAction#
*/
SaveAsAction.prototype.perform = function () {
// 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;
}
return this.save().then(returnToBrowse);
};
/**
* @private
*/
SaveAsAction.prototype.save = function () {
var self = this,
domainObject = this.domainObject,
copyService = this.copyService;
function doWizardSave(parent) {
var wizard = self.createWizard(parent);
return self.dialogService
.getUserInput(wizard.getFormStructure(true),
wizard.getInitialFormValue()
).then(wizard.populateObjectFromInput.bind(wizard));
}
function fetchObject(objectId) {
return self.getObjectService().getObjects([objectId]).then(function (objects) {
return objects[objectId];
});
}
function getParent(object) {
return fetchObject(object.getModel().location);
}
function allowClone(objectToClone) {
return (objectToClone.getId() === domainObject.getId()) ||
objectToClone.getCapability('location').isOriginal();
}
function cloneIntoParent(parent) {
return copyService.perform(domainObject, parent, allowClone);
}
function commitEditingAfterClone(clonedObject) {
return domainObject.getCapability("editor").save()
.then(resolveWith(clonedObject));
}
return getParent(domainObject)
.then(doWizardSave)
.then(getParent)
.then(cloneIntoParent)
.then(commitEditingAfterClone)
.catch(resolveWith(false));
};
/**
* 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
*/
SaveAsAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject;
return domainObject !== undefined &&
domainObject.hasCapability('editor') &&
domainObject.getCapability('editor').isEditContextRoot() &&
domainObject.getModel().persisted === undefined;
};
return SaveAsAction;
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
function () {
'use strict';
var DISALLOWED_ACTIONS = ["move", "copy", "link", "window", "follow"];
/**
* Editable Action Capability. Overrides the action capability
* normally exhibited by a domain object and filters out certain
* actions not applicable when an object is in edit mode.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {PersistenceCapability}
*/
function EditableActionCapability(
actionCapability,
editableObject,
domainObject,
cache
) {
var action = Object.create(actionCapability);
action.getActions = function(domainObject) {
return actionCapability.getActions(domainObject).filter(function(action){
return DISALLOWED_ACTIONS.indexOf(action.getMetadata().key) === -1;
});
};
return action;
}
return EditableActionCapability;
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "composition" capability;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {CompositionCapability}
*/
return function EditableCompositionCapability(
contextCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), but we do not want to return the same
// specific value every time (composition may change)
return new EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
false // Not idempotent
);
};
}
);

View File

@ -1,78 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "context" capability;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {ContextCapability}
*/
return function EditableContextCapability(
contextCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), and it should be idempotent
var capability = new EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
true // Idempotent
),
// Track the real root object for the Elements pane
trueRoot = capability.getRoot();
// Provide access to the real root, for the Elements pane.
capability.getTrueRoot = function () {
return trueRoot;
};
// Hide ancestry after the root of this subgraph
if (cache.isRoot(domainObject)) {
capability.getRoot = function () {
return editableObject;
};
capability.getPath = function () {
return [editableObject];
};
}
return capability;
};
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "instantiation" capability;
* ensures that any domain objects instantiated in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {CompositionCapability}
*/
return function EditableInstantiationCapability(
contextCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), but we do not want to return the same
// specific value every time (composition may change)
return new EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
false // Not idempotent
);
};
}
);

View File

@ -1,125 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
[],
function () {
'use strict';
/**
* Wrapper for both "context" and "composition" capabilities;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
*/
return function EditableLookupCapability(
contextCapability,
editableObject,
domainObject,
cache,
idempotent
) {
var capability = Object.create(contextCapability),
method;
// Check for domain object interface. If something has these
// three methods, we assume it's a domain object.
function isDomainObject(obj) {
return obj !== undefined &&
typeof obj.getId === 'function' &&
typeof obj.getModel === 'function' &&
typeof obj.getCapability === 'function';
}
// Check an object returned by the wrapped capability; if it
// is a domain object, we want to make it editable and/or get
// it from the cache of editable domain objects. This will
// prevent changes made in edit mode from modifying the actual
// underlying domain object.
function makeEditableObject(obj) {
return isDomainObject(obj) ?
cache.getEditableObject(obj) :
obj;
}
// Wrap a returned value (see above); if it's an array, wrap
// all elements.
function makeEditable(returnValue) {
return Array.isArray(returnValue) ?
returnValue.map(makeEditableObject) :
makeEditableObject(returnValue);
}
// Wrap a returned value (see above); if it's a promise, wrap
// the resolved value.
function wrapResult(result) {
return (result && result.then) ? // promise-like
result.then(makeEditable) :
makeEditable(result);
}
// Return a wrapped version of a function, which ensures
// all results are editable domain objects.
function wrapFunction(fn) {
return function () {
return wrapResult(contextCapability[fn].apply(
capability,
arguments
));
};
}
// Wrap a method such that it only delegates once.
function oneTimeFunction(fn) {
return function () {
var result = wrapFunction(fn).apply(this, arguments);
capability[fn] = function () {
return result;
};
return result;
};
}
// Wrap a method of this capability
function wrapMethod(fn) {
if (typeof capability[fn] === 'function') {
capability[fn] =
(idempotent ? oneTimeFunction : wrapFunction)(fn);
}
}
// Wrap all methods; return only editable domain objects.
for (method in contextCapability) {
wrapMethod(method);
}
return capability;
};
}
);

View File

@ -1,68 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
function () {
'use strict';
/**
* Editable Persistence Capability. Overrides the persistence capability
* normally exhibited by a domain object to ensure that changes made
* during edit mode are not immediately stored to the database or other
* backing storage.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {PersistenceCapability}
*/
function EditablePersistenceCapability(
persistenceCapability,
editableObject,
domainObject,
cache
) {
var persistence = Object.create(persistenceCapability);
// Simply trigger refresh of in-view objects; do not
// write anything to database.
persistence.persist = function () {
return cache.markDirty(editableObject);
};
// Delegate refresh to the original object; this avoids refreshing
// the editable instance of the object, and ensures that refresh
// correctly targets the "real" version of the object.
persistence.refresh = function () {
return domainObject.getCapability('persistence').refresh();
};
return persistence;
}
return EditablePersistenceCapability;
}
);

View File

@ -1,60 +0,0 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
['./EditableLookupCapability'],
function (EditableLookupCapability) {
'use strict';
/**
* Wrapper for the "relationship" capability;
* ensures that any domain objects reachable in Edit mode
* are also wrapped as EditableDomainObjects.
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor
* @memberof platform/commonUI/edit
* @implements {RelationshipCapability}
*/
return function EditableRelationshipCapability(
relationshipCapability,
editableObject,
domainObject,
cache
) {
// This is a "lookup" style capability (it looks up other
// domain objects), but we do not want to return the same
// specific value every time (composition may change)
return new EditableLookupCapability(
relationshipCapability,
editableObject,
domainObject,
cache,
false // Not idempotent
);
};
}
);

View File

@ -19,122 +19,100 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
'use strict';
/** /**
* Implements "save" and "cancel" as capabilities of * A capability that implements an editing 'session' for a domain
* the object. In editing mode, user is seeing/using * object. An editing session is initiated via a call to .edit().
* a copy of the object (an EditableDomainObject) * Once initiated, any persist operations will be queued pending a
* which is disconnected from persistence; the Save * subsequent call to [.save()](@link #save) or [.cancel()](@link
* and Cancel actions can use this capability to * #cancel).
* propagate changes from edit mode to the underlying * @param transactionService
* actual persistable object. * @param domainObject
*
* Meant specifically for use by EditableDomainObject and the
* associated cache; the constructor signature is particular
* to a pattern used there and may contain unused arguments.
* @constructor * @constructor
* @memberof platform/commonUI/edit
*/ */
function EditorCapability( function EditorCapability(
persistenceCapability, transactionService,
editableObject, domainObject
domainObject,
cache
) { ) {
this.editableObject = editableObject; this.transactionService = transactionService;
this.domainObject = domainObject; this.domainObject = domainObject;
this.cache = cache;
}
// Simulate Promise.resolve (or $q.when); the former
// causes a delayed reaction from Angular (since it
// does not trigger a digest) and the latter is not
// readily accessible, since we're a few classes
// removed from the layer which gets dependency
// injection.
function resolvePromise(value) {
return (value && value.then) ? value : {
then: function (callback) {
return resolvePromise(callback(value));
}
};
} }
/** /**
* Save any changes that have been made to this domain object * Initiate an editing session. This will start a transaction during
* (as well as to others that might have been retrieved and * which any persist operations will be deferred until either save()
* modified during the editing session) * or cancel() are called.
* @param {boolean} nonrecursive if true, save only this
* object (and not other objects with associated changes)
* @returns {Promise} a promise that will be fulfilled after
* persistence has completed.
* @memberof platform/commonUI/edit.EditorCapability#
*/ */
EditorCapability.prototype.save = function (nonrecursive) { EditorCapability.prototype.edit = function () {
var domainObject = this.domainObject, this.transactionService.startTransaction();
editableObject = this.editableObject, this.domainObject.getCapability('status').set('editing', true);
self = this, };
cache = this.cache,
returnPromise;
// Update the underlying, "real" domain object's model function isEditContextRoot(domainObject) {
// with changes made to the copy used for editing. return domainObject.getCapability('status').get('editing');
function doMutate() { }
return domainObject.useCapability('mutation', function () {
return editableObject.getModel();
});
}
// Persist the underlying domain object function isEditing(domainObject) {
function doPersist() { return isEditContextRoot(domainObject) ||
return domainObject.getCapability('persistence').persist(); domainObject.hasCapability('context') &&
} isEditing(domainObject.getCapability('context').getParent());
}
editableObject.getCapability("status").set("editing", false); /**
* Determines whether this object, or any of its ancestors are
* currently being edited.
* @returns boolean
*/
EditorCapability.prototype.inEditContext = function () {
return isEditing(this.domainObject);
};
if (nonrecursive) { /**
returnPromise = resolvePromise(doMutate()) * Is this the root editing object (ie. the object that the user
.then(doPersist) * clicked 'edit' on)?
.then(function(){ * @returns {*}
self.cancel(); */
}); EditorCapability.prototype.isEditContextRoot = function () {
} else { return isEditContextRoot(this.domainObject);
returnPromise = resolvePromise(cache.saveAll()); };
}
//Return the original (non-editable) object /**
return returnPromise.then(function() { * Save any changes from this editing session. This will flush all
return domainObject.getOriginalObject ? domainObject.getOriginalObject() : domainObject; * pending persists and end the current transaction
* @returns {*}
*/
EditorCapability.prototype.save = function () {
var domainObject = this.domainObject;
return this.transactionService.commit().then(function () {
domainObject.getCapability('status').set('editing', false);
});
};
EditorCapability.prototype.invoke = EditorCapability.prototype.edit;
/**
* Cancel the current editing session. This will discard any pending
* persist operations
* @returns {*}
*/
EditorCapability.prototype.cancel = function () {
var domainObject = this.domainObject;
return this.transactionService.cancel().then(function () {
domainObject.getCapability("status").set("editing", false);
return domainObject;
}); });
}; };
/** /**
* Cancel editing; Discard any changes that have been made to * @returns {boolean} true if there have been any domain model
* this domain object (as well as to others that might have * modifications since the last persist, false otherwise.
* been retrieved and modified during the editing session)
* @returns {Promise} a promise that will be fulfilled after
* cancellation has completed.
* @memberof platform/commonUI/edit.EditorCapability#
*/
EditorCapability.prototype.cancel = function () {
this.editableObject.getCapability("status").set("editing", false);
this.cache.markClean();
return resolvePromise(undefined);
};
/**
* Check if there are any unsaved changes.
* @returns {boolean} true if there are unsaved changes
* @memberof platform/commonUI/edit.EditorCapability#
*/ */
EditorCapability.prototype.dirty = function () { EditorCapability.prototype.dirty = function () {
return this.cache.dirty(); return this.transactionService.size() > 0;
}; };
return EditorCapability; return EditorCapability;

View File

@ -0,0 +1,73 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
['./TransactionalPersistenceCapability'],
function (TransactionalPersistenceCapability) {
/**
* Wraps the [PersistenceCapability]{@link PersistenceCapability} with
* transactional capabilities.
* @param $q
* @param transactionService
* @param capabilityService
* @see TransactionalPersistenceCapability
* @constructor
*/
function TransactionCapabilityDecorator(
$q,
transactionService,
capabilityService
) {
this.capabilityService = capabilityService;
this.transactionService = transactionService;
this.$q = $q;
}
/**
* Decorate PersistenceCapability to queue persistence calls when a
* transaction is in progress.
*/
TransactionCapabilityDecorator.prototype.getCapabilities = function (model) {
var self = this,
capabilities = this.capabilityService.getCapabilities(model),
persistenceCapability = capabilities.persistence;
capabilities.persistence = function (domainObject) {
var original =
(typeof persistenceCapability === 'function') ?
persistenceCapability(domainObject) :
persistenceCapability;
return new TransactionalPersistenceCapability(
self.$q,
self.transactionService,
original,
domainObject
);
};
return capabilities;
};
return TransactionCapabilityDecorator;
}
);

View File

@ -0,0 +1,98 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web 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 Web 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.
*****************************************************************************/
/*global define*/
define(
[],
function () {
/**
* Wraps persistence capability to enable transactions. Transactions
* will cause persist calls not to be invoked immediately, but
* rather queued until [EditorCapability.save()]{@link EditorCapability#save}
* or [EditorCapability.cancel()]{@link EditorCapability#cancel} are
* called.
* @memberof platform/commonUI/edit/capabilities
* @param $q
* @param transactionService
* @param persistenceCapability
* @param domainObject
* @constructor
*/
function TransactionalPersistenceCapability(
$q,
transactionService,
persistenceCapability,
domainObject
) {
this.transactionService = transactionService;
this.persistenceCapability = persistenceCapability;
this.domainObject = domainObject;
this.$q = $q;
this.persistPending = false;
}
/**
* The wrapped persist function. If a transaction is active, persist
* will be queued until the transaction is committed or cancelled.
* @returns {*}
*/
TransactionalPersistenceCapability.prototype.persist = function () {
var self = this;
function onCommit() {
return self.persistenceCapability.persist().then(function (result) {
self.persistPending = false;
return result;
});
}
function onCancel() {
return self.persistenceCapability.refresh().then(function (result) {
self.persistPending = false;
return result;
});
}
if (this.transactionService.isActive()) {
if (!this.persistPending) {
this.transactionService.addToTransaction(onCommit, onCancel);
this.persistPending = true;
}
//Need to return a promise from this function
return this.$q.when(true);
} else {
return this.persistenceCapability.persist();
}
};
TransactionalPersistenceCapability.prototype.refresh = function () {
return this.persistenceCapability.refresh();
};
TransactionalPersistenceCapability.prototype.getSpace = function () {
return this.persistenceCapability.getSpace();
};
return TransactionalPersistenceCapability;
}
);

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining EditActionController. Created by vwoeltje on 11/17/14. * Module defining EditActionController. Created by vwoeltje on 11/17/14.
@ -27,7 +26,6 @@
define( define(
[], [],
function () { function () {
"use strict";
var ACTION_CONTEXT = { category: 'conclude-editing' }; var ACTION_CONTEXT = { category: 'conclude-editing' };

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* This bundle implements Edit mode. * This bundle implements Edit mode.
@ -28,7 +27,6 @@
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Controller which is responsible for populating the scope for * Controller which is responsible for populating the scope for
@ -61,7 +59,7 @@ define(
$scope.$watch('domainObject', setViewForDomainObject); $scope.$watch('domainObject', setViewForDomainObject);
$scope.doAction = function (action){ $scope.doAction = function (action) {
return $scope[action] && $scope[action](); return $scope[action] && $scope[action]();
}; };
} }
@ -76,8 +74,8 @@ define(
var navigatedObject = this.scope.domainObject, var navigatedObject = this.scope.domainObject,
policyMessage; policyMessage;
this.policyService.allow("navigation", navigatedObject, undefined, function(message) { this.policyService.allow("navigation", navigatedObject, undefined, function (message) {
policyMessage = message; policyMessage = message;
}); });
return policyMessage; return policyMessage;

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* Supports the Library and Elements panes in Edit mode. * Supports the Library and Elements panes in Edit mode.

View File

@ -19,12 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
define( define(
[], [],
function () { function () {
"use strict";
/** /**
* The ElementsController prepares the elements view for display * The ElementsController prepares the elements view for display
@ -32,16 +30,27 @@ define(
* @constructor * @constructor
*/ */
function ElementsController($scope) { function ElementsController($scope) {
function filterBy(text){ function filterBy(text) {
if (typeof text === 'undefined') { if (typeof text === 'undefined') {
return $scope.searchText; return $scope.searchText;
} else { } else {
$scope.searchText = text; $scope.searchText = text;
} }
} }
function searchElements(value) {
if ($scope.searchText) {
return value.getModel().name.toLowerCase().search(
$scope.searchText.toLowerCase()) !== -1;
} else {
return true;
}
}
$scope.filterBy = filterBy; $scope.filterBy = filterBy;
$scope.searchElements = searchElements;
} }
return ElementsController; return ElementsController;
} }
); );

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining AddAction. Created by ahenry on 01/21/16. * Module defining AddAction. Created by ahenry on 01/21/16.
@ -29,7 +28,6 @@ define(
'./CreateWizard' './CreateWizard'
], ],
function (CreateWizard) { function (CreateWizard) {
"use strict";
/** /**
* The Add Action is performed to create new instances of * The Add Action is performed to create new instances of
@ -83,37 +81,33 @@ define(
newModel.type = this.type.getKey(); newModel.type = this.type.getKey();
newObject = parentObject.getCapability('instantiation').instantiate(newModel); newObject = parentObject.getCapability('instantiation').instantiate(newModel);
newObject.useCapability('mutation', function(model){ newObject.useCapability('mutation', function (model) {
model.location = parentObject.getId(); model.location = parentObject.getId();
}); });
wizard = new CreateWizard(newObject, this.parent, this.policyService); wizard = new CreateWizard(newObject, this.parent, this.policyService);
function populateObjectFromInput (formValue) { function populateObjectFromInput(formValue) {
return wizard.populateObjectFromInput(formValue, newObject); return wizard.populateObjectFromInput(formValue, newObject);
} }
function addToParent (populatedObject) { function persistAndReturn(domainObject) {
parentObject.getCapability('composition').add(populatedObject); return domainObject.getCapability('persistence')
return parentObject.getCapability('persistence').persist().then(function(){ .persist()
return parentObject; .then(function () {
}); return domainObject;
});
} }
function save(object) { function addToParent(populatedObject) {
/* parentObject.getCapability('composition').add(populatedObject);
It's necessary to persist the new sub-object in order return persistAndReturn(parentObject);
that it can be retrieved for composition in the parent.
Future refactoring that allows temporary objects to be
retrieved from object services will make this unnecessary.
*/
return object.getCapability('editor').save(true);
} }
return this.dialogService return this.dialogService
.getUserInput(wizard.getFormStructure(false), wizard.getInitialFormValue()) .getUserInput(wizard.getFormStructure(false), wizard.getInitialFormValue())
.then(populateObjectFromInput) .then(populateObjectFromInput)
.then(save) .then(persistAndReturn)
.then(addToParent); .then(addToParent);
}; };
@ -131,7 +125,7 @@ define(
* @returns {AddActionMetadata} metadata about this action * @returns {AddActionMetadata} metadata about this action
*/ */
AddAction.prototype.getMetadata = function () { AddAction.prototype.getMetadata = function () {
return this.metadata; return this.metadata;
}; };
return AddAction; return AddAction;

View File

@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global define,Promise*/
/** /**
* Module defining AddActionProvider.js. Created by ahenry on 01/21/16. * Module defining AddActionProvider.js. Created by ahenry on 01/21/16.
@ -27,7 +26,6 @@
define( define(
["./AddAction"], ["./AddAction"],
function (AddAction) { function (AddAction) {
"use strict";
/** /**
* The AddActionProvider is an ActionProvider which introduces * The AddActionProvider is an ActionProvider which introduces

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