Compare commits
	
		
			124 Commits
		
	
	
		
			dialog-ser
			...
			vista-4.1-
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					c688d19e15 | ||
| 
						 | 
					c0ce448dc3 | ||
| 
						 | 
					6c479d6d59 | ||
| 
						 | 
					76ba487261 | ||
| 
						 | 
					e3f4da19f9 | ||
| 
						 | 
					c7ffcbf7e0 | ||
| 
						 | 
					a27b3737f1 | ||
| 
						 | 
					78dccf1e0a | ||
| 
						 | 
					9cb7e09aef | ||
| 
						 | 
					4111c12895 | ||
| 
						 | 
					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 | 
							
								
								
									
										2
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								app.js
									
									
									
									
									
								
							@@ -46,7 +46,7 @@ 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',
 | 
			
		||||
    'webpack-hot-middleware/client?reload=true',
 | 
			
		||||
    webpackConfig.entry.openmct
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -37,25 +37,25 @@ define([
 | 
			
		||||
        },
 | 
			
		||||
        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"
 | 
			
		||||
 
 | 
			
		||||
@@ -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++
 | 
			
		||||
                });
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								index.html
									
									
									
									
									
								
							@@ -27,7 +27,7 @@
 | 
			
		||||
        <meta name="apple-mobile-web-app-capable" content="yes">
 | 
			
		||||
        <title></title>
 | 
			
		||||
        <script src="dist/openmct.js"></script>
 | 
			
		||||
        <link rel="stylesheet" href="dist/openmct.css">
 | 
			
		||||
        <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">
 | 
			
		||||
@@ -36,7 +36,9 @@
 | 
			
		||||
    <body>
 | 
			
		||||
    </body>
 | 
			
		||||
    <script>
 | 
			
		||||
        var THIRTY_MINUTES = 30 * 60 * 1000;
 | 
			
		||||
        const FIVE_MINUTES = 5 * 60 * 1000;
 | 
			
		||||
        const THIRTY_MINUTES = 30 * 60 * 1000;
 | 
			
		||||
 | 
			
		||||
        [
 | 
			
		||||
            'example/eventGenerator',
 | 
			
		||||
            'example/styleguide'
 | 
			
		||||
@@ -67,8 +69,8 @@
 | 
			
		||||
                    timeSystem: 'utc',
 | 
			
		||||
                    clock: 'local',
 | 
			
		||||
                    clockOffsets: {
 | 
			
		||||
                        start: -25 * 60 * 1000,
 | 
			
		||||
                        end: 5 * 60 * 1000
 | 
			
		||||
                        start: - THIRTY_MINUTES,
 | 
			
		||||
                        end: FIVE_MINUTES
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
@@ -76,8 +78,11 @@
 | 
			
		||||
        openmct.install(openmct.plugins.SummaryWidget());
 | 
			
		||||
        openmct.install(openmct.plugins.Notebook());
 | 
			
		||||
        openmct.install(openmct.plugins.FolderView());
 | 
			
		||||
        openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0});
 | 
			
		||||
        openmct.time.timeSystem('utc');
 | 
			
		||||
        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>
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@
 | 
			
		||||
    "eventemitter3": "^1.2.0",
 | 
			
		||||
    "exports-loader": "^0.7.0",
 | 
			
		||||
    "express": "^4.13.1",
 | 
			
		||||
    "fast-sass-loader": "^1.4.5",
 | 
			
		||||
    "fast-sass-loader": "1.4.6",
 | 
			
		||||
    "file-loader": "^1.1.11",
 | 
			
		||||
    "file-saver": "^1.3.8",
 | 
			
		||||
    "git-rev-sync": "^1.4.0",
 | 
			
		||||
@@ -58,7 +58,6 @@
 | 
			
		||||
    "printj": "^1.1.0",
 | 
			
		||||
    "raw-loader": "^0.5.1",
 | 
			
		||||
    "request": "^2.69.0",
 | 
			
		||||
    "screenfull": "^3.3.2",
 | 
			
		||||
    "split": "^1.0.0",
 | 
			
		||||
    "style-loader": "^0.21.0",
 | 
			
		||||
    "v8-compile-cache": "^1.1.0",
 | 
			
		||||
 
 | 
			
		||||
