Compare commits

...

25 Commits

Author SHA1 Message Date
f8fe37d41f Sanding and shimming on misc styles
- Tree icon shrinkage fixed;
- c-icon-button much better relative sizing;
- Removed c-button-set wrapper from Layout.vue;
- Added uppercasing of Create button for Snow theme;
2018-09-12 14:12:50 -07:00
4f5b9902a6 Object browse bar shippable
- Better layout approach;
- Refinements to button classes;
2018-09-12 10:39:24 -07:00
e5c2d7b256 Object browse bar WIP
- Layout of start-side elements now working with ellipsis;
- TODO: cleanups and consolidation;
2018-09-11 18:01:50 -07:00
6737c71c45 Object browse bar WIP
- view-control renamed to disclosure-triangle;
- Good progress on object browse bar elements;
2018-09-11 11:41:20 -07:00
ca055ab765 Object browse bar VERY WIP 2018-09-11 10:13:30 -07:00
4ba90ff73e Object browse bar IN PROGRESS 2018-09-11 10:13:25 -07:00
eaa971cb56 Vue main section overhaul (#2161)
* Separate browse object from conductor

* Main layout convert to flex; padding and overflow at leaf node

* Inspector converted to BEM - WIP

 - Properties pool upper level styles converted;
 - Grid mixins moved out of Inspector and into _mixins;

* Refinements to misc elements

- user-select: none on tree;
- :before and :after reset globally to use box-sizing: border-box;
- li reset globally;

* Styling for buttons and menus; add Create button

 - WIP

* Context and Create menus

 - WIP

* Add glyph backgrounds as data URIs

- For Create menu, items grid;
- Objects only;

* Create menu refinements

- Min/max height handling;
- Code cleanup;

* Main layout head styling; various sanding

- head layout refined;
- c-icon-button, c-button-set added;
- background glyph mixin refined;
- Antialiasing refined to increase icon sharpness;

* Fix SVG data URLs: encode # chars as %23
2018-09-11 10:10:59 -07:00
0301d88033 [Table] style refactor (#2157)
* [Table] Use Vue SFCs

Use Vue SFCs.  Use inject/provide to pass services to components
instead of wrapping components in closures.

* Convert CSS to BEM  - WIP!

- All in progress;
- Headers table divorced from old;
- Sizing working properly at this point;

* Reset legacy file, undo unintended change commit

* Convert CSS to BEM  - WIP!

- All in progress;
- Sizing table divorced from legacy;

* Convert CSS to BEM  - WIP!

- All in progress;
- Table body divorced from legacy;

* Convert CSS to BEM  - WIP!

- Near done, converted tabular-holder from legacy;
- Unit testing in main view and in Layout frames;
- Modded legacy CSS to properly hide control-bar with new naming
when in Layout frame;

* Convert CSS to BEM - done

- Cleanup and organization;

* Convert CSS to BEM

- Further code cleanup;

* Convert CSS to BEM

- Further code cleanup;
- Remove legacy table style imports;
2018-09-05 15:05:40 -07:00
e2e0cf17db Splitter refinement
- Arrow icons;
- Code cleanup;
2018-09-05 13:29:14 -07:00
01a39f4fb7 [Inspector] More vue
commit 9b735b4f70bf4d21f64a1e418a5f9d7342567104
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Fri Aug 31 16:31:48 2018 -0700

    Slight HTML tweak

commit 3e58e140f9ea3640e5551d5f43abf837610c6fb4
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Fri Aug 31 16:26:36 2018 -0700

    [Inspector] Wire up elements pool

    Elements pool wired up to show angular elements pool.

commit d9c60f31bd6d32a5d2e2227d5476edd81e2e4360
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Fri Aug 31 13:56:04 2018 -0700

    [Inspector] vue inspector

    Create a vue inspctor which responds to selection events and shows
    object properties and inspector views.
2018-08-31 16:34:03 -07:00
1bb1330cba Squashed commit of the following:
commit 5aad2e6863
Author: charlesh88 <charlesh88@gmail.com>
Date:   Thu Aug 30 14:34:44 2018 -0700

    Code trimming / cleanup

    - pane tweaks;

commit 139e5ab184
Author: charlesh88 <charlesh88@gmail.com>
Date:   Thu Aug 30 13:50:26 2018 -0700

    Code trimming / cleanup

    - pane tweaks;

commit e3bb387139
Author: charlesh88 <charlesh88@gmail.com>
Date:   Thu Aug 30 13:38:35 2018 -0700

    Code trimming / cleanup

    - pane, Layout;

commit 6edaea0889
Author: charlesh88 <charlesh88@gmail.com>
Date:   Thu Aug 30 12:57:21 2018 -0700

    Collapse button new design and styling WIP

    - Also begin code cleanups;

commit bd8fab3726
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 29 18:04:47 2018 -0700

    Vertical pane resizing fixed

    - Vertical pane styling with significant fixes;

commit cf89e8a86f
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 29 16:52:53 2018 -0700

    Vertical pane resizing fixed

    - Vertical pane styling with significant fixes;

commit b3ad4c4c14
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 29 15:58:12 2018 -0700

    Vertical pane resizing fixed! Kind of...

    - pane__contents at 100% height is causing problems, fix this.
    - Normalized scss var names $splitterBtn*;
    - Added --reacts to pane to allow setting of proper flex attribs;

commit 49cead8cc6
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 28 19:07:23 2018 -0700

    WIP fixing vertical pane drag problem, still broken

    - Converting from flex-basis back to width / height;
    - Make inspector-adapter target proper holder;
    - Added --resizing class to allow user-select: none while dragging;
    - Added mixins for browser prefixing;

commit c6ff381cf0
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 28 14:56:50 2018 -0700

    New design for pane collapse buttons

    - Pane padding normalized;

commit 7cfbfe3d96
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 28 10:27:05 2018 -0700

    CSS sanding, panes and Inspector

    - Pane padding;
    - Inspector min-width;

commit 7d7eeff462
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 28 10:01:02 2018 -0700

    Pane transitions

    - Fixed pane transitions;

commit cf160c27e9
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 28 09:09:49 2018 -0700

    Splitter styling WIP

    - Hover styling

commit 022126ca21
Author: charlesh88 <charlesh88@gmail.com>
Date:   Mon Aug 27 21:18:14 2018 -0700

    Tree styling WIP

    - Mobile styling;
    - Increased hit area for desktop and mobile on tree item;
    - Added button mixin;
    - Fixed scrolling for tree in tree pane;

commit 3f1e649526
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 24 14:47:22 2018 -0700

    Drag collapse WIP

commit f9b764bb64
Author: charlesh88 <charlesh88@gmail.com>
Date:   Thu Aug 23 16:02:02 2018 -0700

    Significant changes to splitter handle and button approach

    - WIP!;
    - WIP on drag to collapse;

commit a1d9c11e82
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 22 17:55:21 2018 -0700

    Pane refactor styles WIP

    - WIP converting from width/height to flex-basis;

commit b65cca277e
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 22 17:54:34 2018 -0700

    Pane refactor styles WIP

    - WIP converting from width/height to flex-basis;

commit 3e71204529
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 22 17:51:07 2018 -0700

    Pane refactor styles WIP

    - Pane transitions;
    - TODO: convert from width/height to flex-basis;

commit b070cc27f4
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 22 10:21:14 2018 -0700

    Mobile styles WIP

    - Mobile layout mostly done;
    - Pane transitions;

commit 2ee7a77a86
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 21 15:56:12 2018 -0700

    Refinements to view control in tree

    - Changed state eval to use 'enabled', removed v-if;

commit 3a2439cd16
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 21 15:53:34 2018 -0700

    Mobile styles, VERY WIP

    WARNING: DON'T PULL!!
    - Mobile in progress;

commit 4e0dcb68bf
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 21 11:45:22 2018 -0700

    Markup / scss refactor mobile styles WIP

    - Layout, panes mobile styling WIP

commit 02afd44dd1
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 21 11:44:05 2018 -0700

    Markup / scss refactor styles WIP

    - Moved glyph constants into _constants to avoid multiple loads of
    glyph classes;

commit 703abe36c9
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Mon Aug 20 13:20:58 2018 -0700

    tree loads composition

    Expose legacy types in new API

    tree navigation

commit 80a185440b
Merge: 93196379a 8378dfa61
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 18:00:04 2018 -0700

    Merge branch 'core-vue-bootstrap' of https://github.com/nasa/openmct into core-vue-bootstrap

commit 93196379aa
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 17:59:43 2018 -0700

    Pane padding WIP

    - Adding resize handle direction to l-pane element;

commit bea135a221
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 17:48:20 2018 -0700

    Inspector styling

    - Moved legacy CSS as needed into MctInspector component;

commit 8378dfa613
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Fri Aug 17 17:31:12 2018 -0700

    Recursive tree items

commit e4420c17c6
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 17:02:20 2018 -0700

    Sanding and shimming on legacy CSS

    - Jury-rigging to temporarily display some views: imagery, tables
    - Code style normalization in _global.scss;

commit 5aa2be9761
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 16:22:54 2018 -0700

    Bring in legacy CSS

    - Legacy styles from old _global.scss moved into section of new
    _global file;
    - Most UI elements are working
    - TODO: fix Inspector grid

commit 8d4734ef5b
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 15:17:22 2018 -0700

    Remove commented CSS

commit e641aa6949
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 14:37:13 2018 -0700

    Main container and scroll-bar styling

commit c3262de1b7
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 14:14:01 2018 -0700

    Add status bar

commit 8addfb886e
Merge: e6be02fb8 4203dbf8e
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 13:52:11 2018 -0700

    Merge branch 'core-vue-bootstrap' of https://github.com/nasa/openmct into core-vue-bootstrap

commit e6be02fb8d
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 13:51:53 2018 -0700

    Splitter refinements / mixin fix

    - Splitter with resize grippy;
    - Fixed @background-image mixins;

commit 4203dbf8e1
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Fri Aug 17 13:46:38 2018 -0700

    Replace angular route with custom router

commit 5a07f0d2b5
Merge: e6b22cbcb 63f22c3f2
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 09:39:45 2018 -0700

    Merge branch 'core-vue-bootstrap' of https://github.com/nasa/openmct into core-vue-bootstrap

commit e6b22cbcbe
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 17 09:39:33 2018 -0700

    Markup / scss refactor WIP

    - Significant reorg of splitter CSS to reduce specificity;
    - Splitter enhancements for collapsed state;

commit 63f22c3f21
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Fri Aug 17 09:32:29 2018 -0700

    remove extraneous files

commit 17cf0cf1e6
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Thu Aug 16 12:43:10 2018 -0700

    Render main and inspector using angular

commit 233c17e75b
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 18:05:44 2018 -0700

    Markup / scss refactor WIP

    - Scroll on tree;
    - Class renaming pane > l-pane;
    - Refinements to collapsed state, WIP

commit 1eaa568e04
Merge: 82dd8e22e 3957fd619
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 17:28:45 2018 -0700

    Markup / scss refactor WIP

    - Merge latest from Pete

commit 82dd8e22e7
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 17:26:45 2018 -0700

    Markup / scss refactor WIP

    - Inspector styling - very WIP!

commit 3957fd619a
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 15 16:47:48 2018 -0700

    Tidy pane js

commit 91eefbfa7b
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 15 16:44:02 2018 -0700

    Pane cleanup

commit 5deff887fc
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 16:25:35 2018 -0700

    Markup / scss refactor WIP

    - Added disabled property to viewControl;
    - Margin for elements in main panes;
    - Main search input styled for --major;

commit 6708c79754
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 14:34:54 2018 -0700

    Markup / scss refactor WIP

    - Fix modifiers to correctly use '--';
    - Fix icon element in search input to disallow shrinking;

commit 7c83db11ad
Merge: e24852bb8 43f978e18
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 13:58:43 2018 -0700

    Merge branch 'core-vue-bootstrap' of https://github.com/nasa/openmct into core-vue-bootstrap

commit e24852bb83
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 13:57:27 2018 -0700

    Markup / scss refactor WIP

    - Tree item styling

commit 43f978e185
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 15 13:52:34 2018 -0700

    Use multipane instead of splitter

commit f67f03af47
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 15 12:43:32 2018 -0700

    new multipane

commit f6b90caaff
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 10:41:46 2018 -0700

    Markup / scss refactor WIP

    - Added view-control component

commit 4c5baf183a
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 15 10:38:26 2018 -0700

    Markup / scss refactor WIP

    - Added sass-base.scss to make it easier for SFC's to
    include needed SASS vars, mixins, etc. with a single import;
    - Cleaned up indention in Layout.vue;

commit b2d12f95ee
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 14 23:24:45 2018 -0700

    Markup / scss refactor WIP

    - Fix transition of magnify glass icon

commit 4449994ca4
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 14 17:31:47 2018 -0700

    Markup / scss refactor WIP

    - Added code comments

commit 84fde4bd34
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 14 17:29:50 2018 -0700

    Markup / scss refactor WIP

    - Search input dynamic behavior

commit 9424f9f49e
Author: charlesh88 <charlesh88@gmail.com>
Date:   Tue Aug 14 11:28:25 2018 -0700

    Markup / scss refactor WIP

    - Search input styling and dynamics WIP;

commit dfc02cdf25
Author: charlesh88 <charlesh88@gmail.com>
Date:   Mon Aug 13 15:34:29 2018 -0700

    Markup / scss refactor WIP

    - Add input-related styling;
    - Cleanup scss in various files;
    - Move search into own component;
    - Refine padding approach in pane-tree;

commit 94a3e9e798
Author: charlesh88 <charlesh88@gmail.com>
Date:   Mon Aug 13 14:36:41 2018 -0700

    Markup / scss refactor WIP

    - Add collapse buttons to splitter;

commit d35aed2d62
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 10 18:45:37 2018 -0700

    Markup / scss refactor WIP

    - Add some initial theme files; pull back from theme "override"
    approach;
    - Splitters refined;
    - Style cleanups;

commit 32cdecebce
Author: charlesh88 <charlesh88@gmail.com>
Date:   Fri Aug 10 14:53:16 2018 -0700

    Markup / scss refactor WIP

    - Markup and components corrected;
    - Stubbed in snow theme file;

commit f811318d18
Author: charlesh88 <charlesh88@gmail.com>
Date:   Thu Aug 9 16:02:22 2018 -0700

    Markup / scss refactor WIP

    - Add normalize.min to styles-new;
    - Factor components to be more standalone, very WIP;

commit 4d9b7fe3e4
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 18:06:11 2018 -0700

    Markup / scss refactor WIP

    - Add timestamp to webpack build

commit dd93653306
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 18:03:00 2018 -0700

    Markup / scss refactor WIP

    - Use MctTree component with passed properties;
    - MctTree markup and CSS ported from codepen;

commit 84430d34b1
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 17:39:26 2018 -0700

    Markup / scss refactor WIP

    - Add new splitter component with passed properties;

commit 50be483421
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 16:04:41 2018 -0700

    Markup / scss refactor WIP

    - Mixins file added;
    - Markup and -shell CSS from codepen brought over;

commit fe2667285e
Merge: c7bd7d97d 5219f5394
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 15:15:21 2018 -0700

    Merge branch 'core-vue-bootstrap' of https://github.com/nasa/openmct into core-vue-bootstrap

commit 5219f5394e
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 8 15:13:28 2018 -0700

    Add alias for styles directory

commit c7bd7d97dc
Merge: 0a7c16031 ab18bb348
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 13:55:44 2018 -0700

    Merge branch 'core-vue-bootstrap' of https://github.com/nasa/openmct into core-vue-bootstrap

commit ab18bb3484
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 8 13:48:27 2018 -0700

    Revert "temporarily use file loader for live-reload via plugin"

    This reverts commit 2f54f404c2.

commit 9c0d5f7dbf
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 8 13:48:17 2018 -0700

    Enable HMR in dev server

commit 0a7c160315
Author: charlesh88 <charlesh88@gmail.com>
Date:   Wed Aug 8 11:26:03 2018 -0700

    Markup / scss refactor WIP

    - Symbol fonts and glyphs files;
    - Constants, global, etc. in progress;

commit 0fa09e31a6
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 8 10:30:11 2018 -0700

    WIP new styles

commit 2f54f404c2
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Wed Aug 8 10:29:23 2018 -0700

    temporarily use file loader for live-reload via plugin

commit 279e0bf29d
Author: Pete Richards <peter.l.richards@nasa.gov>
Date:   Tue Aug 7 14:59:04 2018 -0700

    Beginning of new layout code.

    Really basic 5 component setup.
2018-08-31 12:03:15 -07:00
78c731dbf7 Reimplementation of tables in Vue (#2154)
* Reimplemented tables in Vue

* Updated table configuration to remove table namespace, and support column width in future.

* Fixed table configuration persistence

* Updated vue tables to use ES6 style function notation
2018-08-31 11:54:46 -07:00
0d53898af9 Build refactor to webpack (#2139)
* Move to webpack build
* Use webpack for building openmct.  Move SCSS to one folder and load
all core css up front.  Remove bower, begin removing gulp in favor
of npm run.
* Uses eslint instead of jshint and jscs.  Merge style checking rules
into .eshintrc.js, carrying over core parts of crockford style and
our adaptations.  Current code base fails to pass the linter, want
to separate linter changes from fixes to linting rules.
* Support for Vue SFC with example
* Remove outdated examples
* Use HTML loader for html (supports relative imports of resources e.g.
images) and raw-loader for when javascript must be loaded as text.
2018-08-07 14:47:50 -07:00
9582fb2b06 Merge pull request #2137 from nasa/prevent-plot-accidental-remove
[Plot] Update formDomainObject on mutate
2018-07-31 12:44:51 -07:00
3c075b7ff2 [Plot] pass persisted config in constructor
When a plot series is constructed, it checks to see if should set a
default interpolation based on the persisted configuration.  However,
the persisted configuration wasn't available until after construction
which resulted in the default value always being set.

Pass the persisted configuration through the constructor to ensure the
plot series can make the right decision about defaults.

Fixes #2120.
2018-07-31 12:33:10 -07:00
081edfbd70 Merge pull request #2127 from nasa/plot-requests-2126
[Plot] Prevent duplicate query on bounds change
2018-07-31 12:32:57 -07:00
04cc8f7aa2 [Plot] Update formDomainObject on mutate
When a new series is added to a plot, a plot series form controller
is instantiated and passed in a domain object via scope that it will
mutate upon changes.  If a mutation results in a composition add, then
the plot series form controller needs to get a version of the domain
object with the updated composition array, which it was not previously
doing.

This fixes #2120.
2018-07-31 12:03:49 -07:00
a1d206bfc3 [Remove] Add confirmation dialog (#1870)
* [Remove] Added confirmation dialog before the remove action is performed

Addresses #563
2018-07-27 13:54:41 -07:00
ef9c6d5fed [Plot] Prevent duplicate query on bounds change
Bounds change triggers a clearing of plot history, which triggers
a user interaction change, which was triggering a second query.

This change sets a flag to prevent the requery from the user interaction on
bounds change.  This flag could potentially be reused elsewhere, e.g. if we
wanted to prevent requery when not utilizing a minmax data source.

fixes #2126
2018-07-25 11:44:14 -07:00
15a75ac134 [Table] prevent forced reflow on scroll (#2117)
Prevent forcing a reflow during scroll events, improving scroll
performance.
2018-07-20 16:49:52 -07:00
cde3994979 [CI] Update circleCI to v2 (#1942)
* initial v2 config

t # This is a combination of 10 commits.

fix indent errs

fix indentations

run prepare manually

run prepare manually

remove indent

remove indent

remove indent

remove indent

remove indent

Misc

fix npm prepare

Install gulp

use gulp locally

use checkout

use old job

use old job

build-<test

build-<test

change

change

change

change

change

* add gulp as devdep

* local npm commands

* use node8

* cache bower components

* use npm to run checkstyle

* remove circlev1 config

* store artifacts

* clean up naming

fixes #1933
2018-07-20 16:00:13 -07:00
1a10c966e0 deprecated timeline (#2119)
* first release of deprecated timeline

* Better deprecation message and use unknown icon class

* Update deprecated-timeline-message.html

Added a period to end of sentence.

* remove unused files, and commented code - If we need timeline again we can recover from git

* Provide link to tracker in deprecation message
2018-07-20 15:45:30 -07:00
9288880e47 Add and Remove corresponding classes to capture higher contrast/print friendly png and jpg exports (#2088)
* add and remove corrensponding class to capture better images (wip)

* pass class through exportAsPng and exportAsJpg directly

* pass classname from stacked plots into exportImageService

* Adding additional export styles

Fixes #2088
- WIP

* WIP export styles

Fixes #2080
- Styling WIP;
- Moved styles into plots-main.scss;
- Change to how plot hashes are rendered;

* add class before clone, because adding it on clone was not rendering new css styles

* Export styles

Fixes #2080
- Code indenting cleaned up;
- Additional styles for export;
- Added hide effects for .h-local-controls and unsynced state;

* Apply class to cloned element only
2018-07-20 15:17:10 -07:00
d2c5476cdd [Plot] Update limit variable name (#2124)
Update limit variable name in template so that styles are properly
applied when hovering over plot.  Fixes #2084.
2018-07-20 14:40:29 -07:00
8d21d420ae Plot composition re-ordering support (#2120)
* [Plot] Allow 0 in plot y axis bounds

Allow 0 values in plot y axis bounds.  Also properly re-do validation
when changing from a bad value to the previously used good value.

Fixes https://github.com/nasa/openmct/issues/2082

* [Plot] separate config index from composition index

Locate the configuration index by checking identifiers instead of
relying on order of composition to match order of configuration.

Ensures that editing a plot after reordering composition does not
edit wrong object.

Fixes https://github.com/nasa/openmct/issues/2101

* [Plot] refactor form controllers, separate concerns

Refactor form controllers to simplify the plot options inspector.

Individual plot models each have a form controller which handles
three way binding between the scope, model, and domain object configuration.

Added support to linkFields for dynamic object paths so that mutations
always find the right object in the configuration instead of breaking
when indices change.

* support deferred init for sub-object selection

* Style fixes

* Remove assignment to window
2018-07-20 14:14:01 -07:00
577 changed files with 13409 additions and 22756 deletions

36
.circleci/config.yml Normal file
View File

@ -0,0 +1,36 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:8-browsers
environment:
CHROME_BIN: "/usr/bin/google-chrome"
steps:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Installing dependencies (npm install)
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: npm run test
command: npm run test
- run:
name: npm run lint
command: npm run lint
- store_artifacts:
path: dist
prefix: dist
workflows:
version: 2
test:
jobs:
- build

79
.eslintrc.js Normal file
View File

@ -0,0 +1,79 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"jasmine": true,
"amd": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"allowImportExportEverywhere": true,
"ecmaVersion": 2015,
"ecmaFeatures": {
"impliedStrict": true
}
},
"rules": {
"no-bitwise": "error",
"curly": "error",
"eqeqeq": "error",
"guard-for-in": "error",
"no-extend-native": "error",
"no-inner-declarations": "off",
"no-use-before-define": ["error", "nofunc"],
"no-caller": "error",
"no-sequences": "error",
"no-irregular-whitespace": "error",
"no-new": "error",
"no-shadow": "error",
"no-undef": "error",
"no-unused-vars": [
"error",
{
"vars": "all",
"args": "none"
}
],
"no-console": "off",
"no-trailing-spaces": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"asyncArrow": "always",
"named": "never",
}
],
"array-bracket-spacing": "error",
"space-in-parens": "error",
"space-before-blocks": "error",
"comma-dangle": "error",
"eol-last": "error",
"new-cap": [
"error",
{
"capIsNew": false,
"properties": false
}
],
"dot-notation": "error",
"indent": ["error", 4]
},
"overrides": [
{
"files": ["*Spec.js"],
"rules": {
"no-unused-vars": [
"warn",
{
"vars": "all",
"args": "none",
"varsIgnorePattern": "controller",
}
]
}
}
]
};

View File

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

View File

@ -1,26 +0,0 @@
{
"bitwise": 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",
"WeakMap",
"Map"
],
"shadow": "outer",
"strict": "implied",
"undef": true,
"unused": "vars",
"latedef": "nofunc"
}

View File

@ -84,7 +84,6 @@ Documentation will be generated in `target/docs`.
## Deploying Open MCT ## Deploying Open MCT
Open MCT is built using [`npm`](http://npmjs.com/) Open MCT is built using [`npm`](http://npmjs.com/)
and [`gulp`](http://gulpjs.com/).
To build Open MCT for deployment: To build Open MCT for deployment:
@ -94,32 +93,13 @@ 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 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 source code. * `openmct.js` - Open MCT source code.
* Various assets in the `example` and `platform` directories. * `openmct.css` - Basic styles to load to prevent a FOUC.
* An `index.html` that runs Open MCT in its default configuration. * `index.html`, an example to run Open MCT in the basic configuration.
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
## Bundles
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)
that is intended to be added or removed as a single unit. A plug-in for
Open MCT will be expressed as a bundle; platform components are also
expressed as bundles.
A bundle is also just a directory which contains a file `bundle.json`,
which declares its contents.
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
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
application.
## Tests ## Tests
Tests are written for [Jasmine 1.3](http://jasmine.github.io/1.3/introduction.html) Tests are written for [Jasmine 3](http://jasmine.github.io/)
and run by [Karma](http://karma-runner.github.io). To run: and run by [Karma](http://karma-runner.github.io). To run:
`npm test` `npm test`

79
app.js
View File

@ -7,28 +7,17 @@
* node app.js [options] * node app.js [options]
*/ */
(function () {
"use strict";
var BUNDLE_FILE = 'bundles.json', const options = require('minimist')(process.argv.slice(2));
options = require('minimist')(process.argv.slice(2)), const express = require('express');
express = require('express'), const app = express();
app = express(), const fs = require('fs');
fs = require('fs'), const request = require('request');
request = require('request');
// Defaults // Defaults
options.port = options.port || options.p || 8080; options.port = options.port || options.p || 8080;
options.host = options.host || options.h || 'localhost' options.host = options.host || options.h || 'localhost'
options.directory = options.directory || options.D || '.'; options.directory = options.directory || options.D || '.';
['include', 'exclude', 'i', 'x'].forEach(function (opt) {
options[opt] = options[opt] || [];
// Make sure includes/excludes always end up as arrays
options[opt] = Array.isArray(options[opt]) ?
options[opt] : [options[opt]];
});
options.include = options.include.concat(options.i);
options.exclude = options.exclude.concat(options.x);
// Show command line options // Show command line options
if (options.help || options.h) { if (options.help || options.h) {
@ -36,8 +25,6 @@
console.log("Options:"); console.log("Options:");
console.log(" --help, -h Show this message."); console.log(" --help, -h Show this message.");
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(" --exclude, -x <bundle> Exclude the specified bundle.");
console.log(" --directory, -D <bundle> Serve files from specified directory."); console.log(" --directory, -D <bundle> Serve files from specified directory.");
console.log(""); console.log("");
process.exit(0); process.exit(0);
@ -45,28 +32,6 @@
app.disable('x-powered-by'); app.disable('x-powered-by');
// Override bundles.json for HTTP requests
app.use('/' + BUNDLE_FILE, function (req, res) {
var bundles;
try {
bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8'));
} catch (e) {
bundles = [];
}
// Handle command line inclusions/exclusions
bundles = bundles.concat(options.include);
bundles = bundles.filter(function (bundle) {
return options.exclude.indexOf(bundle) === -1;
});
bundles = bundles.filter(function (bundle, index) { // Uniquify
return bundles.indexOf(bundle) === index;
});
res.send(JSON.stringify(bundles));
});
app.use('/proxyUrl', function proxyRequest(req, res, next) { app.use('/proxyUrl', function proxyRequest(req, res, next) {
console.log('Proxying request to: ', req.query.url); console.log('Proxying request to: ', req.query.url);
req.pipe(request({ req.pipe(request({
@ -75,11 +40,39 @@
}).on('error', next)).pipe(res); }).on('error', next)).pipe(res);
}); });
// Expose everything else as static files const webpack = require('webpack');
app.use(express['static'](options.directory)); const webpackConfig = require('./webpack.config.js');
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
webpackConfig.plugins.push(function() { this.plugin('watch-run', function(watching, callback) { console.log('Begin compile at ' + new Date()); callback(); }) });
webpackConfig.entry.openmct = [
'webpack-hot-middleware/client',
webpackConfig.entry.openmct
];
const compiler = webpack(webpackConfig);
app.use(require('webpack-dev-middleware')(
compiler,
{
publicPath: '/dist',
logLevel: 'warn'
}
));
app.use(require('webpack-hot-middleware')(
compiler,
{
}
));
// Expose index.html for development users.
app.get('/', function (req, res) {
fs.createReadStream('index.html').pipe(res);
});
// Finally, open the HTTP server and log the instance to the console // Finally, open the HTTP server and log the instance to the console
app.listen(options.port, options.host, function() { app.listen(options.port, options.host, function() {
console.log('Open MCT application running at %s:%s', options.host, options.port) console.log('Open MCT application running at %s:%s', options.host, options.port)
}); });
}());

View File

@ -1,27 +0,0 @@
{
"name": "openmct",
"description": "The Open MCT core platform",
"main": "",
"license": "Apache-2.0",
"moduleType": [],
"homepage": "http://nasa.github.io/openmct/",
"private": true,
"dependencies": {
"angular": "1.4.4",
"angular-route": "1.4.4",
"moment": "^2.11.1",
"moment-duration-format": "^1.3.0",
"requirejs": "~2.1.22",
"text": "requirejs-text#^2.0.14",
"es6-promise": "^3.3.0",
"screenfull": "^3.0.0",
"node-uuid": "^1.4.7",
"comma-separated-values": "^3.6.4",
"file-saver": "1.3.3",
"zepto": "^1.1.6",
"eventemitter3": "^1.2.0",
"lodash": "3.10.1",
"almond": "~0.3.2",
"moment-timezone": "^0.5.13"
}
}

View File

@ -1,27 +0,0 @@
machine:
node:
version: 8.11.0
dependencies:
pre:
- npm install -g npm@latest
deployment:
production:
branch: master
commands:
- npm install canvas nomnoml
- ./build-docs.sh
openmctweb-staging-deux:
branch: mobile
heroku:
appname: openmctweb-staging-deux
test:
post:
- gulp lint
- gulp checkstyle
general:
branches:
ignore:
- gh-pages

View File

@ -1,8 +0,0 @@
This bundle is intended to serve as an example of registering
extensions which are mapped directly to built-in Angular features.
These are:
* Controllers
* Directives
* Routes
* Services

View File

@ -1,74 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/ExampleController",
"./src/ExampleDirective",
"./src/ExampleService",
'legacyRegistry'
], function (
ExampleController,
ExampleDirective,
ExampleService,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/builtins", {
"name": "Angular Built-ins Example",
"description": "Example showing how to declare extensions with built-in support from Angular.",
"sources": "src",
"extensions": {
"controllers": [
{
"key": "ExampleController",
"implementation": ExampleController,
"depends": [
"$scope",
"exampleService"
]
}
],
"directives": [
{
"key": "exampleDirective",
"implementation": ExampleDirective,
"depends": [
"examples[]"
]
}
],
"routes": [
{
"templateUrl": "templates/example.html"
}
],
"services": [
{
"key": "exampleService",
"implementation": ExampleService
}
]
}
});
});

View File

@ -1,24 +0,0 @@
<!--
Open MCT, Copyright (c) 2014-2017, United States Government
as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved.
Open MCT is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Open MCT includes source code licensed under additional open source
licenses. See the Open Source Licenses file (LICENSES.md) included with
this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information.
-->
<p>Hello, world! I am the default route.</p>
<p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p>
<span example-directive></span>

View File

@ -1,42 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining ExampleController. Created by vwoeltje on 11/4/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function ExampleController($scope, exampleService) {
$scope.phrase = exampleService.getMessage();
}
return ExampleController;
}
);

View File

@ -1,66 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining ExampleDirective. Created by vwoeltje on 11/4/14.
*/
define(
[],
function () {
"use strict";
var HAS_EXTENSIONS = "A directive loaded these message from " +
"example extensions.",
NO_EXTENSIONS = "A directive tried to load example extensions," +
" but found none.",
MESSAGE = "I heard this from my partial constructor.";
/**
*
* @constructor
*/
function ExampleDirective(examples) {
// Build up a template from example extensions
var template = examples.length > 0 ?
HAS_EXTENSIONS : NO_EXTENSIONS;
template += "<ul>";
examples.forEach(function (E) {
template += "<li>";
if (typeof E === 'function') {
template += (new E(MESSAGE)).getText();
} else {
template += E.text;
}
template += "</li>";
});
template += "</ul>";
return {
template: template
};
}
return ExampleDirective;
}
);

View File

@ -1,46 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining ExampleService. Created by vwoeltje on 11/4/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function ExampleService() {
return {
getMessage: function () {
return "I heard this from a service";
}
};
}
return ExampleService;
}
);

View File

@ -1,82 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/SomeProvider",
"./src/SomeOtherProvider",
"./src/SomeDecorator",
"./src/SomeOtherDecorator",
"./src/SomeAggregator",
"./src/SomeOtherExample",
'legacyRegistry'
], function (
SomeProvider,
SomeOtherProvider,
SomeDecorator,
SomeOtherDecorator,
SomeAggregator,
SomeOtherExample,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/composite", {
"extensions": {
"components": [
{
"implementation": SomeProvider,
"provides": "someService",
"type": "provider"
},
{
"implementation": SomeOtherProvider,
"provides": "someService",
"type": "provider"
},
{
"implementation": SomeDecorator,
"provides": "someService",
"type": "decorator"
},
{
"implementation": SomeOtherDecorator,
"provides": "someService",
"type": "decorator"
},
{
"implementation": SomeAggregator,
"provides": "someService",
"type": "aggregator"
}
],
"examples": [
{
"implementation": SomeOtherExample,
"depends": [
"someService"
]
}
]
}
});
});

