Compare commits
	
		
			165 Commits
		
	
	
		
			check-alar
			...
			fix-legacy
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					75e578d2f0 | ||
| 
						 | 
					0bade5eaba | ||
| 
						 | 
					b6ec023920 | ||
| 
						 | 
					e8e7067993 | ||
| 
						 | 
					0e9319e97b | ||
| 
						 | 
					df53af7b4d | ||
| 
						 | 
					bcbf244fd2 | ||
| 
						 | 
					7ff5febae0 | ||
| 
						 | 
					019d108bb2 | ||
| 
						 | 
					a14f628ca3 | ||
| 
						 | 
					6116351dad | ||
| 
						 | 
					23efef4469 | ||
| 
						 | 
					95549f7be2 | ||
| 
						 | 
					6338bd1168 | ||
| 
						 | 
					f7d0d2c166 | ||
| 
						 | 
					7c2e10ba0e | ||
| 
						 | 
					350d3c92e7 | ||
| 
						 | 
					0f2918efaf | ||
| 
						 | 
					b72ad529aa | ||
| 
						 | 
					f77c6c821c | ||
| 
						 | 
					248f160e73 | ||
| 
						 | 
					5151f90bb8 | ||
| 
						 | 
					402062110d | ||
| 
						 | 
					1c8f23dea1 | ||
| 
						 | 
					5ee22b3481 | ||
| 
						 | 
					322a7bd5a8 | ||
| 
						 | 
					0e30fba72d | ||
| 
						 | 
					1c77ef142c | ||
| 
						 | 
					853764d863 | ||
| 
						 | 
					d0ab59f9da | ||
| 
						 | 
					21e08709cb | ||
| 
						 | 
					a1aa99837b | ||
| 
						 | 
					037264b0bf | ||
| 
						 | 
					1a06702dbe | ||
| 
						 | 
					666bb41697 | ||
| 
						 | 
					e254fafb5c | ||
| 
						 | 
					1dc1cc6c24 | ||
| 
						 | 
					baa5d10009 | ||
| 
						 | 
					ac2b9acccb | ||
| 
						 | 
					075d4deecb | ||
| 
						 | 
					ac11f898d4 | ||
| 
						 | 
					dd31de6935 | ||
| 
						 | 
					9e811e722f | ||
| 
						 | 
					8ef53d85c4 | ||
| 
						 | 
					abcc5cb023 | ||
| 
						 | 
					931871ff95 | ||
| 
						 | 
					6b1e8862ef | ||
| 
						 | 
					00ce246fc5 | ||
| 
						 | 
					c0c7d96429 | ||
| 
						 | 
					92b2582d0d | ||
| 
						 | 
					4084a1ac86 | ||
| 
						 | 
					cb1a1c2616 | ||
| 
						 | 
					ce6c1f173e | ||
| 
						 | 
					30a4888363 | ||
| 
						 | 
					b0917a9866 | ||
| 
						 | 
					464e5de947 | ||
| 
						 | 
					47a07da17d | ||
| 
						 | 
					ec4c443299 | ||
| 
						 | 
					3122168b0e | ||
| 
						 | 
					da3af4b3db | ||
| 
						 | 
					850fa28bf6 | ||
| 
						 | 
					270684c5fd | ||
| 
						 | 
					afa1589cb5 | ||
| 
						 | 
					18a94d938f | ||
| 
						 | 
					d026bc2134 | ||
| 
						 | 
					c0b7276787 | ||
| 
						 | 
					bb8342f62b | ||
| 
						 | 
					0d8dad1559 | ||
| 
						 | 
					c1ef701eb2 | ||
| 
						 | 
					c6a181a2e7 | ||
| 
						 | 
					981392ea07 | ||
| 
						 | 
					5928a102a6 | ||
| 
						 | 
					c748569433 | ||
| 
						 | 
					a87fc51fbb | ||
| 
						 | 
					e07cfc9394 | ||
| 
						 | 
					32a0baa7a3 | ||
| 
						 | 
					f06427cb3e | ||
| 
						 | 
					9ae4e66c91 | ||
| 
						 | 
					eeab6e9bde | ||
| 
						 | 
					cabc410e0a | ||
| 
						 | 
					2dcff00fa7 | ||
| 
						 | 
					94cdce3551 | ||
| 
						 | 
					a7948ce83e | ||
| 
						 | 
					74faf1bd48 | ||
| 
						 | 
					3e7527d55c | ||
| 
						 | 
					9733674d6e | ||
| 
						 | 
					e05dbadea2 | ||
| 
						 | 
					bc512f3766 | ||
| 
						 | 
					ae51e2e437 | ||
| 
						 | 
					0e06a7b403 | ||
| 
						 | 
					ff7df9ad1e | ||
| 
						 | 
					1069a45cfc | ||
| 
						 | 
					d13d59bfa0 | ||
| 
						 | 
					55d3ab5e8a | ||
| 
						 | 
					c073a21ba6 | ||
| 
						 | 
					ed8137726d | ||
| 
						 | 
					3ebdab5e51 | ||
| 
						 | 
					35d1b894e2 | ||
| 
						 | 
					7c54ec4f9f | ||
| 
						 | 
					cbcfd44016 | ||
| 
						 | 
					a296bc2b81 | ||
| 
						 | 
					06b9e0fa97 | ||
| 
						 | 
					4374a6fa28 | ||
| 
						 | 
					67883519ee | ||
| 
						 | 
					6f1b5b4ae3 | ||
| 
						 | 
					c3b7e7869e | ||
| 
						 | 
					d48cc2deee | ||
| 
						 | 
					64b9d4c24a | ||
| 
						 | 
					88bcb6078e | ||
| 
						 | 
					5f9f3cd8e8 | ||
| 
						 | 
					814b404614 | ||
| 
						 | 
					ba2bb2180b | ||
| 
						 | 
					72cdb352f0 | ||
| 
						 | 
					cedf942c0c | ||
| 
						 | 
					27506a3757 | ||
| 
						 | 
					acc4e03c88 | ||
| 
						 | 
					9a6090cd02 | ||
| 
						 | 
					f40c9fa6f9 | ||
| 
						 | 
					e7cdb334de | ||
| 
						 | 
					afca6cd2e9 | ||
| 
						 | 
					3c324cbea0 | ||
| 
						 | 
					56b9708ab7 | ||
| 
						 | 
					e6e5b6a64a | ||
| 
						 | 
					58da916d18 | ||
| 
						 | 
					a0327b56aa | ||
| 
						 | 
					57d60128a2 | ||
| 
						 | 
					987740c649 | ||
| 
						 | 
					944505a5f1 | ||
| 
						 | 
					c5187d8509 | ||
| 
						 | 
					c7b73bdc3f | ||
| 
						 | 
					7483e886f1 | ||
| 
						 | 
					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 | 
							
								
								
									
										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"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										28
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								README.md
									
									
									
									
									
								
							@@ -84,7 +84,6 @@ Documentation will be generated in `target/docs`.
 | 
			
		||||
## Deploying Open MCT
 | 
			
		||||
 | 
			
		||||