@@ -31,8 +31,6 @@ define([
 | 
			
		||||
    "./src/navigation/NavigateAction",
 | 
			
		||||
    "./src/navigation/OrphanNavigationHandler",
 | 
			
		||||
    "./src/windowing/NewTabAction",
 | 
			
		||||
    "./src/windowing/FullscreenAction",
 | 
			
		||||
    "./src/windowing/WindowTitler",
 | 
			
		||||
    "./res/templates/browse.html",
 | 
			
		||||
    "./res/templates/browse-object.html",
 | 
			
		||||
    "./res/templates/browse/object-header.html",
 | 
			
		||||
@@ -53,8 +51,6 @@ define([
 | 
			
		||||
    NavigateAction,
 | 
			
		||||
    OrphanNavigationHandler,
 | 
			
		||||
    NewTabAction,
 | 
			
		||||
    FullscreenAction,
 | 
			
		||||
    WindowTitler,
 | 
			
		||||
    browseTemplate,
 | 
			
		||||
    browseObjectTemplate,
 | 
			
		||||
    objectHeaderTemplate,
 | 
			
		||||
@@ -225,24 +221,9 @@ define([
 | 
			
		||||
                    "group": "windowing",
 | 
			
		||||
                    "cssClass": "icon-new-window",
 | 
			
		||||
                    "priority": "preferred"
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fullscreen",
 | 
			
		||||
                    "implementation": FullscreenAction,
 | 
			
		||||
                    "category": "view-control",
 | 
			
		||||
                    "group": "windowing",
 | 
			
		||||
                    "priority": "default"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "runs": [
 | 
			
		||||
                {
 | 
			
		||||
                    "implementation": WindowTitler,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "navigationService",
 | 
			
		||||
                        "$rootScope",
 | 
			
		||||
                        "$document"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "implementation": OrphanNavigationHandler,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
@@ -265,18 +246,6 @@ define([
 | 
			
		||||
                    key: "inspectorRegion",
 | 
			
		||||
                    template: inspectorRegionTemplate
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "licenses": [
 | 
			
		||||
                {
 | 
			
		||||
                    "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"
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -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 () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Updates the title of the current window to reflect the name
 | 
			
		||||
         * of the currently navigated-to domain object.
 | 
			
		||||
         * @memberof platform/commonUI/browse
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function WindowTitler(navigationService, $rootScope, $document) {
 | 
			
		||||
            // Look up name of the navigated domain object...
 | 
			
		||||
            function getNavigatedObjectName() {
 | 
			
		||||
                var navigatedObject = navigationService.getNavigation();
 | 
			
		||||
                return navigatedObject && navigatedObject.getModel().name;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Set the window title...
 | 
			
		||||
            function setTitle(name) {
 | 
			
		||||
                $document[0].title = name;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Watch the former, and invoke the latter
 | 
			
		||||
            $rootScope.$watch(getNavigatedObjectName, setTitle);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return WindowTitler;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -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(screenfull.toggle).toHaveBeenCalled();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("provides displayable metadata", function () {
 | 
			
		||||
                expect(action.getMetadata().cssClass).toBeDefined();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,78 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * WindowTitlerSpec. Created by vwoeltje on 11/6/14.
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ["../../src/windowing/WindowTitler"],
 | 
			
		||||
    function (WindowTitler) {
 | 
			
		||||
 | 
			
		||||
        describe("The window titler", function () {
 | 
			
		||||
            var mockNavigationService,
 | 
			
		||||
                mockRootScope,
 | 
			
		||||
                mockDocument,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                titler; // eslint-disable-line
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockNavigationService = jasmine.createSpyObj(
 | 
			
		||||
                    'navigationService',
 | 
			
		||||
                    ['getNavigation']
 | 
			
		||||
                );
 | 
			
		||||
                mockRootScope = jasmine.createSpyObj(
 | 
			
		||||
                    '$rootScope',
 | 
			
		||||
                    ['$watch']
 | 
			
		||||
                );
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj(
 | 
			
		||||
                    'domainObject',
 | 
			
		||||
                    ['getModel']
 | 
			
		||||
                );
 | 
			
		||||
                mockDocument = [{}];
 | 
			
		||||
 | 
			
		||||
                mockDomainObject.getModel.and.returnValue({ name: 'Test name' });
 | 
			
		||||
                mockNavigationService.getNavigation.and.returnValue(mockDomainObject);
 | 
			
		||||
 | 
			
		||||
                titler = new WindowTitler(
 | 
			
		||||
                    mockNavigationService,
 | 
			
		||||
                    mockRootScope,
 | 
			
		||||
                    mockDocument
 | 
			
		||||
                );
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("listens for changes to the name of the navigated object", function () {
 | 
			
		||||
                expect(mockRootScope.$watch).toHaveBeenCalledWith(
 | 
			
		||||
                    jasmine.any(Function),
 | 
			
		||||
                    jasmine.any(Function)
 | 
			
		||||
                );
 | 
			
		||||
                expect(mockRootScope.$watch.calls.mostRecent().args[0]())
 | 
			
		||||
                    .toEqual('Test name');
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("sets the title to the name of the navigated object", function () {
 | 
			
		||||
                mockRootScope.$watch.calls.mostRecent().args[1]("Some name");
 | 
			
		||||
                expect(mockDocument[0].title).toEqual("Some name");
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -28,6 +28,7 @@ define([
 | 
			
		||||
    "./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'
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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,7 +42,6 @@ define([
 | 
			
		||||
    "./src/creation/LocatorController",
 | 
			
		||||
    "./src/creation/CreationPolicy",
 | 
			
		||||
    "./src/creation/CreateActionProvider",
 | 
			
		||||
    "./src/creation/AddActionProvider",
 | 
			
		||||
    "./src/creation/CreationService",
 | 
			
		||||
    "./res/templates/create/locator.html",
 | 
			
		||||
    "./res/templates/create/create-button.html",
 | 
			
		||||
@@ -55,13 +49,11 @@ define([
 | 
			
		||||
    "./res/templates/library.html",
 | 
			
		||||
    "./res/templates/edit-object.html",
 | 
			
		||||
    "./res/templates/edit-action-buttons.html",
 | 
			
		||||
    "./res/templates/elements.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,13 +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": [
 | 
			
		||||
                        "dialogService",
 | 
			
		||||
                        "openmct",
 | 
			
		||||
                        "navigationService"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
@@ -225,10 +203,10 @@ define([
 | 
			
		||||
                    "description": "Save changes made to these objects.",
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$injector",
 | 
			
		||||
                        "policyService",
 | 
			
		||||
                        "dialogService",
 | 
			
		||||
                        "copyService",
 | 
			
		||||
                        "notificationService"
 | 
			
		||||
                        "notificationService",
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "priority": "mandatory"
 | 
			
		||||
                },
 | 
			
		||||
@@ -245,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"
 | 
			
		||||
@@ -296,13 +257,6 @@ define([
 | 
			
		||||
                        "action"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "edit-elements",
 | 
			
		||||
                    "template": elementsTemplate,
 | 
			
		||||
                    "gestures": [
 | 
			
		||||
                        "drop"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "topbar-edit",
 | 
			
		||||
                    "template": topbarEditTemplate
 | 
			
		||||
@@ -319,12 +273,6 @@ define([
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "templates": [
 | 
			
		||||
                {
 | 
			
		||||
                    key: "elementsPool",
 | 
			
		||||
                    template: elementsTemplate
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "components": [
 | 
			
		||||
                {
 | 
			
		||||
                    "type": "decorator",
 | 
			
		||||
@@ -356,18 +304,6 @@ define([
 | 
			
		||||
                        "policyService"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "AddActionProvider",
 | 
			
		||||
                    "provides": "actionService",
 | 
			
		||||
                    "type": "provider",
 | 
			
		||||
                    "implementation": AddActionProvider,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$q",
 | 
			
		||||
                        "typeService",
 | 
			
		||||
                        "dialogService",
 | 
			
		||||
                        "policyService"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "CreationService",
 | 
			
		||||
                    "provides": "creationService",
 | 
			
		||||
@@ -388,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",
 | 
			
		||||
 
 | 
			
		||||
@@ -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,11 +23,7 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Module defining RemoveAction. Created by vwoeltje on 11/17/14.
 | 
			
		||||
 */
 | 
			
		||||
define([
 | 
			
		||||
    './RemoveDialog'
 | 
			
		||||
], function (
 | 
			
		||||
    RemoveDialog
 | 
			
		||||
) {
 | 
			
		||||
define([], function () {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Construct an action which will remove the provided object manifestation.
 | 
			
		||||
@@ -42,9 +38,9 @@ define([
 | 
			
		||||
     * @constructor
 | 
			
		||||
     * @implements {Action}
 | 
			
		||||
     */
 | 
			
		||||
    function RemoveAction(dialogService, navigationService, context) {
 | 
			
		||||
    function RemoveAction(openmct, navigationService, context) {
 | 
			
		||||
        this.domainObject = (context || {}).domainObject;
 | 
			
		||||
        this.dialogService = dialogService;
 | 
			
		||||
        this.openmct = openmct;
 | 
			
		||||
        this.navigationService = navigationService;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -53,7 +49,6 @@ define([
 | 
			
		||||
     */
 | 
			
		||||
    RemoveAction.prototype.perform = function () {
 | 
			
		||||
        var dialog,
 | 
			
		||||
            dialogService = this.dialogService,
 | 
			
		||||
            domainObject = this.domainObject,
 | 
			
		||||
            navigationService = this.navigationService;
 | 
			
		||||
        /*
 | 
			
		||||
@@ -104,23 +99,18 @@ define([
 | 
			
		||||
         * 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'),
 | 
			
		||||
        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);
 | 
			
		||||
            checkObjectNavigation(domainObject, parent);
 | 
			
		||||
 | 
			
		||||
            return parent.useCapability('mutation', doMutate);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
         * Pass in the function to remove the domain object so it can be
 | 
			
		||||
         * associated with an 'OK' button press
 | 
			
		||||
         */
 | 
			
		||||
        dialog = new RemoveDialog(dialogService, domainObject, removeFromContext);
 | 
			
		||||
        dialog.show();
 | 
			
		||||
        removeFromContext();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    // Object needs to have a parent for Remove to be applicable
 | 
			
		||||
 
 | 
			
		||||
@@ -1,77 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define([], function () {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @callback removeCallback
 | 
			
		||||
     * @param {DomainObject} domainObject the domain object to be removed
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Construct a new Remove dialog.
 | 
			
		||||
     *
 | 
			
		||||
     * @param {DialogService} dialogService the service that shows the dialog
 | 
			
		||||
     * @param {DomainObject} domainObject the domain object to be removed
 | 
			
		||||
     * @param {removeCallback} removeCallback callback that handles removal of the domain object
 | 
			
		||||
     * @memberof platform/commonUI/edit
 | 
			
		||||
     * @constructor
 | 
			
		||||
     */
 | 
			
		||||
    function RemoveDialog(dialogService, domainObject, removeCallback) {
 | 
			
		||||
        this.dialogService = dialogService;
 | 
			
		||||
        this.domainObject = domainObject;
 | 
			
		||||
        this.removeCallback = removeCallback;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Display a dialog to confirm the removal of a domain object.
 | 
			
		||||
     */
 | 
			
		||||
    RemoveDialog.prototype.show = function () {
 | 
			
		||||
        var dialog,
 | 
			
		||||
            domainObject = this.domainObject,
 | 
			
		||||
            removeCallback = this.removeCallback,
 | 
			
		||||
            model = {
 | 
			
		||||
                title: 'Remove ' + domainObject.getModel().name,
 | 
			
		||||
                actionText: 'Warning! This action will permanently remove this object. Are you sure you want to continue?',
 | 
			
		||||
                severity: 'alert',
 | 
			
		||||
                primaryOption: {
 | 
			
		||||
                    label: 'OK',
 | 
			
		||||
                    callback: function () {
 | 
			
		||||
                        removeCallback(domainObject);
 | 
			
		||||
                        dialog.dismiss();
 | 
			
		||||
                    }
 | 
			
		||||
                },
 | 
			
		||||
                options: [
 | 
			
		||||
                    {
 | 
			
		||||
                        label: 'Cancel',
 | 
			
		||||
                        callback: function () {
 | 
			
		||||
                            dialog.dismiss();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
        dialog = this.dialogService.showBlockingMessage(model);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return RemoveDialog;
 | 
			
		||||
});
 | 
			
		||||
@@ -40,20 +40,20 @@ function (
 | 
			
		||||
         */
 | 
			
		||||
    function SaveAsAction(
 | 
			
		||||
        $injector,
 | 
			
		||||
        policyService,
 | 
			
		||||
        dialogService,
 | 
			
		||||
        copyService,
 | 
			
		||||
        notificationService,
 | 
			
		||||
        openmct,
 | 
			
		||||
        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;
 | 
			
		||||
        this.openmct = openmct;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -63,7 +63,7 @@ function (
 | 
			
		||||
        return new CreateWizard(
 | 
			
		||||
            this.domainObject,
 | 
			
		||||
            parent,
 | 
			
		||||
            this.policyService
 | 
			
		||||
            this.openmct
 | 
			
		||||
        );
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
@@ -92,16 +92,7 @@ function (
 | 
			
		||||
         * @memberof platform/commonUI/edit.SaveAction#
 | 
			
		||||
         */
 | 
			
		||||
    SaveAsAction.prototype.perform = function () {
 | 
			
		||||
        // Discard the current root view (which will be the editing
 | 
			
		||||
        // UI, which will have been pushed atop the Browse UI.)
 | 
			
		||||
        function returnToBrowse(object) {
 | 
			
		||||
            if (object) {
 | 
			
		||||
                object.getCapability("action").perform("navigate");
 | 
			
		||||
            }
 | 
			
		||||
            return object;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return this.save().then(returnToBrowse);
 | 
			
		||||
        return this.save();
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -169,15 +160,17 @@ function (
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        function saveAfterClone(clonedObject) {
 | 
			
		||||
            return domainObject.getCapability("editor").save()
 | 
			
		||||
                .then(resolveWith(clonedObject));
 | 
			
		||||
            return this.openmct.editor.save().then(() => {
 | 
			
		||||
                // Force mutation for search indexing
 | 
			
		||||
                clonedObject.useCapability('mutation', (model) => {
 | 
			
		||||
                    return model;
 | 
			
		||||
                });
 | 
			
		||||
                return clonedObject;
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        function finishEditing(clonedObject) {
 | 
			
		||||
            return domainObject.getCapability("editor").finish()
 | 
			
		||||
                .then(function () {
 | 
			
		||||
                    return fetchObject(clonedObject.getId());
 | 
			
		||||
                });
 | 
			
		||||
            return fetchObject(clonedObject.getId())
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        function onSuccess(object) {
 | 
			
		||||
@@ -190,7 +183,7 @@ function (
 | 
			
		||||
            if (reason !== "user canceled") {
 | 
			
		||||
                self.notificationService.error("Save Failed");
 | 
			
		||||
            }
 | 
			
		||||
            return false;
 | 
			
		||||
            throw reason;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return getParent(domainObject)
 | 
			
		||||
 
 | 
			
		||||
@@ -51,8 +51,11 @@ define(
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.edit = function () {
 | 
			
		||||
            console.warn('DEPRECATED: cannot edit via edit capability, use openmct.editor instead.');
 | 
			
		||||
            this.openmct.editor.edit();
 | 
			
		||||
            this.domainObject.getCapability('status').set('editing', true);
 | 
			
		||||
 | 
			
		||||
            if (!this.openmct.editor.isEditing()) {
 | 
			
		||||
                this.openmct.editor.edit();
 | 
			
		||||
                this.domainObject.getCapability('status').set('editing', true);
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
@@ -82,6 +85,7 @@ define(
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.save = function () {
 | 
			
		||||
            console.warn('DEPRECATED: cannot save via edit capability, use openmct.editor instead.');
 | 
			
		||||
            return Promise.resolve();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        EditorCapability.prototype.invoke = EditorCapability.prototype.edit;
 | 
			
		||||
@@ -93,6 +97,7 @@ define(
 | 
			
		||||
         */
 | 
			
		||||
        EditorCapability.prototype.finish = function () {
 | 
			
		||||
            console.warn('DEPRECATED: cannot finish via edit capability, use openmct.editor instead.');
 | 
			
		||||
            return Promise.resolve();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
 
 | 
			
		||||
@@ -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,44 @@ 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 isFirstViewEditable(domainObject) {
 | 
			
		||||
                let firstView = openmct.objectViews.get(domainObject)[0];
 | 
			
		||||
 | 
			
		||||
                return firstView && firstView.canEdit && firstView.canEdit(domainObject);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            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;
 | 
			
		||||
 | 
			
		||||
                if (isFirstViewEditable(object.useCapability('adapter'))) {
 | 
			
		||||
                    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.
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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,111 +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 (isEditable(view) ||
 | 
			
		||||
                    (view.key === 'plot' && type.getKey() === 'telemetry.panel') ||
 | 
			
		||||
                    (view.key === 'table' && type.getKey() === 'table') ||
 | 
			
		||||
                    (view.key === 'rt-table' && type.getKey() === 'rttable')
 | 
			
		||||
                ) {
 | 
			
		||||
                    count++;
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            function isEditable(view) {
 | 
			
		||||
                if (typeof view.editable === Function) {
 | 
			
		||||
                    return view.editable(domainObject.useCapability('adapter'));
 | 
			
		||||
                } else {
 | 
			
		||||
                    return view.editable === true;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            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,49 +0,0 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Open MCT, Copyright (c) 2014-2018, United States Government
 | 
			
		||||
 * as represented by the Administrator of the National Aeronautics and Space
 | 
			
		||||
 * Administration. All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT is licensed under the Apache License, Version 2.0 (the
 | 
			
		||||
 * "License"); you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0.
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 | 
			
		||||
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing permissions and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * Open MCT includes source code licensed under additional open source
 | 
			
		||||
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    [],
 | 
			
		||||
    function () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Policy controlling which views should be visible in Edit mode.
 | 
			
		||||
         * @memberof platform/commonUI/edit
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @implements {Policy.<View, DomainObject>}
 | 
			
		||||
         */
 | 
			
		||||
        function EditableViewPolicy() {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        EditableViewPolicy.prototype.allow = function (view, domainObject) {
 | 
			
		||||
            // If a view is flagged as non-editable, only allow it
 | 
			
		||||
            // while we're not in Edit mode.
 | 
			
		||||
            if ((view || {}).editable === false) {
 | 
			
		||||
                return !(domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext());
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Like all policies, allow by default.
 | 
			
		||||
            return true;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return EditableViewPolicy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -29,7 +29,7 @@ define(
 | 
			
		||||
                actionContext,
 | 
			
		||||
                capabilities,
 | 
			
		||||
                mockContext,
 | 
			
		||||
                mockDialogService,
 | 
			
		||||
                mockOverlayAPI,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                mockMutation,
 | 
			
		||||
                mockNavigationService,
 | 
			
		||||
@@ -68,9 +68,9 @@ define(
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                mockDialogService = jasmine.createSpyObj(
 | 
			
		||||
                    "dialogService",
 | 
			
		||||
                    ["showBlockingMessage"]
 | 
			
		||||
                mockOverlayAPI = jasmine.createSpyObj(
 | 
			
		||||
                    "overlayAPI",
 | 
			
		||||
                    ["dialog"]
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                mockNavigationService = jasmine.createSpyObj(
 | 
			
		||||
@@ -96,7 +96,7 @@ define(
 | 
			
		||||
 | 
			
		||||
                actionContext = { domainObject: mockDomainObject };
 | 
			
		||||
 | 
			
		||||
                action = new RemoveAction(mockDialogService, mockNavigationService, actionContext);
 | 
			
		||||
                action = new RemoveAction({overlays: mockOverlayAPI}, mockNavigationService, actionContext);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("only applies to objects with parents", function () {
 | 
			
		||||
@@ -118,7 +118,7 @@ define(
 | 
			
		||||
 | 
			
		||||
                action.perform();
 | 
			
		||||
 | 
			
		||||
                expect(mockDialogService.showBlockingMessage).toHaveBeenCalled();
 | 
			
		||||
                expect(mockOverlayAPI.dialog).toHaveBeenCalled();
 | 
			
		||||
 | 
			
		||||
                // Also check that no mutation happens at this point
 | 
			
		||||
                expect(mockParent.useCapability).not.toHaveBeenCalledWith("mutation", jasmine.any(Function));
 | 
			
		||||
@@ -158,13 +158,13 @@ define(
 | 
			
		||||
                    mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
                    mockRootContext = jasmine.createSpyObj("context", ["getParent"]);
 | 
			
		||||
 | 
			
		||||
                    mockDialogService.showBlockingMessage.and.returnValue(mockDialogHandle);
 | 
			
		||||
                    mockOverlayAPI.dialog.and.returnValue(mockDialogHandle);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("mutates the parent when performed", function () {
 | 
			
		||||
                    action.perform();
 | 
			
		||||
                    mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
 | 
			
		||||
                        .primaryOption.callback();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].callback();
 | 
			
		||||
 | 
			
		||||
                    expect(mockMutation.invoke)
 | 
			
		||||
                        .toHaveBeenCalledWith(jasmine.any(Function));
 | 
			
		||||
@@ -174,8 +174,8 @@ define(
 | 
			
		||||
                    var mutator, result;
 | 
			
		||||
 | 
			
		||||
                    action.perform();
 | 
			
		||||
                    mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
 | 
			
		||||
                        .primaryOption.callback();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].callback();
 | 
			
		||||
 | 
			
		||||
                    mutator = mockMutation.invoke.calls.mostRecent().args[0];
 | 
			
		||||
                    result = mutator(model);
 | 
			
		||||
@@ -212,8 +212,8 @@ define(
 | 
			
		||||
                    mockType.hasFeature.and.returnValue(true);
 | 
			
		||||
 | 
			
		||||
                    action.perform();
 | 
			
		||||
                    mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
 | 
			
		||||
                        .primaryOption.callback();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].callback();
 | 
			
		||||
 | 
			
		||||
                    // Expects navigation to parent of domainObject (removed object)
 | 
			
		||||
                    expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent);
 | 
			
		||||
@@ -242,8 +242,8 @@ define(
 | 
			
		||||
                    mockType.hasFeature.and.returnValue(true);
 | 
			
		||||
 | 
			
		||||
                    action.perform();
 | 
			
		||||
                    mockDialogService.showBlockingMessage.calls.mostRecent().args[0]
 | 
			
		||||
                        .primaryOption.callback();
 | 
			
		||||
                    mockOverlayAPI.dialog.calls.mostRecent().args[0]
 | 
			
		||||
                        .buttons[0].callback();
 | 
			
		||||
 | 
			
		||||
                    // 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
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,138 +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,
 | 
			
		||||
                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 };
 | 
			
		||||
                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);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,79 +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/EditableViewPolicy"],
 | 
			
		||||
    function (EditableViewPolicy) {
 | 
			
		||||
 | 
			
		||||
        describe("The editable view policy", function () {
 | 
			
		||||
            var mockDomainObject,
 | 
			
		||||
                testMode,
 | 
			
		||||
                policy;
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                testMode = true; // Act as if we're in Edit mode by default
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj(
 | 
			
		||||
                    'domainObject',
 | 
			
		||||
                    ['hasCapability', 'getCapability']
 | 
			
		||||
                );
 | 
			
		||||
                mockDomainObject.getCapability.and.returnValue({
 | 
			
		||||
                    inEditContext: function () {
 | 
			
		||||
                        return true;
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
                mockDomainObject.hasCapability.and.callFake(function (c) {
 | 
			
		||||
                    return (c === 'editor') && testMode;
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                policy = new EditableViewPolicy();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("disallows views in edit mode that are flagged as non-editable", function () {
 | 
			
		||||
                expect(policy.allow({ editable: false }, mockDomainObject))
 | 
			
		||||
                    .toBeFalsy();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("allows views in edit mode that are flagged as editable", function () {
 | 
			
		||||
                expect(policy.allow({ editable: true }, mockDomainObject))
 | 
			
		||||
                    .toBeTruthy();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("allows any view outside of edit mode", function () {
 | 
			
		||||
                var testViews = [
 | 
			
		||||
                    { editable: false },
 | 
			
		||||
                    { editable: true },
 | 
			
		||||
                    { someKey: "some value" }
 | 
			
		||||
                ];
 | 
			
		||||
                testMode = false; // Act as if we're not in Edit mode
 | 
			
		||||
 | 
			
		||||
                testViews.forEach(function (testView) {
 | 
			
		||||
                    expect(policy.allow(testView, mockDomainObject)).toBeTruthy();
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("treats views with no defined 'editable' property as editable", function () {
 | 
			
		||||
                expect(policy.allow({ someKey: "some value" }, mockDomainObject))
 | 
			
		||||
                    .toBeTruthy();
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,75 +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/representers/EditToolbar'],
 | 
			
		||||
    function (EditToolbar) {
 | 
			
		||||
 | 
			
		||||
        describe("An Edit mode toolbar", function () {
 | 
			
		||||
            var mockOpenMCT,
 | 
			
		||||
                mockScope,
 | 
			
		||||
                mockObjects,
 | 
			
		||||
                mockDomainObject,
 | 
			
		||||
                testStructure,
 | 
			
		||||
                toolbar;
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockOpenMCT = jasmine.createSpy('openmct', ['objects']);
 | 
			
		||||
                mockObjects = jasmine.createSpyObj('objects', ['observe']);
 | 
			
		||||
                mockObjects.observe.and.returnValue();
 | 
			
		||||
                mockOpenMCT.objects = mockObjects;
 | 
			
		||||
                mockScope = jasmine.createSpyObj("$scope", [
 | 
			
		||||
                    "$watchCollection",
 | 
			
		||||
                    "$on"
 | 
			
		||||
                ]);
 | 
			
		||||
                mockScope.$watchCollection.and.returnValue();
 | 
			
		||||
                mockDomainObject = jasmine.createSpyObj("domainObject", [
 | 
			
		||||
                    'identifier'
 | 
			
		||||
                ]);
 | 
			
		||||
 | 
			
		||||
                testStructure = [
 | 
			
		||||
                    { name: "A", property: "a", domainObject: mockDomainObject },
 | 
			
		||||
                    { name: "B", property: "b", domainObject: mockDomainObject },
 | 
			
		||||
                    { name: "C", property: "c", domainObject: mockDomainObject },
 | 
			
		||||
                    { name: "X", property: "x", domainObject: mockDomainObject },
 | 
			
		||||
                    { name: "Y", property: "y", domainObject: mockDomainObject },
 | 
			
		||||
                    { name: "Z", property: "z", domainObject: mockDomainObject },
 | 
			
		||||
                    { name: "M", method: "m", domainObject: mockDomainObject }
 | 
			
		||||
                ];
 | 
			
		||||
 | 
			
		||||
                toolbar = new EditToolbar(mockScope, mockOpenMCT, testStructure);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("adds click functions when a method is specified", function () {
 | 
			
		||||
                var structure = toolbar.getStructure();
 | 
			
		||||
                expect(structure[6].click).toBeDefined();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("adds key for controls that define a property", function () {
 | 
			
		||||
                var structure = toolbar.getStructure();
 | 
			
		||||
                expect(structure[0].key).toEqual(0);
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -31,7 +31,6 @@ define([
 | 
			
		||||
    "./src/controllers/TreeNodeController",
 | 
			
		||||
    "./src/controllers/ActionGroupController",
 | 
			
		||||
    "./src/controllers/ToggleController",
 | 
			
		||||
    "./src/controllers/ContextMenuController",
 | 
			
		||||
    "./src/controllers/ClickAwayController",
 | 
			
		||||
    "./src/controllers/ViewSwitcherController",
 | 
			
		||||
    "./src/controllers/GetterSetterController",
 | 
			
		||||
@@ -49,8 +48,6 @@ define([
 | 
			
		||||
    "./src/directives/MCTSplitter",
 | 
			
		||||
    "./src/directives/MCTTree",
 | 
			
		||||
    "./src/directives/MCTIndicators",
 | 
			
		||||
    "./src/directives/MCTPreview",
 | 
			
		||||
    "./src/actions/MCTPreviewAction",
 | 
			
		||||
    "./src/filters/ReverseFilter",
 | 
			
		||||
    "./res/templates/bottombar.html",
 | 
			
		||||
    "./res/templates/controls/action-button.html",
 | 
			
		||||
@@ -65,13 +62,11 @@ define([
 | 
			
		||||
    "./res/templates/tree-node.html",
 | 
			
		||||
    "./res/templates/label.html",
 | 
			
		||||
    "./res/templates/controls/action-group.html",
 | 
			
		||||
    "./res/templates/menu/context-menu.html",
 | 
			
		||||
    "./res/templates/controls/switcher.html",
 | 
			
		||||
    "./res/templates/object-inspector.html",
 | 
			
		||||
    "./res/templates/controls/selector.html",
 | 
			
		||||
    "./res/templates/controls/datetime-picker.html",
 | 
			
		||||
    "./res/templates/controls/datetime-field.html",
 | 
			
		||||
    "./res/templates/preview.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    UrlService,
 | 
			
		||||
@@ -84,7 +79,6 @@ define([
 | 
			
		||||
    TreeNodeController,
 | 
			
		||||
    ActionGroupController,
 | 
			
		||||
    ToggleController,
 | 
			
		||||
    ContextMenuController,
 | 
			
		||||
    ClickAwayController,
 | 
			
		||||
    ViewSwitcherController,
 | 
			
		||||
    GetterSetterController,
 | 
			
		||||
@@ -102,8 +96,6 @@ define([
 | 
			
		||||
    MCTSplitter,
 | 
			
		||||
    MCTTree,
 | 
			
		||||
    MCTIndicators,
 | 
			
		||||
    MCTPreview,
 | 
			
		||||
    MCTPreviewAction,
 | 
			
		||||
    ReverseFilter,
 | 
			
		||||
    bottombarTemplate,
 | 
			
		||||
    actionButtonTemplate,
 | 
			
		||||
@@ -118,13 +110,11 @@ define([
 | 
			
		||||
    treeNodeTemplate,
 | 
			
		||||
    labelTemplate,
 | 
			
		||||
    actionGroupTemplate,
 | 
			
		||||
    contextMenuTemplate,
 | 
			
		||||
    switcherTemplate,
 | 
			
		||||
    objectInspectorTemplate,
 | 
			
		||||
    selectorTemplate,
 | 
			
		||||
    datetimePickerTemplate,
 | 
			
		||||
    datetimeFieldTemplate,
 | 
			
		||||
    previewTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
@@ -252,13 +242,6 @@ define([
 | 
			
		||||
                    "key": "ToggleController",
 | 
			
		||||
                    "implementation": ToggleController
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "ContextMenuController",
 | 
			
		||||
                    "implementation": ContextMenuController,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$scope"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "ClickAwayController",
 | 
			
		||||
                    "implementation": ClickAwayController,
 | 
			
		||||
@@ -394,31 +377,6 @@ define([
 | 
			
		||||
                    "key": "mctIndicators",
 | 
			
		||||
                    "implementation": MCTIndicators,
 | 
			
		||||
                    "depends": ['openmct']
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "mctPreview",
 | 
			
		||||
                    "implementation": MCTPreview,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$document"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "actions": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "mct-preview-action",
 | 
			
		||||
                    "implementation": MCTPreviewAction,
 | 
			
		||||
                    "name": "Preview",
 | 
			
		||||
                    "cssClass": "hide-in-t-main-view icon-eye-open",
 | 
			
		||||
                    "description": "Preview in large dialog",
 | 
			
		||||
                    "category": [
 | 
			
		||||
                        "contextual",
 | 
			
		||||
                        "view-control"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$compile",
 | 
			
		||||
                        "$rootScope"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "priority": "preferred"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "constants": [
 | 
			
		||||
@@ -517,13 +475,6 @@ define([
 | 
			
		||||
                        "action"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "context-menu",
 | 
			
		||||
                    "template": contextMenuTemplate,
 | 
			
		||||
                    "uses": [
 | 
			
		||||
                        "action"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "switcher",
 | 
			
		||||
                    "template": switcherTemplate,
 | 
			
		||||
@@ -534,10 +485,6 @@ define([
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "object-inspector",
 | 
			
		||||
                    "template": objectInspectorTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "mct-preview",
 | 
			
		||||
                    "template": previewTemplate
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "controls": [
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div class="t-object-label l-flex-row flex-elem grows">
 | 
			
		||||
    <div class="t-item-icon flex-elem {{type.getCssClass()}}" ng-class="{ 'l-icon-link':location.isLink() }"></div>
 | 
			
		||||
    <div class='t-title-label flex-elem grows'>{{model.name}}</div>
 | 
			
		||||
<div class="c-object-label">
 | 
			
		||||
    <div class="c-object-label__type-icon {{type.getCssClass()}}" ng-class="{ 'l-icon-link':location.isLink() }"></div>
 | 
			
		||||
    <div class='c-object-label__name'>{{model.name}}</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,33 +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 class="menu-element context-menu-wrapper mobile-disable-select" ng-controller="ContextMenuController">
 | 
			
		||||
    <div class="menu context-menu">
 | 
			
		||||
        <ul>
 | 
			
		||||
            <li ng-repeat="menuAction in menuActions"
 | 
			
		||||
                ng-click="menuAction.perform()"
 | 
			
		||||
                title="{{menuAction.getMetadata().description}}"
 | 
			
		||||
                class="{{menuAction.getMetadata().cssClass}}">
 | 
			
		||||
                {{menuAction.getMetadata().name}}
 | 
			
		||||
            </li>
 | 
			
		||||
        </ul>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
<div ng-controller="BannerController" ng-show="active.notification"
 | 
			
		||||
     class="l-message-banner s-message-banner {{active.notification.model.severity}}" ng-class="{
 | 
			
		||||
     class="c-message-banner {{active.notification.model.severity}}" ng-class="{
 | 
			
		||||
     'minimized': active.notification.model.minimized,
 | 
			
		||||
     'new': !active.notification.model.minimized}"
 | 
			
		||||
     ng-click="maximize(active.notification)">
 | 
			
		||||
    <span class="banner-elem label">
 | 
			
		||||
    <span class="c-message-banner__message">
 | 
			
		||||
        {{active.notification.model.title}}
 | 
			
		||||
    </span>
 | 
			
		||||
    <span ng-show="active.notification.model.progress !== undefined || active.notification.model.unknownProgress">
 | 
			
		||||
        <mct-include key="'progress-bar'" class="banner-elem"
 | 
			
		||||
        <mct-include key="'progress-bar'" class="c-message-banner__progress-bar"
 | 
			
		||||
                     ng-model="active.notification.model">
 | 
			
		||||
        </mct-include>
 | 
			
		||||
    </span>
 | 
			
		||||
@@ -16,5 +16,5 @@
 | 
			
		||||
       ng-click="action(active.notification.model.primaryOption.callback, $event)">
 | 
			
		||||
        {{active.notification.model.primaryOption.label}}
 | 
			
		||||
    </a>
 | 
			
		||||
    <a class="banner-elem close icon-x" ng-click="dismiss(active.notification, $event)"></a>
 | 
			
		||||
    <button class="c-message-banner__close-button c-click-icon icon-x-in-circle" ng-click="dismiss(active.notification, $event)"></button>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,45 +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.
 | 
			
		||||
-->
 | 
			
		||||
<div class="t-frame-inner abs t-object-type-{{ domainObject.getModel().type }}" mct-preview>
 | 
			
		||||
    <div class="abs object-browse-bar l-flex-row">
 | 
			
		||||
        <div class="left flex-elem l-flex-row grows">
 | 
			
		||||
            <mct-representation
 | 
			
		||||
                    key="'object-header-frame'"
 | 
			
		||||
                    mct-object="domainObject"
 | 
			
		||||
                    class="l-flex-row flex-elem object-header grows">
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="btn-bar right l-flex-row flex-elem flex-justify-end flex-fixed">
 | 
			
		||||
            <mct-representation
 | 
			
		||||
                    key="'switcher'"
 | 
			
		||||
                    ng-model="representation"
 | 
			
		||||
                    mct-object="domainObject">
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="abs object-holder">
 | 
			
		||||
        <mct-representation
 | 
			
		||||
                key="representation.selected.key"
 | 
			
		||||
                mct-object="representation.selected.key && domainObject">
 | 
			
		||||
        </mct-representation>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
<span class="l-progress-bar s-progress-bar"
 | 
			
		||||
      ng-class="{ indeterminate:ngModel.unknownProgress }">
 | 
			
		||||
      ng-class="{ indeterminate:ngModel.progressPerc === 'unknown' }">
 | 
			
		||||
    <span class="progress-amt-holder">
 | 
			
		||||
        <span class="progress-amt" style="width: {{ngModel.progress}}%"></span>
 | 
			
		||||
        <span class="progress-amt" style="width: {{ngModel.progressPerc === 'unknown' ? 100 : ngModel.progressPerc}}%"></span>
 | 
			
		||||
    </span>
 | 
			
		||||
</span>
 | 
			
		||||
<div class="progress-info hint" ng-hide="ngModel.progressText === undefined">
 | 
			
		||||
    <span class="progress-amt-text" ng-show="ngModel.progress > 0">{{ngModel.progress}}% complete. </span>
 | 
			
		||||
    <span class="progress-amt-text" ng-show="ngModel.progressPerc !== 'unknown' && ngModel.progressPerc > 0">{{ngModel.progressPerc}}% complete. </span>
 | 
			
		||||
    {{ngModel.progressText}}
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -20,14 +20,11 @@
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<span ng-controller="ToggleController as toggle">
 | 
			
		||||
    <span ng-controller="TreeNodeController as treeNode">
 | 
			
		||||
        <span
 | 
			
		||||
            class="tree-item menus-to-left"
 | 
			
		||||
            ng-class="{selected: treeNode.isSelected()}"
 | 
			
		||||
            >
 | 
			
		||||
            <span
 | 
			
		||||
                class='ui-symbol view-control flex-elem'
 | 
			
		||||
                ng-class="{ 'has-children': model.composition !== undefined, expanded: toggle.isActive() }"
 | 
			
		||||
    <div class="u-contents" ng-controller="TreeNodeController as treeNode">
 | 
			
		||||
        <div class="c-tree__item menus-to-left"
 | 
			
		||||
            ng-class="{selected: treeNode.isSelected()}">
 | 
			
		||||
            <span class='c-disclosure-triangle c-tree__item__view-control'
 | 
			
		||||
                ng-class="{ 'is-enabled': model.composition !== undefined, 'c-disclosure-triangle--expanded': toggle.isActive() }"
 | 
			
		||||
                ng-click="toggle.toggle(); treeNode.trackExpansion()"
 | 
			
		||||
                >
 | 
			
		||||
            </span>
 | 
			
		||||
@@ -39,19 +36,15 @@
 | 
			
		||||
                ng-click="treeNode.select()"
 | 
			
		||||
                >
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
        </span>
 | 
			
		||||
        <span
 | 
			
		||||
            class="tree-item-subtree"
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="u-contents"
 | 
			
		||||
            ng-show="toggle.isActive()"
 | 
			
		||||
            ng-if="model.composition !== undefined"
 | 
			
		||||
            >
 | 
			
		||||
 | 
			
		||||
            ng-if="model.composition !== undefined">
 | 
			
		||||
            <mct-representation key="'subtree'"
 | 
			
		||||
                                ng-model="ngModel"
 | 
			
		||||
                                parameters="parameters"
 | 
			
		||||
                                mct-object="treeNode.hasBeenExpanded() && domainObject">
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
 | 
			
		||||
        </span>
 | 
			
		||||
    </span>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</span>
 | 
			
		||||
 
 | 
			
		||||
@@ -19,8 +19,8 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<ul class="tree">
 | 
			
		||||
    <li>
 | 
			
		||||
<ul class="c-tree">
 | 
			
		||||
    <li class="c-tree__item-h">
 | 
			
		||||
        <mct-representation key="'tree-node'"
 | 
			
		||||
                            mct-object="domainObject"
 | 
			
		||||
                            ng-model="ngModel"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,2 @@
 | 
			
		||||
<span class="tree-item menus-to-left">
 | 
			
		||||
</span>
 | 
			
		||||
<span class="tree-item-subtree">
 | 
			
		||||
</span>
 | 
			
		||||
<span class="c-tree__item js-tree__item"></span>
 | 
			
		||||
<span class="c-tree__item-subtree"></span>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,2 +1 @@
 | 
			
		||||
<span class='ui-symbol view-control flex-elem'>
 | 
			
		||||
</span>
 | 
			
		||||
<span class='c-disclosure-triangle c-tree__item__view-control'></span>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,4 @@
 | 
			
		||||
<span class="rep-object-label">
 | 
			
		||||
    <div class="t-object-label l-flex-row flex-elem grows">
 | 
			
		||||
        <div class="t-item-icon flex-elem"></div>
 | 
			
		||||
        <div class='t-title-label flex-elem grows'></div>
 | 
			
		||||
    </div>
 | 
			
		||||
</span>
 | 
			
		||||
<div class="rep-object-label c-object-label c-tree__item__label">
 | 
			
		||||
    <div class="c-object-label__type-icon c-tree__item__type-icon t-item-icon"></div>
 | 
			
		||||
    <div class="c-object-label__name c-tree__item__name t-title-label"></div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,55 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(
 | 
			
		||||
    [],
 | 
			
		||||
    function () {
 | 
			
		||||
 | 
			
		||||
        var PREVIEW_TEMPLATE = '<mct-representation key="\'mct-preview\'"' +
 | 
			
		||||
                                    'class="t-rep-frame holder"' +
 | 
			
		||||
                                    'mct-object="domainObject">' +
 | 
			
		||||
                                '</mct-representation>';
 | 
			
		||||
 | 
			
		||||
        function MCTPreviewAction($compile, $rootScope, context) {
 | 
			
		||||
            context = context || {};
 | 
			
		||||
            this.domainObject = context.selectedObject || context.domainObject;
 | 
			
		||||
            this.$rootScope = $rootScope;
 | 
			
		||||
            this.$compile = $compile;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        MCTPreviewAction.prototype.perform = function () {
 | 
			
		||||
            var newScope = this.$rootScope.$new();
 | 
			
		||||
            newScope.domainObject = this.domainObject;
 | 
			
		||||
 | 
			
		||||
            this.$compile(PREVIEW_TEMPLATE)(newScope);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        MCTPreviewAction.appliesTo = function (context) {
 | 
			
		||||
            var domainObject = (context || {}).domainObject,
 | 
			
		||||
                status = domainObject.getCapability('status');
 | 
			
		||||
 | 
			
		||||
            return !(status && status.get('editing'));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return MCTPreviewAction;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -50,7 +50,7 @@ define(
 | 
			
		||||
            };
 | 
			
		||||
            $scope.dismiss = function (notification, $event) {
 | 
			
		||||
                $event.stopPropagation();
 | 
			
		||||
                notification.dismissOrMinimize();
 | 
			
		||||
                notification.dismiss();
 | 
			
		||||
            };
 | 
			
		||||
            $scope.maximize = function (notification) {
 | 
			
		||||
                if (notification.model.severity !== "info") {
 | 
			
		||||
@@ -60,7 +60,7 @@ define(
 | 
			
		||||
                    };
 | 
			
		||||
                    //If the notification is dismissed by the user, close
 | 
			
		||||
                    // the dialog.
 | 
			
		||||
                    notification.onDismiss(function () {
 | 
			
		||||
                    notification.on('dismiss', function () {
 | 
			
		||||
                        dialog.dismiss();
 | 
			
		||||
                    });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,64 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define(['zepto', '../services/Overlay'], function ($, Overlay) {
 | 
			
		||||
    function MCTPreview($document) {
 | 
			
		||||
 | 
			
		||||
        function link($scope, $element) {
 | 
			
		||||
            var actions = $scope.domainObject.getCapability('action'),
 | 
			
		||||
                notebookAction = actions.getActions({key: 'notebook-new-entry'})[0];
 | 
			
		||||
 | 
			
		||||
            var notebookButton = notebookAction ?
 | 
			
		||||
                [
 | 
			
		||||
                    {
 | 
			
		||||
                        class: 'icon-notebook new-notebook-entry',
 | 
			
		||||
                        title: 'New Notebook Entry',
 | 
			
		||||
                        clickHandler: function (event) {
 | 
			
		||||
                            event.stopPropagation();
 | 
			
		||||
                            notebookAction.perform();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                ] : [];
 | 
			
		||||
 | 
			
		||||
            var overlayService = new Overlay({
 | 
			
		||||
                $document: $document,
 | 
			
		||||
                $element: $element[0],
 | 
			
		||||
                $scope: $scope,
 | 
			
		||||
                browseBarButtons: notebookButton
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            overlayService.toggleOverlay();
 | 
			
		||||
 | 
			
		||||
            $scope.$on('$destroy', function () {
 | 
			
		||||
                $element.remove();
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
            restrict: 'A',
 | 
			
		||||
            link: link
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return MCTPreview;
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
@@ -82,7 +82,7 @@ define(
 | 
			
		||||
            }
 | 
			
		||||
            var searchPath = "?" + arr.join('&'),
 | 
			
		||||
                newTabPath =
 | 
			
		||||
                    "index.html#" + this.urlForLocation(mode, domainObject) +
 | 
			
		||||
                    "#" + this.urlForLocation(mode, domainObject) +
 | 
			
		||||
                            searchPath;
 | 
			
		||||
            return newTabPath;
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
@@ -37,9 +37,9 @@ define([
 | 
			
		||||
        this.expanded = state;
 | 
			
		||||
 | 
			
		||||
        if (state) {
 | 
			
		||||
            this.el.addClass('expanded');
 | 
			
		||||
            this.el.addClass('c-disclosure-triangle--expanded');
 | 
			
		||||
        } else {
 | 
			
		||||
            this.el.removeClass('expanded');
 | 
			
		||||
            this.el.removeClass('c-disclosure-triangle--expanded');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.callbacks.forEach(function (callback) {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ define([
 | 
			
		||||
], function ($, nodeTemplate, ToggleView, TreeLabelView) {
 | 
			
		||||
 | 
			
		||||
    function TreeNodeView(gestureService, subtreeFactory, selectFn, openmct) {
 | 
			
		||||
        this.li = $('<li>');
 | 
			
		||||
        this.li = $('<li class="c-tree__item-h">');
 | 
			
		||||
        this.openmct = openmct;
 | 
			
		||||
        this.statusClasses = [];
 | 
			
		||||
 | 
			
		||||
@@ -38,7 +38,7 @@ define([
 | 
			
		||||
                if (!this.subtreeView) {
 | 
			
		||||
                    this.subtreeView = subtreeFactory();
 | 
			
		||||
                    this.subtreeView.model(this.activeObject);
 | 
			
		||||
                    this.li.find('.tree-item-subtree').eq(0)
 | 
			
		||||
                    this.li.find('.c-tree__item-subtree').eq(0)
 | 
			
		||||
                        .append($(this.subtreeView.elements()));
 | 
			
		||||
                }
 | 
			
		||||
                $(this.subtreeView.elements()).removeClass('hidden');
 | 
			
		||||
@@ -85,9 +85,9 @@ define([
 | 
			
		||||
            var obj = domainObject.useCapability('adapter');
 | 
			
		||||
            var hasComposition =  this.openmct.composition.get(obj) !== undefined;
 | 
			
		||||
            if (hasComposition) {
 | 
			
		||||
                $(this.toggleView.elements()).removeClass('no-children');
 | 
			
		||||
                $(this.toggleView.elements()).addClass('is-enabled');
 | 
			
		||||
            } else {
 | 
			
		||||
                $(this.toggleView.elements()).addClass('no-children');
 | 
			
		||||
                $(this.toggleView.elements()).removeClass('is-enabled');
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -120,7 +120,7 @@ define([
 | 
			
		||||
            selectedIdPath = getIdPath(domainObject);
 | 
			
		||||
 | 
			
		||||
        if (this.onSelectionPath) {
 | 
			
		||||
            this.li.find('.tree-item').eq(0).removeClass('selected');
 | 
			
		||||
            this.li.find('.js-tree__item').eq(0).removeClass('is-selected');
 | 
			
		||||
            if (this.subtreeView) {
 | 
			
		||||
                this.subtreeView.value(undefined);
 | 
			
		||||
            }
 | 
			
		||||
@@ -136,7 +136,7 @@ define([
 | 
			
		||||
 | 
			
		||||
        if (this.onSelectionPath) {
 | 
			
		||||
            if (activeIdPath.length === selectedIdPath.length) {
 | 
			
		||||
                this.li.find('.tree-item').eq(0).addClass('selected');
 | 
			
		||||
                this.li.find('.js-tree__item').eq(0).addClass('is-selected');
 | 
			
		||||
            } else {
 | 
			
		||||
                // Expand to reveal the selection
 | 
			
		||||
                this.toggleView.value(true);
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ define([
 | 
			
		||||
], function ($, TreeNodeView, spinnerTemplate) {
 | 
			
		||||
 | 
			
		||||
    function TreeView(gestureService, openmct, selectFn) {
 | 
			
		||||
        this.ul = $('<ul class="tree"></ul>');
 | 
			
		||||
        this.ul = $('<ul class="c-tree"></ul>');
 | 
			
		||||
        this.nodeViews = [];
 | 
			
		||||
        this.callbacks = [];
 | 
			
		||||
        this.selectFn = selectFn || this.value.bind(this);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,60 +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/controllers/ContextMenuController"],
 | 
			
		||||
    function (ContextMenuController) {
 | 
			
		||||
 | 
			
		||||
        describe("The context menu controller", function () {
 | 
			
		||||
            var mockScope,
 | 
			
		||||
                mockActions,
 | 
			
		||||
                controller;
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockActions = jasmine.createSpyObj("action", ["getActions"]);
 | 
			
		||||
                mockScope = jasmine.createSpyObj("$scope", ["$watch"]);
 | 
			
		||||
                controller = new ContextMenuController(mockScope);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("watches scope that may change applicable actions", function () {
 | 
			
		||||
                // The action capability
 | 
			
		||||
                expect(mockScope.$watch).toHaveBeenCalledWith(
 | 
			
		||||
                    "action",
 | 
			
		||||
                    jasmine.any(Function)
 | 
			
		||||
                );
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("populates the scope with grouped and ungrouped actions", function () {
 | 
			
		||||
                mockScope.action = mockActions;
 | 
			
		||||
                mockScope.parameters = { category: "test" };
 | 
			
		||||
 | 
			
		||||
                mockActions.getActions.and.returnValue(["a", "b", "c"]);
 | 
			
		||||
 | 
			
		||||
                // Call the watch
 | 
			
		||||
                mockScope.$watch.calls.mostRecent().args[1]();
 | 
			
		||||
 | 
			
		||||
                // Should have grouped and ungrouped actions in scope now
 | 
			
		||||
                expect(mockScope.menuActions.length).toEqual(3);
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -36,20 +36,6 @@ define([
 | 
			
		||||
 | 
			
		||||
    legacyRegistry.register("platform/commonUI/notification", {
 | 
			
		||||
        "extensions": {
 | 
			
		||||
            "constants": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "DEFAULT_AUTO_DISMISS",
 | 
			
		||||
                    "value": 3000
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "FORCE_AUTO_DISMISS",
 | 
			
		||||
                    "value": 1000
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "MINIMIZE_TIMEOUT",
 | 
			
		||||
                    "value": 300
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "templates": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "notificationIndicatorTemplate",
 | 
			
		||||
@@ -62,7 +48,7 @@ define([
 | 
			
		||||
                    "implementation": NotificationIndicatorController,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$scope",
 | 
			
		||||
                        "notificationService",
 | 
			
		||||
                        "openmct",
 | 
			
		||||
                        "dialogService"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
@@ -76,12 +62,11 @@ define([
 | 
			
		||||
            "services": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "notificationService",
 | 
			
		||||
                    "implementation": NotificationService,
 | 
			
		||||
                    "implementation": function (openmct) {
 | 
			
		||||
                        return new NotificationService.default(openmct);
 | 
			
		||||
                    },
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$timeout",
 | 
			
		||||
                        "topic",
 | 
			
		||||
                        "DEFAULT_AUTO_DISMISS",
 | 
			
		||||
                        "MINIMIZE_TIMEOUT"
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
 
 | 
			
		||||
@@ -35,20 +35,33 @@ define(
 | 
			
		||||
         * @param dialogService
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function NotificationIndicatorController($scope, notificationService, dialogService) {
 | 
			
		||||
            $scope.notifications = notificationService.notifications;
 | 
			
		||||
            $scope.highest = notificationService.highest;
 | 
			
		||||
        function NotificationIndicatorController($scope, openmct, dialogService) {
 | 
			
		||||
            $scope.notifications = openmct.notifications.notifications;
 | 
			
		||||
            $scope.highest = openmct.notifications.highest;
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Launch a dialog showing a list of current notifications.
 | 
			
		||||
             */
 | 
			
		||||
            $scope.showNotificationsList = function () {
 | 
			
		||||
                let notificationsList = openmct.notifications.notifications.map(notification => {
 | 
			
		||||
                    if (notification.model.severity === 'alert' || notification.model.severity === 'info') {
 | 
			
		||||
                        notification.model.primaryOption = {
 | 
			
		||||
                            label: 'Dismiss',
 | 
			
		||||
                            callback: () => {
 | 
			
		||||
                                let currentIndex = notificationsList.indexOf(notification);
 | 
			
		||||
                                notification.dismiss();
 | 
			
		||||
                                notificationsList.splice(currentIndex, 1);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    return notification;
 | 
			
		||||
                })
 | 
			
		||||
                dialogService.getDialogResponse('overlay-message-list', {
 | 
			
		||||
                    dialog: {
 | 
			
		||||
                        title: "Messages",
 | 
			
		||||
                        //Launch the message list dialog with the models
 | 
			
		||||
                        // from the notifications
 | 
			
		||||
                        messages: notificationService.notifications
 | 
			
		||||
                        messages: notificationsList
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,419 +19,46 @@
 | 
			
		||||
 * this source code distribution or the Licensing information page available
 | 
			
		||||
 * at runtime from the About dialog for additional information.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This bundle implements the notification service, which can be used to
 | 
			
		||||
 * show banner notifications to the user. Banner notifications
 | 
			
		||||
 * are used to inform users of events in a non-intrusive way. As
 | 
			
		||||
 * much as possible, notifications share a model with blocking
 | 
			
		||||
 * dialogs so that the same information can be provided in a dialog
 | 
			
		||||
 * and then minimized to a banner notification if needed.
 | 
			
		||||
 *
 | 
			
		||||
 * @namespace platform/commonUI/notification
 | 
			
		||||
 */
 | 
			
		||||
define(
 | 
			
		||||
    ['moment'],
 | 
			
		||||
    function (moment) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A representation of a user action. Options are provided to
 | 
			
		||||
         * dialogs and notifications and are shown as buttons.
 | 
			
		||||
         *
 | 
			
		||||
         * @typedef {object} NotificationOption
 | 
			
		||||
         * @property {string} label the label to appear on the button for
 | 
			
		||||
         * this action
 | 
			
		||||
         * @property {function} callback a callback function to be invoked
 | 
			
		||||
         * when the button is clicked
 | 
			
		||||
        */
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A representation of a banner notification. Banner notifications
 | 
			
		||||
         * are used to inform users of events in a non-intrusive way. As
 | 
			
		||||
         * much as possible, notifications share a model with blocking
 | 
			
		||||
         * dialogs so that the same information can be provided in a dialog
 | 
			
		||||
         * and then minimized to a banner notification if needed, or vice-versa.
 | 
			
		||||
         *
 | 
			
		||||
         * @typedef {object} NotificationModel
 | 
			
		||||
         * @property {string} title The title of the message
 | 
			
		||||
         * @property {string} severity The importance of the message (one of
 | 
			
		||||
         * 'info', 'alert', or 'error' where info < alert <error)
 | 
			
		||||
         * @property {number} [progress] The completion status of a task
 | 
			
		||||
         * represented numerically
 | 
			
		||||
         * @property {boolean} [unknownProgress] a boolean indicating that the
 | 
			
		||||
         * progress of the underlying task is unknown. This will result in a
 | 
			
		||||
         * visually distinct progress bar.
 | 
			
		||||
         * @property {boolean} [autoDismiss] If truthy, dialog will
 | 
			
		||||
         * be automatically minimized or dismissed (depending on severity).
 | 
			
		||||
         * Additionally, if the provided value is a number, it will be used
 | 
			
		||||
         * as the delay period before being dismissed.
 | 
			
		||||
         * @property {boolean} [dismissable=true] If true, notification will
 | 
			
		||||
         * include an option to dismiss it completely.
 | 
			
		||||
         * @property {NotificationOption} [primaryOption] the default user
 | 
			
		||||
         * response to
 | 
			
		||||
         * this message. Will be represented as a button with the provided
 | 
			
		||||
         * label and action. May be used by banner notifications to display
 | 
			
		||||
         * only the most important option to users.
 | 
			
		||||
         * @property {NotificationOption[]} [options] any additional
 | 
			
		||||
         * actions the user can take. Will be represented as additional buttons
 | 
			
		||||
         * that may or may not be available from a banner.
 | 
			
		||||
         * @see DialogModel
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A wrapper object that is returned as a handle to a newly created
 | 
			
		||||
         * notification. Wraps the notifications model and decorates with
 | 
			
		||||
         * functions to dismiss or minimize the notification.
 | 
			
		||||
         *
 | 
			
		||||
         * @typedef {object} Notification
 | 
			
		||||
         * @property {function} dismiss This method is added to the object
 | 
			
		||||
         * returned by {@link NotificationService#notify} and can be used to
 | 
			
		||||
         * dismiss this notification. Dismissing a notification will remove
 | 
			
		||||
         * it completely and it will not appear in the notification indicator
 | 
			
		||||
         * @property {function} minimize This method is added to the object
 | 
			
		||||
         * returned by {@link NotificationService#notify} and can be used to
 | 
			
		||||
         * minimize this notification. Minimizing a notification will send
 | 
			
		||||
         * it to the notification indicator
 | 
			
		||||
         * @property {function} dismissOrMinimize This method is added to the
 | 
			
		||||
         * object returned by {@link NotificationService#notify}. It will
 | 
			
		||||
         * hide the notification by either dismissing or minimizing it,
 | 
			
		||||
         * depending on severity. Typically this is the method that should
 | 
			
		||||
         * be used for dismissing a notification. If more control is
 | 
			
		||||
         * required, then the minimize or dismiss functions can be called
 | 
			
		||||
         * individually.
 | 
			
		||||
         * @property {function} onDismiss Allows listening for on dismiss
 | 
			
		||||
         * events. This allows cleanup etc. when the notification is dismissed.
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The notification service is responsible for informing the user of
 | 
			
		||||
         * events via the use of banner notifications.
 | 
			
		||||
         * @memberof platform/commonUI/notification
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param $timeout the Angular $timeout service
 | 
			
		||||
         * @param defaultAutoDismissTimeout The period of time that an
 | 
			
		||||
         * auto-dismissed message will be displayed for.
 | 
			
		||||
         * @param minimizeAnimationTimeout When notifications are minimized, a brief
 | 
			
		||||
         * animation is shown. This animation requires some time to execute,
 | 
			
		||||
         * so a timeout is required before the notification is hidden
 | 
			
		||||
         */
 | 
			
		||||
        function NotificationService($timeout, topic, defaultAutoDismissTimeout, minimizeAnimationTimeout) {
 | 
			
		||||
            this.notifications = [];
 | 
			
		||||
            this.$timeout = $timeout;
 | 
			
		||||
            this.highest = { severity: "info" };
 | 
			
		||||
            this.AUTO_DISMISS_TIMEOUT = defaultAutoDismissTimeout;
 | 
			
		||||
            this.MINIMIZE_ANIMATION_TIMEOUT = minimizeAnimationTimeout;
 | 
			
		||||
            this.topic = topic;
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * A context in which to hold the active notification and a
 | 
			
		||||
             * handle to its timeout.
 | 
			
		||||
             */
 | 
			
		||||
            this.active = {};
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Minimize a notification. The notification will still be available
 | 
			
		||||
         * from the notification list. Typically notifications with a
 | 
			
		||||
         * severity of 'info' should not be minimized, but rather
 | 
			
		||||
         * dismissed. If you're not sure which is appropriate,
 | 
			
		||||
         * use {@link Notification#dismissOrMinimize}
 | 
			
		||||
         *
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.minimize = function (service, notification) {
 | 
			
		||||
            //Check this is a known notification
 | 
			
		||||
            var index = service.notifications.indexOf(notification);
 | 
			
		||||
 | 
			
		||||
            if (service.active.timeout) {
 | 
			
		||||
                /*
 | 
			
		||||
                 Method can be called manually (clicking dismiss) or
 | 
			
		||||
                 automatically from an auto-timeout. this.active.timeout
 | 
			
		||||
                 acts as a semaphore to prevent race conditions. Cancel any
 | 
			
		||||
                 timeout in progress (for the case where a manual dismiss
 | 
			
		||||
                 has shortcut an active auto-dismiss), and clear the
 | 
			
		||||
                 semaphore.
 | 
			
		||||
                 */
 | 
			
		||||
                service.$timeout.cancel(service.active.timeout);
 | 
			
		||||
                delete service.active.timeout;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (index >= 0) {
 | 
			
		||||
                notification.model.minimized = true;
 | 
			
		||||
                //Add a brief timeout before showing the next notification
 | 
			
		||||
                // in order to allow the minimize animation to run through.
 | 
			
		||||
                service.$timeout(function () {
 | 
			
		||||
                    service.setActiveNotification(service.selectNextNotification());
 | 
			
		||||
                }, service.MINIMIZE_ANIMATION_TIMEOUT);
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Completely removes a notification. This will dismiss it from the
 | 
			
		||||
         * message banner and remove it from the list of notifications.
 | 
			
		||||
         * Typically only notifications with a severity of info should be
 | 
			
		||||
         * dismissed. If you're not sure whether to dismiss or minimize a
 | 
			
		||||
         * notification, use {@link Notification#dismissOrMinimize}.
 | 
			
		||||
         * dismiss
 | 
			
		||||
         *
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.dismiss = function (service, notification) {
 | 
			
		||||
            //Check this is a known notification
 | 
			
		||||
            var index = service.notifications.indexOf(notification);
 | 
			
		||||
 | 
			
		||||
            if (service.active.timeout) {
 | 
			
		||||
                /* Method can be called manually (clicking dismiss) or
 | 
			
		||||
                 * automatically from an auto-timeout. this.active.timeout
 | 
			
		||||
                 * acts as a semaphore to prevent race conditions. Cancel any
 | 
			
		||||
                 * timeout in progress (for the case where a manual dismiss
 | 
			
		||||
                 * has shortcut an active auto-dismiss), and clear the
 | 
			
		||||
                 * semaphore.
 | 
			
		||||
                 */
 | 
			
		||||
 | 
			
		||||
                service.$timeout.cancel(service.active.timeout);
 | 
			
		||||
                delete service.active.timeout;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (index >= 0) {
 | 
			
		||||
                service.notifications.splice(index, 1);
 | 
			
		||||
            }
 | 
			
		||||
            service.setActiveNotification(service.selectNextNotification());
 | 
			
		||||
 | 
			
		||||
            this.setHighestSeverity();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Depending on the severity of the notification will selectively
 | 
			
		||||
         * dismiss or minimize where appropriate.
 | 
			
		||||
         *
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.dismissOrMinimize = function (notification) {
 | 
			
		||||
            var model = notification.model;
 | 
			
		||||
            if (model.severity === "info") {
 | 
			
		||||
                if (model.autoDismiss === false) {
 | 
			
		||||
                    notification.minimize();
 | 
			
		||||
                } else {
 | 
			
		||||
                    notification.dismiss();
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                notification.minimize();
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Returns the notification that is currently visible in the banner area
 | 
			
		||||
         * @returns {Notification}
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.getActiveNotification = function () {
 | 
			
		||||
            return this.active.notification;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A convenience method for info notifications. Notifications
 | 
			
		||||
         * created via this method will be auto-dismissed after a default
 | 
			
		||||
         * wait period unless explicitly forbidden by the caller through
 | 
			
		||||
         * the {autoDismiss} property on the {NotificationModel}, in which
 | 
			
		||||
         * case the notification will be minimized after the wait.
 | 
			
		||||
         * @param {NotificationModel | string} message either a string for
 | 
			
		||||
         * the title of the notification message, or a {@link NotificationModel}
 | 
			
		||||
         * defining the options notification to display
 | 
			
		||||
         * @returns {Notification} the provided notification decorated with
 | 
			
		||||
         * functions to dismiss or minimize
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.info = function (message) {
 | 
			
		||||
            var notificationModel = typeof message === "string" ? {title: message} : message;
 | 
			
		||||
            notificationModel.severity = "info";
 | 
			
		||||
            return this.notify(notificationModel);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A convenience method for alert notifications. Notifications
 | 
			
		||||
         * created via this method will will have severity of "alert" enforced
 | 
			
		||||
         * @param {NotificationModel | string} message either a string for
 | 
			
		||||
         * the title of the alert message with default options, or a
 | 
			
		||||
         * {@link NotificationModel} defining the options notification to
 | 
			
		||||
         * display
 | 
			
		||||
         * @returns {Notification} the provided notification decorated with
 | 
			
		||||
         * functions to dismiss or minimize
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.alert = function (message) {
 | 
			
		||||
            var notificationModel = typeof message === "string" ? {title: message} : message;
 | 
			
		||||
            notificationModel.severity = "alert";
 | 
			
		||||
            return this.notify(notificationModel);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A convenience method for error notifications. Notifications
 | 
			
		||||
         * created via this method will will have severity of "error" enforced
 | 
			
		||||
         * @param {NotificationModel | string} message either a string for
 | 
			
		||||
         * the title of the error message with default options, or a
 | 
			
		||||
         * {@link NotificationModel} defining the options notification to
 | 
			
		||||
         * display
 | 
			
		||||
         * @returns {Notification} the provided notification decorated with
 | 
			
		||||
         * functions to dismiss or minimize
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.error = function (message) {
 | 
			
		||||
            var notificationModel = typeof message === "string" ? {title: message} : message;
 | 
			
		||||
            notificationModel.severity = "error";
 | 
			
		||||
            return this.notify(notificationModel);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.setHighestSeverity = function () {
 | 
			
		||||
            var severity = {
 | 
			
		||||
                "info": 1,
 | 
			
		||||
                "alert": 2,
 | 
			
		||||
                "error": 3
 | 
			
		||||
            };
 | 
			
		||||
            this.highest.severity = this.notifications.reduce(function (previous, notification) {
 | 
			
		||||
                if (severity[notification.model.severity] > severity[previous]) {
 | 
			
		||||
                    return notification.model.severity;
 | 
			
		||||
                } else {
 | 
			
		||||
                    return previous;
 | 
			
		||||
                }
 | 
			
		||||
            }, "info");
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Notifies the user of an event. If there is a banner notification
 | 
			
		||||
         * already active, then it will be dismissed or minimized automatically,
 | 
			
		||||
         * and the provided notification displayed in its place.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {NotificationModel} notificationModel The notification to
 | 
			
		||||
         * display
 | 
			
		||||
         * @returns {Notification} the provided notification decorated with
 | 
			
		||||
         * functions to {@link Notification#dismiss} or {@link Notification#minimize}
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.notify = function (notificationModel) {
 | 
			
		||||
            var self = this,
 | 
			
		||||
                notification,
 | 
			
		||||
                activeNotification = self.active.notification,
 | 
			
		||||
                topic = this.topic();
 | 
			
		||||
 | 
			
		||||
            notificationModel.severity = notificationModel.severity || "info";
 | 
			
		||||
            notificationModel.timestamp = moment.utc().format('YYYY-MM-DD hh:mm:ss.ms');
 | 
			
		||||
 | 
			
		||||
            notification = {
 | 
			
		||||
                model: notificationModel,
 | 
			
		||||
 | 
			
		||||
                minimize: function () {
 | 
			
		||||
                    self.minimize(self, notification);
 | 
			
		||||
                },
 | 
			
		||||
 | 
			
		||||
                dismiss: function () {
 | 
			
		||||
                    self.dismiss(self, notification);
 | 
			
		||||
                    topic.notify();
 | 
			
		||||
                },
 | 
			
		||||
 | 
			
		||||
                dismissOrMinimize: function () {
 | 
			
		||||
                    self.dismissOrMinimize(notification);
 | 
			
		||||
                },
 | 
			
		||||
 | 
			
		||||
                onDismiss: function (callback) {
 | 
			
		||||
                    topic.listen(callback);
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            //Notifications support a 'dismissable' attribute. This is a
 | 
			
		||||
            // convenience to support adding a 'dismiss' option to the
 | 
			
		||||
            // notification for the common case of dismissing a
 | 
			
		||||
            // notification. Could also be done manually by specifying an
 | 
			
		||||
            // option on the model
 | 
			
		||||
            if (notificationModel.dismissable !== false) {
 | 
			
		||||
                notificationModel.options = notificationModel.options || [];
 | 
			
		||||
                notificationModel.options.unshift({
 | 
			
		||||
                    label: "Dismiss",
 | 
			
		||||
                    callback: function () {
 | 
			
		||||
                        notification.dismiss();
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.notifications.push(notification);
 | 
			
		||||
 | 
			
		||||
            this.setHighestSeverity();
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
            Check if there is already an active (ie. visible) notification
 | 
			
		||||
             */
 | 
			
		||||
            if (!this.active.notification) {
 | 
			
		||||
                this.setActiveNotification(notification);
 | 
			
		||||
 | 
			
		||||
            } else if (!this.active.timeout) {
 | 
			
		||||
                /*
 | 
			
		||||
                 If there is already an active notification, time it out. If it's
 | 
			
		||||
                 already got a timeout in progress (either because it has had
 | 
			
		||||
                 timeout forced because of a queue of messages, or it had an
 | 
			
		||||
                 autodismiss specified), leave it to run. Otherwise force a
 | 
			
		||||
                  timeout.
 | 
			
		||||
 | 
			
		||||
                 This notification has been added to queue and will be
 | 
			
		||||
                  serviced as soon as possible.
 | 
			
		||||
                 */
 | 
			
		||||
                this.active.timeout = this.$timeout(function () {
 | 
			
		||||
                    activeNotification.dismissOrMinimize();
 | 
			
		||||
                }, this.AUTO_DISMISS_TIMEOUT);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return notification;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Used internally by the NotificationService
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.setActiveNotification = function (notification) {
 | 
			
		||||
            var shouldAutoDismiss;
 | 
			
		||||
            this.active.notification = notification;
 | 
			
		||||
 | 
			
		||||
            if (!notification) {
 | 
			
		||||
                delete this.active.timeout;
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (notification.model.severity === "info") {
 | 
			
		||||
                shouldAutoDismiss = true;
 | 
			
		||||
            } else {
 | 
			
		||||
                shouldAutoDismiss = notification.model.autoDismiss;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (shouldAutoDismiss || this.selectNextNotification()) {
 | 
			
		||||
                this.active.timeout = this.$timeout(function () {
 | 
			
		||||
                    notification.dismissOrMinimize();
 | 
			
		||||
                }, this.AUTO_DISMISS_TIMEOUT);
 | 
			
		||||
            } else {
 | 
			
		||||
                delete this.active.timeout;
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Used internally by the NotificationService
 | 
			
		||||
         *
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        NotificationService.prototype.selectNextNotification = function () {
 | 
			
		||||
            var notification,
 | 
			
		||||
                i = 0;
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
            Loop through the notifications queue and find the first one that
 | 
			
		||||
            has not already been minimized (manually or otherwise).
 | 
			
		||||
             */
 | 
			
		||||
            for (; i < this.notifications.length; i++) {
 | 
			
		||||
                notification = this.notifications[i];
 | 
			
		||||
 | 
			
		||||
                if (!notification.model.minimized &&
 | 
			
		||||
                    notification !== this.active.notification) {
 | 
			
		||||
 | 
			
		||||
                    return notification;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return NotificationService;
 | 
			
		||||
export default class NotificationService {
 | 
			
		||||
    constructor(openmct) {
 | 
			
		||||
        this.openmct = openmct;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
    info(message) {
 | 
			
		||||
        if (typeof message === 'string') {
 | 
			
		||||
            return this.openmct.notifications.info(message);
 | 
			
		||||
        } else {
 | 
			
		||||
            if (message.hasOwnProperty('progress')) {
 | 
			
		||||
                return this.openmct.notifications.progress(message.title, message.progress, message.progressText);
 | 
			
		||||
            } else {
 | 
			
		||||
                return this.openmct.notifications.info(message.title);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    alert(message) {
 | 
			
		||||
        if (typeof message === 'string') {
 | 
			
		||||
            return this.openmct.notifications.alert(message);
 | 
			
		||||
        } else {
 | 
			
		||||
            return this.openmct.notifications.alert(message.title);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    error(message) {
 | 
			
		||||
        if (typeof message === 'string') {
 | 
			
		||||
            return this.openmct.notifications.error(message);
 | 
			
		||||
        } else {
 | 
			
		||||
            return this.openmct.notifications.error(message.title);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    notify(options) {
 | 
			
		||||
        switch (options.severity) {
 | 
			
		||||
        case 'info':
 | 
			
		||||
            return this.info(options);
 | 
			
		||||
        case 'alert':
 | 
			
		||||
            return this.alert(options);
 | 
			
		||||
        case 'error':
 | 
			
		||||
            return this.error(options);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    getAllNotifications() {
 | 
			
		||||
        return this.openmct.notifications.notifications;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,275 +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/NotificationService'],
 | 
			
		||||
    function (NotificationService) {
 | 
			
		||||
 | 
			
		||||
        describe("The notification service ", function () {
 | 
			
		||||
            var notificationService,
 | 
			
		||||
                mockTimeout,
 | 
			
		||||
                mockAutoDismiss,
 | 
			
		||||
                mockMinimizeTimeout,
 | 
			
		||||
                mockTopicFunction,
 | 
			
		||||
                mockTopicObject,
 | 
			
		||||
                infoModel,
 | 
			
		||||
                alertModel,
 | 
			
		||||
                errorModel;
 | 
			
		||||
 | 
			
		||||
            function elapseTimeout() {
 | 
			
		||||
                mockTimeout.calls.mostRecent().args[0]();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            beforeEach(function () {
 | 
			
		||||
                mockTimeout = jasmine.createSpy("$timeout");
 | 
			
		||||
                mockTopicFunction = jasmine.createSpy("topic");
 | 
			
		||||
                mockTopicObject = jasmine.createSpyObj("topicObject", ["listen", "notify"]);
 | 
			
		||||
                mockTopicFunction.and.returnValue(mockTopicObject);
 | 
			
		||||
 | 
			
		||||
                mockAutoDismiss = mockMinimizeTimeout = 1000;
 | 
			
		||||
                notificationService = new NotificationService(mockTimeout, mockTopicFunction, mockAutoDismiss, mockMinimizeTimeout);
 | 
			
		||||
 | 
			
		||||
                infoModel = {
 | 
			
		||||
                    title: "Mock Info Notification",
 | 
			
		||||
                    severity: "info"
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                alertModel = {
 | 
			
		||||
                    title: "Mock Alert Notification",
 | 
			
		||||
                    severity: "alert"
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                errorModel = {
 | 
			
		||||
                    title: "Mock Error Notification",
 | 
			
		||||
                    severity: "error"
 | 
			
		||||
                };
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("notifies listeners on dismissal of notification", function () {
 | 
			
		||||
                var dismissListener = jasmine.createSpy("ondismiss");
 | 
			
		||||
                var notification = notificationService.notify(infoModel);
 | 
			
		||||
                notification.onDismiss(dismissListener);
 | 
			
		||||
                expect(mockTopicObject.listen).toHaveBeenCalled();
 | 
			
		||||
                notification.dismiss();
 | 
			
		||||
                expect(mockTopicObject.notify).toHaveBeenCalled();
 | 
			
		||||
                mockTopicObject.listen.calls.mostRecent().args[0]();
 | 
			
		||||
                expect(dismissListener).toHaveBeenCalled();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("dismisses a notification when the notification's dismiss method is used", function () {
 | 
			
		||||
                var notification = notificationService.info(infoModel);
 | 
			
		||||
                notification.dismiss();
 | 
			
		||||
                expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                expect(notificationService.notifications.length).toEqual(0);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it("minimizes a notification when the notification's minimize method is used", function () {
 | 
			
		||||
                var notification = notificationService.info(infoModel);
 | 
			
		||||
                notification.minimize();
 | 
			
		||||
                elapseTimeout(); // needed for the minimize animation timeout
 | 
			
		||||
                expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            describe("when receiving info notifications", function () {
 | 
			
		||||
                it("minimizes info notifications if the caller disables auto-dismiss", function () {
 | 
			
		||||
                    infoModel.autoDismiss = false;
 | 
			
		||||
                    var notification = notificationService.info(infoModel);
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    // 2nd elapse for the minimize animation timeout
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("dismisses info notifications if the caller ignores auto-dismiss", function () {
 | 
			
		||||
                    notificationService.info(infoModel);
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(0);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("dismisses info notifications if the caller requests auto-dismiss", function () {
 | 
			
		||||
                    infoModel.autoDismiss = true;
 | 
			
		||||
                    notificationService.info(infoModel);
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(0);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            describe("when receiving alert notifications", function () {
 | 
			
		||||
                it("minimizes alert notifications if the caller enables auto-dismiss", function () {
 | 
			
		||||
                    alertModel.autoDismiss = true;
 | 
			
		||||
                    var notification = notificationService.alert(alertModel);
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("keeps alert notifications active if the caller disables auto-dismiss", function () {
 | 
			
		||||
                    mockTimeout.and.callFake(function (callback, time) {
 | 
			
		||||
                        callback();
 | 
			
		||||
                    });
 | 
			
		||||
                    alertModel.autoDismiss = false;
 | 
			
		||||
                    var notification = notificationService.alert(alertModel);
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toEqual(notification);
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("keeps alert notifications active if the caller ignores auto-dismiss", function () {
 | 
			
		||||
                    mockTimeout.and.callFake(function (callback, time) {
 | 
			
		||||
                        callback();
 | 
			
		||||
                    });
 | 
			
		||||
                    var notification = notificationService.alert(alertModel);
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toEqual(notification);
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            describe("when receiving error notifications", function () {
 | 
			
		||||
                it("minimizes error notifications if the caller enables auto-dismiss", function () {
 | 
			
		||||
                    errorModel.autoDismiss = true;
 | 
			
		||||
                    var notification = notificationService.error(errorModel);
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toBeUndefined();
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("keeps error notifications active if the caller disables auto-dismiss", function () {
 | 
			
		||||
                    mockTimeout.and.callFake(function (callback, time) {
 | 
			
		||||
                        callback();
 | 
			
		||||
                    });
 | 
			
		||||
                    errorModel.autoDismiss = false;
 | 
			
		||||
                    var notification = notificationService.error(errorModel);
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toEqual(notification);
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("keeps error notifications active if the caller ignores auto-dismiss", function () {
 | 
			
		||||
                    mockTimeout.and.callFake(function (callback, time) {
 | 
			
		||||
                        callback();
 | 
			
		||||
                    });
 | 
			
		||||
                    var notification = notificationService.error(errorModel);
 | 
			
		||||
                    expect(notificationService.getActiveNotification()).toEqual(notification);
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(1);
 | 
			
		||||
                    expect(notificationService.notifications[0]).toEqual(notification);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            describe("when called with multiple notifications", function () {
 | 
			
		||||
                it("auto-dismisses the previously active notification, making the new notification active", function () {
 | 
			
		||||
                    var activeNotification;
 | 
			
		||||
                    infoModel.autoDismiss = false;
 | 
			
		||||
                    //First pre-load with a info message
 | 
			
		||||
                    notificationService.notify(infoModel);
 | 
			
		||||
                    activeNotification = notificationService.getActiveNotification();
 | 
			
		||||
                    //Initially expect the active notification to be info
 | 
			
		||||
                    expect(activeNotification.model).toBe(infoModel);
 | 
			
		||||
                    //Then notify of an error
 | 
			
		||||
                    notificationService.notify(errorModel);
 | 
			
		||||
                    //But it should be auto-dismissed and replaced with the
 | 
			
		||||
                    // error notification
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    //Two timeouts, one is to force minimization after
 | 
			
		||||
                    // displaying the message for a minimum period, the
 | 
			
		||||
                    // second is to allow minimization animation to take place.
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    activeNotification = notificationService.getActiveNotification();
 | 
			
		||||
                    expect(activeNotification.model).toBe(errorModel);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("auto-minimizes an active error notification", function () {
 | 
			
		||||
                    var activeNotification;
 | 
			
		||||
                    //First pre-load with an error message
 | 
			
		||||
                    notificationService.notify(errorModel);
 | 
			
		||||
                    //Then notify of info
 | 
			
		||||
                    notificationService.notify(infoModel);
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(2);
 | 
			
		||||
                    //Mock the auto-minimize
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    //Two timeouts, one is to force minimization after
 | 
			
		||||
                    // displaying the message for a minimum period, the
 | 
			
		||||
                    // second is to allow minimization animation to take place.
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    //Previous error message should be minimized, not
 | 
			
		||||
                    // dismissed
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(2);
 | 
			
		||||
                    activeNotification = notificationService.getActiveNotification();
 | 
			
		||||
                    expect(activeNotification.model).toBe(infoModel);
 | 
			
		||||
                    expect(errorModel.minimized).toEqual(true);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                it("auto-minimizes errors when a number of them arrive in short succession", function () {
 | 
			
		||||
                    var activeNotification,
 | 
			
		||||
                        error2 = {
 | 
			
		||||
                            title: "Second Mock Error Notification",
 | 
			
		||||
                            severity: "error"
 | 
			
		||||
                        },
 | 
			
		||||
                        error3 = {
 | 
			
		||||
                            title: "Third Mock Error Notification",
 | 
			
		||||
                            severity: "error"
 | 
			
		||||
                        };
 | 
			
		||||
 | 
			
		||||
                    //First pre-load with a info message
 | 
			
		||||
                    notificationService.notify(errorModel);
 | 
			
		||||
                    //Then notify of a third error
 | 
			
		||||
                    notificationService.notify(error2);
 | 
			
		||||
                    notificationService.notify(error3);
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(3);
 | 
			
		||||
                    //Mock the auto-minimize
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    //Two timeouts, one is to force minimization after
 | 
			
		||||
                    // displaying the message for a minimum period, the
 | 
			
		||||
                    // second is to allow minimization animation to take place.
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    //Previous error message should be minimized, not
 | 
			
		||||
                    // dismissed
 | 
			
		||||
                    expect(notificationService.notifications.length).toEqual(3);
 | 
			
		||||
                    activeNotification = notificationService.getActiveNotification();
 | 
			
		||||
                    expect(activeNotification.model).toBe(error2);
 | 
			
		||||
                    expect(errorModel.minimized).toEqual(true);
 | 
			
		||||
 | 
			
		||||
                    //Mock the second auto-minimize
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    //Two timeouts, one is to force minimization after
 | 
			
		||||
                    // displaying the message for a minimum period, the
 | 
			
		||||
                    // second is to allow minimization animation to take place.
 | 
			
		||||
                    elapseTimeout();
 | 
			
		||||
                    activeNotification = notificationService.getActiveNotification();
 | 
			
		||||
                    expect(activeNotification.model).toBe(error3);
 | 
			
		||||
                    expect(error2.minimized).toEqual(true);
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -58,7 +58,8 @@ define([
 | 
			
		||||
                    "category": "action",
 | 
			
		||||
                    "implementation": ComposeActionPolicy,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$injector"
 | 
			
		||||
                        "$injector",
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "message": "Objects of this type cannot contain objects of that type."
 | 
			
		||||
                },
 | 
			
		||||
 
 | 
			
		||||
@@ -36,10 +36,11 @@ define(
 | 
			
		||||
         * @memberof platform/containment
 | 
			
		||||
         * @implements {Policy.<Action, ActionContext>}
 | 
			
		||||
         */
 | 
			
		||||
        function ComposeActionPolicy($injector) {
 | 
			
		||||
        function ComposeActionPolicy($injector, openmct) {
 | 
			
		||||
            this.getPolicyService = function () {
 | 
			
		||||
                return $injector.get('policyService');
 | 
			
		||||
            };
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ComposeActionPolicy.prototype.allowComposition = function (containerObject, selectedObject) {
 | 
			
		||||
@@ -49,11 +50,8 @@ define(
 | 
			
		||||
 | 
			
		||||
            // ...and delegate to the composition policy
 | 
			
		||||
            return containerObject.getId() !== selectedObject.getId() &&
 | 
			
		||||
                this.policyService.allow(
 | 
			
		||||
                    'composition',
 | 
			
		||||
                    containerObject,
 | 
			
		||||
                    selectedObject
 | 
			
		||||
                );
 | 
			
		||||
                this.openmct.composition.checkPolicy(containerObject.useCapability('adapter'),
 | 
			
		||||
                    selectedObject.useCapability('adapter'));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
 
 | 
			
		||||
@@ -170,7 +170,7 @@ define([
 | 
			
		||||
                    "description": "Provides a service for moving objects",
 | 
			
		||||
                    "implementation": MoveService,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "policyService",
 | 
			
		||||
                        "openmct",
 | 
			
		||||
                        "linkService",
 | 
			
		||||
                        "$q"
 | 
			
		||||
                    ]
 | 
			
		||||
@@ -181,7 +181,7 @@ define([
 | 
			
		||||
                    "description": "Provides a service for linking objects",
 | 
			
		||||
                    "implementation": LinkService,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "policyService"
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
@@ -192,7 +192,7 @@ define([
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$q",
 | 
			
		||||
                        "policyService",
 | 
			
		||||
                        "now"
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
 
 | 
			
		||||
@@ -33,9 +33,10 @@ define(
 | 
			
		||||
         * @memberof platform/entanglement
 | 
			
		||||
         * @implements {platform/entanglement.AbstractComposeService}
 | 
			
		||||
         */
 | 
			
		||||
        function CopyService($q, policyService) {
 | 
			
		||||
        function CopyService($q, policyService, openmct) {
 | 
			
		||||
            this.$q = $q;
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        CopyService.prototype.validate = function (object, parentCandidate) {
 | 
			
		||||
@@ -45,11 +46,7 @@ define(
 | 
			
		||||
            if (parentCandidate.getId() === object.getId()) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            return this.policyService.allow(
 | 
			
		||||
                "composition",
 | 
			
		||||
                parentCandidate,
 | 
			
		||||
                object
 | 
			
		||||
            );
 | 
			
		||||
            return this.openmct.composition.checkPolicy(parentCandidate.useCapability('adapter'), object.useCapability('adapter'));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
 
 | 
			
		||||
@@ -32,8 +32,8 @@ define(
 | 
			
		||||
         * @memberof platform/entanglement
 | 
			
		||||
         * @implements {platform/entanglement.AbstractComposeService}
 | 
			
		||||
         */
 | 
			
		||||
        function LinkService(policyService) {
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
        function LinkService(openmct) {
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        LinkService.prototype.validate = function (object, parentCandidate) {
 | 
			
		||||
@@ -49,11 +49,7 @@ define(
 | 
			
		||||
            if (parentCandidate.getModel().composition.indexOf(object.getId()) !== -1) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            return this.policyService.allow(
 | 
			
		||||
                "composition",
 | 
			
		||||
                parentCandidate,
 | 
			
		||||
                object
 | 
			
		||||
            );
 | 
			
		||||
            return this.openmct.composition.checkPolicy(parentCandidate.useCapability('adapter'), object.useCapability('adapter'));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        LinkService.prototype.perform = function (object, parentObject) {
 | 
			
		||||
 
 | 
			
		||||
@@ -31,8 +31,8 @@ define(
 | 
			
		||||
         * @memberof platform/entanglement
 | 
			
		||||
         * @implements {platform/entanglement.AbstractComposeService}
 | 
			
		||||
         */
 | 
			
		||||
        function MoveService(policyService, linkService) {
 | 
			
		||||
            this.policyService = policyService;
 | 
			
		||||
        function MoveService(openmct, linkService) {
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
            this.linkService = linkService;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -53,10 +53,9 @@ define(
 | 
			
		||||
            if (parentCandidate.getModel().composition.indexOf(object.getId()) !== -1) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            return this.policyService.allow(
 | 
			
		||||
                "composition",
 | 
			
		||||
                parentCandidate,
 | 
			
		||||
                object
 | 
			
		||||
            return this.openmct.composition.checkPolicy(
 | 
			
		||||
                parentCandidate.useCapability('adapter'),
 | 
			
		||||
                object.useCapability('adapter')
 | 
			
		||||
            );
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ define([
 | 
			
		||||
                {
 | 
			
		||||
                    key: "exportService",
 | 
			
		||||
                    implementation: function () {
 | 
			
		||||
                        return new ExportService(saveAs);
 | 
			
		||||
                        return new ExportService(saveAs.saveAs);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
 
 | 
			
		||||
@@ -19,16 +19,14 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div class="l-time-display l-digital l-clock s-clock" ng-controller="ClockController as clock">
 | 
			
		||||
	<div class="l-elem-wrapper">
 | 
			
		||||
	    <span class="l-elem timezone">
 | 
			
		||||
	        {{clock.zone()}}
 | 
			
		||||
	    </span>
 | 
			
		||||
	    <span class="l-elem value active">
 | 
			
		||||
	        {{clock.text()}}
 | 
			
		||||
	    </span>
 | 
			
		||||
	    <span class="l-elem ampm">
 | 
			
		||||
	        {{clock.ampm()}}
 | 
			
		||||
	    </span>
 | 
			
		||||
<div class="c-clock l-time-display" ng-controller="ClockController as clock">
 | 
			
		||||
	<div class="c-clock__timezone">
 | 
			
		||||
		{{clock.zone()}}
 | 
			
		||||
	</div>
 | 
			
		||||
	<div class="c-clock__value">
 | 
			
		||||
		{{clock.text()}}
 | 
			
		||||
	</div>
 | 
			
		||||
	<div class="c-clock__ampm">
 | 
			
		||||
		{{clock.ampm()}}
 | 
			
		||||
	</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -19,21 +19,19 @@
 | 
			
		||||
 this source code distribution or the Licensing information page available
 | 
			
		||||
 at runtime from the About dialog for additional information.
 | 
			
		||||
-->
 | 
			
		||||
<div class="l-time-display l-digital l-timer s-timer s-state-{{timer.timerState}}" ng-controller="TimerController as timer">
 | 
			
		||||
	<div class="l-elem-wrapper l-flex-row">
 | 
			
		||||
        <div class="l-elem-wrapper l-flex-row controls">
 | 
			
		||||
            <a ng-click="timer.clickStopButton()"
 | 
			
		||||
               title="Stop"
 | 
			
		||||
               class="flex-elem s-icon-button t-btn-stop icon-box"></a>
 | 
			
		||||
            <a ng-click="timer.clickButton()"
 | 
			
		||||
               title="{{timer.buttonText()}}"
 | 
			
		||||
               class="flex-elem s-icon-button t-btn-pauseplay {{timer.buttonCssClass()}}"></a>
 | 
			
		||||
        </div>
 | 
			
		||||
	    <span class="flex-elem l-value {{timer.signClass()}}">
 | 
			
		||||
	        <span class="value"
 | 
			
		||||
		        ng-class="{ active:timer.text() }">{{timer.text() || "--:--:--"}}
 | 
			
		||||
            </span>
 | 
			
		||||
	    </span>
 | 
			
		||||
	    <span ng-controller="RefreshingController"></span>
 | 
			
		||||
<div class="c-timer is-{{timer.timerState}}" ng-controller="TimerController as timer">
 | 
			
		||||
    <div class="c-timer__controls">
 | 
			
		||||
        <button ng-click="timer.clickStopButton()"
 | 
			
		||||
                ng-hide="timer.timerState == 'stopped'"
 | 
			
		||||
                title="Reset"
 | 
			
		||||
                class="c-timer__ctrl-reset c-icon-button c-icon-button--major icon-reset"></button>
 | 
			
		||||
        <button ng-click="timer.clickButton()"
 | 
			
		||||
                title="{{timer.buttonText()}}"
 | 
			
		||||
                class="c-timer__ctrl-pause-play c-icon-button c-icon-button--major {{timer.buttonCssClass()}}"></button>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="c-timer__direction {{timer.signClass()}}"
 | 
			
		||||
        ng-hide="!timer.signClass()"></div>
 | 
			
		||||
	<div class="c-timer__value">{{timer.text() || "--:--:--"}}
 | 
			
		||||
	</div>
 | 
			
		||||
	<span class="c-timer__ng-controller u-contents" ng-controller="RefreshingController"></span>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,399 +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([
 | 
			
		||||
    "../layout/res/templates/fixed.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    fixedTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
    legacyRegistry.register("platform/features/fixed", {
 | 
			
		||||
        "name": "Fixed position components.",
 | 
			
		||||
        "description": "Plug in adding Fixed Position object type.",
 | 
			
		||||
        "extensions": {
 | 
			
		||||
            "views": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed-display",
 | 
			
		||||
                    "name": "Fixed Position Display",
 | 
			
		||||
                    "cssClass": "icon-box-with-dashed-lines",
 | 
			
		||||
                    "type": "telemetry.fixed",
 | 
			
		||||
                    "template": fixedTemplate,
 | 
			
		||||
                    "uses": [],
 | 
			
		||||
                    "editable": true
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "toolbars": [
 | 
			
		||||
                {
 | 
			
		||||
                    name: "Fixed Position Toolbar",
 | 
			
		||||
                    key: "fixed.position",
 | 
			
		||||
                    description: "Toolbar for the selected element inside a fixed position display.",
 | 
			
		||||
                    forSelection: function (selection) {
 | 
			
		||||
                        if (!selection) {
 | 
			
		||||
                            return;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        return (
 | 
			
		||||
                            selection[0] && selection[0].context.elementProxy &&
 | 
			
		||||
                            selection[1] && selection[1].context.item.type === 'telemetry.fixed' ||
 | 
			
		||||
                            selection[0] && selection[0].context.item.type === 'telemetry.fixed'
 | 
			
		||||
                        );
 | 
			
		||||
                    },
 | 
			
		||||
                    toolbar: function (selection) {
 | 
			
		||||
                        var imageProperties = ["add", "remove", "order", "stroke", "useGrid", "x", "y", "height", "width", "url"];
 | 
			
		||||
                        var boxProperties = ["add", "remove", "order", "stroke", "useGrid", "x", "y", "height", "width", "fill"];
 | 
			
		||||
                        var textProperties = ["add", "remove", "order", "stroke", "useGrid", "x", "y", "height", "width", "fill", "color", "size", "text"];
 | 
			
		||||
                        var lineProperties = ["add", "remove", "order", "stroke", "useGrid", "x", "y", "x2", "y2"];
 | 
			
		||||
                        var telemetryProperties = ["add", "remove", "order", "stroke", "useGrid", "x", "y", "height", "width", "fill", "color", "size", "titled"];
 | 
			
		||||
                        var fixedPageProperties = ["add"];
 | 
			
		||||
 | 
			
		||||
                        var properties = [],
 | 
			
		||||
                            fixedItem = selection[0] && selection[0].context.item,
 | 
			
		||||
                            elementProxy = selection[0] && selection[0].context.elementProxy,
 | 
			
		||||
                            domainObject = selection[1] && selection[1].context.item,
 | 
			
		||||
                            path;
 | 
			
		||||
 | 
			
		||||
                        if (elementProxy) {
 | 
			
		||||
                            var type = elementProxy.element.type;
 | 
			
		||||
                            path = "configuration['fixed-display'].elements[" + elementProxy.index + "]";
 | 
			
		||||
                            properties =
 | 
			
		||||
                                type === 'fixed.image' ? imageProperties :
 | 
			
		||||
                                    type === 'fixed.text' ? textProperties :
 | 
			
		||||
                                        type === 'fixed.box' ? boxProperties :
 | 
			
		||||
                                            type === 'fixed.line' ? lineProperties :
 | 
			
		||||
                                                type === 'fixed.telemetry' ? telemetryProperties : [];
 | 
			
		||||
                        } else if (fixedItem) {
 | 
			
		||||
                            properties = domainObject && domainObject.type === 'layout' ? [] : fixedPageProperties;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        return [
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "menu-button",
 | 
			
		||||
                                domainObject: domainObject || selection[0].context.item,
 | 
			
		||||
                                method: function (value) {
 | 
			
		||||
                                    selection[0].context.fixedController.add(value);
 | 
			
		||||
                                },
 | 
			
		||||
                                key: "add",
 | 
			
		||||
                                cssClass: "icon-plus",
 | 
			
		||||
                                text: "Add",
 | 
			
		||||
                                options: [
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Box",
 | 
			
		||||
                                        "cssClass": "icon-box",
 | 
			
		||||
                                        "key": "fixed.box"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Line",
 | 
			
		||||
                                        "cssClass": "icon-line-horz",
 | 
			
		||||
                                        "key": "fixed.line"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Text",
 | 
			
		||||
                                        "cssClass": "icon-T",
 | 
			
		||||
                                        "key": "fixed.text"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Image",
 | 
			
		||||
                                        "cssClass": "icon-image",
 | 
			
		||||
                                        "key": "fixed.image"
 | 
			
		||||
                                    }
 | 
			
		||||
                                ]
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "menu-button",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                method: function (value) {
 | 
			
		||||
                                    selection[0].context.fixedController.order(
 | 
			
		||||
                                        selection[0].context.elementProxy,
 | 
			
		||||
                                        value
 | 
			
		||||
                                    );
 | 
			
		||||
                                },
 | 
			
		||||
                                key: "order",
 | 
			
		||||
                                cssClass: "icon-layers",
 | 
			
		||||
                                title: "Layering",
 | 
			
		||||
                                description: "Move the selected object above or below other objects",
 | 
			
		||||
                                options: [
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Move to Top",
 | 
			
		||||
                                        "cssClass": "icon-arrow-double-up",
 | 
			
		||||
                                        "key": "top"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Move Up",
 | 
			
		||||
                                        "cssClass": "icon-arrow-up",
 | 
			
		||||
                                        "key": "up"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Move Down",
 | 
			
		||||
                                        "cssClass": "icon-arrow-down",
 | 
			
		||||
                                        "key": "down"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "name": "Move to Bottom",
 | 
			
		||||
                                        "cssClass": "icon-arrow-double-down",
 | 
			
		||||
                                        "key": "bottom"
 | 
			
		||||
                                    }
 | 
			
		||||
                                ]
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "color",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".fill",
 | 
			
		||||
                                cssClass: "icon-paint-bucket",
 | 
			
		||||
                                title: "Fill color",
 | 
			
		||||
                                description: "Set fill color",
 | 
			
		||||
                                key: 'fill'
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "color",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".stroke",
 | 
			
		||||
                                cssClass: "icon-line-horz",
 | 
			
		||||
                                title: "Border color",
 | 
			
		||||
                                description: "Set border color",
 | 
			
		||||
                                key: 'stroke'
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "dialog-button",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".url",
 | 
			
		||||
                                cssClass: "icon-image",
 | 
			
		||||
                                title: "Image Properties",
 | 
			
		||||
                                description: "Edit image properties",
 | 
			
		||||
                                key: 'url',
 | 
			
		||||
                                dialog: {
 | 
			
		||||
                                    control: "textfield",
 | 
			
		||||
                                    name: "Image URL",
 | 
			
		||||
                                    cssClass: "l-input-lg",
 | 
			
		||||
                                    required: true
 | 
			
		||||
                                }
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "color",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".color",
 | 
			
		||||
                                cssClass: "icon-T",
 | 
			
		||||
                                title: "Text color",
 | 
			
		||||
                                mandatory: true,
 | 
			
		||||
                                description: "Set text color",
 | 
			
		||||
                                key: 'color'
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "select",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".size",
 | 
			
		||||
                                title: "Text size",
 | 
			
		||||
                                description: "Set text size",
 | 
			
		||||
                                "options": [9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 36, 48, 72, 96].map(function (size) {
 | 
			
		||||
                                    return { "name": size + " px", "value": size + "px" };
 | 
			
		||||
                                }),
 | 
			
		||||
                                key: 'size'
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".x",
 | 
			
		||||
                                text: "X",
 | 
			
		||||
                                name: "X",
 | 
			
		||||
                                key: "x",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                min: "0"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".y",
 | 
			
		||||
                                text: "Y",
 | 
			
		||||
                                name: "Y",
 | 
			
		||||
                                key: "y",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                min: "0"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".x",
 | 
			
		||||
                                text: "X1",
 | 
			
		||||
                                name: "X1",
 | 
			
		||||
                                key: "x1",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                min: "0"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".y",
 | 
			
		||||
                                text: "Y1",
 | 
			
		||||
                                name: "Y1",
 | 
			
		||||
                                key: "y1",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                min: "0"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".x2",
 | 
			
		||||
                                text: "X2",
 | 
			
		||||
                                name: "X2",
 | 
			
		||||
                                key: "x2",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                min: "0"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".y2",
 | 
			
		||||
                                text: "Y2",
 | 
			
		||||
                                name: "Y2",
 | 
			
		||||
                                key: "y2",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                min: "0"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".height",
 | 
			
		||||
                                text: "H",
 | 
			
		||||
                                name: "H",
 | 
			
		||||
                                key: "height",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                description: "Resize object height",
 | 
			
		||||
                                min: "1"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "numberfield",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".width",
 | 
			
		||||
                                text: "W",
 | 
			
		||||
                                name: "W",
 | 
			
		||||
                                key: "width",
 | 
			
		||||
                                cssClass: "l-input-sm",
 | 
			
		||||
                                description: "Resize object width",
 | 
			
		||||
                                min: "1"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "checkbox",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".useGrid",
 | 
			
		||||
                                name: "Snap to Grid",
 | 
			
		||||
                                key: "useGrid"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "dialog-button",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".text",
 | 
			
		||||
                                cssClass: "icon-gear",
 | 
			
		||||
                                title: "Text Properties",
 | 
			
		||||
                                description: "Edit text properties",
 | 
			
		||||
                                key: "text",
 | 
			
		||||
                                dialog: {
 | 
			
		||||
                                    control: "textfield",
 | 
			
		||||
                                    name: "Text",
 | 
			
		||||
                                    required: true
 | 
			
		||||
                                }
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "checkbox",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                property: path + ".titled",
 | 
			
		||||
                                name: "Show Title",
 | 
			
		||||
                                key: "titled"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "button",
 | 
			
		||||
                                domainObject: domainObject,
 | 
			
		||||
                                method: function () {
 | 
			
		||||
                                    selection[0].context.fixedController.remove(
 | 
			
		||||
                                        selection[0].context.elementProxy
 | 
			
		||||
                                    );
 | 
			
		||||
                                },
 | 
			
		||||
                                key: "remove",
 | 
			
		||||
                                cssClass: "icon-trash"
 | 
			
		||||
                            }
 | 
			
		||||
                        ].filter(function (item) {
 | 
			
		||||
                            var filtered;
 | 
			
		||||
 | 
			
		||||
                            properties.forEach(function (property) {
 | 
			
		||||
                                if (item.property && item.key === property ||
 | 
			
		||||
                                    item.method && item.key === property) {
 | 
			
		||||
                                    filtered = item;
 | 
			
		||||
                                }
 | 
			
		||||
                            });
 | 
			
		||||
 | 
			
		||||
                            return filtered;
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "types": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "telemetry.fixed",
 | 
			
		||||
                    "name": "Fixed Position Display",
 | 
			
		||||
                    "cssClass": "icon-box-with-dashed-lines",
 | 
			
		||||
                    "description": "Collect and display telemetry elements in " +
 | 
			
		||||
                    "alphanumeric format in a simple canvas workspace. " +
 | 
			
		||||
                    "Elements can be positioned and sized. " +
 | 
			
		||||
                    "Lines, boxes and images can be added as well.",
 | 
			
		||||
                    "priority": 899,
 | 
			
		||||
                    "delegates": [
 | 
			
		||||
                        "telemetry"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "features": "creation",
 | 
			
		||||
                    "contains": [
 | 
			
		||||
                        {
 | 
			
		||||
                            "has": "telemetry"
 | 
			
		||||
                        }
 | 
			
		||||
                    ],
 | 
			
		||||
                    "model": {
 | 
			
		||||
                        "layoutGrid": [64, 16],
 | 
			
		||||
                        "composition": []
 | 
			
		||||
                    },
 | 
			
		||||
                    "properties": [
 | 
			
		||||
                        {
 | 
			
		||||
                            "name": "Layout Grid",
 | 
			
		||||
                            "control": "composite",
 | 
			
		||||
                            "items": [
 | 
			
		||||
                                {
 | 
			
		||||
                                    "name": "Horizontal grid (px)",
 | 
			
		||||
                                    "control": "textfield",
 | 
			
		||||
                                    "cssClass": "l-input-sm l-numeric"
 | 
			
		||||
                                },
 | 
			
		||||
                                {
 | 
			
		||||
                                    "name": "Vertical grid (px)",
 | 
			
		||||
                                    "control": "textfield",
 | 
			
		||||
                                    "cssClass": "l-input-sm l-numeric"
 | 
			
		||||
                                }
 | 
			
		||||
                            ],
 | 
			
		||||
                            "pattern": "^(\\d*[1-9]\\d*)?$",
 | 
			
		||||
                            "property": "layoutGrid",
 | 
			
		||||
                            "conversion": "number[]"
 | 
			
		||||
                        }
 | 
			
		||||
                    ],
 | 
			
		||||
                    "views": [
 | 
			
		||||
                        "fixed-display"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -45,7 +45,6 @@ define([
 | 
			
		||||
                            "key": "url",
 | 
			
		||||
                            "name": "URL",
 | 
			
		||||
                            "control": "textfield",
 | 
			
		||||
                            "pattern": "^(ftp|https?)\\:\\/\\/",
 | 
			
		||||
                            "required": true,
 | 
			
		||||
                            "cssClass": "l-input-lg"
 | 
			
		||||
                        },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,18 @@
 | 
			
		||||
<div class="t-imagery" ng-controller="ImageryController as imagery">
 | 
			
		||||
<div class="t-imagery c-imagery" ng-controller="ImageryController as imagery">
 | 
			
		||||
    <mct-split-pane class='abs' anchor="bottom" alias="imagery">
 | 
			
		||||
    <div class="split-pane-component has-local-controls l-image-main-wrapper l-flex-col"
 | 
			
		||||
        ng-mouseenter="showLocalControls = true;"
 | 
			
		||||
        ng-mouseleave="showLocalControls = false;">
 | 
			
		||||
        <div class="h-local-controls h-local-controls-overlay-content h-local-controls-trans s-local-controls local-controls-hidden l-flex-row">
 | 
			
		||||
            <span class="holder flex-elem grows">
 | 
			
		||||
    <div class="split-pane-component has-local-controls l-image-main-wrapper l-flex-col">
 | 
			
		||||
        <div class="h-local-controls h-local-controls--overlay-content c-local-controls--show-on-hover l-flex-row c-imagery__lc">
 | 
			
		||||
            <span class="holder flex-elem grows c-imagery__lc__sliders">
 | 
			
		||||
                <input class="icon-brightness" type="range"
 | 
			
		||||
                       min="0"
 | 
			
		||||
                       max="500"
 | 
			
		||||
                       ng-model="filters.brightness">
 | 
			
		||||
                </input>
 | 
			
		||||
                       ng-model="filters.brightness" />
 | 
			
		||||
                <input class="icon-contrast" type="range"
 | 
			
		||||
                       min="0"
 | 
			
		||||
                       max="500"
 | 
			
		||||
                       ng-model="filters.contrast">
 | 
			
		||||
                </input>
 | 
			
		||||
                       ng-model="filters.contrast" />
 | 
			
		||||
            </span>
 | 
			
		||||
            <span class="holder flex-elem t-reset-btn-holder">
 | 
			
		||||
            <span class="holder flex-elem t-reset-btn-holder c-imagery__lc__reset-btn">
 | 
			
		||||
                <a class="s-icon-button icon-reset t-btn-reset"
 | 
			
		||||
                   ng-click="filters = { brightness: 100, contrast: 100 }"></a>
 | 
			
		||||
            </span>
 | 
			
		||||
@@ -33,14 +29,14 @@
 | 
			
		||||
 | 
			
		||||
        <div class="l-image-main-controlbar flex-elem l-flex-row">
 | 
			
		||||
            <div class="l-datetime-w flex-elem grows">
 | 
			
		||||
                <a class="s-button show-thumbs sm hidden icon-thumbs-strip"
 | 
			
		||||
                <a class="c-button show-thumbs sm hidden icon-thumbs-strip"
 | 
			
		||||
                    ng-click="showThumbsBubble = (showThumbsBubble) ? false:true"></a>
 | 
			
		||||
                <span class="l-time">{{imagery.getTime()}}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="h-local-controls flex-elem">
 | 
			
		||||
                <a class="s-button pause-play"
 | 
			
		||||
                <a class="c-button icon-pause pause-play"
 | 
			
		||||
                    ng-click="imagery.paused(!imagery.paused())"
 | 
			
		||||
                    ng-class="{ paused: imagery.paused() }"></a>
 | 
			
		||||
                    ng-class="{ 'is-paused': imagery.paused() }"></a>
 | 
			
		||||
                <a href=""
 | 
			
		||||
                    class="s-button l-mag s-mag vsm icon-reset"
 | 
			
		||||
                    ng-click="clipped = false"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,356 +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/LayoutController",
 | 
			
		||||
    "./src/FixedController",
 | 
			
		||||
    "./src/LayoutCompositionPolicy",
 | 
			
		||||
    './src/MCTTriggerModal',
 | 
			
		||||
    "./res/templates/layout.html",
 | 
			
		||||
    "./res/templates/fixed.html",
 | 
			
		||||
    "./res/templates/frame.html",
 | 
			
		||||
    "./res/templates/elements/telemetry.html",
 | 
			
		||||
    "./res/templates/elements/box.html",
 | 
			
		||||
    "./res/templates/elements/line.html",
 | 
			
		||||
    "./res/templates/elements/text.html",
 | 
			
		||||
    "./res/templates/elements/image.html",
 | 
			
		||||
    'legacyRegistry'
 | 
			
		||||
], function (
 | 
			
		||||
    LayoutController,
 | 
			
		||||
    FixedController,
 | 
			
		||||
    LayoutCompositionPolicy,
 | 
			
		||||
    MCTTriggerModal,
 | 
			
		||||
    layoutTemplate,
 | 
			
		||||
    fixedTemplate,
 | 
			
		||||
    frameTemplate,
 | 
			
		||||
    telemetryTemplate,
 | 
			
		||||
    boxTemplate,
 | 
			
		||||
    lineTemplate,
 | 
			
		||||
    textTemplate,
 | 
			
		||||
    imageTemplate,
 | 
			
		||||
    legacyRegistry
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
    legacyRegistry.register("platform/features/layout", {
 | 
			
		||||
        "name": "Layout components.",
 | 
			
		||||
        "description": "Plug in adding Layout capabilities.",
 | 
			
		||||
        "extensions": {
 | 
			
		||||
            "views": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "layout",
 | 
			
		||||
                    "name": "Display Layout",
 | 
			
		||||
                    "cssClass": "icon-layout",
 | 
			
		||||
                    "type": "layout",
 | 
			
		||||
                    "template": layoutTemplate,
 | 
			
		||||
                    "editable": true,
 | 
			
		||||
                    "uses": []
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed",
 | 
			
		||||
                    "name": "Fixed Position",
 | 
			
		||||
                    "cssClass": "icon-box-with-dashed-lines",
 | 
			
		||||
                    "type": "telemetry.panel",
 | 
			
		||||
                    "template": fixedTemplate,
 | 
			
		||||
                    "uses": [
 | 
			
		||||
                        "composition"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "toolbar": {
 | 
			
		||||
                        "sections": [
 | 
			
		||||
                            {
 | 
			
		||||
                                "items": [
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "method": "add",
 | 
			
		||||
                                        "cssClass": "icon-plus",
 | 
			
		||||
                                        "control": "menu-button",
 | 
			
		||||
                                        "text": "Add",
 | 
			
		||||
                                        "title": "Add",
 | 
			
		||||
                                        "description": "Add new items",
 | 
			
		||||
                                        "options": [
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Box",
 | 
			
		||||
                                                "cssClass": "icon-box",
 | 
			
		||||
                                                "key": "fixed.box"
 | 
			
		||||
                                            },
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Line",
 | 
			
		||||
                                                "cssClass": "icon-line-horz",
 | 
			
		||||
                                                "key": "fixed.line"
 | 
			
		||||
                                            },
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Text",
 | 
			
		||||
                                                "cssClass": "icon-T",
 | 
			
		||||
                                                "key": "fixed.text"
 | 
			
		||||
                                            },
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Image",
 | 
			
		||||
                                                "cssClass": "icon-image",
 | 
			
		||||
                                                "key": "fixed.image"
 | 
			
		||||
                                            }
 | 
			
		||||
                                        ]
 | 
			
		||||
                                    }
 | 
			
		||||
                                ]
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                "items": [
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "method": "order",
 | 
			
		||||
                                        "cssClass": "icon-layers",
 | 
			
		||||
                                        "control": "menu-button",
 | 
			
		||||
                                        "title": "Layering",
 | 
			
		||||
                                        "description": "Move the selected object above or below other objects",
 | 
			
		||||
                                        "options": [
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Move to Top",
 | 
			
		||||
                                                "cssClass": "icon-arrow-double-up",
 | 
			
		||||
                                                "key": "top"
 | 
			
		||||
                                            },
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Move Up",
 | 
			
		||||
                                                "cssClass": "icon-arrow-up",
 | 
			
		||||
                                                "key": "up"
 | 
			
		||||
                                            },
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Move Down",
 | 
			
		||||
                                                "cssClass": "icon-arrow-down",
 | 
			
		||||
                                                "key": "down"
 | 
			
		||||
                                            },
 | 
			
		||||
                                            {
 | 
			
		||||
                                                "name": "Move to Bottom",
 | 
			
		||||
                                                "cssClass": "icon-arrow-double-down",
 | 
			
		||||
                                                "key": "bottom"
 | 
			
		||||
                                            }
 | 
			
		||||
                                        ]
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "property": "fill",
 | 
			
		||||
                                        "cssClass": "icon-paint-bucket",
 | 
			
		||||
                                        "title": "Fill color",
 | 
			
		||||
                                        "description": "Set fill color",
 | 
			
		||||
                                        "control": "color"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "property": "stroke",
 | 
			
		||||
                                        "cssClass": "icon-line-horz",
 | 
			
		||||
                                        "title": "Border color",
 | 
			
		||||
                                        "description": "Set border color",
 | 
			
		||||
                                        "control": "color"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "property": "color",
 | 
			
		||||
                                        "cssClass": "icon-T",
 | 
			
		||||
                                        "title": "Text color",
 | 
			
		||||
                                        "description": "Set text color",
 | 
			
		||||
                                        "mandatory": true,
 | 
			
		||||
                                        "control": "color"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "property": "url",
 | 
			
		||||
                                        "cssClass": "icon-image",
 | 
			
		||||
                                        "control": "dialog-button",
 | 
			
		||||
                                        "title": "Image Properties",
 | 
			
		||||
                                        "description": "Edit image properties",
 | 
			
		||||
                                        "dialog": {
 | 
			
		||||
                                            "control": "textfield",
 | 
			
		||||
                                            "name": "Image URL",
 | 
			
		||||
                                            "cssClass": "l-input-lg",
 | 
			
		||||
                                            "required": true
 | 
			
		||||
                                        }
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "property": "text",
 | 
			
		||||
                                        "cssClass": "icon-gear",
 | 
			
		||||
                                        "control": "dialog-button",
 | 
			
		||||
                                        "title": "Text Properties",
 | 
			
		||||
                                        "description": "Edit text properties",
 | 
			
		||||
                                        "dialog": {
 | 
			
		||||
                                            "control": "textfield",
 | 
			
		||||
                                            "name": "Text",
 | 
			
		||||
                                            "required": true
 | 
			
		||||
                                        }
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "method": "showTitle",
 | 
			
		||||
                                        "cssClass": "icon-two-parts-both",
 | 
			
		||||
                                        "control": "button",
 | 
			
		||||
                                        "title": "Show title",
 | 
			
		||||
                                        "description": "Show telemetry element title"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "method": "hideTitle",
 | 
			
		||||
                                        "cssClass": "icon-two-parts-one-only",
 | 
			
		||||
                                        "control": "button",
 | 
			
		||||
                                        "title": "Hide title",
 | 
			
		||||
                                        "description": "Hide telemetry element title"
 | 
			
		||||
                                    }
 | 
			
		||||
                                ]
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                                "items": [
 | 
			
		||||
                                    {
 | 
			
		||||
                                        "method": "remove",
 | 
			
		||||
                                        "control": "button",
 | 
			
		||||
                                        "cssClass": "icon-trash",
 | 
			
		||||
                                        "title": "Delete",
 | 
			
		||||
                                        "description": "Delete the selected item"
 | 
			
		||||
                                    }
 | 
			
		||||
                                ]
 | 
			
		||||
                            }
 | 
			
		||||
                        ]
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "representations": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "frame",
 | 
			
		||||
                    "template": frameTemplate
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "directives": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "mctTriggerModal",
 | 
			
		||||
                    "implementation": MCTTriggerModal,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$document"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "controllers": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "LayoutController",
 | 
			
		||||
                    "implementation": LayoutController,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$scope",
 | 
			
		||||
                        "$element",
 | 
			
		||||
                        "openmct"
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "FixedController",
 | 
			
		||||
                    "implementation": FixedController,
 | 
			
		||||
                    "depends": [
 | 
			
		||||
                        "$scope",
 | 
			
		||||
                        "$q",
 | 
			
		||||
                        "dialogService",
 | 
			
		||||
                        "openmct",
 | 
			
		||||
                        "$element"
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "templates": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed.telemetry",
 | 
			
		||||
                    "template": telemetryTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed.box",
 | 
			
		||||
                    "template": boxTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed.line",
 | 
			
		||||
                    "template": lineTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed.text",
 | 
			
		||||
                    "template": textTemplate
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "fixed.image",
 | 
			
		||||
                    "template": imageTemplate
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "policies": [
 | 
			
		||||
                {
 | 
			
		||||
                    "category": "composition",
 | 
			
		||||
                    "implementation": LayoutCompositionPolicy
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "toolbars": [
 | 
			
		||||
                {
 | 
			
		||||
                    name: "Display Layout Toolbar",
 | 
			
		||||
                    key: "layout",
 | 
			
		||||
                    description: "A toolbar for objects inside a display layout.",
 | 
			
		||||
                    forSelection: function (selection) {
 | 
			
		||||
                        // Apply the layout toolbar if the selected object is inside a layout.
 | 
			
		||||
                        return (selection && selection[1] && selection[1].context.item.type === 'layout');
 | 
			
		||||
                    },
 | 
			
		||||
                    toolbar: function (selection) {
 | 
			
		||||
                        return [
 | 
			
		||||
                            {
 | 
			
		||||
                                control: "checkbox",
 | 
			
		||||
                                name: "Show frame",
 | 
			
		||||
                                domainObject: selection[1].context.item,
 | 
			
		||||
                                property: "configuration.layout.panels[" + selection[0].context.oldItem.id + "].hasFrame"
 | 
			
		||||
                            }
 | 
			
		||||
                        ];
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "types": [
 | 
			
		||||
                {
 | 
			
		||||
                    "key": "layout",
 | 
			
		||||
                    "name": "Display Layout",
 | 
			
		||||
                    "cssClass": "icon-layout",
 | 
			
		||||
                    "description": "Assemble other objects and components together into a reusable screen layout. Working in a simple canvas workspace, simply drag in the objects you want, position and size them. Save your design and view or edit it at any time.",
 | 
			
		||||
                    "priority": 900,
 | 
			
		||||
                    "features": "creation",
 | 
			
		||||
                    "model": {
 | 
			
		||||
                        "composition": [],
 | 
			
		||||
                        configuration: {
 | 
			
		||||
                            layout: {
 | 
			
		||||
                                panels: {
 | 
			
		||||
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    },
 | 
			
		||||
                    "properties": [
 | 
			
		||||
                        {
 | 
			
		||||
                            "name": "Layout Grid",
 | 
			
		||||
                            "control": "composite",
 | 
			
		||||
                            "pattern": "^(\\d*[1-9]\\d*)?$",
 | 
			
		||||
                            "items": [
 | 
			
		||||
                                {
 | 
			
		||||
                                    "name": "Horizontal grid (px)",
 | 
			
		||||
                                    "control": "textfield",
 | 
			
		||||
                                    "cssClass": "l-input-sm l-numeric"
 | 
			
		||||
                                },
 | 
			
		||||
                                {
 | 
			
		||||
                                    "name": "Vertical grid (px)",
 | 
			
		||||
                                    "control": "textfield",
 | 
			
		||||
                                    "cssClass": "l-input-sm l-numeric"
 | 
			
		||||
                                }
 | 
			
		||||
                            ],
 | 
			
		||||
                            "key": "layoutGrid",
 | 
			
		||||
                            "conversion": "number[]"
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                            "name": "Advanced",
 | 
			
		||||
                            "control": "textfield",
 | 
			
		||||
                            "key": "layoutAdvancedCss",
 | 
			
		||||
                            "cssClass": "l-input-lg"
 | 
			
		||||
                        }
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
@@ -1,31 +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.
 | 
			
		||||
-->
 | 
			
		||||
<svg ng-attr-width="{{ngModel.getGridSize()[0] * ngModel.width()}}"
 | 
			
		||||
     ng-attr-height="{{ngModel.getGridSize()[1] * ngModel.height()}}">
 | 
			
		||||
    <line ng-attr-x1="{{ngModel.getGridSize()[0] * ngModel.x1() + 1}}"
 | 
			
		||||
          ng-attr-y1="{{ngModel.getGridSize()[1] * ngModel.y1() + 1}}"
 | 
			
		||||
          ng-attr-x2="{{ngModel.getGridSize()[0] * ngModel.x2() + 1}}"
 | 
			
		||||
          ng-attr-y2="{{ngModel.getGridSize()[1] * ngModel.y2() + 1}}"
 | 
			
		||||
          ng-attr-stroke="{{ngModel.stroke()}}"
 | 
			
		||||
          stroke-width="2">
 | 
			
		||||
    </line>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 1.5 KiB  | 
@@ -1,27 +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
 | 
			
		||||
	class="l-fixed-position-text l-static-text"
 | 
			
		||||
	ng-style="{ background: ngModel.fill(), 'border-color': ngModel.stroke(), color: ngModel.color(), 'font-size': ngModel.size() }"
 | 
			
		||||
	>
 | 
			
		||||
    {{ngModel.element.text}}
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,62 +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 class="t-fixed-position l-fixed-position"
 | 
			
		||||
     ng-controller="FixedController as controller">
 | 
			
		||||
 | 
			
		||||
    <!-- Background grid -->
 | 
			
		||||
    <div class="l-grid-holder" ng-click="controller.bypassSelection($event)">
 | 
			
		||||
        <div class="l-grid l-grid-x"
 | 
			
		||||
             ng-if="!controller.getGridSize()[0] < 3"
 | 
			
		||||
             ng-style="{ 'background-size': controller.getGridSize() [0] + 'px 100%' }"></div>
 | 
			
		||||
        <div class="l-grid l-grid-y"
 | 
			
		||||
             ng-if="!controller.getGridSize()[1] < 3"
 | 
			
		||||
             ng-style="{ 'background-size': '100% ' + controller.getGridSize() [1] + 'px' }"></div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- Fixed position elements -->
 | 
			
		||||
    <div ng-repeat="element in controller.getElements()"
 | 
			
		||||
         class="l-fixed-position-item s-selectable s-moveable s-hover-border"
 | 
			
		||||
         ng-style="element.style"
 | 
			
		||||
         mct-selectable="controller.getContext(element)"
 | 
			
		||||
         mct-init-select="controller.shouldSelect(element)">
 | 
			
		||||
        <mct-include key="element.template"
 | 
			
		||||
                     parameters="{ gridSize: controller.getGridSize() }"
 | 
			
		||||
                     ng-model="element">
 | 
			
		||||
        </mct-include>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- Selection highlight, handles -->
 | 
			
		||||
    <span class="s-selected s-moveable" ng-if="controller.isElementSelected()">
 | 
			
		||||
        <div class="l-fixed-position-item t-edit-handle-holder"
 | 
			
		||||
             mct-drag-down="controller.moveHandle().startDrag()"
 | 
			
		||||
             mct-drag="controller.moveHandle().continueDrag(delta)"
 | 
			
		||||
             mct-drag-up="controller.endDrag()"
 | 
			
		||||
             ng-style="controller.getSelectedElementStyle()">
 | 
			
		||||
        </div>
 | 
			
		||||
        <div ng-repeat="handle in controller.handles()"
 | 
			
		||||
             class="l-fixed-position-item-handle edit-corner"
 | 
			
		||||
             ng-style="handle.style()"
 | 
			
		||||
             mct-drag-down="handle.startDrag()"
 | 
			
		||||
             mct-drag="handle.continueDrag(delta)"
 | 
			
		||||
             mct-drag-up="controller.endDrag(handle)">
 | 
			
		||||
        </div>
 | 
			
		||||
    </span>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -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 class="frame frame-template t-frame-inner abs has-local-controls t-object-type-{{ domainObject.getModel().type }}">
 | 
			
		||||
    <div class="abs object-browse-bar l-flex-row">
 | 
			
		||||
        <div class="left flex-elem l-flex-row grows">
 | 
			
		||||
            <mct-representation
 | 
			
		||||
                    key="'object-header-frame'"
 | 
			
		||||
                    mct-object="domainObject"
 | 
			
		||||
                    class="l-flex-row flex-elem object-header grows">
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="btn-bar right l-flex-row flex-elem flex-justify-end flex-fixed h-local-controls local-controls-hidden">
 | 
			
		||||
            <mct-representation
 | 
			
		||||
                    key="'switcher'"
 | 
			
		||||
                    ng-model="representation"
 | 
			
		||||
                    mct-object="domainObject">
 | 
			
		||||
            </mct-representation>
 | 
			
		||||
            <a class="s-button icon-expand t-btn-view-large"
 | 
			
		||||
               title="View large"
 | 
			
		||||
               mct-trigger-modal>
 | 
			
		||||
            </a>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="abs object-holder">
 | 
			
		||||
        <mct-representation
 | 
			
		||||
                key="representation.selected.key"
 | 
			
		||||
                mct-object="representation.selected.key && domainObject">
 | 
			
		||||
        </mct-representation>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -1,711 +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(
 | 
			
		||||
    [
 | 
			
		||||
        'lodash',
 | 
			
		||||
        './FixedProxy',
 | 
			
		||||
        './elements/ElementProxies',
 | 
			
		||||
        './FixedDragHandle',
 | 
			
		||||
        '../../../../src/api/objects/object-utils'
 | 
			
		||||
    ],
 | 
			
		||||
    function (
 | 
			
		||||
        _,
 | 
			
		||||
        FixedProxy,
 | 
			
		||||
        ElementProxies,
 | 
			
		||||
        FixedDragHandle,
 | 
			
		||||
        objectUtils
 | 
			
		||||
    ) {
 | 
			
		||||
 | 
			
		||||
        var DEFAULT_DIMENSIONS = [2, 1];
 | 
			
		||||
 | 
			
		||||
        // Convert from element x/y/width/height to an
 | 
			
		||||
        // appropriate ng-style argument, to position elements.
 | 
			
		||||
        function convertPosition(elementProxy) {
 | 
			
		||||
            if (elementProxy.getStyle) {
 | 
			
		||||
                return elementProxy.getStyle();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var gridSize = elementProxy.getGridSize();
 | 
			
		||||
 | 
			
		||||
            // Multiply position/dimensions by grid size
 | 
			
		||||
            return {
 | 
			
		||||
                left: (gridSize[0] * elementProxy.element.x) + 'px',
 | 
			
		||||
                top: (gridSize[1] * elementProxy.element.y) + 'px',
 | 
			
		||||
                width: (gridSize[0] * elementProxy.element.width) + 'px',
 | 
			
		||||
                height: (gridSize[1] * elementProxy.element.height) + 'px'
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The FixedController is responsible for supporting the
 | 
			
		||||
         * Fixed Position view. It arranges frames according to saved
 | 
			
		||||
         * configuration and provides methods for updating these based on
 | 
			
		||||
         * mouse movement.
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param {Scope} $scope the controller's Angular scope
 | 
			
		||||
         */
 | 
			
		||||
        function FixedController($scope, $q, dialogService, openmct, $element) {
 | 
			
		||||
            this.names = {}; // Cache names by ID
 | 
			
		||||
            this.values = {}; // Cache values by ID
 | 
			
		||||
            this.elementProxiesById = {};
 | 
			
		||||
            this.telemetryObjects = {};
 | 
			
		||||
            this.subscriptions = {};
 | 
			
		||||
            this.openmct = openmct;
 | 
			
		||||
            this.$element = $element;
 | 
			
		||||
            this.$scope = $scope;
 | 
			
		||||
            this.dialogService = dialogService;
 | 
			
		||||
            this.$q = $q;
 | 
			
		||||
            this.newDomainObject = $scope.domainObject.useCapability('adapter');
 | 
			
		||||
            this.fixedViewSelectable = false;
 | 
			
		||||
 | 
			
		||||
            var self = this;
 | 
			
		||||
            [
 | 
			
		||||
                'digest',
 | 
			
		||||
                'fetchHistoricalData',
 | 
			
		||||
                'getTelemetry',
 | 
			
		||||
                'setDisplayedValue',
 | 
			
		||||
                'subscribeToObject',
 | 
			
		||||
                'unsubscribe',
 | 
			
		||||
                'updateView'
 | 
			
		||||
            ].forEach(function (name) {
 | 
			
		||||
                self[name] = self[name].bind(self);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            // Decorate an element for display
 | 
			
		||||
            function makeProxyElement(element, index, elements) {
 | 
			
		||||
                var ElementProxy = ElementProxies[element.type],
 | 
			
		||||
                    e = ElementProxy && new ElementProxy(element, index, elements, self.gridSize);
 | 
			
		||||
 | 
			
		||||
                if (e) {
 | 
			
		||||
                    // Provide a displayable position (convert from grid to px)
 | 
			
		||||
                    e.style = convertPosition(e);
 | 
			
		||||
                    // Template names are same as type names, presently
 | 
			
		||||
                    e.template = element.type;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return e;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Decorate elements in the current configuration
 | 
			
		||||
            function refreshElements() {
 | 
			
		||||
                var elements = (((self.newDomainObject.configuration || {})['fixed-display'] || {}).elements || []);
 | 
			
		||||
 | 
			
		||||
                // Create the new proxies...
 | 
			
		||||
                self.elementProxies = elements.map(makeProxyElement);
 | 
			
		||||
 | 
			
		||||
                if (self.selectedElementProxy) {
 | 
			
		||||
                    // If selection is not in array, select parent.
 | 
			
		||||
                    // Otherwise, set the element to select after refresh.
 | 
			
		||||
                    var index = elements.indexOf(self.selectedElementProxy.element);
 | 
			
		||||
                    if (index === -1) {
 | 
			
		||||
                        self.$element[0].click();
 | 
			
		||||
                    } else if (!self.elementToSelectAfterRefresh) {
 | 
			
		||||
                        self.elementToSelectAfterRefresh = self.elementProxies[index].element;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // Finally, rebuild lists of elements by id to
 | 
			
		||||
                // facilitate faster update when new telemetry comes in.
 | 
			
		||||
                self.elementProxiesById = {};
 | 
			
		||||
                self.elementProxies.forEach(function (elementProxy) {
 | 
			
		||||
                    var id = elementProxy.id;
 | 
			
		||||
                    if (elementProxy.element.type === 'fixed.telemetry') {
 | 
			
		||||
                        // Provide it a cached name/value to avoid flashing
 | 
			
		||||
                        elementProxy.name = self.names[id];
 | 
			
		||||
                        elementProxy.value = self.values[id];
 | 
			
		||||
                        self.elementProxiesById[id] = self.elementProxiesById[id] || [];
 | 
			
		||||
                        self.elementProxiesById[id].push(elementProxy);
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Trigger a new query for telemetry data
 | 
			
		||||
            function updateDisplayBounds(bounds, isTick) {
 | 
			
		||||
                if (!isTick) {
 | 
			
		||||
                    //Reset values
 | 
			
		||||
                    self.values = {};
 | 
			
		||||
                    refreshElements();
 | 
			
		||||
 | 
			
		||||
                    //Fetch new data
 | 
			
		||||
                    Object.values(self.telemetryObjects).forEach(function (object) {
 | 
			
		||||
                        self.fetchHistoricalData(object);
 | 
			
		||||
                    });
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Add an element to this view
 | 
			
		||||
            function addElement(element) {
 | 
			
		||||
                var index;
 | 
			
		||||
                var elements = (((self.newDomainObject.configuration || {})['fixed-display'] || {}).elements || []);
 | 
			
		||||
                elements.push(element);
 | 
			
		||||
 | 
			
		||||
                if (self.selectedElementProxy) {
 | 
			
		||||
                    index = elements.indexOf(self.selectedElementProxy.element);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                self.mutate("configuration['fixed-display'].elements", elements);
 | 
			
		||||
                elements = (self.newDomainObject.configuration)['fixed-display'].elements || [];
 | 
			
		||||
                self.elementToSelectAfterRefresh = elements[elements.length - 1];
 | 
			
		||||
 | 
			
		||||
                if (self.selectedElementProxy) {
 | 
			
		||||
                    // Update the selected element with the new
 | 
			
		||||
                    // value since newDomainOject is mutated.
 | 
			
		||||
                    self.selectedElementProxy.element = elements[index];
 | 
			
		||||
                }
 | 
			
		||||
                refreshElements();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Position a panel after a drop event
 | 
			
		||||
            function handleDrop(e, id, position) {
 | 
			
		||||
                // Don't handle this event if it has already been handled
 | 
			
		||||
                if (e.defaultPrevented) {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                e.preventDefault();
 | 
			
		||||
 | 
			
		||||
                // Store the position of this element.
 | 
			
		||||
                // color is set to "" to let the CSS theme determine the default color
 | 
			
		||||
                addElement({
 | 
			
		||||
                    type: "fixed.telemetry",
 | 
			
		||||
                    x: Math.floor(position.x / self.gridSize[0]),
 | 
			
		||||
                    y: Math.floor(position.y / self.gridSize[1]),
 | 
			
		||||
                    id: id,
 | 
			
		||||
                    stroke: "transparent",
 | 
			
		||||
                    color: "",
 | 
			
		||||
                    titled: true,
 | 
			
		||||
                    width: DEFAULT_DIMENSIONS[0],
 | 
			
		||||
                    height: DEFAULT_DIMENSIONS[1],
 | 
			
		||||
                    useGrid: true
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                // Subscribe to the new object to get telemetry
 | 
			
		||||
                self.openmct.objects.get(id).then(function (object) {
 | 
			
		||||
                    self.getTelemetry(object);
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.elementProxies = [];
 | 
			
		||||
            this.addElement = addElement;
 | 
			
		||||
            this.refreshElements = refreshElements;
 | 
			
		||||
            this.fixedProxy = new FixedProxy(this.addElement, this.$q, this.dialogService);
 | 
			
		||||
 | 
			
		||||
            this.composition = this.openmct.composition.get(this.newDomainObject);
 | 
			
		||||
            this.composition.on('add', this.onCompositionAdd, this);
 | 
			
		||||
            this.composition.on('remove', this.onCompositionRemove, this);
 | 
			
		||||
            this.composition.load();
 | 
			
		||||
 | 
			
		||||
            // Position panes where they are dropped
 | 
			
		||||
            $scope.$on("mctDrop", handleDrop);
 | 
			
		||||
 | 
			
		||||
            $scope.$on("$destroy", this.destroy.bind(this));
 | 
			
		||||
 | 
			
		||||
            // Respond to external bounds changes
 | 
			
		||||
            this.openmct.time.on("bounds", updateDisplayBounds);
 | 
			
		||||
 | 
			
		||||
            this.openmct.selection.on('change', this.setSelection.bind(this));
 | 
			
		||||
            this.$element.on('click', this.bypassSelection.bind(this));
 | 
			
		||||
            this.unlisten = this.openmct.objects.observe(this.newDomainObject, '*', function (obj) {
 | 
			
		||||
                this.newDomainObject = JSON.parse(JSON.stringify(obj));
 | 
			
		||||
                this.updateElementPositions(this.newDomainObject.layoutGrid);
 | 
			
		||||
            }.bind(this));
 | 
			
		||||
 | 
			
		||||
            this.updateElementPositions(this.newDomainObject.layoutGrid);
 | 
			
		||||
            refreshElements();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.updateElementPositions = function (layoutGrid) {
 | 
			
		||||
            this.gridSize = layoutGrid;
 | 
			
		||||
 | 
			
		||||
            this.elementProxies.forEach(function (elementProxy) {
 | 
			
		||||
                elementProxy.setGridSize(this.gridSize);
 | 
			
		||||
                elementProxy.style = convertPosition(elementProxy);
 | 
			
		||||
            }.bind(this));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.onCompositionAdd = function (object) {
 | 
			
		||||
            this.getTelemetry(object);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.onCompositionRemove = function (identifier) {
 | 
			
		||||
            // Defer mutation of newDomainObject to prevent mutating an
 | 
			
		||||
            // outdated version since this is triggered by a composition change.
 | 
			
		||||
            setTimeout(function () {
 | 
			
		||||
                var id = objectUtils.makeKeyString(identifier);
 | 
			
		||||
                var elements = this.newDomainObject.configuration['fixed-display'].elements || [];
 | 
			
		||||
                var newElements = elements.filter(function (proxy) {
 | 
			
		||||
                    return proxy.id !== id;
 | 
			
		||||
                });
 | 
			
		||||
                this.mutate("configuration['fixed-display'].elements", newElements);
 | 
			
		||||
 | 
			
		||||
                if (this.subscriptions[id]) {
 | 
			
		||||
                    this.subscriptions[id]();
 | 
			
		||||
                    delete this.subscriptions[id];
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                delete this.telemetryObjects[id];
 | 
			
		||||
                this.refreshElements();
 | 
			
		||||
            }.bind(this));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Removes an element from the view.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {Object} elementProxy the element proxy to remove.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.remove = function (elementProxy) {
 | 
			
		||||
            var element = elementProxy.element;
 | 
			
		||||
            var elements = this.newDomainObject.configuration['fixed-display'].elements || [];
 | 
			
		||||
            elements.splice(elements.indexOf(element), 1);
 | 
			
		||||
 | 
			
		||||
            if (element.type === 'fixed.telemetry') {
 | 
			
		||||
                this.newDomainObject.composition = this.newDomainObject.composition.filter(function (identifier) {
 | 
			
		||||
                    return objectUtils.makeKeyString(identifier) !== element.id;
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.mutate("configuration['fixed-display'].elements", elements);
 | 
			
		||||
            this.refreshElements();
 | 
			
		||||
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Adds a new element to the view.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {string} type the type of element to add. Supported types are:
 | 
			
		||||
         * `fixed.image`
 | 
			
		||||
         * `fixed.box`
 | 
			
		||||
         * `fixed.text`
 | 
			
		||||
         * `fixed.line`
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.add = function (type) {
 | 
			
		||||
            this.fixedProxy.add(type);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Change the display order of the element proxy.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.order = function (elementProxy, position) {
 | 
			
		||||
            var elements = elementProxy.order(position);
 | 
			
		||||
 | 
			
		||||
            // Find the selected element index in the updated array.
 | 
			
		||||
            var selectedElemenetIndex = elements.indexOf(this.selectedElementProxy.element);
 | 
			
		||||
 | 
			
		||||
            this.mutate("configuration['fixed-display'].elements", elements);
 | 
			
		||||
            elements = (this.newDomainObject.configuration)['fixed-display'].elements || [];
 | 
			
		||||
 | 
			
		||||
            // Update the selected element with the new
 | 
			
		||||
            // value since newDomainOject is mutated.
 | 
			
		||||
            this.selectedElementProxy.element = elements[selectedElemenetIndex];
 | 
			
		||||
            this.refreshElements();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.generateDragHandle = function (elementProxy, elementHandle) {
 | 
			
		||||
            var index = this.elementProxies.indexOf(elementProxy);
 | 
			
		||||
 | 
			
		||||
            if (elementHandle) {
 | 
			
		||||
                elementHandle.element = elementProxy.element;
 | 
			
		||||
                elementProxy = elementHandle;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return new FixedDragHandle(
 | 
			
		||||
                elementProxy,
 | 
			
		||||
                "configuration['fixed-display'].elements[" + index + "]",
 | 
			
		||||
                this
 | 
			
		||||
            );
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.generateDragHandles = function (elementProxy) {
 | 
			
		||||
            return elementProxy.handles().map(function (handle) {
 | 
			
		||||
                return this.generateDragHandle(elementProxy, handle);
 | 
			
		||||
            }, this);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.updateSelectionStyle = function () {
 | 
			
		||||
            this.selectedElementProxy.style = convertPosition(this.selectedElementProxy);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.setSelection = function (selectable) {
 | 
			
		||||
            var selection = selectable[0];
 | 
			
		||||
 | 
			
		||||
            if (this.selectionListeners) {
 | 
			
		||||
                this.selectionListeners.forEach(function (l) {
 | 
			
		||||
                    l();
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.selectionListeners = [];
 | 
			
		||||
 | 
			
		||||
            if (!selection) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (selection.context.elementProxy) {
 | 
			
		||||
                this.selectedElementProxy = selection.context.elementProxy;
 | 
			
		||||
                this.attachSelectionListeners();
 | 
			
		||||
                this.mvHandle = this.generateDragHandle(this.selectedElementProxy);
 | 
			
		||||
                this.resizeHandles = this.generateDragHandles(this.selectedElementProxy);
 | 
			
		||||
            } else {
 | 
			
		||||
                // Make fixed view selectable if it's not already.
 | 
			
		||||
                if (!this.fixedViewSelectable && selectable.length === 1) {
 | 
			
		||||
                    this.fixedViewSelectable = true;
 | 
			
		||||
                    selection.context.fixedController = this;
 | 
			
		||||
                    this.openmct.selection.select(selection);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                this.resizeHandles = [];
 | 
			
		||||
                this.mvHandle = undefined;
 | 
			
		||||
                this.selectedElementProxy = undefined;
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.attachSelectionListeners = function () {
 | 
			
		||||
            var index = this.elementProxies.indexOf(this.selectedElementProxy);
 | 
			
		||||
            var path = "configuration['fixed-display'].elements[" + index + "]";
 | 
			
		||||
 | 
			
		||||
            this.selectionListeners.push(this.openmct.objects.observe(this.newDomainObject, path + ".useGrid", function (newValue) {
 | 
			
		||||
                if (this.selectedElementProxy.useGrid() !== newValue) {
 | 
			
		||||
                    this.selectedElementProxy.useGrid(newValue);
 | 
			
		||||
                    this.updateSelectionStyle();
 | 
			
		||||
                    this.openmct.objects.mutate(this.newDomainObject, path, this.selectedElementProxy.element);
 | 
			
		||||
                }
 | 
			
		||||
            }.bind(this)));
 | 
			
		||||
            [
 | 
			
		||||
                "width",
 | 
			
		||||
                "height",
 | 
			
		||||
                "stroke",
 | 
			
		||||
                "fill",
 | 
			
		||||
                "x",
 | 
			
		||||
                "y",
 | 
			
		||||
                "x1",
 | 
			
		||||
                "y1",
 | 
			
		||||
                "x2",
 | 
			
		||||
                "y2",
 | 
			
		||||
                "color",
 | 
			
		||||
                "size",
 | 
			
		||||
                "text",
 | 
			
		||||
                "titled"
 | 
			
		||||
            ].forEach(function (property) {
 | 
			
		||||
                this.selectionListeners.push(this.openmct.objects.observe(this.newDomainObject, path + "." + property, function (newValue) {
 | 
			
		||||
                    this.selectedElementProxy.element[property] = newValue;
 | 
			
		||||
                    this.updateSelectionStyle();
 | 
			
		||||
                }.bind(this)));
 | 
			
		||||
            }.bind(this));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.destroy = function () {
 | 
			
		||||
            this.unsubscribe();
 | 
			
		||||
            this.unlisten();
 | 
			
		||||
            this.openmct.time.off("bounds", this.updateDisplayBounds);
 | 
			
		||||
            this.openmct.selection.off("change", this.setSelection);
 | 
			
		||||
            this.composition.off('add', this.onCompositionAdd, this);
 | 
			
		||||
            this.composition.off('remove', this.onCompositionRemove, this);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * A rate-limited digest function. Caps digests at 60Hz
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.digest = function () {
 | 
			
		||||
            var self = this;
 | 
			
		||||
 | 
			
		||||
            if (!this.digesting) {
 | 
			
		||||
                this.digesting = true;
 | 
			
		||||
                requestAnimationFrame(function () {
 | 
			
		||||
                    self.$scope.$digest();
 | 
			
		||||
                    self.digesting = false;
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Unsubscribe all listeners
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.unsubscribe = function () {
 | 
			
		||||
            Object.values(this.subscriptions).forEach(function (unsubscribeFunc) {
 | 
			
		||||
                unsubscribeFunc();
 | 
			
		||||
            });
 | 
			
		||||
            this.subscriptions = {};
 | 
			
		||||
            this.telemetryObjects = {};
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Subscribe to the given domain object
 | 
			
		||||
         * @private
 | 
			
		||||
         * @param {object} object  Domain object to subscribe to
 | 
			
		||||
         * @returns {object} The provided object, for chaining.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.subscribeToObject = function (object) {
 | 
			
		||||
            var self = this;
 | 
			
		||||
            var timeAPI = this.openmct.time;
 | 
			
		||||
            var id = objectUtils.makeKeyString(object.identifier);
 | 
			
		||||
            this.subscriptions[id] = self.openmct.telemetry.subscribe(object, function (datum) {
 | 
			
		||||
                if (timeAPI.clock() !== undefined) {
 | 
			
		||||
                    self.updateView(object, datum);
 | 
			
		||||
                }
 | 
			
		||||
            }, {});
 | 
			
		||||
 | 
			
		||||
            return object;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Print the values from the given datum against the provided object in the view.
 | 
			
		||||
         * @private
 | 
			
		||||
         * @param {object} telemetryObject The domain object associated with the given telemetry data
 | 
			
		||||
         * @param {object} datum The telemetry datum containing the values to print
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.updateView = function (telemetryObject, datum) {
 | 
			
		||||
            var metadata = this.openmct.telemetry.getMetadata(telemetryObject);
 | 
			
		||||
            var valueMetadata = this.chooseValueMetadataToDisplay(metadata);
 | 
			
		||||
            var formattedTelemetryValue = this.getFormattedTelemetryValueForKey(valueMetadata, datum);
 | 
			
		||||
            var limitEvaluator = this.openmct.telemetry.limitEvaluator(telemetryObject);
 | 
			
		||||
            var alarm = limitEvaluator && limitEvaluator.evaluate(datum, valueMetadata);
 | 
			
		||||
 | 
			
		||||
            this.setDisplayedValue(
 | 
			
		||||
                telemetryObject,
 | 
			
		||||
                formattedTelemetryValue,
 | 
			
		||||
                alarm && alarm.cssClass
 | 
			
		||||
            );
 | 
			
		||||
            this.digest();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.getFormattedTelemetryValueForKey = function (valueMetadata, datum) {
 | 
			
		||||
            var formatter = this.openmct.telemetry.getValueFormatter(valueMetadata);
 | 
			
		||||
 | 
			
		||||
            return formatter.format(datum);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.chooseValueMetadataToDisplay = function (metadata) {
 | 
			
		||||
            // If there is a range value, show that preferentially
 | 
			
		||||
            var valueMetadata = metadata.valuesForHints(['range'])[0];
 | 
			
		||||
 | 
			
		||||
            // If no range is defined, default to the highest priority non time-domain data.
 | 
			
		||||
            if (valueMetadata === undefined) {
 | 
			
		||||
                var valuesOrderedByPriority = metadata.values();
 | 
			
		||||
                valueMetadata = valuesOrderedByPriority.filter(function (values) {
 | 
			
		||||
                    return !(values.hints.domain);
 | 
			
		||||
                })[0];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return valueMetadata;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Request the last historical data point for the given domain object
 | 
			
		||||
         * @param {object} object
 | 
			
		||||
         * @returns {object} the provided object for chaining.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.fetchHistoricalData = function (object) {
 | 
			
		||||
            var bounds = this.openmct.time.bounds();
 | 
			
		||||
            var self = this;
 | 
			
		||||
 | 
			
		||||
            self.openmct.telemetry.request(object, {start: bounds.start, end: bounds.end, size: 1})
 | 
			
		||||
                .then(function (data) {
 | 
			
		||||
                    if (data.length > 0) {
 | 
			
		||||
                        self.updateView(object, data[data.length - 1]);
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            return object;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Print a value to the onscreen element associated with a given telemetry object.
 | 
			
		||||
         * @private
 | 
			
		||||
         * @param {object} telemetryObject The telemetry object associated with the value
 | 
			
		||||
         * @param {string | number} value The value to print to screen
 | 
			
		||||
         * @param {string} [cssClass] an optional CSS class to apply to the onscreen element.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.setDisplayedValue = function (telemetryObject, value, cssClass) {
 | 
			
		||||
            var id = objectUtils.makeKeyString(telemetryObject.identifier);
 | 
			
		||||
            var self = this;
 | 
			
		||||
 | 
			
		||||
            (self.elementProxiesById[id] || []).forEach(function (element) {
 | 
			
		||||
                self.names[id] = telemetryObject.name;
 | 
			
		||||
                self.values[id] = value;
 | 
			
		||||
                element.name = self.names[id];
 | 
			
		||||
                element.value = self.values[id];
 | 
			
		||||
                element.cssClass = cssClass;
 | 
			
		||||
            });
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.getTelemetry = function (domainObject) {
 | 
			
		||||
            var id = objectUtils.makeKeyString(domainObject.identifier);
 | 
			
		||||
 | 
			
		||||
            if (this.subscriptions[id]) {
 | 
			
		||||
                this.subscriptions[id]();
 | 
			
		||||
                delete this.subscriptions[id];
 | 
			
		||||
            }
 | 
			
		||||
            delete this.telemetryObjects[id];
 | 
			
		||||
 | 
			
		||||
            if (!this.openmct.telemetry.isTelemetryObject(domainObject)) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Initialize display
 | 
			
		||||
            this.telemetryObjects[id] = domainObject;
 | 
			
		||||
            this.setDisplayedValue(domainObject, "");
 | 
			
		||||
 | 
			
		||||
            return Promise.resolve(domainObject)
 | 
			
		||||
                .then(this.fetchHistoricalData)
 | 
			
		||||
                .then(this.subscribeToObject);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get the size of the grid, in pixels. The returned array
 | 
			
		||||
         * is in the form `[x, y]`.
 | 
			
		||||
         * @returns {number[]} the grid size
 | 
			
		||||
         * @memberof platform/features/layout.FixedController#
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.getGridSize = function () {
 | 
			
		||||
            return this.gridSize;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get an array of elements in this panel; these are
 | 
			
		||||
         * decorated proxies for both selection and display.
 | 
			
		||||
         * @returns {Array} elements in this panel
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.getElements = function () {
 | 
			
		||||
            return this.elementProxies;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Checks if the element should be selected or not.
 | 
			
		||||
         *
 | 
			
		||||
         * @param elementProxy the element to check
 | 
			
		||||
         * @returns {boolean} true if the element should be selected.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.shouldSelect = function (elementProxy) {
 | 
			
		||||
            if (elementProxy.element === this.elementToSelectAfterRefresh) {
 | 
			
		||||
                delete this.elementToSelectAfterRefresh;
 | 
			
		||||
                return true;
 | 
			
		||||
            } else {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Checks if an element is currently selected.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns {boolean} true if an element is selected.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.isElementSelected = function () {
 | 
			
		||||
            return (this.selectedElementProxy) ? true : false;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Gets the style for the selected element.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns {string} element style
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.getSelectedElementStyle = function () {
 | 
			
		||||
            return (this.selectedElementProxy) ? this.selectedElementProxy.style : undefined;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Gets the selected element.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns the selected element
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.getSelectedElement = function () {
 | 
			
		||||
            return this.selectedElementProxy;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Prevents the event from bubbling up if drag is in progress.
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.bypassSelection = function ($event) {
 | 
			
		||||
            if (this.dragInProgress) {
 | 
			
		||||
                if ($event) {
 | 
			
		||||
                    $event.stopPropagation();
 | 
			
		||||
                }
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get drag handles.
 | 
			
		||||
         * @returns {platform/features/layout.FixedDragHandle[]}
 | 
			
		||||
         *          drag handles for the current selection
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.handles = function () {
 | 
			
		||||
            return this.resizeHandles;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get the handle to handle dragging to reposition an element.
 | 
			
		||||
         * @returns {platform/features/layout.FixedDragHandle} the drag handle
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.moveHandle = function () {
 | 
			
		||||
            return this.mvHandle;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Gets the selection context.
 | 
			
		||||
         *
 | 
			
		||||
         * @param elementProxy the element proxy
 | 
			
		||||
         * @returns {object} the context object which includes elementProxy
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.getContext = function (elementProxy) {
 | 
			
		||||
            return {
 | 
			
		||||
                elementProxy: elementProxy,
 | 
			
		||||
                fixedController: this
 | 
			
		||||
            };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * End drag.
 | 
			
		||||
         *
 | 
			
		||||
         * @param handle the resize handle
 | 
			
		||||
         */
 | 
			
		||||
        FixedController.prototype.endDrag = function (handle) {
 | 
			
		||||
            this.dragInProgress = true;
 | 
			
		||||
 | 
			
		||||
            setTimeout(function () {
 | 
			
		||||
                this.dragInProgress = false;
 | 
			
		||||
            }.bind(this), 0);
 | 
			
		||||
 | 
			
		||||
            if (handle) {
 | 
			
		||||
                handle.endDrag();
 | 
			
		||||
            } else {
 | 
			
		||||
                this.moveHandle().endDrag();
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        FixedController.prototype.mutate = function (path, value) {
 | 
			
		||||
            this.openmct.objects.mutate(this.newDomainObject, path, value);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return FixedController;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,110 +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 () {
 | 
			
		||||
 | 
			
		||||
        // Drag handle dimensions
 | 
			
		||||
        var DRAG_HANDLE_SIZE = [6, 6];
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Template-displayable drag handle for an element in fixed
 | 
			
		||||
         * position mode.
 | 
			
		||||
         *
 | 
			
		||||
         * @param elementHandle the element handle
 | 
			
		||||
         * @param configPath the configuration path of an element
 | 
			
		||||
         * @param {Object} fixedControl the fixed controller
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function FixedDragHandle(elementHandle, configPath, fixedControl) {
 | 
			
		||||
            this.elementHandle = elementHandle;
 | 
			
		||||
            this.configPath = configPath;
 | 
			
		||||
            this.fixedControl = fixedControl;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get a CSS style to position this drag handle.
 | 
			
		||||
         *
 | 
			
		||||
         * @returns CSS style object (for `ng-style`)
 | 
			
		||||
         * @memberof platform/features/layout.FixedDragHandle#
 | 
			
		||||
         */
 | 
			
		||||
        FixedDragHandle.prototype.style = function () {
 | 
			
		||||
            var gridSize = this.elementHandle.getGridSize();
 | 
			
		||||
 | 
			
		||||
            // Adjust from grid to pixel coordinates
 | 
			
		||||
            var x = this.elementHandle.x() * gridSize[0],
 | 
			
		||||
                y = this.elementHandle.y() * gridSize[1];
 | 
			
		||||
 | 
			
		||||
            // Convert to a CSS style centered on that point
 | 
			
		||||
            return {
 | 
			
		||||
                left: (x - DRAG_HANDLE_SIZE[0] / 2) + 'px',
 | 
			
		||||
                top: (y - DRAG_HANDLE_SIZE[1] / 2) + 'px',
 | 
			
		||||
                width: DRAG_HANDLE_SIZE[0] + 'px',
 | 
			
		||||
                height: DRAG_HANDLE_SIZE[1] + 'px'
 | 
			
		||||
            };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Start a drag gesture. This should be called when a drag
 | 
			
		||||
         * begins to track initial state.
 | 
			
		||||
         */
 | 
			
		||||
        FixedDragHandle.prototype.startDrag = function () {
 | 
			
		||||
            // Cache initial x/y positions
 | 
			
		||||
            this.dragging = {
 | 
			
		||||
                x: this.elementHandle.x(),
 | 
			
		||||
                y: this.elementHandle.y()
 | 
			
		||||
            };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Continue a drag gesture; update x/y positions.
 | 
			
		||||
         *
 | 
			
		||||
         * @param {number[]} delta x/y pixel difference since drag started
 | 
			
		||||
         */
 | 
			
		||||
        FixedDragHandle.prototype.continueDrag = function (delta) {
 | 
			
		||||
            var gridSize = this.elementHandle.getGridSize();
 | 
			
		||||
 | 
			
		||||
            if (this.dragging) {
 | 
			
		||||
                // Update x/y positions (snapping to grid)
 | 
			
		||||
                var newX = this.dragging.x + Math.round(delta[0] / gridSize[0]);
 | 
			
		||||
                var newY = this.dragging.y + Math.round(delta[1] / gridSize[1]);
 | 
			
		||||
 | 
			
		||||
                this.elementHandle.x(Math.max(0, newX));
 | 
			
		||||
                this.elementHandle.y(Math.max(0, newY));
 | 
			
		||||
                this.fixedControl.updateSelectionStyle();
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * End a drag gesture. This should be called when a drag
 | 
			
		||||
         * concludes to trigger commit of changes.
 | 
			
		||||
         */
 | 
			
		||||
        FixedDragHandle.prototype.endDrag = function () {
 | 
			
		||||
            this.dragging = undefined;
 | 
			
		||||
            this.fixedControl.mutate(this.configPath, this.elementHandle.element);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return FixedDragHandle;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,76 +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(
 | 
			
		||||
    ['./elements/ElementFactory'],
 | 
			
		||||
    function (ElementFactory) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Proxy for configuring a fixed position view via the toolbar.
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param {Function} addElementCallback callback to invoke when
 | 
			
		||||
         *        elements are created
 | 
			
		||||
         * @param $q Angular's $q, for promise-handling
 | 
			
		||||
         * @param {DialogService} dialogService dialog service to use
 | 
			
		||||
         *        when adding a new element will require user input
 | 
			
		||||
         */
 | 
			
		||||
        function FixedProxy(addElementCallback, $q, dialogService) {
 | 
			
		||||
            this.factory = new ElementFactory(dialogService);
 | 
			
		||||
            this.$q = $q;
 | 
			
		||||
            this.addElementCallback = addElementCallback;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Add a new visual element to this view. Supported types are:
 | 
			
		||||
         *
 | 
			
		||||
         * * `fixed.image`
 | 
			
		||||
         * * `fixed.box`
 | 
			
		||||
         * * `fixed.text`
 | 
			
		||||
         * * `fixed.line`
 | 
			
		||||
         *
 | 
			
		||||
         * @param {string} type the type of element to add
 | 
			
		||||
         */
 | 
			
		||||
        FixedProxy.prototype.add = function (type) {
 | 
			
		||||
            var addElementCallback = this.addElementCallback;
 | 
			
		||||
 | 
			
		||||
            // Place a configured element into the view configuration
 | 
			
		||||
            function addElement(element) {
 | 
			
		||||
                // Configure common properties of the element
 | 
			
		||||
                element.x = element.x || 0;
 | 
			
		||||
                element.y = element.y || 0;
 | 
			
		||||
                element.width = element.width || 1;
 | 
			
		||||
                element.height = element.height || 1;
 | 
			
		||||
                element.type = type;
 | 
			
		||||
                element.useGrid = true;
 | 
			
		||||
 | 
			
		||||
                // Finally, add it to the view's configuration
 | 
			
		||||
                addElementCallback(element);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Defer creation to the factory
 | 
			
		||||
            this.$q.when(this.factory.createElement(type)).then(addElement);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return FixedProxy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,115 +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 () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Handles drag interactions on frames in layouts. This will
 | 
			
		||||
         * provides new positions/dimensions for frames based on
 | 
			
		||||
         * relative pixel positions provided; these will take into account
 | 
			
		||||
         * the grid size (in a snap-to sense) and will enforce some minimums
 | 
			
		||||
         * on both position and dimensions.
 | 
			
		||||
         *
 | 
			
		||||
         * The provided position and dimensions factors will determine
 | 
			
		||||
         * whether this is a move or a resize, and what type of resize it
 | 
			
		||||
         * will be. For instance, a position factor of [1, 1]
 | 
			
		||||
         * will move a frame along with the mouse as the drag
 | 
			
		||||
         * proceeds, while a dimension factor of [0, 0] will leave
 | 
			
		||||
         * dimensions unchanged. Combining these in different
 | 
			
		||||
         * ways results in different handles; a position factor of
 | 
			
		||||
         * [1, 0] and a dimensions factor of [-1, 0] will implement
 | 
			
		||||
         * a left-edge resize, as the horizontal position will move
 | 
			
		||||
         * with the mouse while the horizontal dimensions shrink in
 | 
			
		||||
         * kind (and vertical properties remain unmodified.)
 | 
			
		||||
         *
 | 
			
		||||
         * @param {object} rawPosition the initial position/dimensions
 | 
			
		||||
         *                 of the frame being interacted with
 | 
			
		||||
         * @param {number[]} posFactor the position factor
 | 
			
		||||
         * @param {number[]} dimFactor the dimensions factor
 | 
			
		||||
         * @param {number[]} the size of each grid element, in pixels
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         */
 | 
			
		||||
        function LayoutDrag(rawPosition, posFactor, dimFactor, gridSize) {
 | 
			
		||||
            this.rawPosition = rawPosition;
 | 
			
		||||
            this.posFactor = posFactor;
 | 
			
		||||
            this.dimFactor = dimFactor;
 | 
			
		||||
            this.gridSize = gridSize;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Convert a delta from pixel coordinates to grid coordinates,
 | 
			
		||||
        // rounding to whole-number grid coordinates.
 | 
			
		||||
        function toGridDelta(gridSize, pixelDelta) {
 | 
			
		||||
            return pixelDelta.map(function (v, i) {
 | 
			
		||||
                return Math.round(v / gridSize[i]);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Utility function to perform element-by-element multiplication
 | 
			
		||||
        function multiply(array, factors) {
 | 
			
		||||
            return array.map(function (v, i) {
 | 
			
		||||
                return v * factors[i];
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Utility function to perform element-by-element addition
 | 
			
		||||
        function add(array, other) {
 | 
			
		||||
            return array.map(function (v, i) {
 | 
			
		||||
                return v + other[i];
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Utility function to perform element-by-element max-choosing
 | 
			
		||||
        function max(array, other) {
 | 
			
		||||
            return array.map(function (v, i) {
 | 
			
		||||
                return Math.max(v, other[i]);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get a new position object in grid coordinates, with
 | 
			
		||||
         * position and dimensions both offset appropriately
 | 
			
		||||
         * according to the factors supplied in the constructor.
 | 
			
		||||
         * @param {number[]} pixelDelta the offset from the
 | 
			
		||||
         *        original position, in pixels
 | 
			
		||||
         */
 | 
			
		||||
        LayoutDrag.prototype.getAdjustedPosition = function (pixelDelta) {
 | 
			
		||||
            var gridDelta = toGridDelta(this.gridSize, pixelDelta);
 | 
			
		||||
            return {
 | 
			
		||||
                position: max(add(
 | 
			
		||||
                    this.rawPosition.position,
 | 
			
		||||
                    multiply(gridDelta, this.posFactor)
 | 
			
		||||
                ), [0, 0]),
 | 
			
		||||
                dimensions: max(add(
 | 
			
		||||
                    this.rawPosition.dimensions,
 | 
			
		||||
                    multiply(gridDelta, this.dimFactor)
 | 
			
		||||
                ), [1, 1])
 | 
			
		||||
            };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return LayoutDrag;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,105 +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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
define([
 | 
			
		||||
    'zepto',
 | 
			
		||||
    '../../../commonUI/general/src/services/Overlay'
 | 
			
		||||
], function (
 | 
			
		||||
    $,
 | 
			
		||||
    Overlay
 | 
			
		||||
) {
 | 
			
		||||
    /**
 | 
			
		||||
     * MCT Trigger Modal is intended for use in only one location: inside the
 | 
			
		||||
     * object-header to allow views in a layout to be popped out in a modal.
 | 
			
		||||
     * Users can close the modal and go back to normal, and everything generally
 | 
			
		||||
     * just works fine.
 | 
			
		||||
     *
 | 
			
		||||
     * This code is sensitive to how our html is constructed-- particularly with
 | 
			
		||||
     * how it locates the the container of an element in a layout. However, it
 | 
			
		||||
     * should be able to handle slight relocations so long as it is always a
 | 
			
		||||
     * descendent of a `.frame` element.
 | 
			
		||||
     */
 | 
			
		||||
    function MCTTriggerModal($document) {
 | 
			
		||||
 | 
			
		||||
        function link($scope, $element) {
 | 
			
		||||
            var actions = $scope.domainObject.getCapability('action'),
 | 
			
		||||
                notebookAction = actions.getActions({key: 'notebook-new-entry'})[0];
 | 
			
		||||
 | 
			
		||||
            var frame = $element.parent();
 | 
			
		||||
 | 
			
		||||
            for (var i = 0; i < 10; i++) {
 | 
			
		||||
                if (frame.hasClass('frame')) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                frame = frame.parent();
 | 
			
		||||
            }
 | 
			
		||||
            if (!frame.hasClass('frame')) {
 | 
			
		||||
                $element.remove();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            frame = frame[0];
 | 
			
		||||
 | 
			
		||||
            var layoutContainer = frame.parentElement;
 | 
			
		||||
 | 
			
		||||
            var notebookButton = notebookAction ?
 | 
			
		||||
                [
 | 
			
		||||
                    {
 | 
			
		||||
                        class: 'icon-notebook new-notebook-entry',
 | 
			
		||||
                        title: 'New Notebook Entry',
 | 
			
		||||
                        clickHandler: function (event) {
 | 
			
		||||
                            event.stopPropagation();
 | 
			
		||||
                            notebookAction.perform();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                ] : [];
 | 
			
		||||
 | 
			
		||||
            var overlayService = new Overlay ({
 | 
			
		||||
                $document: $document,
 | 
			
		||||
                $scope: $scope,
 | 
			
		||||
                $element: frame,
 | 
			
		||||
                overlayWillMount: function () {
 | 
			
		||||
                    $(frame).removeClass('frame frame-template');
 | 
			
		||||
                    layoutContainer.removeChild(frame);
 | 
			
		||||
                },
 | 
			
		||||
                overlayDidUnmount: function () {
 | 
			
		||||
                    $(frame).addClass('frame frame-template');
 | 
			
		||||
                    layoutContainer.appendChild(frame);
 | 
			
		||||
                },
 | 
			
		||||
                browseBarButtons: notebookButton
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $element.on('click', overlayService.toggleOverlay);
 | 
			
		||||
            $scope.$on('$destroy', function () {
 | 
			
		||||
                $element.off('click', overlayService.toggleOverlay);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
            restrict: 'A',
 | 
			
		||||
            link: link
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return MCTTriggerModal;
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
@@ -1,58 +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 () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Utility function for creating getter-setter functions,
 | 
			
		||||
         * since these are frequently useful for element proxies.
 | 
			
		||||
         *
 | 
			
		||||
         * An optional third argument may be supplied in order to
 | 
			
		||||
         * constrain or modify arguments when using as a setter;
 | 
			
		||||
         * this argument is a function which takes two arguments
 | 
			
		||||
         * (the current value for the property, and the requested
 | 
			
		||||
         * new value.) This is useful when values need to be kept
 | 
			
		||||
         * in certain ranges; specifically, to keep x/y positions
 | 
			
		||||
         * non-negative in a fixed position view.
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param {Object} object the object to get/set values upon
 | 
			
		||||
         * @param {string} key the property to get/set
 | 
			
		||||
         * @param {function} [updater] function used to process updates
 | 
			
		||||
         */
 | 
			
		||||
        function AccessorMutator(object, key, updater) {
 | 
			
		||||
            return function (value) {
 | 
			
		||||
                if (arguments.length > 0) {
 | 
			
		||||
                    object[key] = updater ?
 | 
			
		||||
                        updater(value, object[key]) :
 | 
			
		||||
                        value;
 | 
			
		||||
                }
 | 
			
		||||
                return object[key];
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return AccessorMutator;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,61 +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(
 | 
			
		||||
    ['./ElementProxy', './AccessorMutator'],
 | 
			
		||||
    function (ElementProxy, AccessorMutator) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Selection proxy for Box elements in a fixed position view.
 | 
			
		||||
         * Also serves as a superclass for Text elements, since those
 | 
			
		||||
         * elements have a superset of Box properties.
 | 
			
		||||
         *
 | 
			
		||||
         * Note that arguments here are meant to match those expected
 | 
			
		||||
         * by `Array.prototype.map`
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param element the fixed position element, as stored in its
 | 
			
		||||
         *        configuration
 | 
			
		||||
         * @param index the element's index within its array
 | 
			
		||||
         * @param {number[]} gridSize the current layout grid size in [x,y] from
 | 
			
		||||
         * @param {Array} elements the full array of elements
 | 
			
		||||
         */
 | 
			
		||||
        function BoxProxy(element, index, elements, gridSize) {
 | 
			
		||||
            var proxy = new ElementProxy(element, index, elements, gridSize);
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get/set this element's fill color. (Omitting the
 | 
			
		||||
             * argument makes this act as a getter.)
 | 
			
		||||
             * @method
 | 
			
		||||
             * @param {string} fill the new fill color
 | 
			
		||||
             * @returns {string} the fill color
 | 
			
		||||
             * @memberof platform/features/layout.BoxProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.fill = new AccessorMutator(element, 'fill');
 | 
			
		||||
 | 
			
		||||
            return proxy;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return BoxProxy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,114 +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 () {
 | 
			
		||||
 | 
			
		||||
        var INITIAL_STATES = {
 | 
			
		||||
                "fixed.image": {
 | 
			
		||||
                    stroke: "transparent"
 | 
			
		||||
                },
 | 
			
		||||
                "fixed.box": {
 | 
			
		||||
                    fill: "#717171",
 | 
			
		||||
                    border: "transparent",
 | 
			
		||||
                    stroke: "transparent"
 | 
			
		||||
                },
 | 
			
		||||
                "fixed.line": {
 | 
			
		||||
                    x: 5,
 | 
			
		||||
                    y: 9,
 | 
			
		||||
                    x2: 6,
 | 
			
		||||
                    y2: 6,
 | 
			
		||||
                    stroke: "#717171"
 | 
			
		||||
                },
 | 
			
		||||
                "fixed.text": {
 | 
			
		||||
                    fill: "transparent",
 | 
			
		||||
                    stroke: "transparent"
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            DIALOGS = {
 | 
			
		||||
                "fixed.image": {
 | 
			
		||||
                    name: "Image Properties",
 | 
			
		||||
                    sections: [
 | 
			
		||||
                        {
 | 
			
		||||
                            rows: [
 | 
			
		||||
                                {
 | 
			
		||||
                                    key: "url",
 | 
			
		||||
                                    control: "textfield",
 | 
			
		||||
                                    name: "Image URL",
 | 
			
		||||
                                    "cssClass": "l-input-lg",
 | 
			
		||||
                                    required: true
 | 
			
		||||
                                }
 | 
			
		||||
                            ]
 | 
			
		||||
                        }
 | 
			
		||||
                    ]
 | 
			
		||||
                },
 | 
			
		||||
                "fixed.text": {
 | 
			
		||||
                    name: "Text Element Properties",
 | 
			
		||||
                    sections: [
 | 
			
		||||
                        {
 | 
			
		||||
                            rows: [
 | 
			
		||||
                                {
 | 
			
		||||
                                    key: "text",
 | 
			
		||||
                                    control: "textfield",
 | 
			
		||||
                                    name: "Text",
 | 
			
		||||
                                    required: true
 | 
			
		||||
                                }
 | 
			
		||||
                            ]
 | 
			
		||||
                        }
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * The ElementFactory creates new instances of elements for the
 | 
			
		||||
         * fixed position view, prompting for user input where necessary.
 | 
			
		||||
         * @param {DialogService} dialogService service to request user input
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function ElementFactory(dialogService) {
 | 
			
		||||
            this.dialogService = dialogService;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Create a new element for the fixed position view.
 | 
			
		||||
         * @param {string} type the type of element to create
 | 
			
		||||
         * @returns {Promise|object} the created element, or a promise
 | 
			
		||||
         *          for that element
 | 
			
		||||
         */
 | 
			
		||||
        ElementFactory.prototype.createElement = function (type) {
 | 
			
		||||
            var initialState = INITIAL_STATES[type] || {};
 | 
			
		||||
 | 
			
		||||
            // Clone that state
 | 
			
		||||
            initialState = JSON.parse(JSON.stringify(initialState));
 | 
			
		||||
 | 
			
		||||
            // Show a dialog to configure initial state, if appropriate
 | 
			
		||||
            return DIALOGS[type] ? this.dialogService.getUserInput(
 | 
			
		||||
                DIALOGS[type],
 | 
			
		||||
                initialState
 | 
			
		||||
            ) : initialState;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return ElementFactory;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,35 +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(
 | 
			
		||||
    ['./TelemetryProxy', './ImageProxy', './LineProxy', './BoxProxy', './TextProxy'],
 | 
			
		||||
    function (TelemetryProxy, ImageProxy, LineProxy, BoxProxy, TextProxy) {
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
            "fixed.telemetry": TelemetryProxy,
 | 
			
		||||
            "fixed.line": LineProxy,
 | 
			
		||||
            "fixed.box": BoxProxy,
 | 
			
		||||
            "fixed.image": ImageProxy,
 | 
			
		||||
            "fixed.text": TextProxy
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,209 +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(
 | 
			
		||||
    ['./AccessorMutator', './ResizeHandle', './UnitAccessorMutator'],
 | 
			
		||||
    function (AccessorMutator, ResizeHandle, UnitAccessorMutator) {
 | 
			
		||||
 | 
			
		||||
        // Index deltas for changes in order
 | 
			
		||||
        var ORDERS = {
 | 
			
		||||
            top: Number.POSITIVE_INFINITY,
 | 
			
		||||
            up: 1,
 | 
			
		||||
            down: -1,
 | 
			
		||||
            bottom: Number.NEGATIVE_INFINITY
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        // Mininmum pixel height and width for objects
 | 
			
		||||
        var MIN_WIDTH = 10;
 | 
			
		||||
        var MIN_HEIGHT = 10;
 | 
			
		||||
 | 
			
		||||
        // Ensure a value is non-negative (for x/y setters)
 | 
			
		||||
        function clamp(value) {
 | 
			
		||||
            return Math.max(value, 0);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Abstract superclass for other classes which provide useful
 | 
			
		||||
         * interfaces upon an elements in a fixed position view.
 | 
			
		||||
         * This handles the generic operations (e.g. remove) so that
 | 
			
		||||
         * subclasses only need to implement element-specific behaviors.
 | 
			
		||||
         *
 | 
			
		||||
         * Note that arguments here are meant to match those expected
 | 
			
		||||
         * by `Array.prototype.map`
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param element the fixed position element, as stored in its
 | 
			
		||||
         *        configuration
 | 
			
		||||
         * @param index the element's index within its array
 | 
			
		||||
         * @param {Array} elements the full array of elements
 | 
			
		||||
         * @param {number[]} gridSize the current layout grid size in [x,y] from
 | 
			
		||||
         */
 | 
			
		||||
        function ElementProxy(element, index, elements, gridSize) {
 | 
			
		||||
            /**
 | 
			
		||||
             * The element as stored in the view configuration.
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.element = element;
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * The current grid size of the layout.
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.gridSize = gridSize || [1,1]; //Ensure a reasonable default
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get and/or set the x position of this element.
 | 
			
		||||
             * Units are in fixed position grid space.
 | 
			
		||||
             * @param {number} [x] the new x position (if setting)
 | 
			
		||||
             * @returns {number} the x position
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.x = new AccessorMutator(element, 'x', clamp);
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get and/or set the y position of this element.
 | 
			
		||||
             * Units are in fixed position grid space.
 | 
			
		||||
             * @param {number} [y] the new y position (if setting)
 | 
			
		||||
             * @returns {number} the y position
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.y = new AccessorMutator(element, 'y', clamp);
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get and/or set the stroke color of this element.
 | 
			
		||||
             * @param {string} [stroke] the new stroke color (if setting)
 | 
			
		||||
             * @returns {string} the stroke color
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.stroke = new AccessorMutator(element, 'stroke');
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get and/or set the width of this element.
 | 
			
		||||
             * Units are in fixed position grid space.
 | 
			
		||||
             * @param {number} [w] the new width (if setting)
 | 
			
		||||
             * @returns {number} the width
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.width = new AccessorMutator(element, 'width');
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get and/or set the height of this element.
 | 
			
		||||
             * Units are in fixed position grid space.
 | 
			
		||||
             * @param {number} [h] the new height (if setting)
 | 
			
		||||
             * @returns {number} the height
 | 
			
		||||
             * @memberof platform/features/layout.ElementProxy#
 | 
			
		||||
             */
 | 
			
		||||
            this.height = new AccessorMutator(element, 'height');
 | 
			
		||||
 | 
			
		||||
            this.useGrid = new UnitAccessorMutator(this);
 | 
			
		||||
            this.index = index;
 | 
			
		||||
            this.elements = elements;
 | 
			
		||||
            this.resizeHandles = [new ResizeHandle(this, this.element)];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Change the display order of this element.
 | 
			
		||||
         * @param {string} o where to move this element;
 | 
			
		||||
         *        one of "top", "up", "down", or "bottom"
 | 
			
		||||
         * @return {Array} the full array of elements
 | 
			
		||||
         */
 | 
			
		||||
        ElementProxy.prototype.order = function (o) {
 | 
			
		||||
            var index = this.index,
 | 
			
		||||
                elements = this.elements,
 | 
			
		||||
                element = this.element,
 | 
			
		||||
                delta = ORDERS[o] || 0,
 | 
			
		||||
                desired = Math.max(
 | 
			
		||||
                    Math.min(index + delta, elements.length - 1),
 | 
			
		||||
                    0
 | 
			
		||||
                );
 | 
			
		||||
            // Move to the desired index, if this is a change
 | 
			
		||||
            if ((desired !== index) && (elements[index] === element)) {
 | 
			
		||||
                // Splice out the current element
 | 
			
		||||
                elements.splice(index, 1);
 | 
			
		||||
                // Splice it back in at the correct index
 | 
			
		||||
                elements.splice(desired, 0, element);
 | 
			
		||||
                // Track change in index (proxy should be recreated
 | 
			
		||||
                // anyway, but be consistent)
 | 
			
		||||
                this.index = desired;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return elements;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get handles to control specific features of this element,
 | 
			
		||||
         * e.g. corner size.
 | 
			
		||||
         * @return {platform/features/layout.ElementHandle[]} handles
 | 
			
		||||
         *         for moving/resizing this element
 | 
			
		||||
         */
 | 
			
		||||
        ElementProxy.prototype.handles = function () {
 | 
			
		||||
            return this.resizeHandles;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Returns which grid size the element is currently using.
 | 
			
		||||
         * @return {number[]} The current grid size in [x,y] form if the element
 | 
			
		||||
         *                    is currently using the grid, [1,1] if it is using
 | 
			
		||||
         *                    pixels.
 | 
			
		||||
         */
 | 
			
		||||
        ElementProxy.prototype.getGridSize = function () {
 | 
			
		||||
            var gridSize;
 | 
			
		||||
            // Default to using the grid if useGrid was not defined
 | 
			
		||||
            if (typeof this.element.useGrid === 'undefined') {
 | 
			
		||||
                this.element.useGrid = true;
 | 
			
		||||
            }
 | 
			
		||||
            if (this.element.useGrid) {
 | 
			
		||||
                gridSize = this.gridSize;
 | 
			
		||||
            } else {
 | 
			
		||||
                gridSize = [1,1];
 | 
			
		||||
            }
 | 
			
		||||
            return gridSize;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Set the current grid size stored by this element proxy
 | 
			
		||||
         * @param {number[]} gridSize The current layout grid size in [x,y] form
 | 
			
		||||
         */
 | 
			
		||||
        ElementProxy.prototype.setGridSize = function (gridSize) {
 | 
			
		||||
            this.gridSize = gridSize;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get the current minimum element width in grid units
 | 
			
		||||
         * @return {number} The current minimum element width
 | 
			
		||||
         */
 | 
			
		||||
        ElementProxy.prototype.getMinWidth = function () {
 | 
			
		||||
            return Math.ceil(MIN_WIDTH / this.getGridSize()[0]);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Get the current minimum element height in grid units
 | 
			
		||||
         * @return {number} The current minimum element height
 | 
			
		||||
         */
 | 
			
		||||
        ElementProxy.prototype.getMinHeight = function () {
 | 
			
		||||
            return Math.ceil(MIN_HEIGHT / this.getGridSize()[1]);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return ElementProxy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,58 +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(
 | 
			
		||||
    ['./ElementProxy', './AccessorMutator'],
 | 
			
		||||
    function (ElementProxy, AccessorMutator) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Selection proxy for Image elements in a fixed position view.
 | 
			
		||||
         *
 | 
			
		||||
         * Note that arguments here are meant to match those expected
 | 
			
		||||
         * by `Array.prototype.map`
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param element the fixed position element, as stored in its
 | 
			
		||||
         *        configuration
 | 
			
		||||
         * @param index the element's index within its array
 | 
			
		||||
         * @param {Array} elements the full array of elements
 | 
			
		||||
         * @param {number[]} gridSize the current layout grid size in [x,y] from
 | 
			
		||||
         * @augments {platform/features/layout.ElementProxy}
 | 
			
		||||
         */
 | 
			
		||||
        function ImageProxy(element, index, elements, gridSize) {
 | 
			
		||||
            var proxy = new ElementProxy(element, index, elements, gridSize);
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get and/or set the displayed text of this element.
 | 
			
		||||
             * @param {string} [text] the new text (if setting)
 | 
			
		||||
             * @returns {string} the text
 | 
			
		||||
             * @memberof platform/features/layout.ImageProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.url = new AccessorMutator(element, 'url');
 | 
			
		||||
 | 
			
		||||
            return proxy;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return ImageProxy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,94 +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 () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Handle for changing x/y position of a line's end point.
 | 
			
		||||
         * This is used to support drag handles for line elements
 | 
			
		||||
         * in a fixed position view. Field names for opposite ends
 | 
			
		||||
         * are provided to avoid zero-length lines.
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param element the line element
 | 
			
		||||
         * @param {string} xProperty field which stores x position
 | 
			
		||||
         * @param {string} yProperty field which stores y position
 | 
			
		||||
         * @param {string} xOther field which stores x of other end
 | 
			
		||||
         * @param {string} yOther field which stores y of other end
 | 
			
		||||
         * @implements {platform/features/layout.ElementHandle}
 | 
			
		||||
         */
 | 
			
		||||
        function LineHandle(element, elementProxy, xProperty, yProperty, xOther, yOther) {
 | 
			
		||||
            this.elementProxy = elementProxy;
 | 
			
		||||
            this.element = element;
 | 
			
		||||
            this.xProperty = xProperty;
 | 
			
		||||
            this.yProperty = yProperty;
 | 
			
		||||
            this.xOther = xOther;
 | 
			
		||||
            this.yOther = yOther;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        LineHandle.prototype.x = function (value) {
 | 
			
		||||
            var element = this.element,
 | 
			
		||||
                xProperty = this.xProperty,
 | 
			
		||||
                yProperty = this.yProperty,
 | 
			
		||||
                xOther = this.xOther,
 | 
			
		||||
                yOther = this.yOther;
 | 
			
		||||
 | 
			
		||||
            if (arguments.length > 0) {
 | 
			
		||||
                // Ensure we stay in view
 | 
			
		||||
                value = Math.max(value, 0);
 | 
			
		||||
                // Make sure end points will still be different
 | 
			
		||||
                if (element[yOther] !== element[yProperty] ||
 | 
			
		||||
                    element[xOther] !== value) {
 | 
			
		||||
                    element[xProperty] = value;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return element[xProperty];
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        LineHandle.prototype.y = function (value) {
 | 
			
		||||
            var element = this.element,
 | 
			
		||||
                xProperty = this.xProperty,
 | 
			
		||||
                yProperty = this.yProperty,
 | 
			
		||||
                xOther = this.xOther,
 | 
			
		||||
                yOther = this.yOther;
 | 
			
		||||
 | 
			
		||||
            if (arguments.length > 0) {
 | 
			
		||||
                // Ensure we stay in view
 | 
			
		||||
                value = Math.max(value, 0);
 | 
			
		||||
                // Make sure end points will still be different
 | 
			
		||||
                if (element[xOther] !== element[xProperty] ||
 | 
			
		||||
                    element[yOther] !== value) {
 | 
			
		||||
                    element[yProperty] = value;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return element[yProperty];
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        LineHandle.prototype.getGridSize = function () {
 | 
			
		||||
            return this.elementProxy.getGridSize();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return LineHandle;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,171 +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(
 | 
			
		||||
    ['./ElementProxy', './LineHandle', './AccessorMutator'],
 | 
			
		||||
    function (ElementProxy, LineHandle, AccessorMutator) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Selection/diplay proxy for line elements of a fixed position
 | 
			
		||||
         * view.
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param element the fixed position element, as stored in its
 | 
			
		||||
         *        configuration
 | 
			
		||||
         * @param index the element's index within its array
 | 
			
		||||
         * @param {Array} elements the full array of elements
 | 
			
		||||
         * @param {number[]} gridSize the current layout grid size in [x,y] from
 | 
			
		||||
         * @augments {platform/features/layout.ElementProxy}
 | 
			
		||||
         */
 | 
			
		||||
        function LineProxy(element, index, elements, gridSize) {
 | 
			
		||||
            var proxy = new ElementProxy(element, index, elements, gridSize),
 | 
			
		||||
                handles = [
 | 
			
		||||
                    new LineHandle(element, proxy, 'x', 'y', 'x2', 'y2'),
 | 
			
		||||
                    new LineHandle(element, proxy, 'x2', 'y2', 'x', 'y')
 | 
			
		||||
                ];
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Gets style specific to line proxy.
 | 
			
		||||
             */
 | 
			
		||||
            proxy.getStyle = function () {
 | 
			
		||||
                var layoutGridSize = proxy.getGridSize();
 | 
			
		||||
 | 
			
		||||
                return {
 | 
			
		||||
                    left: (layoutGridSize[0] * proxy.x()) + 'px',
 | 
			
		||||
                    top: (layoutGridSize[1] * proxy.y()) + 'px',
 | 
			
		||||
                    width: (layoutGridSize[0] * proxy.width()) + 'px',
 | 
			
		||||
                    height: (layoutGridSize[1] * proxy.height()) + 'px'
 | 
			
		||||
                };
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the top-left x coordinate, in grid space, of
 | 
			
		||||
             * this line's bounding box.
 | 
			
		||||
             * @returns {number} the x coordinate
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.x = function (v) {
 | 
			
		||||
                var x = Math.min(element.x, element.x2),
 | 
			
		||||
                    delta = Math.max(v, 0) - x;
 | 
			
		||||
                if (arguments.length > 0 && delta) {
 | 
			
		||||
                    element.x += delta;
 | 
			
		||||
                    element.x2 += delta;
 | 
			
		||||
                }
 | 
			
		||||
                return x;
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the top-left y coordinate, in grid space, of
 | 
			
		||||
             * this line's bounding box.
 | 
			
		||||
             * @returns {number} the y coordinate
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.y = function (v) {
 | 
			
		||||
                var y = Math.min(element.y, element.y2),
 | 
			
		||||
                    delta = Math.max(v, 0) - y;
 | 
			
		||||
                if (arguments.length > 0 && delta) {
 | 
			
		||||
                    element.y += delta;
 | 
			
		||||
                    element.y2 += delta;
 | 
			
		||||
                }
 | 
			
		||||
                return y;
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the width, in grid space, of
 | 
			
		||||
             * this line's bounding box.
 | 
			
		||||
             * @returns {number} the width
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.width = function () {
 | 
			
		||||
                return Math.max(Math.abs(element.x - element.x2), 1);
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the height, in grid space, of
 | 
			
		||||
             * this line's bounding box.
 | 
			
		||||
             * @returns {number} the height
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.height = function () {
 | 
			
		||||
                return Math.max(Math.abs(element.y - element.y2), 1);
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the x position, in grid units relative to
 | 
			
		||||
             * the top-left corner, of the first point in this line
 | 
			
		||||
             * segment.
 | 
			
		||||
             * @returns {number} the x position of the first point
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.x1 = function () {
 | 
			
		||||
                return element.x - proxy.x();
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the y position, in grid units relative to
 | 
			
		||||
             * the top-left corner, of the first point in this line
 | 
			
		||||
             * segment.
 | 
			
		||||
             * @returns {number} the y position of the first point
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.y1 = function () {
 | 
			
		||||
                return element.y - proxy.y();
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the x position, in grid units relative to
 | 
			
		||||
             * the top-left corner, of the second point in this line
 | 
			
		||||
             * segment.
 | 
			
		||||
             * @returns {number} the x position of the second point
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.x2 = function () {
 | 
			
		||||
                return element.x2 - proxy.x();
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get the y position, in grid units relative to
 | 
			
		||||
             * the top-left corner, of the second point in this line
 | 
			
		||||
             * segment.
 | 
			
		||||
             * @returns {number} the y position of the second point
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.y2 = function () {
 | 
			
		||||
                return element.y2 - proxy.y();
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            /**
 | 
			
		||||
             * Get element handles for changing the position of end
 | 
			
		||||
             * points of this line.
 | 
			
		||||
             * @returns {LineHandle[]} line handles for both end points
 | 
			
		||||
             * @memberof platform/features/layout.LineProxy#
 | 
			
		||||
             */
 | 
			
		||||
            proxy.handles = function () {
 | 
			
		||||
                return handles;
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            return proxy;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return LineProxy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -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 () {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * @interface platform/features/layout.ElementHandle
 | 
			
		||||
         * @private
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Handle for changing width/height properties of an element.
 | 
			
		||||
         * This is used to support drag handles for different
 | 
			
		||||
         * element types in a fixed position view.
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         */
 | 
			
		||||
        function ResizeHandle(elementProxy, element) {
 | 
			
		||||
            this.elementProxy = elementProxy;
 | 
			
		||||
            this.element = element;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ResizeHandle.prototype.x = function (value) {
 | 
			
		||||
            var element = this.element;
 | 
			
		||||
            if (arguments.length > 0) {
 | 
			
		||||
                element.width = Math.max(
 | 
			
		||||
                    this.elementProxy.getMinWidth(),
 | 
			
		||||
                    value - element.x
 | 
			
		||||
                );
 | 
			
		||||
            }
 | 
			
		||||
            return element.x + element.width;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        ResizeHandle.prototype.y = function (value) {
 | 
			
		||||
            var element = this.element;
 | 
			
		||||
            if (arguments.length > 0) {
 | 
			
		||||
                element.height = Math.max(
 | 
			
		||||
                    this.elementProxy.getMinHeight(),
 | 
			
		||||
                    value - element.y
 | 
			
		||||
                );
 | 
			
		||||
            }
 | 
			
		||||
            return element.y + element.height;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        ResizeHandle.prototype.getGridSize = function () {
 | 
			
		||||
            return this.elementProxy.getGridSize();
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return ResizeHandle;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
@@ -1,56 +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(
 | 
			
		||||
    ['./TextProxy'],
 | 
			
		||||
    function (TextProxy) {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Selection proxy for telemetry elements in a fixed position view.
 | 
			
		||||
         *
 | 
			
		||||
         * Note that arguments here are meant to match those expected
 | 
			
		||||
         * by `Array.prototype.map`
 | 
			
		||||
         *
 | 
			
		||||
         * @memberof platform/features/layout
 | 
			
		||||
         * @constructor
 | 
			
		||||
         * @param element the fixed position element, as stored in its
 | 
			
		||||
         *        configuration
 | 
			
		||||
         * @param index the element's index within its array
 | 
			
		||||
         * @param {Array} elements the full array of elements
 | 
			
		||||
         * @param {number[]} gridSize the current layout grid size in [x,y] form
 | 
			
		||||
         * @augments {platform/features/layout.ElementProxy}
 | 
			
		||||
         */
 | 
			
		||||
        function TelemetryProxy(element, index, elements, gridSize) {
 | 
			
		||||
            var proxy = new TextProxy(element, index, elements, gridSize);
 | 
			
		||||
 | 
			
		||||
            // Expose the domain object identifier
 | 
			
		||||
            proxy.id = element.id;
 | 
			
		||||
 | 
			
		||||
            // Don't expose text configuration
 | 
			
		||||
            delete proxy.text;
 | 
			
		||||
 | 
			
		||||
            return proxy;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return TelemetryProxy;
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user