Compare commits

...

117 Commits

Author SHA1 Message Date
Joel McKinnon
c70ac9759c resolve merge conflict 2020-07-23 15:40:52 -07:00
Charles Hacskaylo
d9baa94970 UI enhancement fixes 2 (#3225)
- Fixed incorrect CSS naming: `c-frame-edit__move` changed to
 `c-frame__move-bar`;
 - Fixed `display: contents` that was erroneously applied to
 `u-angular-object-view-wrapper` and preventing styling from being
 applied to plots, renamed class to `.l-angular-ov-wrapper`;
 - Removed commented CSS;
2020-07-22 20:20:17 -07:00
Shefali Joshi
afeb89a51a [VIPEROMCT-16] Creates a closure for telemetryObject so that requests can resolve correctly even if the telemetryObject is destroyed (#3210)
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-07-22 15:22:31 -07:00
johnriedel
07992f0b2a [Tabs View] add ability to remove tabs from tabs view interface (#3147) (#3148)
* add ability to remove tabs from tabs view interface (#3147)

* an "X" on each tab is visible in edit mode

* replaced custom removeDialog with openmct.overlays.dialog

* Minor mods to markup and CSS

- Changed tab from button to div to allow a cleaner approach to the
nested close button;
- Changed close "icon-x" span to a button and added `c-click-icon` style
tag;
- Tweaked class naming to simplify and align with a more functional/
descriptive approach;

* use ES6 arrow func to avoid self=this

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
Co-authored-by: charlesh88 <charlesh88@gmail.com>
2020-07-22 15:17:35 -07:00
Deep Tailor
a5c4508578 add minified vue to production (#3183)
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
2020-07-22 14:47:46 -07:00
Charles Hacskaylo
a4fab3ce8a UI enhancement fixes (#3222)
- Added min-width and min-height to Display Layout lines to allow
 easier selection and move when line is purely vertical or horizontal;
 - Fixed spacing, size and icon of overlay close button;
2020-07-22 11:35:06 -07:00
Charles Hacskaylo
97d80f57cc UI enhancements (#3217)
* UI enhancements for #3176

- Large overlay now displays fullscreen;

* UI enhancements for #3176

- Adding new ".is-in-small-container" CSS - VERY WIP!
- TODO: fix table implementation;

* UI fixes for NIRVSS client #170

- Hide table header filter inputs when table is in small container;

* UI fixes for NIRVSS client #170

- Fixing legends and plot layout when small, and within a stacked plot;
- Add new `hideLegendWhenSmall` property;
- Remove 'hidden' from plot legend position options;
- Reduced opacity of tabular headers in Espresso theme;
- VERY, VERY WIP right now!

* UI fixes for NIRVSS client #170

- Fixing legends and plot layout when small, and within a stacked plot;
- Cleanups, indention, removed commented CSS;
- Tightened up spacing in plot Y axis;

* UI enhancements for #3176

- Move local controls for plots and imagery, prevent overlapping with
 view large button when in a hidden frame in a layout;
 - Finesse local control styling for increased legibility;
 - Move l-state-indicators to avoid overlap with repositioned local
 controls, finesse styling;

* UI enhancements for #3176

- Tweak large overlay close button for better visual alignment;

* UI enhancements for #3176

- Significant improvements to lines in Display Layouts;
- Increased border-width for lines and boxes;
- Code enhanced for proper handling of horizontal and
vertical lines - but still isn't working properly;
- Renamed box-view.scss to box-and-line-views.scss;
- VERY WIP!

* Fixed incorrect grid array reference

* UI enhancements for #3176

- Fixed final issue with Display Layout line drawing object, thank you
@deeptailor!;

* UI enhancements for #3176

- Contrast enhancements and markup normalization for `c-object-label`
elements in main view, Layout frames, Inspector and overlay;
- Enhanced `l-overlay-large` layout;
- Tightened up margins and spacing in plots;
- Refined `is-paused` styling in Telemetry Tables;
- Now hide Telemetry Tables 'Export Data' button if rows are selected,
which use a separate export button;
- Layout frames now hide button's text labels when small;
- Layout frames spacing tightened up and improved;

* UI enhancements for #3176

- Tweak Snow theme constants;

* UI enhancements for #3176

- Fixed ObjectFrame getOverlayElement method, added a wrapper div
around the viewed object to properly control resulting layout in the
overlay;
- Simplified preview CSS to remove background, border and padding;
- Layout tweaks to add space between scrollbar and thumbs in Imagery
view;
- Removed dev "-info" element in LineView.vue;

* UI enhancements for #3176

- Improved styling for 'edit lock' button;

* UI enhancements for #3176

- Show Display Layout frame "-move" bar on hover, rather than select, to
 make it easier to select items with hidden frames, and only show -move
  bar's drag grippy when that frame is selected;
- `pointer-events: none` applied to table's body and plot's plot areas
when placed in a Layout and being edited, prevents distracting
interactions (plot zoom/pan, table row selection) when selecting and
moving elements in a Layout;
- Refined hover styles for c-button to use $filterHov, simplified and
normalized hover styling;
- Converted a number of old `<a>` tags to `<buttons>` to normalize
styling and use the appropriate control;
- Edit lock button is now colored when locked;

* Fix linting issue

* Minor tweaks

- Tweaked control positioning;

Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
2020-07-21 21:01:38 -07:00
Joel McKinnon
10241ee87d Merge branch 'eslint-one-var' of https://github.com/nasa/openmct into eslint-one-var 2020-07-21 14:48:02 -07:00
Joel McKinnon
46d4ecc497 resolved merge conflicts 2020-07-21 13:18:41 -07:00
Shefali Joshi
41138a1731 Merge pull request #3205 from nasa/data-dropout-fixes
### Reviewer Checklist

1. Changes appear to address issue? Y
2. Appropriate unit tests included? Y
3. Code style and in-line documentation are appropriate? Y
4. Commit messages meet standards? Y
5. Has associated issue been labelled `unverified`? (only applicable if this PR closes the issue) Y
2020-07-21 10:08:31 -07:00
Shefali Joshi
a54a2f8f84 Merge branch 'master' into data-dropout-fixes 2020-07-21 10:01:01 -07:00
Joel McKinnon
5bbe710552 Merge pull request #3215 from nasa/circle-ci-chromeheadless-test-failure
Removing use of ChromeHeadless and using FirefoxHeadless for Circle CI builds
2020-07-21 09:53:40 -07:00
Joshi
f2d34d7c33 For the short term, removing use of ChromeHeadless and using FirefoxHeadless instead. (added npm dependency)
Also increasing browserNoActivityTimeout to 90000

Resolves #3214
2020-07-20 15:12:53 -07:00
Shefali Joshi
8fa1770885 Merge branch 'master' into data-dropout-fixes 2020-07-20 15:01:11 -07:00
Deep Tailor
7221dc1ac6 make clear data indicator a configurable option (#3206) 2020-07-17 16:48:14 -07:00
Charles Hacskaylo
25bb9939d6 Merge pull request #3193 from nasa/fix-safari-3192
Fix Safari display issues for #3192
2020-07-17 15:59:38 -07:00
Charles Hacskaylo
e7e12504f2 Merge branch 'master' into fix-safari-3192 2020-07-17 15:19:32 -07:00
Andrew Henry
63bf856d89 Enable persistence operations from Object Providers (#3200)
* Implement 'save' method in Object API

* Refactor legacy persistence code to work with new save object API

* Added 'isPersistable' check to object API

* Fixed incompatibility between object API changes and composition policies

* Make save method private

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-07-17 09:58:03 -07:00
Shefali Joshi
e3dcd51f8d Disallow editor Edit mode when object is locked (#3208)
* Don't allow editor edit if object is locked

* Adds log statement

* Use capture phase for onDragOver

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-07-17 09:23:51 -07:00
Charles Hacskaylo
cb63f4eca1 Fix is-missing layout problem #3194 (#3195)
- Fixes related to `is-missing` including fixes for Display Layout
alphanumeric views and Tabs view tabs;
2020-07-16 12:43:37 -07:00
Andrew Henry
3f60c3c0f1 Merge branch 'master' into data-dropout-fixes 2020-07-16 11:55:02 -07:00
Andrew Henry
16bb22e834 Added regression test 2020-07-16 11:50:03 -07:00
charlesh88
b1467548da Fix Safari display issues #3192
- Tweaks to fix `c-tab` elements, fix clip-path for webkit;
- Fix Notebook Snapshots header;
2020-07-14 23:40:42 -07:00
charlesh88
baa7c0bc58 Fix Safari display issues #3192
- Tweak to Status area indicator hover bubbles;
2020-07-14 21:51:22 -07:00
charlesh88
73b81e38e7 Fix Safari display issues #3192
- Fix collapsed Status area indicators width problem;
2020-07-14 19:22:18 -07:00
charlesh88
8b088b7a2c Fix Safari display issues #3192
- Fix Status area indicators width problem;
- Also fixes collapsing-status-area-indicator-bubbles transition problem
 as well!;
2020-07-14 18:53:30 -07:00
charlesh88
894da25461 Fix Safari display issues #3192
- Fix Inspector `__content` to properly use flex column layout;
- Change `u-angular-object-view-wrapper` to `display: contents`;
- Fix `gl-plot` to properly use `flex: 1 1 auto` instead of width and
height;
2020-07-14 18:42:52 -07:00
Joel McKinnon
d83adec21f Merge branch 'master' into eslint-one-var 2020-07-13 12:44:17 -07:00
David Tsay
87d63806b9 [Plots] Better Pan/Marquee handling (#3165)
* check for alt key pressed on mouse events

* allows for release of alt key during drag

* eliminates non-browser event states like alt-tab switching apps in windows

* do not listen to plot mouse events on browser context (ctrl) click

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-07-13 12:39:37 -07:00
Joel McKinnon
4512fe960a fixed merge conflicts 2020-07-13 12:25:29 -07:00
Charles Hacskaylo
f0e7f8cfc0 Fix incorrect property inspection (#3180)
- Fixed Folder grid and list views;
- Fixed plot collapsed and expanded legends;

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-07-13 11:36:21 -07:00
Deep Tailor
db597e1e93 [Tabs View] Fix tab not being added (#3160) 2020-07-13 10:24:22 -07:00
Andrew Henry
98db273f5d Remove unsubscribe callback 2020-07-10 15:10:33 -07:00
Charles Hacskaylo
8a6f944655 Missing items (#3125)
* Missing objects styling WIP

- Grabbing prior work from `missing-items` branch;

* Missing objects styling WIP

- Grabbing prior work on hover and missing theme constants from
`missing-items` branch;
- Refined theme constants values;
- Renamed relevant mixins and classes from "isUnknown" to "isMissing";
- Applied new hover and missing/unknown styling to Folder-view grid
items;

* Missing objects styling WIP

- Significant refinements and additions to `is-missing`;
- Normalize object type icons as a markup `*__type-icon` to support
styling and positioning of `is-missing__indicator` as a markup element;
- Application to tree items, l-browse-bar in main view, c-object-label,
grid view;
- Change hover approach in grid-items and tree to use filters;

* Missing objects styling WIP

- Styles added to object-name component in Inspector, markup simplified;
- Styles added to Tabs view;

* Missing objects styling WIP

- Simplified and consolidated `is-missing` approach into
`.c-object-label` class;
- Modded `.c-object-label` class to use flex 1 1 auto, instead of 0 1
auto - be on the outlook for regression problems!;
- TODO: wire up `is-missing` for real and Folder List view;

* Missing objects styling WIP

- Added `is-missing` styling to Folder list view;
- Cleanups, simplification and normalization with tree items in
list-item and list-view.scss;
- Using `c-object-label` now in Folder list view;
- Removed too-broad `<a>` color definition in table.scss;

* Missing objects styling WIP

- `is-missing` added to layout frames, with support for hidden
frames and telemetry views.
- Further styles enhancement;
- Continued added wiring points into markup;

* Missing objects styling WIP

- `is-missing` added to mct-plot;
- Significant improvements for cursor lock indicators in plots;

* Missing objects styling WIP

- Plot legend fixes, added overflow scrolling for collapsed and expanded
 legends;
- Removed conmmented code;

* Wire up 'is-missing'

- Added property checks on domainObject for status 'missing';

* Fix linting issues

* remove carat from eslint package

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-07-10 15:08:14 -07:00
Andrew Henry
bacad24811 Delete telemetry cache only when count reaches 0 2020-07-10 13:27:30 -07:00
Deep Tailor
8cc58946cf Remove Karma Report that was accidentally checked in (#3097)
* remove karma report

* add report.*.json to gitignore

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
2020-07-10 12:47:52 -07:00
Deep Tailor
3338bc1000 upgrade painterro to +1.00.35 (#3172) 2020-07-09 13:41:52 -07:00
David Tsay
80c20b3d05 [Plots] Allow user to change marker style (#3135)
* lineWidth is not supported in modern browsers

* allow marker shape selection in plot inspector

add shapes for canvas2d - point, cross, star

* change line style to line method in anticipation of adding true line style attribute

* add canvas2d circle marker shape

* allow point shapes for webGL plots

add circle shape

* refactor for clarity

* refactor shape to shape code

* add missing semi-colon

* helper function for marker options display in inspector

refactor for clarity

* access correct file

* add diamond marker shape

* add triangle shape to canvas

* add webgl draw triangle marker shape

* refactor fragment shader for clarity
2020-07-09 13:14:32 -07:00
Joel McKinnon
529aa3a2cd fixed lint errors 2020-07-09 11:44:51 -07:00
Joel McKinnon
35062b164a Merge branch 'eslint-updates3' of https://github.com/nasa/openmct into eslint-updates3 2020-07-09 11:32:45 -07:00
Joel McKinnon
976d070402 resolved conflicts 2020-07-09 11:31:56 -07:00
Joel McKinnon
d2161d692c resolved conflict 2020-07-09 11:21:56 -07:00
Joel McKinnon
aa3aa23b95 resolved conflict 2020-07-09 11:21:00 -07:00
Joel McKinnon
3fc20995c7 Merge branch 'master' into eslint-updates3 2020-07-07 16:56:20 -07:00
Joel McKinnon
0d9558b891 Merge pull request #3162 from nasa/display-layout-fix-3161
Fixes issue created when removing Lodash function
2020-07-07 16:54:54 -07:00
Joel McKinnon
b378b6e465 completed changes for one-var rule 2020-07-07 16:40:01 -07:00
Deep Tailor
c29c3c386f fix issue created by lodash upgrade 2020-07-07 15:39:21 -07:00
Joel McKinnon
3a4c205f55 about half of one-var violations fixed 2020-07-07 09:19:51 -07:00
Joel McKinnon
5071328c90 first big chunk of one-var fixes 2020-07-06 23:35:31 -07:00
Joel McKinnon
04c258ccd3 Merge branch 'eslint-updates2' of https://github.com/nasa/openmct into eslint-updates2 2020-07-06 15:08:24 -07:00
Joel McKinnon
6d37adde0e addressed review comments 2020-07-06 15:08:11 -07:00
Joel McKinnon
25aad22562 Merge branch 'master' of https://github.com/nasa/openmct into eslint-updates2 2020-07-06 15:06:52 -07:00
Joel McKinnon
6e3e7a50d7 Merge branch 'master' into eslint-updates2 2020-07-06 11:37:35 -07:00
Jamie V
9ceb3c5b1e Merge pull request #3130 from nasa/display-layout-fix-3128
[Display Layouts] Prevent duplicate from being added when composition 'add' is fired
2020-07-06 11:36:25 -07:00
Joel McKinnon
cfcfb31193 resolve merge conflict 2020-07-06 11:34:39 -07:00
Joel McKinnon
db0d5bd974 added rule func-style 2020-07-06 11:29:32 -07:00
Joel McKinnon
01407ffbe2 changed isNotEqual to arrow function 2020-07-06 08:46:35 -07:00
Joel McKinnon
26d3fce0c8 restored xdescribe in spec 2020-07-06 08:41:48 -07:00
Joel McKinnon
539e0773f8 Merge branch 'eslint-updates2' of https://github.com/nasa/openmct into eslint-updates2 2020-07-06 08:36:28 -07:00
Joel McKinnon
4d34fad8db restored default port, removed additional rule 2020-07-06 08:35:34 -07:00
Joel McKinnon
bfea0e89e6 Merge branch 'master' into eslint-updates2 2020-07-06 08:29:23 -07:00
Joel McKinnon
8e04a9c550 fixed invalid-this issues 2020-07-02 16:42:12 -07:00
Deep Tailor
bee3a9eedf Merge branch 'master' into display-layout-fix-3128 2020-07-02 10:48:53 -07:00
Jamie V
e515d19acd Merge pull request #3144 from nasa/switching-type-error
Fix for non working switch from alpha to tables and plots
2020-07-02 10:38:01 -07:00
Deep Tailor
dd13efe065 Merge branch 'master' into switching-type-error 2020-07-02 10:26:13 -07:00
Charles Hacskaylo
b5dfbe268c Merge pull request #3146 from nasa/new-folder-action-fix-07012020
Added unnamed folder and made it required
2020-07-01 16:48:10 -07:00
Deep Tailor
a9b9107cc3 change icon and action name 2020-07-01 16:30:03 -07:00
Deep Tailor
cfda4e4214 added unnamed folder and required 2020-07-01 16:20:33 -07:00
Deep Tailor
0a657de4b2 Fix for non working switch from alpha to tables 2020-07-01 16:09:05 -07:00
Shefali Joshi
8153edb9cb Update any/all criterion when telemetry is removed (#3138)
Co-authored-by: Andrew Henry <akhenry@gmail.com>
2020-07-01 12:22:47 -07:00
Jamie V
22ca339fb9 [LADTable] Lad bounds listener FIX (#3114)
* added bounds listener, moved history request to function, checking for race conditions

Co-authored-by: Andrew Henry <akhenry@gmail.com>
2020-07-01 09:50:18 -07:00
Charles Hacskaylo
7f8764560b Add new glyphs 062320 (#3140)
* Adding new glyphs for multiple branches

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
2020-06-30 16:19:45 -07:00
Charles Hacskaylo
4411bb0a2d UI fixes for NIRVSS #170 (#3141)
* UI fixes for NIRVSS client #170
2020-06-30 16:12:28 -07:00
David Tsay
4ecd264d93 [Time Conductor] add history and select range features (#2932)
* basic brush prototype visible

* require alt pressed for grab handle. display only

* pan and zoom now co-exist

* revert selection to times

* make LocalTimeSystem UTCBased (Earth based)

* add LocalTimeSystem

* make isTimeFixed check reusable

* linting

* zoom axis sets start and end times

* pass isFixed as props so we can watch for change from parent

* disable cursor for local time and enable for fixed time

* linting

* resize brush on window resize

* just use d3-brush instead of entire d3 package

* WIP prototyping conductor history

* set global bounds before emitting change event

* WIP conductor history

* WIP save history to and pull history from local storage

* WIP persistence works

* reset axis height after prototyping

* conductor history functionality complete

* clean up refactoring

* add presets

code cleanup

* axis visual tuning

* remove unused function calls

* change tick to timespan to avoid confusion

* fix bounds to use for timespans on pan axis

* linting

* linting

* more linting

* linting

* change realtime end bound to 30 secondes

* add max duration validation

* Tweaks to Time Conductor History menu

- Enhanced styles for `.c-menu`;
- Added hint messaging and separator;
- Reversed displayed history array so that latest entry is always first;

* refactor to use browser mouse events instead of d3brush

* Styling Time Conductor axis area

- Styles for `is-zooming` state and brush;
- Styles for `is-alt-key-down` for panning;
- Styles for hover modified;

* resolve merge conflicts

* Styling Time Conductor axis and inputs

- Moved panning and zooming styles up into `conductor.scss`;
- Stubbed in :class names in Conductor.vue;
- New theme constants;

* fix merge conflict

* move zoom/pan styling up to conductor

* WIP almost there

* fix zoom

* move altPressed up to parent

* handle no drag on pan

* rename inMode vars for clarity

* Styling for Time Conductor zoom and pan

- Minor fix to hover cursor for alt-pressed panning;

* add configurable bounds limit to time conductor

* add presets and records

* fixes for history

* remove lodash

* add default configurables for examples

* do not install local time system

* cleanup

* fix indentation

remove logging

* remove comments

* section-hint without section-separator styling

* provide reasonable defaults for conductor configuration

* specify input to check validation on

* improve validation

* first check both inputs for valid formats

* clear each valid input on new entry

* tear down listeners

* add user instructions

* allow preset bounds to be declared as callback function

* set this.left on resize

code refactoring

Co-authored-by: charlesh88 <charlesh88@gmail.com>
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-30 12:10:35 -07:00
Joel McKinnon
e6cd94123c satisfying no-invalid-this rule 2020-06-30 09:56:46 -07:00
Joel McKinnon
1be7927303 satisfied array-callback-return rule 2020-06-30 09:02:36 -07:00
Shefali Joshi
16677c99c9 Add staleness evaluation to conditions. (#3110)
* Add staleness evaluation to conditions.
Add supporting tests
Resolves #3109

* Fix broken test

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-29 14:13:44 -07:00
Deep Tailor
6ab468086a Lock views and prevent editing (#3094)
* working lock and unlock

* prevent flexible layout drop hints from showing

* fix lint issue

* wip

* disable mousedown when not editing in DisplayLayout

* continued wip

* Cherrypick new glyphs from add-new-glyphs-062320

* More new glyphs, updated art

- New glyphs: icon-unlocked and icon-target;
- Updated art for icon-lock glyph;

* Edit toggle refinements WIP

- Markup, CSS in BrowseBar.vue;

* More new glyphs, updated art

- New glyphs: icon-unlocked and icon-target;
- Updated art for icon-lock glyph;

* Edit toggle refinements

- Replaced toggle switch with button;

* prevent styling changes when locked

* fix lint issues

* fix tests

* make reviewer suggested changes

Co-authored-by: charlesh88 <charlesh88@gmail.com>
2020-06-29 13:14:42 -07:00
Deep Tailor
9d2991ee10 [Snapshots] Add download as PNG and JPG buttons (#3123)
* working export

* fix lint errors
2020-06-26 17:34:36 -07:00
Deep Tailor
dadb6120c2 fix lint error 2020-06-26 14:00:39 -07:00
Deep Tailor
d9a94db59d prevent composition from adding a dupe into layout 2020-06-26 13:51:03 -07:00
Joel McKinnon
6dd8d448df Merge pull request #3116 from nasa/new-folder-action
New folder action
2020-06-25 13:27:28 -07:00
Deep Tailor
ef2db1edaf Merge branch 'master' into new-folder-action 2020-06-25 13:13:06 -07:00
Deep Tailor
3748927e87 Display layout fixes 062320 (#3111)
* fix for persisting new domainObject

* convert stacked plot to alpha
2020-06-25 11:03:31 -07:00
Deep Tailor
7e4aac028b Merge branch 'master' into new-folder-action 2020-06-25 10:08:26 -07:00
Jamie V
8e54b8a819 LAD Table (Set) Composition Policy (#2962)
* added LAD Table composition policy, with a check for lad table sets, child can only be lad table
Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-24 13:26:22 -07:00
David Tsay
9e5eddec9b [Plots] y-axis width fix (#3112)
* remove lodash

native implementation of lodash max

* remove unused lodash imports

* add 'missing' semi-colon

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-24 11:44:40 -07:00
Deep Tailor
c46e4c5dad Merge branch 'master' into new-folder-action 2020-06-24 09:51:39 -07:00
Jamie V
f0dc928230 Imagery Bug Fixes (Future Date Issues) (#3107)
[Example Imagery] Console error on pause when start and end date is in future #3103

* added some checks for no image

* some code style updates and removing a nested if statement

Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
2020-06-24 09:47:04 -07:00
Deep Tailor
6f674930d9 remove fdescribe 2020-06-23 18:34:19 -07:00
Deep Tailor
8675fc3fa6 add a few more tests 2020-06-23 18:33:51 -07:00
Deep Tailor
25434342f3 remove unused imports 2020-06-23 16:20:44 -07:00
Deep Tailor
8044dfe726 fix tests 2020-06-23 16:20:28 -07:00
Deep Tailor
cd6c7fdc5e fix broken tests 2020-06-23 15:54:10 -07:00
Deep Tailor
7ff85dc396 remove report 2020-06-23 15:30:37 -07:00
Deep Tailor
fb4877924a remove fdescribe 2020-06-23 15:23:00 -07:00
Deep Tailor
4b13cbdb33 add test 2020-06-23 15:22:43 -07:00
Deep Tailor
51c9328dfd working new folder action 2020-06-23 14:39:19 -07:00
Andrew Henry
31ac67b393 Do not respond to bounds tick changes (#3106)
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-23 13:14:17 -07:00
Shefali Joshi
0399766ccd Merge pull request #3074 from nasa/testing-guidelines
Added guidelines to testing documentation
2020-06-23 10:53:39 -07:00
Shefali Joshi
18ab034147 Merge branch 'master' into testing-guidelines 2020-06-23 10:40:58 -07:00
Joel McKinnon
8a4bc2a463 bumped angular to >=1.8.0 (#3100) 2020-06-22 14:56:06 -07:00
Deep Tailor
771fb9c044 [Display Layout] Allow multiple selection, duplication, and changing types (#3083)
* enable multiple selection

* enable object duplication

* enable copy styles

* enable converting plots and tables to alpha numerics

* enable merging multiple alpha numerics

* change icon for viewSwitcher

* allow users to merge overlay plots into a stacked plot

* New glyph for alphanumeric

Co-authored-by: charlesh88 <charlesh88@gmail.com>
2020-06-19 11:44:17 -07:00
Jamie V
055cf2b118 Lad testing (#3045)
* Added tests for LAD Tables and LAD Table Sets

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
2020-06-17 17:25:34 -07:00
Andrew Henry
e9cf337aac Merge branch 'master' into testing-guidelines 2020-06-17 15:38:56 -07:00
Andrew Henry
04a18248c7 Added reference to Angular memory leak best practices 2020-06-17 15:38:17 -07:00
Andrew Henry
d462db60de Add note on convenience function for test cleanup 2020-06-17 15:31:35 -07:00
Andrew Henry
67ebcf4749 Update testing plan document with description of testathon process (#3022)
* Update testing plan document with description of testathon process
* Add instructions on unverified issues + link to instructions on pull requests.

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
2020-06-17 15:05:02 -07:00
Shefali Joshi
38dbf2ccab Addresses review comments for conditionals code (#2978)
Conditionals code refactoring

Co-authored-by: Andrew Henry <akhenry@gmail.com>
2020-06-17 14:56:36 -07:00
Andrew Henry
e9968e3649 Replace Angular code that synchronizes URL parameters with Time API (#3089)
* Added new test to telemetry tables to check that telemetry data is correctly rendered in rows

* Added test tools for mocking builtins

* Changed order that promises are resolved to address race condition

* Remove duplicate installation of UTC Time System

* Added additional test telemetry

* Start Open MCT headless

* Added headless mode start option. Fixes #3064

* Added new non-angular URL handler

* Removed legacy Angular TimeSettingsURLHandler

* Added function to testTools to reset application state

* Use resetApplicationState function from telemetry table spec

* Added new TimeSettingsURLHandler to plugins

* Added missing semicolons

* #2826 Refactored code into separate class

* Handling of hash-relative URLs

* Refactoring URL sync code

* Refactored to external class

* Moved utils to new 'utils' directory. Refactored location util functions from class to exported functions

* Added test specs for openmctLocation

* Added new function to destroy instances of Open MCT between test runs

* Ensure test specs are cleaning up after themselves

* Added test spec for new URLTimeSettingsSynchronizer

* Removed use of shell script as it doesn't work in windows

* Pushed test coverage to 100%

* Added missing copyright statement

* Removed debugging output

* Fixed linting error

* Upgrade node version

* Clear cache

* Re-enabled tests

Co-authored-by: Melanie Lean <melanielean@Melanies-MacBook-Pro.local>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-17 13:58:25 -07:00
Andrew Henry
d9fafd2956 Tweaked code standards for ternaries and return statements (#3082)
* Tweaked code standards for ternaries and return statements

* Tweaked language slightly

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
2020-06-17 10:52:30 -07:00
Joel McKinnon
b5aba7ce8f Merge pull request #3096 from nasa/revert-3095-patch-1
Revert "Update API.md"
2020-06-12 10:12:56 -07:00
Joel McKinnon
0db5648e10 Revert "Update API.md" 2020-06-12 10:07:49 -07:00
Joel McKinnon
83325da738 Merge pull request #3095 from willmendil/patch-1
Update API.md
2020-06-12 08:50:23 -07:00
Will
4d1b2f3456 Update API.md
typo
2020-06-12 17:42:39 +02:00
Andrew Henry
8962b0c88b Merge branch 'master' into testing-guidelines 2020-05-28 15:48:12 -07:00
Andrew Henry
3876151a4b Added guidelines to testing documentation
Migrating our testing guidelines into the open source repository in the interests of transparency, and to assist contributors to the project.
2020-05-27 13:57:46 -07:00
584 changed files with 9867 additions and 6221 deletions

View File

@@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:8-browsers
- image: circleci/node:13-browsers
environment:
CHROME_BIN: "/usr/bin/google-chrome"
steps:
@@ -11,12 +11,12 @@ jobs:
name: Update npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-13-{{ checksum "package.json" }}
- run:
name: Installing dependencies (npm install)
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
key: dependency-cache-13-{{ checksum "package.json" }}
paths:
- node_modules
- run:

View File

@@ -120,6 +120,8 @@ module.exports = {
"no-useless-computed-key": "error",
// https://eslint.org/docs/rules/rest-spread-spacing
"rest-spread-spacing": ["error"],
// https://eslint.org/docs/rules/one-var
"one-var": ["error", "never"],
"vue/html-indent": [
"error",

3
.gitignore vendored
View File

@@ -37,4 +37,7 @@ protractor/logs
# npm-debug log
npm-debug.log
# karma reports
report.*.json
package-lock.json

View File

@@ -178,7 +178,7 @@ The following guidelines are provided for anyone contributing source code to the
code, and present these in the following order:
* First, variable declarations and initialization.
* Secondly, imperative statements.
* Finally, the returned value. Functions should only have a single return statement.
* Finally, the returned value. A single return statement at the end of the function should be used, except where an early return would improve code clarity.
1. Avoid the use of "magic" values.
eg.
```JavaScript
@@ -189,7 +189,7 @@ The following guidelines are provided for anyone contributing source code to the
```JavaScript
if (responseCode === 401)
```
1. Dont use the ternary operator. Yes it's terse, but there's probably a clearer way of writing it.
1. Use the ternary operator only for simple cases such as variable assignment. Nested ternaries should be avoided in all cases.
1. Test specs should reside alongside the source code they test, not in a separate directory.
1. Organize code by feature, not by type.
eg.
@@ -226,9 +226,9 @@ typically from the author of the change and its reviewer.
Automated testing shall occur whenever changes are merged into the main
development branch and must be confirmed alongside any pull request.
Automated tests are typically unit tests which exercise individual software
components. Tests are subject to code review along with the actual
implementation, to ensure that tests are applicable and useful.
Automated tests are tests which exercise plugins, API, and utility classes.
Tests are subject to code review along with the actual implementation, to
ensure that tests are applicable and useful.
Examples of useful tests:
* Tests which replicate bugs (or their root causes) to verify their
@@ -238,8 +238,26 @@ Examples of useful tests:
* Tests which verify expected interactions with other components in the
system.
During automated testing, code coverage metrics will be reported. Line
coverage must remain at or above 80%.
#### Guidelines
* 100% statement coverage is achievable and desirable.
* Do blackbox testing. Test external behaviors, not internal details. Write tests that describe what your plugin is supposed to do. How it does this doesn't matter, so don't test it.
* Unit test specs for plugins should be defined at the plugin level. Start with one test spec per plugin named pluginSpec.js, and as this test spec grows too big, break it up into multiple test specs that logically group related tests.
* Unit tests for API or for utility functions and classes may be defined at a per-source file level.
* Wherever possible only use and mock public API, builtin functions, and UI in your test specs. Do not directly invoke any private functions. ie. only call or mock functions and objects exposed by openmct.* (eg. openmct.telemetry, openmct.objectView, etc.), and builtin browser functions (fetch, requestAnimationFrame, setTimeout, etc.).
* Where builtin functions have been mocked, be sure to clear them between tests.
* Test at an appropriate level of isolation. Eg.
* If youre testing a view, you do not need to test the whole application UI, you can just fetch the view provider using the public API and render the view into an element that you have created.
* You do not need to test that the view switcher works, there should be separate tests for that.
* You do not need to test that telemetry providers work, you can mock openmct.telemetry.request() to feed test data to the view.
* Use your best judgement when deciding on appropriate scope.
* Automated tests for plugins should start by actually installing the plugin being tested, and then test that installing the plugin adds the desired features and behavior to Open MCT, observing the above rules.
* All variables used in a test spec, including any instances of the Open MCT API should be declared inside of an appropriate block scope (not at the root level of the source file), and should be initialized in the relevant beforeEach block. `beforeEach` is preferable to `beforeAll` to avoid leaking of state between tests.
* A `afterEach` or `afterAll` should be used to do any clean up necessary to prevent leakage of state between test specs. This can happen when functions on `window` are wrapped, or when the URL is changed. [A convenience function](https://github.com/nasa/openmct/blob/master/src/utils/testing.js#L59) is provided for resetting the URL and clearing builtin spies between tests.
* If writing unit tests for legacy Angular code be sure to follow [best practices in order to avoid memory leaks](https://www.thecodecampus.de/blog/avoid-memory-leaks-angularjs-unit-tests/).
#### Examples
* [Example of an automated test spec for an object view plugin](https://github.com/nasa/openmct/blob/master/src/plugins/telemetryTable/pluginSpec.js)
* [Example of an automated test spec for API](https://github.com/nasa/openmct/blob/master/src/api/time/TimeAPISpec.js)
### Commit Message Standards

View File

@@ -1,6 +1,6 @@
# Open MCT License
Open MCT, Copyright (c) 2014-2019, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.
Open MCT, Copyright (c) 2014-2020, 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.

View File

@@ -125,3 +125,22 @@ A release is not closed until both categories have been performed on
the latest snapshot of the software, _and_ no issues labelled as
["blocker" or "critical"](https://github.com/nasa/openmctweb/blob/master/CONTRIBUTING.md#issue-reporting)
remain open.
### Testathons
Testathons can be used as a means of performing per-sprint and per-release testing.
#### Timing
For per-sprint testing, a testathon is typically performed at the beginning of the third week of a sprint, and again later that week to verify any fixes. For per-release testing, a testathon is typically performed prior to any formal testing processes that are applicable to that release.
#### Process
1. Prior to the scheduled testathon, a list will be compiled of all issues that are closed and unverified.
2. For each issue, testers should review the associated PR for testing instructions. See the contributing guide for instructions on [pull requests](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md#merging).
3. As each issue is verified via testing, any team members testing it should leave a comment on that issue indicating that it has been verified fixed.
4. If a bug is found that relates to an issue being tested, notes should be included on the associated issue, and the issue should be reopened. Bug notes should include reproduction steps.
5. For any bugs that are not obviously related to any of the issues under test, a new issue should be created with details about the bug, including reproduction steps. If unsure about whether a bug relates to an issue being tested, just create a new issue.
6. At the end of the testathon, triage will take place, where all tested issues will be reviewed.
7. If verified fixed, an issue will remain closed, and will have the “unverified” label removed.
8. For any bugs found, a severity will be assigned.
9. A second testathon will be scheduled for later in the week that will aim to address all issues identified as blockers, as well as any other issues scoped by the team during triage.
10. Any issues that were not tested will remain "unverified" and will be picked up in the next testathon.

View File

@@ -35,9 +35,9 @@ define(
function EventTelemetry(request, interval) {
var latestObservedTime = Date.now(),
count = Math.floor((latestObservedTime - firstObservedTime) / interval),
generatorData = {};
var latestObservedTime = Date.now();
var count = Math.floor((latestObservedTime - firstObservedTime) / interval);
var generatorData = {};
generatorData.getPointCount = function () {
return count;
@@ -49,8 +49,8 @@ define(
};
generatorData.getRangeValue = function (i, range) {
var domainDelta = this.getDomainValue(i) - firstObservedTime,
ind = i % messages.length;
var domainDelta = this.getDomainValue(i) - firstObservedTime;
var ind = i % messages.length;
return messages[ind] + " - [" + domainDelta.toString() + "]";
};

View File

@@ -34,9 +34,9 @@ define(
* @constructor
*/
function EventTelemetryProvider($q, $timeout) {
var subscriptions = [],
genInterval = 1000,
generating = false;
var subscriptions = [];
var genInterval = 1000;
var generating = false;
//
function matchesSource(request) {

View File

@@ -40,23 +40,23 @@ define([], function () {
}
ExportTelemetryAsCSVAction.prototype.perform = function () {
var context = this.context,
domainObject = context.domainObject,
telemetry = domainObject.getCapability("telemetry"),
metadata = telemetry.getMetadata(),
domains = metadata.domains,
ranges = metadata.ranges,
exportService = this.exportService;
var context = this.context;
var domainObject = context.domainObject;
var telemetry = domainObject.getCapability("telemetry");
var metadata = telemetry.getMetadata();
var domains = metadata.domains;
var ranges = metadata.ranges;
var exportService = this.exportService;
function getName(domainOrRange) {
return domainOrRange.name;
}
telemetry.requestData({}).then(function (series) {
var headers = domains.map(getName).concat(ranges.map(getName)),
rows = [],
row,
i;
var headers = domains.map(getName).concat(ranges.map(getName));
var rows = [];
var row;
var i;
function copyDomainsToRow(telemetryRow, index) {
domains.forEach(function (domain) {

View File

@@ -28,6 +28,16 @@ define([
domain: 2
}
},
// Need to enable "LocalTimeSystem" plugin to make use of this
// {
// key: "local",
// name: "Time",
// format: "local-format",
// source: "utc",
// hints: {
// domain: 3
// }
// },
{
key: "sin",
name: "Sine",
@@ -61,6 +71,15 @@ define([
domain: 1
}
},
{
key: "local",
name: "Time",
format: "utc",
source: "utc",
hints: {
domain: 2
}
},
{
key: "state",
source: "value",

View File

@@ -28,39 +28,39 @@ define([
) {
var RED = {
sin: 0.9,
cos: 0.9
sin: 0.9,
cos: 0.9
};
var YELLOW = {
sin: 0.5,
cos: 0.5
};
var LIMITS = {
rh: {
cssClass: "is-limit--upr is-limit--red",
low: RED,
high: Number.POSITIVE_INFINITY,
name: "Red High"
},
YELLOW = {
sin: 0.5,
cos: 0.5
rl: {
cssClass: "is-limit--lwr is-limit--red",
high: -RED,
low: Number.NEGATIVE_INFINITY,
name: "Red Low"
},
LIMITS = {
rh: {
cssClass: "is-limit--upr is-limit--red",
low: RED,
high: Number.POSITIVE_INFINITY,
name: "Red High"
},
rl: {
cssClass: "is-limit--lwr is-limit--red",
high: -RED,
low: Number.NEGATIVE_INFINITY,
name: "Red Low"
},
yh: {
cssClass: "is-limit--upr is-limit--yellow",
low: YELLOW,
high: RED,
name: "Yellow High"
},
yl: {
cssClass: "is-limit--lwr is-limit--yellow",
low: -RED,
high: -YELLOW,
name: "Yellow Low"
}
};
yh: {
cssClass: "is-limit--upr is-limit--yellow",
low: YELLOW,
high: RED,
name: "Yellow High"
},
yl: {
cssClass: "is-limit--lwr is-limit--yellow",
low: -RED,
high: -YELLOW,
name: "Yellow Low"
}
};
function SinewaveLimitProvider() {

View File

@@ -25,24 +25,24 @@ define(
function () {
"use strict";
var DEFAULT_IDENTITY = { key: "user", name: "Example User" },
DIALOG_STRUCTURE = {
name: "Identify Yourself",
sections: [{ rows: [
{
name: "User ID",
control: "textfield",
key: "key",
required: true
},
{
name: "Human name",
control: "textfield",
key: "name",
required: true
}
]}]
};
var DEFAULT_IDENTITY = { key: "user", name: "Example User" };
var DIALOG_STRUCTURE = {
name: "Identify Yourself",
sections: [{ rows: [
{
name: "User ID",
control: "textfield",
key: "key",
required: true
},
{
name: "Human name",
control: "textfield",
key: "name",
required: true
}
]}]
};
/**

View File

@@ -25,12 +25,12 @@ define(
function () {
"use strict";
var PREFIX = "msl_tlm:",
FORMAT_MAPPINGS = {
float: "number",
integer: "number",
string: "string"
};
var PREFIX = "msl_tlm:";
var FORMAT_MAPPINGS = {
float: "number",
integer: "number",
string: "string"
};
function RemsTelemetryModelProvider(adapter) {
@@ -64,8 +64,8 @@ define(
}
function addInstrument(subsystem, spacecraftId) {
var measurements = (subsystem.measurements || []),
instrumentId = makeId(subsystem);
var measurements = (subsystem.measurements || []);
var instrumentId = makeId(subsystem);
models[instrumentId] = {
type: "msl.instrument",

View File

@@ -42,9 +42,9 @@ define (
* object that wraps the telemetry returned from the telemetry source.
*/
RemsTelemetryProvider.prototype.requestTelemetry = function (requests) {
var packaged = {},
relevantReqs,
adapter = this.adapter;
var packaged = {};
var relevantReqs;
var adapter = this.adapter;
function matchesSource(request) {
return (request.source === SOURCE);

View File

@@ -30,8 +30,8 @@ define(
function (MSLDataDictionary, module) {
"use strict";
var TERRESTRIAL_DATE = "terrestrial_date",
LOCAL_DATA = "../data/rems.json";
var TERRESTRIAL_DATE = "terrestrial_date";
var LOCAL_DATA = "../data/rems.json";
/**
* Fetches historical data from the REMS instrument on the Curiosity
@@ -69,8 +69,8 @@ define(
* @private
*/
RemsTelemetryServerAdapter.prototype.requestHistory = function (request) {
var self = this,
id = request.key;
var self = this;
var id = request.key;
var dataTransforms = this.dataTransforms;

View File

@@ -44,31 +44,31 @@ define(
periodically with the progress of an ongoing process.
*/
$scope.launchProgress = function (knownProgress) {
var dialog,
model = {
title: "Progress Dialog Example",
progress: 0,
hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.",
actionText: "Calculating...",
unknownProgress: !knownProgress,
unknownDuration: false,
severity: "info",
options: [
{
label: "Cancel Operation",
callback: function () {
$log.debug("Operation cancelled");
dialog.dismiss();
}
},
{
label: "Do something else...",
callback: function () {
$log.debug("Something else pressed");
}
var dialog;
var model = {
title: "Progress Dialog Example",
progress: 0,
hint: "Do not navigate away from this page or close this browser tab while this operation is in progress.",
actionText: "Calculating...",
unknownProgress: !knownProgress,
unknownDuration: false,
severity: "info",
options: [
{
label: "Cancel Operation",
callback: function () {
$log.debug("Operation cancelled");
dialog.dismiss();
}
]
};
},
{
label: "Do something else...",
callback: function () {
$log.debug("Something else pressed");
}
}
]
};
function incrementProgress() {
model.progress = Math.min(100, Math.floor(model.progress + Math.random() * 30));
@@ -96,28 +96,28 @@ define(
Demonstrates launching an error dialog
*/
$scope.launchError = function () {
var dialog,
model = {
title: "Error Dialog Example",
actionText: "Something happened, and it was not good.",
severity: "error",
options: [
{
label: "Try Again",
callback: function () {
$log.debug("Try Again Pressed");
dialog.dismiss();
}
},
{
label: "Cancel",
callback: function () {
$log.debug("Cancel Pressed");
dialog.dismiss();
}
var dialog;
var model = {
title: "Error Dialog Example",
actionText: "Something happened, and it was not good.",
severity: "error",
options: [
{
label: "Try Again",
callback: function () {
$log.debug("Try Again Pressed");
dialog.dismiss();
}
]
};
},
{
label: "Cancel",
callback: function () {
$log.debug("Cancel Pressed");
dialog.dismiss();
}
}
]
};
dialog = dialogService.showBlockingMessage(model);
if (!dialog) {
@@ -129,21 +129,21 @@ define(
Demonstrates launching an error dialog
*/
$scope.launchInfo = function () {
var dialog,
model = {
title: "Info Dialog Example",
actionText: "This is an example of a blocking info" +
" dialog. This dialog can be used to draw the user's" +
" attention to an event.",
severity: "info",
primaryOption: {
label: "OK",
callback: function () {
$log.debug("OK Pressed");
dialog.dismiss();
}
var dialog;
var model = {
title: "Info Dialog Example",
actionText: "This is an example of a blocking info" +
" dialog. This dialog can be used to draw the user's" +
" attention to an event.",
severity: "info",
primaryOption: {
label: "OK",
callback: function () {
$log.debug("OK Pressed");
dialog.dismiss();
}
};
}
};
dialog = dialogService.showBlockingMessage(model);

View File

@@ -33,13 +33,13 @@ define(
function BrowserPersistenceProvider($q, SPACE) {
var spaces = SPACE ? [SPACE] : [],
caches = {},
promises = {
as: function (value) {
return $q.when(value);
}
};
var spaces = SPACE ? [SPACE] : [];
var caches = {};
var promises = {
as: function (value) {
return $q.when(value);
}
};
spaces.forEach(function (space) {
caches[space] = {};

View File

@@ -33,10 +33,10 @@ define(
* "foo."
*/
allow: function (action, context) {
var domainObject = (context || {}).domainObject,
model = (domainObject && domainObject.getModel()) || {},
name = model.name || "",
metadata = action.getMetadata() || {};
var domainObject = (context || {}).domainObject;
var model = (domainObject && domainObject.getModel()) || {};
var name = model.name || "";
var metadata = action.getMetadata() || {};
return metadata.key !== 'remove' || name.indexOf('foo') < 0;
}
};

View File

@@ -34,13 +34,13 @@ define(
* @implements {Indicator}
*/
function DigestIndicator($interval, $rootScope) {
var digests = 0,
displayed = 0,
start = Date.now();
var digests = 0;
var displayed = 0;
var start = Date.now();
function update() {
var now = Date.now(),
secs = (now - start) / 1000;
var now = Date.now();
var secs = (now - start) / 1000;
displayed = Math.round(digests / secs);
start = now;
digests = 0;

View File

@@ -34,8 +34,8 @@
<body>
</body>
<script>
const FIVE_MINUTES = 5 * 60 * 1000;
const THIRTY_MINUTES = 30 * 60 * 1000;
const THIRTY_SECONDS = 30 * 1000;
const THIRTY_MINUTES = THIRTY_SECONDS * 60;
[
'example/eventGenerator'
@@ -63,7 +63,39 @@
bounds: {
start: Date.now() - THIRTY_MINUTES,
end: Date.now()
}
},
// commonly used bounds can be stored in history
// bounds (start and end) can accept either a milliseconds number
// or a callback function returning a milliseconds number
// a function is useful for invoking Date.now() at exact moment of preset selection
presets: [
{
label: 'Last Day',
bounds: {
start: () => Date.now() - 1000 * 60 * 60 * 24,
end: () => Date.now()
}
},
{
label: 'Last 2 hours',
bounds: {
start: () => Date.now() - 1000 * 60 * 60 * 2,
end: () => Date.now()
}
},
{
label: 'Last hour',
bounds: {
start: () => Date.now() - 1000 * 60 * 60,
end: () => Date.now()
}
}
],
// maximum recent bounds to retain in conductor history
records: 10,
// maximum duration between start and end bounds
// for utc-based time systems this is in milliseconds
limit: 1000 * 60 * 60 * 24
},
{
name: "Realtime",
@@ -71,7 +103,7 @@
clock: 'local',
clockOffsets: {
start: - THIRTY_MINUTES,
end: FIVE_MINUTES
end: THIRTY_SECONDS
}
}
]
@@ -81,7 +113,10 @@
openmct.install(openmct.plugins.LADTable());
openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay']));
openmct.install(openmct.plugins.ObjectMigration());
openmct.install(openmct.plugins.ClearData(['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked']));
openmct.install(openmct.plugins.ClearData(
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'],
{indicator: true}
));
openmct.start();
</script>
</html>

View File

@@ -23,7 +23,7 @@
/*global module,process*/
const devMode = process.env.NODE_ENV !== 'production';
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'];
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'FirefoxHeadless'];
const coverageEnabled = process.env.COVERAGE === 'true';
const reporters = ['progress', 'html'];
@@ -95,6 +95,7 @@ module.exports = (config) => {
stats: 'errors-only',
logLevel: 'warn'
},
singleRun: true
singleRun: true,
browserNoActivityTimeout: 90000
});
}

View File

@@ -4,7 +4,7 @@
"description": "The Open MCT core platform",
"dependencies": {},
"devDependencies": {
"angular": "1.7.9",
"angular": ">=1.8.0",
"angular-route": "1.4.14",
"babel-eslint": "8.2.6",
"comma-separated-values": "^3.6.4",
@@ -41,6 +41,7 @@
"jsdoc": "^3.3.2",
"karma": "^2.0.3",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.3.0",
"karma-cli": "^1.0.1",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^2.1.1",
@@ -59,7 +60,7 @@
"moment-timezone": "0.5.28",
"node-bourbon": "^4.2.3",
"node-sass": "^4.9.2",
"painterro": "^0.2.65",
"painterro": "^1.0.35",
"printj": "^1.2.1",
"raw-loader": "^0.5.1",
"request": "^2.69.0",
@@ -84,10 +85,10 @@
"build:prod": "cross-env NODE_ENV=production webpack",
"build:dev": "webpack",
"build:watch": "webpack --watch",
"test": "karma start --single-run",
"test": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run",
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
"test:coverage": "./scripts/test-coverage.sh",
"test:watch": "karma start --no-single-run",
"test:coverage": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" COVERAGE=true karma start --single-run",
"test:watch": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --no-single-run",
"verify": "concurrently 'npm:test' 'npm:lint'",
"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'",

View File

@@ -25,9 +25,9 @@ define(
function (AboutController) {
describe("The About controller", function () {
var testVersions,
mockWindow,
controller;
var testVersions;
var mockWindow;
var controller;
beforeEach(function () {
testVersions = [

View File

@@ -25,8 +25,8 @@ define(
function (LicenseController) {
describe("The License controller", function () {
var testLicenses,
controller;
var testLicenses;
var controller;
beforeEach(function () {
testLicenses = [

View File

@@ -25,8 +25,8 @@ define(
function (LogoController) {
describe("The About controller", function () {
var mockOverlayService,
controller;
var mockOverlayService;
var controller;
beforeEach(function () {
mockOverlayService = jasmine.createSpyObj(

View File

@@ -30,9 +30,9 @@ define([
) {
describe("The navigate action", function () {
var mockNavigationService,
mockDomainObject,
action;
var mockNavigationService;
var mockDomainObject;
var action;
beforeEach(function () {
mockNavigationService = jasmine.createSpyObj(

View File

@@ -28,8 +28,8 @@ define(
function (NavigationService) {
describe("The navigation service", function () {
var $window,
navigationService;
let $window;
let navigationService;
beforeEach(function () {
$window = jasmine.createSpyObj('$window', ['confirm']);
@@ -37,8 +37,8 @@ define(
});
it("stores navigation state", function () {
var testObject = { someKey: 42 },
otherObject = { someKey: "some value" };
var testObject = { someKey: 42 };
var otherObject = { someKey: "some value" };
expect(navigationService.getNavigation())
.toBeUndefined();
navigationService.setNavigation(testObject);
@@ -52,8 +52,8 @@ define(
});
it("notifies listeners on change", function () {
var testObject = { someKey: 42 },
callback = jasmine.createSpy("callback");
var testObject = { someKey: 42 };
var callback = jasmine.createSpy("callback");
navigationService.addListener(callback);
expect(callback).not.toHaveBeenCalled();
@@ -63,8 +63,8 @@ define(
});
it("does not notify listeners when no changes occur", function () {
var testObject = { someKey: 42 },
callback = jasmine.createSpy("callback");
var testObject = { someKey: 42 };
var callback = jasmine.createSpy("callback");
navigationService.addListener(callback);
navigationService.setNavigation(testObject);
@@ -73,8 +73,8 @@ define(
});
it("stops notifying listeners after removal", function () {
var testObject = { someKey: 42 },
callback = jasmine.createSpy("callback");
var testObject = { someKey: 42 };
var callback = jasmine.createSpy("callback");
navigationService.addListener(callback);
navigationService.removeListener(callback);

View File

@@ -24,18 +24,18 @@ define([
'../../src/navigation/OrphanNavigationHandler'
], function (OrphanNavigationHandler) {
describe("OrphanNavigationHandler", function () {
var mockTopic,
mockThrottle,
mockMutationTopic,
mockNavigationService,
mockDomainObject,
mockParentObject,
mockContext,
mockActionCapability,
mockEditor,
testParentComposition,
testId,
mockThrottledFns;
var mockTopic;
var mockThrottle;
var mockMutationTopic;
var mockNavigationService;
var mockDomainObject;
var mockParentObject;
var mockContext;
var mockActionCapability;
var mockEditor;
var testParentComposition;
var testId;
var mockThrottledFns;
beforeEach(function () {
testId = 'some-identifier';

View File

@@ -25,12 +25,12 @@ define(
function (NewTabAction) {
describe("The new tab action", function () {
var actionSelected,
actionCurrent,
mockWindow,
mockContextCurrent,
mockContextSelected,
mockUrlService;
var actionSelected;
var actionCurrent;
var mockWindow;
var mockContextCurrent;
var mockContextSelected;
var mockUrlService;
beforeEach(function () {
mockWindow = jasmine.createSpyObj("$window", ["open", "location"]);

View File

@@ -31,13 +31,13 @@
</mct-form>
</div>
<div class="c-overlay__button-bar">
<a class='c-button c-button--major'
<button class='c-button c-button--major'
ng-class="{ disabled: !createForm.$valid }"
ng-click="ngModel.confirm()">
OK
</a>
<a class='c-button '
</button>
<button class='c-button '
ng-click="ngModel.cancel()">
Cancel
</a>
</button>
</div>

View File

@@ -31,13 +31,13 @@
</mct-include>
</div>
<div class="c-overlay__button-bar">
<a ng-repeat="option in ngModel.dialog.options"
<button ng-repeat="option in ngModel.dialog.options"
href=''
class="s-button lg"
title="{{option.description}}"
ng-click="ngModel.confirm(option.key)"
ng-class="{ major: $first, subtle: !$first }">
{{option.name}}
</a>
</button>
</div>
</mct-container>

View File

@@ -24,7 +24,7 @@
<div class="c-overlay__outer">
<button ng-click="ngModel.cancel()"
ng-if="ngModel.cancel"
class="c-click-icon c-overlay__close-button icon-x-in-circle"></button>
class="c-click-icon c-overlay__close-button icon-x"></button>
<div class="c-overlay__contents" ng-transclude></div>
</div>
</div>

View File

@@ -62,10 +62,10 @@ define(
DialogService.prototype.getDialogResponse = function (key, model, resultGetter, typeClass) {
// We will return this result as a promise, because user
// input is asynchronous.
var deferred = this.$q.defer(),
self = this,
overlay,
handleEscKeydown;
var deferred = this.$q.defer();
var self = this;
var overlay;
var handleEscKeydown;
// Confirm function; this will be passed in to the
// overlay-dialog template and associated with a
@@ -247,12 +247,12 @@ define(
if (this.canShowDialog(dialogModel)) {
// Add the overlay using the OverlayService, which
// will handle actual insertion into the DOM
var self = this,
overlay = this.overlayService.createOverlay(
"overlay-blocking-message",
dialogModel,
"t-dialog-sm"
);
var self = this;
var overlay = this.overlayService.createOverlay(
"overlay-blocking-message",
dialogModel,
"t-dialog-sm"
);
this.activeOverlay = overlay;

View File

@@ -76,8 +76,8 @@ define(
*/
OverlayService.prototype.createOverlay = function (key, overlayModel, typeClass) {
// Create a new scope for this overlay
var scope = this.newScope(),
element;
var scope = this.newScope();
var element;
// Stop showing the overlay; additionally, release the scope
// that it uses.

View File

@@ -28,14 +28,14 @@ define(
function (DialogService) {
describe("The dialog service", function () {
var mockOverlayService,
mockQ,
mockLog,
mockOverlay,
mockDeferred,
mockDocument,
mockBody,
dialogService;
var mockOverlayService;
var mockQ;
var mockLog;
var mockOverlay;
var mockDeferred;
var mockDocument;
var mockBody;
var dialogService;
beforeEach(function () {
mockOverlayService = jasmine.createSpyObj(
@@ -188,8 +188,8 @@ define(
});
it("individual dialogs can be dismissed", function () {
var secondDialogHandle,
secondMockOverlay;
var secondDialogHandle;
var secondMockOverlay;
dialogHandle.dismiss();

View File

@@ -28,15 +28,15 @@ define(
function (OverlayService) {
describe("The overlay service", function () {
var mockDocument,
mockCompile,
mockRootScope,
mockBody,
mockTemplate,
mockElement,
mockScope,
mockTimeout,
overlayService;
var mockDocument;
var mockCompile;
var mockRootScope;
var mockBody;
var mockTemplate;
var mockElement;
var mockScope;
var mockTimeout;
var overlayService;
beforeEach(function () {
mockDocument = jasmine.createSpyObj("$document", ["find"]);

View File

@@ -86,8 +86,8 @@ define(
* will be performed; should contain a `domainObject` property
*/
EditAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject,
type = domainObject && domainObject.getCapability('type');
var domainObject = (context || {}).domainObject;
var type = domainObject && domainObject.getCapability('type');
// Only allow editing of types that support it and are not already
// being edited

View File

@@ -37,8 +37,8 @@ define(
}
EditAndComposeAction.prototype.perform = function () {
var self = this,
editAction = this.domainObject.getCapability('action').getActions("edit")[0];
var self = this;
var editAction = this.domainObject.getCapability('action').getActions("edit")[0];
// Link these objects
function doLink() {

View File

@@ -46,9 +46,9 @@ define(
}
PropertiesAction.prototype.perform = function () {
var type = this.domainObject.getCapability('type'),
domainObject = this.domainObject,
dialogService = this.dialogService;
var type = this.domainObject.getCapability('type');
var domainObject = this.domainObject;
var dialogService = this.dialogService;
// Update the domain object model based on user input
function updateModel(userInput, dialog) {
@@ -81,9 +81,14 @@ define(
* context.
*/
PropertiesAction.appliesTo = function (context) {
var domainObject = (context || {}).domainObject,
type = domainObject && domainObject.getCapability('type'),
creatable = type && type.hasFeature('creation');
var domainObject = (context || {}).domainObject;
var type = domainObject && domainObject.getCapability('type');
var creatable = type && type.hasFeature('creation');
if (domainObject && domainObject.model && domainObject.model.locked) {
return false;
}
// Only allow creatable types to be edited
return domainObject && creatable;

View File

@@ -49,9 +49,9 @@ define(
* @memberof platform/commonUI/edit.SaveAction#
*/
SaveAction.prototype.perform = function () {
var self = this,
domainObject = this.domainObject,
dialog = new SaveInProgressDialog(this.dialogService);
var self = this;
var domainObject = this.domainObject;
var dialog = new SaveInProgressDialog(this.dialogService);
// Invoke any save behavior introduced by the editor capability;
// this is introduced by EditableDomainObject which is

View File

@@ -50,8 +50,8 @@ define(
* @memberof platform/commonUI/edit.SaveAndStopEditingAction#
*/
SaveAndStopEditingAction.prototype.perform = function () {
var domainObject = this.domainObject,
saveAction = new SaveAction(this.dialogService, this.notificationService, this.context);
var domainObject = this.domainObject;
var saveAction = new SaveAction(this.dialogService, this.notificationService, this.context);
function closeEditor() {
return domainObject.getCapability("editor").finish();

View File

@@ -99,11 +99,11 @@ function (
* @private
*/
SaveAsAction.prototype.save = function () {
var self = this,
domainObject = this.domainObject,
copyService = this.copyService,
dialog = new SaveInProgressDialog(this.dialogService),
toUndirty = [];
var self = this;
var domainObject = this.domainObject;
var copyService = this.copyService;
var dialog = new SaveInProgressDialog(this.dialogService);
var toUndirty = [];
function doWizardSave(parent) {
var wizard = self.createWizard(parent);

View File

@@ -49,10 +49,10 @@ define(
* transaction is in progress.
*/
TransactionCapabilityDecorator.prototype.getCapabilities = function () {
var self = this,
capabilities = this.capabilityService.getCapabilities
.apply(this.capabilityService, arguments),
persistenceCapability = capabilities.persistence;
var self = this;
var capabilities = this.capabilityService.getCapabilities
.apply(this.capabilityService, arguments);
var persistenceCapability = capabilities.persistence;
capabilities.persistence = function (domainObject) {
var original =

View File

@@ -29,8 +29,8 @@ define(
function () {
function cancelEditing(domainObject) {
var navigatedObject = domainObject,
editorCapability = navigatedObject &&
var navigatedObject = domainObject;
var editorCapability = navigatedObject &&
navigatedObject.getCapability("editor");
return editorCapability &&

View File

@@ -34,12 +34,12 @@ define(
// Update root object based on represented object
function updateRoot(domainObject) {
var root = self.rootDomainObject,
context = domainObject &&
domainObject.getCapability('context'),
newRoot = context && context.getTrueRoot(),
oldId = root && root.getId(),
newId = newRoot && newRoot.getId();
var root = self.rootDomainObject;
var context = domainObject &&
domainObject.getCapability('context');
var newRoot = context && context.getTrueRoot();
var oldId = root && root.getId();
var newId = newRoot && newRoot.getId();
// Only update if this has actually changed,
// to avoid excessive refreshing.

View File

@@ -63,9 +63,9 @@ define(
* This will prompt for user input first.
*/
CreateAction.prototype.perform = function () {
var newModel = this.type.getInitialModel(),
openmct = this.openmct,
newObject;
var newModel = this.type.getInitialModel();
var openmct = this.openmct;
var newObject;
function onCancel() {
openmct.editor.cancel();
@@ -78,13 +78,13 @@ define(
}
function navigateAndEdit(object) {
let objectPath = object.getCapability('context').getPath(),
url = '#/browse/' + objectPath
.slice(1)
.map(function (o) {
return o && openmct.objects.makeKeyString(o.getId());
})
.join('/');
let objectPath = object.getCapability('context').getPath();
let url = '#/browse/' + objectPath
.slice(1)
.map(function (o) {
return o && openmct.objects.makeKeyString(o.getId());
})
.join('/');
window.location.href = url;

View File

@@ -50,10 +50,10 @@ define(
}
CreateActionProvider.prototype.getActions = function (actionContext) {
var context = actionContext || {},
key = context.key,
destination = context.domainObject,
self = this;
var context = actionContext || {};
var key = context.key;
var destination = context.domainObject;
var self = this;
// We only provide Create actions, and we need a
// domain object to serve as the container for the

View File

@@ -55,8 +55,8 @@ define(
* show in the create dialog
*/
CreateWizard.prototype.getFormStructure = function (includeLocation) {
var sections = [],
domainObject = this.domainObject;
var sections = [];
var domainObject = this.domainObject;
function validateLocation(parent) {
return parent && this.openmct.composition.checkPolicy(parent.useCapability('adapter'), domainObject.useCapability('adapter'));
@@ -107,8 +107,8 @@ define(
* @returns {DomainObject}
*/
CreateWizard.prototype.populateObjectFromInput = function (formValue) {
var parent = this.getLocation(formValue),
formModel = this.createModel(formValue);
var parent = this.getLocation(formValue);
var formModel = this.createModel(formValue);
formModel.location = parent.getId();
this.domainObject.useCapability("mutation", function () {
@@ -126,10 +126,10 @@ define(
*/
CreateWizard.prototype.getInitialFormValue = function () {
// Start with initial values for properties
var model = this.model,
formValue = this.properties.map(function (property) {
return property.getValue(model);
});
var model = this.model;
var formValue = this.properties.map(function (property) {
return property.getValue(model);
});
// Include the createParent
formValue.createParent = this.parent;

View File

@@ -63,17 +63,17 @@ define(
* object has been created
*/
CreationService.prototype.createObject = function (model, parent) {
var persistence = parent.getCapability("persistence"),
newObject = parent.useCapability("instantiation", model),
newObjectPersistence = newObject.getCapability("persistence"),
self = this;
var persistence = parent.getCapability("persistence");
var newObject = parent.useCapability("instantiation", model);
var newObjectPersistence = newObject.getCapability("persistence");
var self = this;
// Add the newly-created object's id to the parent's
// composition, so that it will subsequently appear
// as a child contained by that parent.
function addToComposition() {
var compositionCapability = parent.getCapability('composition'),
addResult = compositionCapability &&
var compositionCapability = parent.getCapability('composition');
var addResult = compositionCapability &&
compositionCapability.add(newObject);
return self.$q.when(addResult).then(function (result) {

View File

@@ -39,8 +39,8 @@ define(
// used for bi-directional object selection.
function setLocatingObject(domainObject, priorObject) {
var context = domainObject &&
domainObject.getCapability("context"),
contextRoot = context && context.getRoot();
domainObject.getCapability("context");
var contextRoot = context && context.getRoot();
if (contextRoot && contextRoot !== $scope.rootObject) {
$scope.rootObject = undefined;

View File

@@ -36,8 +36,6 @@ define(
}
EditPersistableObjectsPolicy.prototype.allow = function (action, context) {
var identifier;
var provider;
var domainObject = context.domainObject;
var key = action.getMetadata().key;
var category = (context || {}).category;
@@ -46,9 +44,8 @@ define(
// is also invoked during the create process which should be allowed,
// because it may be saved elsewhere
if ((key === 'edit' && category === 'view-control') || key === 'properties') {
identifier = objectUtils.parseKeyString(domainObject.getId());
provider = this.openmct.objects.getProvider(identifier);
return provider.save !== undefined;
let newStyleObject = objectUtils.toNewFormat(domainObject, domainObject.getId());
return this.openmct.objects.isPersistable(newStyleObject);
}
return true;

View File

@@ -58,9 +58,9 @@ define(
* @param {String} message a message to log with the commit message.
*/
EditRepresenter.prototype.commit = function (message) {
var model = this.$scope.model,
configuration = this.$scope.configuration,
domainObject = this.domainObject;
var model = this.$scope.model;
var configuration = this.$scope.configuration;
var domainObject = this.domainObject;
this.$log.debug([
"Committing ",

View File

@@ -25,12 +25,12 @@ define(
function (CancelAction) {
describe("The Cancel action", function () {
var mockDomainObject,
mockParentObject,
capabilities = {},
parentCapabilities = {},
actionContext,
action;
var mockDomainObject;
var mockParentObject;
var capabilities = {};
var parentCapabilities = {};
var actionContext;
var action;
function mockPromise(value) {
return {

View File

@@ -25,15 +25,15 @@ define(
function (EditAction) {
describe("The Edit action", function () {
var mockLocation,
mockNavigationService,
mockLog,
mockDomainObject,
mockType,
mockEditor,
actionContext,
capabilities,
action;
var mockLocation;
var mockNavigationService;
var mockLog;
var mockDomainObject;
var mockType;
var mockEditor;
var actionContext;
var capabilities;
var action;
beforeEach(function () {
mockLocation = jasmine.createSpyObj(

View File

@@ -25,17 +25,17 @@ define(
function (EditAndComposeAction) {
describe("The Link action", function () {
var mockDomainObject,
mockParent,
mockContext,
mockComposition,
mockActionCapability,
mockEditAction,
mockType,
actionContext,
model,
capabilities,
action;
var mockDomainObject;
var mockParent;
var mockContext;
var mockComposition;
var mockActionCapability;
var mockEditAction;
var mockType;
var actionContext;
var model;
var capabilities;
var action;
function mockPromise(value) {
return {

View File

@@ -25,7 +25,13 @@ define(
function (PropertiesAction) {
describe("Properties action", function () {
var capabilities, model, object, context, input, dialogService, action;
var capabilities;
var model;
var object;
var context;
var input;
var dialogService;
var action;
function mockPromise(value) {
return {

View File

@@ -26,7 +26,10 @@ define(
describe("Properties dialog", function () {
var type, properties, model, dialog;
var type;
var properties;
var model;
var dialog;
beforeEach(function () {
type = {

View File

@@ -26,14 +26,14 @@ define(
function (SaveAction) {
describe("The Save action", function () {
var mockDomainObject,
mockEditorCapability,
actionContext,
mockDialogService,
mockNotificationService,
mockActionCapability,
capabilities = {},
action;
var mockDomainObject;
var mockEditorCapability;
var actionContext;
var mockDialogService;
var mockNotificationService;
var mockActionCapability;
var capabilities = {};
var action;
function mockPromise(value) {
return {

View File

@@ -32,14 +32,14 @@ define(
// depends on is not mocked, so we mock some
// of SaveAction's own dependencies to make
// it run.
var mockDomainObject,
mockEditorCapability,
actionContext,
dialogService,
notificationService,
mockActionCapability,
capabilities = {},
action;
var mockDomainObject;
var mockEditorCapability;
var actionContext;
var dialogService;
var notificationService;
var mockActionCapability;
var capabilities = {};
var action;
function mockPromise(value) {
return {

View File

@@ -26,18 +26,18 @@ define(
function (SaveAsAction) {
xdescribe("The Save As action", function () {
var mockDomainObject,
mockClonedObject,
mockEditorCapability,
mockActionCapability,
mockObjectService,
mockDialogService,
mockCopyService,
mockNotificationService,
mockParent,
actionContext,
capabilities = {},
action;
var mockDomainObject;
var mockClonedObject;
var mockEditorCapability;
var mockActionCapability;
var mockObjectService;
var mockDialogService;
var mockCopyService;
var mockNotificationService;
var mockParent;
var actionContext;
var capabilities = {};
var action;
function noop() {}

View File

@@ -25,14 +25,14 @@ define(
function (EditorCapability) {
xdescribe("The editor capability", function () {
var mockDomainObject,
capabilities,
mockParentObject,
mockTransactionService,
mockStatusCapability,
mockParentStatus,
mockContextCapability,
capability;
var mockDomainObject;
var capabilities;
var mockParentObject;
var mockTransactionService;
var mockStatusCapability;
var mockParentStatus;
var mockContextCapability;
var capability;
function fastPromise(val) {
return {

View File

@@ -28,10 +28,10 @@ define(
function (TransactionalPersistenceCapability, TransactionCapabilityDecorator) {
describe("The transaction capability decorator", function () {
var mockQ,
mockTransactionService,
mockCapabilityService,
provider;
var mockQ;
var mockTransactionService;
var mockCapabilityService;
var provider;
beforeEach(function () {
mockQ = {};

View File

@@ -36,12 +36,12 @@ define(
}
describe("The transactional persistence decorator", function () {
var mockQ,
mockTransactionManager,
mockPersistence,
mockDomainObject,
testId,
capability;
var mockQ;
var mockTransactionManager;
var mockPersistence;
var mockDomainObject;
var testId;
var capability;
beforeEach(function () {
testId = "test-id";

View File

@@ -48,9 +48,9 @@ define(
}
}
var mockScope,
mockActions,
controller;
var mockScope;
var mockActions;
var controller;
beforeEach(function () {
mockActions = jasmine.createSpyObj("action", ["getActions"]);

View File

@@ -25,16 +25,16 @@ define(
function (EditObjectController) {
describe("The Edit Object controller", function () {
var mockScope,
mockObject,
testViews,
mockEditorCapability,
mockLocation,
mockNavigationService,
removeCheck,
mockStatusCapability,
mockCapabilities,
controller;
var mockScope;
var mockObject;
var testViews;
var mockEditorCapability;
var mockLocation;
var mockNavigationService;
var removeCheck;
var mockStatusCapability;
var mockCapabilities;
var controller;
beforeEach(function () {
mockScope = jasmine.createSpyObj(

View File

@@ -25,10 +25,10 @@ define(
function (EditPanesController) {
describe("The Edit Panes controller", function () {
var mockScope,
mockDomainObject,
mockContext,
controller;
var mockScope;
var mockDomainObject;
var mockContext;
var controller;
beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", ["$watch"]);

View File

@@ -28,12 +28,12 @@ define(
function (CreateActionProvider) {
describe("The create action provider", function () {
var mockTypeService,
mockPolicyService,
mockCreationPolicy,
mockPolicyMap = {},
mockTypes,
provider;
var mockTypeService;
var mockPolicyService;
var mockCreationPolicy;
var mockPolicyMap = {};
var mockTypes;
var provider;
function createMockType(name) {
var mockType = jasmine.createSpyObj(

View File

@@ -28,13 +28,13 @@ define(
function (CreateAction) {
xdescribe("The create action", function () {
var mockType,
mockParent,
mockContext,
mockDomainObject,
capabilities = {},
mockEditAction,
action;
var mockType;
var mockParent;
var mockContext;
var mockDomainObject;
var capabilities = {};
var mockEditAction;
var action;
function mockPromise(value) {
return {

View File

@@ -28,9 +28,9 @@ define(
function (CreateMenuController) {
describe("The create menu controller", function () {
var mockScope,
mockActions,
controller;
var mockScope;
var mockActions;
var controller;
beforeEach(function () {
mockActions = jasmine.createSpyObj("action", ["getActions"]);

View File

@@ -28,13 +28,13 @@ define(
function (CreateWizard) {
xdescribe("The create wizard", function () {
var mockType,
mockParent,
mockProperties,
mockPolicyService,
testModel,
mockDomainObject,
wizard;
var mockType;
var mockParent;
var mockProperties;
var mockPolicyService;
var testModel;
var mockDomainObject;
var wizard;
function createMockProperty(name) {
var mockProperty = jasmine.createSpyObj(
@@ -142,11 +142,11 @@ define(
it("populates the model on the associated object", function () {
var formValue = {
"A": "ValueA",
"B": "ValueB",
"C": "ValueC"
},
compareModel = wizard.createModel(formValue);
"A": "ValueA",
"B": "ValueB",
"C": "ValueC"
};
var compareModel = wizard.createModel(formValue);
//populateObjectFromInput adds a .location attribute that is not added by createModel.
compareModel.location = undefined;
wizard.populateObjectFromInput(formValue);
@@ -156,19 +156,19 @@ define(
it("validates selection types using policy", function () {
var mockDomainObj = jasmine.createSpyObj(
'domainObject',
['getCapability']
),
mockOtherType = jasmine.createSpyObj(
'otherType',
['getKey']
),
'domainObject',
['getCapability']
);
var mockOtherType = jasmine.createSpyObj(
'otherType',
['getKey']
);
//Create a form structure with location
structure = wizard.getFormStructure(true),
sections = structure.sections,
rows = structure.sections[sections.length - 1].rows,
locationRow = rows[rows.length - 1];
//Create a form structure with location
var structure = wizard.getFormStructure(true);
var sections = structure.sections;
var rows = structure.sections[sections.length - 1].rows;
var locationRow = rows[rows.length - 1];
mockDomainObj.getCapability.and.returnValue(mockOtherType);
locationRow.validate(mockDomainObj);

View File

@@ -25,8 +25,8 @@ define(
function (CreationPolicy) {
describe("The creation policy", function () {
var mockType,
policy;
var mockType;
var policy;
beforeEach(function () {
mockType = jasmine.createSpyObj(

View File

@@ -28,18 +28,18 @@ define(
function (CreationService) {
describe("The creation service", function () {
var mockQ,
mockLog,
mockParentObject,
mockNewObject,
mockMutationCapability,
mockPersistenceCapability,
mockCompositionCapability,
mockContextCapability,
mockCreationCapability,
mockCapabilities,
mockNewPersistenceCapability,
creationService;
var mockQ;
var mockLog;
var mockParentObject;
var mockNewObject;
var mockMutationCapability;
var mockPersistenceCapability;
var mockCompositionCapability;
var mockContextCapability;
var mockCreationCapability;
var mockCapabilities;
var mockNewPersistenceCapability;
var creationService;
function mockPromise(value) {
return (value && value.then) ? value : {
@@ -157,10 +157,10 @@ define(
it("provides the newly-created object", function () {
var mockDomainObject = jasmine.createSpyObj(
'newDomainObject',
['getId', 'getModel', 'getCapability']
),
mockCallback = jasmine.createSpy('callback');
'newDomainObject',
['getId', 'getModel', 'getCapability']
);
var mockCallback = jasmine.createSpy('callback');
// Act as if the object had been created
mockCompositionCapability.add.and.callFake(function (id) {
@@ -180,8 +180,8 @@ define(
it("warns if parent has no persistence capability", function () {
// Callbacks
var success = jasmine.createSpy("success"),
failure = jasmine.createSpy("failure");
var success = jasmine.createSpy("success");
var failure = jasmine.createSpy("failure");
mockCapabilities.persistence = undefined;
creationService.createObject({}, mockParentObject).then(

View File

@@ -28,14 +28,14 @@ define(
function (LocatorController) {
describe("The locator controller", function () {
var mockScope,
mockTimeout,
mockDomainObject,
mockRootObject,
mockContext,
mockObjectService,
getObjectsPromise,
controller;
var mockScope;
var mockTimeout;
var mockDomainObject;
var mockRootObject;
var mockContext;
var mockObjectService;
var getObjectsPromise;
var controller;
beforeEach(function () {
mockScope = jasmine.createSpyObj(

View File

@@ -25,14 +25,14 @@ define(
function (EditPersistableObjectsPolicy) {
describe("The Edit persistable objects policy", function () {
var mockDomainObject,
mockEditAction,
mockPropertiesAction,
mockOtherAction,
mockAPI,
mockObjectAPI,
testContext,
policy;
var mockDomainObject;
var mockEditAction;
var mockPropertiesAction;
var mockOtherAction;
var mockAPI;
var mockObjectAPI;
var testContext;
var policy;
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj(
@@ -43,7 +43,7 @@ define(
);
mockObjectAPI = jasmine.createSpyObj('objectAPI', [
'getProvider'
'isPersistable'
]);
mockAPI = {
@@ -69,34 +69,31 @@ define(
});
it("Applies to edit action", function () {
mockObjectAPI.getProvider.and.returnValue({});
expect(mockObjectAPI.getProvider).not.toHaveBeenCalled();
expect(mockObjectAPI.isPersistable).not.toHaveBeenCalled();
policy.allow(mockEditAction, testContext);
expect(mockObjectAPI.getProvider).toHaveBeenCalled();
expect(mockObjectAPI.isPersistable).toHaveBeenCalled();
});
it("Applies to properties action", function () {
mockObjectAPI.getProvider.and.returnValue({});
expect(mockObjectAPI.getProvider).not.toHaveBeenCalled();
expect(mockObjectAPI.isPersistable).not.toHaveBeenCalled();
policy.allow(mockPropertiesAction, testContext);
expect(mockObjectAPI.getProvider).toHaveBeenCalled();
expect(mockObjectAPI.isPersistable).toHaveBeenCalled();
});
it("does not apply to other actions", function () {
mockObjectAPI.getProvider.and.returnValue({});
expect(mockObjectAPI.getProvider).not.toHaveBeenCalled();
expect(mockObjectAPI.isPersistable).not.toHaveBeenCalled();
policy.allow(mockOtherAction, testContext);
expect(mockObjectAPI.getProvider).not.toHaveBeenCalled();
expect(mockObjectAPI.isPersistable).not.toHaveBeenCalled();
});
it("Tests object provider for editability", function () {
mockObjectAPI.getProvider.and.returnValue({});
mockObjectAPI.isPersistable.and.returnValue(false);
expect(policy.allow(mockEditAction, testContext)).toBe(false);
expect(mockObjectAPI.getProvider).toHaveBeenCalled();
mockObjectAPI.getProvider.and.returnValue({save: function () {}});
expect(mockObjectAPI.isPersistable).toHaveBeenCalled();
mockObjectAPI.isPersistable.and.returnValue(true);
expect(policy.allow(mockEditAction, testContext)).toBe(true);
});
});

View File

@@ -26,9 +26,9 @@ define([
EditRepresenter
) {
describe('EditRepresenter', function () {
var $log,
$scope,
representer;
var $log;
var $scope;
var representer;
beforeEach(function () {
@@ -42,8 +42,8 @@ define([
});
describe('representation', function () {
var domainObject,
representation;
var domainObject;
var representation;
beforeEach(function () {
domainObject = jasmine.createSpyObj('domainObject', [

View File

@@ -25,8 +25,8 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) {
var TRANSACTION_METHODS = ['add', 'commit', 'cancel', 'size'];
describe("A NestedTransaction", function () {
var mockTransaction,
nestedTransaction;
var mockTransaction;
var nestedTransaction;
beforeEach(function () {
mockTransaction =
@@ -42,8 +42,8 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) {
});
describe("when callbacks are added", function () {
var mockCommit,
mockCancel;
var mockCommit;
var mockCancel;
beforeEach(function () {
mockCommit = jasmine.createSpy('commit');

View File

@@ -25,13 +25,13 @@ define(
["../../src/services/TransactionManager"],
function (TransactionManager) {
describe("TransactionManager", function () {
var mockTransactionService,
testId,
mockOnCommit,
mockOnCancel,
mockRemoves,
mockPromise,
manager;
var mockTransactionService;
var testId;
var mockOnCommit;
var mockOnCancel;
var mockRemoves;
var mockPromise;
var manager;
beforeEach(function () {
mockRemoves = [];

View File

@@ -26,9 +26,9 @@ define(
function (TransactionService) {
describe("The Transaction Service", function () {
var mockQ,
mockLog,
transactionService;
var mockQ;
var mockLog;
var transactionService;
function fastPromise(val) {
return {
@@ -52,8 +52,8 @@ define(
});
it("addToTransaction queues onCommit and onCancel functions", function () {
var onCommit = jasmine.createSpy('onCommit'),
onCancel = jasmine.createSpy('onCancel');
var onCommit = jasmine.createSpy('onCommit');
var onCancel = jasmine.createSpy('onCancel');
transactionService.startTransaction();
transactionService.addToTransaction(onCommit, onCancel);
@@ -61,8 +61,8 @@ define(
});
it("size function returns size of commit and cancel queues", function () {
var onCommit = jasmine.createSpy('onCommit'),
onCancel = jasmine.createSpy('onCancel');
var onCommit = jasmine.createSpy('onCommit');
var onCancel = jasmine.createSpy('onCancel');
transactionService.startTransaction();
transactionService.addToTransaction(onCommit, onCancel);

View File

@@ -26,8 +26,8 @@ define(
function (Transaction) {
describe("A Transaction", function () {
var mockLog,
transaction;
var mockLog;
var transaction;
beforeEach(function () {
mockLog = jasmine.createSpyObj(
@@ -42,9 +42,9 @@ define(
});
describe("when callbacks are added", function () {
var mockCommit,
mockCancel,
remove;
var mockCommit;
var mockCancel;
var remove;
beforeEach(function () {
mockCommit = jasmine.createSpy('commit');

View File

@@ -26,10 +26,10 @@ define([
moment
) {
var DATE_FORMAT = "HH:mm:ss",
DATE_FORMATS = [
DATE_FORMAT
];
var DATE_FORMAT = "HH:mm:ss";
var DATE_FORMATS = [
DATE_FORMAT
];
/**

View File

@@ -26,14 +26,14 @@ define([
moment
) {
var DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS",
DATE_FORMATS = [
DATE_FORMAT,
DATE_FORMAT + "Z",
"YYYY-MM-DD HH:mm:ss",
"YYYY-MM-DD HH:mm",
"YYYY-MM-DD"
];
var DATE_FORMAT = "YYYY-MM-DD HH:mm:ss.SSS";
var DATE_FORMATS = [
DATE_FORMAT,
DATE_FORMAT + "Z",
"YYYY-MM-DD HH:mm:ss",
"YYYY-MM-DD HH:mm",
"YYYY-MM-DD"
];
/**
* @typedef Scale

View File

@@ -27,9 +27,9 @@ define(
var KEYS = ['a', 'b', 'c'];
describe("The FormatProvider", function () {
var mockFormats,
mockFormatInstances,
provider;
var mockFormats;
var mockFormatInstances;
var provider;
beforeEach(function () {
mockFormatInstances = KEYS.map(function (k) {

View File

@@ -19,7 +19,13 @@
this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information.
-->
<div class="c-object-label">
<div class="c-object-label__type-icon {{type.getCssClass()}}" ng-class="{ 'l-icon-link':location.isLink() }"></div>
<div class="c-object-label"
ng-class="{ 'is-missing': model.status === 'missing' }"
>
<div class="c-object-label__type-icon {{type.getCssClass()}}"
ng-class="{ 'l-icon-link':location.isLink() }"
>
<span class="is-missing__indicator" title="This item is missing"></span>
</div>
<div class='c-object-label__name'>{{model.name}}</div>
</div>

View File

@@ -41,19 +41,19 @@ define(
* stylesheets will be found
*/
function StyleSheetLoader(stylesheets, $document, activeTheme, assetPath) {
var head = $document.find('head'),
document = $document[0];
var head = $document.find('head');
var document = $document[0];
// Procedure for adding a single stylesheet
function addStyleSheet(stylesheet) {
// Create a link element, and construct full path
var link = document.createElement('link'),
path = [
assetPath,
stylesheet.bundle.path,
stylesheet.bundle.resources,
stylesheet.stylesheetUrl
].join("/");
var link = document.createElement('link');
var path = [
assetPath,
stylesheet.bundle.path,
stylesheet.bundle.resources,
stylesheet.stylesheetUrl
].join("/");
// Initialize attributes on the link
link.setAttribute("rel", "stylesheet");

View File

@@ -48,12 +48,12 @@ define(
// Separate out the actions that have been retrieved
// into groups, and populate scope with this.
function groupActions(actions) {
var groups = {},
ungrouped = [];
var groups = {};
var ungrouped = [];
function assignToGroup(action) {
var metadata = action.getMetadata(),
group = metadata.group;
var metadata = action.getMetadata();
var group = metadata.group;
if (group) {
groups[group] = groups[group] || [];
groups[group].push(action);
@@ -73,9 +73,9 @@ define(
// Callback for when state which might influence action groupings
// changes.
function updateGroups() {
var actionCapability = $scope.action,
params = $scope.parameters || {},
category = params.category;
var actionCapability = $scope.action;
var params = $scope.parameters || {};
var category = params.category;
if (actionCapability && category) {
// Get actions by capability, and group them

View File

@@ -25,22 +25,22 @@ define(
function (moment) {
var TIME_NAMES = {
'hours': "Hour",
'minutes': "Minute",
'seconds': "Second"
},
MONTHS = moment.months(),
TIME_OPTIONS = (function makeRanges() {
var arr = [];
while (arr.length < 60) {
arr.push(arr.length);
}
return {
hours: arr.slice(0, 24),
minutes: arr,
seconds: arr
};
}());
'hours': "Hour",
'minutes': "Minute",
'seconds': "Second"
};
var MONTHS = moment.months();
var TIME_OPTIONS = (function makeRanges() {
var arr = [];
while (arr.length < 60) {
arr.push(arr.length);
}
return {
hours: arr.slice(0, 24),
minutes: arr,
seconds: arr
};
}());
/**
* Controller to support the date-time picker.
@@ -65,15 +65,15 @@ define(
* Months are zero-indexed, day-of-months are one-indexed.
*/
function DateTimePickerController($scope, now) {
var year,
month, // For picker state, not model state
interacted = false;
var year;
var month; // For picker state, not model state
var interacted = false;
function generateTable() {
var m = moment.utc({ year: year, month: month }).day(0),
table = [],
row,
col;
var m = moment.utc({ year: year, month: month }).day(0);
var table = [];
var row;
var col;
for (row = 0; row < 6; row += 1) {
table.push([]);

View File

@@ -40,9 +40,9 @@ define(
// Gets an array of the contextual parents/ancestors of the selected object
function getContextualPath() {
var currentObj = $scope.domainObject,
currentParent,
parents = [];
var currentObj = $scope.domainObject;
var currentParent;
var parents = [];
currentParent = currentObj &&
currentObj.hasCapability('context') &&

View File

@@ -35,10 +35,10 @@ define(
* @param $scope Angular scope for this controller
*/
function SelectorController(objectService, $scope) {
var treeModel = {},
listModel = {},
previousSelected,
self = this;
var treeModel = {};
var listModel = {};
var previousSelected;
var self = this;
// For watch; look at the user's selection in the tree
function getTreeSelection() {
@@ -126,8 +126,8 @@ define(
* @param {DomainObject} the domain object to select
*/
SelectorController.prototype.select = function (domainObject) {
var id = domainObject && domainObject.getId(),
list = this.getField() || [];
var id = domainObject && domainObject.getId();
var list = this.getField() || [];
// Only select if we have a valid id,
// and it isn't already selected
if (id && list.indexOf(id) === -1) {
@@ -140,8 +140,8 @@ define(
* @param {DomainObject} the domain object to select
*/
SelectorController.prototype.deselect = function (domainObject) {
var id = domainObject && domainObject.getId(),
list = this.getField() || [];
var id = domainObject && domainObject.getId();
var list = this.getField() || [];
// Only change if this was a valid id,
// for an object which was already selected
if (id && list.indexOf(id) !== -1) {

View File

@@ -101,7 +101,12 @@ define([
};
TimeRangeController.prototype.updateTicks = function () {
var i, p, ts, start, end, span;
var i;
var p;
var ts;
var start;
var end;
var span;
end = this.$scope.ngModel.outer.end;
start = this.$scope.ngModel.outer.start;
span = end - start;
@@ -197,9 +202,9 @@ define([
};
TimeRangeController.prototype.middleDrag = function (pixels) {
var delta = this.toMillis(pixels),
edge = delta < 0 ? 'start' : 'end',
opposite = delta < 0 ? 'end' : 'start';
var delta = this.toMillis(pixels);
var edge = delta < 0 ? 'start' : 'end';
var opposite = delta < 0 ? 'end' : 'start';
// Adjust the position of the edge in the direction of drag
this.$scope.ngModel.inner[edge] = clamp(

View File

@@ -59,8 +59,8 @@ define(
* @constructor
*/
function TreeNodeController($scope, $timeout) {
var self = this,
selectedObject = ($scope.ngModel || {}).selectedObject;
var self = this;
var selectedObject = ($scope.ngModel || {}).selectedObject;
// Look up the id for a domain object. A convenience
// for mapping; additionally does some undefined-checking.
@@ -86,14 +86,14 @@ define(
// Consider the currently-navigated object and update
// parameters which support display.
function checkSelection() {
var nodeObject = $scope.domainObject,
navObject = selectedObject,
nodeContext = nodeObject &&
nodeObject.getCapability('context'),
navContext = navObject &&
navObject.getCapability('context'),
nodePath,
navPath;
var nodeObject = $scope.domainObject;
var navObject = selectedObject;
var nodeContext = nodeObject &&
nodeObject.getCapability('context');
var navContext = navObject &&
navObject.getCapability('context');
var nodePath;
var navPath;
// Deselect; we will reselect below, iff we are
// exactly at the end of the path.

View File

@@ -42,13 +42,13 @@ define(
var body = $document.find('body');
function clickBody(event) {
var x = event.clientX,
y = event.clientY,
rect = element[0].getBoundingClientRect(),
xMin = rect.left,
xMax = xMin + rect.width,
yMin = rect.top,
yMax = yMin + rect.height;
var x = event.clientX;
var y = event.clientY;
var rect = element[0].getBoundingClientRect();
var xMin = rect.left;
var xMax = xMin + rect.width;
var yMin = rect.top;
var yMax = yMin + rect.height;
if (x < xMin || x > xMax || y < yMin || y > yMax) {
scope.$apply(function () {

View File

@@ -62,10 +62,10 @@ define(
// Populate initial scope based on attributes requested
// by the container definition
link: function (scope, element, attrs) {
var key = attrs.key,
container = containerMap[key],
alias = "container",
copiedAttributes = {};
var key = attrs.key;
var container = containerMap[key];
var alias = "container";
var copiedAttributes = {};
if (container) {
alias = container.alias || alias;
@@ -78,8 +78,8 @@ define(
},
template: function (element, attrs) {
var key = attrs.key,
container = containerMap[key];
var key = attrs.key;
var container = containerMap[key];
return container ? container.template : "";
}
};

View File

@@ -54,12 +54,12 @@ define(
// mouse event handlers; mousedown and mouseup cannot
// only be attached to the element being linked, as the
// mouse may leave this element during the drag.
var body = $document.find('body'),
isMobile = agentService.isMobile(),
touchEvents,
initialPosition,
$event,
delta;
var body = $document.find('body');
var isMobile = agentService.isMobile();
var touchEvents;
var initialPosition;
var $event;
var delta;
if (isMobile) {
touchEvents = {

View File

@@ -44,10 +44,10 @@ define(
*/
function MCTPopup($compile, popupService) {
function link(scope, element, attrs, ctrl, transclude) {
var div = $compile(TEMPLATE)(scope),
rect = element.parent()[0].getBoundingClientRect(),
position = [rect.left, rect.top],
popup = popupService.display(div, position);
var div = $compile(TEMPLATE)(scope);
var rect = element.parent()[0].getBoundingClientRect();
var position = [rect.left, rect.top];
var popup = popupService.display(div, position);
div.addClass('t-popup');
transclude(function (clone) {

View File

@@ -55,9 +55,9 @@ define(
// Link; start listening for changes to an element's size
function link(scope, element, attrs) {
var lastBounds,
linking = true,
active = true;
var lastBounds;
var linking = true;
var active = true;
// Determine how long to wait before the next update
function currentInterval() {

View File

@@ -44,8 +44,8 @@ define(
*/
function MCTScroll($parse, property, attribute) {
function link(scope, element, attrs) {
var expr = attrs[attribute],
parsed = $parse(expr);
var expr = attrs[attribute];
var parsed = $parse(expr);
// Set the element's scroll to match the scope's state
function updateElement(value) {

View File

@@ -25,47 +25,47 @@ define(
function () {
// Pixel width to allocate for the splitter itself
var DEFAULT_ANCHOR = 'left',
POLLING_INTERVAL = 15, // milliseconds
CHILDREN_WARNING_MESSAGE = [
"Invalid mct-split-pane contents.",
"This element should contain exactly three",
"child elements, where the middle-most element",
"is an mct-splitter."
].join(" "),
ANCHOR_WARNING_MESSAGE = [
"Unknown anchor provided to mct-split-pane,",
"defaulting to",
DEFAULT_ANCHOR + "."
].join(" "),
ANCHORS = {
left: {
edge: "left",
opposite: "right",
dimension: "width",
orientation: "vertical"
},
right: {
edge: "right",
opposite: "left",
dimension: "width",
orientation: "vertical",
reversed: true
},
top: {
edge: "top",
opposite: "bottom",
dimension: "height",
orientation: "horizontal"
},
bottom: {
edge: "bottom",
opposite: "top",
dimension: "height",
orientation: "horizontal",
reversed: true
}
};
var DEFAULT_ANCHOR = 'left';
var POLLING_INTERVAL = 15; // milliseconds
var CHILDREN_WARNING_MESSAGE = [
"Invalid mct-split-pane contents.",
"This element should contain exactly three",
"child elements, where the middle-most element",
"is an mct-splitter."
].join(" ");
var ANCHOR_WARNING_MESSAGE = [
"Unknown anchor provided to mct-split-pane;",
"defaulting to",
DEFAULT_ANCHOR + "."
].join(" ");
var ANCHORS = {
left: {
edge: "left",
opposite: "right",
dimension: "width",
orientation: "vertical"
},
right: {
edge: "right",
opposite: "left",
dimension: "width",
orientation: "vertical",
reversed: true
},
top: {
edge: "top",
opposite: "bottom",
dimension: "height",
orientation: "horizontal"
},
bottom: {
edge: "bottom",
opposite: "top",
dimension: "height",
orientation: "horizontal",
reversed: true
}
};
/**
* Implements `mct-split-pane` directive.
@@ -95,19 +95,19 @@ define(
*/
function MCTSplitPane($parse, $log, $interval, $window) {
function controller($scope, $element, $attrs) {
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR,
positionParsed = $parse($attrs.position),
anchor,
activeInterval,
position,
splitterSize,
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR;
var positionParsed = $parse($attrs.position);
var anchor;
var activeInterval;
var position;
var splitterSize;
alias = $attrs.alias !== undefined ?
"mctSplitPane-" + $attrs.alias : undefined,
var alias = $attrs.alias !== undefined ?
"mctSplitPane-" + $attrs.alias : undefined;
//convert string to number from localStorage
userWidthPreference = $window.localStorage.getItem(alias) === null ?
undefined : Number($window.localStorage.getItem(alias));
//convert string to number from localStorage
var userWidthPreference = $window.localStorage.getItem(alias) === null ?
undefined : Number($window.localStorage.getItem(alias));
// Get relevant size (height or width) of DOM element
function getSize(domElement) {
@@ -121,10 +121,10 @@ define(
// Pick out correct elements to update, flowing from
// selected anchor edge.
var first = children.eq(anchor.reversed ? 2 : 0),
splitter = children.eq(1),
last = children.eq(anchor.reversed ? 0 : 2),
firstSize;
var first = children.eq(anchor.reversed ? 2 : 0);
var splitter = children.eq(1);
var last = children.eq(anchor.reversed ? 0 : 2);
var firstSize;
splitterSize = getSize(splitter[0]);
first.css(anchor.edge, "0px");

View File

@@ -37,8 +37,8 @@ define(
*/
function MCTSplitter() {
function link(scope, element, attrs, mctSplitPane) {
var initialPosition,
newPosition;
var initialPosition;
var newPosition;
element.addClass("splitter");
@@ -50,9 +50,9 @@ define(
},
// Handle user changes to splitter position
move: function (delta) {
var anchor = mctSplitPane.anchor(),
index = anchor.orientation === "vertical" ? 0 : 1,
pixelDelta = delta[index] *
var anchor = mctSplitPane.anchor();
var index = anchor.orientation === "vertical" ? 0 : 1;
var pixelDelta = delta[index] *
(anchor.reversed ? -1 : 1);
// Update the position of this splitter

View File

@@ -75,13 +75,13 @@ define(
* @returns {platform/commonUI/general.Popup} the popup
*/
PopupService.prototype.display = function (element, position, options) {
var $document = this.$document,
$window = this.$window,
body = $document.find('body'),
winDim = [$window.innerWidth, $window.innerHeight],
styles = { position: 'absolute' },
margin,
offset;
var $document = this.$document;
var $window = this.$window;
var body = $document.find('body');
var winDim = [$window.innerWidth, $window.innerHeight];
var styles = { position: 'absolute' };
var margin;
var offset;
function adjustNegatives(value, index) {
return value < 0 ? (value + winDim[index]) : value;

View File

@@ -48,11 +48,11 @@ define(
*/
UrlService.prototype.urlForLocation = function (mode, domainObject) {
var context = domainObject &&
domainObject.getCapability('context'),
objectPath = context ? context.getPath() : [],
ids = objectPath.map(function (domainObj) {
return domainObj.getId();
});
domainObject.getCapability('context');
var objectPath = context ? context.getPath() : [];
var ids = objectPath.map(function (domainObj) {
return domainObj.getId();
});
// Parses the path together. Starts with the
// default index.html file, then the mode passed
@@ -73,15 +73,15 @@ define(
* @returns {string} URL for the domain object
*/
UrlService.prototype.urlForNewTab = function (mode, domainObject) {
var search = this.$location.search(),
arr = [];
var search = this.$location.search();
var arr = [];
for (var key in search) {
if (search.hasOwnProperty(key)) {
arr.push(key + '=' + search[key]);
}
}
var searchPath = "?" + arr.join('&'),
newTabPath =
var searchPath = "?" + arr.join('&');
var newTabPath =
"#" + this.urlForLocation(mode, domainObject) +
searchPath;
return newTabPath;

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