Open MCT is built using [`npm`](http://npmjs.com/)
 | 
			
		||||
and [`gulp`](http://gulpjs.com/).
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
instance (e.g. by starting an HTTP server in that directory), including:
 | 
			
		||||
 | 
			
		||||
* A `main.js` file containing Open MCT source code.
 | 
			
		||||
* Various assets in the `example` and `platform` directories.
 | 
			
		||||
* An `index.html` that runs Open MCT in its default 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.
 | 
			
		||||
* `openmct.js` - Open MCT source code.
 | 
			
		||||
* `openmct.css` - Basic styles to load to prevent a FOUC.
 | 
			
		||||
* `index.html`, an example to run Open MCT in the basic configuration.
 | 
			
		||||
 | 
			
		||||
## 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:
 | 
			
		||||
 | 
			
		||||
`npm test`
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										129
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										129
									
								
								app.js
									
									
									
									
									
								
							@@ -7,79 +7,72 @@
 | 
			
		||||
 * node app.js [options]
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
(function () {
 | 
			
		||||
    "use strict";
 | 
			
		||||
 | 
			
		||||
    var BUNDLE_FILE = 'bundles.json',
 | 
			
		||||
        options = require('minimist')(process.argv.slice(2)),
 | 
			
		||||
        express = require('express'),
 | 
			
		||||
        app = express(),
 | 
			
		||||
        fs = require('fs'),
 | 
			
		||||
        request = require('request');
 | 
			
		||||
const options = require('minimist')(process.argv.slice(2));
 | 
			
		||||
const express = require('express');
 | 
			
		||||
const app = express();
 | 
			
		||||
const fs = require('fs');
 | 
			
		||||
const request = require('request');
 | 
			
		||||
 | 
			
		||||
    // Defaults
 | 
			
		||||
    options.port = options.port || options.p || 8080;
 | 
			
		||||
    options.host = options.host || options.h || 'localhost'
 | 
			
		||||
    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);
 | 
			
		||||
// Defaults
 | 
			
		||||
options.port = options.port || options.p || 8080;
 | 
			
		||||
options.host = options.host || options.h || 'localhost';
 | 
			
		||||
options.directory = options.directory || options.D || '.';
 | 
			
		||||
 | 
			
		||||
    // Show command line options
 | 
			
		||||
    if (options.help || options.h) {
 | 
			
		||||
        console.log("\nUsage: node app.js [options]\n");
 | 
			
		||||
        console.log("Options:");
 | 
			
		||||
        console.log("  --help, -h               Show this message.");
 | 
			
		||||
        console.log("  --port, -p <number>      Specify port.");
 | 
			
		||||
        console.log("  --include, -i <bundle>   Include the specified bundle.");
 | 
			
		||||
        console.log("  --exclude, -x <bundle>   Exclude the specified bundle.");
 | 
			
		||||
        console.log("  --directory, -D <bundle>   Serve files from specified directory.");
 | 
			
		||||
        console.log("");
 | 
			
		||||
        process.exit(0);
 | 
			
		||||
// Show command line options
 | 
			
		||||
if (options.help || options.h) {
 | 
			
		||||
    console.log("\nUsage: node app.js [options]\n");
 | 
			
		||||
    console.log("Options:");
 | 
			
		||||
    console.log("  --help, -h               Show this message.");
 | 
			
		||||
    console.log("  --port, -p <number>      Specify port.");
 | 
			
		||||
    console.log("  --directory, -D <bundle>   Serve files from specified directory.");
 | 
			
		||||
    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 {
 | 
			
		||||
            bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8'));
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
            bundles = [];
 | 
			
		||||
        }
 | 
			
		||||
// Expose index.html for development users.
 | 
			
		||||
app.get('/', function (req, res) {
 | 
			
		||||
    fs.createReadStream('index.html').pipe(res);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
        // Handle command line inclusions/exclusions
 | 
			
		||||
        bundles = bundles.concat(options.include);
 | 
			
		||||
        bundles = bundles.filter(function (bundle) {
 | 
			
		||||
            return options.exclude.indexOf(bundle) === -1;
 | 
			
		||||
        });
 | 
			
		||||
        bundles = bundles.filter(function (bundle, index) { // Uniquify
 | 
			
		||||
            return bundles.indexOf(bundle) === index;
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        res.send(JSON.stringify(bundles));
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    app.use('/proxyUrl', function proxyRequest(req, res, next) {
 | 
			
		||||
        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)
 | 
			
		||||
    });
 | 
			
		||||
}());
 | 
			
		||||
// 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
 | 
			
		||||
@@ -18,9 +18,4 @@
 | 
			
		||||
 licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div
 | 
			
		||||
	class="l-fixed-position-box"
 | 
			
		||||
	ng-style="{ background: ngModel.fill(), border: '1px ' + ngModel.stroke() + ' solid' }"
 | 
			
		||||
	>
 | 
			
		||||
</div>
 | 
			
		||||
-->
 | 
			
		||||
							
								
								
									
										21
									
								
								copyright-notice.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								copyright-notice.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * 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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
@@ -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,24 +0,0 @@
 | 
			
		||||
<!--
 | 
			
		||||
 Open MCT, Copyright (c) 2014-2017, United States Government
 | 
			
		||||
 as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 Administration. All rights reserved.
 | 
			
		||||
 | 
			
		||||
 Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 You may obtain a copy of the License at
 | 
			
		||||
 http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 | 
			
		||||
 Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 License for the specific language governing permissions and limitations
 | 
			
		||||
 under the License.
 | 
			
		||||
 | 
			
		||||
 Open MCT includes source code licensed under additional open source
 | 
			
		||||
 licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<p>Hello, world! I am the default route.</p>
 | 
			
		||||
<p ng-controller="ExampleController">My controller has told me: "{{phrase}}"</p>
 | 
			
		||||
<span example-directive></span>
 | 
			
		||||
@@ -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,46 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2017, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
/*global define,Promise*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining ExampleService. Created by vwoeltje on 11/4/14.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    [],
 | 
			
		||||
    function () {
 | 
			
		||||
        "use strict";
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         *
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function ExampleService() {
 | 
			
		||||
            return {
 | 
			
		||||
                getMessage: function () {
 | 
			
		||||
                    return "I heard this from a service";
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return ExampleService;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -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,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;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -49,7 +49,7 @@ define([
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "eventGenerator",
 | 
			
		||||
                    "name": "Event Message Generator",
 | 
			
		||||
                    "cssClass": "icon-folder-new",
 | 
			
		||||
                    "cssClass": "icon-generator-events",
 | 
			
		||||
                    "description": "For development use. Creates sample event message data that mimics a live data stream.",
 | 
			
		||||
                    "priority": 10,
 | 
			
		||||
                    "features": "creation",
 | 
			
		||||
 
 | 
			
		||||
@@ -22,24 +22,23 @@
 | 
			
		||||
/*global define */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining EventTelemetry. 
 | 
			
		||||
 * Module defining EventTelemetry.
 | 
			
		||||
 * Created by chacskaylo on 06/18/2015.
 | 
			
		||||
 * Modified by shale on 06/23/2015. 
 | 
			
		||||
 * Modified by shale on 06/23/2015.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ['text!../data/transcript.json'],
 | 
			
		||||
    function (transcript) {
 | 
			
		||||
    ['../data/transcript.json'],
 | 
			
		||||
    function (messages) {
 | 
			
		||||
        "use strict";
 | 
			
		||||
 | 
			
		||||
        var firstObservedTime = Date.now(),
 | 
			
		||||
            messages = JSON.parse(transcript);
 | 
			
		||||
        
 | 
			
		||||
        var firstObservedTime = Date.now();
 | 
			
		||||
 | 
			
		||||
        function EventTelemetry(request, interval) {
 | 
			
		||||
 | 
			
		||||
            var latestObservedTime = Date.now(),
 | 
			
		||||
                count = Math.floor((latestObservedTime - firstObservedTime) / interval),
 | 
			
		||||
                generatorData = {};
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            generatorData.getPointCount = function () {
 | 
			
		||||
                return count;
 | 
			
		||||
            };
 | 
			
		||||
@@ -48,13 +47,13 @@ define(
 | 
			
		||||
                return i * interval +
 | 
			
		||||
                        (domain !== 'delta' ? firstObservedTime : 0);
 | 
			
		||||
            };
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
	        generatorData.getRangeValue = function (i, range) {
 | 
			
		||||
		        var domainDelta = this.getDomainValue(i) - firstObservedTime,
 | 
			
		||||
                    ind = i % messages.length;
 | 
			
		||||
                return messages[ind] + " - [" + domainDelta.toString() + "]";
 | 
			
		||||
	        };
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            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,29 +27,35 @@ define([
 | 
			
		||||
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
    var RED = 0.9,
 | 
			
		||||
        YELLOW = 0.5,
 | 
			
		||||
    var RED = {
 | 
			
		||||
            sin: 0.9, 
 | 
			
		||||
            cos: 0.9
 | 
			
		||||
        },
 | 
			
		||||
        YELLOW = {
 | 
			
		||||
            sin: 0.5,
 | 
			
		||||
            cos: 0.5
 | 
			
		||||
        },
 | 
			
		||||
        LIMITS = {
 | 
			
		||||
            rh: {
 | 
			
		||||
                cssClass: "s-limit-upr s-limit-red",
 | 
			
		||||
                cssClass: "is-limit--upr is-limit--red",
 | 
			
		||||
                low: RED,
 | 
			
		||||
                high: Number.POSITIVE_INFINITY,
 | 
			
		||||
                name: "Red High"
 | 
			
		||||
            },
 | 
			
		||||
            rl: {
 | 
			
		||||
                cssClass: "s-limit-lwr s-limit-red",
 | 
			
		||||
                cssClass: "is-limit--lwr is-limit--red",
 | 
			
		||||
                high: -RED,
 | 
			
		||||
                low: Number.NEGATIVE_INFINITY,
 | 
			
		||||
                name: "Red Low"
 | 
			
		||||
            },
 | 
			
		||||
            yh: {
 | 
			
		||||
                cssClass: "s-limit-upr s-limit-yellow",
 | 
			
		||||
                cssClass: "is-limit--upr is-limit--yellow",
 | 
			
		||||
                low: YELLOW,
 | 
			
		||||
                high: RED,
 | 
			
		||||
                name: "Yellow High"
 | 
			
		||||
            },
 | 
			
		||||
            yl: {
 | 
			
		||||
                cssClass: "s-limit-lwr s-limit-yellow",
 | 
			
		||||
                cssClass: "is-limit--lwr is-limit--yellow",
 | 
			
		||||
                low: -RED,
 | 
			
		||||
                high: -YELLOW,
 | 
			
		||||
                name: "Yellow Low"
 | 
			
		||||
@@ -67,17 +73,18 @@ define([
 | 
			
		||||
    SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) {
 | 
			
		||||
        return {
 | 
			
		||||
            evaluate: function (datum, valueMetadata) {
 | 
			
		||||
                var range = valueMetadata ? valueMetadata.key : 'sin'
 | 
			
		||||
                if (datum[range] > RED) {
 | 
			
		||||
                var range = valueMetadata && valueMetadata.key;
 | 
			
		||||
                
 | 
			
		||||
                if (datum[range] > RED[range]) {
 | 
			
		||||
                    return LIMITS.rh;
 | 
			
		||||
                }
 | 
			
		||||
                if (datum[range] < -RED) {
 | 
			
		||||
                if (datum[range] < -RED[range]) {
 | 
			
		||||
                    return LIMITS.rl;
 | 
			
		||||
                }
 | 
			
		||||
                if (datum[range] > YELLOW) {
 | 
			
		||||
                if (datum[range] > YELLOW[range]) {
 | 
			
		||||
                    return LIMITS.yh;
 | 
			
		||||
                }
 | 
			
		||||
                if (datum[range] < -YELLOW) {
 | 
			
		||||
                if (datum[range] < -YELLOW[range]) {
 | 
			
		||||
                    return LIMITS.yl;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define([
 | 
			
		||||
    'text!./generatorWorker.js',
 | 
			
		||||
    'raw-loader!./generatorWorker.js',
 | 
			
		||||
    'uuid'
 | 
			
		||||
], function (
 | 
			
		||||
    workerText,
 | 
			
		||||
 
 | 
			
		||||
@@ -38,20 +38,19 @@ define([
 | 
			
		||||
        openmct.types.addType("example.state-generator", {
 | 
			
		||||
            name: "State Generator",
 | 
			
		||||
            description: "For development use.  Generates test enumerated telemetry by cycling through a given set of states",
 | 
			
		||||
            cssClass: "icon-telemetry",
 | 
			
		||||
            cssClass: "icon-generator-telemetry",
 | 
			
		||||
            creatable: true,
 | 
			
		||||
            form: [
 | 
			
		||||
                {
 | 
			
		||||
                    name: "State Duration (seconds)",
 | 
			
		||||
                    control: "textfield",
 | 
			
		||||
                    control: "numberfield",
 | 
			
		||||
                    cssClass: "l-input-sm l-numeric",
 | 
			
		||||
                    key: "duration",
 | 
			
		||||
                    required: true,
 | 
			
		||||
                    property: [
 | 
			
		||||
                        "telemetry",
 | 
			
		||||
                        "duration"
 | 
			
		||||
                    ],
 | 
			
		||||
                    pattern: "^\\d*(\\.\\d*)?$"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            initialize: function (object) {
 | 
			
		||||
@@ -66,7 +65,7 @@ define([
 | 
			
		||||
        openmct.types.addType("generator", {
 | 
			
		||||
            name: "Sine Wave Generator",
 | 
			
		||||
            description: "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
 | 
			
		||||
            cssClass: "icon-telemetry",
 | 
			
		||||
            cssClass: "icon-generator-telemetry",
 | 
			
		||||
            creatable: true,
 | 
			
		||||
            form: [
 | 
			
		||||
                {
 | 
			
		||||
 
 | 
			
		||||
@@ -26,12 +26,16 @@ define([
 | 
			
		||||
    "./src/NotificationLaunchController",
 | 
			
		||||
    "./src/DialogLaunchIndicator",
 | 
			
		||||
    "./src/NotificationLaunchIndicator",
 | 
			
		||||
    "./res/dialog-launch.html",
 | 
			
		||||
    "./res/notification-launch.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    DialogLaunchController,
 | 
			
		||||
    NotificationLaunchController,
 | 
			
		||||
    DialogLaunchIndicator,
 | 
			
		||||
    NotificationLaunchIndicator,
 | 
			
		||||
    DialogLaunch,
 | 
			
		||||
    NotificationLaunch,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
) {
 | 
			
		||||
    "use strict";
 | 
			
		||||
@@ -41,11 +45,11 @@ define([
 | 
			
		||||
            "templates": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "dialogLaunchTemplate",
 | 
			
		||||
                    "templateUrl": "dialog-launch.html"
 | 
			
		||||
                    "template": DialogLaunch
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "notificationLaunchTemplate",
 | 
			
		||||
                    "templateUrl": "notification-launch.html"
 | 
			
		||||
                    "template": NotificationLaunch
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "controllers": [
 | 
			
		||||
 
 | 
			
		||||
@@ -51,76 +51,26 @@ define(
 | 
			
		||||
                return actionTexts[Math.floor(Math.random()*3)];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function getExampleActions() {
 | 
			
		||||
                var actions = [
 | 
			
		||||
                    {
 | 
			
		||||
                        label: "Try Again",
 | 
			
		||||
                        callback: function () {
 | 
			
		||||
                            $log.debug("Try Again pressed");
 | 
			
		||||
                        }
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        label: "Remove",
 | 
			
		||||
                        callback: function () {
 | 
			
		||||
                            $log.debug("Remove pressed");
 | 
			
		||||
                        }
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        label: "Cancel",
 | 
			
		||||
                        callback: function () {
 | 
			
		||||
                            $log.debug("Cancel pressed");
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                ];
 | 
			
		||||
 | 
			
		||||
                // Randomly remove some actions off the top; leave at least one
 | 
			
		||||
                actions.splice(0,Math.floor(Math.random() * actions.length));
 | 
			
		||||
 | 
			
		||||
                return actions;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function getExampleSeverity() {
 | 
			
		||||
                var severities = [
 | 
			
		||||
                    "info",
 | 
			
		||||
                    "alert",
 | 
			
		||||
                    "error"
 | 
			
		||||
                ];
 | 
			
		||||
                return severities[Math.floor(Math.random() * severities.length)];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Launch a new notification with a severity level of 'Error'.
 | 
			
		||||
             */
 | 
			
		||||
            $scope.newError = function(){
 | 
			
		||||
 | 
			
		||||
            $scope.newError = function () {
 | 
			
		||||
                notificationService.notify({
 | 
			
		||||
                    title: "Example error notification " + messageCounter++,
 | 
			
		||||
                    hint: "An error has occurred",
 | 
			
		||||
                    severity: "error",
 | 
			
		||||
                    primaryOption: {
 | 
			
		||||
                        label: 'Retry',
 | 
			
		||||
                        callback: function() {
 | 
			
		||||
                            $log.info('Retry clicked');
 | 
			
		||||
                        }
 | 
			
		||||
                    },
 | 
			
		||||
                    options: getExampleActions()});
 | 
			
		||||
                    severity: "error"
 | 
			
		||||
                });
 | 
			
		||||
            };
 | 
			
		||||
            /**
 | 
			
		||||
             * Launch a new notification with a severity of 'Alert'.
 | 
			
		||||
             */
 | 
			
		||||
            $scope.newAlert = function(){
 | 
			
		||||
 | 
			
		||||
            $scope.newAlert = function () {
 | 
			
		||||
                notificationService.notify({
 | 
			
		||||
                    title: "Alert notification " + (messageCounter++),
 | 
			
		||||
                    hint: "This is an alert message",
 | 
			
		||||
                    severity: "alert",
 | 
			
		||||
                    primaryOption: {
 | 
			
		||||
                        label: 'Retry',
 | 
			
		||||
                        callback: function() {
 | 
			
		||||
                            $log.info('Retry clicked');
 | 
			
		||||
                        }
 | 
			
		||||
                    },
 | 
			
		||||
                    options: getExampleActions()});
 | 
			
		||||
                    autoDismiss: true
 | 
			
		||||
                });
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -128,39 +78,42 @@ define(
 | 
			
		||||
             * Launch a new notification with a progress bar that is updated
 | 
			
		||||
             * periodically, tracking an ongoing process.
 | 
			
		||||
             */
 | 
			
		||||
            $scope.newProgress = function(){
 | 
			
		||||
 | 
			
		||||
            $scope.newProgress = function () {
 | 
			
		||||
                let progress = 0;
 | 
			
		||||
                var notificationModel = {
 | 
			
		||||
                    title: "Progress notification example",
 | 
			
		||||
                    severity: "info",
 | 
			
		||||
                    progress: 0,
 | 
			
		||||
                    actionText: getExampleActionText(),
 | 
			
		||||
                    unknownProgress: false
 | 
			
		||||
                    progress: progress,
 | 
			
		||||
                    actionText: getExampleActionText()
 | 
			
		||||
                };
 | 
			
		||||
                let notification;
 | 
			
		||||
 | 
			
		||||
                /**
 | 
			
		||||
                 * Simulate an ongoing process and update the progress bar.
 | 
			
		||||
                 * @param notification
 | 
			
		||||
                 */
 | 
			
		||||
                function incrementProgress(notificationModel) {
 | 
			
		||||
                    notificationModel.progress = Math.min(100, Math.floor(notificationModel.progress + Math.random() * 30));
 | 
			
		||||
                    notificationModel.progressText = ["Estimated time" +
 | 
			
		||||
                function incrementProgress() {
 | 
			
		||||
                    progress = Math.min(100, Math.floor(progress + Math.random() * 30))
 | 
			
		||||
                    let progressText = ["Estimated time" +
 | 
			
		||||
                    " remaining:" +
 | 
			
		||||
                    " about ", 60 - Math.floor((notificationModel.progress / 100) * 60), " seconds"].join(" ");
 | 
			
		||||
                    if (notificationModel.progress < 100) {
 | 
			
		||||
                        $timeout(function(){incrementProgress(notificationModel);}, 1000);
 | 
			
		||||
                    " about ", 60 - Math.floor((progress / 100) * 60), " seconds"].join(" ");
 | 
			
		||||
                    notification.progress(progress, progressText);
 | 
			
		||||
 | 
			
		||||
                    if (progress < 100) {
 | 
			
		||||
                        $timeout(function () {
 | 
			
		||||
                            incrementProgress(notificationModel);
 | 
			
		||||
                        }, 1000);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                notificationService.notify(notificationModel);
 | 
			
		||||
                incrementProgress(notificationModel);
 | 
			
		||||
                notification = notificationService.notify(notificationModel);
 | 
			
		||||
                incrementProgress();
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Launch a new notification with severity level of INFO.
 | 
			
		||||
             */
 | 
			
		||||
            $scope.newInfo = function(){
 | 
			
		||||
 | 
			
		||||
            $scope.newInfo = function () {
 | 
			
		||||
                notificationService.info({
 | 
			
		||||
                    title: "Example Info notification " + messageCounter++
 | 
			
		||||
                });
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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([
 | 
			
		||||
    "./src/ExampleStyleGuideModelProvider",
 | 
			
		||||
    "./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'
 | 
			
		||||
], function (
 | 
			
		||||
    ExampleStyleGuideModelProvider,
 | 
			
		||||
    MCTExample,
 | 
			
		||||
    introTemplate,
 | 
			
		||||
    standardsTemplate,
 | 
			
		||||
    colorsTemplate,
 | 
			
		||||
    statusTemplate,
 | 
			
		||||
    glyphsTemplate,
 | 
			
		||||
    controlsTemplate,
 | 
			
		||||
    inputTemplate,
 | 
			
		||||
    menusTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
) {
 | 
			
		||||
    legacyRegistry.register("example/styleguide", {
 | 
			
		||||
@@ -23,14 +39,14 @@ define([
 | 
			
		||||
                { "key": "styleguide.menus", "name": "Menus", "cssClass": "icon-page", "description": "Context menus, dropdowns" }
 | 
			
		||||
            ],
 | 
			
		||||
            "views": [
 | 
			
		||||
                { "key": "styleguide.intro", "type": "styleguide.intro", "templateUrl": "templates/intro.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.standards", "type": "styleguide.standards", "templateUrl": "templates/standards.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.colors", "type": "styleguide.colors", "templateUrl": "templates/colors.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.status", "type": "styleguide.status", "templateUrl": "templates/status.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.glyphs", "type": "styleguide.glyphs", "templateUrl": "templates/glyphs.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.controls", "type": "styleguide.controls", "templateUrl": "templates/controls.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.input", "type": "styleguide.input", "templateUrl": "templates/input.html", "editable": false },
 | 
			
		||||
                { "key": "styleguide.menus", "type": "styleguide.menus", "templateUrl": "templates/menus.html", "editable": false }
 | 
			
		||||
                { "key": "styleguide.intro", "type": "styleguide.intro", "template": introTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.standards", "type": "styleguide.standards", "template": standardsTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.colors", "type": "styleguide.colors", "template": colorsTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.status", "type": "styleguide.status", "template": statusTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.glyphs", "type": "styleguide.glyphs", "template": glyphsTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.controls", "type": "styleguide.controls", "template": controlsTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.input", "type": "styleguide.input", "template": inputTemplate, "editable": false },
 | 
			
		||||
                { "key": "styleguide.menus", "type": "styleguide.menus", "template": menusTemplate, "editable": false }
 | 
			
		||||
            ],
 | 
			
		||||
            "roots": [
 | 
			
		||||
                {
 | 
			
		||||
@@ -85,16 +101,6 @@ define([
 | 
			
		||||
                        "$q"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "stylesheets": [
 | 
			
		||||
                {
 | 
			
		||||
                    "stylesheetUrl": "css/style-guide-espresso.css",
 | 
			
		||||
                    "theme": "espresso"
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "stylesheetUrl": "css/style-guide-snow.css",
 | 
			
		||||
                    "theme": "snow"
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -1,210 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2016, 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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
.l-style-guide {
 | 
			
		||||
    font-size: 0.9em;
 | 
			
		||||
    text-align: justify;
 | 
			
		||||
    margin: auto 10%;
 | 
			
		||||
 | 
			
		||||
    a.link {
 | 
			
		||||
        color: $colorKey;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    h1, h2, strong, b {
 | 
			
		||||
        color: pullForward($colorBodyFg, 50%);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    h2 {
 | 
			
		||||
        font-size: 1.25em;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    h3 {
 | 
			
		||||
        font-size: 0.9em;
 | 
			
		||||
        margin: $interiorMargin 0;
 | 
			
		||||
        &:not(:first-child) {
 | 
			
		||||
            margin-top: $interiorMarginLg * 2;
 | 
			
		||||
        }
 | 
			
		||||
        text-transform: uppercase;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    strong, b {
 | 
			
		||||
        font-weight: normal;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .w-markup {
 | 
			
		||||
        //Wrap markup example "pre" element
 | 
			
		||||
        background-color: $colorCode;
 | 
			
		||||
        border-radius: $interiorMargin;
 | 
			
		||||
        display: block;
 | 
			
		||||
        padding: $interiorMarginLg $interiorMarginLg;
 | 
			
		||||
        position: relative;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .w-mct-example {
 | 
			
		||||
        color: #ccc;
 | 
			
		||||
        > div { margin-bottom: $interiorMarginLg; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    code,
 | 
			
		||||
    pre {
 | 
			
		||||
        font-size: 0.8rem;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    code {
 | 
			
		||||
        background-color: $colorCode;
 | 
			
		||||
        border-radius: $controlCr;
 | 
			
		||||
        display: inline-block;
 | 
			
		||||
        padding: 1px $interiorMargin;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pre {
 | 
			
		||||
        display: block;
 | 
			
		||||
        margin: 0;
 | 
			
		||||
        max-height: 300px;
 | 
			
		||||
        overflow: auto;
 | 
			
		||||
        padding-bottom: $interiorMarginLg;
 | 
			
		||||
        white-space: pre;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    table, ul {
 | 
			
		||||
        margin-bottom: $interiorMarginLg;
 | 
			
		||||
        width: auto;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .themed {
 | 
			
		||||
        display: none; // Each themed styleguide file will set this to block.
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .doc-title {
 | 
			
		||||
        color: rgba(#fff, 0.3);
 | 
			
		||||
        text-transform: uppercase;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .l-section {
 | 
			
		||||
        border-top: 1px solid rgba(#999, 0.3);
 | 
			
		||||
        margin-top: 2em;
 | 
			
		||||
        padding-top: 1em;
 | 
			
		||||
 | 
			
		||||
        .cols {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-direction: row;
 | 
			
		||||
 | 
			
		||||
            .col {
 | 
			
		||||
                flex: 1 1 auto;
 | 
			
		||||
                &:not(:last-child) {
 | 
			
		||||
                    $v: $interiorMargin * 4;
 | 
			
		||||
                    border-right: 1px solid $colorInteriorBorder;
 | 
			
		||||
                    margin-right: $v;
 | 
			
		||||
                    padding-right: $v;
 | 
			
		||||
                }
 | 
			
		||||
                min-width: 300px;
 | 
			
		||||
                img {
 | 
			
		||||
                    width: 100%;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            &.cols1-1 {
 | 
			
		||||
                // 2 cols, equal width
 | 
			
		||||
                .col {
 | 
			
		||||
                    width: 50%;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            &.cols1-2 {
 | 
			
		||||
                // 3 cols, first is 1/3 of the width
 | 
			
		||||
                .col:first-child {
 | 
			
		||||
                    width: 33%;
 | 
			
		||||
                }
 | 
			
		||||
                .col:last-child {
 | 
			
		||||
                    width: 66%;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            &.cols2-1 {
 | 
			
		||||
                // 3 cols, first is 2/3 of the width
 | 
			
		||||
                .col:first-child {
 | 
			
		||||
                    width: 66%;
 | 
			
		||||
                }
 | 
			
		||||
                .col:last-child {
 | 
			
		||||
                    width: 33%;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Example grid of glyphs
 | 
			
		||||
    .items-holder.grid {
 | 
			
		||||
        table.details {
 | 
			
		||||
            width: 100%;
 | 
			
		||||
            td {
 | 
			
		||||
                font-size: inherit;
 | 
			
		||||
                &.label {
 | 
			
		||||
                    color: pushBack($colorBodyFg, 10%);
 | 
			
		||||
                    text-transform: uppercase;
 | 
			
		||||
                    white-space: nowrap;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        .item.glyph-item,
 | 
			
		||||
        .item.swatch-item {
 | 
			
		||||
            margin-bottom: 50px;
 | 
			
		||||
            margin-right: 10px;
 | 
			
		||||
            position: relative;
 | 
			
		||||
            text-align: left;
 | 
			
		||||
            .glyph {
 | 
			
		||||
                color: $colorGlyphExample;
 | 
			
		||||
                font-size: 5em;
 | 
			
		||||
                margin: $interiorMarginLg 0;
 | 
			
		||||
                text-align: center;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .item.glyph-item {
 | 
			
		||||
            width: 225px;
 | 
			
		||||
            height: 200px;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .item.swatch-item {
 | 
			
		||||
            $h: 150px;
 | 
			
		||||
            $d: 75px;
 | 
			
		||||
            width: 200px;
 | 
			
		||||
            height: $h;
 | 
			
		||||
            .glyph {
 | 
			
		||||
                text-shadow: 0px 1px 10px rgba(black, 0.3);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .h-swatch {
 | 
			
		||||
                position: relative;
 | 
			
		||||
                height: $d + $interiorMarginLg;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .swatch {
 | 
			
		||||
                height: $d; width: $d;
 | 
			
		||||
                border: 1px solid $colorInteriorBorder;
 | 
			
		||||
                border-radius: 15%;
 | 
			
		||||
                position: absolute;
 | 
			
		||||
                left: 50%;
 | 
			
		||||
                transform: translateX(-50%);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1,37 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2015, 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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
@import "bourbon";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/constants";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/mixins";
 | 
			
		||||
@import "../../../../platform/commonUI/themes/espresso/res/sass/constants";
 | 
			
		||||
@import "../../../../platform/commonUI/themes/espresso/res/sass/mixins";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/glyphs";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/icons";
 | 
			
		||||
 | 
			
		||||
// Thematic constants
 | 
			
		||||
$colorCode: rgba(black, 0.2);
 | 
			
		||||
$colorGlyphExample: #fff;
 | 
			
		||||
 | 
			
		||||
@import "style-guide-base";
 | 
			
		||||
 | 
			
		||||
div.themed.espresso { display: block; }
 | 
			
		||||
span.themed.espresso { display: inline; }
 | 
			
		||||
@@ -1,37 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2015, 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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
@import "bourbon";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/constants";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/mixins";
 | 
			
		||||
@import "../../../../platform/commonUI/themes/snow/res/sass/constants";
 | 
			
		||||
@import "../../../../platform/commonUI/themes/snow/res/sass/mixins";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/glyphs";
 | 
			
		||||
@import "../../../../platform/commonUI/general/res/sass/icons";
 | 
			
		||||
 | 
			
		||||
// Thematic constants
 | 
			
		||||
$colorCode: rgba(black, 0.1);
 | 
			
		||||
$colorGlyphExample: darken($colorBodyBg, 30%);
 | 
			
		||||
 | 
			
		||||
@import "style-guide-base";
 | 
			
		||||
 | 
			
		||||
div.themed.snow { display: block; }
 | 
			
		||||
span.themed.snow { display: inline; }
 | 
			
		||||
@@ -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>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col">
 | 
			
		||||
                <img src="/example/styleguide/res/images/diagram-objects.svg" />
 | 
			
		||||
                <img src="../images/diagram-objects.svg" />
 | 
			
		||||
            </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>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col">
 | 
			
		||||
                <img src="/example/styleguide/res/images/diagram-containment.svg" />
 | 
			
		||||
                <img src="../images/diagram-containment.svg" />
 | 
			
		||||
            </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>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col">
 | 
			
		||||
                <img src="/example/styleguide/res/images/diagram-views.svg" />
 | 
			
		||||
                <img src="../images/diagram-views.svg" />
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -70,4 +70,4 @@
 | 
			
		||||
    <p></p>
 | 
			
		||||
    <p></p>
 | 
			
		||||
    <p></p>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
define([
 | 
			
		||||
    'text!../res/templates/mct-example.html'
 | 
			
		||||
    '../res/templates/mct-example.html'
 | 
			
		||||
], function (
 | 
			
		||||
    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' ]);
 | 
			
		||||
							
								
								
									
										114
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										114
									
								
								index.html
									
									
									
									
									
								
							@@ -26,65 +26,63 @@
 | 
			
		||||
        <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">
 | 
			
		||||
        <title></title>
 | 
			
		||||
        <script src="bower_components/requirejs/require.js"> </script>
 | 
			
		||||
        <script>
 | 
			
		||||
            var THIRTY_MINUTES = 30 * 60 * 1000;
 | 
			
		||||
 | 
			
		||||
            require(['openmct'], function (openmct) {
 | 
			
		||||
                [
 | 
			
		||||
                    '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">
 | 
			
		||||
        <script src="dist/openmct.js"></script>
 | 
			
		||||
        <link rel="stylesheet" href="dist/styles/openmct.css">
 | 
			
		||||
        <link rel="icon" type="image/png" href="dist/favicons/favicon-32x32.png" sizes="32x32">
 | 
			
		||||
        <link rel="icon" type="image/png" href="dist/favicons/favicon-96x96.png" sizes="96x96">
 | 
			
		||||
        <link rel="icon" type="image/png" href="dist/favicons/favicon-16x16.png" sizes="16x16">
 | 
			
		||||
        <link rel="shortcut icon" href="dist/favicons/favicon.ico">
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
        <div class="l-splash-holder s-splash-holder">
 | 
			
		||||
            <div class="l-splash s-splash"></div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </body>
 | 
			
		||||
    <script>
 | 
			
		||||
        const FIVE_MINUTES = 5 * 60 * 1000;
 | 
			
		||||
        const 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: - THIRTY_MINUTES,
 | 
			
		||||
                        end: FIVE_MINUTES
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        }));
 | 
			
		||||
        openmct.install(openmct.plugins.SummaryWidget());
 | 
			
		||||
        openmct.install(openmct.plugins.Notebook());
 | 
			
		||||
        openmct.install(openmct.plugins.FolderView());
 | 
			
		||||
        openmct.install(openmct.plugins.Tabs());
 | 
			
		||||
        openmct.install(openmct.plugins.FlexibleLayout());
 | 
			
		||||
        openmct.install(openmct.plugins.LADTable());
 | 
			
		||||
        openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay']));
 | 
			
		||||
        openmct.install(openmct.plugins.ObjectMigration());
 | 
			
		||||
        openmct.start();
 | 
			
		||||
    </script>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -21,70 +21,40 @@
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/*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({
 | 
			
		||||
 | 
			
		||||
        // Base path that will be used to resolve all file patterns.
 | 
			
		||||
        basePath: '',
 | 
			
		||||
 | 
			
		||||
        // 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.
 | 
			
		||||
        frameworks: ['jasmine'],
 | 
			
		||||
        files: [
 | 
			
		||||
            {pattern: 'bower_components/**/*.js', included: false},
 | 
			
		||||
            {pattern: 'node_modules/d3-*/**/*.js', included: false},
 | 
			
		||||
            {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'
 | 
			
		||||
            'platform/**/*Spec.js',
 | 
			
		||||
            'src/**/*Spec.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,
 | 
			
		||||
 | 
			
		||||
        // Wnable / disable colors in the output (reporters and logs).
 | 
			
		||||
        reporters: [
 | 
			
		||||
            'progress',
 | 
			
		||||
            'coverage',
 | 
			
		||||
            'html'
 | 
			
		||||
        ],
 | 
			
		||||
        browsers: ['ChromeHeadless'],
 | 
			
		||||
        colors: true,
 | 
			
		||||
 | 
			
		||||
        logLevel: config.LOG_INFO,
 | 
			
		||||
 | 
			
		||||
        // Rerun tests when any file changes.
 | 
			
		||||
        autoWatch: true,
 | 
			
		||||
 | 
			
		||||
        // Specify browsers to run tests in.
 | 
			
		||||
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
 | 
			
		||||
        browsers: [
 | 
			
		||||
            'ChromeHeadless'
 | 
			
		||||
        ],
 | 
			
		||||
 | 
			
		||||
        // Code coverage reporting.
 | 
			
		||||
        coverageReporter: {
 | 
			
		||||
            dir: process.env.CIRCLE_ARTIFACTS ?
 | 
			
		||||
                process.env.CIRCLE_ARTIFACTS + '/coverage' :
 | 
			
		||||
@@ -104,8 +74,19 @@ module.exports = function(config) {
 | 
			
		||||
            foldAll: false
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        // Continuous Integration mode.
 | 
			
		||||
        // If true, Karma captures browsers, runs the tests and exits.
 | 
			
		||||
        preprocessors: {
 | 
			
		||||
            // add webpack as preprocessor
 | 
			
		||||
            'platform/**/*Spec.js': [ 'webpack' ],
 | 
			
		||||
            'src/**/*Spec.js': [ 'webpack' ]
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
        webpack: webpackConfig,
 | 
			
		||||
 | 
			
		||||
        webpackMiddleware: {
 | 
			
		||||
            stats: 'errors-only',
 | 
			
		||||
            logLevel: 'warn'
 | 
			
		||||
        },
 | 
			
		||||
        singleRun: true
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										105
									
								
								openmct.js
									
									
									
									
									
								
							
							
						
						
									
										105
									
								
								openmct.js
									
									
									
									
									
								
							@@ -19,102 +19,19 @@
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
/*global requirejs,BUILD_CONSTANTS*/
 | 
			
		||||
/*global module,BUILD_CONSTANTS*/
 | 
			
		||||
 | 
			
		||||
requirejs.config({
 | 
			
		||||
    "paths": {
 | 
			
		||||
        "legacyRegistry": "src/legacyRegistry",
 | 
			
		||||
        "angular": "bower_components/angular/angular.min",
 | 
			
		||||
        "angular-route": "bower_components/angular-route/angular-route.min",
 | 
			
		||||
        "csv": "bower_components/comma-separated-values/csv.min",
 | 
			
		||||
        "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"
 | 
			
		||||
        }
 | 
			
		||||
const matcher = /\/openmct.js$/;
 | 
			
		||||
if (document.currentScript) {
 | 
			
		||||
    let src = document.currentScript.src;
 | 
			
		||||
    if (src && matcher.test(src)) {
 | 
			
		||||
        // eslint-disable-next-line no-undef
 | 
			
		||||
        __webpack_public_path__ = src.replace(matcher, '') + '/';
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
define([
 | 
			
		||||
    './platform/framework/src/Main',
 | 
			
		||||
    './src/defaultRegistry',
 | 
			
		||||
    './src/MCT',
 | 
			
		||||
    './src/plugins/buildInfo/plugin'
 | 
			
		||||
], function (Main, defaultRegistry, MCT, buildInfo) {
 | 
			
		||||
    var openmct = new MCT();
 | 
			
		||||
const MCT = require('./src/MCT');
 | 
			
		||||
 | 
			
		||||
    openmct.legacyRegistry = defaultRegistry;
 | 
			
		||||
    openmct.install(openmct.plugins.Plot());
 | 
			
		||||
var openmct = new MCT();
 | 
			
		||||
 | 
			
		||||
    if (typeof BUILD_CONSTANTS !== 'undefined') {
 | 
			
		||||
        openmct.install(buildInfo(BUILD_CONSTANTS));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    openmct.on('start', function () {
 | 
			
		||||
        return new Main().run(defaultRegistry);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return openmct;
 | 
			
		||||
});
 | 
			
		||||
module.exports = openmct;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										72
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										72
									
								
								package.json
									
									
									
									
									
								
							@@ -2,7 +2,15 @@
 | 
			
		||||
  "name": "openmct",
 | 
			
		||||
  "version": "0.14.0-SNAPSHOT",
 | 
			
		||||
  "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-axis": "1.0.x",
 | 
			
		||||
    "d3-collection": "1.0.x",
 | 
			
		||||
@@ -13,57 +21,69 @@
 | 
			
		||||
    "d3-selection": "1.3.x",
 | 
			
		||||
    "d3-time": "1.0.x",
 | 
			
		||||
    "d3-time-format": "2.1.x",
 | 
			
		||||
    "eslint": "5.2.0",
 | 
			
		||||
    "eventemitter3": "^1.2.0",
 | 
			
		||||
    "exports-loader": "^0.7.0",
 | 
			
		||||
    "express": "^4.13.1",
 | 
			
		||||
    "minimist": "^1.1.1",
 | 
			
		||||
    "painterro": "^0.2.65",
 | 
			
		||||
    "request": "^2.69.0",
 | 
			
		||||
    "vue": "^2.5.6"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "bower": "^1.7.7",
 | 
			
		||||
    "fast-sass-loader": "1.4.6",
 | 
			
		||||
    "file-loader": "^1.1.11",
 | 
			
		||||
    "file-saver": "^1.3.8",
 | 
			
		||||
    "git-rev-sync": "^1.4.0",
 | 
			
		||||
    "glob": ">= 3.0.0",
 | 
			
		||||
    "gulp": "^3.9.1",
 | 
			
		||||
    "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",
 | 
			
		||||
    "html-loader": "^0.5.5",
 | 
			
		||||
    "html2canvas": "^1.0.0-alpha.12",
 | 
			
		||||
    "imports-loader": "^0.8.0",
 | 
			
		||||
    "istanbul-instrumenter-loader": "^3.0.1",
 | 
			
		||||
    "jasmine-core": "^3.1.0",
 | 
			
		||||
    "jscs-html-reporter": "^0.1.0",
 | 
			
		||||
    "jsdoc": "^3.3.2",
 | 
			
		||||
    "jshint": "^2.7.0",
 | 
			
		||||
    "karma": "^2.0.3",
 | 
			
		||||
    "karma-chrome-launcher": "^2.2.0",
 | 
			
		||||
    "karma-cli": "^1.0.1",
 | 
			
		||||
    "karma-coverage": "^1.1.2",
 | 
			
		||||
    "karma-html-reporter": "^0.2.7",
 | 
			
		||||
    "karma-jasmine": "^1.1.2",
 | 
			
		||||
    "karma-requirejs": "^1.1.0",
 | 
			
		||||
    "karma-webpack": "^3.0.0",
 | 
			
		||||
    "location-bar": "^3.0.1",
 | 
			
		||||
    "lodash": "^3.10.1",
 | 
			
		||||
    "markdown-toc": "^0.11.7",
 | 
			
		||||
    "marked": "^0.3.5",
 | 
			
		||||
    "merge-stream": "^1.0.0",
 | 
			
		||||
    "mkdirp": "^0.5.1",
 | 
			
		||||
    "mini-css-extract-plugin": "^0.4.1",
 | 
			
		||||
    "minimist": "^1.1.1",
 | 
			
		||||
    "moment": "^2.11.1",
 | 
			
		||||
    "moment-duration-format": "^2.2.2",
 | 
			
		||||
    "moment-timezone": "^0.5.21",
 | 
			
		||||
    "node-bourbon": "^4.2.3",
 | 
			
		||||
    "node-sass": "^4.9.2",
 | 
			
		||||
    "painterro": "^0.2.65",
 | 
			
		||||
    "printj": "^1.1.0",
 | 
			
		||||
    "requirejs": "2.1.x",
 | 
			
		||||
    "raw-loader": "^0.5.1",
 | 
			
		||||
    "request": "^2.69.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": {
 | 
			
		||||
    "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",
 | 
			
		||||
    "jshint": "jshint platform example",
 | 
			
		||||
    "watch": "karma start",
 | 
			
		||||
    "test:watch": "karma start --no-single-run",
 | 
			
		||||
    "verify": "concurrently 'npm:test' 'npm:lint'",
 | 
			
		||||
    "jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
 | 
			
		||||
    "otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
 | 
			
		||||
    "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": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
 
 | 
			
		||||
@@ -21,17 +21,17 @@
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define([
 | 
			
		||||
    "text!./res/templates/about-dialog.html",
 | 
			
		||||
    "./res/templates/about-dialog.html",
 | 
			
		||||
    "./src/LogoController",
 | 
			
		||||
    "./src/AboutController",
 | 
			
		||||
    "./src/LicenseController",
 | 
			
		||||
    "text!./res/templates/app-logo.html",
 | 
			
		||||
    "text!./res/templates/about-logo.html",
 | 
			
		||||
    "text!./res/templates/overlay-about.html",
 | 
			
		||||
    "text!./res/templates/license-apache.html",
 | 
			
		||||
    "text!./res/templates/license-mit.html",
 | 
			
		||||
    "text!./res/templates/licenses.html",
 | 
			
		||||
    "text!./res/templates/licenses-export-md.html",
 | 
			
		||||
    "./res/templates/app-logo.html",
 | 
			
		||||
    "./res/templates/about-logo.html",
 | 
			
		||||
    "./res/templates/overlay-about.html",
 | 
			
		||||
    "./res/templates/license-apache.html",
 | 
			
		||||
    "./res/templates/license-mit.html",
 | 
			
		||||
    "./res/templates/licenses.html",
 | 
			
		||||
    "./res/templates/licenses-export-md.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    aboutDialogTemplate,
 | 
			
		||||
 
 | 
			
		||||
@@ -31,18 +31,15 @@ define([
 | 
			
		||||
    "./src/navigation/NavigateAction",
 | 
			
		||||
    "./src/navigation/OrphanNavigationHandler",
 | 
			
		||||
    "./src/windowing/NewTabAction",
 | 
			
		||||
    "./src/windowing/FullscreenAction",
 | 
			
		||||
    "./src/windowing/WindowTitler",
 | 
			
		||||
    "text!./res/templates/browse.html",
 | 
			
		||||
    "text!./res/templates/browse-object.html",
 | 
			
		||||
    "text!./res/templates/items/grid-item.html",
 | 
			
		||||
    "text!./res/templates/browse/object-header.html",
 | 
			
		||||
    "text!./res/templates/browse/object-header-frame.html",
 | 
			
		||||
    "text!./res/templates/menu-arrow.html",
 | 
			
		||||
    "text!./res/templates/back-arrow.html",
 | 
			
		||||
    "text!./res/templates/items/items.html",
 | 
			
		||||
    "text!./res/templates/browse/object-properties.html",
 | 
			
		||||
    "text!./res/templates/browse/inspector-region.html",
 | 
			
		||||
    "./res/templates/browse.html",
 | 
			
		||||
    "./res/templates/browse-object.html",
 | 
			
		||||
    "./res/templates/browse/object-header.html",
 | 
			
		||||
    "./res/templates/browse/object-header-frame.html",
 | 
			
		||||
    "./res/templates/menu-arrow.html",
 | 
			
		||||
    "./res/templates/back-arrow.html",
 | 
			
		||||
    "./res/templates/browse/object-properties.html",
 | 
			
		||||
    "./res/templates/browse/inspector-region.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    BrowseController,
 | 
			
		||||
@@ -55,16 +52,13 @@ define([
 | 
			
		||||
    NavigateAction,
 | 
			
		||||
    OrphanNavigationHandler,
 | 
			
		||||
    NewTabAction,
 | 
			
		||||
    FullscreenAction,
 | 
			
		||||
    WindowTitler,
 | 
			
		||||
    browseTemplate,
 | 
			
		||||
    browseObjectTemplate,
 | 
			
		||||
    gridItemTemplate,
 | 
			
		||||
    objectHeaderTemplate,
 | 
			
		||||
    objectHeaderFrameTemplate,
 | 
			
		||||
    menuArrowTemplate,
 | 
			
		||||
    backArrowTemplate,
 | 
			
		||||
    itemsTemplate,
 | 
			
		||||
    objectPropertiesTemplate,
 | 
			
		||||
    inspectorRegionTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
@@ -73,15 +67,6 @@ define([
 | 
			
		||||
    legacyRegistry.register("platform/commonUI/browse", {
 | 
			
		||||
        "extensions": {
 | 
			
		||||
            "routes": [
 | 
			
		||||
                {
 | 
			
		||||
                    "when": "/browse/:ids*?",
 | 
			
		||||
                    "template": browseTemplate,
 | 
			
		||||
                    "reloadOnSearch": false
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "when": "",
 | 
			
		||||
                    "redirectTo": "/browse/"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "constants": [
 | 
			
		||||
                {
 | 
			
		||||
@@ -165,19 +150,6 @@ define([
 | 
			
		||||
                        "view"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "grid-item",
 | 
			
		||||
                    "template": gridItemTemplate,
 | 
			
		||||
                    "uses": [
 | 
			
		||||
                        "type",
 | 
			
		||||
                        "action",
 | 
			
		||||
                        "location"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "gestures": [
 | 
			
		||||
                        "info",
 | 
			
		||||
                        "menu"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "object-header",
 | 
			
		||||
                    "template": objectHeaderTemplate,
 | 
			
		||||
@@ -251,30 +223,6 @@ define([
 | 
			
		||||
                    "group": "windowing",
 | 
			
		||||
                    "cssClass": "icon-new-window",
 | 
			
		||||
                    "priority": "preferred"
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fullscreen",
 | 
			
		||||
                    "implementation": FullscreenAction,
 | 
			
		||||
                    "category": "view-control",
 | 
			
		||||
                    "group": "windowing",
 | 
			
		||||
                    "priority": "default"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "views": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "items",
 | 
			
		||||
                    "name": "Grid",
 | 
			
		||||
                    "cssClass": "icon-thumbs-strip",
 | 
			
		||||
                    "description": "Grid of available items",
 | 
			
		||||
                    "template": itemsTemplate,
 | 
			
		||||
                    "uses": [
 | 
			
		||||
                        "composition"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "gestures": [
 | 
			
		||||
                        "drop"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "type": "folder",
 | 
			
		||||
                    "editable": false
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "runs": [
 | 
			
		||||
@@ -295,16 +243,18 @@ define([
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "licenses": [
 | 
			
		||||
            "templates": [
 | 
			
		||||
                {
 | 
			
		||||
                    "name": "screenfull.js",
 | 
			
		||||
                    "version": "1.2.0",
 | 
			
		||||
                    "description": "Wrapper for cross-browser usage of fullscreen API",
 | 
			
		||||
                    "author": "Sindre Sorhus",
 | 
			
		||||
                    "website": "https://github.com/sindresorhus/screenfull.js/",
 | 
			
		||||
                    "copyright": "Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
 | 
			
		||||
                    "license": "license-mit",
 | 
			
		||||
                    "link": "https://github.com/sindresorhus/screenfull.js/blob/gh-pages/license"
 | 
			
		||||
                    key: "browseRoot",
 | 
			
		||||
                    template: browseTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    key: "browseObject",
 | 
			
		||||
                    template: browseObjectTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    key: "inspectorRegion",
 | 
			
		||||
                    template: inspectorRegionTemplate
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -66,5 +66,4 @@
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <mct-include key="'conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,45 +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.
 | 
			
		||||
-->
 | 
			
		||||
<!-- For selected, add class 'selected' to outer div -->
 | 
			
		||||
<div class='item grid-item' ng-click='action.perform("navigate")'>
 | 
			
		||||
    <div class='contents abs'>
 | 
			
		||||
        <div class='top-bar bar abs'>
 | 
			
		||||
            <span class='icon-people' title='Shared'></span>
 | 
			
		||||
            <mct-representation class="desktop-hide" key="'info-button'" mct-object="domainObject"></mct-representation>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class='item-main abs lg'>
 | 
			
		||||
            <span class="t-item-icon" ng-class="{ 'l-icon-link':location.isLink() }">
 | 
			
		||||
                <span class="t-item-icon-glyph ng-binding {{type.getCssClass()}}"></span>
 | 
			
		||||
            </span>
 | 
			
		||||
            <div class='abs item-open icon-pointer-right'></div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class='bottom-bar bar abs'>
 | 
			
		||||
            <div class='title'>{{model.name}}</div>
 | 
			
		||||
            <div class='details'>
 | 
			
		||||
                <span>{{type.getName()}}</span>
 | 
			
		||||
                <span ng-show="model.composition !== undefined">
 | 
			
		||||
                    - {{model.composition.length}} Item<span ng-show="model.composition.length > 1">s</span>
 | 
			
		||||
                </span>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -47,6 +47,7 @@ define(
 | 
			
		||||
            urlService,
 | 
			
		||||
            defaultPath
 | 
			
		||||
        ) {
 | 
			
		||||
            window.browseScope = $scope;
 | 
			
		||||
            var initialPath = ($route.current.params.ids || defaultPath).split("/"),
 | 
			
		||||
                currentIds;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,6 @@ define(
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function BrowseObjectController($scope, $location, $route) {
 | 
			
		||||
            var navigatedObject;
 | 
			
		||||
            function setViewForDomainObject(domainObject) {
 | 
			
		||||
 | 
			
		||||
                var locationViewKey = $location.search().view;
 | 
			
		||||
@@ -47,7 +46,6 @@ define(
 | 
			
		||||
                    ((domainObject && domainObject.useCapability('view')) || [])
 | 
			
		||||
                        .forEach(selectViewIfMatching);
 | 
			
		||||
                }
 | 
			
		||||
                navigatedObject = domainObject;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function updateQueryParam(viewKey) {
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,7 @@ define([], function () {
 | 
			
		||||
 | 
			
		||||
        function checkNavigation() {
 | 
			
		||||
            var navigatedObject = navigationService.getNavigation();
 | 
			
		||||
            if (navigatedObject.hasCapability('context')) {
 | 
			
		||||
            if (navigatedObject && navigatedObject.hasCapability('context')) {
 | 
			
		||||
                if (!navigatedObject.getCapability('editor').isEditContextRoot()) {
 | 
			
		||||
                    preventOrphanNavigation(navigatedObject);
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,64 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining FullscreenAction. Created by vwoeltje on 11/18/14.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ["screenfull"],
 | 
			
		||||
    function (screenfull) {
 | 
			
		||||
 | 
			
		||||
        var ENTER_FULLSCREEN = "Enter full screen mode",
 | 
			
		||||
            EXIT_FULLSCREEN = "Exit full screen mode";
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The fullscreen action toggles between fullscreen display
 | 
			
		||||
         * and regular in-window display.
 | 
			
		||||
         * @memberof platform/commonUI/browse
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @implements {Action}
 | 
			
		||||
         */
 | 
			
		||||
        function FullscreenAction(context) {
 | 
			
		||||
            this.context = context;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        FullscreenAction.prototype.perform = function () {
 | 
			
		||||
            screenfull.toggle();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FullscreenAction.prototype.getMetadata = function () {
 | 
			
		||||
            // We override getMetadata, because the icon cssClass and
 | 
			
		||||
            // description need to be determined at run-time
 | 
			
		||||
            // based on whether or not we are currently
 | 
			
		||||
            // full screen.
 | 
			
		||||
            var metadata = Object.create(FullscreenAction);
 | 
			
		||||
            metadata.cssClass = screenfull.isFullscreen ? "icon-fullscreen-expand" : "icon-fullscreen-collapse";
 | 
			
		||||
            metadata.description = screenfull.isFullscreen ?
 | 
			
		||||
                EXIT_FULLSCREEN : ENTER_FULLSCREEN;
 | 
			
		||||
            metadata.group = "windowing";
 | 
			
		||||
            metadata.context = this.context;
 | 
			
		||||
            return metadata;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return FullscreenAction;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -161,7 +161,7 @@ define(
 | 
			
		||||
                instantiateController();
 | 
			
		||||
                return waitsForNavigation().then(function () {
 | 
			
		||||
                    expect(mockNavigationService.setNavigation)
 | 
			
		||||
                    .toHaveBeenCalledWith(mockDefaultRootObject);
 | 
			
		||||
                        .toHaveBeenCalledWith(mockDefaultRootObject);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
@@ -172,7 +172,7 @@ define(
 | 
			
		||||
 | 
			
		||||
                return waitsForNavigation().then(function () {
 | 
			
		||||
                    expect(mockNavigationService.setNavigation)
 | 
			
		||||
                    .toHaveBeenCalledWith(mockDefaultRootObject);
 | 
			
		||||
                        .toHaveBeenCalledWith(mockDefaultRootObject);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,6 @@ define(
 | 
			
		||||
        describe("The PaneController", function () {
 | 
			
		||||
            var mockScope,
 | 
			
		||||
                mockAgentService,
 | 
			
		||||
                mockDomainObjects,
 | 
			
		||||
                mockWindow,
 | 
			
		||||
                controller,
 | 
			
		||||
                mockLocation,
 | 
			
		||||
@@ -47,17 +46,6 @@ define(
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                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(
 | 
			
		||||
                    "agentService",
 | 
			
		||||
                    ["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ define([
 | 
			
		||||
            return action.perform()
 | 
			
		||||
                .then(function () {
 | 
			
		||||
                    expect(mockNavigationService.setNavigation)
 | 
			
		||||
                    .toHaveBeenCalledWith(mockDomainObject, true);
 | 
			
		||||
                        .toHaveBeenCalledWith(mockDomainObject, true);
 | 
			
		||||
                });
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,59 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ["../../src/windowing/FullscreenAction", "screenfull"],
 | 
			
		||||
    function (FullscreenAction, screenfull) {
 | 
			
		||||
 | 
			
		||||
        describe("The fullscreen action", function () {
 | 
			
		||||
            var action,
 | 
			
		||||
                oldToggle;
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                // Screenfull is not shimmed or injected, so
 | 
			
		||||
                // we need to spy on it in the global scope.
 | 
			
		||||
                oldToggle = screenfull.toggle;
 | 
			
		||||
 | 
			
		||||
                screenfull.toggle = jasmine.createSpy("toggle");
 | 
			
		||||
 | 
			
		||||
                action = new FullscreenAction({});
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            afterEach(function () {
 | 
			
		||||
                screenfull.toggle = oldToggle;
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("toggles fullscreen mode when performed", function () {
 | 
			
		||||
                action.perform();
 | 
			
		||||
                expect(window.screenfull.toggle).toHaveBeenCalled();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("provides displayable metadata", function () {
 | 
			
		||||
                expect(action.getMetadata().cssClass).toBeDefined();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -46,7 +46,7 @@ define(
 | 
			
		||||
                // tree is opened in a new tab using the
 | 
			
		||||
                // context menu
 | 
			
		||||
                mockContextSelected = jasmine.createSpyObj("context", ["selectedObject",
 | 
			
		||||
                                                               "domainObject"]);
 | 
			
		||||
                    "domainObject"]);
 | 
			
		||||
 | 
			
		||||
                // Mocks the urlService used to make the new tab's url from a
 | 
			
		||||
                // domainObject and mode
 | 
			
		||||
@@ -54,11 +54,11 @@ define(
 | 
			
		||||
 | 
			
		||||
                // Action done using the current context or mockContextCurrent
 | 
			
		||||
                actionCurrent = new NewTabAction(mockUrlService, mockWindow,
 | 
			
		||||
                                                 mockContextCurrent);
 | 
			
		||||
                    mockContextCurrent);
 | 
			
		||||
 | 
			
		||||
                // Action done using the selected context or mockContextSelected
 | 
			
		||||
                actionSelected = new NewTabAction(mockUrlService, mockWindow,
 | 
			
		||||
                                                  mockContextSelected);
 | 
			
		||||
                    mockContextSelected);
 | 
			
		||||
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ define(
 | 
			
		||||
                mockRootScope,
 | 
			
		||||
                mockDocument,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                titler;
 | 
			
		||||
                titler; // eslint-disable-line
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockNavigationService = jasmine.createSpyObj(
 | 
			
		||||
 
 | 
			
		||||
@@ -23,13 +23,14 @@
 | 
			
		||||
define([
 | 
			
		||||
    "./src/DialogService",
 | 
			
		||||
    "./src/OverlayService",
 | 
			
		||||
    "text!./res/templates/overlay-dialog.html",
 | 
			
		||||
    "text!./res/templates/overlay-options.html",
 | 
			
		||||
    "text!./res/templates/dialog.html",
 | 
			
		||||
    "text!./res/templates/overlay-blocking-message.html",
 | 
			
		||||
    "text!./res/templates/message.html",
 | 
			
		||||
    "text!./res/templates/overlay-message-list.html",
 | 
			
		||||
    "text!./res/templates/overlay.html",
 | 
			
		||||
    "./res/templates/overlay-dialog.html",
 | 
			
		||||
    "./res/templates/overlay-options.html",
 | 
			
		||||
    "./res/templates/dialog.html",
 | 
			
		||||
    "./res/templates/overlay-blocking-message.html",
 | 
			
		||||
    "./res/templates/message.html",
 | 
			
		||||
    "./res/templates/notification-message.html",
 | 
			
		||||
    "./res/templates/overlay-message-list.html",
 | 
			
		||||
    "./res/templates/overlay.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    DialogService,
 | 
			
		||||
@@ -39,6 +40,7 @@ define([
 | 
			
		||||
    dialogTemplate,
 | 
			
		||||
    overlayBlockingMessageTemplate,
 | 
			
		||||
    messageTemplate,
 | 
			
		||||
    notificationMessageTemplate,
 | 
			
		||||
    overlayMessageListTemplate,
 | 
			
		||||
    overlayTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
@@ -88,6 +90,10 @@ define([
 | 
			
		||||
                    "key": "message",
 | 
			
		||||
                    "template": messageTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "notification-message",
 | 
			
		||||
                    "template": notificationMessageTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "overlay-message-list",
 | 
			
		||||
                    "template": overlayMessageListTemplate
 | 
			
		||||
 
 | 
			
		||||
@@ -19,24 +19,24 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div class="abs top-bar">
 | 
			
		||||
    <div class="dialog-title">{{ngModel.title}}</div>
 | 
			
		||||
    <div class="hint">All fields marked <span class="req icon-asterisk"></span> are required.</div>
 | 
			
		||||
<div class="c-overlay__top-bar">
 | 
			
		||||
    <div class="c-overlay__dialog-title">{{ngModel.title}}</div>
 | 
			
		||||
    <div class="c-overlay__dialog-hint hint">All fields marked <span class="req icon-asterisk"></span> are required.</div>
 | 
			
		||||
</div>
 | 
			
		||||
<div class='abs editor'>
 | 
			
		||||
<div class='c-overlay__contents-main'>
 | 
			
		||||
    <mct-form ng-model="ngModel.value"
 | 
			
		||||
              structure="ngModel.structure"
 | 
			
		||||
              class="validates"
 | 
			
		||||
              name="createForm">
 | 
			
		||||
    </mct-form>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="abs bottom-bar">
 | 
			
		||||
    <a class='s-button major'
 | 
			
		||||
<div class="c-overlay__button-bar">
 | 
			
		||||
    <a class='c-button c-button--major'
 | 
			
		||||
       ng-class="{ disabled: !createForm.$valid }"
 | 
			
		||||
       ng-click="ngModel.confirm()">
 | 
			
		||||
        OK
 | 
			
		||||
    </a>
 | 
			
		||||
    <a class='s-button'
 | 
			
		||||
    <a class='c-button  '
 | 
			
		||||
       ng-click="ngModel.cancel()">
 | 
			
		||||
        Cancel
 | 
			
		||||
    </a>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
<div class="l-message"
 | 
			
		||||
<div class="c-message"
 | 
			
		||||
     ng-class="'message-severity-' + ngModel.severity">
 | 
			
		||||
    <div class="w-message-contents">
 | 
			
		||||
        <div class="top-bar">
 | 
			
		||||
            <div class="title">{{ngModel.title}}</div>
 | 
			
		||||
        <div class="c-message__top-bar">
 | 
			
		||||
            <div class="c-message__title">{{ngModel.title}}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="hint" ng-hide="ngModel.hint === undefined">
 | 
			
		||||
        <div class="c-message__hint" ng-hide="ngModel.hint === undefined">
 | 
			
		||||
            {{ngModel.hint}}
 | 
			
		||||
            <span ng-if="ngModel.timestamp !== undefined">[{{ngModel.timestamp}}]</span>
 | 
			
		||||
        </div>
 | 
			
		||||
@@ -16,17 +16,17 @@
 | 
			
		||||
                         ng-model="ngModel"
 | 
			
		||||
                         ng-show="ngModel.progress !== undefined || ngModel.unknownProgress"></mct-include>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="bottom-bar">
 | 
			
		||||
            <a ng-repeat="dialogOption in ngModel.options"
 | 
			
		||||
               class="s-button"
 | 
			
		||||
        <div class="c-overlay__button-bar">
 | 
			
		||||
            <button ng-repeat="dialogOption in ngModel.options"
 | 
			
		||||
               class="c-button"
 | 
			
		||||
               ng-click="dialogOption.callback()">
 | 
			
		||||
                {{dialogOption.label}}
 | 
			
		||||
            </a>
 | 
			
		||||
            <a class="s-button major"
 | 
			
		||||
            </button>
 | 
			
		||||
            <button class="c-button c-button--major"
 | 
			
		||||
               ng-if="ngModel.primaryOption"
 | 
			
		||||
               ng-click="ngModel.primaryOption.callback()">
 | 
			
		||||
                {{ngModel.primaryOption.label}}
 | 
			
		||||
            </a>
 | 
			
		||||
            </button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -0,0 +1,25 @@
 | 
			
		||||
<div class="c-message"
 | 
			
		||||
     ng-class="'message-severity-' + ngModel.severity">
 | 
			
		||||
    <div class="w-message-contents">
 | 
			
		||||
        <div class="c-message__top-bar">
 | 
			
		||||
            <div class="c-message__title">{{ngModel.message}}</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="message-body">
 | 
			
		||||
            <mct-include key="'progress-bar'"
 | 
			
		||||
                         ng-model="ngModel"
 | 
			
		||||
                         ng-show="ngModel.progressPerc !== undefined"></mct-include>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="c-overlay__button-bar">
 | 
			
		||||
            <button ng-repeat="dialogOption in ngModel.options"
 | 
			
		||||
                class="c-button"
 | 
			
		||||
                ng-click="dialogOption.callback()">
 | 
			
		||||
                    {{dialogOption.label}}
 | 
			
		||||
            </button>
 | 
			
		||||
            <button class="c-button c-button--major"
 | 
			
		||||
                ng-if="ngModel.primaryOption"
 | 
			
		||||
                ng-click="ngModel.primaryOption.callback()">
 | 
			
		||||
                    {{ngModel.primaryOption.label}}
 | 
			
		||||
            </button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,22 +1,23 @@
 | 
			
		||||
<mct-container key="overlay">
 | 
			
		||||
    <div class="t-message-list">
 | 
			
		||||
        <div class="top-bar">
 | 
			
		||||
            <div class="dialog-title">{{ngModel.dialog.title}}</div>
 | 
			
		||||
            <div class="hint">Displaying {{ngModel.dialog.messages.length}} message<span ng-show="ngModel.dialog.messages.length > 1 ||
 | 
			
		||||
                                                                                                  ngModel.dialog.messages.length == 0">s</span>
 | 
			
		||||
    <div class="t-message-list c-overlay__contents">
 | 
			
		||||
        <div class="c-overlay__top-bar">
 | 
			
		||||
            <div class="c-overlay__dialog-title">{{ngModel.dialog.title}}</div>
 | 
			
		||||
            <div class="c-overlay__dialog-hint">Displaying {{ngModel.dialog.messages.length}} message<span
 | 
			
		||||
                    ng-show="ngModel.dialog.messages.length > 1 ||
 | 
			
		||||
                            ngModel.dialog.messages.length == 0">s</span>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="w-messages">
 | 
			
		||||
        <div class="w-messages c-overlay__messages">
 | 
			
		||||
            <mct-include
 | 
			
		||||
                ng-repeat="msg in ngModel.dialog.messages | orderBy: '-'"
 | 
			
		||||
                key="'message'" ng-model="msg.model"></mct-include>
 | 
			
		||||
                key="'notification-message'" ng-model="msg.model"></mct-include>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="bottom-bar">
 | 
			
		||||
            <a ng-repeat="dialogAction in ngModel.dialog.actions"
 | 
			
		||||
               class="s-button major"
 | 
			
		||||
        <div class="c-overlay__bottom-bar">
 | 
			
		||||
            <button ng-repeat="dialogAction in ngModel.dialog.actions"
 | 
			
		||||
               class="c-button c-button--major"
 | 
			
		||||
               ng-click="dialogAction.action()">
 | 
			
		||||
                {{dialogAction.label}}
 | 
			
		||||
            </a>
 | 
			
		||||
            </button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</mct-container>
 | 
			
		||||
 
 | 
			
		||||
@@ -19,18 +19,18 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<mct-container key="overlay">
 | 
			
		||||
    <div class="abs top-bar">
 | 
			
		||||
        <div class="dialog-title">{{ngModel.dialog.title}}</div>
 | 
			
		||||
        <div class="hint">{{ngModel.dialog.hint}}</div>
 | 
			
		||||
<mct-container key="c-overlay__contents">
 | 
			
		||||
    <div class=c-overlay__top-bar">
 | 
			
		||||
        <div class="c-overlay__dialog-title">{{ngModel.dialog.title}}</div>
 | 
			
		||||
        <div class="c-overlay__dialog-hint hint">{{ngModel.dialog.hint}}</div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class='abs editor'>
 | 
			
		||||
    <div class='c-overlay__contents-main'>
 | 
			
		||||
        <mct-include key="ngModel.dialog.template"
 | 
			
		||||
                     parameters="ngModel.dialog.parameters"
 | 
			
		||||
                     ng-model="ngModel.dialog.model">
 | 
			
		||||
        </mct-include>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="abs bottom-bar">
 | 
			
		||||
    <div class="c-overlay__button-bar">
 | 
			
		||||
        <a ng-repeat="option in ngModel.dialog.options"
 | 
			
		||||
           href=''
 | 
			
		||||
           class="s-button lg"
 | 
			
		||||
 
 | 
			
		||||
@@ -19,12 +19,12 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div class="abs overlay l-dialog" ng-class="{'delayEntry100ms' : ngModel.delay}">
 | 
			
		||||
    <div class="abs blocker"></div>
 | 
			
		||||
    <div class="abs outer-holder">
 | 
			
		||||
        <a ng-click="ngModel.cancel()"
 | 
			
		||||
<div class="c-overlay l-overlay-small" ng-class="{'delayEntry100ms' : ngModel.delay}">
 | 
			
		||||
    <div class="c-overlay__blocker"></div>
 | 
			
		||||
    <div class="c-overlay__outer">
 | 
			
		||||
        <button ng-click="ngModel.cancel()"
 | 
			
		||||
           ng-if="ngModel.cancel"
 | 
			
		||||
           class="close icon-x-in-circle"></a>
 | 
			
		||||
        <div class="abs inner-holder contents" ng-transclude></div>
 | 
			
		||||
           class="c-click-icon c-overlay__close-button icon-x-in-circle"></button>
 | 
			
		||||
        <div class="c-overlay__contents" ng-transclude></div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -95,7 +95,10 @@ define(
 | 
			
		||||
 | 
			
		||||
            // Create the overlay element and add it to the document's body
 | 
			
		||||
            element = this.$compile(TEMPLATE)(scope);
 | 
			
		||||
            this.findBody().prepend(element);
 | 
			
		||||
            
 | 
			
		||||
            // Append so that most recent dialog is last in DOM. This means the most recent dialog will be on top when
 | 
			
		||||
            // multiple overlays with the same z-index are active.
 | 
			
		||||
            this.findBody().append(element);
 | 
			
		||||
 | 
			
		||||
            return {
 | 
			
		||||
                dismiss: dismiss
 | 
			
		||||
 
 | 
			
		||||
@@ -59,8 +59,8 @@ define(
 | 
			
		||||
                    ["resolve", "reject"]
 | 
			
		||||
                );
 | 
			
		||||
                mockDocument = jasmine.createSpyObj(
 | 
			
		||||
                  "$document",
 | 
			
		||||
                  ["find"]
 | 
			
		||||
                    "$document",
 | 
			
		||||
                    ["find"]
 | 
			
		||||
                );
 | 
			
		||||
                mockBody = jasmine.createSpyObj('body', ['on', 'off']);
 | 
			
		||||
                mockDocument.find.and.returnValue(mockBody);
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,6 @@
 | 
			
		||||
define([
 | 
			
		||||
    "./src/controllers/EditActionController",
 | 
			
		||||
    "./src/controllers/EditPanesController",
 | 
			
		||||
    "./src/controllers/ElementsController",
 | 
			
		||||
    "./src/controllers/EditObjectController",
 | 
			
		||||
    "./src/actions/EditAndComposeAction",
 | 
			
		||||
    "./src/actions/EditAction",
 | 
			
		||||
@@ -33,11 +32,7 @@ define([
 | 
			
		||||
    "./src/actions/SaveAndStopEditingAction",
 | 
			
		||||
    "./src/actions/SaveAsAction",
 | 
			
		||||
    "./src/actions/CancelAction",
 | 
			
		||||
    "./src/policies/EditActionPolicy",
 | 
			
		||||
    "./src/policies/EditPersistableObjectsPolicy",
 | 
			
		||||
    "./src/policies/EditableLinkPolicy",
 | 
			
		||||
    "./src/policies/EditableMovePolicy",
 | 
			
		||||
    "./src/policies/EditContextualActionPolicy",
 | 
			
		||||
    "./src/representers/EditRepresenter",
 | 
			
		||||
    "./src/capabilities/EditorCapability",
 | 
			
		||||
    "./src/capabilities/TransactionCapabilityDecorator",
 | 
			
		||||
@@ -47,21 +42,18 @@ define([
 | 
			
		||||
    "./src/creation/LocatorController",
 | 
			
		||||
    "./src/creation/CreationPolicy",
 | 
			
		||||
    "./src/creation/CreateActionProvider",
 | 
			
		||||
    "./src/creation/AddActionProvider",
 | 
			
		||||
    "./src/creation/CreationService",
 | 
			
		||||
    "text!./res/templates/create/locator.html",
 | 
			
		||||
    "text!./res/templates/create/create-button.html",
 | 
			
		||||
    "text!./res/templates/create/create-menu.html",
 | 
			
		||||
    "text!./res/templates/library.html",
 | 
			
		||||
    "text!./res/templates/edit-object.html",
 | 
			
		||||
    "text!./res/templates/edit-action-buttons.html",
 | 
			
		||||
    "text!./res/templates/elements.html",
 | 
			
		||||
    "text!./res/templates/topbar-edit.html",
 | 
			
		||||
    "./res/templates/create/locator.html",
 | 
			
		||||
    "./res/templates/create/create-button.html",
 | 
			
		||||
    "./res/templates/create/create-menu.html",
 | 
			
		||||
    "./res/templates/library.html",
 | 
			
		||||
    "./res/templates/edit-object.html",
 | 
			
		||||
    "./res/templates/edit-action-buttons.html",
 | 
			
		||||
    "./res/templates/topbar-edit.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    EditActionController,
 | 
			
		||||
    EditPanesController,
 | 
			
		||||
    ElementsController,
 | 
			
		||||
    EditObjectController,
 | 
			
		||||
    EditAndComposeAction,
 | 
			
		||||
    EditAction,
 | 
			
		||||
@@ -71,11 +63,7 @@ define([
 | 
			
		||||
    SaveAndStopEditingAction,
 | 
			
		||||
    SaveAsAction,
 | 
			
		||||
    CancelAction,
 | 
			
		||||
    EditActionPolicy,
 | 
			
		||||
    EditPersistableObjectsPolicy,
 | 
			
		||||
    EditableLinkPolicy,
 | 
			
		||||
    EditableMovePolicy,
 | 
			
		||||
    EditContextualActionPolicy,
 | 
			
		||||
    EditRepresenter,
 | 
			
		||||
    EditorCapability,
 | 
			
		||||
    TransactionCapabilityDecorator,
 | 
			
		||||
@@ -85,7 +73,6 @@ define([
 | 
			
		||||
    LocatorController,
 | 
			
		||||
    CreationPolicy,
 | 
			
		||||
    CreateActionProvider,
 | 
			
		||||
    AddActionProvider,
 | 
			
		||||
    CreationService,
 | 
			
		||||
    locatorTemplate,
 | 
			
		||||
    createButtonTemplate,
 | 
			
		||||
@@ -93,7 +80,6 @@ define([
 | 
			
		||||
    libraryTemplate,
 | 
			
		||||
    editObjectTemplate,
 | 
			
		||||
    editActionButtonsTemplate,
 | 
			
		||||
    elementsTemplate,
 | 
			
		||||
    topbarEditTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
) {
 | 
			
		||||
@@ -115,14 +101,6 @@ define([
 | 
			
		||||
                        "$scope"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "ElementsController",
 | 
			
		||||
                    "implementation": ElementsController,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$scope",
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "EditObjectController",
 | 
			
		||||
                    "implementation": EditObjectController,
 | 
			
		||||
@@ -182,12 +160,13 @@ define([
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "remove",
 | 
			
		||||
                    "category": "contextual",
 | 
			
		||||
                    "category": "legacy",
 | 
			
		||||
                    "implementation": RemoveAction,
 | 
			
		||||
                    "cssClass": "icon-trash",
 | 
			
		||||
                    "name": "Remove",
 | 
			
		||||
                    "description": "Remove this object from its containing object.",
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "openmct",
 | 
			
		||||
                        "navigationService"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
@@ -224,10 +203,10 @@ define([
 | 
			
		||||
                    "description": "Save changes made to these objects.",
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$injector",
 | 
			
		||||
                        "policyService",
 | 
			
		||||
                        "dialogService",
 | 
			
		||||
                        "copyService",
 | 
			
		||||
                        "notificationService"
 | 
			
		||||
                        "notificationService",
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "priority": "mandatory"
 | 
			
		||||
                },
 | 
			
		||||
@@ -244,28 +223,11 @@ define([
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "policies": [
 | 
			
		||||
                {
 | 
			
		||||
                    "category": "action",
 | 
			
		||||
                    "implementation": EditActionPolicy
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "category": "action",
 | 
			
		||||
                    "implementation": EditPersistableObjectsPolicy,
 | 
			
		||||
                    "depends": ["openmct"]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "category": "action",
 | 
			
		||||
                    "implementation": EditContextualActionPolicy,
 | 
			
		||||
                    "depends": ["navigationService", "editModeBlacklist", "nonEditContextBlacklist"]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "category": "action",
 | 
			
		||||
                    "implementation": EditableMovePolicy
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "category": "action",
 | 
			
		||||
                    "implementation": EditableLinkPolicy
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "implementation": CreationPolicy,
 | 
			
		||||
                    "category": "creation"
 | 
			
		||||
@@ -295,13 +257,6 @@ define([
 | 
			
		||||
                        "action"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "edit-elements",
 | 
			
		||||
                    "template": elementsTemplate,
 | 
			
		||||
                    "gestures": [
 | 
			
		||||
                        "drop"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "topbar-edit",
 | 
			
		||||
                    "template": topbarEditTemplate
 | 
			
		||||
@@ -349,18 +304,6 @@ define([
 | 
			
		||||
                        "policyService"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "AddActionProvider",
 | 
			
		||||
                    "provides": "actionService",
 | 
			
		||||
                    "type": "provider",
 | 
			
		||||
                    "implementation": AddActionProvider,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$q",
 | 
			
		||||
                        "typeService",
 | 
			
		||||
                        "dialogService",
 | 
			
		||||
                        "policyService"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "CreationService",
 | 
			
		||||
                    "provides": "creationService",
 | 
			
		||||
@@ -381,16 +324,6 @@ define([
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "constants": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "editModeBlacklist",
 | 
			
		||||
                    "value": ["copy", "follow", "link", "locate"]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "nonEditContextBlacklist",
 | 
			
		||||
                    "value": ["copy", "follow", "properties", "move", "link", "remove", "locate"]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "capabilities": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "editor",
 | 
			
		||||
@@ -398,7 +331,8 @@ define([
 | 
			
		||||
                    "description": "Provides transactional editing capabilities",
 | 
			
		||||
                    "implementation": EditorCapability,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "transactionService"
 | 
			
		||||
                        "transactionService",
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
 
 | 
			
		||||
@@ -1,49 +0,0 @@
 | 
			
		||||
<!--
 | 
			
		||||
 Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 Administration. All rights reserved.
 | 
			
		||||
 | 
			
		||||
 Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 You may obtain a copy of the License at
 | 
			
		||||
 http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 | 
			
		||||
 Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 License for the specific language governing permissions and limitations
 | 
			
		||||
 under the License.
 | 
			
		||||
 | 
			
		||||
 Open MCT includes source code licensed under additional open source
 | 
			
		||||
 licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div ng-controller="ElementsController" class="flex-elem l-flex-col holder grows">
 | 
			
		||||
    <mct-include key="'input-filter'"
 | 
			
		||||
                 class="flex-elem holder"
 | 
			
		||||
                 ng-model="filterBy">
 | 
			
		||||
    </mct-include>
 | 
			
		||||
    <div class="flex-elem grows vscroll scroll-pad">
 | 
			
		||||
        <ul class="tree" id="inspector-elements-tree"
 | 
			
		||||
            ng-if="composition.length > 0">
 | 
			
		||||
            <li ng-repeat="containedObject in composition | filter:searchElements">
 | 
			
		||||
                <span class="tree-item">
 | 
			
		||||
                    <span class="grippy-sm"
 | 
			
		||||
                          ng-if="composition.length > 1"
 | 
			
		||||
                          data-id="{{ containedObject.id }}"
 | 
			
		||||
                          mct-drag-down="dragDown($event)"
 | 
			
		||||
                          mct-drag="drag($event)"
 | 
			
		||||
                          mct-drag-up="dragUp($event)">
 | 
			
		||||
                    </span>
 | 
			
		||||
                    <mct-representation
 | 
			
		||||
                            class="rep-object-label"
 | 
			
		||||
                            key="'label'"
 | 
			
		||||
                            mct-object="containedObject">
 | 
			
		||||
                    </mct-representation>
 | 
			
		||||
                </span>
 | 
			
		||||
            </li>
 | 
			
		||||
        </ul>
 | 
			
		||||
        <div ng-if="composition.length === 0">No contained elements</div>    
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -23,111 +23,109 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining RemoveAction. Created by vwoeltje on 11/17/14.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    [],
 | 
			
		||||
    function () {
 | 
			
		||||
define([], function () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Construct an action which will remove the provided object manifestation.
 | 
			
		||||
         * The object will be removed from its parent's composition; the parent
 | 
			
		||||
         * is looked up via the "context" capability (so this will be the
 | 
			
		||||
         * immediate ancestor by which this specific object was reached.)
 | 
			
		||||
         *
 | 
			
		||||
         * @param {DomainObject} object the object to be removed
 | 
			
		||||
         * @param {ActionContext} context the context in which this action is performed
 | 
			
		||||
         * @memberof platform/commonUI/edit
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @implements {Action}
 | 
			
		||||
    /**
 | 
			
		||||
     * Construct an action which will remove the provided object manifestation.
 | 
			
		||||
     * The object will be removed from its parent's composition; the parent
 | 
			
		||||
     * is looked up via the "context" capability (so this will be the
 | 
			
		||||
     * immediate ancestor by which this specific object was reached.)
 | 
			
		||||
     *
 | 
			
		||||
     * @param {DialogService} dialogService a service which will show the dialog
 | 
			
		||||
     * @param {NavigationService} navigationService a service that maintains the current navigation state
 | 
			
		||||
     * @param {ActionContext} context the context in which this action is performed
 | 
			
		||||
     * @memberof platform/commonUI/edit
 | 
			
		||||
     * @constructor
 | 
			
		||||
     * @implements {Action}
 | 
			
		||||
     */
 | 
			
		||||
    function RemoveAction(openmct, navigationService, context) {
 | 
			
		||||
        this.domainObject = (context || {}).domainObject;
 | 
			
		||||
        this.openmct = openmct;
 | 
			
		||||
        this.navigationService = navigationService;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Perform this action.
 | 
			
		||||
     */
 | 
			
		||||
    RemoveAction.prototype.perform = function () {
 | 
			
		||||
        var dialog,
 | 
			
		||||
            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) {
 | 
			
		||||
            this.domainObject = (context || {}).domainObject;
 | 
			
		||||
            this.navigationService = navigationService;
 | 
			
		||||
        function isNotObject(otherObjectId) {
 | 
			
		||||
            return otherObjectId !== domainObject.getId();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Perform this action.
 | 
			
		||||
         * @return {Promise} a promise which will be
 | 
			
		||||
         *         fulfilled when the action has completed.
 | 
			
		||||
        /*
 | 
			
		||||
         * Mutate a parent object such that it no longer contains the object
 | 
			
		||||
         * which is being removed.
 | 
			
		||||
         */
 | 
			
		||||
        RemoveAction.prototype.perform = function () {
 | 
			
		||||
            var navigationService = this.navigationService,
 | 
			
		||||
                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();
 | 
			
		||||
            }
 | 
			
		||||
        function doMutate(model) {
 | 
			
		||||
            model.composition = model.composition.filter(isNotObject);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * Mutate a parent object such that it no longer contains the object
 | 
			
		||||
             * which is being removed.
 | 
			
		||||
             */
 | 
			
		||||
            function doMutate(model) {
 | 
			
		||||
                model.composition = model.composition.filter(isNotObject);
 | 
			
		||||
            }
 | 
			
		||||
        /*
 | 
			
		||||
         * Checks current object and ascendants of current
 | 
			
		||||
         * object with object being removed, if the current
 | 
			
		||||
         * object or any in the current object's path is being removed,
 | 
			
		||||
         * navigate back to parent of removed object.
 | 
			
		||||
         */
 | 
			
		||||
        function checkObjectNavigation(object, parentObject) {
 | 
			
		||||
            // Traverse object starts at current location
 | 
			
		||||
            var traverseObject = (navigationService).getNavigation(),
 | 
			
		||||
                context;
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * Checks current object and ascendants of current
 | 
			
		||||
             * object with object being removed, if the current
 | 
			
		||||
             * object or any in the current object's path is being removed,
 | 
			
		||||
             * navigate back to parent of removed object.
 | 
			
		||||
             */
 | 
			
		||||
            function checkObjectNavigation(object, parentObject) {
 | 
			
		||||
                // 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();
 | 
			
		||||
            // 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();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * Remove the object from its parent, as identified by its context
 | 
			
		||||
             * capability. Based on object's location and selected object's location
 | 
			
		||||
             * user may be navigated to existing parent object
 | 
			
		||||
             */
 | 
			
		||||
            function removeFromContext(object) {
 | 
			
		||||
                var contextCapability = object.getCapability('context'),
 | 
			
		||||
                    parent = contextCapability.getParent();
 | 
			
		||||
        /*
 | 
			
		||||
         * Remove the object from its parent, as identified by its context
 | 
			
		||||
         * capability. Based on object's location and selected object's location
 | 
			
		||||
         * user may be navigated to existing parent object
 | 
			
		||||
         */
 | 
			
		||||
        function removeFromContext() {
 | 
			
		||||
            var contextCapability = domainObject.getCapability('context'),
 | 
			
		||||
                parent = contextCapability.getParent();
 | 
			
		||||
 | 
			
		||||
                // If currently within path of removed object(s),
 | 
			
		||||
                // navigates to existing object up tree
 | 
			
		||||
                checkObjectNavigation(object, parent);
 | 
			
		||||
            // If currently within path of removed object(s),
 | 
			
		||||
            // navigates to existing object up tree
 | 
			
		||||
            checkObjectNavigation(domainObject, parent);
 | 
			
		||||
 | 
			
		||||
                return parent.useCapability('mutation', doMutate);
 | 
			
		||||
            }
 | 
			
		||||
            return parent.useCapability('mutation', doMutate);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            return removeFromContext(domainObject);
 | 
			
		||||
        };
 | 
			
		||||
        removeFromContext();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
        // Object needs to have a parent for Remove to be applicable
 | 
			
		||||
        RemoveAction.appliesTo = function (context) {
 | 
			
		||||
            var object = (context || {}).domainObject,
 | 
			
		||||
                contextCapability = object && object.getCapability("context"),
 | 
			
		||||
                parent = contextCapability && contextCapability.getParent(),
 | 
			
		||||
                parentType = parent && parent.getCapability('type'),
 | 
			
		||||
                parentCreatable = parentType && parentType.hasFeature('creation');
 | 
			
		||||
    // Object needs to have a parent for Remove to be applicable
 | 
			
		||||
    RemoveAction.appliesTo = function (context) {
 | 
			
		||||
        var object = (context || {}).domainObject,
 | 
			
		||||
            contextCapability = object && object.getCapability("context"),
 | 
			
		||||
            parent = contextCapability && contextCapability.getParent(),
 | 
			
		||||
            parentType = parent && parent.getCapability('type'),
 | 
			
		||||
            parentCreatable = parentType && parentType.hasFeature('creation');
 | 
			
		||||
 | 
			
		||||
            // Only creatable types should be modifiable
 | 
			
		||||
            return parent !== undefined &&
 | 
			
		||||
                    Array.isArray(parent.getModel().composition) &&
 | 
			
		||||
                    parentCreatable;
 | 
			
		||||
        };
 | 
			
		||||
        // Only creatable types should be modifiable
 | 
			
		||||
        return parent !== undefined &&
 | 
			
		||||
                Array.isArray(parent.getModel().composition) &&
 | 
			
		||||
                parentCreatable;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
        return RemoveAction;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
    return RemoveAction;
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -25,12 +25,12 @@ define([
 | 
			
		||||
    '../creation/CreateWizard',
 | 
			
		||||
    './SaveInProgressDialog'
 | 
			
		||||
],
 | 
			
		||||
    function (
 | 
			
		||||
        CreateWizard,
 | 
			
		||||
        SaveInProgressDialog
 | 
			
		||||
    ) {
 | 
			
		||||
function (
 | 
			
		||||
    CreateWizard,
 | 
			
		||||
    SaveInProgressDialog
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
    /**
 | 
			
		||||
         * The "Save" action; the action triggered by clicking Save from
 | 
			
		||||
         * Edit Mode. Exits the editing user interface and invokes object
 | 
			
		||||
         * capabilities to persist the changes that have been made.
 | 
			
		||||
@@ -38,189 +38,182 @@ define([
 | 
			
		||||
         * @implements {Action}
 | 
			
		||||
         * @memberof platform/commonUI/edit
 | 
			
		||||
         */
 | 
			
		||||
        function SaveAsAction(
 | 
			
		||||
            $injector,
 | 
			
		||||
            policyService,
 | 
			
		||||
            dialogService,
 | 
			
		||||
            copyService,
 | 
			
		||||
            notificationService,
 | 
			
		||||
            context
 | 
			
		||||
        ) {
 | 
			
		||||
            this.domainObject = (context || {}).domainObject;
 | 
			
		||||
            this.injectObjectService = function () {
 | 
			
		||||
                this.objectService = $injector.get("objectService");
 | 
			
		||||
            };
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
            this.dialogService = dialogService;
 | 
			
		||||
            this.copyService = copyService;
 | 
			
		||||
            this.notificationService = notificationService;
 | 
			
		||||
        }
 | 
			
		||||
    function SaveAsAction(
 | 
			
		||||
        $injector,
 | 
			
		||||
        dialogService,
 | 
			
		||||
        copyService,
 | 
			
		||||
        notificationService,
 | 
			
		||||
        openmct,
 | 
			
		||||
        context
 | 
			
		||||
    ) {
 | 
			
		||||
        this.domainObject = (context || {}).domainObject;
 | 
			
		||||
        this.injectObjectService = function () {
 | 
			
		||||
            this.objectService = $injector.get("objectService");
 | 
			
		||||
        };
 | 
			
		||||
        this.dialogService = dialogService;
 | 
			
		||||
        this.copyService = copyService;
 | 
			
		||||
        this.notificationService = notificationService;
 | 
			
		||||
        this.openmct = openmct;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
    /**
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        SaveAsAction.prototype.createWizard = function (parent) {
 | 
			
		||||
            return new CreateWizard(
 | 
			
		||||
                this.domainObject,
 | 
			
		||||
                parent,
 | 
			
		||||
                this.policyService
 | 
			
		||||
            );
 | 
			
		||||
        };
 | 
			
		||||
    SaveAsAction.prototype.createWizard = function (parent) {
 | 
			
		||||
        return new CreateWizard(
 | 
			
		||||
            this.domainObject,
 | 
			
		||||
            parent,
 | 
			
		||||
            this.openmct
 | 
			
		||||
        );
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
    /**
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        SaveAsAction.prototype.getObjectService = function () {
 | 
			
		||||
            // Lazily acquire object service (avoids cyclical dependency)
 | 
			
		||||
            if (!this.objectService) {
 | 
			
		||||
                this.injectObjectService();
 | 
			
		||||
            }
 | 
			
		||||
            return this.objectService;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        function resolveWith(object) {
 | 
			
		||||
            return function () {
 | 
			
		||||
                return object;
 | 
			
		||||
            };
 | 
			
		||||
    SaveAsAction.prototype.getObjectService = function () {
 | 
			
		||||
        // Lazily acquire object service (avoids cyclical dependency)
 | 
			
		||||
        if (!this.objectService) {
 | 
			
		||||
            this.injectObjectService();
 | 
			
		||||
        }
 | 
			
		||||
        return this.objectService;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
    function resolveWith(object) {
 | 
			
		||||
        return function () {
 | 
			
		||||
            return object;
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
         * Save changes and conclude editing.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns {Promise} a promise that will be fulfilled when
 | 
			
		||||
         *          cancellation has completed
 | 
			
		||||
         * @memberof platform/commonUI/edit.SaveAction#
 | 
			
		||||
         */
 | 
			
		||||
        SaveAsAction.prototype.perform = function () {
 | 
			
		||||
            // Discard the current root view (which will be the editing
 | 
			
		||||
            // UI, which will have been pushed atop the Browse UI.)
 | 
			
		||||
            function returnToBrowse(object) {
 | 
			
		||||
                if (object) {
 | 
			
		||||
                    object.getCapability("action").perform("navigate");
 | 
			
		||||
                }
 | 
			
		||||
                return object;
 | 
			
		||||
            }
 | 
			
		||||
    SaveAsAction.prototype.perform = function () {
 | 
			
		||||
        return this.save();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
            return this.save().then(returnToBrowse);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
    /**
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        SaveAsAction.prototype.save = function () {
 | 
			
		||||
            var self = this,
 | 
			
		||||
                domainObject = this.domainObject,
 | 
			
		||||
                copyService = this.copyService,
 | 
			
		||||
                dialog = new SaveInProgressDialog(this.dialogService),
 | 
			
		||||
                toUndirty = [];
 | 
			
		||||
    SaveAsAction.prototype.save = function () {
 | 
			
		||||
        var self = this,
 | 
			
		||||
            domainObject = this.domainObject,
 | 
			
		||||
            copyService = this.copyService,
 | 
			
		||||
            dialog = new SaveInProgressDialog(this.dialogService),
 | 
			
		||||
            toUndirty = [];
 | 
			
		||||
 | 
			
		||||
            function doWizardSave(parent) {
 | 
			
		||||
                var wizard = self.createWizard(parent);
 | 
			
		||||
        function doWizardSave(parent) {
 | 
			
		||||
            var wizard = self.createWizard(parent);
 | 
			
		||||
 | 
			
		||||
                return self.dialogService
 | 
			
		||||
                    .getUserInput(wizard.getFormStructure(true),
 | 
			
		||||
                        wizard.getInitialFormValue())
 | 
			
		||||
                    .then(wizard.populateObjectFromInput.bind(wizard), function (failureReason) {
 | 
			
		||||
                        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];
 | 
			
		||||
            return self.dialogService
 | 
			
		||||
                .getUserInput(wizard.getFormStructure(true),
 | 
			
		||||
                    wizard.getInitialFormValue())
 | 
			
		||||
                .then(wizard.populateObjectFromInput.bind(wizard), function (failureReason) {
 | 
			
		||||
                    return Promise.reject("user canceled");
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            function getParent(object) {
 | 
			
		||||
                return fetchObject(object.getModel().location);
 | 
			
		||||
            }
 | 
			
		||||
        function showBlockingDialog(object) {
 | 
			
		||||
            dialog.show();
 | 
			
		||||
            return object;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            function allowClone(objectToClone) {
 | 
			
		||||
                var allowed =
 | 
			
		||||
        function hideBlockingDialog(object) {
 | 
			
		||||
            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.getCapability('location').isOriginal();
 | 
			
		||||
                if (allowed) {
 | 
			
		||||
                    toUndirty.push(objectToClone);
 | 
			
		||||
                }
 | 
			
		||||
                return allowed;
 | 
			
		||||
            if (allowed) {
 | 
			
		||||
                toUndirty.push(objectToClone);
 | 
			
		||||
            }
 | 
			
		||||
            return allowed;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            function cloneIntoParent(parent) {
 | 
			
		||||
                return copyService.perform(domainObject, parent, allowClone);
 | 
			
		||||
        function cloneIntoParent(parent) {
 | 
			
		||||
            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 this.openmct.editor.save().then(() => {
 | 
			
		||||
                // Force mutation for search indexing
 | 
			
		||||
                clonedObject.useCapability('mutation', (model) => {
 | 
			
		||||
                    return model;
 | 
			
		||||
                });
 | 
			
		||||
                return clonedObject;
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        function finishEditing(clonedObject) {
 | 
			
		||||
            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");
 | 
			
		||||
            }
 | 
			
		||||
            throw reason;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
            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;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return getParent(domainObject)
 | 
			
		||||
                .then(doWizardSave)
 | 
			
		||||
                .then(showBlockingDialog)
 | 
			
		||||
                .then(getParent)
 | 
			
		||||
                .then(cloneIntoParent)
 | 
			
		||||
                .then(undirtyOriginals)
 | 
			
		||||
                .then(saveAfterClone)
 | 
			
		||||
                .then(finishEditing)
 | 
			
		||||
                .then(hideBlockingDialog)
 | 
			
		||||
                .then(onSuccess)
 | 
			
		||||
                .catch(onFailure);
 | 
			
		||||
        };
 | 
			
		||||
        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.
 | 
			
		||||
         * This will ensure that a domain object is present in the context,
 | 
			
		||||
         * and that this domain object is in Edit mode.
 | 
			
		||||
         * @returns true if applicable
 | 
			
		||||
         */
 | 
			
		||||
        SaveAsAction.appliesTo = function (context) {
 | 
			
		||||
            var domainObject = (context || {}).domainObject;
 | 
			
		||||
            return domainObject !== undefined &&
 | 
			
		||||
    SaveAsAction.appliesTo = function (context) {
 | 
			
		||||
        var domainObject = (context || {}).domainObject;
 | 
			
		||||
        return domainObject !== undefined &&
 | 
			
		||||
                domainObject.hasCapability('editor') &&
 | 
			
		||||
                domainObject.getCapability('editor').isEditContextRoot() &&
 | 
			
		||||
                domainObject.getModel().persisted === undefined;
 | 
			
		||||
        };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
        return SaveAsAction;
 | 
			
		||||
    }
 | 
			
		||||
    return SaveAsAction;
 | 
			
		||||
}
 | 
			
		||||
);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,9 +36,11 @@ define(
 | 
			
		||||
         */
 | 
			
		||||
        function EditorCapability(
 | 
			
		||||
            transactionService,
 | 
			
		||||
            openmct,
 | 
			
		||||
            domainObject
 | 
			
		||||
        ) {
 | 
			
		||||
            this.transactionService = transactionService;
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
            this.domainObject = domainObject;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -48,27 +50,22 @@ define(
 | 
			
		||||
         * or finish() are called.
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.edit = function () {
 | 
			
		||||
            this.transactionService.startTransaction();
 | 
			
		||||
            this.domainObject.getCapability('status').set('editing', true);
 | 
			
		||||
            console.warn('DEPRECATED: cannot edit via edit capability, use openmct.editor instead.');
 | 
			
		||||
 | 
			
		||||
            if (!this.openmct.editor.isEditing()) {
 | 
			
		||||
                this.openmct.editor.edit();
 | 
			
		||||
                this.domainObject.getCapability('status').set('editing', true);
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        function isEditContextRoot(domainObject) {
 | 
			
		||||
            return domainObject.getCapability('status').get('editing');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        function isEditing(domainObject) {
 | 
			
		||||
            return isEditContextRoot(domainObject) ||
 | 
			
		||||
                domainObject.hasCapability('context') &&
 | 
			
		||||
                isEditing(domainObject.getCapability('context').getParent());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Determines whether this object, or any of its ancestors are
 | 
			
		||||
         * currently being edited.
 | 
			
		||||
         * @returns boolean
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.inEditContext = function () {
 | 
			
		||||
            return isEditing(this.domainObject);
 | 
			
		||||
            console.warn('DEPRECATION WARNING: isEditing checks must be done via openmct.editor.');
 | 
			
		||||
            return this.openmct.editor.isEditing();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
@@ -77,7 +74,8 @@ define(
 | 
			
		||||
         * @returns {*}
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.isEditContextRoot = function () {
 | 
			
		||||
            return isEditContextRoot(this.domainObject);
 | 
			
		||||
            console.warn('DEPRECATION WARNING: isEditing checks must be done via openmct.editor.');
 | 
			
		||||
            return this.openmct.editor.isEditing();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
@@ -86,10 +84,8 @@ define(
 | 
			
		||||
         * @returns {*}
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.save = function () {
 | 
			
		||||
            var transactionService = this.transactionService;
 | 
			
		||||
            return transactionService.commit().then(function () {
 | 
			
		||||
                transactionService.startTransaction();
 | 
			
		||||
            });
 | 
			
		||||
            console.warn('DEPRECATED: cannot save via edit capability, use openmct.editor instead.');
 | 
			
		||||
            return Promise.resolve();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        EditorCapability.prototype.invoke = EditorCapability.prototype.edit;
 | 
			
		||||
@@ -100,16 +96,8 @@ define(
 | 
			
		||||
         * @returns {*}
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.finish = function () {
 | 
			
		||||
            var domainObject = this.domainObject;
 | 
			
		||||
 | 
			
		||||
            if (this.transactionService.isActive()) {
 | 
			
		||||
                return this.transactionService.cancel().then(function () {
 | 
			
		||||
                    domainObject.getCapability("status").set("editing", false);
 | 
			
		||||
                    return domainObject;
 | 
			
		||||
                });
 | 
			
		||||
            } else {
 | 
			
		||||
                return Promise.resolve(domainObject);
 | 
			
		||||
            }
 | 
			
		||||
            console.warn('DEPRECATED: cannot finish via edit capability, use openmct.editor instead.');
 | 
			
		||||
            return Promise.resolve();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,8 @@ define(
 | 
			
		||||
            // present context.
 | 
			
		||||
            function updateActions() {
 | 
			
		||||
                $scope.saveActions = $scope.action ?
 | 
			
		||||
                        $scope.action.getActions(SAVE_ACTION_CONTEXT) :
 | 
			
		||||
                        [];
 | 
			
		||||
                    $scope.action.getActions(SAVE_ACTION_CONTEXT) :
 | 
			
		||||
                    [];
 | 
			
		||||
 | 
			
		||||
                $scope.saveActionsAsMenuOptions = $scope.saveActions.map(actionToMenuOption);
 | 
			
		||||
 | 
			
		||||
@@ -59,8 +59,8 @@ define(
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                $scope.otherEditActions = $scope.action ?
 | 
			
		||||
                        $scope.action.getActions(OTHERS_ACTION_CONTEXT) :
 | 
			
		||||
                        [];
 | 
			
		||||
                    $scope.action.getActions(OTHERS_ACTION_CONTEXT) :
 | 
			
		||||
                    [];
 | 
			
		||||
 | 
			
		||||
                // Required because Angular does not allow 'bind'
 | 
			
		||||
                // in expressions.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,197 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    ['zepto'],
 | 
			
		||||
    function ($) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The ElementsController prepares the elements view for display
 | 
			
		||||
         *
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function ElementsController($scope, openmct) {
 | 
			
		||||
            this.scope = $scope;
 | 
			
		||||
            this.scope.composition = [];
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
            this.dragDown = this.dragDown.bind(this);
 | 
			
		||||
            this.dragUp = this.dragUp.bind(this);
 | 
			
		||||
 | 
			
		||||
            var self = this;
 | 
			
		||||
 | 
			
		||||
            function filterBy(text) {
 | 
			
		||||
                if (typeof text === 'undefined') {
 | 
			
		||||
                    return $scope.searchText;
 | 
			
		||||
                } else {
 | 
			
		||||
                    $scope.searchText = text;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function searchElements(value) {
 | 
			
		||||
                if ($scope.searchText) {
 | 
			
		||||
                    return value.getModel().name.toLowerCase().search(
 | 
			
		||||
                            $scope.searchText.toLowerCase()) !== -1;
 | 
			
		||||
                } else {
 | 
			
		||||
                    return true;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function setSelection(selection) {
 | 
			
		||||
                if (!selection[0]) {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (self.mutationListener) {
 | 
			
		||||
                    self.mutationListener();
 | 
			
		||||
                    delete self.mutationListener;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                var domainObject = selection[0].context.oldItem;
 | 
			
		||||
                self.refreshComposition(domainObject);
 | 
			
		||||
 | 
			
		||||
                if (domainObject) {
 | 
			
		||||
 | 
			
		||||
                    self.mutationListener = domainObject.getCapability('mutation')
 | 
			
		||||
                        .listen(self.refreshComposition.bind(self, domainObject));
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $scope.filterBy = filterBy;
 | 
			
		||||
            $scope.searchElements = searchElements;
 | 
			
		||||
 | 
			
		||||
            openmct.selection.on('change', setSelection);
 | 
			
		||||
            setSelection(openmct.selection.get());
 | 
			
		||||
 | 
			
		||||
            $scope.dragDown = this.dragDown;
 | 
			
		||||
            $scope.drag = this.drag;
 | 
			
		||||
            $scope.dragUp = this.dragUp;
 | 
			
		||||
 | 
			
		||||
            $scope.$on("$destroy", function () {
 | 
			
		||||
                openmct.selection.off("change", setSelection);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Invoked on DragStart - Adds reordering class to parent UL element
 | 
			
		||||
         * Sets selected object ID, to be used on Drag End
 | 
			
		||||
         *
 | 
			
		||||
         * @param {object} event | Mouse Event
 | 
			
		||||
         */
 | 
			
		||||
        ElementsController.prototype.dragDown = function (event) {
 | 
			
		||||
            if (!this.parentUL) {
 | 
			
		||||
                this.parentUL = $(document).find('#inspector-elements-tree');
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.selectedTreeItem = $(event.target).parent();
 | 
			
		||||
            this.selectedObjectId = event.target.getAttribute('data-id');
 | 
			
		||||
 | 
			
		||||
            this.parentUL.addClass('reordering');
 | 
			
		||||
            this.selectedTreeItem.addClass('reorder-actor');
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Invoked on dragEnd - Removes selected object from position in composition
 | 
			
		||||
         * and replaces it at the target position. Composition is then updated with current
 | 
			
		||||
         * scope
 | 
			
		||||
         *
 | 
			
		||||
         * @param {object} event - Mouse Event
 | 
			
		||||
         */
 | 
			
		||||
        ElementsController.prototype.dragUp = function (event) {
 | 
			
		||||
            this.targetObjectId = event.target.getAttribute('data-id');
 | 
			
		||||
 | 
			
		||||
            if (this.targetObjectId && this.selectedObjectId) {
 | 
			
		||||
                var selectedObjectPosition,
 | 
			
		||||
                    targetObjectPosition;
 | 
			
		||||
 | 
			
		||||
                selectedObjectPosition = findObjectInCompositionFromId(this.selectedObjectId, this.scope.composition);
 | 
			
		||||
                targetObjectPosition = findObjectInCompositionFromId(this.targetObjectId, this.scope.composition);
 | 
			
		||||
 | 
			
		||||
                if ((selectedObjectPosition !== -1) && (targetObjectPosition !== -1)) {
 | 
			
		||||
                    var selectedObject = this.scope.composition.splice(selectedObjectPosition, 1),
 | 
			
		||||
                        selection = this.openmct.selection.get(),
 | 
			
		||||
                        domainObject = selection ? selection[0].context.oldItem : undefined;
 | 
			
		||||
 | 
			
		||||
                    this.scope.composition.splice(targetObjectPosition, 0, selectedObject[0]);
 | 
			
		||||
 | 
			
		||||
                    if (domainObject) {
 | 
			
		||||
                        domainObject.getCapability('mutation').mutate(function (model) {
 | 
			
		||||
                            model.composition = this.scope.composition.map(function (dObject) {
 | 
			
		||||
                                return dObject.id;
 | 
			
		||||
                            });
 | 
			
		||||
                        }.bind(this));
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (this.parentUL) {
 | 
			
		||||
                this.parentUL.removeClass('reordering');
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (this.selectedTreeItem) {
 | 
			
		||||
                this.selectedTreeItem.removeClass('reorder-actor');
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        ElementsController.prototype.drag = function (event) {
 | 
			
		||||
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Gets the composition for the selected object and populates the scope with it.
 | 
			
		||||
         *
 | 
			
		||||
         * @param domainObject the selected object
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        ElementsController.prototype.refreshComposition = function (domainObject) {
 | 
			
		||||
            var refreshTracker = {};
 | 
			
		||||
            this.currentRefresh = refreshTracker;
 | 
			
		||||
 | 
			
		||||
            var selectedObjectComposition = domainObject && domainObject.useCapability('composition');
 | 
			
		||||
            if (selectedObjectComposition) {
 | 
			
		||||
                selectedObjectComposition.then(function (composition) {
 | 
			
		||||
                    if (this.currentRefresh === refreshTracker) {
 | 
			
		||||
                        this.scope.composition = composition;
 | 
			
		||||
                    }
 | 
			
		||||
                }.bind(this));
 | 
			
		||||
            } else {
 | 
			
		||||
                this.scope.composition = [];
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Finds position of object with given ID in Composition
 | 
			
		||||
         *
 | 
			
		||||
         * @param {String} id
 | 
			
		||||
         * @param {Array} composition
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        function findObjectInCompositionFromId(id, composition) {
 | 
			
		||||
            var mapped = composition.map(function (element) {
 | 
			
		||||
                return element.id;
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            return mapped.indexOf(id);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return ElementsController;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,133 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining AddAction. Created by ahenry on 01/21/16.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    [
 | 
			
		||||
        './CreateWizard'
 | 
			
		||||
    ],
 | 
			
		||||
    function (CreateWizard) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The Add Action is performed to create new instances of
 | 
			
		||||
         * domain objects of a specific type that are subobjects of an
 | 
			
		||||
         * object being edited. This is the action that is performed when a
 | 
			
		||||
         * user uses the Add menu option.
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/commonUI/browse
 | 
			
		||||
         * @implements {Action}
 | 
			
		||||
         * @constructor
 | 
			
		||||
         *
 | 
			
		||||
         * @param {Type} type the type of domain object to create
 | 
			
		||||
         * @param {DomainObject} parent the domain object that should
 | 
			
		||||
         *        act as a container for the newly-created object
 | 
			
		||||
         *        (note that the user will have an opportunity to
 | 
			
		||||
         *        override this)
 | 
			
		||||
         * @param {ActionContext} context the context in which the
 | 
			
		||||
         *        action is being performed
 | 
			
		||||
         * @param {DialogService} dialogService
 | 
			
		||||
         */
 | 
			
		||||
        function AddAction(type, parent, context, $q, dialogService, policyService) {
 | 
			
		||||
            this.metadata = {
 | 
			
		||||
                key: 'add',
 | 
			
		||||
                cssClass: type.getCssClass(),
 | 
			
		||||
                name: type.getName(),
 | 
			
		||||
                type: type.getKey(),
 | 
			
		||||
                description: type.getDescription(),
 | 
			
		||||
                context: context
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            this.type = type;
 | 
			
		||||
            this.parent = parent;
 | 
			
		||||
            this.$q = $q;
 | 
			
		||||
            this.dialogService = dialogService;
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         *
 | 
			
		||||
         * Create a new object of the given type.
 | 
			
		||||
         * This will prompt for user input first.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns {Promise} that will be resolved with the object that the
 | 
			
		||||
         * action was originally invoked on (ie. the 'parent')
 | 
			
		||||
         */
 | 
			
		||||
        AddAction.prototype.perform = function () {
 | 
			
		||||
            var newModel = this.type.getInitialModel(),
 | 
			
		||||
                newObject,
 | 
			
		||||
                parentObject = this.parent,
 | 
			
		||||
                wizard;
 | 
			
		||||
 | 
			
		||||
            newModel.type = this.type.getKey();
 | 
			
		||||
            newObject = parentObject.getCapability('instantiation').instantiate(newModel);
 | 
			
		||||
            newObject.useCapability('mutation', function (model) {
 | 
			
		||||
                model.location = parentObject.getId();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            wizard = new CreateWizard(newObject, this.parent, this.policyService);
 | 
			
		||||
 | 
			
		||||
            function populateObjectFromInput(formValue) {
 | 
			
		||||
                return wizard.populateObjectFromInput(formValue, newObject);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function persistAndReturn(domainObject) {
 | 
			
		||||
                return domainObject.getCapability('persistence')
 | 
			
		||||
                    .persist()
 | 
			
		||||
                    .then(function () {
 | 
			
		||||
                        return domainObject;
 | 
			
		||||
                    });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function addToParent(populatedObject) {
 | 
			
		||||
                parentObject.getCapability('composition').add(populatedObject);
 | 
			
		||||
                return persistAndReturn(parentObject);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return this.dialogService
 | 
			
		||||
                .getUserInput(wizard.getFormStructure(false), wizard.getInitialFormValue())
 | 
			
		||||
                .then(populateObjectFromInput)
 | 
			
		||||
                .then(persistAndReturn)
 | 
			
		||||
                .then(addToParent);
 | 
			
		||||
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Metadata associated with a Add action.
 | 
			
		||||
         * @typedef {ActionMetadata} AddActionMetadata
 | 
			
		||||
         * @property {string} type the key for the type of domain object
 | 
			
		||||
         *           to be created
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get metadata about this action.
 | 
			
		||||
         * @returns {AddActionMetadata} metadata about this action
 | 
			
		||||
         */
 | 
			
		||||
        AddAction.prototype.getMetadata = function () {
 | 
			
		||||
            return this.metadata;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return AddAction;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,82 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining AddActionProvider.js. Created by ahenry on 01/21/16.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ["./AddAction"],
 | 
			
		||||
    function (AddAction) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The AddActionProvider is an ActionProvider which introduces
 | 
			
		||||
         * an Add action for creating sub objects.
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/commonUI/browse
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @implements {ActionService}
 | 
			
		||||
         *
 | 
			
		||||
         * @param {TypeService} typeService the type service, used to discover
 | 
			
		||||
         *        available types
 | 
			
		||||
         * @param {DialogService} dialogService the dialog service, used by
 | 
			
		||||
         *        specific Create actions to get user input to populate the
 | 
			
		||||
         *        model of the newly-created domain object.
 | 
			
		||||
         * @param {CreationService} creationService the creation service (also
 | 
			
		||||
         *        introduced in this bundle), responsible for handling actual
 | 
			
		||||
         *        object creation.
 | 
			
		||||
         */
 | 
			
		||||
        function AddActionProvider($q, typeService, dialogService, policyService) {
 | 
			
		||||
            this.typeService = typeService;
 | 
			
		||||
            this.dialogService = dialogService;
 | 
			
		||||
            this.$q = $q;
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        AddActionProvider.prototype.getActions = function (actionContext) {
 | 
			
		||||
            var context = actionContext || {},
 | 
			
		||||
                key = context.key,
 | 
			
		||||
                destination = context.domainObject;
 | 
			
		||||
 | 
			
		||||
            // We only provide Add actions, and we need a
 | 
			
		||||
            // domain object to serve as the container for the
 | 
			
		||||
            // newly-created object (although the user may later
 | 
			
		||||
            // make a different selection)
 | 
			
		||||
            if (key !== 'add' || !destination) {
 | 
			
		||||
                return [];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Introduce one create action per type
 | 
			
		||||
            return ['timeline', 'activity'].map(function (type) {
 | 
			
		||||
                return new AddAction(
 | 
			
		||||
                    this.typeService.getType(type),
 | 
			
		||||
                    destination,
 | 
			
		||||
                    context,
 | 
			
		||||
                    this.$q,
 | 
			
		||||
                    this.dialogService,
 | 
			
		||||
                    this.policyService
 | 
			
		||||
                );
 | 
			
		||||
            }, this);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return AddActionProvider;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -44,7 +44,7 @@ define(
 | 
			
		||||
         * @param {ActionContext} context the context in which the
 | 
			
		||||
         *        action is being performed
 | 
			
		||||
         */
 | 
			
		||||
        function CreateAction(type, parent, context) {
 | 
			
		||||
        function CreateAction(type, parent, context, openmct) {
 | 
			
		||||
            this.metadata = {
 | 
			
		||||
                key: 'create',
 | 
			
		||||
                cssClass: type.getCssClass(),
 | 
			
		||||
@@ -55,6 +55,7 @@ define(
 | 
			
		||||
            };
 | 
			
		||||
            this.type = type;
 | 
			
		||||
            this.parent = parent;
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
@@ -63,37 +64,36 @@ define(
 | 
			
		||||
         */
 | 
			
		||||
        CreateAction.prototype.perform = function () {
 | 
			
		||||
            var newModel = this.type.getInitialModel(),
 | 
			
		||||
                newObject,
 | 
			
		||||
                editAction,
 | 
			
		||||
                editorCapability;
 | 
			
		||||
 | 
			
		||||
            function closeEditor() {
 | 
			
		||||
                return editorCapability.finish();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function onSave() {
 | 
			
		||||
                return editorCapability.save()
 | 
			
		||||
                    .then(closeEditor);
 | 
			
		||||
            }
 | 
			
		||||
                openmct = this.openmct,
 | 
			
		||||
                newObject;
 | 
			
		||||
 | 
			
		||||
            function onCancel() {
 | 
			
		||||
                return closeEditor();
 | 
			
		||||
                openmct.editor.cancel();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function navigateAndEdit(object) {
 | 
			
		||||
                let objectPath = object.getCapability('context').getPath(),
 | 
			
		||||
                    url = '#/browse/' + objectPath
 | 
			
		||||
                        .slice(1)
 | 
			
		||||
                        .map(function (o) {
 | 
			
		||||
                            return o && openmct.objects.makeKeyString(o.getId());
 | 
			
		||||
                        })
 | 
			
		||||
                        .join('/');
 | 
			
		||||
 | 
			
		||||
                window.location.href = url;
 | 
			
		||||
 | 
			
		||||
                openmct.editor.edit();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            newModel.type = this.type.getKey();
 | 
			
		||||
            newModel.location = this.parent.getId();
 | 
			
		||||
            newObject = this.parent.useCapability('instantiation', newModel);
 | 
			
		||||
            editorCapability = newObject.hasCapability('editor') && newObject.getCapability("editor");
 | 
			
		||||
 | 
			
		||||
            editAction = newObject.getCapability("action").getActions("edit")[0];
 | 
			
		||||
            //If an edit action is available, perform it
 | 
			
		||||
            if (editAction) {
 | 
			
		||||
                return editAction.perform();
 | 
			
		||||
            } else if (editorCapability) {
 | 
			
		||||
                //otherwise, use the save as action
 | 
			
		||||
                editorCapability.edit();
 | 
			
		||||
                return newObject.getCapability("action").perform("save-as").then(onSave, onCancel);
 | 
			
		||||
            }
 | 
			
		||||
            openmct.editor.edit();
 | 
			
		||||
            newObject.getCapability("action").perform("save-as").then(navigateAndEdit, onCancel);
 | 
			
		||||
            // TODO: support editing object without saving object first.
 | 
			
		||||
            // Which means we have to toggle createwizard afterwards.  For now,
 | 
			
		||||
            // We will disable this.
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,8 +39,8 @@ define(
 | 
			
		||||
            // Update the set of Create actions
 | 
			
		||||
            function refreshActions() {
 | 
			
		||||
                $scope.createActions = $scope.action ?
 | 
			
		||||
                        $scope.action.getActions('create') :
 | 
			
		||||
                        [];
 | 
			
		||||
                    $scope.action.getActions('create') :
 | 
			
		||||
                    [];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Listen for new instances of the represented object's
 | 
			
		||||
 
 | 
			
		||||
@@ -34,13 +34,13 @@ define(
 | 
			
		||||
         * @memberof platform/commonUI/browse
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function CreateWizard(domainObject, parent, policyService) {
 | 
			
		||||
        function CreateWizard(domainObject, parent, openmct) {
 | 
			
		||||
            this.type = domainObject.getCapability('type');
 | 
			
		||||
            this.model = domainObject.getModel();
 | 
			
		||||
            this.domainObject = domainObject;
 | 
			
		||||
            this.properties = this.type.getProperties();
 | 
			
		||||
            this.parent = parent;
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
@@ -56,15 +56,10 @@ define(
 | 
			
		||||
         */
 | 
			
		||||
        CreateWizard.prototype.getFormStructure = function (includeLocation) {
 | 
			
		||||
            var sections = [],
 | 
			
		||||
                domainObject = this.domainObject,
 | 
			
		||||
                policyService = this.policyService;
 | 
			
		||||
                domainObject = this.domainObject;
 | 
			
		||||
 | 
			
		||||
            function validateLocation(parent) {
 | 
			
		||||
                return parent && policyService.allow(
 | 
			
		||||
                    "composition",
 | 
			
		||||
                    parent,
 | 
			
		||||
                    domainObject
 | 
			
		||||
                );
 | 
			
		||||
                return parent && this.openmct.composition.checkPolicy(parent.useCapability('adapter'), domainObject.useCapability('adapter'));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            sections.push({
 | 
			
		||||
@@ -93,7 +88,7 @@ define(
 | 
			
		||||
                    rows: [{
 | 
			
		||||
                        name: "Save In",
 | 
			
		||||
                        control: "locator",
 | 
			
		||||
                        validate: validateLocation,
 | 
			
		||||
                        validate: validateLocation.bind(this),
 | 
			
		||||
                        key: "createParent"
 | 
			
		||||
                    }]
 | 
			
		||||
                });
 | 
			
		||||
 
 | 
			
		||||
@@ -1,103 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    [],
 | 
			
		||||
    function () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Policy controlling when the `edit` and/or `properties` actions
 | 
			
		||||
         * can appear as applicable actions of the `view-control` category
 | 
			
		||||
         * (shown as buttons in the top-right of browse mode.)
 | 
			
		||||
         * @memberof platform/commonUI/edit
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @implements {Policy.<Action, ActionContext>}
 | 
			
		||||
         */
 | 
			
		||||
        function EditActionPolicy(policyService) {
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get a count of views which are not flagged as non-editable.
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        EditActionPolicy.prototype.countEditableViews = function (context) {
 | 
			
		||||
            var domainObject = context.domainObject,
 | 
			
		||||
                count = 0,
 | 
			
		||||
                type, views;
 | 
			
		||||
 | 
			
		||||
            if (!domainObject) {
 | 
			
		||||
                return count;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            type = domainObject.getCapability('type');
 | 
			
		||||
            views = domainObject.useCapability('view');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            // A view is editable unless explicitly flagged as not
 | 
			
		||||
            (views || []).forEach(function (view) {
 | 
			
		||||
                if (view.editable === true ||
 | 
			
		||||
                    (view.key === 'plot' && type.getKey() === 'telemetry.panel') ||
 | 
			
		||||
                    (view.key === 'table' && type.getKey() === 'table') ||
 | 
			
		||||
                    (view.key === 'rt-table' && type.getKey() === 'rttable')
 | 
			
		||||
                    ) {
 | 
			
		||||
                    count++;
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            return count;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Checks whether the domain object is currently being edited. If
 | 
			
		||||
         * so, the edit action is not applicable.
 | 
			
		||||
         * @param context
 | 
			
		||||
         * @returns {*|boolean}
 | 
			
		||||
         */
 | 
			
		||||
        function isEditing(context) {
 | 
			
		||||
            var domainObject = (context || {}).domainObject;
 | 
			
		||||
            return domainObject &&
 | 
			
		||||
                domainObject.hasCapability('editor') &&
 | 
			
		||||
                domainObject.getCapability('editor').isEditContextRoot();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        EditActionPolicy.prototype.allow = function (action, context) {
 | 
			
		||||
            var key = action.getMetadata().key,
 | 
			
		||||
                category = (context || {}).category;
 | 
			
		||||
 | 
			
		||||
            // Restrict 'edit' to cases where there are editable
 | 
			
		||||
            // views (similarly, restrict 'properties' to when
 | 
			
		||||
            // the converse is true), and where the domain object is not
 | 
			
		||||
            // already being edited.
 | 
			
		||||
            if (key === 'edit') {
 | 
			
		||||
                return this.countEditableViews(context) > 0 && !isEditing(context);
 | 
			
		||||
            } else if (key === 'properties' && category === 'view-control') {
 | 
			
		||||
                return this.countEditableViews(context) < 1 && !isEditing(context);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Like all policies, allow by default.
 | 
			
		||||
            return true;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return EditActionPolicy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,72 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    [],
 | 
			
		||||
    function () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Policy controlling whether the context menu is visible when
 | 
			
		||||
         * objects are being edited
 | 
			
		||||
         * @param navigationService
 | 
			
		||||
         * @param editModeBlacklist A blacklist of actions disallowed from
 | 
			
		||||
         * context menu when navigated object is being edited
 | 
			
		||||
         * @param nonEditContextBlacklist A blacklist of actions disallowed
 | 
			
		||||
         * from context menu of non-editable objects, when navigated object
 | 
			
		||||
         * is being edited
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param editModeBlacklist A blacklist of actions disallowed from
 | 
			
		||||
         * context menu when navigated object is being edited
 | 
			
		||||
         * @param nonEditContextBlacklist A blacklist of actions disallowed
 | 
			
		||||
         * from context menu of non-editable objects, when navigated object
 | 
			
		||||
         * @implements {Policy.<Action, ActionContext>}
 | 
			
		||||
         */
 | 
			
		||||
        function EditContextualActionPolicy(navigationService, editModeBlacklist, nonEditContextBlacklist) {
 | 
			
		||||
            this.navigationService = navigationService;
 | 
			
		||||
 | 
			
		||||
            //The list of objects disallowed on target object when in edit mode
 | 
			
		||||
            this.editModeBlacklist = editModeBlacklist;
 | 
			
		||||
            //The list of objects disallowed on target object that is not in
 | 
			
		||||
            // edit mode (ie. the context menu in the tree on the LHS).
 | 
			
		||||
            this.nonEditContextBlacklist = nonEditContextBlacklist;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        EditContextualActionPolicy.prototype.allow = function (action, context) {
 | 
			
		||||
            var selectedObject = context.domainObject,
 | 
			
		||||
                navigatedObject = this.navigationService.getNavigation(),
 | 
			
		||||
                actionMetadata = action.getMetadata ? action.getMetadata() : {};
 | 
			
		||||
 | 
			
		||||
            if (navigatedObject.hasCapability("editor") && navigatedObject.getCapability("editor").isEditContextRoot()) {
 | 
			
		||||
                if (selectedObject.hasCapability("editor") && selectedObject.getCapability("editor").inEditContext()) {
 | 
			
		||||
                    return this.editModeBlacklist.indexOf(actionMetadata.key) === -1;
 | 
			
		||||
                } else {
 | 
			
		||||
                    //Target is in the context menu
 | 
			
		||||
                    return this.nonEditContextBlacklist.indexOf(actionMetadata.key) === -1;
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return EditContextualActionPolicy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,51 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define([], function () {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Policy suppressing links when the linked-to domain object is in
 | 
			
		||||
     * edit mode. Domain objects being edited may not have been persisted,
 | 
			
		||||
     * so creating links to these can result in inconsistent state.
 | 
			
		||||
     *
 | 
			
		||||
     * @memberof platform/commonUI/edit
 | 
			
		||||
     * @constructor
 | 
			
		||||
     * @implements {Policy.<View, DomainObject>}
 | 
			
		||||
     */
 | 
			
		||||
    function EditableLinkPolicy() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    EditableLinkPolicy.prototype.allow = function (action, context) {
 | 
			
		||||
        var key = action.getMetadata().key,
 | 
			
		||||
            object;
 | 
			
		||||
 | 
			
		||||
        if (key === 'link') {
 | 
			
		||||
            object = context.selectedObject || context.domainObject;
 | 
			
		||||
            return !(object.hasCapability("editor") && object.getCapability("editor").inEditContext());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Like all policies, allow by default.
 | 
			
		||||
        return true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return EditableLinkPolicy;
 | 
			
		||||
});
 | 
			
		||||
@@ -1,52 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define([], function () {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Policy suppressing move actions among editable and non-editable
 | 
			
		||||
     * domain objects.
 | 
			
		||||
     * @memberof platform/commonUI/edit
 | 
			
		||||
     * @constructor
 | 
			
		||||
     * @implements {Policy.<View, DomainObject>}
 | 
			
		||||
     */
 | 
			
		||||
    function EditableMovePolicy() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    EditableMovePolicy.prototype.allow = function (action, context) {
 | 
			
		||||
        var domainObject = context.domainObject,
 | 
			
		||||
            selectedObject = context.selectedObject,
 | 
			
		||||
            key = action.getMetadata().key,
 | 
			
		||||
            isDomainObjectEditing = domainObject.hasCapability('editor') &&
 | 
			
		||||
                domainObject.getCapability('editor').inEditContext();
 | 
			
		||||
 | 
			
		||||
        if (key === 'move' && isDomainObjectEditing) {
 | 
			
		||||
            return !!selectedObject && selectedObject.hasCapability('editor') &&
 | 
			
		||||
                selectedObject.getCapability('editor').inEditContext();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Like all policies, allow by default.
 | 
			
		||||
        return true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return EditableMovePolicy;
 | 
			
		||||
});
 | 
			
		||||
@@ -1,254 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
define(
 | 
			
		||||
    [
 | 
			
		||||
        '../../../../../src/api/objects/object-utils',
 | 
			
		||||
        'lodash'
 | 
			
		||||
    ],
 | 
			
		||||
    function (
 | 
			
		||||
        objectUtils,
 | 
			
		||||
        _
 | 
			
		||||
    ) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Provides initial structure and state (as suitable for provision
 | 
			
		||||
         * to the `mct-toolbar` directive) for a view's toolbar, based on
 | 
			
		||||
         * that view's declaration of what belongs in its toolbar and on
 | 
			
		||||
         * the current selection.
 | 
			
		||||
         *
 | 
			
		||||
         * @param $scope the Angular scope
 | 
			
		||||
         * @param {Object} openmct the openmct object
 | 
			
		||||
         * @param structure the toolbar structure
 | 
			
		||||
         * @memberof platform/commonUI/edit
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function EditToolbar($scope, openmct, structure) {
 | 
			
		||||
            this.toolbarStructure = [];
 | 
			
		||||
            this.properties = [];
 | 
			
		||||
            this.toolbarState = [];
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
            this.domainObjectsById = {};
 | 
			
		||||
            this.unobserveObjects = [];
 | 
			
		||||
            this.stateTracker = [];
 | 
			
		||||
 | 
			
		||||
            $scope.$watchCollection(this.getState.bind(this), this.handleStateChanges.bind(this));
 | 
			
		||||
            $scope.$on("$destroy", this.destroy.bind(this));
 | 
			
		||||
 | 
			
		||||
            this.updateToolbar(structure);
 | 
			
		||||
            this.registerListeners(structure);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Updates the toolbar with a new structure.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {Array} structure the toolbar structure
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.updateToolbar = function (structure) {
 | 
			
		||||
            var self = this;
 | 
			
		||||
 | 
			
		||||
            function addKey(item) {
 | 
			
		||||
                self.stateTracker.push({
 | 
			
		||||
                    id: objectUtils.makeKeyString(item.domainObject.identifier),
 | 
			
		||||
                    domainObject: item.domainObject,
 | 
			
		||||
                    property: item.property
 | 
			
		||||
                });
 | 
			
		||||
                self.properties.push(item.property);
 | 
			
		||||
 | 
			
		||||
                return self.properties.length - 1; // Return index of property
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function convertItem(item) {
 | 
			
		||||
                var converted = Object.create(item || {});
 | 
			
		||||
 | 
			
		||||
                if (item.property) {
 | 
			
		||||
                    converted.key = addKey(item);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (item.method) {
 | 
			
		||||
                    converted.click = function (value) {
 | 
			
		||||
                        item.method(value);
 | 
			
		||||
                    };
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return converted;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Get initial value for a given property
 | 
			
		||||
            function initializeState(property) {
 | 
			
		||||
                var result;
 | 
			
		||||
                structure.forEach(function (item) {
 | 
			
		||||
                    if (item.property === property) {
 | 
			
		||||
                        result = _.get(item.domainObject, item.property);
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                return result;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Tracks the domain object and property for every element in the state array
 | 
			
		||||
            this.stateTracker = [];
 | 
			
		||||
            this.toolbarStructure = structure.map(convertItem);
 | 
			
		||||
            this.toolbarState = this.properties.map(initializeState);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Gets the structure of the toolbar, as appropriate to
 | 
			
		||||
         * pass to `mct-toolbar`.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns {Array} the toolbar structure
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.getStructure = function () {
 | 
			
		||||
            return this.toolbarStructure;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Gets the current state of the toolbar, as appropriate
 | 
			
		||||
         * to two-way bind to the state handled by `mct-toolbar`.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns {Array} state of the toolbar
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.getState = function () {
 | 
			
		||||
            return this.toolbarState;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Mutates the domain object's property with a new value.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {Object} dominObject the domain object
 | 
			
		||||
         * @param {string} property the domain object's property to update
 | 
			
		||||
         * @param value the property's new value
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.updateDomainObject = function (domainObject, property, value) {
 | 
			
		||||
            this.openmct.objects.mutate(domainObject, property, value);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Updates state with the new value.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {number} index the index of the corresponding
 | 
			
		||||
         *        element in the state array
 | 
			
		||||
         * @param value the new value to update the state array with
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.updateState = function (index, value) {
 | 
			
		||||
            this.toolbarState[index] = value;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Register listeners for domain objects to watch for updates.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {Array} the toolbar structure
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.registerListeners = function (structure) {
 | 
			
		||||
            var self = this;
 | 
			
		||||
 | 
			
		||||
            function observeObject(domainObject, id) {
 | 
			
		||||
                var unobserveObject = self.openmct.objects.observe(domainObject, '*', function (newObject) {
 | 
			
		||||
                    self.domainObjectsById[id].newObject = JSON.parse(JSON.stringify(newObject));
 | 
			
		||||
                    self.scheduleStateUpdate();
 | 
			
		||||
                });
 | 
			
		||||
                self.unobserveObjects.push(unobserveObject);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            structure.forEach(function (item) {
 | 
			
		||||
                var domainObject = item.domainObject;
 | 
			
		||||
                var id = objectUtils.makeKeyString(domainObject.identifier);
 | 
			
		||||
 | 
			
		||||
                if (!self.domainObjectsById[id]) {
 | 
			
		||||
                    self.domainObjectsById[id] = {
 | 
			
		||||
                        domainObject: domainObject,
 | 
			
		||||
                        properties: []
 | 
			
		||||
                    };
 | 
			
		||||
                    observeObject(domainObject, id);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                self.domainObjectsById[id].properties.push(item.property);
 | 
			
		||||
            });
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Delays updating the state.
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.scheduleStateUpdate = function () {
 | 
			
		||||
            if (this.stateUpdateScheduled) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.stateUpdateScheduled = true;
 | 
			
		||||
            setTimeout(this.updateStateAfterMutation.bind(this));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        EditToolbar.prototype.updateStateAfterMutation = function () {
 | 
			
		||||
            this.stateTracker.forEach(function (state, index) {
 | 
			
		||||
                if (!this.domainObjectsById[state.id].newObject) {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                var domainObject = this.domainObjectsById[state.id].domainObject;
 | 
			
		||||
                var newObject = this.domainObjectsById[state.id].newObject;
 | 
			
		||||
                var currentValue = _.get(domainObject, state.property);
 | 
			
		||||
                var newValue = _.get(newObject, state.property);
 | 
			
		||||
 | 
			
		||||
                state.domainObject = newObject;
 | 
			
		||||
 | 
			
		||||
                if (currentValue !== newValue) {
 | 
			
		||||
                    this.updateState(index, newValue);
 | 
			
		||||
                }
 | 
			
		||||
            }, this);
 | 
			
		||||
 | 
			
		||||
            Object.values(this.domainObjectsById).forEach(function (tracker) {
 | 
			
		||||
                if (tracker.newObject) {
 | 
			
		||||
                    tracker.domainObject = tracker.newObject;
 | 
			
		||||
                }
 | 
			
		||||
                delete tracker.newObject;
 | 
			
		||||
            });
 | 
			
		||||
            this.stateUpdateScheduled = false;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Removes the listeners.
 | 
			
		||||
         */
 | 
			
		||||
        EditToolbar.prototype.deregisterListeners = function () {
 | 
			
		||||
            this.unobserveObjects.forEach(function (unobserveObject) {
 | 
			
		||||
                unobserveObject();
 | 
			
		||||
            });
 | 
			
		||||
            this.unobserveObjects = [];
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        EditToolbar.prototype.handleStateChanges = function (state) {
 | 
			
		||||
            (state || []).map(function (newValue, index) {
 | 
			
		||||
                var domainObject = this.stateTracker[index].domainObject;
 | 
			
		||||
                var property = this.stateTracker[index].property;
 | 
			
		||||
                var currentValue = _.get(domainObject, property);
 | 
			
		||||
 | 
			
		||||
                if (currentValue !== newValue) {
 | 
			
		||||
                    this.updateDomainObject(domainObject, property, newValue);
 | 
			
		||||
                }
 | 
			
		||||
            }, this);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        EditToolbar.prototype.destroy = function () {
 | 
			
		||||
            this.deregisterListeners();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return EditToolbar;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -25,8 +25,7 @@ define(
 | 
			
		||||
    function (EditAndComposeAction) {
 | 
			
		||||
 | 
			
		||||
        describe("The Link action", function () {
 | 
			
		||||
            var mockQ,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
            var mockDomainObject,
 | 
			
		||||
                mockParent,
 | 
			
		||||
                mockContext,
 | 
			
		||||
                mockComposition,
 | 
			
		||||
@@ -47,13 +46,10 @@ define(
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj(
 | 
			
		||||
                    "domainObject",
 | 
			
		||||
                    ["getId", "getCapability"]
 | 
			
		||||
                );
 | 
			
		||||
                mockQ = { when: mockPromise };
 | 
			
		||||
                mockParent = {
 | 
			
		||||
                    getModel: function () {
 | 
			
		||||
                        return model;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,50 +25,37 @@ define(
 | 
			
		||||
    function (RemoveAction) {
 | 
			
		||||
 | 
			
		||||
        describe("The Remove action", function () {
 | 
			
		||||
            var mockQ,
 | 
			
		||||
                mockNavigationService,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockParent,
 | 
			
		||||
                mockChildObject,
 | 
			
		||||
                mockGrandchildObject,
 | 
			
		||||
                mockRootObject,
 | 
			
		||||
                mockContext,
 | 
			
		||||
                mockChildContext,
 | 
			
		||||
                mockGrandchildContext,
 | 
			
		||||
                mockRootContext,
 | 
			
		||||
                mockMutation,
 | 
			
		||||
                mockType,
 | 
			
		||||
            var action,
 | 
			
		||||
                actionContext,
 | 
			
		||||
                model,
 | 
			
		||||
                capabilities,
 | 
			
		||||
                action;
 | 
			
		||||
 | 
			
		||||
            function mockPromise(value) {
 | 
			
		||||
                return {
 | 
			
		||||
                    then: function (callback) {
 | 
			
		||||
                        return mockPromise(callback(value));
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
                mockContext,
 | 
			
		||||
                mockOverlayAPI,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockMutation,
 | 
			
		||||
                mockNavigationService,
 | 
			
		||||
                mockParent,
 | 
			
		||||
                mockType,
 | 
			
		||||
                model;
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj(
 | 
			
		||||
                    "domainObject",
 | 
			
		||||
                    ["getId", "getCapability"]
 | 
			
		||||
                    ["getId", "getCapability", "getModel"]
 | 
			
		||||
                );
 | 
			
		||||
                mockChildObject = jasmine.createSpyObj(
 | 
			
		||||
                    "domainObject",
 | 
			
		||||
                    ["getId", "getCapability"]
 | 
			
		||||
                );
 | 
			
		||||
                mockGrandchildObject = jasmine.createSpyObj(
 | 
			
		||||
                    "domainObject",
 | 
			
		||||
                    ["getId", "getCapability"]
 | 
			
		||||
                );
 | 
			
		||||
                mockRootObject = jasmine.createSpyObj(
 | 
			
		||||
                    "domainObject",
 | 
			
		||||
                    ["getId", "getCapability"]
 | 
			
		||||
                );
 | 
			
		||||
                mockQ = { when: mockPromise };
 | 
			
		||||
 | 
			
		||||
                mockMutation = jasmine.createSpyObj("mutation", ["invoke"]);
 | 
			
		||||
                mockType = jasmine.createSpyObj("type", ["hasFeature"]);
 | 
			
		||||
                mockType.hasFeature.and.returnValue(true);
 | 
			
		||||
 | 
			
		||||
                capabilities = {
 | 
			
		||||
                    mutation: mockMutation,
 | 
			
		||||
                    type: mockType
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                model = {
 | 
			
		||||
                    composition: ["a", "test", "b"]
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                mockParent = {
 | 
			
		||||
                    getModel: function () {
 | 
			
		||||
                        return model;
 | 
			
		||||
@@ -80,12 +67,12 @@ define(
 | 
			
		||||
                        return capabilities[k].invoke(v);
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
                mockContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
                mockChildContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
                mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
                mockRootContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
                mockMutation = jasmine.createSpyObj("mutation", ["invoke"]);
 | 
			
		||||
                mockType = jasmine.createSpyObj("type", ["hasFeature"]);
 | 
			
		||||
 | 
			
		||||
                mockOverlayAPI = jasmine.createSpyObj(
 | 
			
		||||
                    "overlayAPI",
 | 
			
		||||
                    ["dialog"]
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                mockNavigationService = jasmine.createSpyObj(
 | 
			
		||||
                    "navigationService",
 | 
			
		||||
                    [
 | 
			
		||||
@@ -97,23 +84,19 @@ define(
 | 
			
		||||
                );
 | 
			
		||||
                mockNavigationService.getNavigation.and.returnValue(mockDomainObject);
 | 
			
		||||
 | 
			
		||||
                mockContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
                mockContext.getParent.and.returnValue(mockParent);
 | 
			
		||||
 | 
			
		||||
                mockDomainObject.getId.and.returnValue("test");
 | 
			
		||||
                mockDomainObject.getCapability.and.returnValue(mockContext);
 | 
			
		||||
                mockDomainObject.getModel.and.returnValue({name: 'test object'});
 | 
			
		||||
 | 
			
		||||
                mockContext.getParent.and.returnValue(mockParent);
 | 
			
		||||
                mockType.hasFeature.and.returnValue(true);
 | 
			
		||||
 | 
			
		||||
                capabilities = {
 | 
			
		||||
                    mutation: mockMutation,
 | 
			
		||||
                    type: mockType
 | 
			
		||||
                };
 | 
			
		||||
                model = {
 | 
			
		||||
                    composition: ["a", "test", "b"]
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                actionContext = { domainObject: mockDomainObject };
 | 
			
		||||
 | 
			
		||||
                action = new RemoveAction(mockNavigationService, actionContext);
 | 
			
		||||
                action = new RemoveAction({overlays: mockOverlayAPI}, mockNavigationService, actionContext);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("only applies to objects with parents", function () {
 | 
			
		||||
@@ -127,83 +110,146 @@ define(
 | 
			
		||||
                expect(mockType.hasFeature).toHaveBeenCalledWith('creation');
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("mutates the parent when performed", function () {
 | 
			
		||||
                action.perform();
 | 
			
		||||
                expect(mockMutation.invoke)
 | 
			
		||||
                    .toHaveBeenCalledWith(jasmine.any(Function));
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            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);
 | 
			
		||||
            it("shows a blocking message dialog", function () {
 | 
			
		||||
                mockParent = jasmine.createSpyObj(
 | 
			
		||||
                    "parent",
 | 
			
		||||
                    ["getModel", "getCapability", "useCapability"]
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                action.perform();
 | 
			
		||||
 | 
			
		||||
                // Expects navigation to parent of domainObject (removed object)
 | 
			
		||||
                expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent);
 | 
			
		||||
                expect(mockOverlayAPI.dialog).toHaveBeenCalled();
 | 
			
		||||
 | 
			
		||||
                // 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 () {
 | 
			
		||||
                // Navigates to grandchild of ROOT
 | 
			
		||||
                mockNavigationService.getNavigation.and.returnValue(mockGrandchildObject);
 | 
			
		||||
            describe("after the remove callback is triggered", function () {
 | 
			
		||||
                var mockChildContext,
 | 
			
		||||
                    mockChildObject,
 | 
			
		||||
                    mockDialogHandle,
 | 
			
		||||
                    mockGrandchildContext,
 | 
			
		||||
                    mockGrandchildObject,
 | 
			
		||||
                    mockRootContext,
 | 
			
		||||
                    mockRootObject;
 | 
			
		||||
 | 
			
		||||
                // 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");
 | 
			
		||||
                beforeEach(function () {
 | 
			
		||||
                    mockChildObject = jasmine.createSpyObj(
 | 
			
		||||
                        "domainObject",
 | 
			
		||||
                        ["getId", "getCapability"]
 | 
			
		||||
                    );
 | 
			
		||||
 | 
			
		||||
                // Sets context for the grandchild, child, and domainObject
 | 
			
		||||
                mockRootObject.getCapability.and.returnValue(mockRootContext);
 | 
			
		||||
                mockChildObject.getCapability.and.returnValue(mockChildContext);
 | 
			
		||||
                mockGrandchildObject.getCapability.and.returnValue(mockGrandchildContext);
 | 
			
		||||
                    mockDialogHandle = jasmine.createSpyObj(
 | 
			
		||||
                        "dialogHandle",
 | 
			
		||||
                        ["dismiss"]
 | 
			
		||||
                    );
 | 
			
		||||
 | 
			
		||||
                // Parents of grandchild and child are set
 | 
			
		||||
                mockChildContext.getParent.and.returnValue(mockRootObject);
 | 
			
		||||
                mockGrandchildContext.getParent.and.returnValue(mockChildObject);
 | 
			
		||||
                    mockGrandchildObject = jasmine.createSpyObj(
 | 
			
		||||
                        "domainObject",
 | 
			
		||||
                        ["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"]);
 | 
			
		||||
 | 
			
		||||
                    mockOverlayAPI.dialog.and.returnValue(mockDialogHandle);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("mutates the parent when performed", function () {
 | 
			
		||||
                    action.perform();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].callback();
 | 
			
		||||
 | 
			
		||||
                    expect(mockMutation.invoke)
 | 
			
		||||
                        .toHaveBeenCalledWith(jasmine.any(Function));
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("changes composition from its mutation function", function () {
 | 
			
		||||
                    var mutator, result;
 | 
			
		||||
 | 
			
		||||
                    action.perform();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].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();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].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();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].callback();
 | 
			
		||||
 | 
			
		||||
                    // Expects no navigation to occur
 | 
			
		||||
                    expect(mockNavigationService.setNavigation).not.toHaveBeenCalled();
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                // Expects no navigation to occur
 | 
			
		||||
                expect(mockNavigationService.setNavigation).not.toHaveBeenCalled();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,184 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
/*global describe,it,expect,beforeEach,jasmine*/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    ["../../src/controllers/ElementsController"],
 | 
			
		||||
    function (ElementsController) {
 | 
			
		||||
 | 
			
		||||
        describe("The Elements Pane controller", function () {
 | 
			
		||||
            var mockScope,
 | 
			
		||||
                mockOpenMCT,
 | 
			
		||||
                mockSelection,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockMutationCapability,
 | 
			
		||||
                mockCompositionCapability,
 | 
			
		||||
                mockCompositionObjects,
 | 
			
		||||
                mockComposition,
 | 
			
		||||
                mockUnlisten,
 | 
			
		||||
                selectable = [],
 | 
			
		||||
                controller;
 | 
			
		||||
 | 
			
		||||
            function mockPromise(value) {
 | 
			
		||||
                return {
 | 
			
		||||
                    then: function (thenFunc) {
 | 
			
		||||
                        return mockPromise(thenFunc(value));
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            function createDomainObject() {
 | 
			
		||||
                return {
 | 
			
		||||
                    useCapability: function () {
 | 
			
		||||
                        return mockCompositionCapability;
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockComposition = ["a", "b"];
 | 
			
		||||
                mockCompositionObjects = mockComposition.map(createDomainObject);
 | 
			
		||||
                mockCompositionCapability = mockPromise(mockCompositionObjects);
 | 
			
		||||
 | 
			
		||||
                mockUnlisten = jasmine.createSpy('unlisten');
 | 
			
		||||
                mockMutationCapability = jasmine.createSpyObj("mutationCapability", [
 | 
			
		||||
                    "listen"
 | 
			
		||||
                ]);
 | 
			
		||||
                mockMutationCapability.listen.and.returnValue(mockUnlisten);
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj("domainObject", [
 | 
			
		||||
                    "getCapability",
 | 
			
		||||
                    "useCapability"
 | 
			
		||||
                ]);
 | 
			
		||||
                mockDomainObject.useCapability.and.returnValue(mockCompositionCapability);
 | 
			
		||||
                mockDomainObject.getCapability.and.returnValue(mockMutationCapability);
 | 
			
		||||
 | 
			
		||||
                mockScope = jasmine.createSpyObj("$scope", ['$on']);
 | 
			
		||||
                mockSelection = jasmine.createSpyObj("selection", [
 | 
			
		||||
                    'on',
 | 
			
		||||
                    'off',
 | 
			
		||||
                    'get'
 | 
			
		||||
                ]);
 | 
			
		||||
                mockSelection.get.and.returnValue([]);
 | 
			
		||||
                mockOpenMCT = {
 | 
			
		||||
                    selection: mockSelection
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                selectable[0] = {
 | 
			
		||||
                    context: {
 | 
			
		||||
                        oldItem: mockDomainObject
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                spyOn(ElementsController.prototype, 'refreshComposition').and.callThrough();
 | 
			
		||||
 | 
			
		||||
                controller = new ElementsController(mockScope, mockOpenMCT);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            function getModel(model) {
 | 
			
		||||
                return function () {
 | 
			
		||||
                    return model;
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            it("filters objects in elements pool based on input text and" +
 | 
			
		||||
                " object name", function () {
 | 
			
		||||
                var objects = [
 | 
			
		||||
                    {
 | 
			
		||||
                        getModel: getModel({name: "first element"})
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        getModel: getModel({name: "second element"})
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        getModel: getModel({name: "third element"})
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        getModel: getModel({name: "THIRD Element 1"})
 | 
			
		||||
                    }
 | 
			
		||||
                ];
 | 
			
		||||
 | 
			
		||||
                mockScope.filterBy("third element");
 | 
			
		||||
                expect(objects.filter(mockScope.searchElements).length).toBe(2);
 | 
			
		||||
                mockScope.filterBy("element");
 | 
			
		||||
                expect(objects.filter(mockScope.searchElements).length).toBe(4);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("refreshes composition on selection", function () {
 | 
			
		||||
                mockOpenMCT.selection.on.calls.mostRecent().args[1](selectable);
 | 
			
		||||
 | 
			
		||||
                expect(ElementsController.prototype.refreshComposition).toHaveBeenCalledWith(mockDomainObject);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("listens on mutation and refreshes composition", function () {
 | 
			
		||||
                mockOpenMCT.selection.on.calls.mostRecent().args[1](selectable);
 | 
			
		||||
 | 
			
		||||
                expect(mockDomainObject.getCapability).toHaveBeenCalledWith('mutation');
 | 
			
		||||
                expect(mockMutationCapability.listen).toHaveBeenCalled();
 | 
			
		||||
                expect(ElementsController.prototype.refreshComposition.calls.count()).toBe(1);
 | 
			
		||||
 | 
			
		||||
                mockMutationCapability.listen.calls.mostRecent().args[0](mockDomainObject);
 | 
			
		||||
 | 
			
		||||
                expect(ElementsController.prototype.refreshComposition.calls.count()).toBe(2);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("cleans up mutation listener when selection changes", function () {
 | 
			
		||||
                mockOpenMCT.selection.on.calls.mostRecent().args[1](selectable);
 | 
			
		||||
 | 
			
		||||
                expect(mockMutationCapability.listen).toHaveBeenCalled();
 | 
			
		||||
 | 
			
		||||
                mockOpenMCT.selection.on.calls.mostRecent().args[1](selectable);
 | 
			
		||||
 | 
			
		||||
                expect(mockUnlisten).toHaveBeenCalled();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("does not listen on mutation for element proxy selectable", function () {
 | 
			
		||||
                selectable[0] = {
 | 
			
		||||
                    context: {
 | 
			
		||||
                        elementProxy: {}
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
                mockOpenMCT.selection.on.calls.mostRecent().args[1](selectable);
 | 
			
		||||
 | 
			
		||||
                expect(mockDomainObject.getCapability).not.toHaveBeenCalledWith('mutation');
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("checks concurrent changes to composition", function () {
 | 
			
		||||
                var secondMockComposition = ["a", "b", "c"],
 | 
			
		||||
                    secondMockCompositionObjects = secondMockComposition.map(createDomainObject),
 | 
			
		||||
                    firstCompositionCallback,
 | 
			
		||||
                    secondCompositionCallback;
 | 
			
		||||
 | 
			
		||||
                spyOn(mockCompositionCapability, "then").and.callThrough();
 | 
			
		||||
 | 
			
		||||
                controller.refreshComposition(mockDomainObject);
 | 
			
		||||
                controller.refreshComposition(mockDomainObject);
 | 
			
		||||
 | 
			
		||||
                firstCompositionCallback = mockCompositionCapability.then.calls.all()[0].args[0];
 | 
			
		||||
                secondCompositionCallback = mockCompositionCapability.then.calls.all()[1].args[0];
 | 
			
		||||
                secondCompositionCallback(secondMockCompositionObjects);
 | 
			
		||||
                firstCompositionCallback(mockCompositionObjects);
 | 
			
		||||
 | 
			
		||||
                expect(mockScope.composition).toBe(secondMockCompositionObjects);
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,105 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * MCTRepresentationSpec. Created by ahenry on 01/21/14.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ["../../src/creation/AddActionProvider"],
 | 
			
		||||
    function (AddActionProvider) {
 | 
			
		||||
 | 
			
		||||
        describe("The add action provider", function () {
 | 
			
		||||
            var mockTypeService,
 | 
			
		||||
                mockDialogService,
 | 
			
		||||
                mockPolicyService,
 | 
			
		||||
                mockTypeMap,
 | 
			
		||||
                mockTypes,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockQ,
 | 
			
		||||
                provider;
 | 
			
		||||
 | 
			
		||||
            function createMockType(name) {
 | 
			
		||||
                var mockType = jasmine.createSpyObj(
 | 
			
		||||
                    "type" + name,
 | 
			
		||||
                    [
 | 
			
		||||
                        "getKey",
 | 
			
		||||
                        "getGlyph",
 | 
			
		||||
                        "getCssClass",
 | 
			
		||||
                        "getName",
 | 
			
		||||
                        "getDescription",
 | 
			
		||||
                        "getProperties",
 | 
			
		||||
                        "getInitialModel",
 | 
			
		||||
                        "hasFeature"
 | 
			
		||||
                    ]
 | 
			
		||||
                );
 | 
			
		||||
                mockType.hasFeature.and.returnValue(true);
 | 
			
		||||
                mockType.getName.and.returnValue(name);
 | 
			
		||||
                mockType.getKey.and.returnValue(name);
 | 
			
		||||
                return mockType;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockTypeService = jasmine.createSpyObj(
 | 
			
		||||
                    "typeService",
 | 
			
		||||
                    ["getType"]
 | 
			
		||||
                );
 | 
			
		||||
                mockDialogService = {};
 | 
			
		||||
                mockPolicyService = {};
 | 
			
		||||
                mockDomainObject = {};
 | 
			
		||||
 | 
			
		||||
                mockTypes = [
 | 
			
		||||
                    "timeline",
 | 
			
		||||
                    "activity",
 | 
			
		||||
                    "other"
 | 
			
		||||
                ].map(createMockType);
 | 
			
		||||
                mockTypeMap = {};
 | 
			
		||||
 | 
			
		||||
                mockTypes.forEach(function (type) {
 | 
			
		||||
                    mockTypeMap[type.getKey()] = type;
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                mockTypeService.getType.and.callFake(function (key) {
 | 
			
		||||
                    return mockTypeMap[key];
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                provider = new AddActionProvider(
 | 
			
		||||
                    mockQ,
 | 
			
		||||
                    mockTypeService,
 | 
			
		||||
                    mockDialogService,
 | 
			
		||||
                    mockPolicyService
 | 
			
		||||
                );
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("provides actions for timeline and activity", function () {
 | 
			
		||||
                var actions = provider.getActions({
 | 
			
		||||
                    key: "add",
 | 
			
		||||
                    domainObject: mockDomainObject
 | 
			
		||||
                });
 | 
			
		||||
                expect(actions.length).toBe(2);
 | 
			
		||||
                expect(actions[0].metadata.type).toBe('timeline');
 | 
			
		||||
                expect(actions[1].metadata.type).toBe('activity');
 | 
			
		||||
 | 
			
		||||
                // Make sure it was creation which was used to check
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -34,7 +34,6 @@ define(
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                capabilities = {},
 | 
			
		||||
                mockEditAction,
 | 
			
		||||
                mockSaveAction,
 | 
			
		||||
                action;
 | 
			
		||||
 | 
			
		||||
            function mockPromise(value) {
 | 
			
		||||
@@ -83,12 +82,6 @@ define(
 | 
			
		||||
                mockDomainObject.getCapability.and.callFake(function (name) {
 | 
			
		||||
                    return capabilities[name];
 | 
			
		||||
                });
 | 
			
		||||
                mockSaveAction = jasmine.createSpyObj(
 | 
			
		||||
                    "saveAction",
 | 
			
		||||
                    [
 | 
			
		||||
                        "perform"
 | 
			
		||||
                    ]
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                capabilities.action = jasmine.createSpyObj(
 | 
			
		||||
                    "actionCapability",
 | 
			
		||||
 
 | 
			
		||||
@@ -142,11 +142,11 @@ define(
 | 
			
		||||
 | 
			
		||||
            it("populates the model on the associated object", function () {
 | 
			
		||||
                var formValue = {
 | 
			
		||||
                    "A": "ValueA",
 | 
			
		||||
                    "B": "ValueB",
 | 
			
		||||
                    "C": "ValueC"
 | 
			
		||||
                },
 | 
			
		||||
                compareModel = wizard.createModel(formValue);
 | 
			
		||||
                        "A": "ValueA",
 | 
			
		||||
                        "B": "ValueB",
 | 
			
		||||
                        "C": "ValueC"
 | 
			
		||||
                    },
 | 
			
		||||
                    compareModel = wizard.createModel(formValue);
 | 
			
		||||
                //populateObjectFromInput adds a .location attribute that is not added by createModel.
 | 
			
		||||
                compareModel.location = undefined;
 | 
			
		||||
                wizard.populateObjectFromInput(formValue);
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,7 @@ define(
 | 
			
		||||
                mockNewObject.getId.and.returnValue('newId');
 | 
			
		||||
                mockNewObject.getCapability.and.callFake(function (c) {
 | 
			
		||||
                    return c === 'persistence' ?
 | 
			
		||||
                            mockNewPersistenceCapability : undefined;
 | 
			
		||||
                        mockNewPersistenceCapability : undefined;
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                mockPersistenceCapability.persist
 | 
			
		||||
 
 | 
			
		||||
@@ -76,66 +76,66 @@ define(
 | 
			
		||||
            describe("when context is available", function () {
 | 
			
		||||
 | 
			
		||||
                beforeEach(function () {
 | 
			
		||||
                        mockContext.getRoot.and.returnValue(mockRootObject);
 | 
			
		||||
                        controller = new LocatorController(mockScope, mockTimeout, mockObjectService);
 | 
			
		||||
                    });
 | 
			
		||||
                    mockContext.getRoot.and.returnValue(mockRootObject);
 | 
			
		||||
                    controller = new LocatorController(mockScope, mockTimeout, mockObjectService);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("adds a treeModel to scope", function () {
 | 
			
		||||
                        expect(mockScope.treeModel).toBeDefined();
 | 
			
		||||
                    });
 | 
			
		||||
                    expect(mockScope.treeModel).toBeDefined();
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("watches for changes to treeModel", function () {
 | 
			
		||||
                        // This is what the embedded tree representation
 | 
			
		||||
                        // will be modifying.
 | 
			
		||||
                        expect(mockScope.$watch).toHaveBeenCalledWith(
 | 
			
		||||
                            "treeModel.selectedObject",
 | 
			
		||||
                            jasmine.any(Function)
 | 
			
		||||
                        );
 | 
			
		||||
                    });
 | 
			
		||||
                    // This is what the embedded tree representation
 | 
			
		||||
                    // will be modifying.
 | 
			
		||||
                    expect(mockScope.$watch).toHaveBeenCalledWith(
 | 
			
		||||
                        "treeModel.selectedObject",
 | 
			
		||||
                        jasmine.any(Function)
 | 
			
		||||
                    );
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("changes its own model on embedded model updates", function () {
 | 
			
		||||
                        // Need to pass on selection changes as updates to
 | 
			
		||||
                        // the control's value
 | 
			
		||||
                        mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
 | 
			
		||||
                        mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                        expect(mockScope.ngModel.someField).toEqual(mockDomainObject);
 | 
			
		||||
                        expect(mockScope.rootObject).toEqual(mockRootObject);
 | 
			
		||||
                    // Need to pass on selection changes as updates to
 | 
			
		||||
                    // the control's value
 | 
			
		||||
                    mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
 | 
			
		||||
                    mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                    expect(mockScope.ngModel.someField).toEqual(mockDomainObject);
 | 
			
		||||
                    expect(mockScope.rootObject).toEqual(mockRootObject);
 | 
			
		||||
 | 
			
		||||
                        // Verify that the capability we expect to have been used
 | 
			
		||||
                        // was used.
 | 
			
		||||
                        expect(mockDomainObject.getCapability)
 | 
			
		||||
                            .toHaveBeenCalledWith("context");
 | 
			
		||||
                    });
 | 
			
		||||
                    // Verify that the capability we expect to have been used
 | 
			
		||||
                    // was used.
 | 
			
		||||
                    expect(mockDomainObject.getCapability)
 | 
			
		||||
                        .toHaveBeenCalledWith("context");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("rejects changes which fail validation", function () {
 | 
			
		||||
                        mockScope.structure = { validate: jasmine.createSpy('validate') };
 | 
			
		||||
                        mockScope.structure.validate.and.returnValue(false);
 | 
			
		||||
                    mockScope.structure = { validate: jasmine.createSpy('validate') };
 | 
			
		||||
                    mockScope.structure.validate.and.returnValue(false);
 | 
			
		||||
 | 
			
		||||
                        // Pass selection change
 | 
			
		||||
                        mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
 | 
			
		||||
                        mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                    // Pass selection change
 | 
			
		||||
                    mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
 | 
			
		||||
                    mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
 | 
			
		||||
                        expect(mockScope.structure.validate).toHaveBeenCalled();
 | 
			
		||||
                        // Change should have been rejected
 | 
			
		||||
                        expect(mockScope.ngModel.someField).not.toEqual(mockDomainObject);
 | 
			
		||||
                    });
 | 
			
		||||
                    expect(mockScope.structure.validate).toHaveBeenCalled();
 | 
			
		||||
                    // Change should have been rejected
 | 
			
		||||
                    expect(mockScope.ngModel.someField).not.toEqual(mockDomainObject);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("treats a lack of a selection as invalid", function () {
 | 
			
		||||
                        mockScope.ngModelController = jasmine.createSpyObj(
 | 
			
		||||
                            'ngModelController',
 | 
			
		||||
                            ['$setValidity']
 | 
			
		||||
                        );
 | 
			
		||||
                    mockScope.ngModelController = jasmine.createSpyObj(
 | 
			
		||||
                        'ngModelController',
 | 
			
		||||
                        ['$setValidity']
 | 
			
		||||
                    );
 | 
			
		||||
 | 
			
		||||
                        mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
 | 
			
		||||
                        mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                        expect(mockScope.ngModelController.$setValidity)
 | 
			
		||||
                            .toHaveBeenCalledWith(jasmine.any(String), true);
 | 
			
		||||
                    mockScope.$watch.calls.mostRecent().args[1](mockDomainObject);
 | 
			
		||||
                    mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                    expect(mockScope.ngModelController.$setValidity)
 | 
			
		||||
                        .toHaveBeenCalledWith(jasmine.any(String), true);
 | 
			
		||||
 | 
			
		||||
                        mockScope.$watch.calls.mostRecent().args[1](undefined);
 | 
			
		||||
                        mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                        expect(mockScope.ngModelController.$setValidity)
 | 
			
		||||
                            .toHaveBeenCalledWith(jasmine.any(String), false);
 | 
			
		||||
                    });
 | 
			
		||||
                    mockScope.$watch.calls.mostRecent().args[1](undefined);
 | 
			
		||||
                    mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
                    expect(mockScope.ngModelController.$setValidity)
 | 
			
		||||
                        .toHaveBeenCalledWith(jasmine.any(String), false);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
            describe("when no context is available", function () {
 | 
			
		||||
                var defaultRoot = "DEFAULT_ROOT";
 | 
			
		||||
 
 | 
			
		||||
@@ -1,140 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    ["../../src/policies/EditActionPolicy"],
 | 
			
		||||
    function (EditActionPolicy) {
 | 
			
		||||
 | 
			
		||||
        describe("The Edit action policy", function () {
 | 
			
		||||
            var editableView,
 | 
			
		||||
                nonEditableView,
 | 
			
		||||
                undefinedView,
 | 
			
		||||
                testViews,
 | 
			
		||||
                testContext,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockEditAction,
 | 
			
		||||
                mockPropertiesAction,
 | 
			
		||||
                mockTypeCapability,
 | 
			
		||||
                mockEditorCapability,
 | 
			
		||||
                capabilities,
 | 
			
		||||
                plotView,
 | 
			
		||||
                policy;
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj(
 | 
			
		||||
                    'domainObject',
 | 
			
		||||
                    [
 | 
			
		||||
                        'useCapability',
 | 
			
		||||
                        'hasCapability',
 | 
			
		||||
                        'getCapability'
 | 
			
		||||
                    ]
 | 
			
		||||
                );
 | 
			
		||||
                mockEditorCapability = jasmine.createSpyObj('editorCapability', ['isEditContextRoot']);
 | 
			
		||||
                mockTypeCapability = jasmine.createSpyObj('type', ['getKey']);
 | 
			
		||||
                capabilities = {
 | 
			
		||||
                    'editor': mockEditorCapability,
 | 
			
		||||
                    'type': mockTypeCapability
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                mockEditAction = jasmine.createSpyObj('edit', ['getMetadata']);
 | 
			
		||||
                mockPropertiesAction = jasmine.createSpyObj('edit', ['getMetadata']);
 | 
			
		||||
 | 
			
		||||
                mockDomainObject.getCapability.and.callFake(function (capability) {
 | 
			
		||||
                    return capabilities[capability];
 | 
			
		||||
                });
 | 
			
		||||
                mockDomainObject.hasCapability.and.callFake(function (capability) {
 | 
			
		||||
                    return !!capabilities[capability];
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                editableView = { editable: true };
 | 
			
		||||
                nonEditableView = { editable: false };
 | 
			
		||||
                undefinedView = { someKey: "some value" };
 | 
			
		||||
                plotView = { key: "plot", editable: false };
 | 
			
		||||
                testViews = [];
 | 
			
		||||
 | 
			
		||||
                mockDomainObject.useCapability.and.callFake(function (c) {
 | 
			
		||||
                    // Provide test views, only for the view capability
 | 
			
		||||
                    return c === 'view' && testViews;
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                mockEditAction.getMetadata.and.returnValue({ key: 'edit' });
 | 
			
		||||
                mockPropertiesAction.getMetadata.and.returnValue({ key: 'properties' });
 | 
			
		||||
 | 
			
		||||
                testContext = {
 | 
			
		||||
                    domainObject: mockDomainObject,
 | 
			
		||||
                    category: 'view-control'
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                policy = new EditActionPolicy();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("allows the edit action when there are editable views", function () {
 | 
			
		||||
                testViews = [editableView];
 | 
			
		||||
                expect(policy.allow(mockEditAction, testContext)).toBe(true);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("allows the edit properties action when there are no editable views", function () {
 | 
			
		||||
                testViews = [nonEditableView, nonEditableView];
 | 
			
		||||
                expect(policy.allow(mockPropertiesAction, testContext)).toBe(true);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("disallows the edit action when there are no editable views", function () {
 | 
			
		||||
                testViews = [nonEditableView, nonEditableView];
 | 
			
		||||
                expect(policy.allow(mockEditAction, testContext)).toBe(false);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("disallows the edit properties action when there are" +
 | 
			
		||||
                " editable views", function () {
 | 
			
		||||
                testViews = [editableView];
 | 
			
		||||
                expect(policy.allow(mockPropertiesAction, testContext)).toBe(false);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("disallows the edit action when object is already being" +
 | 
			
		||||
                " edited", function () {
 | 
			
		||||
                testViews = [editableView];
 | 
			
		||||
                mockEditorCapability.isEditContextRoot.and.returnValue(true);
 | 
			
		||||
                expect(policy.allow(mockEditAction, testContext)).toBe(false);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("allows editing of panels in plot view", function () {
 | 
			
		||||
                testViews = [plotView];
 | 
			
		||||
                mockTypeCapability.getKey.and.returnValue('telemetry.panel');
 | 
			
		||||
 | 
			
		||||
                expect(policy.allow(mockEditAction, testContext)).toBe(true);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("disallows editing of plot view when object not a panel type", function () {
 | 
			
		||||
                testViews = [plotView];
 | 
			
		||||
                mockTypeCapability.getKey.and.returnValue('something.else');
 | 
			
		||||
 | 
			
		||||
                expect(policy.allow(mockEditAction, testContext)).toBe(false);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            it("allows the edit properties outside of the 'view-control' category", function () {
 | 
			
		||||
                testViews = [nonEditableView];
 | 
			
		||||
                testContext.category = "something-else";
 | 
			
		||||
                expect(policy.allow(mockPropertiesAction, testContext)).toBe(true);
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,120 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
/*global describe,it,expect,beforeEach,jasmine*/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    ["../../src/policies/EditContextualActionPolicy"],
 | 
			
		||||
    function (EditContextualActionPolicy) {
 | 
			
		||||
 | 
			
		||||
        describe("The Edit contextual action policy", function () {
 | 
			
		||||
            var policy,
 | 
			
		||||
                navigationService,
 | 
			
		||||
                mockAction,
 | 
			
		||||
                context,
 | 
			
		||||
                navigatedObject,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockEditorCapability,
 | 
			
		||||
                metadata,
 | 
			
		||||
                editModeBlacklist = ["copy", "follow", "window", "link", "locate"],
 | 
			
		||||
                nonEditContextBlacklist = ["copy", "follow", "properties", "move", "link", "remove", "locate"];
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockEditorCapability = jasmine.createSpyObj("editorCapability", ["isEditContextRoot", "inEditContext"]);
 | 
			
		||||
 | 
			
		||||
                navigatedObject = jasmine.createSpyObj("navigatedObject", ["hasCapability", "getCapability"]);
 | 
			
		||||
                navigatedObject.getCapability.and.returnValue(mockEditorCapability);
 | 
			
		||||
                navigatedObject.hasCapability.and.returnValue(false);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj("domainObject", ["hasCapability", "getCapability"]);
 | 
			
		||||
                mockDomainObject.hasCapability.and.returnValue(false);
 | 
			
		||||
                mockDomainObject.getCapability.and.returnValue(mockEditorCapability);
 | 
			
		||||
 | 
			
		||||
                navigationService = jasmine.createSpyObj("navigationService", ["getNavigation"]);
 | 
			
		||||
                navigationService.getNavigation.and.returnValue(navigatedObject);
 | 
			
		||||
 | 
			
		||||
                metadata = {key: "move"};
 | 
			
		||||
                mockAction = jasmine.createSpyObj("action", ["getMetadata"]);
 | 
			
		||||
                mockAction.getMetadata.and.returnValue(metadata);
 | 
			
		||||
 | 
			
		||||
                context = {domainObject: mockDomainObject};
 | 
			
		||||
 | 
			
		||||
                policy = new EditContextualActionPolicy(navigationService, editModeBlacklist, nonEditContextBlacklist);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('Allows all actions when navigated object not in edit mode', function () {
 | 
			
		||||
                expect(policy.allow(mockAction, context)).toBe(true);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('Allows "window" action when navigated object in edit mode,' +
 | 
			
		||||
                ' but selected object not in edit mode ', function () {
 | 
			
		||||
                navigatedObject.hasCapability.and.returnValue(true);
 | 
			
		||||
                mockEditorCapability.isEditContextRoot.and.returnValue(true);
 | 
			
		||||
                metadata.key = "window";
 | 
			
		||||
                expect(policy.allow(mockAction, context)).toBe(true);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('Allows "remove" action when navigated object in edit mode,' +
 | 
			
		||||
                ' and selected object not editable, but its parent is.',
 | 
			
		||||
                function () {
 | 
			
		||||
                    var mockParent = jasmine.createSpyObj("parentObject", ["hasCapability"]),
 | 
			
		||||
                        mockContextCapability = jasmine.createSpyObj("contextCapability", ["getParent"]);
 | 
			
		||||
 | 
			
		||||
                    mockParent.hasCapability.and.returnValue(true);
 | 
			
		||||
                    mockContextCapability.getParent.and.returnValue(mockParent);
 | 
			
		||||
                    navigatedObject.hasCapability.and.returnValue(true);
 | 
			
		||||
 | 
			
		||||
                    mockDomainObject.getCapability.and.returnValue(mockContextCapability);
 | 
			
		||||
                    mockDomainObject.hasCapability.and.callFake(function (capability) {
 | 
			
		||||
                        switch (capability) {
 | 
			
		||||
                            case "editor": return false;
 | 
			
		||||
                            case "context": return true;
 | 
			
		||||
                        }
 | 
			
		||||
                    });
 | 
			
		||||
                    metadata.key = "remove";
 | 
			
		||||
 | 
			
		||||
                    expect(policy.allow(mockAction, context)).toBe(true);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            it('Disallows "move" action when navigated object in edit mode,' +
 | 
			
		||||
                ' but selected object not in edit mode ', function () {
 | 
			
		||||
                navigatedObject.hasCapability.and.returnValue(true);
 | 
			
		||||
                mockEditorCapability.isEditContextRoot.and.returnValue(true);
 | 
			
		||||
                mockEditorCapability.inEditContext.and.returnValue(false);
 | 
			
		||||
                metadata.key = "move";
 | 
			
		||||
                expect(policy.allow(mockAction, context)).toBe(false);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('Disallows copy action when navigated object and' +
 | 
			
		||||
                ' selected object in edit mode', function () {
 | 
			
		||||
                navigatedObject.hasCapability.and.returnValue(true);
 | 
			
		||||
                mockDomainObject.hasCapability.and.returnValue(true);
 | 
			
		||||
                mockEditorCapability.isEditContextRoot.and.returnValue(true);
 | 
			
		||||
                mockEditorCapability.inEditContext.and.returnValue(true);
 | 
			
		||||
 | 
			
		||||
                metadata.key = "copy";
 | 
			
		||||
                expect(policy.allow(mockAction, context)).toBe(false);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user