mirror of
https://github.com/nasa/openmct.git
synced 2025-06-25 18:50:11 +00:00
Compare commits
74 Commits
vue-table-
...
vue-toolba
Author | SHA1 | Date | |
---|---|---|---|
0b828b68a3 | |||
76c21ba73a | |||
d35800a307 | |||
ebd266cbbb | |||
de900702a6 | |||
ae8202b90e | |||
84350d1776 | |||
88a23151ec | |||
1a60a2e13a | |||
6e81b985a6 | |||
0ee881f2d2 | |||
908b843d8b | |||
16df2567ed | |||
1aea27f9b6 | |||
0d1acfd4df | |||
13c984f3c1 | |||
f8aea00792 | |||
15c52fe097 | |||
1b4aa5cbbf | |||
11acc1cfe5 | |||
d4c2a44a96 | |||
7792396c46 | |||
984cf0ca1e | |||
7483e886f1 | |||
792633c0d1 | |||
dfd33251f0 | |||
734d368c0b | |||
794098740e | |||
9c178a870d | |||
8b3a058b03 | |||
ef92da4d9d | |||
80b02672a6 | |||
fbf1c68c7a | |||
5eac6e646b | |||
82e5bf2325 | |||
40b7117987 | |||
07ca60e13a | |||
08cd6b1d99 | |||
78ae7b334c | |||
3a28caac06 | |||
c883bbe6c2 | |||
eaa971cb56 | |||
0301d88033 | |||
e2e0cf17db | |||
01a39f4fb7 | |||
1bb1330cba | |||
78c731dbf7 | |||
0d53898af9 | |||
9582fb2b06 | |||
3c075b7ff2 | |||
081edfbd70 | |||
04cc8f7aa2 | |||
a1d206bfc3 | |||
ef9c6d5fed | |||
15a75ac134 | |||
cde3994979 | |||
1a10c966e0 | |||
9288880e47 | |||
d2c5476cdd | |||
8d21d420ae | |||
cc22fd4e9d | |||
4a046b3eea | |||
b0702ceff5 | |||
5af14cd3b9 | |||
d7eb4c17ca | |||
8c9fe2d36b | |||
3246480f82 | |||
8055e050b6 | |||
b0f73fff0d | |||
755cf21d3f | |||
95457a1981 | |||
da0ed95662 | |||
c8919708bb | |||
cc5bfda730 |
36
.circleci/config.yml
Normal file
36
.circleci/config.yml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:8-browsers
|
||||||
|
environment:
|
||||||
|
CHROME_BIN: "/usr/bin/google-chrome"
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Update npm
|
||||||
|
command: 'sudo npm install -g npm@latest'
|
||||||
|
- restore_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
|
- run:
|
||||||
|
name: Installing dependencies (npm install)
|
||||||
|
command: npm install
|
||||||
|
- save_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
|
paths:
|
||||||
|
- node_modules
|
||||||
|
- run:
|
||||||
|
name: npm run test
|
||||||
|
command: npm run test
|
||||||
|
- run:
|
||||||
|
name: npm run lint
|
||||||
|
command: npm run lint
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist
|
||||||
|
prefix: dist
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
test:
|
||||||
|
jobs:
|
||||||
|
- build
|
79
.eslintrc.js
Normal file
79
.eslintrc.js
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
module.exports = {
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
"jasmine": true,
|
||||||
|
"amd": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"parser": "babel-eslint",
|
||||||
|
"parserOptions": {
|
||||||
|
"allowImportExportEverywhere": true,
|
||||||
|
"ecmaVersion": 2015,
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"impliedStrict": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-bitwise": "error",
|
||||||
|
"curly": "error",
|
||||||
|
"eqeqeq": "error",
|
||||||
|
"guard-for-in": "error",
|
||||||
|
"no-extend-native": "error",
|
||||||
|
"no-inner-declarations": "off",
|
||||||
|
"no-use-before-define": ["error", "nofunc"],
|
||||||
|
"no-caller": "error",
|
||||||
|
"no-sequences": "error",
|
||||||
|
"no-irregular-whitespace": "error",
|
||||||
|
"no-new": "error",
|
||||||
|
"no-shadow": "error",
|
||||||
|
"no-undef": "error",
|
||||||
|
"no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"vars": "all",
|
||||||
|
"args": "none"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-console": "off",
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"space-before-function-paren": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"anonymous": "always",
|
||||||
|
"asyncArrow": "always",
|
||||||
|
"named": "never",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"array-bracket-spacing": "error",
|
||||||
|
"space-in-parens": "error",
|
||||||
|
"space-before-blocks": "error",
|
||||||
|
"comma-dangle": "error",
|
||||||
|
"eol-last": "error",
|
||||||
|
"new-cap": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"capIsNew": false,
|
||||||
|
"properties": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dot-notation": "error",
|
||||||
|
"indent": ["error", 4]
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*Spec.js"],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
"vars": "all",
|
||||||
|
"args": "none",
|
||||||
|
"varsIgnorePattern": "controller",
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
5
.jscsrc
5
.jscsrc
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"preset": "crockford",
|
|
||||||
"requireMultipleVarDecl": false,
|
|
||||||
"requireVarDeclFirst": false
|
|
||||||
}
|
|
26
.jshintrc
26
.jshintrc
@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"bitwise": true,
|
|
||||||
"browser": true,
|
|
||||||
"curly": true,
|
|
||||||
"eqeqeq": true,
|
|
||||||
"forin": true,
|
|
||||||
"freeze": true,
|
|
||||||
"funcscope": false,
|
|
||||||
"futurehostile": true,
|
|
||||||
"latedef": true,
|
|
||||||
"noarg": true,
|
|
||||||
"nocomma": true,
|
|
||||||
"nonbsp": true,
|
|
||||||
"nonew": true,
|
|
||||||
"predef": [
|
|
||||||
"define",
|
|
||||||
"Promise",
|
|
||||||
"WeakMap",
|
|
||||||
"Map"
|
|
||||||
],
|
|
||||||
"shadow": "outer",
|
|
||||||
"strict": "implied",
|
|
||||||
"undef": true,
|
|
||||||
"unused": "vars",
|
|
||||||
"latedef": "nofunc"
|
|
||||||
}
|
|
88
API.md
88
API.md
@ -37,7 +37,7 @@
|
|||||||
- [Time Systems and Bounds](#time-systems-and-bounds)
|
- [Time Systems and Bounds](#time-systems-and-bounds)
|
||||||
- [Defining and Registering Time Systems](#defining-and-registering-time-systems)
|
- [Defining and Registering Time Systems](#defining-and-registering-time-systems)
|
||||||
- [Getting and Setting the Active Time System](#getting-and-setting-the-active-time-system)
|
- [Getting and Setting the Active Time System](#getting-and-setting-the-active-time-system)
|
||||||
- [Time Bounds](#time-bounds)
|
- [Time Bounds](#time-bounds)
|
||||||
- [Clocks](#clocks)
|
- [Clocks](#clocks)
|
||||||
- [Defining and registering clocks](#defining-and-registering-clocks)
|
- [Defining and registering clocks](#defining-and-registering-clocks)
|
||||||
- [Getting and setting active clock](#getting-and-setting-active-clock)
|
- [Getting and setting active clock](#getting-and-setting-active-clock)
|
||||||
@ -48,6 +48,10 @@
|
|||||||
- [The Time Conductor](#the-time-conductor)
|
- [The Time Conductor](#the-time-conductor)
|
||||||
- [Time Conductor Configuration](#time-conductor-configuration)
|
- [Time Conductor Configuration](#time-conductor-configuration)
|
||||||
- [Example conductor configuration](#example-conductor-configuration)
|
- [Example conductor configuration](#example-conductor-configuration)
|
||||||
|
- [Indicators](#indicators)
|
||||||
|
- [The URL Status Indicator](#the-url-status-indicator)
|
||||||
|
- [Creating a Simple Indicator](#creating-a-simple-indicator)
|
||||||
|
- [Custom Indicators](#custom-indicators)
|
||||||
- [Included Plugins](#included-plugins)
|
- [Included Plugins](#included-plugins)
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
@ -688,7 +692,7 @@ openmct.time.timeSystem(utcTimeSystem, bounds);
|
|||||||
Setting the active time system will trigger a [`'timeSystem'`](#time-events)
|
Setting the active time system will trigger a [`'timeSystem'`](#time-events)
|
||||||
event. If you supplied bounds, a [`'bounds'`](#time-events) event will be triggered afterwards with your newly supplied bounds.
|
event. If you supplied bounds, a [`'bounds'`](#time-events) event will be triggered afterwards with your newly supplied bounds.
|
||||||
|
|
||||||
### Time Bounds
|
#### Time Bounds
|
||||||
|
|
||||||
The TimeAPI provides a getter/setter for querying and setting time bounds. Time
|
The TimeAPI provides a getter/setter for querying and setting time bounds. Time
|
||||||
bounds are simply an object with a `start` and an end `end` attribute.
|
bounds are simply an object with a `start` and an end `end` attribute.
|
||||||
@ -977,6 +981,72 @@ openmct.install(openmct.plugins.Conductor({
|
|||||||
}));
|
}));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Indicators
|
||||||
|
|
||||||
|
Indicators are small widgets that reside at the bottom of the screen and are visible from
|
||||||
|
every screen in Open MCT. They can be used to convey system state using an icon and text.
|
||||||
|
Typically an indicator will display an icon (customizable with a CSS class) that will
|
||||||
|
reveal additional information when the mouse cursor is hovered over it.
|
||||||
|
|
||||||
|
### The URL Status Indicator
|
||||||
|
|
||||||
|
A common use case for indicators is to convey the state of some external system such as a
|
||||||
|
persistence backend or HTTP server. So long as this system is accessible via HTTP request,
|
||||||
|
Open MCT provides a general purpose indicator to show whether the server is available and
|
||||||
|
returing a 2xx status code. The URL Status Indicator is made available as a default plugin. See
|
||||||
|
[Included Plugins](#included-plugins) below for details on how to install and configure the
|
||||||
|
URL Status Indicator.
|
||||||
|
|
||||||
|
### Creating a Simple Indicator
|
||||||
|
|
||||||
|
A simple indicator with an icon and some text can be created and added with minimal code. An indicator
|
||||||
|
of this type exposes functions for customizing the text, icon, and style of the indicator.
|
||||||
|
|
||||||
|
eg.
|
||||||
|
``` javascript
|
||||||
|
var myIndicator = openmct.indicators.simpleIndicator();
|
||||||
|
myIndicator.text("Hello World!");
|
||||||
|
openmct.indicators.add(myIndicator);
|
||||||
|
```
|
||||||
|
|
||||||
|
This will create a new indicator and add it to the bottom of the screen in Open MCT.
|
||||||
|
By default, the indicator will appear as an information icon. Hovering over the icon will
|
||||||
|
reveal the text set via the call to `.text()`. The Indicator object returned by the API
|
||||||
|
call exposes a number of functions for customizing the content and appearance of the indicator:
|
||||||
|
|
||||||
|
* `.text([text])`: Gets or sets the text shown when the user hovers over the indicator.
|
||||||
|
Accepts an __optional__ `string` argument that, if provided, will be used to set the text.
|
||||||
|
Hovering over the indicator will expand it to its full size, revealing this text alongside
|
||||||
|
the icon. Returns the currently set text as a `string`.
|
||||||
|
* `.description([description])`: Gets or sets the indicator's description. Accepts an
|
||||||
|
__optional__ `string` argument that, if provided, will be used to set the text. The description
|
||||||
|
allows for more detail to be provided in a tooltip when the user hovers over the indicator.
|
||||||
|
Returns the currently set text as a `string`.
|
||||||
|
* `.iconClass([className])`: Gets or sets the CSS class used to define the icon. Accepts an __optional__
|
||||||
|
`string` parameter to be used to set the class applied to the indicator. Any of
|
||||||
|
[the built-in glyphs](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home/glyphs?view=styleguide.glyphs)
|
||||||
|
may be used here, or a custom CSS class can be provided. Returns the currently defined CSS
|
||||||
|
class as a `string`.
|
||||||
|
* `.statusClass([className])`: Gets or sets the CSS class used to determine status. Accepts an __optional __
|
||||||
|
`string` parameter to be used to set a status class applied to the indicator. May be used to apply
|
||||||
|
different colors to indicate status.
|
||||||
|
|
||||||
|
### Custom Indicators
|
||||||
|
|
||||||
|
A completely custom indicator can be added by simple providing a DOM element to place alongside other indicators.
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var domNode = document.createElement('div');
|
||||||
|
domNode.innerText = new Date().toString();
|
||||||
|
setInterval(function () {
|
||||||
|
domNode.innerText = new Date().toString();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
openmct.indicators.add({
|
||||||
|
element: domNode
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## Included Plugins
|
## Included Plugins
|
||||||
|
|
||||||
Open MCT is packaged along with a few general-purpose plugins:
|
Open MCT is packaged along with a few general-purpose plugins:
|
||||||
@ -1000,18 +1070,18 @@ openmct.install(openmct.plugins.CouchDB('http://localhost:9200'))
|
|||||||
* `openmct.plugins.Espresso` and `openmct.plugins.Snow` are two different
|
* `openmct.plugins.Espresso` and `openmct.plugins.Snow` are two different
|
||||||
themes (dark and light) available for Open MCT. Note that at least one
|
themes (dark and light) available for Open MCT. Note that at least one
|
||||||
of these themes must be installed for Open MCT to appear correctly.
|
of these themes must be installed for Open MCT to appear correctly.
|
||||||
* `openmct.plugins.URLIndicatorPlugin` adds an indicator which shows the
|
* `openmct.plugins.URLIndicator` adds an indicator which shows the
|
||||||
availability of a URL with the following options:
|
availability of a URL with the following options:
|
||||||
- `url` : URL to indicate the status of
|
- `url` : URL to indicate the status of
|
||||||
- `cssClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items)
|
- `iconClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items)
|
||||||
- `interval`: Interval between checking the connection, defaults to `10000`
|
- `interval`: Interval between checking the connection, defaults to `10000`
|
||||||
- `label` Name showing up as text in the status bar, defaults to url
|
- `label` Name showing up as text in the status bar, defaults to url
|
||||||
```javascript
|
```javascript
|
||||||
openmct.install(openmct.plugins.URLIndicatorPlugin({
|
openmct.install(openmct.plugins.URLIndicator({
|
||||||
url: 'http://google.com',
|
url: 'http://localhost:8080',
|
||||||
cssClass: 'check',
|
iconClass: 'check',
|
||||||
interval: 10000,
|
interval: 10000,
|
||||||
label: 'Google'
|
label: 'Localhost'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
28
README.md
28
README.md
@ -84,7 +84,6 @@ Documentation will be generated in `target/docs`.
|
|||||||
## Deploying Open MCT
|
## Deploying Open MCT
|
||||||
|
|
||||||
Open MCT is built using [`npm`](http://npmjs.com/)
|
Open MCT is built using [`npm`](http://npmjs.com/)
|
||||||
and [`gulp`](http://gulpjs.com/).
|
|
||||||
|
|
||||||
To build Open MCT for deployment:
|
To build Open MCT for deployment:
|
||||||
|
|
||||||
@ -94,32 +93,13 @@ This will compile and minify JavaScript sources, as well as copy over assets.
|
|||||||
The contents of the `dist` folder will contain a runnable Open MCT
|
The contents of the `dist` folder will contain a runnable Open MCT
|
||||||
instance (e.g. by starting an HTTP server in that directory), including:
|
instance (e.g. by starting an HTTP server in that directory), including:
|
||||||
|
|
||||||
* A `main.js` file containing Open MCT source code.
|
* `openmct.js` - Open MCT source code.
|
||||||
* Various assets in the `example` and `platform` directories.
|
* `openmct.css` - Basic styles to load to prevent a FOUC.
|
||||||
* An `index.html` that runs Open MCT in its default configuration.
|
* `index.html`, an example to run Open MCT in the basic configuration.
|
||||||
|
|
||||||
Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js).
|
|
||||||
|
|
||||||
## Bundles
|
|
||||||
|
|
||||||
A bundle is a group of software components (including source code, declared
|
|
||||||
as AMD modules, as well as resources such as images and HTML templates)
|
|
||||||
that is intended to be added or removed as a single unit. A plug-in for
|
|
||||||
Open MCT will be expressed as a bundle; platform components are also
|
|
||||||
expressed as bundles.
|
|
||||||
|
|
||||||
A bundle is also just a directory which contains a file `bundle.json`,
|
|
||||||
which declares its contents.
|
|
||||||
|
|
||||||
The file `bundles.json` (note the plural), at the top level of the
|
|
||||||
repository, is a JSON file containing an array of all bundles (expressed as
|
|
||||||
directory names) to include in a running instance of Open MCT. Adding or
|
|
||||||
removing paths from this list will add or remove bundles from the running
|
|
||||||
application.
|
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
Tests are written for [Jasmine 1.3](http://jasmine.github.io/1.3/introduction.html)
|
Tests are written for [Jasmine 3](http://jasmine.github.io/)
|
||||||
and run by [Karma](http://karma-runner.github.io). To run:
|
and run by [Karma](http://karma-runner.github.io). To run:
|
||||||
|
|
||||||
`npm test`
|
`npm test`
|
||||||
|
129
app.js
129
app.js
@ -7,79 +7,72 @@
|
|||||||
* node app.js [options]
|
* node app.js [options]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var BUNDLE_FILE = 'bundles.json',
|
const options = require('minimist')(process.argv.slice(2));
|
||||||
options = require('minimist')(process.argv.slice(2)),
|
const express = require('express');
|
||||||
express = require('express'),
|
const app = express();
|
||||||
app = express(),
|
const fs = require('fs');
|
||||||
fs = require('fs'),
|
const request = require('request');
|
||||||
request = require('request');
|
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
options.port = options.port || options.p || 8080;
|
options.port = options.port || options.p || 8080;
|
||||||
options.host = options.host || options.h || 'localhost'
|
options.host = options.host || options.h || 'localhost'
|
||||||
options.directory = options.directory || options.D || '.';
|
options.directory = options.directory || options.D || '.';
|
||||||
['include', 'exclude', 'i', 'x'].forEach(function (opt) {
|
|
||||||
options[opt] = options[opt] || [];
|
|
||||||
// Make sure includes/excludes always end up as arrays
|
|
||||||
options[opt] = Array.isArray(options[opt]) ?
|
|
||||||
options[opt] : [options[opt]];
|
|
||||||
});
|
|
||||||
options.include = options.include.concat(options.i);
|
|
||||||
options.exclude = options.exclude.concat(options.x);
|
|
||||||
|
|
||||||
// Show command line options
|
// Show command line options
|
||||||
if (options.help || options.h) {
|
if (options.help || options.h) {
|
||||||
console.log("\nUsage: node app.js [options]\n");
|
console.log("\nUsage: node app.js [options]\n");
|
||||||
console.log("Options:");
|
console.log("Options:");
|
||||||
console.log(" --help, -h Show this message.");
|
console.log(" --help, -h Show this message.");
|
||||||
console.log(" --port, -p <number> Specify port.");
|
console.log(" --port, -p <number> Specify port.");
|
||||||
console.log(" --include, -i <bundle> Include the specified bundle.");
|
console.log(" --directory, -D <bundle> Serve files from specified directory.");
|
||||||
console.log(" --exclude, -x <bundle> Exclude the specified bundle.");
|
console.log("");
|
||||||
console.log(" --directory, -D <bundle> Serve files from specified directory.");
|
process.exit(0);
|
||||||
console.log("");
|
}
|
||||||
process.exit(0);
|
|
||||||
|
app.disable('x-powered-by');
|
||||||
|
|
||||||
|
app.use('/proxyUrl', function proxyRequest(req, res, next) {
|
||||||
|
console.log('Proxying request to: ', req.query.url);
|
||||||
|
req.pipe(request({
|
||||||
|
url: req.query.url,
|
||||||
|
strictSSL: false
|
||||||
|
}).on('error', next)).pipe(res);
|
||||||
|
});
|
||||||
|
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const webpackConfig = require('./webpack.config.js');
|
||||||
|
webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||||
|
webpackConfig.plugins.push(function() { this.plugin('watch-run', function(watching, callback) { console.log('Begin compile at ' + new Date()); callback(); }) });
|
||||||
|
|
||||||
|
webpackConfig.entry.openmct = [
|
||||||
|
'webpack-hot-middleware/client?reload=true',
|
||||||
|
webpackConfig.entry.openmct
|
||||||
|
];
|
||||||
|
|
||||||
|
const compiler = webpack(webpackConfig);
|
||||||
|
|
||||||
|
app.use(require('webpack-dev-middleware')(
|
||||||
|
compiler,
|
||||||
|
{
|
||||||
|
publicPath: '/dist',
|
||||||
|
logLevel: 'warn'
|
||||||
}
|
}
|
||||||
|
));
|
||||||
|
|
||||||
app.disable('x-powered-by');
|
app.use(require('webpack-hot-middleware')(
|
||||||
|
compiler,
|
||||||
|
{
|
||||||
|
|
||||||
// Override bundles.json for HTTP requests
|
}
|
||||||
app.use('/' + BUNDLE_FILE, function (req, res) {
|
));
|
||||||
var bundles;
|
|
||||||
|
|
||||||
try {
|
// Expose index.html for development users.
|
||||||
bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8'));
|
app.get('/', function (req, res) {
|
||||||
} catch (e) {
|
fs.createReadStream('index.html').pipe(res);
|
||||||
bundles = [];
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// Handle command line inclusions/exclusions
|
// Finally, open the HTTP server and log the instance to the console
|
||||||
bundles = bundles.concat(options.include);
|
app.listen(options.port, options.host, function() {
|
||||||
bundles = bundles.filter(function (bundle) {
|
console.log('Open MCT application running at %s:%s', options.host, options.port)
|
||||||
return options.exclude.indexOf(bundle) === -1;
|
});
|
||||||
});
|
|
||||||
bundles = bundles.filter(function (bundle, index) { // Uniquify
|
|
||||||
return bundles.indexOf(bundle) === index;
|
|
||||||
});
|
|
||||||
|
|
||||||
res.send(JSON.stringify(bundles));
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use('/proxyUrl', function proxyRequest(req, res, next) {
|
|
||||||
console.log('Proxying request to: ', req.query.url);
|
|
||||||
req.pipe(request({
|
|
||||||
url: req.query.url,
|
|
||||||
strictSSL: false
|
|
||||||
}).on('error', next)).pipe(res);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Expose everything else as static files
|
|
||||||
app.use(express['static'](options.directory));
|
|
||||||
|
|
||||||
// Finally, open the HTTP server and log the instance to the console
|
|
||||||
app.listen(options.port, options.host, function() {
|
|
||||||
console.log('Open MCT application running at %s:%s', options.host, options.port)
|
|
||||||
});
|
|
||||||
}());
|
|
||||||
|
27
bower.json
27
bower.json
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "openmct",
|
|
||||||
"description": "The Open MCT core platform",
|
|
||||||
"main": "",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"moduleType": [],
|
|
||||||
"homepage": "http://nasa.github.io/openmct/",
|
|
||||||
"private": true,
|
|
||||||
"dependencies": {
|
|
||||||
"angular": "1.4.4",
|
|
||||||
"angular-route": "1.4.4",
|
|
||||||
"moment": "^2.11.1",
|
|
||||||
"moment-duration-format": "^1.3.0",
|
|
||||||
"requirejs": "~2.1.22",
|
|
||||||
"text": "requirejs-text#^2.0.14",
|
|
||||||
"es6-promise": "^3.3.0",
|
|
||||||
"screenfull": "^3.0.0",
|
|
||||||
"node-uuid": "^1.4.7",
|
|
||||||
"comma-separated-values": "^3.6.4",
|
|
||||||
"file-saver": "1.3.3",
|
|
||||||
"zepto": "^1.1.6",
|
|
||||||
"eventemitter3": "^1.2.0",
|
|
||||||
"lodash": "3.10.1",
|
|
||||||
"almond": "~0.3.2",
|
|
||||||
"moment-timezone": "^0.5.13"
|
|
||||||
}
|
|
||||||
}
|
|
27
circle.yml
27
circle.yml
@ -1,27 +0,0 @@
|
|||||||
machine:
|
|
||||||
node:
|
|
||||||
version: 8.11.0
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
pre:
|
|
||||||
- npm install -g npm@latest
|
|
||||||
|
|
||||||
deployment:
|
|
||||||
production:
|
|
||||||
branch: master
|
|
||||||
commands:
|
|
||||||
- npm install canvas nomnoml
|
|
||||||
- ./build-docs.sh
|
|
||||||
openmctweb-staging-deux:
|
|
||||||
branch: mobile
|
|
||||||
heroku:
|
|
||||||
appname: openmctweb-staging-deux
|
|
||||||
test:
|
|
||||||
post:
|
|
||||||
- gulp lint
|
|
||||||
- gulp checkstyle
|
|
||||||
|
|
||||||
general:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- gh-pages
|
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2017, United States Government
|
Open MCT, Copyright (c) 2014-2018, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
@ -18,7 +18,4 @@
|
|||||||
licenses. See the Open Source Licenses file (LICENSES.md) included with
|
licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
this source code distribution or the Licensing information page available
|
this source code distribution or the Licensing information page available
|
||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
<p>Hello, world! I am the default route.</p>
|
|
||||||
<p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p>
|
|
||||||
<span example-directive></span>
|
|
@ -18,18 +18,4 @@
|
|||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(
|
|
||||||
["../src/TelemetryDelegator"],
|
|
||||||
function (TelemetryDelegator) {
|
|
||||||
|
|
||||||
describe("The telemetry delegator", function () {
|
|
||||||
var delegator;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
delegator = new TelemetryDelegator();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,8 +0,0 @@
|
|||||||
This bundle is intended to serve as an example of registering
|
|
||||||
extensions which are mapped directly to built-in Angular features.
|
|
||||||
|
|
||||||
These are:
|
|
||||||
* Controllers
|
|
||||||
* Directives
|
|
||||||
* Routes
|
|
||||||
* Services
|
|
@ -1,74 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
"./src/ExampleController",
|
|
||||||
"./src/ExampleDirective",
|
|
||||||
"./src/ExampleService",
|
|
||||||
'legacyRegistry'
|
|
||||||
], function (
|
|
||||||
ExampleController,
|
|
||||||
ExampleDirective,
|
|
||||||
ExampleService,
|
|
||||||
legacyRegistry
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
legacyRegistry.register("example/builtins", {
|
|
||||||
"name": "Angular Built-ins Example",
|
|
||||||
"description": "Example showing how to declare extensions with built-in support from Angular.",
|
|
||||||
"sources": "src",
|
|
||||||
"extensions": {
|
|
||||||
"controllers": [
|
|
||||||
{
|
|
||||||
"key": "ExampleController",
|
|
||||||
"implementation": ExampleController,
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"exampleService"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"directives": [
|
|
||||||
{
|
|
||||||
"key": "exampleDirective",
|
|
||||||
"implementation": ExampleDirective,
|
|
||||||
"depends": [
|
|
||||||
"examples[]"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"routes": [
|
|
||||||
{
|
|
||||||
"templateUrl": "templates/example.html"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": [
|
|
||||||
{
|
|
||||||
"key": "exampleService",
|
|
||||||
"implementation": ExampleService
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,42 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining ExampleController. Created by vwoeltje on 11/4/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function ExampleController($scope, exampleService) {
|
|
||||||
$scope.phrase = exampleService.getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ExampleController;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,66 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining ExampleDirective. Created by vwoeltje on 11/4/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var HAS_EXTENSIONS = "A directive loaded these message from " +
|
|
||||||
"example extensions.",
|
|
||||||
NO_EXTENSIONS = "A directive tried to load example extensions," +
|
|
||||||
" but found none.",
|
|
||||||
MESSAGE = "I heard this from my partial constructor.";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function ExampleDirective(examples) {
|
|
||||||
// Build up a template from example extensions
|
|
||||||
var template = examples.length > 0 ?
|
|
||||||
HAS_EXTENSIONS : NO_EXTENSIONS;
|
|
||||||
|
|
||||||
template += "<ul>";
|
|
||||||
examples.forEach(function (E) {
|
|
||||||
template += "<li>";
|
|
||||||
if (typeof E === 'function') {
|
|
||||||
template += (new E(MESSAGE)).getText();
|
|
||||||
} else {
|
|
||||||
template += E.text;
|
|
||||||
}
|
|
||||||
template += "</li>";
|
|
||||||
});
|
|
||||||
template += "</ul>";
|
|
||||||
|
|
||||||
return {
|
|
||||||
template: template
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return ExampleDirective;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,82 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
"./src/SomeProvider",
|
|
||||||
"./src/SomeOtherProvider",
|
|
||||||
"./src/SomeDecorator",
|
|
||||||
"./src/SomeOtherDecorator",
|
|
||||||
"./src/SomeAggregator",
|
|
||||||
"./src/SomeOtherExample",
|
|
||||||
'legacyRegistry'
|
|
||||||
], function (
|
|
||||||
SomeProvider,
|
|
||||||
SomeOtherProvider,
|
|
||||||
SomeDecorator,
|
|
||||||
SomeOtherDecorator,
|
|
||||||
SomeAggregator,
|
|
||||||
SomeOtherExample,
|
|
||||||
legacyRegistry
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
legacyRegistry.register("example/composite", {
|
|
||||||
"extensions": {
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"implementation": SomeProvider,
|
|
||||||
"provides": "someService",
|
|
||||||
"type": "provider"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"implementation": SomeOtherProvider,
|
|
||||||
"provides": "someService",
|
|
||||||
"type": "provider"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"implementation": SomeDecorator,
|
|
||||||
"provides": "someService",
|
|
||||||
"type": "decorator"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"implementation": SomeOtherDecorator,
|
|
||||||
"provides": "someService",
|
|
||||||
"type": "decorator"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"implementation": SomeAggregator,
|
|
||||||
"provides": "someService",
|
|
||||||
"type": "aggregator"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"examples": [
|
|
||||||
{
|
|
||||||
"implementation": SomeOtherExample,
|
|
||||||
"depends": [
|
|
||||||
"someService"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,50 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeAggregator. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeAggregator(someProviders) {
|
|
||||||
return {
|
|
||||||
getMessages: function () {
|
|
||||||
return someProviders.map(function (provider) {
|
|
||||||
return provider.getMessages();
|
|
||||||
}).reduce(function (a, b) {
|
|
||||||
return a.concat(b);
|
|
||||||
}, []);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeAggregator;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,48 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeDecorator. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeDecorator(someProvider) {
|
|
||||||
return {
|
|
||||||
getMessages: function () {
|
|
||||||
return someProvider.getMessages().map(function (msg) {
|
|
||||||
return msg.toLocaleUpperCase();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeDecorator;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,48 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeOtherDecorator. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeOtherDecorator(someProvider) {
|
|
||||||
return {
|
|
||||||
getMessages: function () {
|
|
||||||
return someProvider.getMessages().map(function (msg) {
|
|
||||||
return msg + "...";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeOtherDecorator;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,46 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeOtherExample. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeOtherExample(someService) {
|
|
||||||
return {
|
|
||||||
getText: function () {
|
|
||||||
return someService.getMessages().join(" | ");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeOtherExample;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,48 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeOtherProvider. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeOtherProvider() {
|
|
||||||
return {
|
|
||||||
getMessages: function () {
|
|
||||||
return [
|
|
||||||
"I am a message from some other provider."
|
|
||||||
];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeOtherProvider;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,48 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeProvider. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeProvider() {
|
|
||||||
return {
|
|
||||||
getMessages: function () {
|
|
||||||
return [
|
|
||||||
"I am a message from some provider."
|
|
||||||
];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeProvider;
|
|
||||||
}
|
|
||||||
);
|
|
@ -60,8 +60,8 @@ define([
|
|||||||
"source": "eventGenerator",
|
"source": "eventGenerator",
|
||||||
"domains": [
|
"domains": [
|
||||||
{
|
{
|
||||||
"key": "time",
|
"key": "utc",
|
||||||
"name": "Time",
|
"name": "Timestamp",
|
||||||
"format": "utc"
|
"format": "utc"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -22,24 +22,23 @@
|
|||||||
/*global define */
|
/*global define */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module defining EventTelemetry.
|
* Module defining EventTelemetry.
|
||||||
* Created by chacskaylo on 06/18/2015.
|
* Created by chacskaylo on 06/18/2015.
|
||||||
* Modified by shale on 06/23/2015.
|
* Modified by shale on 06/23/2015.
|
||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
['text!../data/transcript.json'],
|
['../data/transcript.json'],
|
||||||
function (transcript) {
|
function (messages) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var firstObservedTime = Date.now(),
|
var firstObservedTime = Date.now();
|
||||||
messages = JSON.parse(transcript);
|
|
||||||
|
|
||||||
function EventTelemetry(request, interval) {
|
function EventTelemetry(request, interval) {
|
||||||
|
|
||||||
var latestObservedTime = Date.now(),
|
var latestObservedTime = Date.now(),
|
||||||
count = Math.floor((latestObservedTime - firstObservedTime) / interval),
|
count = Math.floor((latestObservedTime - firstObservedTime) / interval),
|
||||||
generatorData = {};
|
generatorData = {};
|
||||||
|
|
||||||
generatorData.getPointCount = function () {
|
generatorData.getPointCount = function () {
|
||||||
return count;
|
return count;
|
||||||
};
|
};
|
||||||
@ -48,13 +47,13 @@ define(
|
|||||||
return i * interval +
|
return i * interval +
|
||||||
(domain !== 'delta' ? firstObservedTime : 0);
|
(domain !== 'delta' ? firstObservedTime : 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
generatorData.getRangeValue = function (i, range) {
|
generatorData.getRangeValue = function (i, range) {
|
||||||
var domainDelta = this.getDomainValue(i) - firstObservedTime,
|
var domainDelta = this.getDomainValue(i) - firstObservedTime,
|
||||||
ind = i % messages.length;
|
ind = i % messages.length;
|
||||||
return messages[ind] + " - [" + domainDelta.toString() + "]";
|
return messages[ind] + " - [" + domainDelta.toString() + "]";
|
||||||
};
|
};
|
||||||
|
|
||||||
return generatorData;
|
return generatorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
"./src/SomeExample",
|
|
||||||
'legacyRegistry'
|
|
||||||
], function (
|
|
||||||
SomeExample,
|
|
||||||
legacyRegistry
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
legacyRegistry.register("example/extensions", {
|
|
||||||
"name": "Custom Extensions Examples",
|
|
||||||
"description": "Example showing how to declare custom extensions.",
|
|
||||||
"sources": "src",
|
|
||||||
"extensions": {
|
|
||||||
"examples": [
|
|
||||||
{
|
|
||||||
"text": "I came from example/extensions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"implementation": SomeExample,
|
|
||||||
"depends": [
|
|
||||||
"exampleService"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,52 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining SomeExample. Created by vwoeltje on 11/5/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function SomeExample(exampleService, message) {
|
|
||||||
return {
|
|
||||||
getText: function () {
|
|
||||||
return [
|
|
||||||
'"',
|
|
||||||
exampleService.getMessage(),
|
|
||||||
'" and "',
|
|
||||||
message,
|
|
||||||
'"'
|
|
||||||
].join("");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return SomeExample;
|
|
||||||
}
|
|
||||||
);
|
|
@ -27,8 +27,14 @@ define([
|
|||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
var RED = 0.9,
|
var RED = {
|
||||||
YELLOW = 0.5,
|
sin: 0.9,
|
||||||
|
cos: 0.9
|
||||||
|
},
|
||||||
|
YELLOW = {
|
||||||
|
sin: 0.5,
|
||||||
|
cos: 0.5
|
||||||
|
},
|
||||||
LIMITS = {
|
LIMITS = {
|
||||||
rh: {
|
rh: {
|
||||||
cssClass: "s-limit-upr s-limit-red",
|
cssClass: "s-limit-upr s-limit-red",
|
||||||
@ -67,17 +73,18 @@ define([
|
|||||||
SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) {
|
SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) {
|
||||||
return {
|
return {
|
||||||
evaluate: function (datum, valueMetadata) {
|
evaluate: function (datum, valueMetadata) {
|
||||||
var range = valueMetadata ? valueMetadata.key : 'sin'
|
var range = valueMetadata && valueMetadata.key;
|
||||||
if (datum[range] > RED) {
|
|
||||||
|
if (datum[range] > RED[range]) {
|
||||||
return LIMITS.rh;
|
return LIMITS.rh;
|
||||||
}
|
}
|
||||||
if (datum[range] < -RED) {
|
if (datum[range] < -RED[range]) {
|
||||||
return LIMITS.rl;
|
return LIMITS.rl;
|
||||||
}
|
}
|
||||||
if (datum[range] > YELLOW) {
|
if (datum[range] > YELLOW[range]) {
|
||||||
return LIMITS.yh;
|
return LIMITS.yh;
|
||||||
}
|
}
|
||||||
if (datum[range] < -YELLOW) {
|
if (datum[range] < -YELLOW[range]) {
|
||||||
return LIMITS.yl;
|
return LIMITS.yl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ define([
|
|||||||
var data = [];
|
var data = [];
|
||||||
while (start <= end && data.length < 5000) {
|
while (start <= end && data.length < 5000) {
|
||||||
data.push(pointForTimestamp(start, duration, domainObject.name));
|
data.push(pointForTimestamp(start, duration, domainObject.name));
|
||||||
start += 5000;
|
start += duration;
|
||||||
}
|
}
|
||||||
return Promise.resolve(data);
|
return Promise.resolve(data);
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'text!./generatorWorker.js',
|
'raw-loader!./generatorWorker.js',
|
||||||
'uuid'
|
'uuid'
|
||||||
], function (
|
], function (
|
||||||
workerText,
|
workerText,
|
||||||
|
@ -38,7 +38,8 @@ define([
|
|||||||
"provides": "identityService",
|
"provides": "identityService",
|
||||||
"type": "provider",
|
"type": "provider",
|
||||||
"depends": [
|
"depends": [
|
||||||
"dialogService"
|
"dialogService",
|
||||||
|
"$q"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -55,21 +55,37 @@ define(
|
|||||||
* @implements {IdentityService}
|
* @implements {IdentityService}
|
||||||
* @memberof platform/identity
|
* @memberof platform/identity
|
||||||
*/
|
*/
|
||||||
function ExampleIdentityProvider(dialogService) {
|
function ExampleIdentityProvider(dialogService, $q) {
|
||||||
// Handle rejected dialog messages by treating the
|
this.dialogService = dialogService;
|
||||||
// current user as undefined.
|
this.$q = $q;
|
||||||
function echo(v) { return v; }
|
|
||||||
function giveUndefined() { return undefined; }
|
|
||||||
|
|
||||||
this.userPromise =
|
this.returnUser = this.returnUser.bind(this);
|
||||||
dialogService.getUserInput(DIALOG_STRUCTURE, DEFAULT_IDENTITY)
|
this.returnUndefined = this.returnUndefined.bind(this);
|
||||||
.then(echo, giveUndefined);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExampleIdentityProvider.prototype.getUser = function () {
|
ExampleIdentityProvider.prototype.getUser = function () {
|
||||||
return this.userPromise;
|
if (this.user) {
|
||||||
|
return this.$q.when(this.user);
|
||||||
|
} else {
|
||||||
|
return this.dialogService.getUserInput(DIALOG_STRUCTURE, DEFAULT_IDENTITY)
|
||||||
|
.then(this.returnUser, this.returnUndefined);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
ExampleIdentityProvider.prototype.returnUser = function (user) {
|
||||||
|
return this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
ExampleIdentityProvider.prototype.returnUndefined = function () {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return ExampleIdentityProvider;
|
return ExampleIdentityProvider;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<span class="status block" ng-controller="DialogLaunchController">
|
<span class="h-indicator" ng-controller="DialogLaunchController">
|
||||||
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
||||||
<span class="status-indicator icon-box-with-arrow"></span><span class="label">
|
<div class="ls-indicator icon-box-with-arrow s-status-available"><span class="label">
|
||||||
<a ng-click="launchProgress(true)">Known</a> |
|
<a ng-click="launchProgress(true)">Known</a>
|
||||||
<a ng-click="launchProgress(false)">Unknown</a> |
|
<a ng-click="launchProgress(false)">Unknown</a>
|
||||||
<a ng-click="launchError()">Error</a> |
|
<a ng-click="launchError()">Error</a>
|
||||||
<a ng-click="launchInfo()">Info</a>
|
<a ng-click="launchInfo()">Info</a>
|
||||||
</span><span class="count"></span>
|
</span></div>
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<span class="status block" ng-controller="NotificationLaunchController">
|
<span class="h-indicator" ng-controller="NotificationLaunchController">
|
||||||
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
||||||
<span class="status-indicator icon-bell"></span><span class="label">
|
<div class="ls-indicator icon-bell s-status-available"><span class="label">
|
||||||
<a ng-click="newInfo()">Success</a> |
|
<a ng-click="newInfo()">Success</a>
|
||||||
<a ng-click="newError()">Error</a> |
|
<a ng-click="newError()">Error</a>
|
||||||
<a ng-click="newAlert()">Alert</a> |
|
<a ng-click="newAlert()">Alert</a>
|
||||||
<a ng-click="newProgress()">Progress</a>
|
<a ng-click="newProgress()">Progress</a>
|
||||||
</span><span class="count"></span>
|
</span></div>
|
||||||
</span>
|
</span>
|
||||||
|
19
example/simpleVuePlugin/HelloWorld.vue
Normal file
19
example/simpleVuePlugin/HelloWorld.vue
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<template>
|
||||||
|
<div class="example">{{ msg }}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
msg: 'Hello world!'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.example {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
37
example/simpleVuePlugin/plugin.js
Normal file
37
example/simpleVuePlugin/plugin.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import Vue from 'Vue';
|
||||||
|
import HelloWorld from './HelloWorld.vue';
|
||||||
|
|
||||||
|
function SimpleVuePlugin () {
|
||||||
|
return function install(openmct) {
|
||||||
|
var views = (openmct.mainViews || openmct.objectViews);
|
||||||
|
|
||||||
|
openmct.types.addType('hello-world', {
|
||||||
|
name: 'Hello World',
|
||||||
|
description: 'An introduction object',
|
||||||
|
creatable: true
|
||||||
|
});
|
||||||
|
openmct.objectViews.addProvider({
|
||||||
|
name: "demo-provider",
|
||||||
|
key: "hello-world",
|
||||||
|
cssClass: "icon-packet",
|
||||||
|
canView: function (d) {
|
||||||
|
return d.type === 'hello-world';
|
||||||
|
},
|
||||||
|
view: function (domainObject) {
|
||||||
|
var vm;
|
||||||
|
return {
|
||||||
|
show: function (container) {
|
||||||
|
vm = new Vue(HelloWorld);
|
||||||
|
container.appendChild(vm.$mount().$el);
|
||||||
|
},
|
||||||
|
destroy: function (container) {
|
||||||
|
vm.$destroy();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SimpleVuePlugin
|
@ -1,10 +1,26 @@
|
|||||||
define([
|
define([
|
||||||
"./src/ExampleStyleGuideModelProvider",
|
"./src/ExampleStyleGuideModelProvider",
|
||||||
"./src/MCTExample",
|
"./src/MCTExample",
|
||||||
|
"./res/templates/intro.html",
|
||||||
|
"./res/templates/standards.html",
|
||||||
|
"./res/templates/colors.html",
|
||||||
|
"./res/templates/status.html",
|
||||||
|
"./res/templates/glyphs.html",
|
||||||
|
"./res/templates/controls.html",
|
||||||
|
"./res/templates/input.html",
|
||||||
|
"./res/templates/menus.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
ExampleStyleGuideModelProvider,
|
ExampleStyleGuideModelProvider,
|
||||||
MCTExample,
|
MCTExample,
|
||||||
|
introTemplate,
|
||||||
|
standardsTemplate,
|
||||||
|
colorsTemplate,
|
||||||
|
statusTemplate,
|
||||||
|
glyphsTemplate,
|
||||||
|
controlsTemplate,
|
||||||
|
inputTemplate,
|
||||||
|
menusTemplate,
|
||||||
legacyRegistry
|
legacyRegistry
|
||||||
) {
|
) {
|
||||||
legacyRegistry.register("example/styleguide", {
|
legacyRegistry.register("example/styleguide", {
|
||||||
@ -23,14 +39,14 @@ define([
|
|||||||
{ "key": "styleguide.menus", "name": "Menus", "cssClass": "icon-page", "description": "Context menus, dropdowns" }
|
{ "key": "styleguide.menus", "name": "Menus", "cssClass": "icon-page", "description": "Context menus, dropdowns" }
|
||||||
],
|
],
|
||||||
"views": [
|
"views": [
|
||||||
{ "key": "styleguide.intro", "type": "styleguide.intro", "templateUrl": "templates/intro.html", "editable": false },
|
{ "key": "styleguide.intro", "type": "styleguide.intro", "template": introTemplate, "editable": false },
|
||||||
{ "key": "styleguide.standards", "type": "styleguide.standards", "templateUrl": "templates/standards.html", "editable": false },
|
{ "key": "styleguide.standards", "type": "styleguide.standards", "template": standardsTemplate, "editable": false },
|
||||||
{ "key": "styleguide.colors", "type": "styleguide.colors", "templateUrl": "templates/colors.html", "editable": false },
|
{ "key": "styleguide.colors", "type": "styleguide.colors", "template": colorsTemplate, "editable": false },
|
||||||
{ "key": "styleguide.status", "type": "styleguide.status", "templateUrl": "templates/status.html", "editable": false },
|
{ "key": "styleguide.status", "type": "styleguide.status", "template": statusTemplate, "editable": false },
|
||||||
{ "key": "styleguide.glyphs", "type": "styleguide.glyphs", "templateUrl": "templates/glyphs.html", "editable": false },
|
{ "key": "styleguide.glyphs", "type": "styleguide.glyphs", "template": glyphsTemplate, "editable": false },
|
||||||
{ "key": "styleguide.controls", "type": "styleguide.controls", "templateUrl": "templates/controls.html", "editable": false },
|
{ "key": "styleguide.controls", "type": "styleguide.controls", "template": controlsTemplate, "editable": false },
|
||||||
{ "key": "styleguide.input", "type": "styleguide.input", "templateUrl": "templates/input.html", "editable": false },
|
{ "key": "styleguide.input", "type": "styleguide.input", "template": inputTemplate, "editable": false },
|
||||||
{ "key": "styleguide.menus", "type": "styleguide.menus", "templateUrl": "templates/menus.html", "editable": false }
|
{ "key": "styleguide.menus", "type": "styleguide.menus", "template": menusTemplate, "editable": false }
|
||||||
],
|
],
|
||||||
"roots": [
|
"roots": [
|
||||||
{
|
{
|
||||||
@ -85,16 +101,6 @@ define([
|
|||||||
"$q"
|
"$q"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"stylesheets": [
|
|
||||||
{
|
|
||||||
"stylesheetUrl": "css/style-guide-espresso.css",
|
|
||||||
"theme": "espresso"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"stylesheetUrl": "css/style-guide-snow.css",
|
|
||||||
"theme": "snow"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<p>As you develop plugins for Open MCT, consider how a generalized component might be combined with others when designing to create a rich and powerful larger object, rather than adding a single monolithic, non-modular plugin. To solve a particular problem or allow a new feature in Open MCT, you may need to introduce more than just one new object type.</p>
|
<p>As you develop plugins for Open MCT, consider how a generalized component might be combined with others when designing to create a rich and powerful larger object, rather than adding a single monolithic, non-modular plugin. To solve a particular problem or allow a new feature in Open MCT, you may need to introduce more than just one new object type.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<img src="/example/styleguide/res/images/diagram-objects.svg" />
|
<img src="../images/diagram-objects.svg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<p>The types of objects that a container can hold should be based on the purpose of the container and the views that it affords. For example, a Folder’s purpose is to allow a user to conceptually organize objects of all other types; a Folder must therefore be able to contain an object of any type.</p>
|
<p>The types of objects that a container can hold should be based on the purpose of the container and the views that it affords. For example, a Folder’s purpose is to allow a user to conceptually organize objects of all other types; a Folder must therefore be able to contain an object of any type.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<img src="/example/styleguide/res/images/diagram-containment.svg" />
|
<img src="../images/diagram-containment.svg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<p>Views are simply different ways to view the content of a given object. For example, telemetry data could be viewed as a plot or a table. A clock can display its time in analog fashion or with digital numbers. In each view, all of the content is present; it’s just represented differently. When providing views for an object, all the content of the object should be present in each view.</p>
|
<p>Views are simply different ways to view the content of a given object. For example, telemetry data could be viewed as a plot or a table. A clock can display its time in analog fashion or with digital numbers. In each view, all of the content is present; it’s just represented differently. When providing views for an object, all the content of the object should be present in each view.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<img src="/example/styleguide/res/images/diagram-views.svg" />
|
<img src="../images/diagram-views.svg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -70,4 +70,4 @@
|
|||||||
<p></p>
|
<p></p>
|
||||||
<p></p>
|
<p></p>
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,12 +20,12 @@
|
|||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
<style>
|
<style>
|
||||||
.w-mct-example div[class*="s-limit"],
|
|
||||||
.w-mct-example div[class*="s-status"],
|
.w-mct-example div[class*="s-status"],
|
||||||
.w-mct-example div[class*="s-unsynced"],
|
.w-mct-example span[class*="s-status"],
|
||||||
|
.w-mct-example div[class*="s-limit"],
|
||||||
.w-mct-example span[class*="s-limit"] {
|
.w-mct-example span[class*="s-limit"] {
|
||||||
border-radius: 4px;
|
border-radius: 3px;
|
||||||
padding: 3px 7px;
|
padding: 2px 5px;
|
||||||
}
|
}
|
||||||
.w-mct-example table {
|
.w-mct-example table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -36,65 +36,12 @@
|
|||||||
<h1>Status Indication</h1>
|
<h1>Status Indication</h1>
|
||||||
|
|
||||||
<div class="l-section">
|
<div class="l-section">
|
||||||
<h2>Overview</h2>
|
<h2>Status Classes</h2>
|
||||||
<p>Many elements in Open MCT need to articulate a dynamic status; Open MCT provides the following styles and conventions to handle this:</p>
|
|
||||||
<ul>
|
|
||||||
<li><strong>Limits</strong>: when telemetry values exceed minimum or maximum values, they can be violating limits. Limit styles include both color and iconography; color is used to indicate severity while icons are used to indicate direction, upper or lower.</li>
|
|
||||||
<li><strong>Status</strong>: Open MCT also provides a number or built-in Status styles allowing telemetry or other displayed information to be visually classified by type. Common uses for these classes are to visually denote event records.</li>
|
|
||||||
<li><strong>Synchronization</strong>: When the system is displaying real-time data, it is very important that displays clearly indicate when they are not doing so, such as when a plot if frozen while panning or zooming. Open MCT provides a style for this.</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="l-section">
|
|
||||||
<h2>Limits</h2>
|
|
||||||
<div class="cols cols1-1">
|
<div class="cols cols1-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p>Limit CSS classes can be applied to any block or inline element. Open MCT limit classes set color and optionally an icon, but don't effect other properties. Yellow and red limit classes can be used as is, or allow the application of any custom icon available in Open MCT's glyphs library. "Level" limit classes - upper and lower - always use an icon in addition to a color; Open MCT doesn't support level limits without color.</p>
|
<p>Status classes allow any block or inline-block element to be decorated in order to articulate a
|
||||||
<ul>
|
status. Provided classes include color-only and color plus icon; custom icons can easily be
|
||||||
<li>Color only</li>
|
employed by using a color-only status class in combination with an <a class="link" href="#/browse/styleguide:home/glyphs?tc.mode=local&tc.timeSystem=utc&tc.startDelta=1800000&tc.endDelta=0&view=styleguide.glyphs">glyph</a>.</p>
|
||||||
<ul>
|
|
||||||
<li><code>s-limit-yellow</code>: A yellow limit.</li>
|
|
||||||
<li><code>s-limit-red</code>: A red limit.</li>
|
|
||||||
</ul>
|
|
||||||
<li>Color and icon</li>
|
|
||||||
<ul>
|
|
||||||
<li><code>s-limit-yellow-icon</code>: A yellow limit with icon.</li>
|
|
||||||
<li><code>s-limit-red-icon</code>: A red limit with icon.</li>
|
|
||||||
</ul>
|
|
||||||
<li>Upper and lower limit indicators. Must be used with a color limit class to be visible.</li>
|
|
||||||
<ul>
|
|
||||||
<li><code>s-limit-upr</code>: Upper limit.
|
|
||||||
</li>
|
|
||||||
<li><code>s-limit-lwr</code>: Lower limit.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<mct-example><div class="s-limit-yellow">Yellow limit</div>
|
|
||||||
<div class="s-limit-red">Red limit</div>
|
|
||||||
<div class="s-limit-yellow-icon">Yellow limit with icon</div>
|
|
||||||
<div class="s-limit-red-icon">Red limit with icon</div>
|
|
||||||
<div class="s-limit-yellow s-limit-lwr">Lower yellow limit</div>
|
|
||||||
<div class="s-limit-red s-limit-upr">Upper red limit</div>
|
|
||||||
<div class="s-limit-red icon-bell">Red Limit with a custom icon</div>
|
|
||||||
<div>Some text with an <span class="s-limit-yellow-icon">inline element</span> showing a yellow limit.</div>
|
|
||||||
|
|
||||||
<!-- Limits applied in a table -->
|
|
||||||
<table>
|
|
||||||
<tr class='header'><td>Name</td><td>Value 1</td><td>Value 2</td></tr>
|
|
||||||
<tr><td>ENG_PWR 4991</td><td>7.023</td><td class="s-limit-yellow s-limit-upr">70.23</td></tr>
|
|
||||||
<tr><td>ENG_PWR 4992</td><td>49.784</td><td class="s-limit-red s-limit-lwr">-121.22</td></tr>
|
|
||||||
<tr><td>ENG_PWR 4993</td><td class="s-limit-yellow icon-bell">0.451</td><td>1.007</td></tr>
|
|
||||||
</table>
|
|
||||||
</mct-example>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="l-section">
|
|
||||||
<h2>Status</h2>
|
|
||||||
<div class="cols cols1-1">
|
|
||||||
<div class="col">
|
|
||||||
<p>Classes here can be applied to elements as needed.</p>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Color only</li>
|
<li>Color only</li>
|
||||||
<ul>
|
<ul>
|
||||||
@ -106,37 +53,175 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<li>Color and icon</li>
|
<li>Color and icon</li>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>s-status-warning-hi-icon</code></li>
|
<li><code>s-status-icon-warning-hi</code></li>
|
||||||
<li><code>s-status-warning-lo-icon</code></li>
|
<li><code>s-status-icon-warning-lo</code></li>
|
||||||
<li><code>s-status-diagnostic-icon</code></li>
|
<li><code>s-status-icon-diagnostic</code></li>
|
||||||
<li><code>s-status-info-icon</code></li>
|
<li><code>s-status-icon-info</code></li>
|
||||||
<li><code>s-status-ok-icon</code></li>
|
<li><code>s-status-icon-ok</code></li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<mct-example><div class="s-status-warning-hi">WARNING HI</div>
|
<mct-example><!-- Color alone examples -->
|
||||||
|
<div class="s-status-warning-hi">WARNING HI</div>
|
||||||
<div class="s-status-warning-lo">WARNING LOW</div>
|
<div class="s-status-warning-lo">WARNING LOW</div>
|
||||||
<div class="s-status-diagnostic">DIAGNOSTIC</div>
|
<div class="s-status-diagnostic">DIAGNOSTIC</div>
|
||||||
<div class="s-status-info">INFO</div>
|
<div class="s-status-info">INFO</div>
|
||||||
<div class="s-status-ok">OK</div>
|
<div class="s-status-ok">OK</div>
|
||||||
<div class="s-status-warning-hi-icon">WARNING HI with icon</div>
|
|
||||||
<div class="s-status-warning-lo-icon">WARNING LOW with icon</div>
|
<!-- Color and icon examples -->
|
||||||
<div class="s-status-diagnostic-icon">DIAGNOSTIC with icon</div>
|
<div class="s-status-icon-warning-hi">WARNING HI with icon</div>
|
||||||
<div class="s-status-info-icon">INFO with icon</div>
|
<div class="s-status-icon-warning-lo">WARNING LOW with icon</div>
|
||||||
<div class="s-status-ok-icon">OK with icon</div>
|
<div class="s-status-icon-diagnostic">DIAGNOSTIC with icon</div>
|
||||||
<div class="s-status-warning-hi icon-gear">WARNING HI with custom icon</div>
|
<div class="s-status-icon-info">INFO with icon</div>
|
||||||
|
<div class="s-status-icon-ok">OK with icon</div>
|
||||||
|
<div class="s-status-warning-hi icon-alert-triangle">WARNING HI with custom icon</div>
|
||||||
|
<div>Some text with an <span class="s-status-icon-diagnostic">inline element</span> showing a Diagnostic status.</div>
|
||||||
</mct-example>
|
</mct-example>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="l-section">
|
<div class="l-section">
|
||||||
<h2>Synchronization</h2>
|
<h2>Limit Classes</h2>
|
||||||
<div class="cols cols1-1">
|
<div class="cols cols1-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p>When the system is operating in real-time streaming mode, it is important for views that display real-time data to clearly articulate when they are not, such as when a user zooms or pans a plot view, freezing that view. In that case, the CSS class <code>s-unsynced</code> should be applied to that view.</p>
|
<p>Limit classes are a specialized form of status, specifically meant to be applied to telemetry
|
||||||
|
displays to indicate that a limit threshold has been violated. Open MCT provides both severity
|
||||||
|
and direction classes; severity (yellow and red) can be used alone or in combination
|
||||||
|
with direction (upper or lower). Direction classes cannot be used on their own.</p>
|
||||||
|
<p>Like Status classes, Limits can be used as color-only, or color plus icon. Custom icons can
|
||||||
|
be applied in the same fashion as described above.</p>
|
||||||
|
<ul>
|
||||||
|
<li>Severity color alone</li>
|
||||||
|
<ul>
|
||||||
|
<li><code>s-limit-yellow</code>: A yellow limit.</li>
|
||||||
|
<li><code>s-limit-red</code>: A red limit.</li>
|
||||||
|
</ul>
|
||||||
|
<li>Severity color and icon</li>
|
||||||
|
<ul>
|
||||||
|
<li><code>s-limit-icon-yellow</code>: A yellow limit with icon.</li>
|
||||||
|
<li><code>s-limit-icon-red</code>: A red limit with icon.</li>
|
||||||
|
</ul>
|
||||||
|
<li>Direction indicators. MUST be used with a "color alone" limit class. See
|
||||||
|
examples for more.</li>
|
||||||
|
<ul>
|
||||||
|
<li><code>s-limit-upr</code>: Upper limit.</li>
|
||||||
|
<li><code>s-limit-lwr</code>: Lower limit.</li>
|
||||||
|
</ul>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<mct-example><div class="s-unsynced">This element is unsynced</div>
|
<mct-example><!-- Color alone examples -->
|
||||||
|
<div class="s-limit-yellow">Yellow limit</div>
|
||||||
|
<div class="s-limit-red">Red limit</div>
|
||||||
|
|
||||||
|
<!-- Color and icon examples -->
|
||||||
|
<div class="s-limit-icon-yellow">Yellow limit with icon</div>
|
||||||
|
<div class="s-limit-icon-red">Red limit with icon</div>
|
||||||
|
<div class="s-limit-red icon-alert-rect">Red Limit with a custom icon</div>
|
||||||
|
<div>Some text with an <span class="s-limit-icon-yellow">inline element</span> showing a yellow limit.</div>
|
||||||
|
|
||||||
|
<!-- Severity and direction examples -->
|
||||||
|
<div class="s-limit-yellow s-limit-lwr">Lower yellow limit</div>
|
||||||
|
<div class="s-limit-red s-limit-upr">Upper red limit</div>
|
||||||
|
|
||||||
|
<!-- Limits applied in a table -->
|
||||||
|
<table>
|
||||||
|
<tr class='header'><td>Name</td><td>Value 1</td><td>Value 2</td></tr>
|
||||||
|
<tr><td>ENG_PWR 4991</td><td>7.023</td><td class="s-limit-yellow s-limit-upr">70.23</td></tr>
|
||||||
|
<tr><td>ENG_PWR 4992</td><td>49.784</td><td class="s-limit-red s-limit-lwr">-121.22</td></tr>
|
||||||
|
<tr><td>ENG_PWR 4993</td><td class="s-limit-yellow icon-alert-triangle">0.451</td><td>1.007</td></tr>
|
||||||
|
</table>
|
||||||
</mct-example>
|
</mct-example>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="l-section">
|
||||||
|
<h2>Status Bar Indicators</h2>
|
||||||
|
<div class="cols cols1-1">
|
||||||
|
<div class="col">
|
||||||
|
<p>Indicators are small iconic notification elements that appear in the Status Bar area of
|
||||||
|
the application at the window's bottom. Indicators should be used to articulate the state of a
|
||||||
|
system and optionally provide gestures related to that system. They use a combination of icon and
|
||||||
|
color to identify themselves and articulate a state respectively.</p>
|
||||||
|
<h3>Recommendations</h3>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Keep the icon consistent</strong>. The icon is the principal identifier of the system and is a valuable
|
||||||
|
recall aid for the user. Don't change the icon as a system's state changes, use color and
|
||||||
|
text for that purpose.</li>
|
||||||
|
<li><strong>Don't use the same icon more than once</strong>. Select meaningful and distinct icons so the user
|
||||||
|
will be able to quickly identify what they're looking for.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>States</h3>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Disabled</strong>: The system is not available to the user.</li>
|
||||||
|
<li><strong>Off / Available</strong>: The system is accessible to the user but is not currently
|
||||||
|
"On" or has not been configured. If the Indicator directly provides gestures
|
||||||
|
related to the system, such as opening a configuration dialog box, then use
|
||||||
|
"Available"; if the user must act elsewhere or the system isn't user-controllable,
|
||||||
|
use "Off".</li>
|
||||||
|
<li><strong>On</strong>: The system is enabled or configured; it is having an effect on the larger application.</li>
|
||||||
|
<li><strong>Alert / Error</strong>: There has been a problem with the system. Generally, "Alert"
|
||||||
|
should be used to call attention to an issue that isn't critical, while "Error"
|
||||||
|
should be used to call attention to a problem that the user should really be aware of or do
|
||||||
|
something about.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Structure</h3>
|
||||||
|
<p>Indicators consist of a <code>.ls-indicator</code>
|
||||||
|
wrapper element with <code>.icon-*</code> classes for the type of thing they represent and
|
||||||
|
<code>.s-status-*</code> classes to articulate the current state. Title attributes should be used
|
||||||
|
to provide more verbose information about the thing and/or its status.</p>
|
||||||
|
<p>The wrapper encloses a <code>.label</code> element that is displayed on hover. This element should
|
||||||
|
include a brief statement of the current status, and can also include clickable elements
|
||||||
|
as <code><a></code> tags. An optional <code>.count</code> element can be included to display
|
||||||
|
information such as a number of messages.</p>
|
||||||
|
<p>Icon classes are as defined on the
|
||||||
|
<a class="link" href="#/browse/styleguide:home/glyphs?tc.mode=local&tc.timeSystem=utc&tc.startDelta=1800000&tc.endDelta=0&view=styleguide.glyphs">
|
||||||
|
Glyphs page</a>. Status classes applicable to Indicators are as follows:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>s-status-disabled</code></li>
|
||||||
|
<li><code>s-status-off</code></li>
|
||||||
|
<li><code>s-status-available</code></li>
|
||||||
|
<li><code>s-status-on</code></li>
|
||||||
|
<li><code>s-status-alert</code></li>
|
||||||
|
<li><code>s-status-error</code></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<mct-example><div class="s-ue-bottom-bar status-holder s-status-bar">
|
||||||
|
<span class="ls-indicator icon-database s-status-disabled" title="The system is currently disabled.">
|
||||||
|
<span class="label">System not enabled.</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="s-ue-bottom-bar status-holder s-status-bar">
|
||||||
|
<span class="ls-indicator icon-database s-status-available" title="Configure data connection.">
|
||||||
|
<span class="label">Data connection available
|
||||||
|
<a class="icon-gear">Configure</a>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="s-ue-bottom-bar status-holder s-status-bar">
|
||||||
|
<span class="ls-indicator icon-database s-status-on" title="Data connected.">
|
||||||
|
<span class="label">Connected to Skynet
|
||||||
|
<a class="icon-gear">Change</a>
|
||||||
|
<a>Disconnect</a>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="s-ue-bottom-bar status-holder s-status-bar">
|
||||||
|
<span class="ls-indicator icon-database s-status-alert" title="System is self-aware.">
|
||||||
|
<span class="label">Skynet at Turing Level 5</span>
|
||||||
|
</span>
|
||||||
|
<span class="ls-indicator icon-bell s-status-error" title="You have alerts.">
|
||||||
|
<span class="label">
|
||||||
|
<a class="icon-alert-triangle">View Alerts</a>
|
||||||
|
</span>
|
||||||
|
<span class="count">495</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</mct-example>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
define([
|
define([
|
||||||
'text!../res/templates/mct-example.html'
|
'../res/templates/mct-example.html'
|
||||||
], function (
|
], function (
|
||||||
MCTExampleTemplate
|
MCTExampleTemplate
|
||||||
) {
|
) {
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
"./src/ExampleTaxonomyModelProvider",
|
|
||||||
'legacyRegistry'
|
|
||||||
], function (
|
|
||||||
ExampleTaxonomyModelProvider,
|
|
||||||
legacyRegistry
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
legacyRegistry.register("example/taxonomy", {
|
|
||||||
"name": "Example taxonomy",
|
|
||||||
"description": "Example illustrating the addition of a static top-level hierarchy",
|
|
||||||
"extensions": {
|
|
||||||
"roots": [
|
|
||||||
{
|
|
||||||
"id": "exampleTaxonomy"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"models": [
|
|
||||||
{
|
|
||||||
"id": "exampleTaxonomy",
|
|
||||||
"model": {
|
|
||||||
"type": "folder",
|
|
||||||
"name": "Stub Subsystems",
|
|
||||||
"composition": [
|
|
||||||
"examplePacket0",
|
|
||||||
"examplePacket1",
|
|
||||||
"examplePacket2"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"provides": "modelService",
|
|
||||||
"type": "provider",
|
|
||||||
"implementation": ExampleTaxonomyModelProvider,
|
|
||||||
"depends": [
|
|
||||||
"$q"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,69 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function ExampleTaxonomyModelProvider($q) {
|
|
||||||
var models = {},
|
|
||||||
packetId,
|
|
||||||
telemetryId,
|
|
||||||
i,
|
|
||||||
j;
|
|
||||||
|
|
||||||
// Add some "subsystems"
|
|
||||||
for (i = 0; i < 3; i += 1) {
|
|
||||||
packetId = "examplePacket" + i;
|
|
||||||
|
|
||||||
models[packetId] = {
|
|
||||||
name: "Stub Subsystem " + (i + 1),
|
|
||||||
type: "telemetry.panel",
|
|
||||||
composition: []
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add some "telemetry points"
|
|
||||||
for (j = 0; j < 100 * (i + 1); j += 1) {
|
|
||||||
telemetryId = "exampleTelemetry" + j;
|
|
||||||
models[telemetryId] = {
|
|
||||||
name: "SWG" + i + "." + j,
|
|
||||||
type: "generator",
|
|
||||||
telemetry: {
|
|
||||||
period: 10 + i + j
|
|
||||||
}
|
|
||||||
};
|
|
||||||
models[packetId].composition.push(telemetryId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
getModels: function () {
|
|
||||||
return $q.when(models);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return ExampleTaxonomyModelProvider;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1 +0,0 @@
|
|||||||
Example of running a Web Worker using the `workerService`.
|
|
@ -1,52 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
"./src/FibonacciIndicator",
|
|
||||||
'legacyRegistry'
|
|
||||||
], function (
|
|
||||||
FibonacciIndicator,
|
|
||||||
legacyRegistry
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
legacyRegistry.register("example/worker", {
|
|
||||||
"extensions": {
|
|
||||||
"indicators": [
|
|
||||||
{
|
|
||||||
"implementation": FibonacciIndicator,
|
|
||||||
"depends": [
|
|
||||||
"workerService",
|
|
||||||
"$rootScope"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"workers": [
|
|
||||||
{
|
|
||||||
"key": "example.fibonacci",
|
|
||||||
"scriptUrl": "FibonacciWorker.js"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,67 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays Fibonacci numbers in the status area.
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function FibonacciIndicator(workerService, $rootScope) {
|
|
||||||
var latest,
|
|
||||||
counter = 0,
|
|
||||||
worker = workerService.run('example.fibonacci');
|
|
||||||
|
|
||||||
function requestNext() {
|
|
||||||
worker.postMessage([counter]);
|
|
||||||
counter += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleResponse(event) {
|
|
||||||
latest = event.data;
|
|
||||||
$rootScope.$apply();
|
|
||||||
requestNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
worker.onmessage = handleResponse;
|
|
||||||
requestNext();
|
|
||||||
|
|
||||||
return {
|
|
||||||
getCssClass: function () {
|
|
||||||
return "icon-object-unknown";
|
|
||||||
},
|
|
||||||
getText: function () {
|
|
||||||
return latest;
|
|
||||||
},
|
|
||||||
getDescription: function () {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return FibonacciIndicator;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,15 +0,0 @@
|
|||||||
/*global self*/
|
|
||||||
(function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
// Calculate fibonacci numbers inefficiently.
|
|
||||||
// We can do this because we're on a background thread, and
|
|
||||||
// won't halt the UI.
|
|
||||||
function fib(n) {
|
|
||||||
return n < 2 ? n : (fib(n - 1) + fib(n - 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
self.onmessage = function (event) {
|
|
||||||
self.postMessage(fib(event.data));
|
|
||||||
};
|
|
||||||
}());
|
|
182
gulpfile.js
182
gulpfile.js
@ -1,182 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/*global require,__dirname*/
|
|
||||||
|
|
||||||
require("v8-compile-cache");
|
|
||||||
|
|
||||||
var gulp = require('gulp'),
|
|
||||||
sourcemaps = require('gulp-sourcemaps'),
|
|
||||||
path = require('path'),
|
|
||||||
fs = require('fs'),
|
|
||||||
git = require('git-rev-sync'),
|
|
||||||
moment = require('moment'),
|
|
||||||
project = require('./package.json'),
|
|
||||||
_ = require('lodash'),
|
|
||||||
paths = {
|
|
||||||
main: 'openmct.js',
|
|
||||||
dist: 'dist',
|
|
||||||
reports: 'dist/reports',
|
|
||||||
scss: ['./platform/**/*.scss', './example/**/*.scss'],
|
|
||||||
assets: [
|
|
||||||
'./{example,platform}/**/*.{css,css.map,png,svg,ico,woff,eot,ttf}'
|
|
||||||
],
|
|
||||||
scripts: [ 'openmct.js', 'platform/**/*.js', 'src/**/*.js' ],
|
|
||||||
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
|
|
||||||
},
|
|
||||||
options = {
|
|
||||||
requirejsOptimize: {
|
|
||||||
name: 'bower_components/almond/almond.js',
|
|
||||||
include: paths.main.replace('.js', ''),
|
|
||||||
wrap: {
|
|
||||||
start: (function () {
|
|
||||||
var buildVariables = {
|
|
||||||
version: project.version,
|
|
||||||
timestamp: moment.utc(Date.now()).format(),
|
|
||||||
revision: fs.existsSync('.git') ? git.long() : 'Unknown',
|
|
||||||
branch: fs.existsSync('.git') ? git.branch() : 'Unknown'
|
|
||||||
};
|
|
||||||
return fs.readFileSync("src/start.frag", 'utf-8')
|
|
||||||
.replace(/@@(\w+)/g, function (match, key) {
|
|
||||||
return buildVariables[key];
|
|
||||||
});;
|
|
||||||
}()),
|
|
||||||
endFile: "src/end.frag"
|
|
||||||
},
|
|
||||||
optimize: 'uglify2',
|
|
||||||
uglify2: { output: { comments: /@preserve/ } },
|
|
||||||
mainConfigFile: paths.main,
|
|
||||||
wrapShim: true
|
|
||||||
},
|
|
||||||
karma: {
|
|
||||||
configFile: path.resolve(__dirname, 'karma.conf.js'),
|
|
||||||
singleRun: true
|
|
||||||
},
|
|
||||||
sass: {
|
|
||||||
sourceComments: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
|
||||||
options.requirejsOptimize.optimize = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
gulp.task('scripts', function () {
|
|
||||||
var requirejsOptimize = require('gulp-requirejs-optimize');
|
|
||||||
|
|
||||||
return gulp.src(paths.main)
|
|
||||||
.pipe(sourcemaps.init())
|
|
||||||
.pipe(requirejsOptimize(options.requirejsOptimize))
|
|
||||||
.pipe(sourcemaps.write('.'))
|
|
||||||
.pipe(gulp.dest(paths.dist));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('test', function (done) {
|
|
||||||
var karma = require('karma');
|
|
||||||
new karma.Server(options.karma, done).start();
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('stylesheets', function () {
|
|
||||||
var sass = require('gulp-sass');
|
|
||||||
var rename = require('gulp-rename');
|
|
||||||
var bourbon = require('node-bourbon');
|
|
||||||
options.sass.includePaths = bourbon.includePaths;
|
|
||||||
|
|
||||||
return gulp.src(paths.scss, {base: '.'})
|
|
||||||
.pipe(sourcemaps.init())
|
|
||||||
.pipe(sass(options.sass).on('error', sass.logError))
|
|
||||||
.pipe(rename(function (file) {
|
|
||||||
file.dirname =
|
|
||||||
file.dirname.replace(path.sep + 'sass', path.sep + 'css');
|
|
||||||
return file;
|
|
||||||
}))
|
|
||||||
.pipe(sourcemaps.write('.'))
|
|
||||||
.pipe(gulp.dest(__dirname));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('lint', function () {
|
|
||||||
var jshint = require('gulp-jshint');
|
|
||||||
var merge = require('merge-stream');
|
|
||||||
|
|
||||||
var nonspecs = paths.specs.map(function (glob) {
|
|
||||||
return "!" + glob;
|
|
||||||
}),
|
|
||||||
scriptLint = gulp.src(paths.scripts.concat(nonspecs))
|
|
||||||
.pipe(jshint()),
|
|
||||||
specLint = gulp.src(paths.specs)
|
|
||||||
.pipe(jshint({ jasmine: true }));
|
|
||||||
|
|
||||||
return merge(scriptLint, specLint)
|
|
||||||
.pipe(jshint.reporter('gulp-jshint-html-reporter', {
|
|
||||||
filename: paths.reports + '/lint/jshint-report.html',
|
|
||||||
createMissingFolders : true
|
|
||||||
}))
|
|
||||||
.pipe(jshint.reporter('default'))
|
|
||||||
.pipe(jshint.reporter('fail'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('checkstyle', function () {
|
|
||||||
var jscs = require('gulp-jscs');
|
|
||||||
var mkdirp = require('mkdirp');
|
|
||||||
var reportName = 'jscs-html-report.html';
|
|
||||||
var reportPath = path.resolve(paths.reports, 'checkstyle', reportName);
|
|
||||||
var moveReport = fs.rename.bind(fs, reportName, reportPath, _.noop);
|
|
||||||
|
|
||||||
mkdirp.sync(path.resolve(paths.reports, 'checkstyle'));
|
|
||||||
|
|
||||||
return gulp.src(paths.scripts)
|
|
||||||
.pipe(jscs())
|
|
||||||
.pipe(jscs.reporter())
|
|
||||||
.pipe(jscs.reporter('jscs-html-reporter')).on('finish', moveReport)
|
|
||||||
.pipe(jscs.reporter('fail'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('fixstyle', function () {
|
|
||||||
var jscs = require('gulp-jscs');
|
|
||||||
|
|
||||||
return gulp.src(paths.scripts, { base: '.' })
|
|
||||||
.pipe(jscs({ fix: true }))
|
|
||||||
.pipe(gulp.dest('.'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('assets', ['stylesheets'], function () {
|
|
||||||
return gulp.src(paths.assets)
|
|
||||||
.pipe(gulp.dest(paths.dist));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch', function () {
|
|
||||||
return gulp.watch(paths.scss, ['stylesheets', 'assets']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('serve', function () {
|
|
||||||
console.log('Running development server with all defaults');
|
|
||||||
var app = require('./app.js');
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('develop', ['serve', 'stylesheets', 'watch']);
|
|
||||||
|
|
||||||
gulp.task('install', [ 'assets', 'scripts' ]);
|
|
||||||
|
|
||||||
gulp.task('verify', [ 'lint', 'test', 'checkstyle' ]);
|
|
||||||
|
|
||||||
gulp.task('build', [ 'verify', 'install' ]);
|
|
108
index.html
108
index.html
@ -26,65 +26,57 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title></title>
|
<title></title>
|
||||||
<script src="bower_components/requirejs/require.js"> </script>
|
<script src="dist/openmct.js"></script>
|
||||||
<script>
|
<link rel="stylesheet" href="dist/openmct.css">
|
||||||
var THIRTY_MINUTES = 30 * 60 * 1000;
|
<link rel="icon" type="image/png" href="dist/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
|
<link rel="icon" type="image/png" href="dist/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
require(['openmct'], function (openmct) {
|
<link rel="icon" type="image/png" href="dist/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
[
|
<link rel="shortcut icon" href="dist/favicons/favicon.ico">
|
||||||
'example/eventGenerator',
|
|
||||||
'example/styleguide'
|
|
||||||
].forEach(
|
|
||||||
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
|
|
||||||
);
|
|
||||||
openmct.install(openmct.plugins.MyItems());
|
|
||||||
openmct.install(openmct.plugins.LocalStorage());
|
|
||||||
openmct.install(openmct.plugins.Espresso());
|
|
||||||
openmct.install(openmct.plugins.Generator());
|
|
||||||
openmct.install(openmct.plugins.ExampleImagery());
|
|
||||||
openmct.install(openmct.plugins.UTCTimeSystem());
|
|
||||||
openmct.install(openmct.plugins.ImportExport());
|
|
||||||
openmct.install(openmct.plugins.AutoflowView({
|
|
||||||
type: "telemetry.panel"
|
|
||||||
}));
|
|
||||||
openmct.install(openmct.plugins.Conductor({
|
|
||||||
menuOptions: [
|
|
||||||
{
|
|
||||||
name: "Fixed",
|
|
||||||
timeSystem: 'utc',
|
|
||||||
bounds: {
|
|
||||||
start: Date.now() - THIRTY_MINUTES,
|
|
||||||
end: Date.now()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Realtime",
|
|
||||||
timeSystem: 'utc',
|
|
||||||
clock: 'local',
|
|
||||||
clockOffsets: {
|
|
||||||
start: -25 * 60 * 1000,
|
|
||||||
end: 5 * 60 * 1000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}));
|
|
||||||
openmct.install(openmct.plugins.SummaryWidget());
|
|
||||||
openmct.install(openmct.plugins.Notebook());
|
|
||||||
openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0});
|
|
||||||
openmct.time.timeSystem('utc');
|
|
||||||
openmct.start();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">
|
|
||||||
<link rel="stylesheet" href="platform/commonUI/general/res/css/openmct.css">
|
|
||||||
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-32x32.png" sizes="32x32">
|
|
||||||
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-96x96.png" sizes="96x96">
|
|
||||||
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-16x16.png" sizes="16x16">
|
|
||||||
<link rel="shortcut icon" href="platform/commonUI/general/res/images/favicons/favicon.ico">
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="l-splash-holder s-splash-holder">
|
|
||||||
<div class="l-splash s-splash"></div>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
<script>
|
||||||
|
var THIRTY_MINUTES = 30 * 60 * 1000;
|
||||||
|
[
|
||||||
|
'example/eventGenerator',
|
||||||
|
'example/styleguide'
|
||||||
|
].forEach(
|
||||||
|
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
|
||||||
|
);
|
||||||
|
openmct.install(openmct.plugins.MyItems());
|
||||||
|
openmct.install(openmct.plugins.LocalStorage());
|
||||||
|
openmct.install(openmct.plugins.Generator());
|
||||||
|
openmct.install(openmct.plugins.ExampleImagery());
|
||||||
|
openmct.install(openmct.plugins.UTCTimeSystem());
|
||||||
|
openmct.install(openmct.plugins.ImportExport());
|
||||||
|
openmct.install(openmct.plugins.AutoflowView({
|
||||||
|
type: "telemetry.panel"
|
||||||
|
}));
|
||||||
|
openmct.install(openmct.plugins.Conductor({
|
||||||
|
menuOptions: [
|
||||||
|
{
|
||||||
|
name: "Fixed",
|
||||||
|
timeSystem: 'utc',
|
||||||
|
bounds: {
|
||||||
|
start: Date.now() - THIRTY_MINUTES,
|
||||||
|
end: Date.now()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Realtime",
|
||||||
|
timeSystem: 'utc',
|
||||||
|
clock: 'local',
|
||||||
|
clockOffsets: {
|
||||||
|
start: -25 * 60 * 1000,
|
||||||
|
end: 5 * 60 * 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
openmct.install(openmct.plugins.SummaryWidget());
|
||||||
|
openmct.install(openmct.plugins.Notebook());
|
||||||
|
openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0});
|
||||||
|
openmct.time.timeSystem('utc');
|
||||||
|
openmct.start();
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
@ -21,70 +21,40 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/*global module,process*/
|
/*global module,process*/
|
||||||
module.exports = function(config) {
|
|
||||||
|
const devMode = process.env.NODE_ENV !== 'production';
|
||||||
|
|
||||||
|
module.exports = (config) => {
|
||||||
|
|
||||||
|
const webpackConfig = require('./webpack.config.js');
|
||||||
|
delete webpackConfig.output;
|
||||||
|
|
||||||
|
if (!devMode) {
|
||||||
|
webpackConfig.module.rules.push({
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /node_modules|example/,
|
||||||
|
use: 'istanbul-instrumenter-loader'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
config.set({
|
config.set({
|
||||||
|
|
||||||
// Base path that will be used to resolve all file patterns.
|
|
||||||
basePath: '',
|
basePath: '',
|
||||||
|
frameworks: ['jasmine'],
|
||||||
// Frameworks to use
|
|
||||||
// Available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
||||||
frameworks: ['jasmine', 'requirejs'],
|
|
||||||
|
|
||||||
// List of files / patterns to load in the browser.
|
|
||||||
// By default, files are also included in a script tag.
|
|
||||||
files: [
|
files: [
|
||||||
{pattern: 'bower_components/**/*.js', included: false},
|
'platform/**/*Spec.js',
|
||||||
{pattern: 'node_modules/d3-*/**/*.js', included: false},
|
'src/**/*Spec.js'
|
||||||
{pattern: 'node_modules/vue/**/*.js', included: false},
|
|
||||||
{pattern: 'node_modules/printj/dist/*.js', included: false},
|
|
||||||
{pattern: 'src/**/*', included: false},
|
|
||||||
{pattern: 'node_modules/painterro/build/*.js', included: false},
|
|
||||||
{pattern: 'node_modules/html2canvas/dist/*', included: false},
|
|
||||||
{pattern: 'example/**/*.html', included: false},
|
|
||||||
{pattern: 'example/**/*.js', included: false},
|
|
||||||
{pattern: 'example/**/*.json', included: false},
|
|
||||||
{pattern: 'platform/**/*.js', included: false},
|
|
||||||
{pattern: 'warp/**/*.js', included: false},
|
|
||||||
{pattern: 'platform/**/*.html', included: false},
|
|
||||||
'test-main.js'
|
|
||||||
],
|
],
|
||||||
|
|
||||||
// List of files to exclude.
|
|
||||||
exclude: [
|
|
||||||
'platform/framework/src/Main.js'
|
|
||||||
],
|
|
||||||
|
|
||||||
// Preprocess matching files before serving them to the browser.
|
|
||||||
// https://npmjs.org/browse/keyword/karma-preprocessor
|
|
||||||
preprocessors: {
|
|
||||||
'src/**/!(*Spec).js': [ 'coverage' ],
|
|
||||||
'platform/**/src/**/!(*Spec).js': [ 'coverage' ]
|
|
||||||
},
|
|
||||||
|
|
||||||
// Test results reporter to use
|
|
||||||
// Possible values: 'dots', 'progress'
|
|
||||||
// Available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
||||||
reporters: ['progress', 'coverage', 'html'],
|
|
||||||
|
|
||||||
// Web server port.
|
|
||||||
port: 9876,
|
port: 9876,
|
||||||
|
reporters: [
|
||||||
// Wnable / disable colors in the output (reporters and logs).
|
'progress',
|
||||||
|
'coverage',
|
||||||
|
'html'
|
||||||
|
],
|
||||||
|
browsers: ['ChromeHeadless'],
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
|
|
||||||
// Rerun tests when any file changes.
|
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
|
|
||||||
// Specify browsers to run tests in.
|
|
||||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
|
||||||
browsers: [
|
|
||||||
'ChromeHeadless'
|
|
||||||
],
|
|
||||||
|
|
||||||
// Code coverage reporting.
|
|
||||||
coverageReporter: {
|
coverageReporter: {
|
||||||
dir: process.env.CIRCLE_ARTIFACTS ?
|
dir: process.env.CIRCLE_ARTIFACTS ?
|
||||||
process.env.CIRCLE_ARTIFACTS + '/coverage' :
|
process.env.CIRCLE_ARTIFACTS + '/coverage' :
|
||||||
@ -104,8 +74,19 @@ module.exports = function(config) {
|
|||||||
foldAll: false
|
foldAll: false
|
||||||
},
|
},
|
||||||
|
|
||||||
// Continuous Integration mode.
|
preprocessors: {
|
||||||
// If true, Karma captures browsers, runs the tests and exits.
|
// add webpack as preprocessor
|
||||||
|
'platform/**/*Spec.js': [ 'webpack' ],
|
||||||
|
'src/**/*Spec.js': [ 'webpack' ]
|
||||||
|
},
|
||||||
|
|
||||||
|
webpack: webpackConfig,
|
||||||
|
|
||||||
|
webpackMiddleware: {
|
||||||
|
stats: 'errors-only',
|
||||||
|
logLevel: 'warn'
|
||||||
|
},
|
||||||
singleRun: true
|
singleRun: true
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
|
105
openmct.js
105
openmct.js
@ -19,102 +19,19 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*global requirejs,BUILD_CONSTANTS*/
|
/*global module,BUILD_CONSTANTS*/
|
||||||
|
|
||||||
requirejs.config({
|
const matcher = /\/openmct.js$/;
|
||||||
"paths": {
|
if (document.currentScript) {
|
||||||
"legacyRegistry": "src/legacyRegistry",
|
let src = document.currentScript.src;
|
||||||
"angular": "bower_components/angular/angular.min",
|
if (src && matcher.test(src)) {
|
||||||
"angular-route": "bower_components/angular-route/angular-route.min",
|
// eslint-disable-next-line no-undef
|
||||||
"csv": "bower_components/comma-separated-values/csv.min",
|
__webpack_public_path__ = src.replace(matcher, '') + '/';
|
||||||
"EventEmitter": "bower_components/eventemitter3/index",
|
|
||||||
"es6-promise": "bower_components/es6-promise/es6-promise.min",
|
|
||||||
"moment": "bower_components/moment/moment",
|
|
||||||
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
|
|
||||||
"moment-timezone": "bower_components/moment-timezone/builds/moment-timezone-with-data",
|
|
||||||
"saveAs": "bower_components/file-saver/FileSaver.min",
|
|
||||||
"screenfull": "bower_components/screenfull/dist/screenfull.min",
|
|
||||||
"text": "bower_components/text/text",
|
|
||||||
"uuid": "bower_components/node-uuid/uuid",
|
|
||||||
"vue": "node_modules/vue/dist/vue.min",
|
|
||||||
"zepto": "bower_components/zepto/zepto.min",
|
|
||||||
"lodash": "bower_components/lodash/lodash",
|
|
||||||
"d3-selection": "node_modules/d3-selection/dist/d3-selection.min",
|
|
||||||
"d3-scale": "node_modules/d3-scale/build/d3-scale.min",
|
|
||||||
"d3-axis": "node_modules/d3-axis/build/d3-axis.min",
|
|
||||||
"d3-array": "node_modules/d3-array/build/d3-array.min",
|
|
||||||
"d3-collection": "node_modules/d3-collection/build/d3-collection.min",
|
|
||||||
"d3-color": "node_modules/d3-color/build/d3-color.min",
|
|
||||||
"d3-format": "node_modules/d3-format/build/d3-format.min",
|
|
||||||
"d3-interpolate": "node_modules/d3-interpolate/build/d3-interpolate.min",
|
|
||||||
"d3-time": "node_modules/d3-time/build/d3-time.min",
|
|
||||||
"d3-time-format": "node_modules/d3-time-format/build/d3-time-format.min",
|
|
||||||
"html2canvas": "node_modules/html2canvas/dist/html2canvas.min",
|
|
||||||
"painterro": "node_modules/painterro/build/painterro.min",
|
|
||||||
"printj": "node_modules/printj/dist/printj.min"
|
|
||||||
},
|
|
||||||
"shim": {
|
|
||||||
"angular": {
|
|
||||||
"exports": "angular"
|
|
||||||
},
|
|
||||||
"angular-route": {
|
|
||||||
"deps": ["angular"]
|
|
||||||
},
|
|
||||||
"EventEmitter": {
|
|
||||||
"exports": "EventEmitter"
|
|
||||||
},
|
|
||||||
"moment-duration-format": {
|
|
||||||
"deps": ["moment"]
|
|
||||||
},
|
|
||||||
"painterro": {
|
|
||||||
"exports": "Painterro"
|
|
||||||
},
|
|
||||||
"saveAs": {
|
|
||||||
"exports": "saveAs"
|
|
||||||
},
|
|
||||||
"screenfull": {
|
|
||||||
"exports": "screenfull"
|
|
||||||
},
|
|
||||||
"zepto": {
|
|
||||||
"exports": "Zepto"
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"exports": "lodash"
|
|
||||||
},
|
|
||||||
"d3-selection": {
|
|
||||||
"exports": "d3-selection"
|
|
||||||
},
|
|
||||||
"d3-scale": {
|
|
||||||
"deps": ["d3-array", "d3-collection", "d3-color", "d3-format", "d3-interpolate", "d3-time", "d3-time-format"],
|
|
||||||
"exports": "d3-scale"
|
|
||||||
},
|
|
||||||
"d3-axis": {
|
|
||||||
"exports": "d3-axis"
|
|
||||||
},
|
|
||||||
"dom-to-image": {
|
|
||||||
"exports": "domtoimage"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
define([
|
const MCT = require('./src/MCT');
|
||||||
'./platform/framework/src/Main',
|
|
||||||
'./src/defaultRegistry',
|
|
||||||
'./src/MCT',
|
|
||||||
'./src/plugins/buildInfo/plugin'
|
|
||||||
], function (Main, defaultRegistry, MCT, buildInfo) {
|
|
||||||
var openmct = new MCT();
|
|
||||||
|
|
||||||
openmct.legacyRegistry = defaultRegistry;
|
var openmct = new MCT();
|
||||||
openmct.install(openmct.plugins.Plot());
|
|
||||||
|
|
||||||
if (typeof BUILD_CONSTANTS !== 'undefined') {
|
module.exports = openmct;
|
||||||
openmct.install(buildInfo(BUILD_CONSTANTS));
|
|
||||||
}
|
|
||||||
|
|
||||||
openmct.on('start', function () {
|
|
||||||
return new Main().run(defaultRegistry);
|
|
||||||
});
|
|
||||||
|
|
||||||
return openmct;
|
|
||||||
});
|
|
||||||
|
73
package.json
73
package.json
@ -2,7 +2,15 @@
|
|||||||
"name": "openmct",
|
"name": "openmct",
|
||||||
"version": "0.14.0-SNAPSHOT",
|
"version": "0.14.0-SNAPSHOT",
|
||||||
"description": "The Open MCT core platform",
|
"description": "The Open MCT core platform",
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"angular": "1.4.14",
|
||||||
|
"angular-route": "1.4.14",
|
||||||
|
"babel-eslint": "8.2.6",
|
||||||
|
"comma-separated-values": "^3.6.4",
|
||||||
|
"concurrently": "^3.6.1",
|
||||||
|
"copy-webpack-plugin": "^4.5.2",
|
||||||
|
"css-loader": "^1.0.0",
|
||||||
"d3-array": "1.2.x",
|
"d3-array": "1.2.x",
|
||||||
"d3-axis": "1.0.x",
|
"d3-axis": "1.0.x",
|
||||||
"d3-collection": "1.0.x",
|
"d3-collection": "1.0.x",
|
||||||
@ -13,57 +21,70 @@
|
|||||||
"d3-selection": "1.3.x",
|
"d3-selection": "1.3.x",
|
||||||
"d3-time": "1.0.x",
|
"d3-time": "1.0.x",
|
||||||
"d3-time-format": "2.1.x",
|
"d3-time-format": "2.1.x",
|
||||||
|
"eslint": "5.2.0",
|
||||||
|
"eventemitter3": "^1.2.0",
|
||||||
|
"exports-loader": "^0.7.0",
|
||||||
"express": "^4.13.1",
|
"express": "^4.13.1",
|
||||||
"minimist": "^1.1.1",
|
"fast-sass-loader": "^1.4.5",
|
||||||
"painterro": "^0.2.65",
|
"file-loader": "^1.1.11",
|
||||||
"request": "^2.69.0",
|
"file-saver": "^1.3.8",
|
||||||
"vue": "^2.5.6"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"bower": "^1.7.7",
|
|
||||||
"git-rev-sync": "^1.4.0",
|
"git-rev-sync": "^1.4.0",
|
||||||
"glob": ">= 3.0.0",
|
"glob": ">= 3.0.0",
|
||||||
"gulp": "^3.9.1",
|
"html-loader": "^0.5.5",
|
||||||
"gulp-jscs": "^3.0.2",
|
|
||||||
"gulp-jshint": "^2.0.0",
|
|
||||||
"gulp-jshint-html-reporter": "^0.1.3",
|
|
||||||
"gulp-rename": "^1.2.2",
|
|
||||||
"gulp-requirejs-optimize": "^0.3.1",
|
|
||||||
"gulp-sass": "^3.1.0",
|
|
||||||
"gulp-sourcemaps": "^1.6.0",
|
|
||||||
"html2canvas": "^1.0.0-alpha.12",
|
"html2canvas": "^1.0.0-alpha.12",
|
||||||
|
"imports-loader": "^0.8.0",
|
||||||
|
"istanbul-instrumenter-loader": "^3.0.1",
|
||||||
"jasmine-core": "^3.1.0",
|
"jasmine-core": "^3.1.0",
|
||||||
"jscs-html-reporter": "^0.1.0",
|
|
||||||
"jsdoc": "^3.3.2",
|
"jsdoc": "^3.3.2",
|
||||||
"jshint": "^2.7.0",
|
|
||||||
"karma": "^2.0.3",
|
"karma": "^2.0.3",
|
||||||
"karma-chrome-launcher": "^2.2.0",
|
"karma-chrome-launcher": "^2.2.0",
|
||||||
"karma-cli": "^1.0.1",
|
"karma-cli": "^1.0.1",
|
||||||
"karma-coverage": "^1.1.2",
|
"karma-coverage": "^1.1.2",
|
||||||
"karma-html-reporter": "^0.2.7",
|
"karma-html-reporter": "^0.2.7",
|
||||||
"karma-jasmine": "^1.1.2",
|
"karma-jasmine": "^1.1.2",
|
||||||
"karma-requirejs": "^1.1.0",
|
"karma-webpack": "^3.0.0",
|
||||||
|
"location-bar": "^3.0.1",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
"markdown-toc": "^0.11.7",
|
"markdown-toc": "^0.11.7",
|
||||||
"marked": "^0.3.5",
|
"marked": "^0.3.5",
|
||||||
"merge-stream": "^1.0.0",
|
"mini-css-extract-plugin": "^0.4.1",
|
||||||
"mkdirp": "^0.5.1",
|
"minimist": "^1.1.1",
|
||||||
"moment": "^2.11.1",
|
"moment": "^2.11.1",
|
||||||
|
"moment-duration-format": "^2.2.2",
|
||||||
|
"moment-timezone": "^0.5.21",
|
||||||
"node-bourbon": "^4.2.3",
|
"node-bourbon": "^4.2.3",
|
||||||
|
"node-sass": "^4.9.2",
|
||||||
|
"painterro": "^0.2.65",
|
||||||
"printj": "^1.1.0",
|
"printj": "^1.1.0",
|
||||||
"requirejs": "2.1.x",
|
"raw-loader": "^0.5.1",
|
||||||
|
"request": "^2.69.0",
|
||||||
|
"screenfull": "^3.3.2",
|
||||||
"split": "^1.0.0",
|
"split": "^1.0.0",
|
||||||
"v8-compile-cache": "^1.1.0"
|
"style-loader": "^0.21.0",
|
||||||
|
"v8-compile-cache": "^1.1.0",
|
||||||
|
"vue": "2.5.6",
|
||||||
|
"vue-loader": "^15.2.6",
|
||||||
|
"vue-template-compiler": "2.5.6",
|
||||||
|
"webpack": "^4.16.2",
|
||||||
|
"webpack-cli": "^3.1.0",
|
||||||
|
"webpack-dev-middleware": "^3.1.3",
|
||||||
|
"webpack-hot-middleware": "^2.22.3",
|
||||||
|
"zepto": "^1.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
|
"lint": "eslint platform src openmct.js",
|
||||||
|
"lint:fix": "eslint platform src openmct.js --fix",
|
||||||
|
"build:prod": "NODE_ENV=production webpack",
|
||||||
|
"build:dev": "webpack",
|
||||||
|
"build:watch": "webpack --watch",
|
||||||
"test": "karma start --single-run",
|
"test": "karma start --single-run",
|
||||||
"jshint": "jshint platform example",
|
"test:watch": "karma start --no-single-run",
|
||||||
"watch": "karma start",
|
"verify": "concurrently 'npm:test' 'npm:lint'",
|
||||||
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
||||||
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
||||||
"docs": "npm run jsdoc ; npm run otherdoc",
|
"docs": "npm run jsdoc ; npm run otherdoc",
|
||||||
"prepare": "node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install"
|
"prepare": "npm run build:prod"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -21,17 +21,17 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
"text!./res/templates/about-dialog.html",
|
"./res/templates/about-dialog.html",
|
||||||
"./src/LogoController",
|
"./src/LogoController",
|
||||||
"./src/AboutController",
|
"./src/AboutController",
|
||||||
"./src/LicenseController",
|
"./src/LicenseController",
|
||||||
"text!./res/templates/app-logo.html",
|
"./res/templates/app-logo.html",
|
||||||
"text!./res/templates/about-logo.html",
|
"./res/templates/about-logo.html",
|
||||||
"text!./res/templates/overlay-about.html",
|
"./res/templates/overlay-about.html",
|
||||||
"text!./res/templates/license-apache.html",
|
"./res/templates/license-apache.html",
|
||||||
"text!./res/templates/license-mit.html",
|
"./res/templates/license-mit.html",
|
||||||
"text!./res/templates/licenses.html",
|
"./res/templates/licenses.html",
|
||||||
"text!./res/templates/licenses-export-md.html",
|
"./res/templates/licenses-export-md.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
aboutDialogTemplate,
|
aboutDialogTemplate,
|
||||||
|
@ -33,16 +33,16 @@ define([
|
|||||||
"./src/windowing/NewTabAction",
|
"./src/windowing/NewTabAction",
|
||||||
"./src/windowing/FullscreenAction",
|
"./src/windowing/FullscreenAction",
|
||||||
"./src/windowing/WindowTitler",
|
"./src/windowing/WindowTitler",
|
||||||
"text!./res/templates/browse.html",
|
"./res/templates/browse.html",
|
||||||
"text!./res/templates/browse-object.html",
|
"./res/templates/browse-object.html",
|
||||||
"text!./res/templates/items/grid-item.html",
|
"./res/templates/items/grid-item.html",
|
||||||
"text!./res/templates/browse/object-header.html",
|
"./res/templates/browse/object-header.html",
|
||||||
"text!./res/templates/browse/object-header-frame.html",
|
"./res/templates/browse/object-header-frame.html",
|
||||||
"text!./res/templates/menu-arrow.html",
|
"./res/templates/menu-arrow.html",
|
||||||
"text!./res/templates/back-arrow.html",
|
"./res/templates/back-arrow.html",
|
||||||
"text!./res/templates/items/items.html",
|
"./res/templates/items/items.html",
|
||||||
"text!./res/templates/browse/object-properties.html",
|
"./res/templates/browse/object-properties.html",
|
||||||
"text!./res/templates/browse/inspector-region.html",
|
"./res/templates/browse/inspector-region.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
BrowseController,
|
BrowseController,
|
||||||
@ -73,15 +73,6 @@ define([
|
|||||||
legacyRegistry.register("platform/commonUI/browse", {
|
legacyRegistry.register("platform/commonUI/browse", {
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"routes": [
|
"routes": [
|
||||||
{
|
|
||||||
"when": "/browse/:ids*?",
|
|
||||||
"template": browseTemplate,
|
|
||||||
"reloadOnSearch": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"when": "",
|
|
||||||
"redirectTo": "/browse/"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"constants": [
|
"constants": [
|
||||||
{
|
{
|
||||||
@ -295,6 +286,20 @@ define([
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"templates": [
|
||||||
|
{
|
||||||
|
key: "browseRoot",
|
||||||
|
template: browseTemplate
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "browseObject",
|
||||||
|
template: browseObjectTemplate
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "inspectorRegion",
|
||||||
|
template: inspectorRegionTemplate
|
||||||
|
}
|
||||||
|
],
|
||||||
"licenses": [
|
"licenses": [
|
||||||
{
|
{
|
||||||
"name": "screenfull.js",
|
"name": "screenfull.js",
|
||||||
|
@ -66,5 +66,4 @@
|
|||||||
</mct-representation>
|
</mct-representation>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mct-include key="'conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include>
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,6 +47,7 @@ define(
|
|||||||
urlService,
|
urlService,
|
||||||
defaultPath
|
defaultPath
|
||||||
) {
|
) {
|
||||||
|
window.browseScope = $scope;
|
||||||
var initialPath = ($route.current.params.ids || defaultPath).split("/"),
|
var initialPath = ($route.current.params.ids || defaultPath).split("/"),
|
||||||
currentIds;
|
currentIds;
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ define(
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function BrowseObjectController($scope, $location, $route) {
|
function BrowseObjectController($scope, $location, $route) {
|
||||||
var navigatedObject;
|
|
||||||
function setViewForDomainObject(domainObject) {
|
function setViewForDomainObject(domainObject) {
|
||||||
|
|
||||||
var locationViewKey = $location.search().view;
|
var locationViewKey = $location.search().view;
|
||||||
@ -47,7 +46,6 @@ define(
|
|||||||
((domainObject && domainObject.useCapability('view')) || [])
|
((domainObject && domainObject.useCapability('view')) || [])
|
||||||
.forEach(selectViewIfMatching);
|
.forEach(selectViewIfMatching);
|
||||||
}
|
}
|
||||||
navigatedObject = domainObject;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateQueryParam(viewKey) {
|
function updateQueryParam(viewKey) {
|
||||||
|
@ -161,7 +161,7 @@ define(
|
|||||||
instantiateController();
|
instantiateController();
|
||||||
return waitsForNavigation().then(function () {
|
return waitsForNavigation().then(function () {
|
||||||
expect(mockNavigationService.setNavigation)
|
expect(mockNavigationService.setNavigation)
|
||||||
.toHaveBeenCalledWith(mockDefaultRootObject);
|
.toHaveBeenCalledWith(mockDefaultRootObject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ define(
|
|||||||
|
|
||||||
return waitsForNavigation().then(function () {
|
return waitsForNavigation().then(function () {
|
||||||
expect(mockNavigationService.setNavigation)
|
expect(mockNavigationService.setNavigation)
|
||||||
.toHaveBeenCalledWith(mockDefaultRootObject);
|
.toHaveBeenCalledWith(mockDefaultRootObject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ define(
|
|||||||
describe("The PaneController", function () {
|
describe("The PaneController", function () {
|
||||||
var mockScope,
|
var mockScope,
|
||||||
mockAgentService,
|
mockAgentService,
|
||||||
mockDomainObjects,
|
|
||||||
mockWindow,
|
mockWindow,
|
||||||
controller,
|
controller,
|
||||||
mockLocation,
|
mockLocation,
|
||||||
@ -47,17 +46,6 @@ define(
|
|||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockScope = jasmine.createSpyObj("$scope", ["$on"]);
|
mockScope = jasmine.createSpyObj("$scope", ["$on"]);
|
||||||
mockDomainObjects = ['a', 'b'].map(function (id) {
|
|
||||||
var mockDomainObject = jasmine.createSpyObj(
|
|
||||||
'domainObject-' + id,
|
|
||||||
['getId', 'getModel', 'getCapability']
|
|
||||||
);
|
|
||||||
|
|
||||||
mockDomainObject.getId.and.returnValue(id);
|
|
||||||
mockDomainObject.getModel.and.returnValue({});
|
|
||||||
|
|
||||||
return mockDomainObject;
|
|
||||||
});
|
|
||||||
mockAgentService = jasmine.createSpyObj(
|
mockAgentService = jasmine.createSpyObj(
|
||||||
"agentService",
|
"agentService",
|
||||||
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
|
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
|
||||||
|
@ -56,7 +56,7 @@ define([
|
|||||||
return action.perform()
|
return action.perform()
|
||||||
.then(function () {
|
.then(function () {
|
||||||
expect(mockNavigationService.setNavigation)
|
expect(mockNavigationService.setNavigation)
|
||||||
.toHaveBeenCalledWith(mockDomainObject, true);
|
.toHaveBeenCalledWith(mockDomainObject, true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ define(
|
|||||||
|
|
||||||
it("toggles fullscreen mode when performed", function () {
|
it("toggles fullscreen mode when performed", function () {
|
||||||
action.perform();
|
action.perform();
|
||||||
expect(window.screenfull.toggle).toHaveBeenCalled();
|
expect(screenfull.toggle).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("provides displayable metadata", function () {
|
it("provides displayable metadata", function () {
|
||||||
|
@ -46,7 +46,7 @@ define(
|
|||||||
// tree is opened in a new tab using the
|
// tree is opened in a new tab using the
|
||||||
// context menu
|
// context menu
|
||||||
mockContextSelected = jasmine.createSpyObj("context", ["selectedObject",
|
mockContextSelected = jasmine.createSpyObj("context", ["selectedObject",
|
||||||
"domainObject"]);
|
"domainObject"]);
|
||||||
|
|
||||||
// Mocks the urlService used to make the new tab's url from a
|
// Mocks the urlService used to make the new tab's url from a
|
||||||
// domainObject and mode
|
// domainObject and mode
|
||||||
@ -54,11 +54,11 @@ define(
|
|||||||
|
|
||||||
// Action done using the current context or mockContextCurrent
|
// Action done using the current context or mockContextCurrent
|
||||||
actionCurrent = new NewTabAction(mockUrlService, mockWindow,
|
actionCurrent = new NewTabAction(mockUrlService, mockWindow,
|
||||||
mockContextCurrent);
|
mockContextCurrent);
|
||||||
|
|
||||||
// Action done using the selected context or mockContextSelected
|
// Action done using the selected context or mockContextSelected
|
||||||
actionSelected = new NewTabAction(mockUrlService, mockWindow,
|
actionSelected = new NewTabAction(mockUrlService, mockWindow,
|
||||||
mockContextSelected);
|
mockContextSelected);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ define(
|
|||||||
mockRootScope,
|
mockRootScope,
|
||||||
mockDocument,
|
mockDocument,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
titler;
|
titler; // eslint-disable-line
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockNavigationService = jasmine.createSpyObj(
|
mockNavigationService = jasmine.createSpyObj(
|
||||||
|
@ -23,13 +23,13 @@
|
|||||||
define([
|
define([
|
||||||
"./src/DialogService",
|
"./src/DialogService",
|
||||||
"./src/OverlayService",
|
"./src/OverlayService",
|
||||||
"text!./res/templates/overlay-dialog.html",
|
"./res/templates/overlay-dialog.html",
|
||||||
"text!./res/templates/overlay-options.html",
|
"./res/templates/overlay-options.html",
|
||||||
"text!./res/templates/dialog.html",
|
"./res/templates/dialog.html",
|
||||||
"text!./res/templates/overlay-blocking-message.html",
|
"./res/templates/overlay-blocking-message.html",
|
||||||
"text!./res/templates/message.html",
|
"./res/templates/message.html",
|
||||||
"text!./res/templates/overlay-message-list.html",
|
"./res/templates/overlay-message-list.html",
|
||||||
"text!./res/templates/overlay.html",
|
"./res/templates/overlay.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
DialogService,
|
DialogService,
|
||||||
|
@ -59,8 +59,8 @@ define(
|
|||||||
["resolve", "reject"]
|
["resolve", "reject"]
|
||||||
);
|
);
|
||||||
mockDocument = jasmine.createSpyObj(
|
mockDocument = jasmine.createSpyObj(
|
||||||
"$document",
|
"$document",
|
||||||
["find"]
|
["find"]
|
||||||
);
|
);
|
||||||
mockBody = jasmine.createSpyObj('body', ['on', 'off']);
|
mockBody = jasmine.createSpyObj('body', ['on', 'off']);
|
||||||
mockDocument.find.and.returnValue(mockBody);
|
mockDocument.find.and.returnValue(mockBody);
|
||||||
|
@ -49,14 +49,14 @@ define([
|
|||||||
"./src/creation/CreateActionProvider",
|
"./src/creation/CreateActionProvider",
|
||||||
"./src/creation/AddActionProvider",
|
"./src/creation/AddActionProvider",
|
||||||
"./src/creation/CreationService",
|
"./src/creation/CreationService",
|
||||||
"text!./res/templates/create/locator.html",
|
"./res/templates/create/locator.html",
|
||||||
"text!./res/templates/create/create-button.html",
|
"./res/templates/create/create-button.html",
|
||||||
"text!./res/templates/create/create-menu.html",
|
"./res/templates/create/create-menu.html",
|
||||||
"text!./res/templates/library.html",
|
"./res/templates/library.html",
|
||||||
"text!./res/templates/edit-object.html",
|
"./res/templates/edit-object.html",
|
||||||
"text!./res/templates/edit-action-buttons.html",
|
"./res/templates/edit-action-buttons.html",
|
||||||
"text!./res/templates/elements.html",
|
"./res/templates/elements.html",
|
||||||
"text!./res/templates/topbar-edit.html",
|
"./res/templates/topbar-edit.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
EditActionController,
|
EditActionController,
|
||||||
@ -188,6 +188,7 @@ define([
|
|||||||
"name": "Remove",
|
"name": "Remove",
|
||||||
"description": "Remove this object from its containing object.",
|
"description": "Remove this object from its containing object.",
|
||||||
"depends": [
|
"depends": [
|
||||||
|
"dialogService",
|
||||||
"navigationService"
|
"navigationService"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -318,6 +319,12 @@ define([
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"templates": [
|
||||||
|
{
|
||||||
|
key: "elementsPool",
|
||||||
|
template: elementsTemplate
|
||||||
|
}
|
||||||
|
],
|
||||||
"components": [
|
"components": [
|
||||||
{
|
{
|
||||||
"type": "decorator",
|
"type": "decorator",
|
||||||
|
@ -23,111 +23,119 @@
|
|||||||
/**
|
/**
|
||||||
* Module defining RemoveAction. Created by vwoeltje on 11/17/14.
|
* Module defining RemoveAction. Created by vwoeltje on 11/17/14.
|
||||||
*/
|
*/
|
||||||
define(
|
define([
|
||||||
[],
|
'./RemoveDialog'
|
||||||
function () {
|
], function (
|
||||||
|
RemoveDialog
|
||||||
|
) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct an action which will remove the provided object manifestation.
|
* Construct an action which will remove the provided object manifestation.
|
||||||
* The object will be removed from its parent's composition; the parent
|
* The object will be removed from its parent's composition; the parent
|
||||||
* is looked up via the "context" capability (so this will be the
|
* is looked up via the "context" capability (so this will be the
|
||||||
* immediate ancestor by which this specific object was reached.)
|
* immediate ancestor by which this specific object was reached.)
|
||||||
*
|
*
|
||||||
* @param {DomainObject} object the object to be removed
|
* @param {DialogService} dialogService a service which will show the dialog
|
||||||
* @param {ActionContext} context the context in which this action is performed
|
* @param {NavigationService} navigationService a service that maintains the current navigation state
|
||||||
* @memberof platform/commonUI/edit
|
* @param {ActionContext} context the context in which this action is performed
|
||||||
* @constructor
|
* @memberof platform/commonUI/edit
|
||||||
* @implements {Action}
|
* @constructor
|
||||||
|
* @implements {Action}
|
||||||
|
*/
|
||||||
|
function RemoveAction(dialogService, navigationService, context) {
|
||||||
|
this.domainObject = (context || {}).domainObject;
|
||||||
|
this.dialogService = dialogService;
|
||||||
|
this.navigationService = navigationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform this action.
|
||||||
|
*/
|
||||||
|
RemoveAction.prototype.perform = function () {
|
||||||
|
var dialog,
|
||||||
|
dialogService = this.dialogService,
|
||||||
|
domainObject = this.domainObject,
|
||||||
|
navigationService = this.navigationService;
|
||||||
|
/*
|
||||||
|
* Check whether an object ID matches the ID of the object being
|
||||||
|
* removed (used to filter a parent's composition to handle the
|
||||||
|
* removal.)
|
||||||
*/
|
*/
|
||||||
function RemoveAction(navigationService, context) {
|
function isNotObject(otherObjectId) {
|
||||||
this.domainObject = (context || {}).domainObject;
|
return otherObjectId !== domainObject.getId();
|
||||||
this.navigationService = navigationService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Perform this action.
|
* Mutate a parent object such that it no longer contains the object
|
||||||
* @return {Promise} a promise which will be
|
* which is being removed.
|
||||||
* fulfilled when the action has completed.
|
|
||||||
*/
|
*/
|
||||||
RemoveAction.prototype.perform = function () {
|
function doMutate(model) {
|
||||||
var navigationService = this.navigationService,
|
model.composition = model.composition.filter(isNotObject);
|
||||||
domainObject = this.domainObject;
|
}
|
||||||
/*
|
|
||||||
* Check whether an object ID matches the ID of the object being
|
|
||||||
* removed (used to filter a parent's composition to handle the
|
|
||||||
* removal.)
|
|
||||||
*/
|
|
||||||
function isNotObject(otherObjectId) {
|
|
||||||
return otherObjectId !== domainObject.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mutate a parent object such that it no longer contains the object
|
* Checks current object and ascendants of current
|
||||||
* which is being removed.
|
* object with object being removed, if the current
|
||||||
*/
|
* object or any in the current object's path is being removed,
|
||||||
function doMutate(model) {
|
* navigate back to parent of removed object.
|
||||||
model.composition = model.composition.filter(isNotObject);
|
*/
|
||||||
}
|
function checkObjectNavigation(object, parentObject) {
|
||||||
|
// Traverse object starts at current location
|
||||||
|
var traverseObject = (navigationService).getNavigation(),
|
||||||
|
context;
|
||||||
|
|
||||||
/*
|
// Stop when object is not defined (above ROOT)
|
||||||
* Checks current object and ascendants of current
|
while (traverseObject) {
|
||||||
* object with object being removed, if the current
|
// If object currently traversed to is object being removed
|
||||||
* object or any in the current object's path is being removed,
|
// navigate to parent of current object and then exit loop
|
||||||
* navigate back to parent of removed object.
|
if (traverseObject.getId() === object.getId()) {
|
||||||
*/
|
navigationService.setNavigation(parentObject);
|
||||||
function checkObjectNavigation(object, parentObject) {
|
return;
|
||||||
// Traverse object starts at current location
|
|
||||||
var traverseObject = (navigationService).getNavigation(),
|
|
||||||
context;
|
|
||||||
|
|
||||||
// Stop when object is not defined (above ROOT)
|
|
||||||
while (traverseObject) {
|
|
||||||
// If object currently traversed to is object being removed
|
|
||||||
// navigate to parent of current object and then exit loop
|
|
||||||
if (traverseObject.getId() === object.getId()) {
|
|
||||||
navigationService.setNavigation(parentObject);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Traverses to parent of current object, moving
|
|
||||||
// up the ascendant path
|
|
||||||
context = traverseObject.getCapability('context');
|
|
||||||
traverseObject = context && context.getParent();
|
|
||||||
}
|
}
|
||||||
|
// Traverses to parent of current object, moving
|
||||||
|
// up the ascendant path
|
||||||
|
context = traverseObject.getCapability('context');
|
||||||
|
traverseObject = context && context.getParent();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove the object from its parent, as identified by its context
|
* Remove the object from its parent, as identified by its context
|
||||||
* capability. Based on object's location and selected object's location
|
* capability. Based on object's location and selected object's location
|
||||||
* user may be navigated to existing parent object
|
* user may be navigated to existing parent object
|
||||||
*/
|
*/
|
||||||
function removeFromContext(object) {
|
function removeFromContext(object) {
|
||||||
var contextCapability = object.getCapability('context'),
|
var contextCapability = object.getCapability('context'),
|
||||||
parent = contextCapability.getParent();
|
parent = contextCapability.getParent();
|
||||||
|
|
||||||
// If currently within path of removed object(s),
|
// If currently within path of removed object(s),
|
||||||
// navigates to existing object up tree
|
// navigates to existing object up tree
|
||||||
checkObjectNavigation(object, parent);
|
checkObjectNavigation(object, parent);
|
||||||
|
|
||||||
return parent.useCapability('mutation', doMutate);
|
return parent.useCapability('mutation', doMutate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return removeFromContext(domainObject);
|
/*
|
||||||
};
|
* Pass in the function to remove the domain object so it can be
|
||||||
|
* associated with an 'OK' button press
|
||||||
|
*/
|
||||||
|
dialog = new RemoveDialog(dialogService, domainObject, removeFromContext);
|
||||||
|
dialog.show();
|
||||||
|
};
|
||||||
|
|
||||||
// Object needs to have a parent for Remove to be applicable
|
// Object needs to have a parent for Remove to be applicable
|
||||||
RemoveAction.appliesTo = function (context) {
|
RemoveAction.appliesTo = function (context) {
|
||||||
var object = (context || {}).domainObject,
|
var object = (context || {}).domainObject,
|
||||||
contextCapability = object && object.getCapability("context"),
|
contextCapability = object && object.getCapability("context"),
|
||||||
parent = contextCapability && contextCapability.getParent(),
|
parent = contextCapability && contextCapability.getParent(),
|
||||||
parentType = parent && parent.getCapability('type'),
|
parentType = parent && parent.getCapability('type'),
|
||||||
parentCreatable = parentType && parentType.hasFeature('creation');
|
parentCreatable = parentType && parentType.hasFeature('creation');
|
||||||
|
|
||||||
// Only creatable types should be modifiable
|
// Only creatable types should be modifiable
|
||||||
return parent !== undefined &&
|
return parent !== undefined &&
|
||||||
Array.isArray(parent.getModel().composition) &&
|
Array.isArray(parent.getModel().composition) &&
|
||||||
parentCreatable;
|
parentCreatable;
|
||||||
};
|
};
|
||||||
|
|
||||||
return RemoveAction;
|
return RemoveAction;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
77
platform/commonUI/edit/src/actions/RemoveDialog.js
Normal file
77
platform/commonUI/edit/src/actions/RemoveDialog.js
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2017, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
* Open MCT includes source code licensed under additional open source
|
||||||
|
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
|
* this source code distribution or the Licensing information page available
|
||||||
|
* at runtime from the About dialog for additional information.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
define([], function () {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @callback removeCallback
|
||||||
|
* @param {DomainObject} domainObject the domain object to be removed
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new Remove dialog.
|
||||||
|
*
|
||||||
|
* @param {DialogService} dialogService the service that shows the dialog
|
||||||
|
* @param {DomainObject} domainObject the domain object to be removed
|
||||||
|
* @param {removeCallback} removeCallback callback that handles removal of the domain object
|
||||||
|
* @memberof platform/commonUI/edit
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function RemoveDialog(dialogService, domainObject, removeCallback) {
|
||||||
|
this.dialogService = dialogService;
|
||||||
|
this.domainObject = domainObject;
|
||||||
|
this.removeCallback = removeCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a dialog to confirm the removal of a domain object.
|
||||||
|
*/
|
||||||
|
RemoveDialog.prototype.show = function () {
|
||||||
|
var dialog,
|
||||||
|
domainObject = this.domainObject,
|
||||||
|
removeCallback = this.removeCallback,
|
||||||
|
model = {
|
||||||
|
title: 'Remove ' + domainObject.getModel().name,
|
||||||
|
actionText: 'Warning! This action will permanently remove this object. Are you sure you want to continue?',
|
||||||
|
severity: 'alert',
|
||||||
|
primaryOption: {
|
||||||
|
label: 'OK',
|
||||||
|
callback: function () {
|
||||||
|
removeCallback(domainObject);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'Cancel',
|
||||||
|
callback: function () {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
dialog = this.dialogService.showBlockingMessage(model);
|
||||||
|
};
|
||||||
|
|
||||||
|
return RemoveDialog;
|
||||||
|
});
|
@ -25,12 +25,12 @@ define([
|
|||||||
'../creation/CreateWizard',
|
'../creation/CreateWizard',
|
||||||
'./SaveInProgressDialog'
|
'./SaveInProgressDialog'
|
||||||
],
|
],
|
||||||
function (
|
function (
|
||||||
CreateWizard,
|
CreateWizard,
|
||||||
SaveInProgressDialog
|
SaveInProgressDialog
|
||||||
) {
|
) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The "Save" action; the action triggered by clicking Save from
|
* The "Save" action; the action triggered by clicking Save from
|
||||||
* Edit Mode. Exits the editing user interface and invokes object
|
* Edit Mode. Exits the editing user interface and invokes object
|
||||||
* capabilities to persist the changes that have been made.
|
* capabilities to persist the changes that have been made.
|
||||||
@ -38,189 +38,189 @@ define([
|
|||||||
* @implements {Action}
|
* @implements {Action}
|
||||||
* @memberof platform/commonUI/edit
|
* @memberof platform/commonUI/edit
|
||||||
*/
|
*/
|
||||||
function SaveAsAction(
|
function SaveAsAction(
|
||||||
$injector,
|
$injector,
|
||||||
policyService,
|
policyService,
|
||||||
dialogService,
|
dialogService,
|
||||||
copyService,
|
copyService,
|
||||||
notificationService,
|
notificationService,
|
||||||
context
|
context
|
||||||
) {
|
) {
|
||||||
this.domainObject = (context || {}).domainObject;
|
this.domainObject = (context || {}).domainObject;
|
||||||
this.injectObjectService = function () {
|
this.injectObjectService = function () {
|
||||||
this.objectService = $injector.get("objectService");
|
this.objectService = $injector.get("objectService");
|
||||||
};
|
};
|
||||||
this.policyService = policyService;
|
this.policyService = policyService;
|
||||||
this.dialogService = dialogService;
|
this.dialogService = dialogService;
|
||||||
this.copyService = copyService;
|
this.copyService = copyService;
|
||||||
this.notificationService = notificationService;
|
this.notificationService = notificationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
SaveAsAction.prototype.createWizard = function (parent) {
|
SaveAsAction.prototype.createWizard = function (parent) {
|
||||||
return new CreateWizard(
|
return new CreateWizard(
|
||||||
this.domainObject,
|
this.domainObject,
|
||||||
parent,
|
parent,
|
||||||
this.policyService
|
this.policyService
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
SaveAsAction.prototype.getObjectService = function () {
|
SaveAsAction.prototype.getObjectService = function () {
|
||||||
// Lazily acquire object service (avoids cyclical dependency)
|
// Lazily acquire object service (avoids cyclical dependency)
|
||||||
if (!this.objectService) {
|
if (!this.objectService) {
|
||||||
this.injectObjectService();
|
this.injectObjectService();
|
||||||
}
|
|
||||||
return this.objectService;
|
|
||||||
};
|
|
||||||
|
|
||||||
function resolveWith(object) {
|
|
||||||
return function () {
|
|
||||||
return object;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
return this.objectService;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
function resolveWith(object) {
|
||||||
|
return function () {
|
||||||
|
return object;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Save changes and conclude editing.
|
* Save changes and conclude editing.
|
||||||
*
|
*
|
||||||
* @returns {Promise} a promise that will be fulfilled when
|
* @returns {Promise} a promise that will be fulfilled when
|
||||||
* cancellation has completed
|
* cancellation has completed
|
||||||
* @memberof platform/commonUI/edit.SaveAction#
|
* @memberof platform/commonUI/edit.SaveAction#
|
||||||
*/
|
*/
|
||||||
SaveAsAction.prototype.perform = function () {
|
SaveAsAction.prototype.perform = function () {
|
||||||
// Discard the current root view (which will be the editing
|
// Discard the current root view (which will be the editing
|
||||||
// UI, which will have been pushed atop the Browse UI.)
|
// UI, which will have been pushed atop the Browse UI.)
|
||||||
function returnToBrowse(object) {
|
function returnToBrowse(object) {
|
||||||
if (object) {
|
if (object) {
|
||||||
object.getCapability("action").perform("navigate");
|
object.getCapability("action").perform("navigate");
|
||||||
}
|
|
||||||
return object;
|
|
||||||
}
|
}
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
return this.save().then(returnToBrowse);
|
return this.save().then(returnToBrowse);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
SaveAsAction.prototype.save = function () {
|
SaveAsAction.prototype.save = function () {
|
||||||
var self = this,
|
var self = this,
|
||||||
domainObject = this.domainObject,
|
domainObject = this.domainObject,
|
||||||
copyService = this.copyService,
|
copyService = this.copyService,
|
||||||
dialog = new SaveInProgressDialog(this.dialogService),
|
dialog = new SaveInProgressDialog(this.dialogService),
|
||||||
toUndirty = [];
|
toUndirty = [];
|
||||||
|
|
||||||
function doWizardSave(parent) {
|
function doWizardSave(parent) {
|
||||||
var wizard = self.createWizard(parent);
|
var wizard = self.createWizard(parent);
|
||||||
|
|
||||||
return self.dialogService
|
return self.dialogService
|
||||||
.getUserInput(wizard.getFormStructure(true),
|
.getUserInput(wizard.getFormStructure(true),
|
||||||
wizard.getInitialFormValue())
|
wizard.getInitialFormValue())
|
||||||
.then(wizard.populateObjectFromInput.bind(wizard), function (failureReason) {
|
.then(wizard.populateObjectFromInput.bind(wizard), function (failureReason) {
|
||||||
return Promise.reject("user canceled");
|
return Promise.reject("user canceled");
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function showBlockingDialog(object) {
|
|
||||||
dialog.show();
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideBlockingDialog(object) {
|
|
||||||
dialog.hide();
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
function fetchObject(objectId) {
|
|
||||||
return self.getObjectService().getObjects([objectId]).then(function (objects) {
|
|
||||||
return objects[objectId];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParent(object) {
|
function showBlockingDialog(object) {
|
||||||
return fetchObject(object.getModel().location);
|
dialog.show();
|
||||||
}
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
function allowClone(objectToClone) {
|
function hideBlockingDialog(object) {
|
||||||
var allowed =
|
dialog.hide();
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchObject(objectId) {
|
||||||
|
return self.getObjectService().getObjects([objectId]).then(function (objects) {
|
||||||
|
return objects[objectId];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getParent(object) {
|
||||||
|
return fetchObject(object.getModel().location);
|
||||||
|
}
|
||||||
|
|
||||||
|
function allowClone(objectToClone) {
|
||||||
|
var allowed =
|
||||||
(objectToClone.getId() === domainObject.getId()) ||
|
(objectToClone.getId() === domainObject.getId()) ||
|
||||||
objectToClone.getCapability('location').isOriginal();
|
objectToClone.getCapability('location').isOriginal();
|
||||||
if (allowed) {
|
if (allowed) {
|
||||||
toUndirty.push(objectToClone);
|
toUndirty.push(objectToClone);
|
||||||
}
|
|
||||||
return allowed;
|
|
||||||
}
|
}
|
||||||
|
return allowed;
|
||||||
|
}
|
||||||
|
|
||||||
function cloneIntoParent(parent) {
|
function cloneIntoParent(parent) {
|
||||||
return copyService.perform(domainObject, parent, allowClone);
|
return copyService.perform(domainObject, parent, allowClone);
|
||||||
|
}
|
||||||
|
|
||||||
|
function undirty(object) {
|
||||||
|
return object.getCapability('persistence').refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
function undirtyOriginals(object) {
|
||||||
|
return Promise.all(toUndirty.map(undirty))
|
||||||
|
.then(resolveWith(object));
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveAfterClone(clonedObject) {
|
||||||
|
return domainObject.getCapability("editor").save()
|
||||||
|
.then(resolveWith(clonedObject));
|
||||||
|
}
|
||||||
|
|
||||||
|
function finishEditing(clonedObject) {
|
||||||
|
return domainObject.getCapability("editor").finish()
|
||||||
|
.then(function () {
|
||||||
|
return fetchObject(clonedObject.getId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSuccess(object) {
|
||||||
|
self.notificationService.info("Save Succeeded");
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onFailure(reason) {
|
||||||
|
hideBlockingDialog();
|
||||||
|
if (reason !== "user canceled") {
|
||||||
|
self.notificationService.error("Save Failed");
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function undirty(object) {
|
return getParent(domainObject)
|
||||||
return object.getCapability('persistence').refresh();
|
.then(doWizardSave)
|
||||||
}
|
.then(showBlockingDialog)
|
||||||
|
.then(getParent)
|
||||||
function undirtyOriginals(object) {
|
.then(cloneIntoParent)
|
||||||
return Promise.all(toUndirty.map(undirty))
|
.then(undirtyOriginals)
|
||||||
.then(resolveWith(object));
|
.then(saveAfterClone)
|
||||||
}
|
.then(finishEditing)
|
||||||
|
.then(hideBlockingDialog)
|
||||||
function saveAfterClone(clonedObject) {
|
.then(onSuccess)
|
||||||
return domainObject.getCapability("editor").save()
|
.catch(onFailure);
|
||||||
.then(resolveWith(clonedObject));
|
};
|
||||||
}
|
|
||||||
|
|
||||||
function finishEditing(clonedObject) {
|
|
||||||
return domainObject.getCapability("editor").finish()
|
|
||||||
.then(function () {
|
|
||||||
return fetchObject(clonedObject.getId());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSuccess(object) {
|
|
||||||
self.notificationService.info("Save Succeeded");
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onFailure(reason) {
|
|
||||||
hideBlockingDialog();
|
|
||||||
if (reason !== "user canceled") {
|
|
||||||
self.notificationService.error("Save Failed");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getParent(domainObject)
|
|
||||||
.then(doWizardSave)
|
|
||||||
.then(showBlockingDialog)
|
|
||||||
.then(getParent)
|
|
||||||
.then(cloneIntoParent)
|
|
||||||
.then(undirtyOriginals)
|
|
||||||
.then(saveAfterClone)
|
|
||||||
.then(finishEditing)
|
|
||||||
.then(hideBlockingDialog)
|
|
||||||
.then(onSuccess)
|
|
||||||
.catch(onFailure);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if this action is applicable in a given context.
|
* Check if this action is applicable in a given context.
|
||||||
* This will ensure that a domain object is present in the context,
|
* This will ensure that a domain object is present in the context,
|
||||||
* and that this domain object is in Edit mode.
|
* and that this domain object is in Edit mode.
|
||||||
* @returns true if applicable
|
* @returns true if applicable
|
||||||
*/
|
*/
|
||||||
SaveAsAction.appliesTo = function (context) {
|
SaveAsAction.appliesTo = function (context) {
|
||||||
var domainObject = (context || {}).domainObject;
|
var domainObject = (context || {}).domainObject;
|
||||||
return domainObject !== undefined &&
|
return domainObject !== undefined &&
|
||||||
domainObject.hasCapability('editor') &&
|
domainObject.hasCapability('editor') &&
|
||||||
domainObject.getCapability('editor').isEditContextRoot() &&
|
domainObject.getCapability('editor').isEditContextRoot() &&
|
||||||
domainObject.getModel().persisted === undefined;
|
domainObject.getModel().persisted === undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
return SaveAsAction;
|
return SaveAsAction;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -49,8 +49,8 @@ define(
|
|||||||
// present context.
|
// present context.
|
||||||
function updateActions() {
|
function updateActions() {
|
||||||
$scope.saveActions = $scope.action ?
|
$scope.saveActions = $scope.action ?
|
||||||
$scope.action.getActions(SAVE_ACTION_CONTEXT) :
|
$scope.action.getActions(SAVE_ACTION_CONTEXT) :
|
||||||
[];
|
[];
|
||||||
|
|
||||||
$scope.saveActionsAsMenuOptions = $scope.saveActions.map(actionToMenuOption);
|
$scope.saveActionsAsMenuOptions = $scope.saveActions.map(actionToMenuOption);
|
||||||
|
|
||||||
@ -59,8 +59,8 @@ define(
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.otherEditActions = $scope.action ?
|
$scope.otherEditActions = $scope.action ?
|
||||||
$scope.action.getActions(OTHERS_ACTION_CONTEXT) :
|
$scope.action.getActions(OTHERS_ACTION_CONTEXT) :
|
||||||
[];
|
[];
|
||||||
|
|
||||||
// Required because Angular does not allow 'bind'
|
// Required because Angular does not allow 'bind'
|
||||||
// in expressions.
|
// in expressions.
|
||||||
|
@ -49,7 +49,7 @@ define(
|
|||||||
function searchElements(value) {
|
function searchElements(value) {
|
||||||
if ($scope.searchText) {
|
if ($scope.searchText) {
|
||||||
return value.getModel().name.toLowerCase().search(
|
return value.getModel().name.toLowerCase().search(
|
||||||
$scope.searchText.toLowerCase()) !== -1;
|
$scope.searchText.toLowerCase()) !== -1;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ define(
|
|||||||
// Update the set of Create actions
|
// Update the set of Create actions
|
||||||
function refreshActions() {
|
function refreshActions() {
|
||||||
$scope.createActions = $scope.action ?
|
$scope.createActions = $scope.action ?
|
||||||
$scope.action.getActions('create') :
|
$scope.action.getActions('create') :
|
||||||
[];
|
[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listen for new instances of the represented object's
|
// Listen for new instances of the represented object's
|
||||||
|
@ -55,15 +55,23 @@ define(
|
|||||||
|
|
||||||
// A view is editable unless explicitly flagged as not
|
// A view is editable unless explicitly flagged as not
|
||||||
(views || []).forEach(function (view) {
|
(views || []).forEach(function (view) {
|
||||||
if (view.editable === true ||
|
if (isEditable(view) ||
|
||||||
(view.key === 'plot' && type.getKey() === 'telemetry.panel') ||
|
(view.key === 'plot' && type.getKey() === 'telemetry.panel') ||
|
||||||
(view.key === 'table' && type.getKey() === 'table') ||
|
(view.key === 'table' && type.getKey() === 'table') ||
|
||||||
(view.key === 'rt-table' && type.getKey() === 'rttable')
|
(view.key === 'rt-table' && type.getKey() === 'rttable')
|
||||||
) {
|
) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isEditable(view) {
|
||||||
|
if (typeof view.editable === Function) {
|
||||||
|
return view.editable(domainObject.useCapability('adapter'));
|
||||||
|
} else {
|
||||||
|
return view.editable === true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,16 +55,16 @@ define(
|
|||||||
navigatedObject = this.navigationService.getNavigation(),
|
navigatedObject = this.navigationService.getNavigation(),
|
||||||
actionMetadata = action.getMetadata ? action.getMetadata() : {};
|
actionMetadata = action.getMetadata ? action.getMetadata() : {};
|
||||||
|
|
||||||
if (navigatedObject.hasCapability("editor") && navigatedObject.getCapability("editor").isEditContextRoot()) {
|
// if (navigatedObject.hasCapability("editor") && navigatedObject.getCapability("editor").isEditContextRoot()) {
|
||||||
if (selectedObject.hasCapability("editor") && selectedObject.getCapability("editor").inEditContext()) {
|
if (selectedObject.hasCapability("editor") && selectedObject.getCapability("editor").inEditContext()) {
|
||||||
return this.editModeBlacklist.indexOf(actionMetadata.key) === -1;
|
return this.editModeBlacklist.indexOf(actionMetadata.key) === -1;
|
||||||
} else {
|
} else {
|
||||||
//Target is in the context menu
|
//Target is in the context menu
|
||||||
return this.nonEditContextBlacklist.indexOf(actionMetadata.key) === -1;
|
return this.nonEditContextBlacklist.indexOf(actionMetadata.key) === -1;
|
||||||
}
|
}
|
||||||
} else {
|
// } else {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
return EditContextualActionPolicy;
|
return EditContextualActionPolicy;
|
||||||
|
@ -25,8 +25,7 @@ define(
|
|||||||
function (EditAndComposeAction) {
|
function (EditAndComposeAction) {
|
||||||
|
|
||||||
describe("The Link action", function () {
|
describe("The Link action", function () {
|
||||||
var mockQ,
|
var mockDomainObject,
|
||||||
mockDomainObject,
|
|
||||||
mockParent,
|
mockParent,
|
||||||
mockContext,
|
mockContext,
|
||||||
mockComposition,
|
mockComposition,
|
||||||
@ -47,13 +46,10 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
|
||||||
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
"domainObject",
|
"domainObject",
|
||||||
["getId", "getCapability"]
|
["getId", "getCapability"]
|
||||||
);
|
);
|
||||||
mockQ = { when: mockPromise };
|
|
||||||
mockParent = {
|
mockParent = {
|
||||||
getModel: function () {
|
getModel: function () {
|
||||||
return model;
|
return model;
|
||||||
|
@ -25,50 +25,37 @@ define(
|
|||||||
function (RemoveAction) {
|
function (RemoveAction) {
|
||||||
|
|
||||||
describe("The Remove action", function () {
|
describe("The Remove action", function () {
|
||||||
var mockQ,
|
var action,
|
||||||
mockNavigationService,
|
|
||||||
mockDomainObject,
|
|
||||||
mockParent,
|
|
||||||
mockChildObject,
|
|
||||||
mockGrandchildObject,
|
|
||||||
mockRootObject,
|
|
||||||
mockContext,
|
|
||||||
mockChildContext,
|
|
||||||
mockGrandchildContext,
|
|
||||||
mockRootContext,
|
|
||||||
mockMutation,
|
|
||||||
mockType,
|
|
||||||
actionContext,
|
actionContext,
|
||||||
model,
|
|
||||||
capabilities,
|
capabilities,
|
||||||
action;
|
mockContext,
|
||||||
|
mockDialogService,
|
||||||
function mockPromise(value) {
|
mockDomainObject,
|
||||||
return {
|
mockMutation,
|
||||||
then: function (callback) {
|
mockNavigationService,
|
||||||
return mockPromise(callback(value));
|
mockParent,
|
||||||
}
|
mockType,
|
||||||
};
|
model;
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
"domainObject",
|
"domainObject",
|
||||||
["getId", "getCapability"]
|
["getId", "getCapability", "getModel"]
|
||||||
);
|
);
|
||||||
mockChildObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
mockMutation = jasmine.createSpyObj("mutation", ["invoke"]);
|
||||||
["getId", "getCapability"]
|
mockType = jasmine.createSpyObj("type", ["hasFeature"]);
|
||||||
);
|
mockType.hasFeature.and.returnValue(true);
|
||||||
mockGrandchildObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
capabilities = {
|
||||||
["getId", "getCapability"]
|
mutation: mockMutation,
|
||||||
);
|
type: mockType
|
||||||
mockRootObject = jasmine.createSpyObj(
|
};
|
||||||
"domainObject",
|
|
||||||
["getId", "getCapability"]
|
model = {
|
||||||
);
|
composition: ["a", "test", "b"]
|
||||||
mockQ = { when: mockPromise };
|
};
|
||||||
|
|
||||||
mockParent = {
|
mockParent = {
|
||||||
getModel: function () {
|
getModel: function () {
|
||||||
return model;
|
return model;
|
||||||
@ -80,12 +67,12 @@ define(
|
|||||||
return capabilities[k].invoke(v);
|
return capabilities[k].invoke(v);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mockContext = jasmine.createSpyObj("context", ["getParent"]);
|
|
||||||
mockChildContext = jasmine.createSpyObj("context", ["getParent"]);
|
mockDialogService = jasmine.createSpyObj(
|
||||||
mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]);
|
"dialogService",
|
||||||
mockRootContext = jasmine.createSpyObj("context", ["getParent"]);
|
["showBlockingMessage"]
|
||||||
mockMutation = jasmine.createSpyObj("mutation", ["invoke"]);
|
);
|
||||||
mockType = jasmine.createSpyObj("type", ["hasFeature"]);
|
|
||||||
mockNavigationService = jasmine.createSpyObj(
|
mockNavigationService = jasmine.createSpyObj(
|
||||||
"navigationService",
|
"navigationService",
|
||||||
[
|
[
|
||||||
@ -97,23 +84,19 @@ define(
|
|||||||
);
|
);
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockDomainObject);
|
mockNavigationService.getNavigation.and.returnValue(mockDomainObject);
|
||||||
|
|
||||||
|
mockContext = jasmine.createSpyObj("context", ["getParent"]);
|
||||||
|
mockContext.getParent.and.returnValue(mockParent);
|
||||||
|
|
||||||
mockDomainObject.getId.and.returnValue("test");
|
mockDomainObject.getId.and.returnValue("test");
|
||||||
mockDomainObject.getCapability.and.returnValue(mockContext);
|
mockDomainObject.getCapability.and.returnValue(mockContext);
|
||||||
|
mockDomainObject.getModel.and.returnValue({name: 'test object'});
|
||||||
|
|
||||||
mockContext.getParent.and.returnValue(mockParent);
|
mockContext.getParent.and.returnValue(mockParent);
|
||||||
mockType.hasFeature.and.returnValue(true);
|
mockType.hasFeature.and.returnValue(true);
|
||||||
|
|
||||||
capabilities = {
|
|
||||||
mutation: mockMutation,
|
|
||||||
type: mockType
|
|
||||||
};
|
|
||||||
model = {
|
|
||||||
composition: ["a", "test", "b"]
|
|
||||||
};
|
|
||||||
|
|
||||||
actionContext = { domainObject: mockDomainObject };
|
actionContext = { domainObject: mockDomainObject };
|
||||||
|
|
||||||
action = new RemoveAction(mockNavigationService, actionContext);
|
action = new RemoveAction(mockDialogService, mockNavigationService, actionContext);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("only applies to objects with parents", function () {
|
it("only applies to objects with parents", function () {
|
||||||
@ -127,83 +110,146 @@ define(
|
|||||||
expect(mockType.hasFeature).toHaveBeenCalledWith('creation');
|
expect(mockType.hasFeature).toHaveBeenCalledWith('creation');
|
||||||
});
|
});
|
||||||
|
|
||||||
it("mutates the parent when performed", function () {
|
it("shows a blocking message dialog", function () {
|
||||||
action.perform();
|
mockParent = jasmine.createSpyObj(
|
||||||
expect(mockMutation.invoke)
|
"parent",
|
||||||
.toHaveBeenCalledWith(jasmine.any(Function));
|
["getModel", "getCapability", "useCapability"]
|
||||||
});
|
);
|
||||||
|
|
||||||
it("changes composition from its mutation function", function () {
|
|
||||||
var mutator, result;
|
|
||||||
action.perform();
|
|
||||||
mutator = mockMutation.invoke.calls.mostRecent().args[0];
|
|
||||||
result = mutator(model);
|
|
||||||
|
|
||||||
// Should not have cancelled the mutation
|
|
||||||
expect(result).not.toBe(false);
|
|
||||||
|
|
||||||
// Simulate mutate's behavior (remove can either return a
|
|
||||||
// new model or modify this one in-place)
|
|
||||||
result = result || model;
|
|
||||||
|
|
||||||
// Should have removed "test" - that was our
|
|
||||||
// mock domain object's id.
|
|
||||||
expect(result.composition).toEqual(["a", "b"]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("removes parent of object currently navigated to", function () {
|
|
||||||
// Navigates to child object
|
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockChildObject);
|
|
||||||
|
|
||||||
// Test is id of object being removed
|
|
||||||
// Child object has different id
|
|
||||||
mockDomainObject.getId.and.returnValue("test");
|
|
||||||
mockChildObject.getId.and.returnValue("not test");
|
|
||||||
|
|
||||||
// Sets context for the child and domainObject
|
|
||||||
mockDomainObject.getCapability.and.returnValue(mockContext);
|
|
||||||
mockChildObject.getCapability.and.returnValue(mockChildContext);
|
|
||||||
|
|
||||||
// Parents of child and domainObject are set
|
|
||||||
mockContext.getParent.and.returnValue(mockParent);
|
|
||||||
mockChildContext.getParent.and.returnValue(mockDomainObject);
|
|
||||||
|
|
||||||
mockType.hasFeature.and.returnValue(true);
|
|
||||||
|
|
||||||
action.perform();
|
action.perform();
|
||||||
|
|
||||||
// Expects navigation to parent of domainObject (removed object)
|
expect(mockDialogService.showBlockingMessage).toHaveBeenCalled();
|
||||||
expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent);
|
|
||||||
|
// Also check that no mutation happens at this point
|
||||||
|
expect(mockParent.useCapability).not.toHaveBeenCalledWith("mutation", jasmine.any(Function));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("checks if removing object not in ascendent path (reaches ROOT)", function () {
|
describe("after the remove callback is triggered", function () {
|
||||||
// Navigates to grandchild of ROOT
|
var mockChildContext,
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockGrandchildObject);
|
mockChildObject,
|
||||||
|
mockDialogHandle,
|
||||||
|
mockGrandchildContext,
|
||||||
|
mockGrandchildObject,
|
||||||
|
mockRootContext,
|
||||||
|
mockRootObject;
|
||||||
|
|
||||||
// domainObject (grandparent) is set as ROOT, child and grandchild
|
beforeEach(function () {
|
||||||
// are set objects not being removed
|
mockChildObject = jasmine.createSpyObj(
|
||||||
mockDomainObject.getId.and.returnValue("test 1");
|
"domainObject",
|
||||||
mockRootObject.getId.and.returnValue("ROOT");
|
["getId", "getCapability"]
|
||||||
mockChildObject.getId.and.returnValue("not test 2");
|
);
|
||||||
mockGrandchildObject.getId.and.returnValue("not test 3");
|
|
||||||
|
|
||||||
// Sets context for the grandchild, child, and domainObject
|
mockDialogHandle = jasmine.createSpyObj(
|
||||||
mockRootObject.getCapability.and.returnValue(mockRootContext);
|
"dialogHandle",
|
||||||
mockChildObject.getCapability.and.returnValue(mockChildContext);
|
["dismiss"]
|
||||||
mockGrandchildObject.getCapability.and.returnValue(mockGrandchildContext);
|
);
|
||||||
|
|
||||||
// Parents of grandchild and child are set
|
mockGrandchildObject = jasmine.createSpyObj(
|
||||||
mockChildContext.getParent.and.returnValue(mockRootObject);
|
"domainObject",
|
||||||
mockGrandchildContext.getParent.and.returnValue(mockChildObject);
|
["getId", "getCapability"]
|
||||||
|
);
|
||||||
|
|
||||||
mockType.hasFeature.and.returnValue(true);
|
mockRootObject = jasmine.createSpyObj(
|
||||||
|
"domainObject",
|
||||||
|
["getId", "getCapability"]
|
||||||
|
);
|
||||||
|
|
||||||
action.perform();
|
mockChildContext = jasmine.createSpyObj("context", ["getParent"]);
|
||||||
|
mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]);
|
||||||
|
mockRootContext = jasmine.createSpyObj("context", ["getParent"]);
|
||||||
|
|
||||||
|
mockDialogService.showBlockingMessage.and.returnValue(mockDialogHandle);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("mutates the parent when performed", function () {
|
||||||
|
action.perform();
|
||||||
|
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
|
||||||
|
.primaryOption.callback();
|
||||||
|
|
||||||
|
expect(mockMutation.invoke)
|
||||||
|
.toHaveBeenCalledWith(jasmine.any(Function));
|
||||||
|
});
|
||||||
|
|
||||||
|
it("changes composition from its mutation function", function () {
|
||||||
|
var mutator, result;
|
||||||
|
|
||||||
|
action.perform();
|
||||||
|
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
|
||||||
|
.primaryOption.callback();
|
||||||
|
|
||||||
|
mutator = mockMutation.invoke.calls.mostRecent().args[0];
|
||||||
|
result = mutator(model);
|
||||||
|
|
||||||
|
// Should not have cancelled the mutation
|
||||||
|
expect(result).not.toBe(false);
|
||||||
|
|
||||||
|
// Simulate mutate's behavior (remove can either return a
|
||||||
|
// new model or modify this one in-place)
|
||||||
|
result = result || model;
|
||||||
|
|
||||||
|
// Should have removed "test" - that was our
|
||||||
|
// mock domain object's id.
|
||||||
|
expect(result.composition).toEqual(["a", "b"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("removes parent of object currently navigated to", function () {
|
||||||
|
// Navigates to child object
|
||||||
|
mockNavigationService.getNavigation.and.returnValue(mockChildObject);
|
||||||
|
|
||||||
|
// Test is id of object being removed
|
||||||
|
// Child object has different id
|
||||||
|
mockDomainObject.getId.and.returnValue("test");
|
||||||
|
mockChildObject.getId.and.returnValue("not test");
|
||||||
|
|
||||||
|
// Sets context for the child and domainObject
|
||||||
|
mockDomainObject.getCapability.and.returnValue(mockContext);
|
||||||
|
mockChildObject.getCapability.and.returnValue(mockChildContext);
|
||||||
|
|
||||||
|
// Parents of child and domainObject are set
|
||||||
|
mockContext.getParent.and.returnValue(mockParent);
|
||||||
|
mockChildContext.getParent.and.returnValue(mockDomainObject);
|
||||||
|
|
||||||
|
mockType.hasFeature.and.returnValue(true);
|
||||||
|
|
||||||
|
action.perform();
|
||||||
|
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
|
||||||
|
.primaryOption.callback();
|
||||||
|
|
||||||
|
// Expects navigation to parent of domainObject (removed object)
|
||||||
|
expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("checks if removing object not in ascendent path (reaches ROOT)", function () {
|
||||||
|
// Navigates to grandchild of ROOT
|
||||||
|
mockNavigationService.getNavigation.and.returnValue(mockGrandchildObject);
|
||||||
|
|
||||||
|
// domainObject (grandparent) is set as ROOT, child and grandchild
|
||||||
|
// are set objects not being removed
|
||||||
|
mockDomainObject.getId.and.returnValue("test 1");
|
||||||
|
mockRootObject.getId.and.returnValue("ROOT");
|
||||||
|
mockChildObject.getId.and.returnValue("not test 2");
|
||||||
|
mockGrandchildObject.getId.and.returnValue("not test 3");
|
||||||
|
|
||||||
|
// Sets context for the grandchild, child, and domainObject
|
||||||
|
mockRootObject.getCapability.and.returnValue(mockRootContext);
|
||||||
|
mockChildObject.getCapability.and.returnValue(mockChildContext);
|
||||||
|
mockGrandchildObject.getCapability.and.returnValue(mockGrandchildContext);
|
||||||
|
|
||||||
|
// Parents of grandchild and child are set
|
||||||
|
mockChildContext.getParent.and.returnValue(mockRootObject);
|
||||||
|
mockGrandchildContext.getParent.and.returnValue(mockChildObject);
|
||||||
|
|
||||||
|
mockType.hasFeature.and.returnValue(true);
|
||||||
|
|
||||||
|
action.perform();
|
||||||
|
mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
|
||||||
|
.primaryOption.callback();
|
||||||
|
|
||||||
|
// Expects no navigation to occur
|
||||||
|
expect(mockNavigationService.setNavigation).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
// Expects no navigation to occur
|
|
||||||
expect(mockNavigationService.setNavigation).not.toHaveBeenCalled();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -34,7 +34,6 @@ define(
|
|||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
capabilities = {},
|
capabilities = {},
|
||||||
mockEditAction,
|
mockEditAction,
|
||||||
mockSaveAction,
|
|
||||||
action;
|
action;
|
||||||
|
|
||||||
function mockPromise(value) {
|
function mockPromise(value) {
|
||||||
@ -83,12 +82,6 @@ define(
|
|||||||
mockDomainObject.getCapability.and.callFake(function (name) {
|
mockDomainObject.getCapability.and.callFake(function (name) {
|
||||||
return capabilities[name];
|
return capabilities[name];
|
||||||
});
|
});
|
||||||
mockSaveAction = jasmine.createSpyObj(
|
|
||||||
"saveAction",
|
|
||||||
[
|
|
||||||
"perform"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
capabilities.action = jasmine.createSpyObj(
|
capabilities.action = jasmine.createSpyObj(
|
||||||
"actionCapability",
|
"actionCapability",
|
||||||
|
@ -142,11 +142,11 @@ define(
|
|||||||
|
|
||||||
it("populates the model on the associated object", function () {
|
it("populates the model on the associated object", function () {
|
||||||
var formValue = {
|
var formValue = {
|
||||||
"A": "ValueA",
|
"A": "ValueA",
|
||||||
"B": "ValueB",
|
"B": "ValueB",
|
||||||
"C": "ValueC"
|
"C": "ValueC"
|
||||||
},
|
},
|
||||||
compareModel = wizard.createModel(formValue);
|
compareModel = wizard.createModel(formValue);
|
||||||
//populateObjectFromInput adds a .location attribute that is not added by createModel.
|
//populateObjectFromInput adds a .location attribute that is not added by createModel.
|
||||||
compareModel.location = undefined;
|
compareModel.location = undefined;
|
||||||
wizard.populateObjectFromInput(formValue);
|
wizard.populateObjectFromInput(formValue);
|
||||||
|
@ -114,7 +114,7 @@ define(
|
|||||||
mockNewObject.getId.and.returnValue('newId');
|
mockNewObject.getId.and.returnValue('newId');
|
||||||
mockNewObject.getCapability.and.callFake(function (c) {
|
mockNewObject.getCapability.and.callFake(function (c) {
|
||||||
return c === 'persistence' ?
|
return c === 'persistence' ?
|
||||||
mockNewPersistenceCapability : undefined;
|
mockNewPersistenceCapability : undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
mockPersistenceCapability.persist
|
mockPersistenceCapability.persist
|
||||||
|
@ -76,66 +76,66 @@ define(
|
|||||||
describe("when context is available", function () {
|
describe("when context is available", function () {
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockContext.getRoot.and.returnValue(mockRootObject);
|
mockContext.getRoot.and.returnValue(mockRootObject);
|
||||||
controller = new LocatorController(mockScope, mockTimeout, mockObjectService);
|
controller = new LocatorController(mockScope, mockTimeout, mockObjectService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("adds a treeModel to scope", function () {
|
it("adds a treeModel to scope", function () {
|
||||||
expect(mockScope.treeModel).toBeDefined();
|
expect(mockScope.treeModel).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("watches for changes to treeModel", function () {
|
it("watches for changes to treeModel", function () {
|
||||||
// This is what the embedded tree representation
|
// This is what the embedded tree representation
|
||||||
// will be modifying.
|
// will be modifying.
|
||||||
expect(mockScope.$watch).toHaveBeenCalledWith(
|
expect(mockScope.$watch).toHaveBeenCalledWith(
|
||||||
"treeModel.selectedObject",
|
"treeModel.selectedObject",
|
||||||
jasmine.any(Function)
|
jasmine.any(Function)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("changes its own model on embedded model updates", function () {
|
it("changes its own model on embedded model updates", function () {
|
||||||
// Need to pass on selection changes as updates to
|
// Need to pass on selection changes as updates to
|
||||||
// the control's value
|
// the control's value
|
||||||
mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
|
mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
|
||||||
mockTimeout.calls.mostRecent().args[0]();
|
mockTimeout.calls.mostRecent().args[0]();
|
||||||
expect(mockScope.ngModel.someField).toEqual(mockDomainObject);
|
expect(mockScope.ngModel.someField).toEqual(mockDomainObject);
|
||||||
expect(mockScope.rootObject).toEqual(mockRootObject);
|
expect(mockScope.rootObject).toEqual(mockRootObject);
|
||||||
|
|
||||||
// Verify that the capability we expect to have been used
|
// Verify that the capability we expect to have been used
|
||||||
// was used.
|
// was used.
|
||||||
expect(mockDomainObject.getCapability)
|
expect(mockDomainObject.getCapability)
|
||||||
.toHaveBeenCalledWith("context");
|
.toHaveBeenCalledWith("context");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("rejects changes which fail validation", function () {
|
it("rejects changes which fail validation", function () {
|
||||||
mockScope.structure = { validate: jasmine.createSpy('validate') };
|
mockScope.structure = { validate: jasmine.createSpy('validate') };
|
||||||
mockScope.structure.validate.and.returnValue(false);
|
mockScope.structure.validate.and.returnValue(false);
|
||||||
|
|
||||||
// Pass selection change
|
// Pass selection change
|
||||||
mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
|
mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
|
||||||
mockTimeout.calls.mostRecent().args[0]();
|
mockTimeout.calls.mostRecent().args[0]();
|
||||||
|
|
||||||
expect(mockScope.structure.validate).toHaveBeenCalled();
|
expect(mockScope.structure.validate).toHaveBeenCalled();
|
||||||
// Change should have been rejected
|
// Change should have been rejected
|
||||||
expect(mockScope.ngModel.someField).not.toEqual(mockDomainObject);
|
expect(mockScope.ngModel.someField).not.toEqual(mockDomainObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("treats a lack of a selection as invalid", function () {
|
it("treats a lack of a selection as invalid", function () {
|
||||||
mockScope.ngModelController = jasmine.createSpyObj(
|
mockScope.ngModelController = jasmine.createSpyObj(
|
||||||
'ngModelController',
|
'ngModelController',
|
||||||
['$setValidity']
|
['$setValidity']
|
||||||
);
|
);
|
||||||
|
|
||||||
mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
|
mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
|
||||||
mockTimeout.calls.mostRecent().args[0]();
|
mockTimeout.calls.mostRecent().args[0]();
|
||||||
expect(mockScope.ngModelController.$setValidity)
|
expect(mockScope.ngModelController.$setValidity)
|
||||||
.toHaveBeenCalledWith(jasmine.any(String), true);
|
.toHaveBeenCalledWith(jasmine.any(String), true);
|
||||||
|
|
||||||
mockScope.$watch.calls.mostRecent().args[1](undefined);
|
mockScope.$watch.calls.mostRecent().args[1](undefined);
|
||||||
mockTimeout.calls.mostRecent().args[0]();
|
mockTimeout.calls.mostRecent().args[0]();
|
||||||
expect(mockScope.ngModelController.$setValidity)
|
expect(mockScope.ngModelController.$setValidity)
|
||||||
.toHaveBeenCalledWith(jasmine.any(String), false);
|
.toHaveBeenCalledWith(jasmine.any(String), false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("when no context is available", function () {
|
describe("when no context is available", function () {
|
||||||
var defaultRoot = "DEFAULT_ROOT";
|
var defaultRoot = "DEFAULT_ROOT";
|
||||||
|
@ -27,7 +27,6 @@ define(
|
|||||||
describe("The Edit action policy", function () {
|
describe("The Edit action policy", function () {
|
||||||
var editableView,
|
var editableView,
|
||||||
nonEditableView,
|
nonEditableView,
|
||||||
undefinedView,
|
|
||||||
testViews,
|
testViews,
|
||||||
testContext,
|
testContext,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
@ -67,7 +66,6 @@ define(
|
|||||||
|
|
||||||
editableView = { editable: true };
|
editableView = { editable: true };
|
||||||
nonEditableView = { editable: false };
|
nonEditableView = { editable: false };
|
||||||
undefinedView = { someKey: "some value" };
|
|
||||||
plotView = { key: "plot", editable: false };
|
plotView = { key: "plot", editable: false };
|
||||||
testViews = [];
|
testViews = [];
|
||||||
|
|
||||||
|
@ -75,25 +75,25 @@ define(
|
|||||||
|
|
||||||
it('Allows "remove" action when navigated object in edit mode,' +
|
it('Allows "remove" action when navigated object in edit mode,' +
|
||||||
' and selected object not editable, but its parent is.',
|
' and selected object not editable, but its parent is.',
|
||||||
function () {
|
function () {
|
||||||
var mockParent = jasmine.createSpyObj("parentObject", ["hasCapability"]),
|
var mockParent = jasmine.createSpyObj("parentObject", ["hasCapability"]),
|
||||||
mockContextCapability = jasmine.createSpyObj("contextCapability", ["getParent"]);
|
mockContextCapability = jasmine.createSpyObj("contextCapability", ["getParent"]);
|
||||||
|
|
||||||
mockParent.hasCapability.and.returnValue(true);
|
mockParent.hasCapability.and.returnValue(true);
|
||||||
mockContextCapability.getParent.and.returnValue(mockParent);
|
mockContextCapability.getParent.and.returnValue(mockParent);
|
||||||
navigatedObject.hasCapability.and.returnValue(true);
|
navigatedObject.hasCapability.and.returnValue(true);
|
||||||
|
|
||||||
mockDomainObject.getCapability.and.returnValue(mockContextCapability);
|
mockDomainObject.getCapability.and.returnValue(mockContextCapability);
|
||||||
mockDomainObject.hasCapability.and.callFake(function (capability) {
|
mockDomainObject.hasCapability.and.callFake(function (capability) {
|
||||||
switch (capability) {
|
switch (capability) {
|
||||||
case "editor": return false;
|
case "editor": return false;
|
||||||
case "context": return true;
|
case "context": return true;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
metadata.key = "remove";
|
|
||||||
|
|
||||||
expect(policy.allow(mockAction, context)).toBe(true);
|
|
||||||
});
|
});
|
||||||
|
metadata.key = "remove";
|
||||||
|
|
||||||
|
expect(policy.allow(mockAction, context)).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
it('Disallows "move" action when navigated object in edit mode,' +
|
it('Disallows "move" action when navigated object in edit mode,' +
|
||||||
' but selected object not in edit mode ', function () {
|
' but selected object not in edit mode ', function () {
|
||||||
|
@ -37,8 +37,8 @@ define(
|
|||||||
);
|
);
|
||||||
mockDomainObject.getCapability.and.returnValue({
|
mockDomainObject.getCapability.and.returnValue({
|
||||||
inEditContext: function () {
|
inEditContext: function () {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mockDomainObject.hasCapability.and.callFake(function (c) {
|
mockDomainObject.hasCapability.and.callFake(function (c) {
|
||||||
return (c === 'editor') && testMode;
|
return (c === 'editor') && testMode;
|
||||||
|
@ -30,12 +30,6 @@ define(
|
|||||||
mockObjects,
|
mockObjects,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
testStructure,
|
testStructure,
|
||||||
testAB,
|
|
||||||
testABC,
|
|
||||||
testABC2,
|
|
||||||
testABCXYZ,
|
|
||||||
testABCYZ,
|
|
||||||
testM,
|
|
||||||
toolbar;
|
toolbar;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
@ -53,22 +47,15 @@ define(
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
testStructure = [
|
testStructure = [
|
||||||
{ name: "A", property: "a", domainObject: mockDomainObject },
|
{ name: "A", property: "a", domainObject: mockDomainObject },
|
||||||
{ name: "B", property: "b", domainObject: mockDomainObject },
|
{ name: "B", property: "b", domainObject: mockDomainObject },
|
||||||
{ name: "C", property: "c", domainObject: mockDomainObject },
|
{ name: "C", property: "c", domainObject: mockDomainObject },
|
||||||
{ name: "X", property: "x", domainObject: mockDomainObject },
|
{ name: "X", property: "x", domainObject: mockDomainObject },
|
||||||
{ name: "Y", property: "y", domainObject: mockDomainObject },
|
{ name: "Y", property: "y", domainObject: mockDomainObject },
|
||||||
{ name: "Z", property: "z", domainObject: mockDomainObject },
|
{ name: "Z", property: "z", domainObject: mockDomainObject },
|
||||||
{ name: "M", method: "m", domainObject: mockDomainObject }
|
{ name: "M", method: "m", domainObject: mockDomainObject }
|
||||||
];
|
];
|
||||||
|
|
||||||
testAB = { a: 0, b: 1 };
|
|
||||||
testABC = { a: 0, b: 1, c: 2 };
|
|
||||||
testABC2 = { a: 4, b: 1, c: 2 }; // For inconsistent-state checking
|
|
||||||
testABCXYZ = { a: 0, b: 1, c: 2, x: 'X!', y: 'Y!', z: 'Z!' };
|
|
||||||
testABCYZ = { a: 0, b: 1, c: 2, y: 'Y!', z: 'Z!' };
|
|
||||||
testM = { m: jasmine.createSpy("method") };
|
|
||||||
|
|
||||||
toolbar = new EditToolbar(mockScope, mockOpenMCT, testStructure);
|
toolbar = new EditToolbar(mockScope, mockOpenMCT, testStructure);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,13 +43,12 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) {
|
|||||||
|
|
||||||
describe("when callbacks are added", function () {
|
describe("when callbacks are added", function () {
|
||||||
var mockCommit,
|
var mockCommit,
|
||||||
mockCancel,
|
mockCancel;
|
||||||
remove;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockCommit = jasmine.createSpy('commit');
|
mockCommit = jasmine.createSpy('commit');
|
||||||
mockCancel = jasmine.createSpy('cancel');
|
mockCancel = jasmine.createSpy('cancel');
|
||||||
remove = nestedTransaction.add(mockCommit, mockCancel);
|
nestedTransaction.add(mockCommit, mockCancel);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("does not interact with its parent transaction", function () {
|
it("does not interact with its parent transaction", function () {
|
||||||
|
@ -76,8 +76,8 @@ define(
|
|||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
onCommits = [0, 1, 2].map(function (val) {
|
onCommits = [0, 1, 2].map(function (val) {
|
||||||
return jasmine.createSpy("onCommit" + val);
|
return jasmine.createSpy("onCommit" + val);
|
||||||
});
|
});
|
||||||
|
|
||||||
transactionService.startTransaction();
|
transactionService.startTransaction();
|
||||||
onCommits.forEach(transactionService.addToTransaction.bind(transactionService));
|
onCommits.forEach(transactionService.addToTransaction.bind(transactionService));
|
||||||
|
@ -92,8 +92,8 @@ define([
|
|||||||
return true;
|
return true;
|
||||||
}]
|
}]
|
||||||
].filter(function (row) {
|
].filter(function (row) {
|
||||||
return row[1](momentified);
|
return row[1](momentified);
|
||||||
})[0][0];
|
})[0][0];
|
||||||
|
|
||||||
if (format !== undefined) {
|
if (format !== undefined) {
|
||||||
return moment.utc(d).format(format);
|
return moment.utc(d).format(format);
|
||||||
|
@ -34,7 +34,6 @@ define([
|
|||||||
"./src/controllers/ContextMenuController",
|
"./src/controllers/ContextMenuController",
|
||||||
"./src/controllers/ClickAwayController",
|
"./src/controllers/ClickAwayController",
|
||||||
"./src/controllers/ViewSwitcherController",
|
"./src/controllers/ViewSwitcherController",
|
||||||
"./src/controllers/BottomBarController",
|
|
||||||
"./src/controllers/GetterSetterController",
|
"./src/controllers/GetterSetterController",
|
||||||
"./src/controllers/SelectorController",
|
"./src/controllers/SelectorController",
|
||||||
"./src/controllers/ObjectInspectorController",
|
"./src/controllers/ObjectInspectorController",
|
||||||
@ -49,29 +48,30 @@ define([
|
|||||||
"./src/directives/MCTSplitPane",
|
"./src/directives/MCTSplitPane",
|
||||||
"./src/directives/MCTSplitter",
|
"./src/directives/MCTSplitter",
|
||||||
"./src/directives/MCTTree",
|
"./src/directives/MCTTree",
|
||||||
|
"./src/directives/MCTIndicators",
|
||||||
"./src/directives/MCTPreview",
|
"./src/directives/MCTPreview",
|
||||||
"./src/actions/MCTPreviewAction",
|
"./src/actions/MCTPreviewAction",
|
||||||
"./src/filters/ReverseFilter",
|
"./src/filters/ReverseFilter",
|
||||||
"text!./res/templates/bottombar.html",
|
"./res/templates/bottombar.html",
|
||||||
"text!./res/templates/controls/action-button.html",
|
"./res/templates/controls/action-button.html",
|
||||||
"text!./res/templates/controls/input-filter.html",
|
"./res/templates/controls/input-filter.html",
|
||||||
"text!./res/templates/indicator.html",
|
"./res/templates/angular-indicator.html",
|
||||||
"text!./res/templates/message-banner.html",
|
"./res/templates/message-banner.html",
|
||||||
"text!./res/templates/progress-bar.html",
|
"./res/templates/progress-bar.html",
|
||||||
"text!./res/templates/controls/time-controller.html",
|
"./res/templates/controls/time-controller.html",
|
||||||
"text!./res/templates/containers/accordion.html",
|
"./res/templates/containers/accordion.html",
|
||||||
"text!./res/templates/subtree.html",
|
"./res/templates/subtree.html",
|
||||||
"text!./res/templates/tree.html",
|
"./res/templates/tree.html",
|
||||||
"text!./res/templates/tree-node.html",
|
"./res/templates/tree-node.html",
|
||||||
"text!./res/templates/label.html",
|
"./res/templates/label.html",
|
||||||
"text!./res/templates/controls/action-group.html",
|
"./res/templates/controls/action-group.html",
|
||||||
"text!./res/templates/menu/context-menu.html",
|
"./res/templates/menu/context-menu.html",
|
||||||
"text!./res/templates/controls/switcher.html",
|
"./res/templates/controls/switcher.html",
|
||||||
"text!./res/templates/object-inspector.html",
|
"./res/templates/object-inspector.html",
|
||||||
"text!./res/templates/controls/selector.html",
|
"./res/templates/controls/selector.html",
|
||||||
"text!./res/templates/controls/datetime-picker.html",
|
"./res/templates/controls/datetime-picker.html",
|
||||||
"text!./res/templates/controls/datetime-field.html",
|
"./res/templates/controls/datetime-field.html",
|
||||||
"text!./res/templates/preview.html",
|
"./res/templates/preview.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
UrlService,
|
UrlService,
|
||||||
@ -87,7 +87,6 @@ define([
|
|||||||
ContextMenuController,
|
ContextMenuController,
|
||||||
ClickAwayController,
|
ClickAwayController,
|
||||||
ViewSwitcherController,
|
ViewSwitcherController,
|
||||||
BottomBarController,
|
|
||||||
GetterSetterController,
|
GetterSetterController,
|
||||||
SelectorController,
|
SelectorController,
|
||||||
ObjectInspectorController,
|
ObjectInspectorController,
|
||||||
@ -102,6 +101,7 @@ define([
|
|||||||
MCTSplitPane,
|
MCTSplitPane,
|
||||||
MCTSplitter,
|
MCTSplitter,
|
||||||
MCTTree,
|
MCTTree,
|
||||||
|
MCTIndicators,
|
||||||
MCTPreview,
|
MCTPreview,
|
||||||
MCTPreviewAction,
|
MCTPreviewAction,
|
||||||
ReverseFilter,
|
ReverseFilter,
|
||||||
@ -173,12 +173,6 @@ define([
|
|||||||
"key": "reverse"
|
"key": "reverse"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stylesheets": [
|
|
||||||
{
|
|
||||||
"stylesheetUrl": "css/normalize.min.css",
|
|
||||||
"priority": "mandatory"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"templates": [
|
"templates": [
|
||||||
{
|
{
|
||||||
"key": "bottombar",
|
"key": "bottombar",
|
||||||
@ -281,13 +275,6 @@ define([
|
|||||||
"$timeout"
|
"$timeout"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "BottomBarController",
|
|
||||||
"implementation": BottomBarController,
|
|
||||||
"depends": [
|
|
||||||
"indicators[]"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "GetterSetterController",
|
"key": "GetterSetterController",
|
||||||
"implementation": GetterSetterController,
|
"implementation": GetterSetterController,
|
||||||
@ -403,6 +390,11 @@ define([
|
|||||||
"implementation": MCTTree,
|
"implementation": MCTTree,
|
||||||
"depends": ['gestureService', 'openmct']
|
"depends": ['gestureService', 'openmct']
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "mctIndicators",
|
||||||
|
"implementation": MCTIndicators,
|
||||||
|
"depends": ['openmct']
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "mctPreview",
|
"key": "mctPreview",
|
||||||
"implementation": MCTPreview,
|
"implementation": MCTPreview,
|
||||||
@ -420,11 +412,11 @@ define([
|
|||||||
"description": "Preview in large dialog",
|
"description": "Preview in large dialog",
|
||||||
"category": [
|
"category": [
|
||||||
"contextual",
|
"contextual",
|
||||||
"view-control"
|
"view-control"
|
||||||
],
|
],
|
||||||
"depends": [
|
"depends": [
|
||||||
"$compile",
|
"$compile",
|
||||||
"$rootScope"
|
"$rootScope"
|
||||||
],
|
],
|
||||||
"priority": "preferred"
|
"priority": "preferred"
|
||||||
}
|
}
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
/* http://meyerweb.com/eric/tools/css/reset/
|
|
||||||
v2.0 | 20110126
|
|
||||||
License: none (public domain)
|
|
||||||
*/
|
|
||||||
|
|
||||||
html, body, div, span, applet, object, iframe,
|
|
||||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
||||||
a, abbr, acronym, address, big, cite, code,
|
|
||||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
||||||
small, strike, strong, sub, sup, tt, var,
|
|
||||||
b, u, i, center,
|
|
||||||
dl, dt, dd, ol, ul, li,
|
|
||||||
fieldset, form, label, legend,
|
|
||||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
||||||
article, aside, canvas, details, embed,
|
|
||||||
figure, figcaption, footer, header, hgroup,
|
|
||||||
menu, nav, output, ruby, section, summary,
|
|
||||||
time, mark, audio, video {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
font-size: 100%;
|
|
||||||
font: inherit;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
/* HTML5 display-role reset for older browsers */
|
|
||||||
article, aside, details, figcaption, figure,
|
|
||||||
footer, header, hgroup, menu, nav, section {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
ol, ul {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
blockquote, q {
|
|
||||||
quotes: none;
|
|
||||||
}
|
|
||||||
blockquote:before, blockquote:after,
|
|
||||||
q:before, q:after {
|
|
||||||
content: '';
|
|
||||||
content: none;
|
|
||||||
}
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
border-spacing: 0;
|
|
||||||
}
|
|
@ -1,85 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*************************************************** MIXINS */
|
|
||||||
@mixin formulateStatusColors($c) {
|
|
||||||
// Sets bg and icon colors for elements
|
|
||||||
background: rgba($c, 0.4) !important;
|
|
||||||
&:before { color: $c !important; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************** GENERAL */
|
|
||||||
.s-limit-yellow,
|
|
||||||
.s-limit-red,
|
|
||||||
.s-limit-yellow-icon,
|
|
||||||
.s-limit-red-icon,
|
|
||||||
.s-status-warning-lo,
|
|
||||||
.s-status-warning-hi,
|
|
||||||
.s-status-diagnostic,
|
|
||||||
.s-status-command,
|
|
||||||
.s-status-info,
|
|
||||||
.s-status-ok,
|
|
||||||
.s-status-warning-lo-icon,
|
|
||||||
.s-status-warning-hi-icon,
|
|
||||||
.s-status-diagnostic-icon,
|
|
||||||
.s-status-command-icon,
|
|
||||||
.s-status-info-icon,
|
|
||||||
.s-status-ok-icon {
|
|
||||||
@include trans-prop-nice($props: background, $dur: 500ms);
|
|
||||||
&:before {
|
|
||||||
content:'';
|
|
||||||
font-family: symbolsfont;
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin-right: $interiorMarginSm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************** LIMITS */
|
|
||||||
.s-limit-yellow, .s-limit-yellow-icon {
|
|
||||||
@include formulateStatusColors($colorWarningLo);
|
|
||||||
}
|
|
||||||
|
|
||||||
.s-limit-red, .s-limit-red-icon {
|
|
||||||
@include formulateStatusColors($colorWarningHi);
|
|
||||||
}
|
|
||||||
|
|
||||||
.s-limit-upr:before { content: $glyph-icon-arrow-double-up; }
|
|
||||||
.s-limit-lwr:before { content: $glyph-icon-arrow-double-down; }
|
|
||||||
.s-limit-yellow-icon:before,
|
|
||||||
.s-limit-red-icon:before { content: $glyph-icon-alert-triangle; }
|
|
||||||
|
|
||||||
/*************************************************** STATUS */
|
|
||||||
.s-status-warning-hi, .s-status-warning-hi-icon { @include formulateStatusColors($colorWarningHi); }
|
|
||||||
.s-status-warning-lo, .s-status-warning-lo-icon { @include formulateStatusColors($colorWarningLo); }
|
|
||||||
.s-status-diagnostic, .s-status-diagnostic-icon { @include formulateStatusColors($colorDiagnostic); }
|
|
||||||
.s-status-info, .s-status-info-icon { @include formulateStatusColors($colorInfo); }
|
|
||||||
.s-status-ok, .s-status-ok-icon { @include formulateStatusColors($colorOk); }
|
|
||||||
|
|
||||||
.s-status-warning-hi-icon:before { content: $glyph-icon-alert-triangle; }
|
|
||||||
.s-status-warning-lo-icon:before { content: $glyph-icon-alert-rect; }
|
|
||||||
.s-status-diagnostic-icon:before { content: $glyph-icon-eye-open; }
|
|
||||||
.s-status-info-icon:before { content: $glyph-icon-info; }
|
|
||||||
.s-status-ok-icon:before { content: $glyph-icon-check; }
|
|
||||||
|
|
||||||
|
|
@ -1,308 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
.abs.holder-plot {
|
|
||||||
right: $interiorMargin; // Fend off the scrollbar when less than min-height;
|
|
||||||
.t-object-alert.t-alert-unsynced {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************* STACKED PLOT LAYOUT */
|
|
||||||
.t-plot-stacked {
|
|
||||||
.l-view-section {
|
|
||||||
// Make this a flex container
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column nowrap;
|
|
||||||
.gl-plot.child-frame {
|
|
||||||
mct-plot {
|
|
||||||
display: flex;
|
|
||||||
flex: 1 1 auto;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
flex: 1 1 auto;
|
|
||||||
&:not(:first-child) {
|
|
||||||
margin-top: $interiorMargin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.s-status-timeconductor-unsynced .holder-plot {
|
|
||||||
.t-object-alert.t-alert-unsynced {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.gl-plot {
|
|
||||||
color: $colorPlotFg;
|
|
||||||
display: flex;
|
|
||||||
font-size: 0.7rem;
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
min-height: $plotMinH;
|
|
||||||
|
|
||||||
/********************************************* AXIS AND DISPLAY AREA */
|
|
||||||
.plot-wrapper-axis-and-display-area {
|
|
||||||
margin-top: $interiorMargin; // Keep the top tick label from getting clipped
|
|
||||||
position: relative;
|
|
||||||
flex: 1 1 auto;
|
|
||||||
.t-object-alert {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
font-size: 1.5em;
|
|
||||||
top: $interiorMarginSm; left: $interiorMarginSm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-wrapper-display-area-and-x-axis {
|
|
||||||
// Holds the plot area and the X-axis only
|
|
||||||
position: absolute;
|
|
||||||
top: nth($plotDisplayArea, 1);
|
|
||||||
right: nth($plotDisplayArea, 2);
|
|
||||||
bottom: 0;
|
|
||||||
left: nth($plotDisplayArea, 4);
|
|
||||||
|
|
||||||
.gl-plot-display-area {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: nth($plotDisplayArea, 3);
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-axis-area.gl-plot-x {
|
|
||||||
top: auto;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
height: $plotXBarH;
|
|
||||||
width: auto;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-axis-area {
|
|
||||||
position: absolute;
|
|
||||||
&.gl-plot-y {
|
|
||||||
top: nth($plotDisplayArea, 1);
|
|
||||||
right: auto;
|
|
||||||
bottom: nth($plotDisplayArea, 3);
|
|
||||||
left: 0;
|
|
||||||
width: $plotYBarW;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-coords {
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: $controlCr;
|
|
||||||
background: black;
|
|
||||||
color: lighten($colorBodyFg, 30%);
|
|
||||||
padding: 2px 5px;
|
|
||||||
position: absolute;
|
|
||||||
top: nth($plotDisplayArea,1) + $interiorMarginLg;
|
|
||||||
right: auto;
|
|
||||||
bottom: auto;
|
|
||||||
left: nth($plotDisplayArea,4) + $interiorMarginLg;
|
|
||||||
z-index: 10;
|
|
||||||
&:empty {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-label,
|
|
||||||
.l-plot-label {
|
|
||||||
color: $colorPlotLabelFg;
|
|
||||||
position: absolute;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
&.gl-plot-x-label,
|
|
||||||
&.l-plot-x-label {
|
|
||||||
top: auto;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.gl-plot-y-label,
|
|
||||||
&.l-plot-y-label {
|
|
||||||
$x: -50%;
|
|
||||||
$r: -90deg;
|
|
||||||
transform-origin: 50% 0;
|
|
||||||
transform: translateX($x) rotate($r);
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: $interiorMargin; // Kick off the left edge
|
|
||||||
left: 0;
|
|
||||||
top: 50%;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-x-options,
|
|
||||||
.gl-plot-y-options {
|
|
||||||
$h: 24px;
|
|
||||||
position: absolute;
|
|
||||||
height: $h;
|
|
||||||
min-height: $h;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-x-options {
|
|
||||||
transform: translateX(-50%);
|
|
||||||
bottom: 0;
|
|
||||||
left: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-y-options {
|
|
||||||
transform: translateY(-50%);
|
|
||||||
min-width: 150px; // Need this due to enclosure of .select
|
|
||||||
top: 50%;
|
|
||||||
left: $plotYLabelW + $interiorMargin * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.t-plot-display-controls {
|
|
||||||
position: absolute;
|
|
||||||
top: $interiorMargin;
|
|
||||||
right: $interiorMargin;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-hash {
|
|
||||||
position: absolute;
|
|
||||||
border: 0 $colorPlotHash $stylePlotHash;
|
|
||||||
&.hash-v {
|
|
||||||
border-right-width: 1px;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
&.hash-h {
|
|
||||||
border-bottom-width: 1px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************** Limits and Out-of-Bounds data */
|
|
||||||
|
|
||||||
.l-limit-bar,
|
|
||||||
.l-oob-data {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.l-limit-bar {
|
|
||||||
// Limits in plot display area
|
|
||||||
@mixin limitBg($c) {
|
|
||||||
background: rgba($c, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
height: auto;
|
|
||||||
z-index: 0;
|
|
||||||
&.s-limit-yellow { @include limitBg($colorLimitYellowBg); }
|
|
||||||
&.s-limit-red { @include limitBg($colorLimitRedBg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
.l-oob-data {
|
|
||||||
$c: #7748d6;
|
|
||||||
$a: 0.5;
|
|
||||||
$h: 10px;
|
|
||||||
@include absPosDefault();
|
|
||||||
pointer-events: none;
|
|
||||||
height: $h;
|
|
||||||
z-index: 1;
|
|
||||||
&.l-oob-data-up {
|
|
||||||
top: 0;
|
|
||||||
bottom: auto;
|
|
||||||
@include linearGlow(0deg, $c, $a);
|
|
||||||
}
|
|
||||||
&.l-oob-data-dwn {
|
|
||||||
bottom: 0;
|
|
||||||
top: auto;
|
|
||||||
@include linearGlow(180deg, $c, $a);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.gl-plot-display-area,
|
|
||||||
.plot-display-area {
|
|
||||||
@if $colorPlotBg != none { background-color: $colorPlotBg; }
|
|
||||||
cursor: crosshair;
|
|
||||||
border: 1px solid $colorPlotAreaBorder;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tick {
|
|
||||||
position: absolute;
|
|
||||||
border: 0 $colorPlotHash solid;
|
|
||||||
&.tick-x {
|
|
||||||
border-right-width: 1px;
|
|
||||||
height: 100%; // Assumption is that the tick will be in a holder that will set it's height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-tick,
|
|
||||||
.tick-label {
|
|
||||||
@include reverseEllipsis();
|
|
||||||
font-size: 0.7rem;
|
|
||||||
position: absolute;
|
|
||||||
&.gl-plot-x-tick-label,
|
|
||||||
&.tick-label-x {
|
|
||||||
right: auto;
|
|
||||||
bottom: auto;
|
|
||||||
left: auto;
|
|
||||||
height: auto;
|
|
||||||
width: 20%;
|
|
||||||
margin-left: -10%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
&.gl-plot-y-tick-label,
|
|
||||||
&.tick-label-y {
|
|
||||||
top: auto;
|
|
||||||
height: 1em;
|
|
||||||
width: auto;
|
|
||||||
margin-bottom: -0.5em;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gl-plot-tick {
|
|
||||||
&.gl-plot-x-tick-label {
|
|
||||||
top: $interiorMargin;
|
|
||||||
}
|
|
||||||
&.gl-plot-y-tick-label {
|
|
||||||
right: $interiorMargin;
|
|
||||||
left: $interiorMargin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tick-label {
|
|
||||||
&.tick-label-x {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
&.tick-label-y {
|
|
||||||
right: 0; left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,14 +20,8 @@
|
|||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
|
||||||
<div class='status block'
|
<div class="ls-indicator {{ngModel.getCssClass()}}"
|
||||||
title="{{ngModel.getDescription()}}"
|
title="{{ngModel.getDescription()}}"
|
||||||
ng-click='ngModel.configure()'
|
|
||||||
ng-show="ngModel.getText().length > 0">
|
ng-show="ngModel.getText().length > 0">
|
||||||
<span class="status-indicator {{ngModel.getCssClass()}}"></span><span class="label"
|
<span class="label">{{ngModel.getText()}}</span>
|
||||||
ng-class='ngModel.getTextClass()'>
|
|
||||||
{{ngModel.getText()}}
|
|
||||||
<a class="s-button icon-gear" ng-if="ngModel.configure"></a>
|
|
||||||
</span><span class="count">
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
@ -19,14 +19,9 @@
|
|||||||
this source code distribution or the Licensing information page available
|
this source code distribution or the Licensing information page available
|
||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
<div class='abs bottom-bar ue-bottom-bar mobile-disable-select' ng-controller="BottomBarController as bar">
|
<div class='abs bottom-bar l-ue-bottom-bar s-ue-bottom-bar mobile-disable-select'>
|
||||||
<div id='status' class='status-holder'>
|
<div id='status' class='status-holder'>
|
||||||
<mct-include ng-repeat="indicator in bar.getIndicators()"
|
<mct-indicators></mct-indicators>
|
||||||
ng-model="indicator.ngModel"
|
|
||||||
key="indicator.template"
|
|
||||||
class="status-block-holder"
|
|
||||||
ng-class='indicator.ngModel.getGlyphClass()'>
|
|
||||||
</mct-include>
|
|
||||||
</div>
|
</div>
|
||||||
<mct-include key="'message-banner'"></mct-include>
|
<mct-include key="'message-banner'"></mct-include>
|
||||||
<mct-include key="'about-logo'"></mct-include>
|
<mct-include key="'about-logo'"></mct-include>
|
||||||
|
@ -38,8 +38,8 @@ define(
|
|||||||
// Refresh variable "menuActions" in the scope
|
// Refresh variable "menuActions" in the scope
|
||||||
function updateActions() {
|
function updateActions() {
|
||||||
$scope.menuActions = $scope.action ?
|
$scope.menuActions = $scope.action ?
|
||||||
$scope.action.getActions({ category: 'contextual' }) :
|
$scope.action.getActions({ category: 'contextual' }) :
|
||||||
[];
|
[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update using the action capability
|
// Update using the action capability
|
||||||
|
@ -188,7 +188,7 @@ define(
|
|||||||
// Ensure some useful default
|
// Ensure some useful default
|
||||||
$scope.ngModel[$scope.field] =
|
$scope.ngModel[$scope.field] =
|
||||||
$scope.ngModel[$scope.field] === undefined ?
|
$scope.ngModel[$scope.field] === undefined ?
|
||||||
now() : $scope.ngModel[$scope.field];
|
now() : $scope.ngModel[$scope.field];
|
||||||
|
|
||||||
$scope.$watch('ngModel[field]', updateFromModel);
|
$scope.$watch('ngModel[field]', updateFromModel);
|
||||||
$scope.$watchCollection('date', updateFromView);
|
$scope.$watchCollection('date', updateFromView);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
* Open MCT, Copyright (c) 2014-2018, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -19,28 +19,22 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*global define,Promise*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining ExampleService. Created by vwoeltje on 11/4/14.
|
|
||||||
*/
|
|
||||||
define(
|
define(
|
||||||
[],
|
[],
|
||||||
function () {
|
function () {
|
||||||
"use strict";
|
function MCTIndicators(openmct) {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function ExampleService() {
|
|
||||||
return {
|
return {
|
||||||
getMessage: function () {
|
restrict: "E",
|
||||||
return "I heard this from a service";
|
link: function link(scope, element) {
|
||||||
|
openmct.indicators.indicatorElements
|
||||||
|
.forEach(function (indicatorElement) {
|
||||||
|
element.append(indicatorElement);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExampleService;
|
return MCTIndicators;
|
||||||
}
|
}
|
||||||
);
|
);
|
@ -28,16 +28,16 @@ define(['zepto', '../services/Overlay'], function ($, Overlay) {
|
|||||||
notebookAction = actions.getActions({key: 'notebook-new-entry'})[0];
|
notebookAction = actions.getActions({key: 'notebook-new-entry'})[0];
|
||||||
|
|
||||||
var notebookButton = notebookAction ?
|
var notebookButton = notebookAction ?
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
class: 'icon-notebook new-notebook-entry',
|
class: 'icon-notebook new-notebook-entry',
|
||||||
title: 'New Notebook Entry',
|
title: 'New Notebook Entry',
|
||||||
clickHandler: function (event) {
|
clickHandler: function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
notebookAction.perform();
|
notebookAction.perform();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
] : [];
|
||||||
] : [];
|
|
||||||
|
|
||||||
var overlayService = new Overlay({
|
var overlayService = new Overlay({
|
||||||
$document: $document,
|
$document: $document,
|
||||||
|
@ -62,8 +62,8 @@ define(
|
|||||||
// Determine how long to wait before the next update
|
// Determine how long to wait before the next update
|
||||||
function currentInterval() {
|
function currentInterval() {
|
||||||
return attrs.mctResizeInterval ?
|
return attrs.mctResizeInterval ?
|
||||||
scope.$eval(attrs.mctResizeInterval) :
|
scope.$eval(attrs.mctResizeInterval) :
|
||||||
DEFAULT_INTERVAL;
|
DEFAULT_INTERVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Evaluate mct-resize with the current bounds
|
// Evaluate mct-resize with the current bounds
|
||||||
|
@ -45,15 +45,27 @@ define(
|
|||||||
|
|
||||||
// Link; install event handlers.
|
// Link; install event handlers.
|
||||||
function link(scope, element, attrs) {
|
function link(scope, element, attrs) {
|
||||||
var removeSelectable = openmct.selection.selectable(
|
var isDestroyed = false;
|
||||||
element[0],
|
|
||||||
scope.$eval(attrs.mctSelectable),
|
|
||||||
attrs.hasOwnProperty('mctInitSelect') && scope.$eval(attrs.mctInitSelect) !== false
|
|
||||||
);
|
|
||||||
|
|
||||||
scope.$on("$destroy", function () {
|
scope.$on("$destroy", function () {
|
||||||
removeSelectable();
|
isDestroyed = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
openmct.$injector.get('$timeout')(function () {
|
||||||
|
if (isDestroyed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var removeSelectable = openmct.selection.selectable(
|
||||||
|
element[0],
|
||||||
|
scope.$eval(attrs.mctSelectable),
|
||||||
|
attrs.hasOwnProperty('mctInitSelect') && scope.$eval(attrs.mctInitSelect) !== false
|
||||||
|
);
|
||||||
|
|
||||||
|
scope.$on("$destroy", function () {
|
||||||
|
removeSelectable();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -103,16 +103,16 @@ define(
|
|||||||
splitterSize,
|
splitterSize,
|
||||||
|
|
||||||
alias = $attrs.alias !== undefined ?
|
alias = $attrs.alias !== undefined ?
|
||||||
"mctSplitPane-" + $attrs.alias : undefined,
|
"mctSplitPane-" + $attrs.alias : undefined,
|
||||||
|
|
||||||
//convert string to number from localStorage
|
//convert string to number from localStorage
|
||||||
userWidthPreference = $window.localStorage.getItem(alias) === null ?
|
userWidthPreference = $window.localStorage.getItem(alias) === null ?
|
||||||
undefined : Number($window.localStorage.getItem(alias));
|
undefined : Number($window.localStorage.getItem(alias));
|
||||||
|
|
||||||
// Get relevant size (height or width) of DOM element
|
// Get relevant size (height or width) of DOM element
|
||||||
function getSize(domElement) {
|
function getSize(domElement) {
|
||||||
return (anchor.orientation === 'vertical' ?
|
return (anchor.orientation === 'vertical' ?
|
||||||
domElement.offsetWidth : domElement.offsetHeight);
|
domElement.offsetWidth : domElement.offsetHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply styles to child elements
|
// Apply styles to child elements
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module defining OverlayService. Created by deeptailor on 03/29/2018
|
* Module defining OverlayService. Created by deeptailor on 03/29/2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
define([
|
define([
|
||||||
'zepto',
|
'zepto',
|
||||||
'text!../../res/templates/tree/toggle.html'
|
'../../res/templates/tree/toggle.html'
|
||||||
], function ($, toggleTemplate) {
|
], function ($, toggleTemplate) {
|
||||||
function ToggleView(state) {
|
function ToggleView(state) {
|
||||||
this.expanded = !!state;
|
this.expanded = !!state;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user