View File

@ -1,50 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeAggregator. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeAggregator(someProviders) {
return {
getMessages: function () {
return someProviders.map(function (provider) {
return provider.getMessages();
}).reduce(function (a, b) {
return a.concat(b);
}, []);
}
};
}
return SomeAggregator;
}
);

View File

@ -1,48 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeDecorator. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeDecorator(someProvider) {
return {
getMessages: function () {
return someProvider.getMessages().map(function (msg) {
return msg.toLocaleUpperCase();
});
}
};
}
return SomeDecorator;
}
);

View File

@ -1,48 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeOtherDecorator. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeOtherDecorator(someProvider) {
return {
getMessages: function () {
return someProvider.getMessages().map(function (msg) {
return msg + "...";
});
}
};
}
return SomeOtherDecorator;
}
);

View File

@ -1,46 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeOtherExample. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeOtherExample(someService) {
return {
getText: function () {
return someService.getMessages().join(" | ");
}
};
}
return SomeOtherExample;
}
);

View File

@ -1,48 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeOtherProvider. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeOtherProvider() {
return {
getMessages: function () {
return [
"I am a message from some other provider."
];
}
};
}
return SomeOtherProvider;
}
);

View File

@ -1,48 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeProvider. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeProvider() {
return {
getMessages: function () {
return [
"I am a message from some provider."
];
}
};
}
return SomeProvider;
}
);

View File

@ -27,12 +27,11 @@
* Modified by shale on 06/23/2015. * Modified by shale on 06/23/2015.
*/ */
define( define(
['text!../data/transcript.json'], ['../data/transcript.json'],
function (transcript) { function (messages) {
"use strict"; "use strict";
var firstObservedTime = Date.now(), var firstObservedTime = Date.now();
messages = JSON.parse(transcript);
function EventTelemetry(request, interval) { function EventTelemetry(request, interval) {

View File

@ -1,51 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/SomeExample",
'legacyRegistry'
], function (
SomeExample,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/extensions", {
"name": "Custom Extensions Examples",
"description": "Example showing how to declare custom extensions.",
"sources": "src",
"extensions": {
"examples": [
{
"text": "I came from example/extensions"
},
{
"implementation": SomeExample,
"depends": [
"exampleService"
]
}
]
}
});
});

View File

@ -1,52 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/**
* Module defining SomeExample. Created by vwoeltje on 11/5/14.
*/
define(
[],
function () {
"use strict";
/**
*
* @constructor
*/
function SomeExample(exampleService, message) {
return {
getText: function () {
return [
'"',
exampleService.getMessage(),
'" and "',
message,
'"'
].join("");
}
};
}
return SomeExample;
}
);

View File

@ -27,8 +27,14 @@ define([
) { ) {
var RED = 0.9, var RED = {
YELLOW = 0.5, sin: 0.9,
cos: 0.9
},
YELLOW = {
sin: 0.5,
cos: 0.5
},
LIMITS = { LIMITS = {
rh: { rh: {
cssClass: "s-limit-upr s-limit-red", cssClass: "s-limit-upr s-limit-red",
@ -67,17 +73,18 @@ define([
SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) { SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) {
return { return {
evaluate: function (datum, valueMetadata) { evaluate: function (datum, valueMetadata) {
var range = valueMetadata ? valueMetadata.key : 'sin' var range = valueMetadata && valueMetadata.key;
if (datum[range] > RED) {
if (datum[range] > RED[range]) {
return LIMITS.rh; return LIMITS.rh;
} }
if (datum[range] < -RED) { if (datum[range] < -RED[range]) {
return LIMITS.rl; return LIMITS.rl;
} }
if (datum[range] > YELLOW) { if (datum[range] > YELLOW[range]) {
return LIMITS.yh; return LIMITS.yh;
} }
if (datum[range] < -YELLOW) { if (datum[range] < -YELLOW[range]) {
return LIMITS.yl; return LIMITS.yl;
} }
} }

View File

@ -21,7 +21,7 @@
*****************************************************************************/ *****************************************************************************/
define([ define([
'text!./generatorWorker.js', 'raw-loader!./generatorWorker.js',
'uuid' 'uuid'
], function ( ], function (
workerText, workerText,

View File

@ -0,0 +1,19 @@
<template>
<div class="example">{{ msg }}</div>
</template>
<script>
export default {
data () {
return {
msg: 'Hello world!'
}
}
}
</script>
<style>
.example {
color: red;
}
</style>

View File

@ -0,0 +1,37 @@
import Vue from 'Vue';
import HelloWorld from './HelloWorld.vue';
function SimpleVuePlugin () {
return function install(openmct) {
var views = (openmct.mainViews || openmct.objectViews);
openmct.types.addType('hello-world', {
name: 'Hello World',
description: 'An introduction object',
creatable: true
});
openmct.objectViews.addProvider({
name: "demo-provider",
key: "hello-world",
cssClass: "icon-packet",
canView: function (d) {
return d.type === 'hello-world';
},
view: function (domainObject) {
var vm;
return {
show: function (container) {
vm = new Vue(HelloWorld);
container.appendChild(vm.$mount().$el);
},
destroy: function (container) {
vm.$destroy();
}
};
}
});
}
}
export default SimpleVuePlugin

View File

@ -1,10 +1,26 @@
define([ define([
"./src/ExampleStyleGuideModelProvider", "./src/ExampleStyleGuideModelProvider",
"./src/MCTExample", "./src/MCTExample",
"./res/templates/intro.html",
"./res/templates/standards.html",
"./res/templates/colors.html",
"./res/templates/status.html",
"./res/templates/glyphs.html",
"./res/templates/controls.html",
"./res/templates/input.html",
"./res/templates/menus.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ExampleStyleGuideModelProvider, ExampleStyleGuideModelProvider,
MCTExample, MCTExample,
introTemplate,
standardsTemplate,
colorsTemplate,
statusTemplate,
glyphsTemplate,
controlsTemplate,
inputTemplate,
menusTemplate,
legacyRegistry legacyRegistry
) { ) {
legacyRegistry.register("example/styleguide", { legacyRegistry.register("example/styleguide", {
@ -23,14 +39,14 @@ define([
{ "key": "styleguide.menus", "name": "Menus", "cssClass": "icon-page", "description": "Context menus, dropdowns" } { "key": "styleguide.menus", "name": "Menus", "cssClass": "icon-page", "description": "Context menus, dropdowns" }
], ],
"views": [ "views": [
{ "key": "styleguide.intro", "type": "styleguide.intro", "templateUrl": "templates/intro.html", "editable": false }, { "key": "styleguide.intro", "type": "styleguide.intro", "template": introTemplate, "editable": false },
{ "key": "styleguide.standards", "type": "styleguide.standards", "templateUrl": "templates/standards.html", "editable": false }, { "key": "styleguide.standards", "type": "styleguide.standards", "template": standardsTemplate, "editable": false },
{ "key": "styleguide.colors", "type": "styleguide.colors", "templateUrl": "templates/colors.html", "editable": false }, { "key": "styleguide.colors", "type": "styleguide.colors", "template": colorsTemplate, "editable": false },
{ "key": "styleguide.status", "type": "styleguide.status", "templateUrl": "templates/status.html", "editable": false }, { "key": "styleguide.status", "type": "styleguide.status", "template": statusTemplate, "editable": false },
{ "key": "styleguide.glyphs", "type": "styleguide.glyphs", "templateUrl": "templates/glyphs.html", "editable": false }, { "key": "styleguide.glyphs", "type": "styleguide.glyphs", "template": glyphsTemplate, "editable": false },
{ "key": "styleguide.controls", "type": "styleguide.controls", "templateUrl": "templates/controls.html", "editable": false }, { "key": "styleguide.controls", "type": "styleguide.controls", "template": controlsTemplate, "editable": false },
{ "key": "styleguide.input", "type": "styleguide.input", "templateUrl": "templates/input.html", "editable": false }, { "key": "styleguide.input", "type": "styleguide.input", "template": inputTemplate, "editable": false },
{ "key": "styleguide.menus", "type": "styleguide.menus", "templateUrl": "templates/menus.html", "editable": false } { "key": "styleguide.menus", "type": "styleguide.menus", "template": menusTemplate, "editable": false }
], ],
"roots": [ "roots": [
{ {
@ -85,16 +101,6 @@ define([
"$q" "$q"
] ]
} }
],
"stylesheets": [
{
"stylesheetUrl": "css/style-guide-espresso.css",
"theme": "espresso"
},
{
"stylesheetUrl": "css/style-guide-snow.css",
"theme": "snow"
}
] ]
} }
}); });

View File

@ -34,7 +34,7 @@
<p>As you develop plugins for Open MCT, consider how a generalized component might be combined with others when designing to create a rich and powerful larger object, rather than adding a single monolithic, non-modular plugin. To solve a particular problem or allow a new feature in Open MCT, you may need to introduce more than just one new object type.</p> <p>As you develop plugins for Open MCT, consider how a generalized component might be combined with others when designing to create a rich and powerful larger object, rather than adding a single monolithic, non-modular plugin. To solve a particular problem or allow a new feature in Open MCT, you may need to introduce more than just one new object type.</p>
</div> </div>
<div class="col"> <div class="col">
<img src="/example/styleguide/res/images/diagram-objects.svg" /> <img src="../images/diagram-objects.svg" />
</div> </div>
</div> </div>
</div> </div>
@ -48,7 +48,7 @@
<p>The types of objects that a container can hold should be based on the purpose of the container and the views that it affords. For example, a Folders purpose is to allow a user to conceptually organize objects of all other types; a Folder must therefore be able to contain an object of any type.</p> <p>The types of objects that a container can hold should be based on the purpose of the container and the views that it affords. For example, a Folders purpose is to allow a user to conceptually organize objects of all other types; a Folder must therefore be able to contain an object of any type.</p>
</div> </div>
<div class="col"> <div class="col">
<img src="/example/styleguide/res/images/diagram-containment.svg" /> <img src="../images/diagram-containment.svg" />
</div> </div>
</div> </div>
</div> </div>
@ -60,7 +60,7 @@
<p>Views are simply different ways to view the content of a given object. For example, telemetry data could be viewed as a plot or a table. A clock can display its time in analog fashion or with digital numbers. In each view, all of the content is present; its just represented differently. When providing views for an object, all the content of the object should be present in each view.</p> <p>Views are simply different ways to view the content of a given object. For example, telemetry data could be viewed as a plot or a table. A clock can display its time in analog fashion or with digital numbers. In each view, all of the content is present; its just represented differently. When providing views for an object, all the content of the object should be present in each view.</p>
</div> </div>
<div class="col"> <div class="col">
<img src="/example/styleguide/res/images/diagram-views.svg" /> <img src="../images/diagram-views.svg" />
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
define([ define([
'text!../res/templates/mct-example.html' '../res/templates/mct-example.html'
], function ( ], function (
MCTExampleTemplate MCTExampleTemplate
) { ) {

View File

@ -1,68 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/ExampleTaxonomyModelProvider",
'legacyRegistry'
], function (
ExampleTaxonomyModelProvider,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/taxonomy", {
"name": "Example taxonomy",
"description": "Example illustrating the addition of a static top-level hierarchy",
"extensions": {
"roots": [
{
"id": "exampleTaxonomy"
}
],
"models": [
{
"id": "exampleTaxonomy",
"model": {
"type": "folder",
"name": "Stub Subsystems",
"composition": [
"examplePacket0",
"examplePacket1",
"examplePacket2"
]
}
}
],
"components": [
{
"provides": "modelService",
"type": "provider",
"implementation": ExampleTaxonomyModelProvider,
"depends": [
"$q"
]
}
]
}
});
});

View File

@ -1,69 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
[],
function () {
"use strict";
function ExampleTaxonomyModelProvider($q) {
var models = {},
packetId,
telemetryId,
i,
j;
// Add some "subsystems"
for (i = 0; i < 3; i += 1) {
packetId = "examplePacket" + i;
models[packetId] = {
name: "Stub Subsystem " + (i + 1),
type: "telemetry.panel",
composition: []
};
// Add some "telemetry points"
for (j = 0; j < 100 * (i + 1); j += 1) {
telemetryId = "exampleTelemetry" + j;
models[telemetryId] = {
name: "SWG" + i + "." + j,
type: "generator",
telemetry: {
period: 10 + i + j
}
};
models[packetId].composition.push(telemetryId);
}
}
return {
getModels: function () {
return $q.when(models);
}
};
}
return ExampleTaxonomyModelProvider;
}
);

View File

@ -1 +0,0 @@
Example of running a Web Worker using the `workerService`.

View File

@ -1,52 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define([
"./src/FibonacciIndicator",
'legacyRegistry'
], function (
FibonacciIndicator,
legacyRegistry
) {
"use strict";
legacyRegistry.register("example/worker", {
"extensions": {
"indicators": [
{
"implementation": FibonacciIndicator,
"depends": [
"workerService",
"$rootScope"
]
}
],
"workers": [
{
"key": "example.fibonacci",
"scriptUrl": "FibonacciWorker.js"
}
]
}
});
});

View File

@ -1,67 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
[],
function () {
"use strict";
/**
* Displays Fibonacci numbers in the status area.
* @constructor
*/
function FibonacciIndicator(workerService, $rootScope) {
var latest,
counter = 0,
worker = workerService.run('example.fibonacci');
function requestNext() {
worker.postMessage([counter]);
counter += 1;
}
function handleResponse(event) {
latest = event.data;
$rootScope.$apply();
requestNext();
}
worker.onmessage = handleResponse;
requestNext();
return {
getCssClass: function () {
return "icon-object-unknown";
},
getText: function () {
return "" + latest;
},
getDescription: function () {
return "";
}
};
}
return FibonacciIndicator;
}
);

View File

@ -1,15 +0,0 @@
/*global self*/
(function () {
"use strict";
// Calculate fibonacci numbers inefficiently.
// We can do this because we're on a background thread, and
// won't halt the UI.
function fib(n) {
return n < 2 ? n : (fib(n - 1) + fib(n - 2));
}
self.onmessage = function (event) {
self.postMessage(fib(event.data));
};
}());

View File

@ -1,182 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global require,__dirname*/
require("v8-compile-cache");
var gulp = require('gulp'),
sourcemaps = require('gulp-sourcemaps'),
path = require('path'),
fs = require('fs'),
git = require('git-rev-sync'),
moment = require('moment'),
project = require('./package.json'),
_ = require('lodash'),
paths = {
main: 'openmct.js',
dist: 'dist',
reports: 'dist/reports',
scss: ['./platform/**/*.scss', './example/**/*.scss'],
assets: [
'./{example,platform}/**/*.{css,css.map,png,svg,ico,woff,eot,ttf}'
],
scripts: [ 'openmct.js', 'platform/**/*.js', 'src/**/*.js' ],
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
},
options = {
requirejsOptimize: {
name: 'bower_components/almond/almond.js',
include: paths.main.replace('.js', ''),
wrap: {
start: (function () {
var buildVariables = {
version: project.version,
timestamp: moment.utc(Date.now()).format(),
revision: fs.existsSync('.git') ? git.long() : 'Unknown',
branch: fs.existsSync('.git') ? git.branch() : 'Unknown'
};
return fs.readFileSync("src/start.frag", 'utf-8')
.replace(/@@(\w+)/g, function (match, key) {
return buildVariables[key];
});;
}()),
endFile: "src/end.frag"
},
optimize: 'uglify2',
uglify2: { output: { comments: /@preserve/ } },
mainConfigFile: paths.main,
wrapShim: true
},
karma: {
configFile: path.resolve(__dirname, 'karma.conf.js'),
singleRun: true
},
sass: {
sourceComments: true
}
};
if (process.env.NODE_ENV === 'development') {
options.requirejsOptimize.optimize = 'none';
}
gulp.task('scripts', function () {
var requirejsOptimize = require('gulp-requirejs-optimize');
return gulp.src(paths.main)
.pipe(sourcemaps.init())
.pipe(requirejsOptimize(options.requirejsOptimize))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.dist));
});
gulp.task('test', function (done) {
var karma = require('karma');
new karma.Server(options.karma, done).start();
});
gulp.task('stylesheets', function () {
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var bourbon = require('node-bourbon');
options.sass.includePaths = bourbon.includePaths;
return gulp.src(paths.scss, {base: '.'})
.pipe(sourcemaps.init())
.pipe(sass(options.sass).on('error', sass.logError))
.pipe(rename(function (file) {
file.dirname =
file.dirname.replace(path.sep + 'sass', path.sep + 'css');
return file;
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(__dirname));
});
gulp.task('lint', function () {
var jshint = require('gulp-jshint');
var merge = require('merge-stream');
var nonspecs = paths.specs.map(function (glob) {
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('gulp-jshint-html-reporter', {
filename: paths.reports + '/lint/jshint-report.html',
createMissingFolders : true
}))
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('checkstyle', function () {
var jscs = require('gulp-jscs');
var mkdirp = require('mkdirp');
var reportName = 'jscs-html-report.html';
var reportPath = path.resolve(paths.reports, 'checkstyle', reportName);
var moveReport = fs.rename.bind(fs, reportName, reportPath, _.noop);
mkdirp.sync(path.resolve(paths.reports, 'checkstyle'));
return gulp.src(paths.scripts)
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter('jscs-html-reporter')).on('finish', moveReport)
.pipe(jscs.reporter('fail'));
});
gulp.task('fixstyle', function () {
var jscs = require('gulp-jscs');
return gulp.src(paths.scripts, { base: '.' })
.pipe(jscs({ fix: true }))
.pipe(gulp.dest('.'));
});
gulp.task('assets', ['stylesheets'], function () {
return gulp.src(paths.assets)
.pipe(gulp.dest(paths.dist));
});
gulp.task('watch', function () {
return gulp.watch(paths.scss, ['stylesheets', 'assets']);
});
gulp.task('serve', function () {
console.log('Running development server with all defaults');
var app = require('./app.js');
});
gulp.task('develop', ['serve', 'stylesheets', 'watch']);
gulp.task('install', [ 'assets', 'scripts' ]);
gulp.task('verify', [ 'lint', 'test', 'checkstyle' ]);
gulp.task('build', [ 'verify', 'install' ]);

View File

@ -26,11 +26,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<title></title> <title></title>
<script src="bower_components/requirejs/require.js"> </script> <script src="dist/openmct.js"></script>
<link rel="stylesheet" href="dist/openmct.css">
<link rel="icon" type="image/png" href="dist/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="dist/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="dist/favicons/favicon-16x16.png" sizes="16x16">
<link rel="shortcut icon" href="dist/favicons/favicon.ico">
</head>
<body>
</body>
<script> <script>
var THIRTY_MINUTES = 30 * 60 * 1000; var THIRTY_MINUTES = 30 * 60 * 1000;
require(['openmct'], function (openmct) {
[ [
'example/eventGenerator', 'example/eventGenerator',
'example/styleguide' 'example/styleguide'
@ -39,7 +45,6 @@
); );
openmct.install(openmct.plugins.MyItems()); openmct.install(openmct.plugins.MyItems());
openmct.install(openmct.plugins.LocalStorage()); openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.Espresso());
openmct.install(openmct.plugins.Generator()); openmct.install(openmct.plugins.Generator());
openmct.install(openmct.plugins.ExampleImagery()); openmct.install(openmct.plugins.ExampleImagery());
openmct.install(openmct.plugins.UTCTimeSystem()); openmct.install(openmct.plugins.UTCTimeSystem());
@ -73,19 +78,5 @@
openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0}); openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0});
openmct.time.timeSystem('utc'); openmct.time.timeSystem('utc');
openmct.start(); openmct.start();
window.openmct = openmct;
});
</script> </script>
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">
<link rel="stylesheet" href="platform/commonUI/general/res/css/openmct.css">
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-16x16.png" sizes="16x16">
<link rel="shortcut icon" href="platform/commonUI/general/res/images/favicons/favicon.ico">
</head>
<body>
<div class="l-splash-holder s-splash-holder">
<div class="l-splash s-splash"></div>
</div>
</body>
</html> </html>

View File

@ -21,70 +21,40 @@
*****************************************************************************/ *****************************************************************************/
/*global module,process*/ /*global module,process*/
module.exports = function(config) {
const devMode = process.env.NODE_ENV !== 'production';
module.exports = (config) => {
const webpackConfig = require('./webpack.config.js');
delete webpackConfig.output;
if (!devMode) {
webpackConfig.module.rules.push({
test: /\.js$/,
exclude: /node_modules|example/,
use: 'istanbul-instrumenter-loader'
});
}
config.set({ config.set({
// Base path that will be used to resolve all file patterns.
basePath: '', basePath: '',
frameworks: ['jasmine'],
// Frameworks to use
// Available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'requirejs'],
// List of files / patterns to load in the browser.
// By default, files are also included in a script tag.
files: [ files: [
{pattern: 'bower_components/**/*.js', included: false}, 'platform/**/*Spec.js',
{pattern: 'node_modules/d3-*/**/*.js', included: false}, 'src/**/*Spec.js'
{pattern: 'node_modules/vue/**/*.js', included: false},
{pattern: 'node_modules/printj/dist/*.js', included: false},
{pattern: 'src/**/*', included: false},
{pattern: 'node_modules/painterro/build/*.js', included: false},
{pattern: 'node_modules/html2canvas/dist/*', included: false},
{pattern: 'example/**/*.html', included: false},
{pattern: 'example/**/*.js', included: false},
{pattern: 'example/**/*.json', included: false},
{pattern: 'platform/**/*.js', included: false},
{pattern: 'warp/**/*.js', included: false},
{pattern: 'platform/**/*.html', included: false},
'test-main.js'
], ],
// List of files to exclude.
exclude: [
'platform/framework/src/Main.js'
],
// Preprocess matching files before serving them to the browser.
// https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/**/!(*Spec).js': [ 'coverage' ],
'platform/**/src/**/!(*Spec).js': [ 'coverage' ]
},
// Test results reporter to use
// Possible values: 'dots', 'progress'
// Available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage', 'html'],
// Web server port.
port: 9876, port: 9876,
reporters: [
// Wnable / disable colors in the output (reporters and logs). 'progress',
'coverage',
'html'
],
browsers: ['ChromeHeadless'],
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
// Rerun tests when any file changes.
autoWatch: true, autoWatch: true,
// Specify browsers to run tests in.
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [
'ChromeHeadless'
],
// Code coverage reporting.
coverageReporter: { coverageReporter: {
dir: process.env.CIRCLE_ARTIFACTS ? dir: process.env.CIRCLE_ARTIFACTS ?
process.env.CIRCLE_ARTIFACTS + '/coverage' : process.env.CIRCLE_ARTIFACTS + '/coverage' :
@ -104,8 +74,19 @@ module.exports = function(config) {
foldAll: false foldAll: false
}, },
// Continuous Integration mode. preprocessors: {
// If true, Karma captures browsers, runs the tests and exits. // add webpack as preprocessor
'platform/**/*Spec.js': [ 'webpack' ],
'src/**/*Spec.js': [ 'webpack' ]
},
webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only',
logLevel: 'warn'
},
singleRun: true singleRun: true
}); });
}; }

View File

@ -19,102 +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 requirejs,BUILD_CONSTANTS*/ /*global module,BUILD_CONSTANTS*/
requirejs.config({ const matcher = /\/openmct.js$/;
"paths": { if (document.currentScript) {
"legacyRegistry": "src/legacyRegistry", let src = document.currentScript.src;
"angular": "bower_components/angular/angular.min", if (src && matcher.test(src)) {
"angular-route": "bower_components/angular-route/angular-route.min", // eslint-disable-next-line no-undef
"csv": "bower_components/comma-separated-values/csv.min", __webpack_public_path__ = src.replace(matcher, '') + '/';
"EventEmitter": "bower_components/eventemitter3/index",
"es6-promise": "bower_components/es6-promise/es6-promise.min",
"moment": "bower_components/moment/moment",
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
"moment-timezone": "bower_components/moment-timezone/builds/moment-timezone-with-data",
"saveAs": "bower_components/file-saver/FileSaver.min",
"screenfull": "bower_components/screenfull/dist/screenfull.min",
"text": "bower_components/text/text",
"uuid": "bower_components/node-uuid/uuid",
"vue": "node_modules/vue/dist/vue.min",
"zepto": "bower_components/zepto/zepto.min",
"lodash": "bower_components/lodash/lodash",
"d3-selection": "node_modules/d3-selection/dist/d3-selection.min",
"d3-scale": "node_modules/d3-scale/build/d3-scale.min",
"d3-axis": "node_modules/d3-axis/build/d3-axis.min",
"d3-array": "node_modules/d3-array/build/d3-array.min",
"d3-collection": "node_modules/d3-collection/build/d3-collection.min",
"d3-color": "node_modules/d3-color/build/d3-color.min",
"d3-format": "node_modules/d3-format/build/d3-format.min",
"d3-interpolate": "node_modules/d3-interpolate/build/d3-interpolate.min",
"d3-time": "node_modules/d3-time/build/d3-time.min",
"d3-time-format": "node_modules/d3-time-format/build/d3-time-format.min",
"html2canvas": "node_modules/html2canvas/dist/html2canvas.min",
"painterro": "node_modules/painterro/build/painterro.min",
"printj": "node_modules/printj/dist/printj.min"
},
"shim": {
"angular": {
"exports": "angular"
},
"angular-route": {
"deps": ["angular"]
},
"EventEmitter": {
"exports": "EventEmitter"
},
"moment-duration-format": {
"deps": ["moment"]
},
"painterro": {
"exports": "Painterro"
},
"saveAs": {
"exports": "saveAs"
},
"screenfull": {
"exports": "screenfull"
},
"zepto": {
"exports": "Zepto"
},
"lodash": {
"exports": "lodash"
},
"d3-selection": {
"exports": "d3-selection"
},
"d3-scale": {
"deps": ["d3-array", "d3-collection", "d3-color", "d3-format", "d3-interpolate", "d3-time", "d3-time-format"],
"exports": "d3-scale"
},
"d3-axis": {
"exports": "d3-axis"
},
"dom-to-image": {
"exports": "domtoimage"
} }
} }
});
define([ const MCT = require('./src/MCT');
'./platform/framework/src/Main',
'./src/defaultRegistry',
'./src/MCT',
'./src/plugins/buildInfo/plugin'
], function (Main, defaultRegistry, MCT, buildInfo) {
var openmct = new MCT(); var openmct = new MCT();
openmct.legacyRegistry = defaultRegistry; module.exports = openmct;
openmct.install(openmct.plugins.Plot());
if (typeof BUILD_CONSTANTS !== 'undefined') {
openmct.install(buildInfo(BUILD_CONSTANTS));
}
openmct.on('start', function () {
return new Main().run(defaultRegistry);
});
return openmct;
});

View File

@ -2,7 +2,15 @@
"name": "openmct", "name": "openmct",
"version": "0.14.0-SNAPSHOT", "version": "0.14.0-SNAPSHOT",
"description": "The Open MCT core platform", "description": "The Open MCT core platform",
"dependencies": { "dependencies": {},
"devDependencies": {
"angular": "1.4.14",
"angular-route": "1.4.14",
"babel-eslint": "8.2.6",
"comma-separated-values": "^3.6.4",
"concurrently": "^3.6.1",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
"d3-array": "1.2.x", "d3-array": "1.2.x",
"d3-axis": "1.0.x", "d3-axis": "1.0.x",
"d3-collection": "1.0.x", "d3-collection": "1.0.x",
@ -13,57 +21,70 @@
"d3-selection": "1.3.x", "d3-selection": "1.3.x",
"d3-time": "1.0.x", "d3-time": "1.0.x",
"d3-time-format": "2.1.x", "d3-time-format": "2.1.x",
"eslint": "5.2.0",
"eventemitter3": "^1.2.0",
"exports-loader": "^0.7.0",
"express": "^4.13.1", "express": "^4.13.1",
"minimist": "^1.1.1", "fast-sass-loader": "^1.4.5",
"painterro": "^0.2.65", "file-loader": "^1.1.11",
"request": "^2.69.0", "file-saver": "^1.3.8",
"vue": "^2.5.6"
},
"devDependencies": {
"bower": "^1.7.7",
"git-rev-sync": "^1.4.0", "git-rev-sync": "^1.4.0",
"glob": ">= 3.0.0", "glob": ">= 3.0.0",
"gulp": "^3.9.1", "html-loader": "^0.5.5",
"gulp-jscs": "^3.0.2",
"gulp-jshint": "^2.0.0",
"gulp-jshint-html-reporter": "^0.1.3",
"gulp-rename": "^1.2.2",
"gulp-requirejs-optimize": "^0.3.1",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^1.6.0",
"html2canvas": "^1.0.0-alpha.12", "html2canvas": "^1.0.0-alpha.12",
"imports-loader": "^0.8.0",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine-core": "^3.1.0", "jasmine-core": "^3.1.0",
"jscs-html-reporter": "^0.1.0",
"jsdoc": "^3.3.2", "jsdoc": "^3.3.2",
"jshint": "^2.7.0",
"karma": "^2.0.3", "karma": "^2.0.3",
"karma-chrome-launcher": "^2.2.0", "karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1", "karma-cli": "^1.0.1",
"karma-coverage": "^1.1.2", "karma-coverage": "^1.1.2",
"karma-html-reporter": "^0.2.7", "karma-html-reporter": "^0.2.7",
"karma-jasmine": "^1.1.2", "karma-jasmine": "^1.1.2",
"karma-requirejs": "^1.1.0", "karma-webpack": "^3.0.0",
"location-bar": "^3.0.1",
"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", "mini-css-extract-plugin": "^0.4.1",
"mkdirp": "^0.5.1", "minimist": "^1.1.1",
"moment": "^2.11.1", "moment": "^2.11.1",
"moment-duration-format": "^2.2.2",
"moment-timezone": "^0.5.21",
"node-bourbon": "^4.2.3", "node-bourbon": "^4.2.3",
"node-sass": "^4.9.2",
"painterro": "^0.2.65",
"printj": "^1.1.0", "printj": "^1.1.0",
"requirejs": "2.1.x", "raw-loader": "^0.5.1",
"request": "^2.69.0",
"screenfull": "^3.3.2",
"split": "^1.0.0", "split": "^1.0.0",
"v8-compile-cache": "^1.1.0" "style-loader": "^0.21.0",
"v8-compile-cache": "^1.1.0",
"vue": "2.5.6",
"vue-loader": "^15.2.6",
"vue-template-compiler": "2.5.6",
"webpack": "^4.16.2",
"webpack-cli": "^3.1.0",
"webpack-dev-middleware": "^3.1.3",
"webpack-hot-middleware": "^2.22.3",
"zepto": "^1.2.0"
}, },
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"lint": "eslint platform src openmct.js",
"lint:fix": "eslint platform src openmct.js --fix",
"build:prod": "NODE_ENV=production webpack",
"build:dev": "webpack",
"build:watch": "webpack --watch",
"test": "karma start --single-run", "test": "karma start --single-run",
"jshint": "jshint platform example", "test:watch": "karma start --no-single-run",
"watch": "karma start", "verify": "concurrently 'npm:test' 'npm:lint'",
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api", "jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'", "otherdoc": "node docs/gendocs.js --in docs/src --out dist/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",
"prepare": "node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install" "prepare": "npm run build:prod"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -21,17 +21,17 @@
*****************************************************************************/ *****************************************************************************/
define([ define([
"text!./res/templates/about-dialog.html", "./res/templates/about-dialog.html",
"./src/LogoController", "./src/LogoController",
"./src/AboutController", "./src/AboutController",
"./src/LicenseController", "./src/LicenseController",
"text!./res/templates/app-logo.html", "./res/templates/app-logo.html",
"text!./res/templates/about-logo.html", "./res/templates/about-logo.html",
"text!./res/templates/overlay-about.html", "./res/templates/overlay-about.html",
"text!./res/templates/license-apache.html", "./res/templates/license-apache.html",
"text!./res/templates/license-mit.html", "./res/templates/license-mit.html",
"text!./res/templates/licenses.html", "./res/templates/licenses.html",
"text!./res/templates/licenses-export-md.html", "./res/templates/licenses-export-md.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
aboutDialogTemplate, aboutDialogTemplate,

View File

@ -33,16 +33,16 @@ define([
"./src/windowing/NewTabAction", "./src/windowing/NewTabAction",
"./src/windowing/FullscreenAction", "./src/windowing/FullscreenAction",
"./src/windowing/WindowTitler", "./src/windowing/WindowTitler",
"text!./res/templates/browse.html", "./res/templates/browse.html",
"text!./res/templates/browse-object.html", "./res/templates/browse-object.html",
"text!./res/templates/items/grid-item.html", "./res/templates/items/grid-item.html",
"text!./res/templates/browse/object-header.html", "./res/templates/browse/object-header.html",
"text!./res/templates/browse/object-header-frame.html", "./res/templates/browse/object-header-frame.html",
"text!./res/templates/menu-arrow.html", "./res/templates/menu-arrow.html",
"text!./res/templates/back-arrow.html", "./res/templates/back-arrow.html",
"text!./res/templates/items/items.html", "./res/templates/items/items.html",
"text!./res/templates/browse/object-properties.html", "./res/templates/browse/object-properties.html",
"text!./res/templates/browse/inspector-region.html", "./res/templates/browse/inspector-region.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
BrowseController, BrowseController,
@ -73,15 +73,6 @@ define([
legacyRegistry.register("platform/commonUI/browse", { legacyRegistry.register("platform/commonUI/browse", {
"extensions": { "extensions": {
"routes": [ "routes": [
{
"when": "/browse/:ids*?",
"template": browseTemplate,
"reloadOnSearch": false
},
{
"when": "",
"redirectTo": "/browse/"
}
], ],
"constants": [ "constants": [
{ {
@ -295,6 +286,20 @@ define([
] ]
} }
], ],
"templates": [
{
key: "browseRoot",
template: browseTemplate
},
{
key: "browseObject",
template: browseObjectTemplate
},
{
key: "inspectorRegion",
template: inspectorRegionTemplate
}
],
"licenses": [ "licenses": [
{ {
"name": "screenfull.js", "name": "screenfull.js",

View File

@ -66,5 +66,4 @@
</mct-representation> </mct-representation>
</div> </div>
</div> </div>
<mct-include key="'conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include>
</div> </div>

View File

@ -47,6 +47,7 @@ define(
urlService, urlService,
defaultPath defaultPath
) { ) {
window.browseScope = $scope;
var initialPath = ($route.current.params.ids || defaultPath).split("/"), var initialPath = ($route.current.params.ids || defaultPath).split("/"),
currentIds; currentIds;

View File

@ -31,7 +31,6 @@ define(
* @constructor * @constructor
*/ */
function BrowseObjectController($scope, $location, $route) { function BrowseObjectController($scope, $location, $route) {
var navigatedObject;
function setViewForDomainObject(domainObject) { function setViewForDomainObject(domainObject) {
var locationViewKey = $location.search().view; var locationViewKey = $location.search().view;
@ -47,7 +46,6 @@ define(
((domainObject && domainObject.useCapability('view')) || []) ((domainObject && domainObject.useCapability('view')) || [])
.forEach(selectViewIfMatching); .forEach(selectViewIfMatching);
} }
navigatedObject = domainObject;
} }
function updateQueryParam(viewKey) { function updateQueryParam(viewKey) {

View File

@ -27,7 +27,6 @@ define(
describe("The PaneController", function () { describe("The PaneController", function () {
var mockScope, var mockScope,
mockAgentService, mockAgentService,
mockDomainObjects,
mockWindow, mockWindow,
controller, controller,
mockLocation, mockLocation,
@ -47,17 +46,6 @@ define(
beforeEach(function () { beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", ["$on"]); mockScope = jasmine.createSpyObj("$scope", ["$on"]);
mockDomainObjects = ['a', 'b'].map(function (id) {
var mockDomainObject = jasmine.createSpyObj(
'domainObject-' + id,
['getId', 'getModel', 'getCapability']
);
mockDomainObject.getId.and.returnValue(id);
mockDomainObject.getModel.and.returnValue({});
return mockDomainObject;
});
mockAgentService = jasmine.createSpyObj( mockAgentService = jasmine.createSpyObj(
"agentService", "agentService",
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"] ["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]

View File

@ -47,7 +47,7 @@ define(
it("toggles fullscreen mode when performed", function () { it("toggles fullscreen mode when performed", function () {
action.perform(); action.perform();
expect(window.screenfull.toggle).toHaveBeenCalled(); expect(screenfull.toggle).toHaveBeenCalled();
}); });
it("provides displayable metadata", function () { it("provides displayable metadata", function () {

View File

@ -32,7 +32,7 @@ define(
mockRootScope, mockRootScope,
mockDocument, mockDocument,
mockDomainObject, mockDomainObject,
titler; titler; // eslint-disable-line
beforeEach(function () { beforeEach(function () {
mockNavigationService = jasmine.createSpyObj( mockNavigationService = jasmine.createSpyObj(

View File

@ -23,13 +23,13 @@
define([ define([
"./src/DialogService", "./src/DialogService",
"./src/OverlayService", "./src/OverlayService",
"text!./res/templates/overlay-dialog.html", "./res/templates/overlay-dialog.html",
"text!./res/templates/overlay-options.html", "./res/templates/overlay-options.html",
"text!./res/templates/dialog.html", "./res/templates/dialog.html",
"text!./res/templates/overlay-blocking-message.html", "./res/templates/overlay-blocking-message.html",
"text!./res/templates/message.html", "./res/templates/message.html",
"text!./res/templates/overlay-message-list.html", "./res/templates/overlay-message-list.html",
"text!./res/templates/overlay.html", "./res/templates/overlay.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
DialogService, DialogService,

View File

@ -49,14 +49,14 @@ define([
"./src/creation/CreateActionProvider", "./src/creation/CreateActionProvider",
"./src/creation/AddActionProvider", "./src/creation/AddActionProvider",
"./src/creation/CreationService", "./src/creation/CreationService",
"text!./res/templates/create/locator.html", "./res/templates/create/locator.html",
"text!./res/templates/create/create-button.html", "./res/templates/create/create-button.html",
"text!./res/templates/create/create-menu.html", "./res/templates/create/create-menu.html",
"text!./res/templates/library.html", "./res/templates/library.html",
"text!./res/templates/edit-object.html", "./res/templates/edit-object.html",
"text!./res/templates/edit-action-buttons.html", "./res/templates/edit-action-buttons.html",
"text!./res/templates/elements.html", "./res/templates/elements.html",
"text!./res/templates/topbar-edit.html", "./res/templates/topbar-edit.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
EditActionController, EditActionController,
@ -188,6 +188,7 @@ define([
"name": "Remove", "name": "Remove",
"description": "Remove this object from its containing object.", "description": "Remove this object from its containing object.",
"depends": [ "depends": [
"dialogService",
"navigationService" "navigationService"
] ]
}, },
@ -318,6 +319,12 @@ define([
] ]
} }
], ],
"templates": [
{
key: "elementsPool",
template: elementsTemplate
}
],
"components": [ "components": [
{ {
"type": "decorator", "type": "decorator",

View File

@ -23,9 +23,11 @@
/** /**
* Module defining RemoveAction. Created by vwoeltje on 11/17/14. * Module defining RemoveAction. Created by vwoeltje on 11/17/14.
*/ */
define( define([
[], './RemoveDialog'
function () { ], function (
RemoveDialog
) {
/** /**
* Construct an action which will remove the provided object manifestation. * Construct an action which will remove the provided object manifestation.
@ -33,25 +35,27 @@ define(
* is looked up via the "context" capability (so this will be the * is looked up via the "context" capability (so this will be the
* immediate ancestor by which this specific object was reached.) * immediate ancestor by which this specific object was reached.)
* *
* @param {DomainObject} object the object to be removed * @param {DialogService} dialogService a service which will show the dialog
* @param {NavigationService} navigationService a service that maintains the current navigation state
* @param {ActionContext} context the context in which this action is performed * @param {ActionContext} context the context in which this action is performed
* @memberof platform/commonUI/edit * @memberof platform/commonUI/edit
* @constructor * @constructor
* @implements {Action} * @implements {Action}
*/ */
function RemoveAction(navigationService, context) { function RemoveAction(dialogService, navigationService, context) {
this.domainObject = (context || {}).domainObject; this.domainObject = (context || {}).domainObject;
this.dialogService = dialogService;
this.navigationService = navigationService; this.navigationService = navigationService;
} }
/** /**
* Perform this action. * Perform this action.
* @return {Promise} a promise which will be
* fulfilled when the action has completed.
*/ */
RemoveAction.prototype.perform = function () { RemoveAction.prototype.perform = function () {
var navigationService = this.navigationService, var dialog,
domainObject = this.domainObject; dialogService = this.dialogService,
domainObject = this.domainObject,
navigationService = this.navigationService;
/* /*
* Check whether an object ID matches the ID of the object being * Check whether an object ID matches the ID of the object being
* removed (used to filter a parent's composition to handle the * removed (used to filter a parent's composition to handle the
@ -111,7 +115,12 @@ define(
return parent.useCapability('mutation', doMutate); return parent.useCapability('mutation', doMutate);
} }
return removeFromContext(domainObject); /*
* Pass in the function to remove the domain object so it can be
* associated with an 'OK' button press
*/
dialog = new RemoveDialog(dialogService, domainObject, removeFromContext);
dialog.show();
}; };
// Object needs to have a parent for Remove to be applicable // Object needs to have a parent for Remove to be applicable
@ -129,5 +138,4 @@ define(
}; };
return RemoveAction; return RemoveAction;
} });
);

View File

@ -0,0 +1,77 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* @callback removeCallback
* @param {DomainObject} domainObject the domain object to be removed
*/
/**
* Construct a new Remove dialog.
*
* @param {DialogService} dialogService the service that shows the dialog
* @param {DomainObject} domainObject the domain object to be removed
* @param {removeCallback} removeCallback callback that handles removal of the domain object
* @memberof platform/commonUI/edit
* @constructor
*/
function RemoveDialog(dialogService, domainObject, removeCallback) {
this.dialogService = dialogService;
this.domainObject = domainObject;
this.removeCallback = removeCallback;
}
/**
* Display a dialog to confirm the removal of a domain object.
*/
RemoveDialog.prototype.show = function () {
var dialog,
domainObject = this.domainObject,
removeCallback = this.removeCallback,
model = {
title: 'Remove ' + domainObject.getModel().name,
actionText: 'Warning! This action will permanently remove this object. Are you sure you want to continue?',
severity: 'alert',
primaryOption: {
label: 'OK',
callback: function () {
removeCallback(domainObject);
dialog.dismiss();
}
},
options: [
{
label: 'Cancel',
callback: function () {
dialog.dismiss();
}
}
]
};
dialog = this.dialogService.showBlockingMessage(model);
};
return RemoveDialog;
});

View File

@ -55,16 +55,16 @@ define(
navigatedObject = this.navigationService.getNavigation(), navigatedObject = this.navigationService.getNavigation(),
actionMetadata = action.getMetadata ? action.getMetadata() : {}; actionMetadata = action.getMetadata ? action.getMetadata() : {};
if (navigatedObject.hasCapability("editor") && navigatedObject.getCapability("editor").isEditContextRoot()) { // if (navigatedObject.hasCapability("editor") && navigatedObject.getCapability("editor").isEditContextRoot()) {
if (selectedObject.hasCapability("editor") && selectedObject.getCapability("editor").inEditContext()) { if (selectedObject.hasCapability("editor") && selectedObject.getCapability("editor").inEditContext()) {
return this.editModeBlacklist.indexOf(actionMetadata.key) === -1; return this.editModeBlacklist.indexOf(actionMetadata.key) === -1;
} else { } else {
//Target is in the context menu //Target is in the context menu
return this.nonEditContextBlacklist.indexOf(actionMetadata.key) === -1; return this.nonEditContextBlacklist.indexOf(actionMetadata.key) === -1;
} }
} else { // } else {
return true; // return true;
} // }
}; };
return EditContextualActionPolicy; return EditContextualActionPolicy;

View File

@ -25,8 +25,7 @@ define(
function (EditAndComposeAction) { function (EditAndComposeAction) {
describe("The Link action", function () { describe("The Link action", function () {
var mockQ, var mockDomainObject,
mockDomainObject,
mockParent, mockParent,
mockContext, mockContext,
mockComposition, mockComposition,
@ -47,13 +46,10 @@ define(
} }
beforeEach(function () { beforeEach(function () {
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(
"domainObject", "domainObject",
["getId", "getCapability"] ["getId", "getCapability"]
); );
mockQ = { when: mockPromise };
mockParent = { mockParent = {
getModel: function () { getModel: function () {
return model; return model;

View File

@ -25,50 +25,37 @@ define(
function (RemoveAction) { function (RemoveAction) {
describe("The Remove action", function () { describe("The Remove action", function () {
var mockQ, var action,
mockNavigationService,
mockDomainObject,
mockParent,
mockChildObject,
mockGrandchildObject,
mockRootObject,
mockContext,
mockChildContext,
mockGrandchildContext,
mockRootContext,
mockMutation,
mockType,
actionContext, actionContext,
model,
capabilities, capabilities,
action; mockContext,
mockDialogService,
function mockPromise(value) { mockDomainObject,
return { mockMutation,
then: function (callback) { mockNavigationService,
return mockPromise(callback(value)); mockParent,
} mockType,
}; model;
}
beforeEach(function () { beforeEach(function () {
mockDomainObject = jasmine.createSpyObj( mockDomainObject = jasmine.createSpyObj(
"domainObject", "domainObject",
["getId", "getCapability"] ["getId", "getCapability", "getModel"]
); );
mockChildObject = jasmine.createSpyObj(
"domainObject", mockMutation = jasmine.createSpyObj("mutation", ["invoke"]);
["getId", "getCapability"] mockType = jasmine.createSpyObj("type", ["hasFeature"]);
); mockType.hasFeature.and.returnValue(true);
mockGrandchildObject = jasmine.createSpyObj(
"domainObject", capabilities = {
["getId", "getCapability"] mutation: mockMutation,
); type: mockType
mockRootObject = jasmine.createSpyObj( };
"domainObject",
["getId", "getCapability"] model = {
); composition: ["a", "test", "b"]
mockQ = { when: mockPromise }; };
mockParent = { mockParent = {
getModel: function () { getModel: function () {
return model; return model;
@ -80,12 +67,12 @@ define(
return capabilities[k].invoke(v); return capabilities[k].invoke(v);
} }
}; };
mockContext = jasmine.createSpyObj("context", ["getParent"]);
mockChildContext = jasmine.createSpyObj("context", ["getParent"]); mockDialogService = jasmine.createSpyObj(
mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]); "dialogService",
mockRootContext = jasmine.createSpyObj("context", ["getParent"]); ["showBlockingMessage"]
mockMutation = jasmine.createSpyObj("mutation", ["invoke"]); );
mockType = jasmine.createSpyObj("type", ["hasFeature"]);
mockNavigationService = jasmine.createSpyObj( mockNavigationService = jasmine.createSpyObj(
"navigationService", "navigationService",
[ [
@ -97,23 +84,19 @@ define(
); );
mockNavigationService.getNavigation.and.returnValue(mockDomainObject); mockNavigationService.getNavigation.and.returnValue(mockDomainObject);
mockContext = jasmine.createSpyObj("context", ["getParent"]);
mockContext.getParent.and.returnValue(mockParent);
mockDomainObject.getId.and.returnValue("test"); mockDomainObject.getId.and.returnValue("test");
mockDomainObject.getCapability.and.returnValue(mockContext); mockDomainObject.getCapability.and.returnValue(mockContext);
mockDomainObject.getModel.and.returnValue({name: 'test object'});
mockContext.getParent.and.returnValue(mockParent); mockContext.getParent.and.returnValue(mockParent);
mockType.hasFeature.and.returnValue(true); mockType.hasFeature.and.returnValue(true);
capabilities = {
mutation: mockMutation,
type: mockType
};
model = {
composition: ["a", "test", "b"]
};
actionContext = { domainObject: mockDomainObject }; actionContext = { domainObject: mockDomainObject };
action = new RemoveAction(mockNavigationService, actionContext); action = new RemoveAction(mockDialogService, mockNavigationService, actionContext);
}); });
it("only applies to objects with parents", function () { it("only applies to objects with parents", function () {
@ -127,15 +110,73 @@ define(
expect(mockType.hasFeature).toHaveBeenCalledWith('creation'); expect(mockType.hasFeature).toHaveBeenCalledWith('creation');
}); });
it("shows a blocking message dialog", function () {
mockParent = jasmine.createSpyObj(
"parent",
["getModel", "getCapability", "useCapability"]
);
action.perform();
expect(mockDialogService.showBlockingMessage).toHaveBeenCalled();
// Also check that no mutation happens at this point
expect(mockParent.useCapability).not.toHaveBeenCalledWith("mutation", jasmine.any(Function));
});
describe("after the remove callback is triggered", function () {
var mockChildContext,
mockChildObject,
mockDialogHandle,
mockGrandchildContext,
mockGrandchildObject,
mockRootContext,
mockRootObject;
beforeEach(function () {
mockChildObject = jasmine.createSpyObj(
"domainObject",
["getId", "getCapability"]
);
mockDialogHandle = jasmine.createSpyObj(
"dialogHandle",
["dismiss"]
);
mockGrandchildObject = jasmine.createSpyObj(
"domainObject",
["getId", "getCapability"]
);
mockRootObject = jasmine.createSpyObj(
"domainObject",
["getId", "getCapability"]
);
mockChildContext = jasmine.createSpyObj("context", ["getParent"]);
mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]);
mockRootContext = jasmine.createSpyObj("context", ["getParent"]);
mockDialogService.showBlockingMessage.and.returnValue(mockDialogHandle);
});
it("mutates the parent when performed", function () { it("mutates the parent when performed", function () {
action.perform(); action.perform();
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
.primaryOption.callback();
expect(mockMutation.invoke) expect(mockMutation.invoke)
.toHaveBeenCalledWith(jasmine.any(Function)); .toHaveBeenCalledWith(jasmine.any(Function));
}); });
it("changes composition from its mutation function", function () { it("changes composition from its mutation function", function () {
var mutator, result; var mutator, result;
action.perform(); action.perform();
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
.primaryOption.callback();
mutator = mockMutation.invoke.calls.mostRecent().args[0]; mutator = mockMutation.invoke.calls.mostRecent().args[0];
result = mutator(model); result = mutator(model);
@ -171,6 +212,8 @@ define(
mockType.hasFeature.and.returnValue(true); mockType.hasFeature.and.returnValue(true);
action.perform(); action.perform();
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
.primaryOption.callback();
// Expects navigation to parent of domainObject (removed object) // Expects navigation to parent of domainObject (removed object)
expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent); expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent);
@ -199,11 +242,14 @@ define(
mockType.hasFeature.and.returnValue(true); mockType.hasFeature.and.returnValue(true);
action.perform(); action.perform();
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
.primaryOption.callback();
// Expects no navigation to occur // Expects no navigation to occur
expect(mockNavigationService.setNavigation).not.toHaveBeenCalled(); expect(mockNavigationService.setNavigation).not.toHaveBeenCalled();
}); });
}); });
});
} }
); );

View File

@ -34,7 +34,6 @@ define(
mockDomainObject, mockDomainObject,
capabilities = {}, capabilities = {},
mockEditAction, mockEditAction,
mockSaveAction,
action; action;
function mockPromise(value) { function mockPromise(value) {
@ -83,12 +82,6 @@ define(
mockDomainObject.getCapability.and.callFake(function (name) { mockDomainObject.getCapability.and.callFake(function (name) {
return capabilities[name]; return capabilities[name];
}); });
mockSaveAction = jasmine.createSpyObj(
"saveAction",
[
"perform"
]
);
capabilities.action = jasmine.createSpyObj( capabilities.action = jasmine.createSpyObj(
"actionCapability", "actionCapability",

View File

@ -27,7 +27,6 @@ define(
describe("The Edit action policy", function () { describe("The Edit action policy", function () {
var editableView, var editableView,
nonEditableView, nonEditableView,
undefinedView,
testViews, testViews,
testContext, testContext,
mockDomainObject, mockDomainObject,
@ -67,7 +66,6 @@ define(
editableView = { editable: true }; editableView = { editable: true };
nonEditableView = { editable: false }; nonEditableView = { editable: false };
undefinedView = { someKey: "some value" };
plotView = { key: "plot", editable: false }; plotView = { key: "plot", editable: false };
testViews = []; testViews = [];

View File

@ -30,12 +30,6 @@ define(
mockObjects, mockObjects,
mockDomainObject, mockDomainObject,
testStructure, testStructure,
testAB,
testABC,
testABC2,
testABCXYZ,
testABCYZ,
testM,
toolbar; toolbar;
beforeEach(function () { beforeEach(function () {
@ -62,13 +56,6 @@ define(
{ name: "M", method: "m", domainObject: mockDomainObject } { name: "M", method: "m", domainObject: mockDomainObject }
]; ];
testAB = { a: 0, b: 1 };
testABC = { a: 0, b: 1, c: 2 };
testABC2 = { a: 4, b: 1, c: 2 }; // For inconsistent-state checking
testABCXYZ = { a: 0, b: 1, c: 2, x: 'X!', y: 'Y!', z: 'Z!' };
testABCYZ = { a: 0, b: 1, c: 2, y: 'Y!', z: 'Z!' };
testM = { m: jasmine.createSpy("method") };
toolbar = new EditToolbar(mockScope, mockOpenMCT, testStructure); toolbar = new EditToolbar(mockScope, mockOpenMCT, testStructure);
}); });

View File

@ -43,13 +43,12 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) {
describe("when callbacks are added", function () { describe("when callbacks are added", function () {
var mockCommit, var mockCommit,
mockCancel, mockCancel;
remove;
beforeEach(function () { beforeEach(function () {
mockCommit = jasmine.createSpy('commit'); mockCommit = jasmine.createSpy('commit');
mockCancel = jasmine.createSpy('cancel'); mockCancel = jasmine.createSpy('cancel');
remove = nestedTransaction.add(mockCommit, mockCancel); nestedTransaction.add(mockCommit, mockCancel);
}); });
it("does not interact with its parent transaction", function () { it("does not interact with its parent transaction", function () {

View File

@ -52,26 +52,26 @@ define([
"./src/directives/MCTPreview", "./src/directives/MCTPreview",
"./src/actions/MCTPreviewAction", "./src/actions/MCTPreviewAction",
"./src/filters/ReverseFilter", "./src/filters/ReverseFilter",
"text!./res/templates/bottombar.html", "./res/templates/bottombar.html",
"text!./res/templates/controls/action-button.html", "./res/templates/controls/action-button.html",
"text!./res/templates/controls/input-filter.html", "./res/templates/controls/input-filter.html",
"text!./res/templates/angular-indicator.html", "./res/templates/angular-indicator.html",
"text!./res/templates/message-banner.html", "./res/templates/message-banner.html",
"text!./res/templates/progress-bar.html", "./res/templates/progress-bar.html",
"text!./res/templates/controls/time-controller.html", "./res/templates/controls/time-controller.html",
"text!./res/templates/containers/accordion.html", "./res/templates/containers/accordion.html",
"text!./res/templates/subtree.html", "./res/templates/subtree.html",
"text!./res/templates/tree.html", "./res/templates/tree.html",
"text!./res/templates/tree-node.html", "./res/templates/tree-node.html",
"text!./res/templates/label.html", "./res/templates/label.html",
"text!./res/templates/controls/action-group.html", "./res/templates/controls/action-group.html",
"text!./res/templates/menu/context-menu.html", "./res/templates/menu/context-menu.html",
"text!./res/templates/controls/switcher.html", "./res/templates/controls/switcher.html",
"text!./res/templates/object-inspector.html", "./res/templates/object-inspector.html",
"text!./res/templates/controls/selector.html", "./res/templates/controls/selector.html",
"text!./res/templates/controls/datetime-picker.html", "./res/templates/controls/datetime-picker.html",
"text!./res/templates/controls/datetime-field.html", "./res/templates/controls/datetime-field.html",
"text!./res/templates/preview.html", "./res/templates/preview.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
UrlService, UrlService,
@ -173,12 +173,6 @@ define([
"key": "reverse" "key": "reverse"
} }
], ],
"stylesheets": [
{
"stylesheetUrl": "css/normalize.min.css",
"priority": "mandatory"
}
],
"templates": [ "templates": [
{ {
"key": "bottombar", "key": "bottombar",

View File

@ -1,48 +0,0 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

View File

@ -1,308 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
.abs.holder-plot {
right: $interiorMargin; // Fend off the scrollbar when less than min-height;
.t-object-alert.t-alert-unsynced {
display: none;
}
}
/********************************************* STACKED PLOT LAYOUT */
.t-plot-stacked {
.l-view-section {
// Make this a flex container
display: flex;
flex-flow: column nowrap;
.gl-plot.child-frame {
mct-plot {
display: flex;
flex: 1 1 auto;
height: 100%;
position: relative;
}
flex: 1 1 auto;
&:not(:first-child) {
margin-top: $interiorMargin;
}
}
}
.s-status-timeconductor-unsynced .holder-plot {
.t-object-alert.t-alert-unsynced {
display: block;
}
}
}
.gl-plot {
color: $colorPlotFg;
display: flex;
font-size: 0.7rem;
position: relative;
width: 100%;
height: 100%;
min-height: $plotMinH;
/********************************************* AXIS AND DISPLAY AREA */
.plot-wrapper-axis-and-display-area {
margin-top: $interiorMargin; // Keep the top tick label from getting clipped
position: relative;
flex: 1 1 auto;
.t-object-alert {
position: absolute;
display: block;
font-size: 1.5em;
top: $interiorMarginSm; left: $interiorMarginSm;
}
}
.gl-plot-wrapper-display-area-and-x-axis {
// Holds the plot area and the X-axis only
position: absolute;
top: nth($plotDisplayArea, 1);
right: nth($plotDisplayArea, 2);
bottom: 0;
left: nth($plotDisplayArea, 4);
.gl-plot-display-area {
position: absolute;
top: 0;
right: 0;
bottom: nth($plotDisplayArea, 3);
left: 0;
}
.gl-plot-axis-area.gl-plot-x {
top: auto;
right: 0;
bottom: 0;
left: 0;
height: $plotXBarH;
width: auto;
overflow: hidden;
}
}
.gl-plot-axis-area {
position: absolute;
&.gl-plot-y {
top: nth($plotDisplayArea, 1);
right: auto;
bottom: nth($plotDisplayArea, 3);
left: 0;
width: $plotYBarW;
}
}
.gl-plot-coords {
box-sizing: border-box;
border-radius: $controlCr;
background: black;
color: lighten($colorBodyFg, 30%);
padding: 2px 5px;
position: absolute;
top: nth($plotDisplayArea,1) + $interiorMarginLg;
right: auto;
bottom: auto;
left: nth($plotDisplayArea,4) + $interiorMarginLg;
z-index: 10;
&:empty {
display: none;
}
}
.gl-plot-label,
.l-plot-label {
color: $colorPlotLabelFg;
position: absolute;
text-align: center;
&.gl-plot-x-label,
&.l-plot-x-label {
top: auto;
right: 0;
bottom: 0;
left: 0;
height: auto;
}
&.gl-plot-y-label,
&.l-plot-y-label {
$x: -50%;
$r: -90deg;
transform-origin: 50% 0;
transform: translateX($x) rotate($r);
display: inline-block;
margin-left: $interiorMargin; // Kick off the left edge
left: 0;
top: 50%;
white-space: nowrap;
}
}
.gl-plot-x-options,
.gl-plot-y-options {
$h: 24px;
position: absolute;
height: $h;
min-height: $h;
z-index: 2;
}
.gl-plot-x-options {
transform: translateX(-50%);
bottom: 0;
left: 50%;
}
.gl-plot-y-options {
transform: translateY(-50%);
min-width: 150px; // Need this due to enclosure of .select
top: 50%;
left: $plotYLabelW + $interiorMargin * 2;
}
.t-plot-display-controls {
position: absolute;
top: $interiorMargin;
right: $interiorMargin;
}
.gl-plot-hash {
position: absolute;
border: 0 $colorPlotHash $stylePlotHash;
&.hash-v {
border-right-width: 1px;
height: 100%;
}
&.hash-h {
border-bottom-width: 1px;
width: 100%;
}
}
/****************************** Limits and Out-of-Bounds data */
.l-limit-bar,
.l-oob-data {
position: absolute;
left: 0;
right: 0;
width: auto;
}
.l-limit-bar {
// Limits in plot display area
@mixin limitBg($c) {
background: rgba($c, 0.2);
}
height: auto;
z-index: 0;
&.s-limit-yellow { @include limitBg($colorLimitYellowBg); }
&.s-limit-red { @include limitBg($colorLimitRedBg); }
}
.l-oob-data {
$c: #7748d6;
$a: 0.5;
$h: 10px;
@include absPosDefault();
pointer-events: none;
height: $h;
z-index: 1;
&.l-oob-data-up {
top: 0;
bottom: auto;
@include linearGlow(0deg, $c, $a);
}
&.l-oob-data-dwn {
bottom: 0;
top: auto;
@include linearGlow(180deg, $c, $a);
}
}
}
.gl-plot-display-area,
.plot-display-area {
@if $colorPlotBg != none { background-color: $colorPlotBg; }
cursor: crosshair;
border: 1px solid $colorPlotAreaBorder;
}
.tick {
position: absolute;
border: 0 $colorPlotHash solid;
&.tick-x {
border-right-width: 1px;
height: 100%; // Assumption is that the tick will be in a holder that will set it's height;
}
}
.gl-plot-tick,
.tick-label {
@include reverseEllipsis();
font-size: 0.7rem;
position: absolute;
&.gl-plot-x-tick-label,
&.tick-label-x {
right: auto;
bottom: auto;
left: auto;
height: auto;
width: 20%;
margin-left: -10%;
text-align: center;
}
&.gl-plot-y-tick-label,
&.tick-label-y {
top: auto;
height: 1em;
width: auto;
margin-bottom: -0.5em;
text-align: right;
}
}
.gl-plot-tick {
&.gl-plot-x-tick-label {
top: $interiorMargin;
}
&.gl-plot-y-tick-label {
right: $interiorMargin;
left: $interiorMargin;
}
}
.tick-label {
&.tick-label-x {
top: 0;
}
&.tick-label-y {
right: 0; left: 0;
}
}

View File

@ -45,6 +45,15 @@ define(
// Link; install event handlers. // Link; install event handlers.
function link(scope, element, attrs) { function link(scope, element, attrs) {
var isDestroyed = false;
scope.$on("$destroy", function () {
isDestroyed = true;
});
openmct.$injector.get('$timeout')(function () {
if (isDestroyed) {
return;
}
var removeSelectable = openmct.selection.selectable( var removeSelectable = openmct.selection.selectable(
element[0], element[0],
scope.$eval(attrs.mctSelectable), scope.$eval(attrs.mctSelectable),
@ -54,6 +63,9 @@ define(
scope.$on("$destroy", function () { scope.$on("$destroy", function () {
removeSelectable(); removeSelectable();
}); });
});
} }
return { return {

View File

@ -22,7 +22,7 @@
define([ define([
'zepto', 'zepto',
'text!../../res/templates/tree/toggle.html' '../../res/templates/tree/toggle.html'
], function ($, toggleTemplate) { ], function ($, toggleTemplate) {
function ToggleView(state) { function ToggleView(state) {
this.expanded = !!state; this.expanded = !!state;

View File

@ -22,7 +22,7 @@
define([ define([
'zepto', 'zepto',
'text!../../res/templates/tree/tree-label.html' '../../res/templates/tree/tree-label.html'
], function ($, labelTemplate) { ], function ($, labelTemplate) {
function TreeLabelView(gestureService) { function TreeLabelView(gestureService) {

View File

@ -22,7 +22,7 @@
define([ define([
'zepto', 'zepto',
'text!../../res/templates/tree/node.html', '../../res/templates/tree/node.html',
'./ToggleView', './ToggleView',
'./TreeLabelView' './TreeLabelView'
], function ($, nodeTemplate, ToggleView, TreeLabelView) { ], function ($, nodeTemplate, ToggleView, TreeLabelView) {

View File

@ -23,7 +23,7 @@
define([ define([
'zepto', 'zepto',
'./TreeNodeView', './TreeNodeView',
'text!../../res/templates/tree/wait-node.html' '../../res/templates/tree/wait-node.html'
], function ($, TreeNodeView, spinnerTemplate) { ], function ($, TreeNodeView, spinnerTemplate) {
function TreeView(gestureService, openmct, selectFn) { function TreeView(gestureService, openmct, selectFn) {

View File

@ -31,7 +31,7 @@ define(
mockHead, mockHead,
mockElement, mockElement,
testBundle, testBundle,
loader; loader; // eslint-disable-line
beforeEach(function () { beforeEach(function () {
testBundle = { testBundle = {

View File

@ -41,7 +41,6 @@ define(
mockScope, mockScope,
mockElement, mockElement,
testAttrs, testAttrs,
mockBody,
mockTransclude, mockTransclude,
mockParentEl, mockParentEl,
mockNewElement, mockNewElement,
@ -59,8 +58,6 @@ define(
jasmine.createSpyObj("$scope", ["$eval", "$apply", "$on"]); jasmine.createSpyObj("$scope", ["$eval", "$apply", "$on"]);
mockElement = mockElement =
jasmine.createSpyObj("element", JQLITE_METHODS); jasmine.createSpyObj("element", JQLITE_METHODS);
mockBody =
jasmine.createSpyObj("body", JQLITE_METHODS);
mockTransclude = mockTransclude =
jasmine.createSpy("transclude"); jasmine.createSpy("transclude");
mockParentEl = mockParentEl =

View File

@ -24,10 +24,10 @@ define([
"./src/gestures/InfoGesture", "./src/gestures/InfoGesture",
"./src/gestures/InfoButtonGesture", "./src/gestures/InfoButtonGesture",
"./src/services/InfoService", "./src/services/InfoService",
"text!./res/info-table.html", "./res/info-table.html",
"text!./res/info-bubble.html", "./res/info-bubble.html",
"text!./res/bubble.html", "./res/bubble.html",
"text!./res/templates/info-button.html", "./res/templates/info-button.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
InfoGesture, InfoGesture,

View File

@ -25,8 +25,7 @@ define(
function (InfoButtonGesture) { function (InfoButtonGesture) {
describe("The info button gesture", function () { describe("The info button gesture", function () {
var mockTimeout, var mockDocument,
mockDocument,
mockBody, mockBody,
mockAgentService, mockAgentService,
mockInfoService, mockInfoService,
@ -42,7 +41,6 @@ define(
fireDismissGesture; fireDismissGesture;
beforeEach(function () { beforeEach(function () {
mockTimeout = jasmine.createSpy('$timeout');
mockDocument = jasmine.createSpyObj('$document', ['find']); mockDocument = jasmine.createSpyObj('$document', ['find']);
mockBody = jasmine.createSpyObj('body', ['on', 'off', 'scope', 'css', 'unbind']); mockBody = jasmine.createSpyObj('body', ['on', 'off', 'scope', 'css', 'unbind']);
mockDocument.find.and.returnValue(mockBody); mockDocument.find.and.returnValue(mockBody);

View File

@ -74,7 +74,7 @@ define(
"device " + (trueMethods.join(", ")); "device " + (trueMethods.join(", "));
describe("when " + summary, function () { describe("when " + summary, function () {
var classifier; var classifier; // eslint-disable-line
beforeEach(function () { beforeEach(function () {
trueMethods.forEach(function (m) { trueMethods.forEach(function (m) {

View File

@ -24,7 +24,7 @@ define([
"./src/NotificationIndicatorController", "./src/NotificationIndicatorController",
"./src/NotificationIndicator", "./src/NotificationIndicator",
"./src/NotificationService", "./src/NotificationService",
"text!./res/notification-indicator.html", "./res/notification-indicator.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
NotificationIndicatorController, NotificationIndicatorController,

View File

@ -76,7 +76,7 @@ define(
* @returns a domain object * @returns a domain object
*/ */
InspectorController.prototype.selectedItem = function () { InspectorController.prototype.selectedItem = function () {
return this.$scope.selection[0].context.oldItem; return this.$scope.selection[0] && this.$scope.selection[0].context.oldItem;
}; };
/** /**

View File

@ -1,49 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'legacyRegistry'
], function (
legacyRegistry
) {
legacyRegistry.register("platform/commonUI/themes/espresso", {
"name": "Espresso",
"description": "Espresso theme: dark and rich",
"extensions": {
"stylesheets": [
{
"stylesheetUrl": "css/theme-espresso.css",
"priority": 1000
}
],
"constants": [
{
"key": "THEME",
"value": "espresso"
}
]
}
});
});

View File

@ -48,10 +48,11 @@ define(
}); });
it("throws exceptions on unrecognized conversions", function () { it("throws exceptions on unrecognized conversions", function () {
var caught = false, tmp; var caught = false;
try { try {
tmp = new TypePropertyConversion("some-unknown-conversion"); // eslint-disable-next-line
new TypePropertyConversion("some-unknown-conversion");
} catch (e) { } catch (e) {
caught = true; caught = true;
} }

View File

@ -124,7 +124,6 @@ define(
var mockQ, var mockQ,
mockDeferred, mockDeferred,
createObjectPromise,
copyService, copyService,
object, object,
newParent, newParent,
@ -138,7 +137,6 @@ define(
resolvedValue; resolvedValue;
beforeEach(function () { beforeEach(function () {
createObjectPromise = synchronousPromise(undefined);
policyService.allow.and.returnValue(true); policyService.allow.and.returnValue(true);
persistObjectPromise = synchronousPromise(undefined); persistObjectPromise = synchronousPromise(undefined);
@ -275,8 +273,7 @@ define(
describe("on domainObject with composition", function () { describe("on domainObject with composition", function () {
var childObject, var childObject,
objectClone, objectClone,
childObjectClone, childObjectClone;
compositionPromise;
beforeEach(function () { beforeEach(function () {
var invocationCount = 0, var invocationCount = 0,
@ -325,11 +322,6 @@ define(
} }
}); });
compositionPromise = jasmine.createSpyObj(
'compositionPromise',
['then']
);
compositionCapability compositionCapability
.invoke .invoke
.and.returnValue(synchronousPromise([childObject])); .and.returnValue(synchronousPromise([childObject]));

View File

@ -178,7 +178,6 @@ define(
type: { type: 'object' } type: { type: 'object' }
} }
}); });
moveResult = moveService.perform(object, newParent); moveResult = moveService.perform(object, newParent);
}); });
@ -189,6 +188,10 @@ define(
); );
}); });
it("returns a promise", function () {
expect(moveResult.then).toEqual(jasmine.any(Function));
});
it("waits for result of link", function () { it("waits for result of link", function () {
expect(linkService.perform.calls.mostRecent().promise.then) expect(linkService.perform.calls.mostRecent().promise.then)
.toHaveBeenCalledWith(jasmine.any(Function)); .toHaveBeenCalledWith(jasmine.any(Function));

View File

@ -34,8 +34,8 @@ define([
"./src/actions/RestartTimerAction", "./src/actions/RestartTimerAction",
"./src/actions/StopTimerAction", "./src/actions/StopTimerAction",
"./src/actions/PauseTimerAction", "./src/actions/PauseTimerAction",
"text!./res/templates/clock.html", "./res/templates/clock.html",
"text!./res/templates/timer.html", "./res/templates/timer.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
MomentTimezone, MomentTimezone,

View File

@ -29,10 +29,10 @@ define([
"./src/ui/ConductorAxisDirective", "./src/ui/ConductorAxisDirective",
"./src/ui/NumberFormat", "./src/ui/NumberFormat",
"./src/ui/StringFormat", "./src/ui/StringFormat",
"text!./res/templates/time-conductor.html", "./res/templates/time-conductor.html",
"text!./res/templates/mode-selector/mode-selector.html", "./res/templates/mode-selector/mode-selector.html",
"text!./res/templates/mode-selector/mode-menu.html", "./res/templates/mode-selector/mode-menu.html",
"text!./res/templates/time-of-interest.html", "./res/templates/time-of-interest.html",
"legacyRegistry" "legacyRegistry"
], function ( ], function (
TimeConductorController, TimeConductorController,
@ -97,16 +97,6 @@ define([
"implementation": ConductorTOIDirective "implementation": ConductorTOIDirective
} }
], ],
"stylesheets": [
{
"stylesheetUrl": "css/time-conductor-espresso.css",
"theme": "espresso"
},
{
"stylesheetUrl": "css/time-conductor-snow.css",
"theme": "snow"
}
],
"templates": [ "templates": [
{ {
"key": "conductor", "key": "conductor",

View File

@ -37,8 +37,6 @@ define([
mockConductorViewService, mockConductorViewService,
mockFormatService, mockFormatService,
mockScope, mockScope,
mockElement,
mockTarget,
mockBounds, mockBounds,
element, element,
mockTimeSystem, mockTimeSystem,
@ -56,13 +54,6 @@ define([
]); ]);
//Add some HTML elements //Add some HTML elements
mockTarget = {
offsetWidth: 0,
offsetHeight: 0
};
mockElement = {
firstChild: mockTarget
};
mockBounds = { mockBounds = {
start: 100, start: 100,
end: 200 end: 200

View File

@ -376,7 +376,6 @@ define(['./TimeConductorController'], function (TimeConductorController) {
describe("when the URL defines conductor state", function () { describe("when the URL defines conductor state", function () {
var urlBounds; var urlBounds;
var urlTimeSystem; var urlTimeSystem;
var urlMode;
var urlDeltas; var urlDeltas;
var mockDeltaFormat; var mockDeltaFormat;
@ -439,7 +438,6 @@ define(['./TimeConductorController'], function (TimeConductorController) {
end: 200 end: 200
}; };
urlTimeSystem = "otherTimeSystem"; urlTimeSystem = "otherTimeSystem";
urlMode = "realtime";
urlDeltas = { urlDeltas = {
start: 300, start: 300,
end: 400 end: 400

View File

@ -21,7 +21,7 @@
*****************************************************************************/ *****************************************************************************/
define([ define([
"text!../layout/res/templates/fixed.html", "../layout/res/templates/fixed.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
fixedTemplate, fixedTemplate,

View File

@ -23,7 +23,7 @@
define([ define([
'./src/HyperlinkController', './src/HyperlinkController',
'legacyRegistry', 'legacyRegistry',
'text!./res/templates/hyperlink.html' './res/templates/hyperlink.html'
], function ( ], function (
HyperlinkController, HyperlinkController,
legacyRegistry, legacyRegistry,

View File

@ -24,7 +24,7 @@ define([
"./src/policies/ImageryViewPolicy", "./src/policies/ImageryViewPolicy",
"./src/controllers/ImageryController", "./src/controllers/ImageryController",
"./src/directives/MCTBackgroundImage", "./src/directives/MCTBackgroundImage",
"text!./res/templates/imagery.html", "./res/templates/imagery.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ImageryViewPolicy, ImageryViewPolicy,

View File

@ -25,14 +25,14 @@ define([
"./src/FixedController", "./src/FixedController",
"./src/LayoutCompositionPolicy", "./src/LayoutCompositionPolicy",
'./src/MCTTriggerModal', './src/MCTTriggerModal',
"text!./res/templates/layout.html", "./res/templates/layout.html",
"text!./res/templates/fixed.html", "./res/templates/fixed.html",
"text!./res/templates/frame.html", "./res/templates/frame.html",
"text!./res/templates/elements/telemetry.html", "./res/templates/elements/telemetry.html",
"text!./res/templates/elements/box.html", "./res/templates/elements/box.html",
"text!./res/templates/elements/line.html", "./res/templates/elements/line.html",
"text!./res/templates/elements/text.html", "./res/templates/elements/text.html",
"text!./res/templates/elements/image.html", "./res/templates/elements/image.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
LayoutController, LayoutController,

View File

@ -23,7 +23,7 @@
define([ define([
'./src/controllers/ListViewController', './src/controllers/ListViewController',
'./src/directives/MCTGesture', './src/directives/MCTGesture',
'text!./res/templates/listview.html', './res/templates/listview.html',
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ListViewController, ListViewController,

View File

@ -13,13 +13,13 @@ define([
"./src/actions/NewEntryContextual", "./src/actions/NewEntryContextual",
"./src/capabilities/NotebookCapability", "./src/capabilities/NotebookCapability",
"./src/policies/CompositionPolicy", "./src/policies/CompositionPolicy",
"text!./res/templates/notebook.html", "./res/templates/notebook.html",
"text!./res/templates/entry.html", "./res/templates/entry.html",
"text!./res/templates/annotation.html", "./res/templates/annotation.html",
"text!./res/templates/notifications.html", "./res/templates/notifications.html",
"text!../layout/res/templates/frame.html", "../layout/res/templates/frame.html",
"text!./res/templates/controls/embedControl.html", "./res/templates/controls/embedControl.html",
"text!./res/templates/controls/snapSelect.html" "./res/templates/controls/snapSelect.html"
], function ( ], function (
legacyRegistry, legacyRegistry,
NotebookController, NotebookController,
@ -288,19 +288,6 @@ define([
"key": "snapshot-select", "key": "snapshot-select",
"template": snapSelectTemplate "template": snapSelectTemplate
} }
],
"stylesheets": [
{
"stylesheetUrl": "css/notebook.css"
},
{
"stylesheetUrl": "css/notebook-espresso.css",
"theme": "espresso"
},
{
"stylesheetUrl": "css/notebook-snow.css",
"theme": "snow"
}
] ]
} }
}); });

View File

@ -38,7 +38,7 @@ var OVERLAY_TEMPLATE = '' +
define([ define([
'zepto', 'zepto',
"text!../../res/templates/snapshotHeader.html" "../../res/templates/snapshotHeader.html"
], ],
function ($, headerTemplate) { function ($, headerTemplate) {

View File

@ -310,8 +310,7 @@ define(
initiatingEvent = agentService.isMobile() ? initiatingEvent = agentService.isMobile() ?
'touchstart' : 'mousedown', 'touchstart' : 'mousedown',
dismissExistingMenu, dismissExistingMenu,
menu, menu;
popup;
var container = $($event.currentTarget).parent().parent(); var container = $($event.currentTarget).parent().parent();
@ -333,7 +332,7 @@ define(
// ...and record the presence of this menu. // ...and record the presence of this menu.
dismissExistingMenu = dismiss; dismissExistingMenu = dismiss;
popup = popupService.display(menu, [$event.pageX,$event.pageY], { popupService.display(menu, [$event.pageX,$event.pageY], {
marginX: 0, marginX: 0,
marginY: -50 marginY: -50
}); });

View File

@ -31,11 +31,9 @@ define(['zepto'], function ($) {
var selectedModel = selectedObject.getModel(); var selectedModel = selectedObject.getModel();
var cssClass = selectedObject.getCapability('type').typeDef.cssClass; var cssClass = selectedObject.getCapability('type').typeDef.cssClass;
var entryId = -1; var entryId = -1;
var embedId = -1;
$scope.clearSearch(); $scope.clearSearch();
if ($element[0].id === 'newEntry') { if ($element[0].id === 'newEntry') {
entryId = $scope.domainObject.model.entries.length; entryId = $scope.domainObject.model.entries.length;
embedId = 0;
var lastEntry = $scope.domainObject.model.entries[entryId - 1]; var lastEntry = $scope.domainObject.model.entries[entryId - 1];
if (lastEntry === undefined || lastEntry.text || lastEntry.embeds) { if (lastEntry === undefined || lastEntry.text || lastEntry.embeds) {
$scope.domainObject.useCapability('mutation', function (model) { $scope.domainObject.useCapability('mutation', function (model) {
@ -84,8 +82,6 @@ define(['zepto'], function ($) {
}); });
}); });
embedId = $scope.domainObject.model.entries[entryId].embeds.length - 1;
if (selectedObject) { if (selectedObject) {
e.preventDefault(); e.preventDefault();

View File

@ -22,7 +22,7 @@
define([ define([
"./src/EmbeddedPageController", "./src/EmbeddedPageController",
"text!./res/iframe.html", "./res/iframe.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
EmbeddedPageController, EmbeddedPageController,

View File

@ -22,7 +22,7 @@
define([ define([
"text!./res/markup.html", "./res/markup.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (

View File

@ -1,134 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
"./src/directives/MCTTable",
"./src/controllers/TelemetryTableController",
"./src/controllers/TableOptionsController",
'../../commonUI/regions/src/Region',
'../../commonUI/browse/src/InspectorRegion',
"text!./res/templates/table-options-edit.html",
"text!./res/templates/telemetry-table.html",
"legacyRegistry"
], function (
MCTTable,
TelemetryTableController,
TableOptionsController,
Region,
InspectorRegion,
tableOptionsEditTemplate,
telemetryTableTemplate,
legacyRegistry
) {
/**
* Two region parts are defined here. One that appears only in browse
* mode, and one that appears only in edit mode. For not they both point
* to the same representation, but a different key could be used here to
* include a customized representation for edit mode.
*/
var tableInspector = new InspectorRegion(),
tableOptionsEditRegion = new Region({
name: "table-options",
title: "Table Options",
modes: ['edit'],
content: {
key: "table-options-edit"
}
});
tableInspector.addRegion(tableOptionsEditRegion);
legacyRegistry.register("platform/features/table", {
"extensions": {
"types": [
{
"key": "table",
"name": "Telemetry Table",
"cssClass": "icon-tabular-realtime",
"description": "A table of values over a given time period. The table will be automatically updated with new values as they become available",
"priority": 861,
"features": "creation",
"delegates": [
"telemetry"
],
"inspector": "table-options-edit",
"contains": [
{
"has": "telemetry"
}
],
"model": {
"composition": []
},
"views": [
"table"
]
}
],
"controllers": [
{
"key": "TelemetryTableController",
"implementation": TelemetryTableController,
"depends": ["$scope", "$timeout", "openmct"]
},
{
"key": "TableOptionsController",
"implementation": TableOptionsController,
"depends": ["$scope"]
}
],
"views": [
{
"name": "Telemetry Table",
"key": "table",
"cssClass": "icon-tabular-realtime",
"template": telemetryTableTemplate,
"needs": [
"telemetry"
],
"delegation": true,
"editable": false
}
],
"directives": [
{
"key": "mctTable",
"implementation": MCTTable,
"depends": ["$timeout"]
}
],
"representations": [
{
"key": "table-options-edit",
"template": tableOptionsEditTemplate
}
],
"stylesheets": [
{
"stylesheetUrl": "css/table.css",
"priority": "mandatory"
}
]
}
});
});

View File

@ -1,95 +0,0 @@
<div class="l-control-bar">
<a class="s-button t-export icon-download labeled"
ng-click="exportAsCSV()"
title="Export This View's Data">
Export
</a>
</div>
<div class="mct-table-headers-w" mct-scroll-x="scroll.x">
<table class="mct-table l-tabular-headers filterable"
ng-style="{
'max-width': totalWidth
}">
<thead>
<tr>
<th ng-repeat="header in displayHeaders"
ng-style="{
width: columnWidths[$index] + 'px',
'max-width': columnWidths[$index] + 'px',
}"
ng-class="[
enableSort ? 'sortable' : '',
sortColumn === header ? 'sort' : '',
sortDirection || ''
].join(' ')"
ng-click="toggleSort(header)">
{{ header }}
</th>
</tr>
<tr ng-if="enableFilter" class="s-filters">
<th ng-repeat="header in displayHeaders"
ng-style="{
width: columnWidths[$index] + 'px',
'max-width': columnWidths[$index] + 'px',
}">
<div class="holder l-filter flex-elem grows"
ng-class="{active: filters[header]}">
<input type="text"
ng-model="filters[header]"/>
<a class="clear-icon clear-input icon-x-in-circle"
ng-class="{show: filters[header]}"
ng-click="filters[header] = undefined"></a>
</div>
</th>
</tr>
</thead>
</table>
</div>
<table class="mct-sizing-table t-sizing-table"
ng-style="{
width: calcTableWidthPx
}">
<tbody>
<tr>
<td ng-repeat="header in displayHeaders">{{header}}</td>
</tr>
<tr><td ng-repeat="header in displayHeaders" >
{{sizingRow[header].text}}
</td></tr>
</tbody>
</table>
<div class="l-tabular-body t-scrolling vscroll--persist" mct-resize="resize()" mct-scroll-x="scroll.x">
<div class="mct-table-scroll-forcer"
ng-style="{
width: totalWidth
}"></div>
<table class="mct-table"
ng-style="{
height: totalHeight + 'px',
'max-width': totalWidth
}">
<tbody>
<tr ng-repeat-start="visibleRow in visibleRows track by $index"
ng-if="visibleRow.rowIndex === toiRowIndex"
ng-style="{ top: visibleRow.offsetY + 'px' }"
class="l-toi-tablerow">
<td colspan="999">
<mct-include key="'time-of-interest'"
class="l-toi-holder pinned"></mct-include>
</td>
</tr>
<tr ng-repeat-end
ng-style="{ top: visibleRow.offsetY + 'px' }"
ng-click="table.onRowClick($event, visibleRow.rowIndex)">
<td ng-repeat="header in displayHeaders"
ng-style="{
width: columnWidths[$index] + 'px',
'max-width': columnWidths[$index] + 'px',
}"
class="{{visibleRow.contents[header].cssClass}}">
{{ visibleRow.contents[header].text }}
</td>
</tr>
</tbody>
</table>
</div>

View File

@ -1,32 +0,0 @@
<!--
Open MCT, Copyright (c) 2014-2018, United States Government
as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved.
Open MCT is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Open MCT includes source code licensed under additional open source
licenses. See the Open Source Licenses file (LICENSES.md) included with
this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information.
-->
<div ng-if="domainObject.getCapability('editor').inEditContext()"
ng-controller="TableOptionsController"
class="flex-elem grows l-inspector-part">
<mct-form
ng-model="configuration.table.columns"
structure="columnsForm"
name="columnsFormState"
class="flex-elem no-margin">
</mct-form>
</div>

View File

@ -1,15 +0,0 @@
<div ng-controller="TelemetryTableController as tableController"
ng-class="{'loading': loading}">
<mct-table
headers="headers"
rows="rows"
time-columns="[tableController.table.timeSystemColumnTitle]"
format-cell="formatCell"
enableFilter="true"
enableSort="true"
auto-scroll="autoScroll"
default-sort="defaultSort"
export-as="{{ exportAs }}"
class="tabular-holder l-sticky-headers has-control-bar">
</mct-table>
</div>

View File

@ -1,67 +0,0 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2018, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(function () {
function TableColumn(openmct, telemetryObject, metadatum) {
this.openmct = openmct;
this.telemetryObject = telemetryObject;
this.metadatum = metadatum;
this.formatter = openmct.telemetry.getValueFormatter(metadatum);
this.titleValue = this.metadatum.name;
}
TableColumn.prototype.title = function (title) {
if (arguments.length > 0) {
this.titleValue = title;
}
return this.titleValue;
};
TableColumn.prototype.isCurrentTimeSystem = function () {
var isCurrentTimeSystem = this.metadatum.hints.hasOwnProperty('domain') &&
this.metadatum.key === this.openmct.time.timeSystem().key;
return isCurrentTimeSystem;
};
TableColumn.prototype.hasValue = function (telemetryObject, telemetryDatum) {
var keyStringForDatum = this.openmct.objects.makeKeyString(telemetryObject.identifier);
var keyStringForColumn = this.openmct.objects.makeKeyString(this.telemetryObject.identifier);
return keyStringForDatum === keyStringForColumn && telemetryDatum.hasOwnProperty(this.metadatum.source);
};
TableColumn.prototype.getValue = function (telemetryDatum, limitEvaluator) {
var alarm = limitEvaluator &&
limitEvaluator.evaluate(telemetryDatum, this.metadatum);
var value = {
text: this.formatter.format(telemetryDatum),
value: this.formatter.parse(telemetryDatum)
};
if (alarm) {
value.cssClass = alarm.cssClass;
}
return value;
};
return TableColumn;
});

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