mirror of
https://github.com/nasa/openmct.git
synced 2025-06-28 19:53:02 +00:00
Compare commits
31 Commits
ui-various
...
fix-lint-e
Author | SHA1 | Date | |
---|---|---|---|
1e64cf4657 | |||
60ba2c23e6 | |||
606aaf29c7 | |||
61c31454ac | |||
8b715f331c | |||
d6950a0976 | |||
68f3436792 | |||
4414161faf | |||
5f1dc5d5e2 | |||
7477536478 | |||
c13b07e648 | |||
2ecff75da5 | |||
ff5b88b544 | |||
9b7a986475 | |||
c054914a9c | |||
69b6f8afa9 | |||
45164a2f68 | |||
b189a887e6 | |||
71abfbc336 | |||
ee690545fb | |||
fcf3c76aa1 | |||
5dbd77d10c | |||
43515ca84e | |||
54fe881e71 | |||
7c32700b69 | |||
e98d0cc7c5 | |||
bba3306a98 | |||
35743577c9 | |||
7b2b682eea | |||
51ab52e9f1 | |||
acc24ccd72 |
@ -23,9 +23,9 @@
|
|||||||
/*global module,process*/
|
/*global module,process*/
|
||||||
|
|
||||||
const devMode = process.env.NODE_ENV !== 'production';
|
const devMode = process.env.NODE_ENV !== 'production';
|
||||||
|
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'];
|
||||||
|
|
||||||
module.exports = (config) => {
|
module.exports = (config) => {
|
||||||
|
|
||||||
const webpackConfig = require('./webpack.config.js');
|
const webpackConfig = require('./webpack.config.js');
|
||||||
delete webpackConfig.output;
|
delete webpackConfig.output;
|
||||||
|
|
||||||
@ -50,11 +50,17 @@ module.exports = (config) => {
|
|||||||
'coverage',
|
'coverage',
|
||||||
'html'
|
'html'
|
||||||
],
|
],
|
||||||
browsers: ['ChromeHeadless'],
|
browsers: browsers,
|
||||||
|
customLaunchers: {
|
||||||
|
ChromeDebugging: {
|
||||||
|
base: 'Chrome',
|
||||||
|
flags: ['--remote-debugging-port=9222'],
|
||||||
|
debug: true
|
||||||
|
}
|
||||||
|
},
|
||||||
colors: true,
|
colors: true,
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
|
|
||||||
coverageReporter: {
|
coverageReporter: {
|
||||||
dir: process.env.CIRCLE_ARTIFACTS ?
|
dir: process.env.CIRCLE_ARTIFACTS ?
|
||||||
process.env.CIRCLE_ARTIFACTS + '/coverage' :
|
process.env.CIRCLE_ARTIFACTS + '/coverage' :
|
||||||
@ -66,22 +72,18 @@ module.exports = (config) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// HTML test reporting.
|
// HTML test reporting.
|
||||||
htmlReporter: {
|
htmlReporter: {
|
||||||
outputDir: "dist/reports/tests",
|
outputDir: "dist/reports/tests",
|
||||||
preserveDescribeNesting: true,
|
preserveDescribeNesting: true,
|
||||||
foldAll: false
|
foldAll: false
|
||||||
},
|
},
|
||||||
|
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
// add webpack as preprocessor
|
// add webpack as preprocessor
|
||||||
'platform/**/*Spec.js': [ 'webpack' ],
|
'platform/**/*Spec.js': [ 'webpack', 'sourcemap' ],
|
||||||
'src/**/*Spec.js': [ 'webpack' ]
|
'src/**/*Spec.js': [ 'webpack', 'sourcemap' ]
|
||||||
},
|
},
|
||||||
|
|
||||||
webpack: webpackConfig,
|
webpack: webpackConfig,
|
||||||
|
|
||||||
webpackMiddleware: {
|
webpackMiddleware: {
|
||||||
stats: 'errors-only',
|
stats: 'errors-only',
|
||||||
logLevel: 'warn'
|
logLevel: 'warn'
|
||||||
@ -89,4 +91,3 @@ module.exports = (config) => {
|
|||||||
singleRun: true
|
singleRun: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*global module,BUILD_CONSTANTS*/
|
/*global module*/
|
||||||
|
|
||||||
const matcher = /\/openmct.js$/;
|
const matcher = /\/openmct.js$/;
|
||||||
if (document.currentScript) {
|
if (document.currentScript) {
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
"karma-coverage": "^1.1.2",
|
"karma-coverage": "^1.1.2",
|
||||||
"karma-html-reporter": "^0.2.7",
|
"karma-html-reporter": "^0.2.7",
|
||||||
"karma-jasmine": "^1.1.2",
|
"karma-jasmine": "^1.1.2",
|
||||||
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-webpack": "^3.0.0",
|
"karma-webpack": "^3.0.0",
|
||||||
"location-bar": "^3.0.1",
|
"location-bar": "^3.0.1",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
@ -79,6 +80,7 @@
|
|||||||
"build:dev": "webpack",
|
"build:dev": "webpack",
|
||||||
"build:watch": "webpack --watch",
|
"build:watch": "webpack --watch",
|
||||||
"test": "karma start --single-run",
|
"test": "karma start --single-run",
|
||||||
|
"test-debug": "NODE_ENV=debug karma start --no-single-run",
|
||||||
"test:watch": "karma start --no-single-run",
|
"test:watch": "karma start --no-single-run",
|
||||||
"verify": "concurrently 'npm:test' 'npm:lint'",
|
"verify": "concurrently 'npm:test' 'npm:lint'",
|
||||||
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
||||||
|
@ -21,12 +21,6 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
"./src/BrowseController",
|
|
||||||
"./src/PaneController",
|
|
||||||
"./src/InspectorPaneController",
|
|
||||||
"./src/BrowseObjectController",
|
|
||||||
"./src/MenuArrowController",
|
|
||||||
"./src/ObjectHeaderController",
|
|
||||||
"./src/navigation/NavigationService",
|
"./src/navigation/NavigationService",
|
||||||
"./src/navigation/NavigateAction",
|
"./src/navigation/NavigateAction",
|
||||||
"./src/navigation/OrphanNavigationHandler",
|
"./src/navigation/OrphanNavigationHandler",
|
||||||
@ -41,12 +35,6 @@ define([
|
|||||||
"./res/templates/browse/inspector-region.html",
|
"./res/templates/browse/inspector-region.html",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
BrowseController,
|
|
||||||
PaneController,
|
|
||||||
InspectorPaneController,
|
|
||||||
BrowseObjectController,
|
|
||||||
MenuArrowController,
|
|
||||||
ObjectHeaderController,
|
|
||||||
NavigationService,
|
NavigationService,
|
||||||
NavigateAction,
|
NavigateAction,
|
||||||
OrphanNavigationHandler,
|
OrphanNavigationHandler,
|
||||||
@ -73,70 +61,6 @@ define([
|
|||||||
"priority": "fallback"
|
"priority": "fallback"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"controllers": [
|
|
||||||
{
|
|
||||||
"key": "BrowseController",
|
|
||||||
"implementation": BrowseController,
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"$route",
|
|
||||||
"$location",
|
|
||||||
"objectService",
|
|
||||||
"navigationService",
|
|
||||||
"urlService",
|
|
||||||
"DEFAULT_PATH"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "PaneController",
|
|
||||||
"implementation": PaneController,
|
|
||||||
"priority": "preferred",
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"agentService",
|
|
||||||
"$window",
|
|
||||||
"$location",
|
|
||||||
"$attrs",
|
|
||||||
"navigationService"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "BrowseObjectController",
|
|
||||||
"implementation": BrowseObjectController,
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"$location",
|
|
||||||
"$route"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "MenuArrowController",
|
|
||||||
"implementation": MenuArrowController,
|
|
||||||
"depends": [
|
|
||||||
"$scope"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "InspectorPaneController",
|
|
||||||
"implementation": InspectorPaneController,
|
|
||||||
"priority": "preferred",
|
|
||||||
"depends": [
|
|
||||||
"$scope",
|
|
||||||
"agentService",
|
|
||||||
"$window",
|
|
||||||
"navigationService",
|
|
||||||
"$location",
|
|
||||||
"$attrs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "ObjectHeaderController",
|
|
||||||
"implementation": ObjectHeaderController,
|
|
||||||
"depends": [
|
|
||||||
"$scope"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"representations": [
|
"representations": [
|
||||||
{
|
{
|
||||||
"key": "browse-object",
|
"key": "browse-object",
|
||||||
|
@ -1,215 +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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This bundle implements Browse mode.
|
|
||||||
* @namespace platform/commonUI/browse
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
['lodash'],
|
|
||||||
function (_) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The BrowseController is used to populate the initial scope in Browse
|
|
||||||
* mode. It loads the root object from the objectService and makes it
|
|
||||||
* available in the scope for Angular template's; this is the point at
|
|
||||||
* which Angular templates first have access to the domain object
|
|
||||||
* hierarchy.
|
|
||||||
*
|
|
||||||
* @memberof platform/commonUI/browse
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function BrowseController(
|
|
||||||
$scope,
|
|
||||||
$route,
|
|
||||||
$location,
|
|
||||||
objectService,
|
|
||||||
navigationService,
|
|
||||||
urlService,
|
|
||||||
defaultPath
|
|
||||||
) {
|
|
||||||
window.browseScope = $scope;
|
|
||||||
var initialPath = ($route.current.params.ids || defaultPath).split("/"),
|
|
||||||
currentIds;
|
|
||||||
|
|
||||||
$scope.treeModel = {
|
|
||||||
selectedObject: undefined,
|
|
||||||
onSelection: function (object) {
|
|
||||||
navigationService.setNavigation(object, true);
|
|
||||||
},
|
|
||||||
allowSelection: function (object) {
|
|
||||||
var domainObjectInView = navigationService.getNavigation(),
|
|
||||||
isInEditMode = domainObjectInView.getCapability('status').get('editing');
|
|
||||||
|
|
||||||
if (isInEditMode) {
|
|
||||||
|
|
||||||
var actions = object.getCapability('action'),
|
|
||||||
previewAction = actions.getActions({key: 'mct-preview-action'})[0];
|
|
||||||
|
|
||||||
if (previewAction && previewAction.perform) {
|
|
||||||
previewAction.perform();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return navigationService.shouldNavigate();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function idsForObject(domainObject) {
|
|
||||||
return urlService
|
|
||||||
.urlForLocation("", domainObject)
|
|
||||||
.replace('/', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find an object in an array of objects.
|
|
||||||
function findObject(domainObjects, id) {
|
|
||||||
var i;
|
|
||||||
for (i = 0; i < domainObjects.length; i += 1) {
|
|
||||||
if (domainObjects[i].getId() === id) {
|
|
||||||
return domainObjects[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// helper, fetch a single object from the object service.
|
|
||||||
function getObject(id) {
|
|
||||||
return objectService.getObjects([id])
|
|
||||||
.then(function (results) {
|
|
||||||
return results[id];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// recursively locate and return an object inside of a container
|
|
||||||
// via a path. If at any point in the recursion it fails to find
|
|
||||||
// the next object, it will return the parent.
|
|
||||||
function findViaComposition(containerObject, path) {
|
|
||||||
var nextId = path.shift();
|
|
||||||
if (!nextId) {
|
|
||||||
return containerObject;
|
|
||||||
}
|
|
||||||
return containerObject.useCapability('composition')
|
|
||||||
.then(function (composees) {
|
|
||||||
var nextObject = findObject(composees, nextId);
|
|
||||||
if (!nextObject) {
|
|
||||||
return containerObject;
|
|
||||||
}
|
|
||||||
if (!nextObject.hasCapability('composition')) {
|
|
||||||
return nextObject;
|
|
||||||
}
|
|
||||||
return findViaComposition(nextObject, path);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateToObject(desiredObject) {
|
|
||||||
$scope.navigatedObject = desiredObject;
|
|
||||||
$scope.treeModel.selectedObject = desiredObject;
|
|
||||||
currentIds = idsForObject(desiredObject);
|
|
||||||
$route.current.pathParams.ids = currentIds;
|
|
||||||
$location.path('/browse/' + currentIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLastChildIfRoot(object) {
|
|
||||||
if (object.getId() !== 'ROOT') {
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
return object.useCapability('composition')
|
|
||||||
.then(function (composees) {
|
|
||||||
return composees[composees.length - 1];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateToPath(path) {
|
|
||||||
return getObject('ROOT')
|
|
||||||
.then(function (root) {
|
|
||||||
return findViaComposition(root, path);
|
|
||||||
})
|
|
||||||
.then(getLastChildIfRoot)
|
|
||||||
.then(function (object) {
|
|
||||||
navigationService.setNavigation(object);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getObject('ROOT')
|
|
||||||
.then(function (root) {
|
|
||||||
$scope.domainObject = root;
|
|
||||||
navigateToPath(initialPath);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle navigation events from view service. Only navigates
|
|
||||||
// if path has changed.
|
|
||||||
function navigateDirectlyToModel(domainObject) {
|
|
||||||
var newIds = idsForObject(domainObject);
|
|
||||||
if (currentIds !== newIds) {
|
|
||||||
currentIds = newIds;
|
|
||||||
navigateToObject(domainObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Listen for changes in navigation state.
|
|
||||||
navigationService.addListener(navigateDirectlyToModel);
|
|
||||||
|
|
||||||
// Listen for route changes which are caused by browser events
|
|
||||||
// (e.g. bookmarks to pages in OpenMCT) and prevent them. Instead,
|
|
||||||
// navigate to the path ourselves, which results in it being
|
|
||||||
// properly set.
|
|
||||||
$scope.$on('$routeChangeStart', function (event, route, oldRoute) {
|
|
||||||
if (route.$$route === $route.current.$$route) {
|
|
||||||
if (route.pathParams.ids &&
|
|
||||||
route.pathParams.ids !== $route.current.pathParams.ids) {
|
|
||||||
|
|
||||||
var otherParams = _.omit(route.params, 'ids');
|
|
||||||
var oldOtherParams = _.omit(oldRoute.params, 'ids');
|
|
||||||
var deletedParams = _.omit(oldOtherParams, _.keys(otherParams));
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
navigateToPath(route.pathParams.ids.split('/'))
|
|
||||||
.then(function () {
|
|
||||||
if (!_.isEqual(otherParams, oldOtherParams)) {
|
|
||||||
_.forEach(otherParams, function (v, k) {
|
|
||||||
$location.search(k, v);
|
|
||||||
});
|
|
||||||
_.forEach(deletedParams, function (k) {
|
|
||||||
$location.search(k, null);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
navigateToPath([]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Clean up when the scope is destroyed
|
|
||||||
$scope.$on("$destroy", function () {
|
|
||||||
navigationService.removeListener(navigateDirectlyToModel);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return BrowseController;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -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 () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controller for the `browse-object` representation of a domain
|
|
||||||
* object (the right-hand side of Browse mode.)
|
|
||||||
* @memberof platform/commonUI/browse
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function BrowseObjectController($scope, $location, $route) {
|
|
||||||
function setViewForDomainObject(domainObject) {
|
|
||||||
|
|
||||||
var locationViewKey = $location.search().view;
|
|
||||||
|
|
||||||
function selectViewIfMatching(view) {
|
|
||||||
if (view.key === locationViewKey) {
|
|
||||||
$scope.representation = $scope.representation || {};
|
|
||||||
$scope.representation.selected = view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (locationViewKey) {
|
|
||||||
((domainObject && domainObject.useCapability('view')) || [])
|
|
||||||
.forEach(selectViewIfMatching);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateQueryParam(viewKey) {
|
|
||||||
if (viewKey && $location.search().view !== viewKey) {
|
|
||||||
$location.search('view', viewKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$scope.$watch('domainObject', setViewForDomainObject);
|
|
||||||
$scope.$watch('representation.selected.key', updateQueryParam);
|
|
||||||
$scope.$on('$locationChangeSuccess', function () {
|
|
||||||
setViewForDomainObject($scope.domainObject);
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.doAction = function (action) {
|
|
||||||
return $scope[action] && $scope[action]();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return BrowseObjectController;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT Web 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 Web 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(
|
|
||||||
["./PaneController"],
|
|
||||||
function (PaneController) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pane controller that reveals inspector, if hidden, when object
|
|
||||||
* switches to edit mode.
|
|
||||||
*
|
|
||||||
* @param $scope
|
|
||||||
* @param agentService
|
|
||||||
* @param $window
|
|
||||||
* @param navigationService
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function InspectorPaneController($scope, agentService, $window, navigationService, $location, $attrs) {
|
|
||||||
PaneController.call(this, $scope, agentService, $window, $location, $attrs);
|
|
||||||
var statusListener,
|
|
||||||
self = this;
|
|
||||||
|
|
||||||
function showInspector(statuses) {
|
|
||||||
if (statuses.indexOf('editing') !== -1 && !self.visible()) {
|
|
||||||
self.toggle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function attachStatusListener(domainObject) {
|
|
||||||
// Remove existing status listener if existing
|
|
||||||
if (statusListener) {
|
|
||||||
statusListener();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (domainObject.hasCapability("status")) {
|
|
||||||
statusListener = domainObject.getCapability("status").listen(showInspector);
|
|
||||||
}
|
|
||||||
return statusListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
var domainObject = navigationService.getNavigation();
|
|
||||||
if (domainObject) {
|
|
||||||
attachStatusListener(domainObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
navigationService.addListener(attachStatusListener);
|
|
||||||
|
|
||||||
$scope.$on("$destroy", function () {
|
|
||||||
statusListener();
|
|
||||||
navigationService.removeListener(attachStatusListener);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
InspectorPaneController.prototype = Object.create(PaneController.prototype);
|
|
||||||
|
|
||||||
return InspectorPaneController;
|
|
||||||
}
|
|
||||||
);
|
|
@ -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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining MenuArrowController. Created by shale on 06/30/2015.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[],
|
|
||||||
function () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A left-click on the menu arrow should display a
|
|
||||||
* context menu. This controller launches the context
|
|
||||||
* menu.
|
|
||||||
* @memberof platform/commonUI/browse
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function MenuArrowController($scope) {
|
|
||||||
this.$scope = $scope;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a context menu for the domain object in this scope.
|
|
||||||
*
|
|
||||||
* @param event the browser event which caused this (used to
|
|
||||||
* position the menu)
|
|
||||||
*/
|
|
||||||
MenuArrowController.prototype.showMenu = function (event) {
|
|
||||||
var actionContext = {
|
|
||||||
key: 'menu',
|
|
||||||
domainObject: this.$scope.domainObject,
|
|
||||||
event: event
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$scope.domainObject.getCapability('action').perform(actionContext);
|
|
||||||
};
|
|
||||||
|
|
||||||
return MenuArrowController;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,92 +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 () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controller to provide the ability to inline edit an object name.
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @memberof platform/commonUI/browse
|
|
||||||
*/
|
|
||||||
function ObjectHeaderController($scope) {
|
|
||||||
this.$scope = $scope;
|
|
||||||
this.domainObject = $scope.domainObject;
|
|
||||||
this.editable = this.allowEdit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the object name on blur and enter keypress events.
|
|
||||||
*
|
|
||||||
* @param event the mouse event
|
|
||||||
*/
|
|
||||||
ObjectHeaderController.prototype.updateName = function (event) {
|
|
||||||
if (!event || !event.currentTarget) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.type === 'blur') {
|
|
||||||
this.updateModel(event);
|
|
||||||
} else if (event.which === 13) {
|
|
||||||
this.updateModel(event);
|
|
||||||
event.currentTarget.blur();
|
|
||||||
window.getSelection().removeAllRanges();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the model.
|
|
||||||
*
|
|
||||||
* @param event the mouse event
|
|
||||||
* @param private
|
|
||||||
*/
|
|
||||||
ObjectHeaderController.prototype.updateModel = function (event) {
|
|
||||||
var name = event.currentTarget.textContent.replace(/\n/g, ' ');
|
|
||||||
|
|
||||||
if (name.length === 0) {
|
|
||||||
name = "Unnamed " + this.domainObject.getCapability("type").typeDef.name;
|
|
||||||
event.currentTarget.textContent = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name !== this.domainObject.getModel().name) {
|
|
||||||
this.domainObject.getCapability('mutation').mutate(function (model) {
|
|
||||||
model.name = name;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the domain object is editable.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @return true if object is editable
|
|
||||||
*/
|
|
||||||
ObjectHeaderController.prototype.allowEdit = function () {
|
|
||||||
var type = this.domainObject && this.domainObject.getCapability('type');
|
|
||||||
return !!(type && type.hasFeature('creation'));
|
|
||||||
};
|
|
||||||
|
|
||||||
return ObjectHeaderController;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,88 +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 navigationListenerAdded = false;
|
|
||||||
/**
|
|
||||||
* Controller to provide the ability to show/hide the tree in
|
|
||||||
* Browse mode.
|
|
||||||
* @constructor
|
|
||||||
* @memberof platform/commonUI/browse
|
|
||||||
*/
|
|
||||||
function PaneController($scope, agentService, $window, $location, $attrs, navigationService) {
|
|
||||||
var self = this;
|
|
||||||
this.agentService = agentService;
|
|
||||||
var hideParameterPresent = $location.search().hasOwnProperty($attrs.hideParameter);
|
|
||||||
|
|
||||||
if ($attrs.hideParameter && hideParameterPresent) {
|
|
||||||
this.state = false;
|
|
||||||
$location.search($attrs.hideParameter, undefined);
|
|
||||||
} else {
|
|
||||||
this.state = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback to invoke when any selection occurs in the tree.
|
|
||||||
* This controller can be passed in as the `parameters` object
|
|
||||||
* to the tree representation.
|
|
||||||
*
|
|
||||||
* @property {Function} callback
|
|
||||||
* @memberof platform/commonUI/browse.PaneController#
|
|
||||||
*/
|
|
||||||
this.callback = function () {
|
|
||||||
// Note that, since this is a callback to pass, this is not
|
|
||||||
// declared as a method but as a property which happens to
|
|
||||||
// be a function.
|
|
||||||
if (agentService.isPhone() && agentService.isPortrait()) {
|
|
||||||
// On phones, trees should collapse in portrait mode
|
|
||||||
// when something is navigated-to.
|
|
||||||
self.state = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (navigationService && navigationService.addListener && !navigationListenerAdded) {
|
|
||||||
navigationService.addListener(this.callback);
|
|
||||||
navigationListenerAdded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggle the visibility of the pane.
|
|
||||||
*/
|
|
||||||
PaneController.prototype.toggle = function () {
|
|
||||||
this.state = !this.state;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the desired visibility state of the pane.
|
|
||||||
* @returns {boolean} true when visible
|
|
||||||
*/
|
|
||||||
PaneController.prototype.visible = function () {
|
|
||||||
return !!this.state;
|
|
||||||
};
|
|
||||||
|
|
||||||
return PaneController;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,266 +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 console*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
[
|
|
||||||
"../src/BrowseController",
|
|
||||||
"../src/navigation/NavigationService"
|
|
||||||
],
|
|
||||||
function (
|
|
||||||
BrowseController,
|
|
||||||
NavigationService
|
|
||||||
) {
|
|
||||||
|
|
||||||
describe("The browse controller", function () {
|
|
||||||
var mockScope,
|
|
||||||
mockRoute,
|
|
||||||
mockLocation,
|
|
||||||
mockObjectService,
|
|
||||||
mockNavigationService,
|
|
||||||
mockRootObject,
|
|
||||||
mockUrlService,
|
|
||||||
mockDefaultRootObject,
|
|
||||||
mockOtherDomainObject,
|
|
||||||
mockNextObject,
|
|
||||||
testDefaultRoot,
|
|
||||||
controller;
|
|
||||||
|
|
||||||
function waitsForNavigation() {
|
|
||||||
return new Promise(function (resolve) {
|
|
||||||
mockNavigationService.setNavigation.and.callFake(function (obj) {
|
|
||||||
var returnValue;
|
|
||||||
try {
|
|
||||||
returnValue = NavigationService.prototype.setNavigation.call(mockNavigationService, obj);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
//Not rejecting because 'setNavigation' has been called, which is what's being tested here.
|
|
||||||
//Rejecting will fail tests.
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
return returnValue;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function instantiateController() {
|
|
||||||
controller = new BrowseController(
|
|
||||||
mockScope,
|
|
||||||
mockRoute,
|
|
||||||
mockLocation,
|
|
||||||
mockObjectService,
|
|
||||||
mockNavigationService,
|
|
||||||
mockUrlService,
|
|
||||||
testDefaultRoot
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
testDefaultRoot = "some-root-level-domain-object";
|
|
||||||
|
|
||||||
mockScope = jasmine.createSpyObj(
|
|
||||||
"$scope",
|
|
||||||
["$on", "$watch"]
|
|
||||||
);
|
|
||||||
mockRoute = { current: { params: {}, pathParams: {} } };
|
|
||||||
mockUrlService = jasmine.createSpyObj(
|
|
||||||
"urlService",
|
|
||||||
["urlForLocation"]
|
|
||||||
);
|
|
||||||
mockUrlService.urlForLocation.and.callFake(function (mode, object) {
|
|
||||||
if (object === mockDefaultRootObject) {
|
|
||||||
return [mode, testDefaultRoot].join('/');
|
|
||||||
}
|
|
||||||
if (object === mockOtherDomainObject) {
|
|
||||||
return [mode, 'other'].join('/');
|
|
||||||
}
|
|
||||||
if (object === mockNextObject) {
|
|
||||||
return [mode, testDefaultRoot, 'next'].join('/');
|
|
||||||
}
|
|
||||||
throw new Error('Tried to get url for unexpected object');
|
|
||||||
});
|
|
||||||
mockLocation = jasmine.createSpyObj(
|
|
||||||
"$location",
|
|
||||||
["path"]
|
|
||||||
);
|
|
||||||
mockObjectService = jasmine.createSpyObj(
|
|
||||||
"objectService",
|
|
||||||
["getObjects"]
|
|
||||||
);
|
|
||||||
mockNavigationService = new NavigationService({});
|
|
||||||
[
|
|
||||||
"getNavigation",
|
|
||||||
"setNavigation",
|
|
||||||
"addListener",
|
|
||||||
"removeListener"
|
|
||||||
].forEach(function (method) {
|
|
||||||
spyOn(mockNavigationService, method)
|
|
||||||
.and.callThrough();
|
|
||||||
});
|
|
||||||
mockRootObject = jasmine.createSpyObj(
|
|
||||||
"rootObjectContainer",
|
|
||||||
["getId", "getCapability", "getModel", "useCapability", "hasCapability"]
|
|
||||||
);
|
|
||||||
mockDefaultRootObject = jasmine.createSpyObj(
|
|
||||||
"defaultRootObject",
|
|
||||||
["getId", "getCapability", "getModel", "useCapability", "hasCapability"]
|
|
||||||
);
|
|
||||||
mockOtherDomainObject = jasmine.createSpyObj(
|
|
||||||
"otherDomainObject",
|
|
||||||
["getId", "getCapability", "getModel", "useCapability", "hasCapability"]
|
|
||||||
);
|
|
||||||
mockNextObject = jasmine.createSpyObj(
|
|
||||||
"nestedDomainObject",
|
|
||||||
["getId", "getCapability", "getModel", "useCapability", "hasCapability"]
|
|
||||||
);
|
|
||||||
mockObjectService.getObjects.and.returnValue(Promise.resolve({
|
|
||||||
ROOT: mockRootObject
|
|
||||||
}));
|
|
||||||
mockRootObject.useCapability.and.returnValue(Promise.resolve([
|
|
||||||
mockOtherDomainObject,
|
|
||||||
mockDefaultRootObject
|
|
||||||
]));
|
|
||||||
mockRootObject.hasCapability.and.returnValue(true);
|
|
||||||
mockDefaultRootObject.useCapability.and.returnValue(Promise.resolve([
|
|
||||||
mockNextObject
|
|
||||||
]));
|
|
||||||
mockDefaultRootObject.hasCapability.and.returnValue(true);
|
|
||||||
mockOtherDomainObject.hasCapability.and.returnValue(false);
|
|
||||||
mockNextObject.useCapability.and.returnValue(undefined);
|
|
||||||
mockNextObject.hasCapability.and.returnValue(false);
|
|
||||||
mockNextObject.getId.and.returnValue("next");
|
|
||||||
mockDefaultRootObject.getId.and.returnValue(testDefaultRoot);
|
|
||||||
|
|
||||||
instantiateController();
|
|
||||||
return waitsForNavigation();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses composition to set the navigated object, if there is none", function () {
|
|
||||||
instantiateController();
|
|
||||||
return waitsForNavigation().then(function () {
|
|
||||||
expect(mockNavigationService.setNavigation)
|
|
||||||
.toHaveBeenCalledWith(mockDefaultRootObject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("navigates to a root-level object, even when default path is not found", function () {
|
|
||||||
mockDefaultRootObject.getId
|
|
||||||
.and.returnValue("something-other-than-the-" + testDefaultRoot);
|
|
||||||
instantiateController();
|
|
||||||
|
|
||||||
return waitsForNavigation().then(function () {
|
|
||||||
expect(mockNavigationService.setNavigation)
|
|
||||||
.toHaveBeenCalledWith(mockDefaultRootObject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("does not try to override navigation", function () {
|
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockDefaultRootObject);
|
|
||||||
instantiateController();
|
|
||||||
return waitsForNavigation().then(function () {
|
|
||||||
expect(mockScope.navigatedObject).toBe(mockDefaultRootObject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates scope when navigated object changes", function () {
|
|
||||||
// Should have registered a listener - call it
|
|
||||||
mockNavigationService.addListener.calls.mostRecent().args[0](
|
|
||||||
mockOtherDomainObject
|
|
||||||
);
|
|
||||||
expect(mockScope.navigatedObject).toEqual(mockOtherDomainObject);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
it("releases its navigation listener when its scope is destroyed", function () {
|
|
||||||
expect(mockScope.$on).toHaveBeenCalledWith(
|
|
||||||
"$destroy",
|
|
||||||
jasmine.any(Function)
|
|
||||||
);
|
|
||||||
mockScope.$on.calls.mostRecent().args[1]();
|
|
||||||
|
|
||||||
// Should remove the listener it added earlier
|
|
||||||
expect(mockNavigationService.removeListener).toHaveBeenCalledWith(
|
|
||||||
mockNavigationService.addListener.calls.mostRecent().args[0]
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses route parameters to choose initially-navigated object", function () {
|
|
||||||
mockRoute.current.params.ids = testDefaultRoot + "/next";
|
|
||||||
instantiateController();
|
|
||||||
return waitsForNavigation().then(function () {
|
|
||||||
expect(mockScope.navigatedObject).toBe(mockNextObject);
|
|
||||||
expect(mockNavigationService.setNavigation)
|
|
||||||
.toHaveBeenCalledWith(mockNextObject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("handles invalid IDs by going as far as possible", function () {
|
|
||||||
// Idea here is that if we get a bad path of IDs,
|
|
||||||
// browse controller should traverse down it until
|
|
||||||
// it hits an invalid ID.
|
|
||||||
mockRoute.current.params.ids = testDefaultRoot + "/junk";
|
|
||||||
instantiateController();
|
|
||||||
return waitsForNavigation().then(function () {
|
|
||||||
expect(mockScope.navigatedObject).toBe(mockDefaultRootObject);
|
|
||||||
expect(mockNavigationService.setNavigation)
|
|
||||||
.toHaveBeenCalledWith(mockDefaultRootObject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("handles compositionless objects by going as far as possible", function () {
|
|
||||||
// Idea here is that if we get a path which passes
|
|
||||||
// through an object without a composition, browse controller
|
|
||||||
// should stop at it since remaining IDs cannot be loaded.
|
|
||||||
mockRoute.current.params.ids = testDefaultRoot + "/next/junk";
|
|
||||||
instantiateController();
|
|
||||||
return waitsForNavigation().then(function () {
|
|
||||||
expect(mockScope.navigatedObject).toBe(mockNextObject);
|
|
||||||
expect(mockNavigationService.setNavigation)
|
|
||||||
.toHaveBeenCalledWith(mockNextObject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates the displayed route to reflect current navigation", function () {
|
|
||||||
// In order to trigger a route update and not a route change,
|
|
||||||
// the current route must be updated before location.path is
|
|
||||||
// called.
|
|
||||||
expect(mockRoute.current.pathParams.ids)
|
|
||||||
.not
|
|
||||||
.toBe(testDefaultRoot + '/next');
|
|
||||||
mockLocation.path.and.callFake(function () {
|
|
||||||
expect(mockRoute.current.pathParams.ids)
|
|
||||||
.toBe(testDefaultRoot + '/next');
|
|
||||||
});
|
|
||||||
mockNavigationService.addListener.calls.mostRecent().args[0](
|
|
||||||
mockNextObject
|
|
||||||
);
|
|
||||||
expect(mockLocation.path).toHaveBeenCalledWith(
|
|
||||||
'/browse/' + testDefaultRoot + '/next'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,93 +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/BrowseObjectController"],
|
|
||||||
function (BrowseObjectController) {
|
|
||||||
|
|
||||||
describe("The browse object controller", function () {
|
|
||||||
var mockScope,
|
|
||||||
mockLocation,
|
|
||||||
mockRoute,
|
|
||||||
controller;
|
|
||||||
|
|
||||||
// Utility function; look for a $watch on scope and fire it
|
|
||||||
function fireWatch(expr, value) {
|
|
||||||
mockScope.$watch.calls.all().forEach(function (call) {
|
|
||||||
if (call.args[0] === expr) {
|
|
||||||
call.args[1](value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockScope = jasmine.createSpyObj(
|
|
||||||
"$scope",
|
|
||||||
["$on", "$watch"]
|
|
||||||
);
|
|
||||||
mockRoute = { current: { params: {} } };
|
|
||||||
mockLocation = jasmine.createSpyObj(
|
|
||||||
"$location",
|
|
||||||
["path", "search"]
|
|
||||||
);
|
|
||||||
mockLocation.search.and.returnValue({});
|
|
||||||
|
|
||||||
controller = new BrowseObjectController(
|
|
||||||
mockScope,
|
|
||||||
mockLocation,
|
|
||||||
mockRoute
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates query parameters when selected view changes", function () {
|
|
||||||
fireWatch("representation.selected.key", "xyz");
|
|
||||||
expect(mockLocation.search).toHaveBeenCalledWith('view', "xyz");
|
|
||||||
|
|
||||||
// Allows the path index to be checked
|
|
||||||
// prior to setting $route.current
|
|
||||||
mockLocation.path.and.returnValue("/browse/");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("sets the active view from query parameters", function () {
|
|
||||||
var mockDomainObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
|
||||||
['getId', 'getModel', 'getCapability', 'useCapability']
|
|
||||||
),
|
|
||||||
testViews = [
|
|
||||||
{ key: 'abc' },
|
|
||||||
{ key: 'def', someKey: 'some value' },
|
|
||||||
{ key: 'xyz' }
|
|
||||||
];
|
|
||||||
|
|
||||||
mockDomainObject.useCapability.and.callFake(function (c) {
|
|
||||||
return (c === 'view') && testViews;
|
|
||||||
});
|
|
||||||
mockLocation.search.and.returnValue({ view: 'def' });
|
|
||||||
|
|
||||||
fireWatch('domainObject', mockDomainObject);
|
|
||||||
expect(mockScope.representation.selected)
|
|
||||||
.toEqual(testViews[1]);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,103 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT Web 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 Web 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/InspectorPaneController"],
|
|
||||||
function (InspectorPaneController) {
|
|
||||||
|
|
||||||
describe("The InspectorPaneController", function () {
|
|
||||||
var mockScope,
|
|
||||||
mockAgentService,
|
|
||||||
mockDomainObject,
|
|
||||||
mockWindow,
|
|
||||||
mockStatusCapability,
|
|
||||||
mockNavigationService,
|
|
||||||
mockNavigationUnlistener,
|
|
||||||
mockStatusUnlistener,
|
|
||||||
controller,
|
|
||||||
mockLocation,
|
|
||||||
mockAttrs;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockScope = jasmine.createSpyObj("$scope", ["$on"]);
|
|
||||||
mockWindow = jasmine.createSpyObj("$window", ["open"]);
|
|
||||||
mockAgentService = jasmine.createSpyObj(
|
|
||||||
"agentService",
|
|
||||||
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockNavigationUnlistener = jasmine.createSpy("navigationUnlistener");
|
|
||||||
mockNavigationService = jasmine.createSpyObj(
|
|
||||||
"navigationService",
|
|
||||||
["getNavigation", "addListener"]
|
|
||||||
);
|
|
||||||
mockNavigationService.addListener.and.returnValue(mockNavigationUnlistener);
|
|
||||||
|
|
||||||
mockStatusUnlistener = jasmine.createSpy("statusUnlistener");
|
|
||||||
mockStatusCapability = jasmine.createSpyObj(
|
|
||||||
"statusCapability",
|
|
||||||
["listen"]
|
|
||||||
);
|
|
||||||
mockStatusCapability.listen.and.returnValue(mockStatusUnlistener);
|
|
||||||
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
|
||||||
'domainObject',
|
|
||||||
[
|
|
||||||
'getId',
|
|
||||||
'getModel',
|
|
||||||
'getCapability',
|
|
||||||
'hasCapability'
|
|
||||||
]
|
|
||||||
);
|
|
||||||
mockDomainObject.getId.and.returnValue("domainObject");
|
|
||||||
mockDomainObject.getModel.and.returnValue({});
|
|
||||||
mockDomainObject.hasCapability.and.returnValue(true);
|
|
||||||
mockDomainObject.getCapability.and.returnValue(mockStatusCapability);
|
|
||||||
|
|
||||||
mockLocation = jasmine.createSpyObj('location', ['search']);
|
|
||||||
mockLocation.search.and.returnValue({});
|
|
||||||
|
|
||||||
mockAttrs = {};
|
|
||||||
|
|
||||||
controller = new InspectorPaneController(mockScope, mockAgentService, mockWindow, mockNavigationService, mockLocation, mockAttrs);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("listens for changes to navigation and attaches a status" +
|
|
||||||
" listener", function () {
|
|
||||||
expect(mockNavigationService.addListener).toHaveBeenCalledWith(jasmine.any(Function));
|
|
||||||
mockNavigationService.addListener.calls.mostRecent().args[0](mockDomainObject);
|
|
||||||
expect(mockStatusCapability.listen).toHaveBeenCalledWith(jasmine.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("if hidden, shows the inspector when domain object switches to" +
|
|
||||||
" edit mode", function () {
|
|
||||||
controller.toggle();
|
|
||||||
// test pre-condition that inspector is hidden
|
|
||||||
expect(controller.visible()).toBe(false);
|
|
||||||
mockNavigationService.addListener.calls.mostRecent().args[0](mockDomainObject);
|
|
||||||
mockStatusCapability.listen.calls.mostRecent().args[0](["editing"]);
|
|
||||||
expect(controller.visible()).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MenuArrowControllerSpec. Created by shale on 07/02/2015.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
["../src/MenuArrowController"],
|
|
||||||
function (MenuArrowController) {
|
|
||||||
|
|
||||||
describe("The menu arrow controller ", function () {
|
|
||||||
var mockScope,
|
|
||||||
mockDomainObject,
|
|
||||||
mockEvent,
|
|
||||||
mockContextMenuAction,
|
|
||||||
mockActionContext,
|
|
||||||
controller;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockScope = jasmine.createSpyObj(
|
|
||||||
"$scope",
|
|
||||||
[""]
|
|
||||||
);
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
|
||||||
["getCapability"]
|
|
||||||
);
|
|
||||||
mockEvent = jasmine.createSpyObj(
|
|
||||||
"event",
|
|
||||||
["preventDefault"]
|
|
||||||
);
|
|
||||||
mockContextMenuAction = jasmine.createSpyObj(
|
|
||||||
"action",
|
|
||||||
["perform", "getActions"]
|
|
||||||
);
|
|
||||||
mockActionContext = jasmine.createSpyObj(
|
|
||||||
"actionContext",
|
|
||||||
[""]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockActionContext.domainObject = mockDomainObject;
|
|
||||||
mockActionContext.event = mockEvent;
|
|
||||||
mockScope.domainObject = mockDomainObject;
|
|
||||||
mockDomainObject.getCapability.and.returnValue(mockContextMenuAction);
|
|
||||||
mockContextMenuAction.perform.and.returnValue(jasmine.any(Function));
|
|
||||||
|
|
||||||
controller = new MenuArrowController(mockScope);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("calls the context menu action when clicked", function () {
|
|
||||||
// Simulate a click on the menu arrow
|
|
||||||
controller.showMenu(mockEvent);
|
|
||||||
|
|
||||||
// Expect the menu action to be performed
|
|
||||||
expect(mockDomainObject.getCapability).toHaveBeenCalledWith('action');
|
|
||||||
expect(mockContextMenuAction.perform).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,137 +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/ObjectHeaderController"],
|
|
||||||
function (ObjectHeaderController) {
|
|
||||||
|
|
||||||
describe("The object header controller", function () {
|
|
||||||
var mockScope,
|
|
||||||
mockDomainObject,
|
|
||||||
mockCapabilities,
|
|
||||||
mockMutationCapability,
|
|
||||||
mockTypeCapability,
|
|
||||||
mockEvent,
|
|
||||||
mockCurrentTarget,
|
|
||||||
model,
|
|
||||||
controller;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockMutationCapability = jasmine.createSpyObj("mutation", ["mutate"]);
|
|
||||||
mockTypeCapability = jasmine.createSpyObj("type", ["typeDef", "hasFeature"]);
|
|
||||||
mockTypeCapability.typeDef = { name: ""};
|
|
||||||
mockTypeCapability.hasFeature.and.callFake(function (feature) {
|
|
||||||
return feature === 'creation';
|
|
||||||
});
|
|
||||||
|
|
||||||
mockCapabilities = {
|
|
||||||
mutation: mockMutationCapability,
|
|
||||||
type: mockTypeCapability
|
|
||||||
};
|
|
||||||
|
|
||||||
model = {
|
|
||||||
name: "Test name"
|
|
||||||
};
|
|
||||||
mockDomainObject = jasmine.createSpyObj("domainObject", ["getCapability", "getModel"]);
|
|
||||||
mockDomainObject.getModel.and.returnValue(model);
|
|
||||||
mockDomainObject.getCapability.and.callFake(function (key) {
|
|
||||||
return mockCapabilities[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
mockScope = {
|
|
||||||
domainObject: mockDomainObject
|
|
||||||
};
|
|
||||||
|
|
||||||
mockCurrentTarget = jasmine.createSpyObj("currentTarget", ["blur", "textContent"]);
|
|
||||||
mockCurrentTarget.blur.and.returnValue(mockCurrentTarget);
|
|
||||||
|
|
||||||
mockEvent = {
|
|
||||||
which: {},
|
|
||||||
type: {},
|
|
||||||
currentTarget: mockCurrentTarget
|
|
||||||
};
|
|
||||||
|
|
||||||
controller = new ObjectHeaderController(mockScope);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates the model with new name on blur", function () {
|
|
||||||
mockEvent.type = "blur";
|
|
||||||
mockCurrentTarget.textContent = "New name";
|
|
||||||
controller.updateName(mockEvent);
|
|
||||||
|
|
||||||
expect(mockMutationCapability.mutate).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates the model with a default for blank names", function () {
|
|
||||||
mockEvent.type = "blur";
|
|
||||||
mockCurrentTarget.textContent = "";
|
|
||||||
controller.updateName(mockEvent);
|
|
||||||
|
|
||||||
expect(mockCurrentTarget.textContent.length).not.toEqual(0);
|
|
||||||
expect(mockMutationCapability.mutate).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("does not update the model if the same name", function () {
|
|
||||||
mockEvent.type = "blur";
|
|
||||||
mockCurrentTarget.textContent = mockDomainObject.getModel().name;
|
|
||||||
controller.updateName(mockEvent);
|
|
||||||
|
|
||||||
expect(mockMutationCapability.mutate).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("updates the model on enter keypress event only", function () {
|
|
||||||
mockCurrentTarget.textContent = "New name";
|
|
||||||
controller.updateName(mockEvent);
|
|
||||||
|
|
||||||
expect(mockMutationCapability.mutate).not.toHaveBeenCalled();
|
|
||||||
|
|
||||||
mockEvent.which = 13;
|
|
||||||
controller.updateName(mockEvent);
|
|
||||||
|
|
||||||
expect(mockMutationCapability.mutate).toHaveBeenCalledWith(jasmine.any(Function));
|
|
||||||
|
|
||||||
mockMutationCapability.mutate.calls.mostRecent().args[0](model);
|
|
||||||
|
|
||||||
expect(mockDomainObject.getModel().name).toBe("New name");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("blurs the field on enter key press", function () {
|
|
||||||
mockCurrentTarget.textContent = "New name";
|
|
||||||
mockEvent.which = 13;
|
|
||||||
controller.updateName(mockEvent);
|
|
||||||
|
|
||||||
expect(mockEvent.currentTarget.blur).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("allows editting name when object is creatable", function () {
|
|
||||||
expect(controller.allowEdit()).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("disallows editting name when object is non-creatable", function () {
|
|
||||||
mockTypeCapability.hasFeature.and.returnValue(false);
|
|
||||||
|
|
||||||
expect(controller.allowEdit()).toBe(false);
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,106 +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/PaneController"],
|
|
||||||
function (PaneController) {
|
|
||||||
|
|
||||||
describe("The PaneController", function () {
|
|
||||||
var mockScope,
|
|
||||||
mockAgentService,
|
|
||||||
mockWindow,
|
|
||||||
controller,
|
|
||||||
mockLocation,
|
|
||||||
mockAttrs;
|
|
||||||
|
|
||||||
// We want to reinstantiate for each test case
|
|
||||||
// because device state can influence constructor-time behavior
|
|
||||||
function instantiateController() {
|
|
||||||
return new PaneController(
|
|
||||||
mockScope,
|
|
||||||
mockAgentService,
|
|
||||||
mockWindow,
|
|
||||||
mockLocation,
|
|
||||||
mockAttrs
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockScope = jasmine.createSpyObj("$scope", ["$on"]);
|
|
||||||
mockAgentService = jasmine.createSpyObj(
|
|
||||||
"agentService",
|
|
||||||
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
|
|
||||||
);
|
|
||||||
mockWindow = jasmine.createSpyObj("$window", ["open"]);
|
|
||||||
|
|
||||||
mockLocation = jasmine.createSpyObj('location', ['search']);
|
|
||||||
mockLocation.search.and.returnValue({});
|
|
||||||
|
|
||||||
mockAttrs = {};
|
|
||||||
});
|
|
||||||
|
|
||||||
it("is initially visible", function () {
|
|
||||||
expect(instantiateController().visible()).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("allows visibility to be toggled", function () {
|
|
||||||
controller = instantiateController();
|
|
||||||
controller.toggle();
|
|
||||||
expect(controller.visible()).toBeFalsy();
|
|
||||||
controller.toggle();
|
|
||||||
expect(controller.visible()).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("collapses on navigation changes on portrait-oriented phones", function () {
|
|
||||||
mockAgentService.isMobile.and.returnValue(true);
|
|
||||||
mockAgentService.isPhone.and.returnValue(true);
|
|
||||||
mockAgentService.isPortrait.and.returnValue(true);
|
|
||||||
controller = instantiateController();
|
|
||||||
expect(controller.visible()).toBeTruthy();
|
|
||||||
|
|
||||||
// Simulate a change from the tree by invoking controller's
|
|
||||||
controller.callback();
|
|
||||||
|
|
||||||
// Tree should have collapsed
|
|
||||||
expect(controller.visible()).toBeFalsy();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("specifying hideParameter", function () {
|
|
||||||
beforeEach(function () {
|
|
||||||
mockAttrs = {hideParameter: 'hideTree'};
|
|
||||||
});
|
|
||||||
|
|
||||||
it("sets pane state to false when in location.search", function () {
|
|
||||||
mockLocation.search.and.returnValue({'hideTree': true});
|
|
||||||
expect(instantiateController().visible()).toBe(false);
|
|
||||||
expect(mockLocation.search).toHaveBeenCalledWith('hideTree', undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("sets state to true when not found in location.search", function () {
|
|
||||||
mockLocation.search.and.returnValue({});
|
|
||||||
expect(instantiateController().visible()).toBe(true);
|
|
||||||
expect(mockLocation.search).not.toHaveBeenCalledWith('hideTree', undefined);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -27,7 +27,6 @@ define([
|
|||||||
"./src/actions/EditAndComposeAction",
|
"./src/actions/EditAndComposeAction",
|
||||||
"./src/actions/EditAction",
|
"./src/actions/EditAction",
|
||||||
"./src/actions/PropertiesAction",
|
"./src/actions/PropertiesAction",
|
||||||
"./src/actions/RemoveAction",
|
|
||||||
"./src/actions/SaveAction",
|
"./src/actions/SaveAction",
|
||||||
"./src/actions/SaveAndStopEditingAction",
|
"./src/actions/SaveAndStopEditingAction",
|
||||||
"./src/actions/SaveAsAction",
|
"./src/actions/SaveAsAction",
|
||||||
@ -58,7 +57,6 @@ define([
|
|||||||
EditAndComposeAction,
|
EditAndComposeAction,
|
||||||
EditAction,
|
EditAction,
|
||||||
PropertiesAction,
|
PropertiesAction,
|
||||||
RemoveAction,
|
|
||||||
SaveAction,
|
SaveAction,
|
||||||
SaveAndStopEditingAction,
|
SaveAndStopEditingAction,
|
||||||
SaveAsAction,
|
SaveAsAction,
|
||||||
@ -158,18 +156,6 @@ define([
|
|||||||
"dialogService"
|
"dialogService"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "remove",
|
|
||||||
"category": "legacy",
|
|
||||||
"implementation": RemoveAction,
|
|
||||||
"cssClass": "icon-trash",
|
|
||||||
"name": "Remove",
|
|
||||||
"description": "Remove this object from its containing object.",
|
|
||||||
"depends": [
|
|
||||||
"openmct",
|
|
||||||
"navigationService"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "save-and-stop-editing",
|
"key": "save-and-stop-editing",
|
||||||
"category": "save",
|
"category": "save",
|
||||||
|
@ -1,131 +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 RemoveAction. Created by vwoeltje on 11/17/14.
|
|
||||||
*/
|
|
||||||
define([], function () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct an action which will remove the provided object manifestation.
|
|
||||||
* The object will be removed from its parent's composition; the parent
|
|
||||||
* is looked up via the "context" capability (so this will be the
|
|
||||||
* immediate ancestor by which this specific object was reached.)
|
|
||||||
*
|
|
||||||
* @param {DialogService} dialogService a service which will show the dialog
|
|
||||||
* @param {NavigationService} navigationService a service that maintains the current navigation state
|
|
||||||
* @param {ActionContext} context the context in which this action is performed
|
|
||||||
* @memberof platform/commonUI/edit
|
|
||||||
* @constructor
|
|
||||||
* @implements {Action}
|
|
||||||
*/
|
|
||||||
function RemoveAction(openmct, navigationService, context) {
|
|
||||||
this.domainObject = (context || {}).domainObject;
|
|
||||||
this.openmct = openmct;
|
|
||||||
this.navigationService = navigationService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform this action.
|
|
||||||
*/
|
|
||||||
RemoveAction.prototype.perform = function () {
|
|
||||||
var dialog,
|
|
||||||
domainObject = this.domainObject,
|
|
||||||
navigationService = this.navigationService;
|
|
||||||
/*
|
|
||||||
* Check whether an object ID matches the ID of the object being
|
|
||||||
* removed (used to filter a parent's composition to handle the
|
|
||||||
* removal.)
|
|
||||||
*/
|
|
||||||
function isNotObject(otherObjectId) {
|
|
||||||
return otherObjectId !== domainObject.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Mutate a parent object such that it no longer contains the object
|
|
||||||
* which is being removed.
|
|
||||||
*/
|
|
||||||
function doMutate(model) {
|
|
||||||
model.composition = model.composition.filter(isNotObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Checks current object and ascendants of current
|
|
||||||
* object with object being removed, if the current
|
|
||||||
* object or any in the current object's path is being removed,
|
|
||||||
* navigate back to parent of removed object.
|
|
||||||
*/
|
|
||||||
function checkObjectNavigation(object, parentObject) {
|
|
||||||
// Traverse object starts at current location
|
|
||||||
var traverseObject = (navigationService).getNavigation(),
|
|
||||||
context;
|
|
||||||
|
|
||||||
// Stop when object is not defined (above ROOT)
|
|
||||||
while (traverseObject) {
|
|
||||||
// If object currently traversed to is object being removed
|
|
||||||
// navigate to parent of current object and then exit loop
|
|
||||||
if (traverseObject.getId() === object.getId()) {
|
|
||||||
navigationService.setNavigation(parentObject);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Traverses to parent of current object, moving
|
|
||||||
// up the ascendant path
|
|
||||||
context = traverseObject.getCapability('context');
|
|
||||||
traverseObject = context && context.getParent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Remove the object from its parent, as identified by its context
|
|
||||||
* capability. Based on object's location and selected object's location
|
|
||||||
* user may be navigated to existing parent object
|
|
||||||
*/
|
|
||||||
function removeFromContext() {
|
|
||||||
var contextCapability = domainObject.getCapability('context'),
|
|
||||||
parent = contextCapability.getParent();
|
|
||||||
|
|
||||||
// If currently within path of removed object(s),
|
|
||||||
// navigates to existing object up tree
|
|
||||||
checkObjectNavigation(domainObject, parent);
|
|
||||||
|
|
||||||
return parent.useCapability('mutation', doMutate);
|
|
||||||
}
|
|
||||||
|
|
||||||
removeFromContext();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Object needs to have a parent for Remove to be applicable
|
|
||||||
RemoveAction.appliesTo = function (context) {
|
|
||||||
var object = (context || {}).domainObject,
|
|
||||||
contextCapability = object && object.getCapability("context"),
|
|
||||||
parent = contextCapability && contextCapability.getParent(),
|
|
||||||
parentType = parent && parent.getCapability('type'),
|
|
||||||
parentCreatable = parentType && parentType.hasFeature('creation');
|
|
||||||
|
|
||||||
// Only creatable types should be modifiable
|
|
||||||
return parent !== undefined &&
|
|
||||||
Array.isArray(parent.getModel().composition) &&
|
|
||||||
parentCreatable;
|
|
||||||
};
|
|
||||||
|
|
||||||
return RemoveAction;
|
|
||||||
});
|
|
@ -1,255 +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/actions/RemoveAction"],
|
|
||||||
function (RemoveAction) {
|
|
||||||
|
|
||||||
describe("The Remove action", function () {
|
|
||||||
var action,
|
|
||||||
actionContext,
|
|
||||||
capabilities,
|
|
||||||
mockContext,
|
|
||||||
mockOverlayAPI,
|
|
||||||
mockDomainObject,
|
|
||||||
mockMutation,
|
|
||||||
mockNavigationService,
|
|
||||||
mockParent,
|
|
||||||
mockType,
|
|
||||||
model;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
|
||||||
["getId", "getCapability", "getModel"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockMutation = jasmine.createSpyObj("mutation", ["invoke"]);
|
|
||||||
mockType = jasmine.createSpyObj("type", ["hasFeature"]);
|
|
||||||
mockType.hasFeature.and.returnValue(true);
|
|
||||||
|
|
||||||
capabilities = {
|
|
||||||
mutation: mockMutation,
|
|
||||||
type: mockType
|
|
||||||
};
|
|
||||||
|
|
||||||
model = {
|
|
||||||
composition: ["a", "test", "b"]
|
|
||||||
};
|
|
||||||
|
|
||||||
mockParent = {
|
|
||||||
getModel: function () {
|
|
||||||
return model;
|
|
||||||
},
|
|
||||||
getCapability: function (k) {
|
|
||||||
return capabilities[k];
|
|
||||||
},
|
|
||||||
useCapability: function (k, v) {
|
|
||||||
return capabilities[k].invoke(v);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
mockOverlayAPI = jasmine.createSpyObj(
|
|
||||||
"overlayAPI",
|
|
||||||
["dialog"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockNavigationService = jasmine.createSpyObj(
|
|
||||||
"navigationService",
|
|
||||||
[
|
|
||||||
"getNavigation",
|
|
||||||
"setNavigation",
|
|
||||||
"addListener",
|
|
||||||
"removeListener"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockDomainObject);
|
|
||||||
|
|
||||||
mockContext = jasmine.createSpyObj("context", ["getParent"]);
|
|
||||||
mockContext.getParent.and.returnValue(mockParent);
|
|
||||||
|
|
||||||
mockDomainObject.getId.and.returnValue("test");
|
|
||||||
mockDomainObject.getCapability.and.returnValue(mockContext);
|
|
||||||
mockDomainObject.getModel.and.returnValue({name: 'test object'});
|
|
||||||
|
|
||||||
mockContext.getParent.and.returnValue(mockParent);
|
|
||||||
mockType.hasFeature.and.returnValue(true);
|
|
||||||
|
|
||||||
actionContext = { domainObject: mockDomainObject };
|
|
||||||
|
|
||||||
action = new RemoveAction({overlays: mockOverlayAPI}, mockNavigationService, actionContext);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("only applies to objects with parents", function () {
|
|
||||||
expect(RemoveAction.appliesTo(actionContext)).toBeTruthy();
|
|
||||||
|
|
||||||
mockContext.getParent.and.returnValue(undefined);
|
|
||||||
|
|
||||||
expect(RemoveAction.appliesTo(actionContext)).toBeFalsy();
|
|
||||||
|
|
||||||
// Also verify that creatability was checked
|
|
||||||
expect(mockType.hasFeature).toHaveBeenCalledWith('creation');
|
|
||||||
});
|
|
||||||
|
|
||||||
it("shows a blocking message dialog", function () {
|
|
||||||
mockParent = jasmine.createSpyObj(
|
|
||||||
"parent",
|
|
||||||
["getModel", "getCapability", "useCapability"]
|
|
||||||
);
|
|
||||||
|
|
||||||
action.perform();
|
|
||||||
|
|
||||||
expect(mockOverlayAPI.dialog).toHaveBeenCalled();
|
|
||||||
|
|
||||||
// Also check that no mutation happens at this point
|
|
||||||
expect(mockParent.useCapability).not.toHaveBeenCalledWith("mutation", jasmine.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("after the remove callback is triggered", function () {
|
|
||||||
var mockChildContext,
|
|
||||||
mockChildObject,
|
|
||||||
mockDialogHandle,
|
|
||||||
mockGrandchildContext,
|
|
||||||
mockGrandchildObject,
|
|
||||||
mockRootContext,
|
|
||||||
mockRootObject;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
mockChildObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
|
||||||
["getId", "getCapability"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockDialogHandle = jasmine.createSpyObj(
|
|
||||||
"dialogHandle",
|
|
||||||
["dismiss"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockGrandchildObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
|
||||||
["getId", "getCapability"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockRootObject = jasmine.createSpyObj(
|
|
||||||
"domainObject",
|
|
||||||
["getId", "getCapability"]
|
|
||||||
);
|
|
||||||
|
|
||||||
mockChildContext = jasmine.createSpyObj("context", ["getParent"]);
|
|
||||||
mockGrandchildContext = jasmine.createSpyObj("context", ["getParent"]);
|
|
||||||
mockRootContext = jasmine.createSpyObj("context", ["getParent"]);
|
|
||||||
|
|
||||||
mockOverlayAPI.dialog.and.returnValue(mockDialogHandle);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("mutates the parent when performed", function () {
|
|
||||||
action.perform();
|
|
||||||
mockOverlayAPI.dialog.calls.mostRecent().args[0]
|
|
||||||
.buttons[0].callback();
|
|
||||||
|
|
||||||
expect(mockMutation.invoke)
|
|
||||||
.toHaveBeenCalledWith(jasmine.any(Function));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("changes composition from its mutation function", function () {
|
|
||||||
var mutator, result;
|
|
||||||
|
|
||||||
action.perform();
|
|
||||||
mockOverlayAPI.dialog.calls.mostRecent().args[0]
|
|
||||||
.buttons[0].callback();
|
|
||||||
|
|
||||||
mutator = mockMutation.invoke.calls.mostRecent().args[0];
|
|
||||||
result = mutator(model);
|
|
||||||
|
|
||||||
// Should not have cancelled the mutation
|
|
||||||
expect(result).not.toBe(false);
|
|
||||||
|
|
||||||
// Simulate mutate's behavior (remove can either return a
|
|
||||||
// new model or modify this one in-place)
|
|
||||||
result = result || model;
|
|
||||||
|
|
||||||
// Should have removed "test" - that was our
|
|
||||||
// mock domain object's id.
|
|
||||||
expect(result.composition).toEqual(["a", "b"]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("removes parent of object currently navigated to", function () {
|
|
||||||
// Navigates to child object
|
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockChildObject);
|
|
||||||
|
|
||||||
// Test is id of object being removed
|
|
||||||
// Child object has different id
|
|
||||||
mockDomainObject.getId.and.returnValue("test");
|
|
||||||
mockChildObject.getId.and.returnValue("not test");
|
|
||||||
|
|
||||||
// Sets context for the child and domainObject
|
|
||||||
mockDomainObject.getCapability.and.returnValue(mockContext);
|
|
||||||
mockChildObject.getCapability.and.returnValue(mockChildContext);
|
|
||||||
|
|
||||||
// Parents of child and domainObject are set
|
|
||||||
mockContext.getParent.and.returnValue(mockParent);
|
|
||||||
mockChildContext.getParent.and.returnValue(mockDomainObject);
|
|
||||||
|
|
||||||
mockType.hasFeature.and.returnValue(true);
|
|
||||||
|
|
||||||
action.perform();
|
|
||||||
mockOverlayAPI.dialog.calls.mostRecent().args[0]
|
|
||||||
.buttons[0].callback();
|
|
||||||
|
|
||||||
// Expects navigation to parent of domainObject (removed object)
|
|
||||||
expect(mockNavigationService.setNavigation).toHaveBeenCalledWith(mockParent);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("checks if removing object not in ascendent path (reaches ROOT)", function () {
|
|
||||||
// Navigates to grandchild of ROOT
|
|
||||||
mockNavigationService.getNavigation.and.returnValue(mockGrandchildObject);
|
|
||||||
|
|
||||||
// domainObject (grandparent) is set as ROOT, child and grandchild
|
|
||||||
// are set objects not being removed
|
|
||||||
mockDomainObject.getId.and.returnValue("test 1");
|
|
||||||
mockRootObject.getId.and.returnValue("ROOT");
|
|
||||||
mockChildObject.getId.and.returnValue("not test 2");
|
|
||||||
mockGrandchildObject.getId.and.returnValue("not test 3");
|
|
||||||
|
|
||||||
// Sets context for the grandchild, child, and domainObject
|
|
||||||
mockRootObject.getCapability.and.returnValue(mockRootContext);
|
|
||||||
mockChildObject.getCapability.and.returnValue(mockChildContext);
|
|
||||||
mockGrandchildObject.getCapability.and.returnValue(mockGrandchildContext);
|
|
||||||
|
|
||||||
// Parents of grandchild and child are set
|
|
||||||
mockChildContext.getParent.and.returnValue(mockRootObject);
|
|
||||||
mockGrandchildContext.getParent.and.returnValue(mockChildObject);
|
|
||||||
|
|
||||||
mockType.hasFeature.and.returnValue(true);
|
|
||||||
|
|
||||||
action.perform();
|
|
||||||
mockOverlayAPI.dialog.calls.mostRecent().args[0]
|
|
||||||
.buttons[0].callback();
|
|
||||||
|
|
||||||
// Expects no navigation to occur
|
|
||||||
expect(mockNavigationService.setNavigation).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
@ -25,7 +25,7 @@ define(
|
|||||||
["../../src/actions/SaveAsAction"],
|
["../../src/actions/SaveAsAction"],
|
||||||
function (SaveAsAction) {
|
function (SaveAsAction) {
|
||||||
|
|
||||||
describe("The Save As action", function () {
|
xdescribe("The Save As action", function () {
|
||||||
var mockDomainObject,
|
var mockDomainObject,
|
||||||
mockClonedObject,
|
mockClonedObject,
|
||||||
mockEditorCapability,
|
mockEditorCapability,
|
||||||
|
@ -24,7 +24,7 @@ define(
|
|||||||
["../../src/capabilities/EditorCapability"],
|
["../../src/capabilities/EditorCapability"],
|
||||||
function (EditorCapability) {
|
function (EditorCapability) {
|
||||||
|
|
||||||
describe("The editor capability", function () {
|
xdescribe("The editor capability", function () {
|
||||||
var mockDomainObject,
|
var mockDomainObject,
|
||||||
capabilities,
|
capabilities,
|
||||||
mockParentObject,
|
mockParentObject,
|
||||||
|
@ -27,7 +27,7 @@ define(
|
|||||||
["../../src/creation/CreateAction"],
|
["../../src/creation/CreateAction"],
|
||||||
function (CreateAction) {
|
function (CreateAction) {
|
||||||
|
|
||||||
describe("The create action", function () {
|
xdescribe("The create action", function () {
|
||||||
var mockType,
|
var mockType,
|
||||||
mockParent,
|
mockParent,
|
||||||
mockContext,
|
mockContext,
|
||||||
|
@ -27,7 +27,7 @@ define(
|
|||||||
["../../src/creation/CreateWizard"],
|
["../../src/creation/CreateWizard"],
|
||||||
function (CreateWizard) {
|
function (CreateWizard) {
|
||||||
|
|
||||||
describe("The create wizard", function () {
|
xdescribe("The create wizard", function () {
|
||||||
var mockType,
|
var mockType,
|
||||||
mockParent,
|
mockParent,
|
||||||
mockProperties,
|
mockProperties,
|
||||||
|
@ -26,7 +26,7 @@ define([
|
|||||||
'zepto'
|
'zepto'
|
||||||
], function (TreeView, $) {
|
], function (TreeView, $) {
|
||||||
|
|
||||||
describe("TreeView", function () {
|
xdescribe("TreeView", function () {
|
||||||
var mockGestureService,
|
var mockGestureService,
|
||||||
mockGestureHandle,
|
mockGestureHandle,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
|
@ -24,7 +24,7 @@ define(
|
|||||||
['../src/NotificationIndicatorController'],
|
['../src/NotificationIndicatorController'],
|
||||||
function (NotificationIndicatorController) {
|
function (NotificationIndicatorController) {
|
||||||
|
|
||||||
describe("The notification indicator controller ", function () {
|
xdescribe("The notification indicator controller ", function () {
|
||||||
var mockNotificationService,
|
var mockNotificationService,
|
||||||
mockScope,
|
mockScope,
|
||||||
mockDialogService,
|
mockDialogService,
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
define(
|
define(
|
||||||
["../src/ComposeActionPolicy"],
|
["../src/ComposeActionPolicy"],
|
||||||
function (ComposeActionPolicy) {
|
function (ComposeActionPolicy) {
|
||||||
describe("The compose action policy", function () {
|
xdescribe("The compose action policy", function () {
|
||||||
var mockInjector,
|
var mockInjector,
|
||||||
mockPolicyService,
|
mockPolicyService,
|
||||||
mockTypes,
|
mockTypes,
|
||||||
|
@ -42,7 +42,7 @@ define(
|
|||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("CopyService", function () {
|
xdescribe("CopyService", function () {
|
||||||
var policyService;
|
var policyService;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@ -29,7 +29,7 @@ define(
|
|||||||
],
|
],
|
||||||
function (LinkService, domainObjectFactory, ControlledPromise) {
|
function (LinkService, domainObjectFactory, ControlledPromise) {
|
||||||
|
|
||||||
describe("LinkService", function () {
|
xdescribe("LinkService", function () {
|
||||||
|
|
||||||
var linkService,
|
var linkService,
|
||||||
mockPolicyService;
|
mockPolicyService;
|
||||||
|
@ -34,7 +34,7 @@ define(
|
|||||||
ControlledPromise
|
ControlledPromise
|
||||||
) {
|
) {
|
||||||
|
|
||||||
describe("MoveService", function () {
|
xdescribe("MoveService", function () {
|
||||||
|
|
||||||
var moveService,
|
var moveService,
|
||||||
policyService,
|
policyService,
|
||||||
|
@ -31,7 +31,7 @@ define([
|
|||||||
MCT,
|
MCT,
|
||||||
$
|
$
|
||||||
) {
|
) {
|
||||||
describe("The timer-following indicator", function () {
|
xdescribe("The timer-following indicator", function () {
|
||||||
var timerService;
|
var timerService;
|
||||||
var openmct;
|
var openmct;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ define(
|
|||||||
var MOCK_ELEMENT_TEMPLATE =
|
var MOCK_ELEMENT_TEMPLATE =
|
||||||
'<div class="l-image-thumbs-wrapper"></div>';
|
'<div class="l-image-thumbs-wrapper"></div>';
|
||||||
|
|
||||||
describe("The Imagery controller", function () {
|
xdescribe("The Imagery controller", function () {
|
||||||
var $scope,
|
var $scope,
|
||||||
openmct,
|
openmct,
|
||||||
oldDomainObject,
|
oldDomainObject,
|
||||||
|
@ -24,7 +24,7 @@ define(
|
|||||||
["../src/MCTFileInput"],
|
["../src/MCTFileInput"],
|
||||||
function (MCTFileInput) {
|
function (MCTFileInput) {
|
||||||
|
|
||||||
describe("The mct-file-input directive", function () {
|
xdescribe("The mct-file-input directive", function () {
|
||||||
|
|
||||||
var mockScope,
|
var mockScope,
|
||||||
mockFileInputService,
|
mockFileInputService,
|
||||||
|
@ -55,13 +55,13 @@ define([
|
|||||||
|
|
||||||
FrameworkLayer.prototype.initializeApplication = function (
|
FrameworkLayer.prototype.initializeApplication = function (
|
||||||
angular,
|
angular,
|
||||||
legacyRegistry,
|
openmct,
|
||||||
logLevel
|
logLevel
|
||||||
) {
|
) {
|
||||||
var $http = this.$http,
|
var $http = this.$http,
|
||||||
$log = this.$log,
|
$log = this.$log,
|
||||||
app = angular.module(Constants.MODULE_NAME, ["ngRoute"]),
|
app = angular.module(Constants.MODULE_NAME, ["ngRoute"]),
|
||||||
loader = new BundleLoader($http, $log, legacyRegistry),
|
loader = new BundleLoader($http, $log, openmct.legacyRegistry),
|
||||||
resolver = new BundleResolver(
|
resolver = new BundleResolver(
|
||||||
new ExtensionResolver(
|
new ExtensionResolver(
|
||||||
new ImplementationLoader({}),
|
new ImplementationLoader({}),
|
||||||
@ -77,7 +77,7 @@ define([
|
|||||||
),
|
),
|
||||||
bootstrapper = new ApplicationBootstrapper(
|
bootstrapper = new ApplicationBootstrapper(
|
||||||
angular,
|
angular,
|
||||||
window.document,
|
openmct.element,
|
||||||
$log
|
$log
|
||||||
),
|
),
|
||||||
initializer = new FrameworkInitializer(
|
initializer = new FrameworkInitializer(
|
||||||
|
@ -41,7 +41,7 @@ define(
|
|||||||
function Main() {
|
function Main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Main.prototype.run = function (legacyRegistry) {
|
Main.prototype.run = function (openmct) {
|
||||||
// Get a reference to Angular's injector, so we can get $http and $log
|
// Get a reference to Angular's injector, so we can get $http and $log
|
||||||
// services, which are useful to the framework layer.
|
// services, which are useful to the framework layer.
|
||||||
var injector = angular.injector(['ng']);
|
var injector = angular.injector(['ng']);
|
||||||
@ -53,7 +53,7 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return injector.instantiate(['$http', '$log', FrameworkLayer])
|
return injector.instantiate(['$http', '$log', FrameworkLayer])
|
||||||
.initializeApplication(angular, legacyRegistry, logLevel());
|
.initializeApplication(angular, openmct, logLevel());
|
||||||
};
|
};
|
||||||
|
|
||||||
return Main;
|
return Main;
|
||||||
|
@ -72,7 +72,6 @@ define([
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
openmct.legacyRegistry.enable('platform/import-export');
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, objectUtils) {
|
||||||
define(['zepto'], function ($) {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ImportAsJSONAction is available from context menus and allows a user
|
* The ImportAsJSONAction is available from context menus and allows a user
|
||||||
@ -61,9 +60,15 @@ define(['zepto'], function ($) {
|
|||||||
|
|
||||||
ImportAsJSONAction.prototype.importObjectTree = function (objTree) {
|
ImportAsJSONAction.prototype.importObjectTree = function (objTree) {
|
||||||
var parent = this.context.domainObject;
|
var parent = this.context.domainObject;
|
||||||
var tree = this.generateNewIdentifiers(objTree);
|
var namespace = parent.useCapability('adapter').identifier.namespace;
|
||||||
|
|
||||||
|
var tree = this.generateNewIdentifiers(objTree, namespace);
|
||||||
var rootId = tree.rootId;
|
var rootId = tree.rootId;
|
||||||
var rootObj = this.instantiate(tree.openmct[rootId], rootId);
|
|
||||||
|
var rootModel = tree.openmct[rootId];
|
||||||
|
delete rootModel.persisted;
|
||||||
|
|
||||||
|
var rootObj = this.instantiate(rootModel, rootId);
|
||||||
var newStyleParent = parent.useCapability('adapter');
|
var newStyleParent = parent.useCapability('adapter');
|
||||||
var newStyleRootObj = rootObj.useCapability('adapter');
|
var newStyleRootObj = rootObj.useCapability('adapter');
|
||||||
|
|
||||||
@ -105,8 +110,10 @@ define(['zepto'], function ($) {
|
|||||||
if (!tree[keystring] || seen.includes(keystring)) {
|
if (!tree[keystring] || seen.includes(keystring)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let newModel = tree[keystring];
|
||||||
|
delete newModel.persisted;
|
||||||
|
|
||||||
newObj = this.instantiate(tree[keystring], keystring);
|
newObj = this.instantiate(newModel, keystring);
|
||||||
newObj.getCapability("location")
|
newObj.getCapability("location")
|
||||||
.setPrimaryLocation(tree[keystring].location);
|
.setPrimaryLocation(tree[keystring].location);
|
||||||
this.deepInstantiate(newObj, tree, seen);
|
this.deepInstantiate(newObj, tree, seen);
|
||||||
@ -114,11 +121,17 @@ define(['zepto'], function ($) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ImportAsJSONAction.prototype.generateNewIdentifiers = function (tree) {
|
ImportAsJSONAction.prototype.generateNewIdentifiers = function (tree, namespace) {
|
||||||
// For each domain object in the file, generate new ID, replace in tree
|
// For each domain object in the file, generate new ID, replace in tree
|
||||||
Object.keys(tree.openmct).forEach(function (domainObjectId) {
|
Object.keys(tree.openmct).forEach(function (domainObjectId) {
|
||||||
var newId = this.identifierService.generate();
|
let newId = {
|
||||||
tree = this.rewriteId(domainObjectId, newId, tree);
|
namespace: namespace,
|
||||||
|
key: this.identifierService.generate()
|
||||||
|
};
|
||||||
|
|
||||||
|
let oldId = objectUtils.parseKeyString(domainObjectId);
|
||||||
|
|
||||||
|
tree = this.rewriteId(oldId, newId, tree);
|
||||||
}, this);
|
}, this);
|
||||||
return tree;
|
return tree;
|
||||||
};
|
};
|
||||||
@ -129,9 +142,21 @@ define(['zepto'], function ($) {
|
|||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ImportAsJSONAction.prototype.rewriteId = function (oldID, newID, tree) {
|
ImportAsJSONAction.prototype.rewriteId = function (oldId, newId, tree) {
|
||||||
tree = JSON.stringify(tree).replace(new RegExp(oldID, 'g'), newID);
|
let newIdKeyString = this.openmct.objects.makeKeyString(newId);
|
||||||
return JSON.parse(tree);
|
let oldIdKeyString = this.openmct.objects.makeKeyString(oldId);
|
||||||
|
tree = JSON.stringify(tree).replace(new RegExp(oldIdKeyString, 'g'), newIdKeyString);
|
||||||
|
|
||||||
|
return JSON.parse(tree, (key, value) => {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(value, 'key') &&
|
||||||
|
Object.prototype.hasOwnProperty.call(value, 'namespace') &&
|
||||||
|
value.key === oldId.key &&
|
||||||
|
value.namespace === oldId.namespace) {
|
||||||
|
return newId
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
ImportAsJSONAction.prototype.getFormModel = function () {
|
ImportAsJSONAction.prototype.getFormModel = function () {
|
||||||
|
@ -29,7 +29,7 @@ define(
|
|||||||
],
|
],
|
||||||
function (ExportAsJSONAction, domainObjectFactory, MCT, AdapterCapability) {
|
function (ExportAsJSONAction, domainObjectFactory, MCT, AdapterCapability) {
|
||||||
|
|
||||||
describe("The export JSON action", function () {
|
xdescribe("The export JSON action", function () {
|
||||||
|
|
||||||
var context,
|
var context,
|
||||||
action,
|
action,
|
||||||
|
@ -27,7 +27,7 @@ define(
|
|||||||
],
|
],
|
||||||
function (ImportAsJSONAction, domainObjectFactory) {
|
function (ImportAsJSONAction, domainObjectFactory) {
|
||||||
|
|
||||||
describe("The import JSON action", function () {
|
xdescribe("The import JSON action", function () {
|
||||||
|
|
||||||
var context = {};
|
var context = {};
|
||||||
var action,
|
var action,
|
||||||
|
@ -24,7 +24,7 @@ define(
|
|||||||
["../src/CouchIndicator"],
|
["../src/CouchIndicator"],
|
||||||
function (CouchIndicator) {
|
function (CouchIndicator) {
|
||||||
|
|
||||||
describe("The CouchDB status indicator", function () {
|
xdescribe("The CouchDB status indicator", function () {
|
||||||
var mockHttp,
|
var mockHttp,
|
||||||
mockInterval,
|
mockInterval,
|
||||||
testPath,
|
testPath,
|
||||||
|
@ -24,7 +24,7 @@ define(
|
|||||||
["../src/ElasticIndicator"],
|
["../src/ElasticIndicator"],
|
||||||
function (ElasticIndicator) {
|
function (ElasticIndicator) {
|
||||||
|
|
||||||
describe("The ElasticSearch status indicator", function () {
|
xdescribe("The ElasticSearch status indicator", function () {
|
||||||
var mockHttp,
|
var mockHttp,
|
||||||
mockInterval,
|
mockInterval,
|
||||||
testPath,
|
testPath,
|
||||||
|
@ -24,7 +24,7 @@ define(
|
|||||||
["../src/LocalStorageIndicator"],
|
["../src/LocalStorageIndicator"],
|
||||||
function (LocalStorageIndicator) {
|
function (LocalStorageIndicator) {
|
||||||
|
|
||||||
describe("The local storage status indicator", function () {
|
xdescribe("The local storage status indicator", function () {
|
||||||
var indicator;
|
var indicator;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@ -32,14 +32,6 @@ define(
|
|||||||
mockPromise,
|
mockPromise,
|
||||||
handler;
|
handler;
|
||||||
|
|
||||||
function asPromise(value) {
|
|
||||||
return (value || {}).then ? value : {
|
|
||||||
then: function (callback) {
|
|
||||||
return asPromise(callback(value));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function makeMockFailure(id, index) {
|
function makeMockFailure(id, index) {
|
||||||
var mockFailure = jasmine.createSpyObj(
|
var mockFailure = jasmine.createSpyObj(
|
||||||
'failure-' + id,
|
'failure-' + id,
|
||||||
|
@ -29,6 +29,7 @@ define([
|
|||||||
"./res/templates/search.html",
|
"./res/templates/search.html",
|
||||||
"./res/templates/search-menu.html",
|
"./res/templates/search-menu.html",
|
||||||
"raw-loader!./src/services/GenericSearchWorker.js",
|
"raw-loader!./src/services/GenericSearchWorker.js",
|
||||||
|
"raw-loader!./src/services/BareBonesSearchWorker.js",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
SearchController,
|
SearchController,
|
||||||
@ -39,6 +40,7 @@ define([
|
|||||||
searchTemplate,
|
searchTemplate,
|
||||||
searchMenuTemplate,
|
searchMenuTemplate,
|
||||||
searchWorkerText,
|
searchWorkerText,
|
||||||
|
BareBonesSearchWorkerText,
|
||||||
legacyRegistry
|
legacyRegistry
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -53,6 +55,11 @@ define([
|
|||||||
"ROOT"
|
"ROOT"
|
||||||
],
|
],
|
||||||
"priority": "fallback"
|
"priority": "fallback"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "USE_LEGACY_INDEXER",
|
||||||
|
"value": false,
|
||||||
|
"priority": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"controllers": [
|
"controllers": [
|
||||||
@ -101,6 +108,7 @@ define([
|
|||||||
"workerService",
|
"workerService",
|
||||||
"topic",
|
"topic",
|
||||||
"GENERIC_SEARCH_ROOTS",
|
"GENERIC_SEARCH_ROOTS",
|
||||||
|
"USE_LEGACY_INDEXER",
|
||||||
"openmct"
|
"openmct"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -115,6 +123,10 @@ define([
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"workers": [
|
"workers": [
|
||||||
|
{
|
||||||
|
"key": "bareBonesSearchWorker",
|
||||||
|
"scriptText": BareBonesSearchWorkerText
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "genericSearchWorker",
|
"key": "genericSearchWorker",
|
||||||
"scriptText": searchWorkerText
|
"scriptText": searchWorkerText
|
||||||
|
80
platform/search/src/services/BareBonesSearchWorker.js
Normal file
80
platform/search/src/services/BareBonesSearchWorker.js
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* 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 self*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module defining BareBonesSearchWorker. Created by deeptailor on 10/03/2019.
|
||||||
|
*/
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
// An array of objects composed of domain object IDs and names
|
||||||
|
// {id: domainObject's ID, name: domainObject's name}
|
||||||
|
var indexedItems = [];
|
||||||
|
|
||||||
|
function indexItem(id, model) {
|
||||||
|
indexedItems.push({
|
||||||
|
id: id,
|
||||||
|
name: model.name.toLowerCase()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets search results from the indexedItems based on provided search
|
||||||
|
* input. Returns matching results from indexedItems
|
||||||
|
*
|
||||||
|
* @param data An object which contains:
|
||||||
|
* * input: The original string which we are searching with
|
||||||
|
* * maxResults: The maximum number of search results desired
|
||||||
|
* * queryId: an id identifying this query, will be returned.
|
||||||
|
*/
|
||||||
|
function search(data) {
|
||||||
|
// This results dictionary will have domain object ID keys which
|
||||||
|
// point to the value the domain object's score.
|
||||||
|
var results,
|
||||||
|
input = data.input.trim().toLowerCase(),
|
||||||
|
message = {
|
||||||
|
request: 'search',
|
||||||
|
results: {},
|
||||||
|
total: 0,
|
||||||
|
queryId: data.queryId
|
||||||
|
};
|
||||||
|
|
||||||
|
results = indexedItems.filter((indexedItem) => {
|
||||||
|
return indexedItem.name.includes(input);
|
||||||
|
});
|
||||||
|
|
||||||
|
message.total = results.length;
|
||||||
|
message.results = results
|
||||||
|
.slice(0, data.maxResults);
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.onmessage = function (event) {
|
||||||
|
if (event.data.request === 'index') {
|
||||||
|
indexItem(event.data.id, event.data.model);
|
||||||
|
} else if (event.data.request === 'search') {
|
||||||
|
self.postMessage(search(event.data));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}());
|
@ -44,7 +44,7 @@ define([
|
|||||||
* @param {TopicService} topic the topic service.
|
* @param {TopicService} topic the topic service.
|
||||||
* @param {Array} ROOTS An array of object Ids to begin indexing.
|
* @param {Array} ROOTS An array of object Ids to begin indexing.
|
||||||
*/
|
*/
|
||||||
function GenericSearchProvider($q, $log, modelService, workerService, topic, ROOTS, openmct) {
|
function GenericSearchProvider($q, $log, modelService, workerService, topic, ROOTS, USE_LEGACY_INDEXER, openmct) {
|
||||||
var provider = this;
|
var provider = this;
|
||||||
this.$q = $q;
|
this.$q = $q;
|
||||||
this.$log = $log;
|
this.$log = $log;
|
||||||
@ -58,6 +58,8 @@ define([
|
|||||||
|
|
||||||
this.pendingQueries = {};
|
this.pendingQueries = {};
|
||||||
|
|
||||||
|
this.USE_LEGACY_INDEXER = USE_LEGACY_INDEXER;
|
||||||
|
|
||||||
this.worker = this.startWorker(workerService);
|
this.worker = this.startWorker(workerService);
|
||||||
this.indexOnMutation(topic);
|
this.indexOnMutation(topic);
|
||||||
|
|
||||||
@ -101,8 +103,14 @@ define([
|
|||||||
* @returns worker the created search worker.
|
* @returns worker the created search worker.
|
||||||
*/
|
*/
|
||||||
GenericSearchProvider.prototype.startWorker = function (workerService) {
|
GenericSearchProvider.prototype.startWorker = function (workerService) {
|
||||||
var worker = workerService.run('genericSearchWorker'),
|
var provider = this,
|
||||||
provider = this;
|
worker;
|
||||||
|
|
||||||
|
if (this.USE_LEGACY_INDEXER) {
|
||||||
|
worker = workerService.run('genericSearchWorker');
|
||||||
|
} else {
|
||||||
|
worker = workerService.run('bareBonesSearchWorker');
|
||||||
|
}
|
||||||
|
|
||||||
worker.addEventListener('message', function (messageEvent) {
|
worker.addEventListener('message', function (messageEvent) {
|
||||||
provider.onWorkerMessage(messageEvent);
|
provider.onWorkerMessage(messageEvent);
|
||||||
@ -242,18 +250,34 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pendingQuery = this.pendingQueries[event.data.queryId],
|
var pendingQuery,
|
||||||
|
modelResults;
|
||||||
|
|
||||||
|
if (this.USE_LEGACY_INDEXER) {
|
||||||
|
pendingQuery = this.pendingQueries[event.data.queryId];
|
||||||
modelResults = {
|
modelResults = {
|
||||||
total: event.data.total
|
total: event.data.total
|
||||||
};
|
};
|
||||||
|
|
||||||
modelResults.hits = event.data.results.map(function (hit) {
|
modelResults.hits = event.data.results.map(function (hit) {
|
||||||
return {
|
return {
|
||||||
id: hit.item.id,
|
id: hit.item.id,
|
||||||
model: hit.item.model,
|
model: hit.item.model,
|
||||||
score: hit.matchCount
|
score: hit.matchCount
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
pendingQuery = this.pendingQueries[event.data.queryId];
|
||||||
|
modelResults = {
|
||||||
|
total: event.data.total
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
modelResults.hits = event.data.results.map(function (hit) {
|
||||||
|
return {
|
||||||
|
id: hit.id
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
pendingQuery.resolve(modelResults);
|
pendingQuery.resolve(modelResults);
|
||||||
delete this.pendingQueries[event.data.queryId];
|
delete this.pendingQueries[event.data.queryId];
|
||||||
|
@ -29,7 +29,7 @@ define([
|
|||||||
GenericSearchProvider
|
GenericSearchProvider
|
||||||
) {
|
) {
|
||||||
|
|
||||||
describe('GenericSearchProvider', function () {
|
xdescribe('GenericSearchProvider', function () {
|
||||||
var $q,
|
var $q,
|
||||||
$log,
|
$log,
|
||||||
modelService,
|
modelService,
|
||||||
|
12
src/MCT.js
12
src/MCT.js
@ -95,12 +95,15 @@ define([
|
|||||||
*/
|
*/
|
||||||
function MCT() {
|
function MCT() {
|
||||||
EventEmitter.call(this);
|
EventEmitter.call(this);
|
||||||
|
/* eslint-disable no-undef */
|
||||||
this.buildInfo = {
|
this.buildInfo = {
|
||||||
version: __OPENMCT_VERSION__,
|
version: __OPENMCT_VERSION__,
|
||||||
buildDate: __OPENMCT_BUILD_DATE__,
|
buildDate: __OPENMCT_BUILD_DATE__,
|
||||||
revision: __OPENMCT_REVISION__,
|
revision: __OPENMCT_REVISION__,
|
||||||
branch: __OPENMCT_BUILD_BRANCH__
|
branch: __OPENMCT_BUILD_BRANCH__
|
||||||
};
|
};
|
||||||
|
/* eslint-enable no-undef */
|
||||||
|
|
||||||
|
|
||||||
this.legacyBundle = { extensions: {
|
this.legacyBundle = { extensions: {
|
||||||
services: [
|
services: [
|
||||||
@ -260,10 +263,6 @@ define([
|
|||||||
this.install(this.plugins.Tabs());
|
this.install(this.plugins.Tabs());
|
||||||
this.install(this.plugins.FlexibleLayout());
|
this.install(this.plugins.FlexibleLayout());
|
||||||
this.install(this.plugins.GoToOriginalAction());
|
this.install(this.plugins.GoToOriginalAction());
|
||||||
|
|
||||||
if (typeof BUILD_CONSTANTS !== 'undefined') {
|
|
||||||
this.install(buildInfoPlugin(BUILD_CONSTANTS));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MCT.prototype = Object.create(EventEmitter.prototype);
|
MCT.prototype = Object.create(EventEmitter.prototype);
|
||||||
@ -344,6 +343,8 @@ define([
|
|||||||
domElement = document.body;
|
domElement = document.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.element = domElement;
|
||||||
|
|
||||||
this.legacyExtension('runs', {
|
this.legacyExtension('runs', {
|
||||||
depends: ['navigationService'],
|
depends: ['navigationService'],
|
||||||
implementation: function (navigationService) {
|
implementation: function (navigationService) {
|
||||||
@ -373,7 +374,8 @@ define([
|
|||||||
* @event start
|
* @event start
|
||||||
* @memberof module:openmct.MCT~
|
* @memberof module:openmct.MCT~
|
||||||
*/
|
*/
|
||||||
var startPromise = new Main().run(this.legacyRegistry)
|
const startPromise = new Main()
|
||||||
|
startPromise.run(this)
|
||||||
.then(function (angular) {
|
.then(function (angular) {
|
||||||
this.$angular = angular;
|
this.$angular = angular;
|
||||||
// OpenMCT Object provider doesn't operate properly unless
|
// OpenMCT Object provider doesn't operate properly unless
|
||||||
|
@ -25,7 +25,7 @@ define([
|
|||||||
'./plugins/plugins',
|
'./plugins/plugins',
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (MCT, plugins, legacyRegistry) {
|
], function (MCT, plugins, legacyRegistry) {
|
||||||
describe("MCT", function () {
|
xdescribe("MCT", function () {
|
||||||
var openmct;
|
var openmct;
|
||||||
var mockPlugin;
|
var mockPlugin;
|
||||||
var mockPlugin2;
|
var mockPlugin2;
|
||||||
|
@ -37,7 +37,7 @@ define(
|
|||||||
var legacyExtensionFunction = MCT.prototype.legacyExtension;
|
var legacyExtensionFunction = MCT.prototype.legacyExtension;
|
||||||
var legacyIndicatorsRunsFunction;
|
var legacyIndicatorsRunsFunction;
|
||||||
|
|
||||||
describe('The legacy indicators plugin', function () {
|
xdescribe('The legacy indicators plugin', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockLegacyExtensionFunction();
|
mockLegacyExtensionFunction();
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
export default function legacyCompositionPolicyAdapter(openmct) {
|
export default function legacyCompositionPolicyAdapter(openmct) {
|
||||||
const instantiate = this.openmct.$injector.get('instantiate');
|
const instantiate = openmct.$injector.get('instantiate');
|
||||||
const policyService = this.openmct.$injector.get('policyService');
|
const policyService = openmct.$injector.get('policyService');
|
||||||
|
|
||||||
openmct.composition.addPolicy((parent, child) => {
|
openmct.composition.addPolicy((parent, child) => {
|
||||||
|
|
||||||
let parentId = this.openmct.objects.makeKeyString(parent.identifier);
|
let parentId = openmct.objects.makeKeyString(parent.identifier);
|
||||||
let childId = this.openmct.objects.makeKeyString(child.identifier);
|
let childId = openmct.objects.makeKeyString(child.identifier);
|
||||||
|
|
||||||
let legacyParent = instantiate(parent, parentId);
|
let legacyParent = instantiate(parent, parentId);
|
||||||
let legacyChild = instantiate(child, childId);
|
let legacyChild = instantiate(child, childId);
|
||||||
|
@ -3,17 +3,6 @@ define([
|
|||||||
], function (
|
], function (
|
||||||
|
|
||||||
) {
|
) {
|
||||||
const DEFAULT_VIEW_PRIORITY = 100;
|
|
||||||
|
|
||||||
const PRIORITY_LEVELS = {
|
|
||||||
"fallback": Number.NEGATIVE_INFINITY,
|
|
||||||
"default": -100,
|
|
||||||
"none": 0,
|
|
||||||
"optional": DEFAULT_VIEW_PRIORITY,
|
|
||||||
"preferred": 1000,
|
|
||||||
"mandatory": Number.POSITIVE_INFINITY
|
|
||||||
};
|
|
||||||
|
|
||||||
function TypeInspectorViewProvider(typeDefinition, openmct, convertToLegacyObject) {
|
function TypeInspectorViewProvider(typeDefinition, openmct, convertToLegacyObject) {
|
||||||
console.warn(`DEPRECATION WARNING: Migrate ${typeDefinition.key} from ${typeDefinition.bundle.path} to use the new Inspector View APIs. Legacy Inspector view support will be removed soon.`);
|
console.warn(`DEPRECATION WARNING: Migrate ${typeDefinition.key} from ${typeDefinition.bundle.path} to use the new Inspector View APIs. Legacy Inspector view support will be removed soon.`);
|
||||||
let representation = openmct.$injector.get('representations[]')
|
let representation = openmct.$injector.get('representations[]')
|
||||||
|
@ -29,7 +29,7 @@ define(
|
|||||||
MCT,
|
MCT,
|
||||||
MCTIndicators
|
MCTIndicators
|
||||||
) {
|
) {
|
||||||
describe("The Indicator API", function () {
|
xdescribe("The Indicator API", function () {
|
||||||
var openmct;
|
var openmct;
|
||||||
var directive;
|
var directive;
|
||||||
var holderElement;
|
var holderElement;
|
||||||
|
@ -25,7 +25,7 @@ define([
|
|||||||
], function (
|
], function (
|
||||||
TelemetryAPI
|
TelemetryAPI
|
||||||
) {
|
) {
|
||||||
describe('Telemetry API', function () {
|
xdescribe('Telemetry API', function () {
|
||||||
var openmct;
|
var openmct;
|
||||||
var telemetryAPI;
|
var telemetryAPI;
|
||||||
var mockTypeService;
|
var mockTypeService;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2018, United States Government
|
* Open MCT, Copyright (c) 2014-2019, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -35,7 +35,7 @@ define(
|
|||||||
) {
|
) {
|
||||||
var defaultAjaxFunction = $.ajax;
|
var defaultAjaxFunction = $.ajax;
|
||||||
|
|
||||||
describe("The URLIndicator", function () {
|
xdescribe("The URLIndicator", function () {
|
||||||
var openmct;
|
var openmct;
|
||||||
var indicatorElement;
|
var indicatorElement;
|
||||||
var pluginOptions;
|
var pluginOptions;
|
||||||
|
@ -27,7 +27,7 @@ define([
|
|||||||
'zepto',
|
'zepto',
|
||||||
'./dom-observer'
|
'./dom-observer'
|
||||||
], function (AutoflowTabularPlugin, AutoflowTabularConstants, MCT, $, DOMObserver) {
|
], function (AutoflowTabularPlugin, AutoflowTabularConstants, MCT, $, DOMObserver) {
|
||||||
describe("AutoflowTabularPlugin", function () {
|
xdescribe("AutoflowTabularPlugin", function () {
|
||||||
var testType;
|
var testType;
|
||||||
var testObject;
|
var testObject;
|
||||||
var mockmct;
|
var mockmct;
|
||||||
|
@ -20,8 +20,7 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([], function () {
|
define(['lodash'], function (_) {
|
||||||
|
|
||||||
function DisplayLayoutToolbar(openmct) {
|
function DisplayLayoutToolbar(openmct) {
|
||||||
return {
|
return {
|
||||||
name: "Display Layout Toolbar",
|
name: "Display Layout Toolbar",
|
||||||
@ -40,7 +39,7 @@ define([], function () {
|
|||||||
return (selectedParent && selectedParent.context.item && selectedParent.context.item.type === 'layout') ||
|
return (selectedParent && selectedParent.context.item && selectedParent.context.item.type === 'layout') ||
|
||||||
(selectedObject.context.item && selectedObject.context.item.type === 'layout');
|
(selectedObject.context.item && selectedObject.context.item.type === 'layout');
|
||||||
},
|
},
|
||||||
toolbar: function (selection) {
|
toolbar: function (selectedObjects) {
|
||||||
const DIALOG_FORM = {
|
const DIALOG_FORM = {
|
||||||
'text': {
|
'text': {
|
||||||
name: "Text Element Properties",
|
name: "Text Element Properties",
|
||||||
@ -222,7 +221,7 @@ define([], function () {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
method: function (option) {
|
method: function (option) {
|
||||||
selectionPath[1].context.orderItem(option.value, getAllTypes(selection));
|
selectionPath[1].context.orderItem(option.value, getAllTypes(selectedObjects));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -441,11 +440,11 @@ define([], function () {
|
|||||||
return {
|
return {
|
||||||
control: "select-menu",
|
control: "select-menu",
|
||||||
domainObject: selectionPath[1].context.item,
|
domainObject: selectionPath[1].context.item,
|
||||||
applicableSelectedItems: selection.filter(selectionPath => {
|
applicableSelectedItems: selection.filter(path => {
|
||||||
return selectionPath[0].context.layoutItem.type === 'telemetry-view';
|
return path[0].context.layoutItem.type === 'telemetry-view';
|
||||||
}),
|
}),
|
||||||
property: function (selectionPath) {
|
property: function (path) {
|
||||||
return getPath(selectionPath) + ".value";
|
return getPath(path) + ".value";
|
||||||
},
|
},
|
||||||
title: "Set value",
|
title: "Set value",
|
||||||
options: openmct.telemetry.getMetadata(selectionPath[0].context.item).values().map(value => {
|
options: openmct.telemetry.getMetadata(selectionPath[0].context.item).values().map(value => {
|
||||||
@ -500,8 +499,8 @@ define([], function () {
|
|||||||
!selectionPath[0].context.layoutItem;
|
!selectionPath[0].context.layoutItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMainLayoutSelected(selection[0])) {
|
if (isMainLayoutSelected(selectedObjects[0])) {
|
||||||
return [getAddButton(selection)];
|
return [getAddButton(selectedObjects)];
|
||||||
}
|
}
|
||||||
|
|
||||||
let toolbar = {
|
let toolbar = {
|
||||||
@ -517,145 +516,145 @@ define([], function () {
|
|||||||
'remove': []
|
'remove': []
|
||||||
};
|
};
|
||||||
|
|
||||||
selection.forEach(selectionPath => {
|
selectedObjects.forEach(selectionPath => {
|
||||||
let selectedParent = selectionPath[1].context.item;
|
let selectedParent = selectionPath[1].context.item;
|
||||||
let layoutItem = selectionPath[0].context.layoutItem;
|
let layoutItem = selectionPath[0].context.layoutItem;
|
||||||
|
|
||||||
if (layoutItem.type === 'subobject-view') {
|
if (layoutItem.type === 'subobject-view') {
|
||||||
if (toolbar['add-menu'].length === 0 && selectionPath[0].context.item.type === 'layout') {
|
if (toolbar['add-menu'].length === 0 && selectionPath[0].context.item.type === 'layout') {
|
||||||
toolbar['add-menu'] = [getAddButton(selection, selectionPath)];
|
toolbar['add-menu'] = [getAddButton(selectedObjects, selectionPath)];
|
||||||
}
|
}
|
||||||
if (toolbar['toggle-frame'].length === 0) {
|
if (toolbar['toggle-frame'].length === 0) {
|
||||||
toolbar['toggle-frame'] = [getToggleFrameButton(selectedParent, selection)];
|
toolbar['toggle-frame'] = [getToggleFrameButton(selectedParent, selectedObjects)];
|
||||||
}
|
}
|
||||||
if (toolbar.position.length === 0) {
|
if (toolbar.position.length === 0) {
|
||||||
toolbar.position = [
|
toolbar.position = [
|
||||||
getStackOrder(selectedParent, selectionPath),
|
getStackOrder(selectedParent, selectionPath),
|
||||||
getXInput(selectedParent, selection),
|
getXInput(selectedParent, selectedObjects),
|
||||||
getYInput(selectedParent, selection),
|
getYInput(selectedParent, selectedObjects),
|
||||||
getHeightInput(selectedParent, selection),
|
getHeightInput(selectedParent, selectedObjects),
|
||||||
getWidthInput(selectedParent, selection)
|
getWidthInput(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.remove.length === 0) {
|
if (toolbar.remove.length === 0) {
|
||||||
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selection)];
|
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
} else if (layoutItem.type === 'telemetry-view') {
|
} else if (layoutItem.type === 'telemetry-view') {
|
||||||
if (toolbar['display-mode'].length === 0) {
|
if (toolbar['display-mode'].length === 0) {
|
||||||
toolbar['display-mode'] = [getDisplayModeMenu(selectedParent, selection)];
|
toolbar['display-mode'] = [getDisplayModeMenu(selectedParent, selectedObjects)];
|
||||||
}
|
}
|
||||||
if (toolbar['telemetry-value'].length === 0) {
|
if (toolbar['telemetry-value'].length === 0) {
|
||||||
toolbar['telemetry-value'] = [getTelemetryValueMenu(selectionPath, selection)];
|
toolbar['telemetry-value'] = [getTelemetryValueMenu(selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
if (toolbar.style.length < 2) {
|
if (toolbar.style.length < 2) {
|
||||||
toolbar.style = [
|
toolbar.style = [
|
||||||
getFillMenu(selectedParent, selection),
|
getFillMenu(selectedParent, selectedObjects),
|
||||||
getStrokeMenu(selectedParent, selection)
|
getStrokeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar['text-style'].length === 0) {
|
if (toolbar['text-style'].length === 0) {
|
||||||
toolbar['text-style'] = [
|
toolbar['text-style'] = [
|
||||||
getTextColorMenu(selectedParent, selection),
|
getTextColorMenu(selectedParent, selectedObjects),
|
||||||
getTextSizeMenu(selectedParent, selection)
|
getTextSizeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.position.length === 0) {
|
if (toolbar.position.length === 0) {
|
||||||
toolbar.position = [
|
toolbar.position = [
|
||||||
getStackOrder(selectedParent, selectionPath),
|
getStackOrder(selectedParent, selectionPath),
|
||||||
getXInput(selectedParent, selection),
|
getXInput(selectedParent, selectedObjects),
|
||||||
getYInput(selectedParent, selection),
|
getYInput(selectedParent, selectedObjects),
|
||||||
getHeightInput(selectedParent, selection),
|
getHeightInput(selectedParent, selectedObjects),
|
||||||
getWidthInput(selectedParent, selection)
|
getWidthInput(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.remove.length === 0) {
|
if (toolbar.remove.length === 0) {
|
||||||
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selection)];
|
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
} else if (layoutItem.type === 'text-view') {
|
} else if (layoutItem.type === 'text-view') {
|
||||||
if (toolbar.style.length < 2) {
|
if (toolbar.style.length < 2) {
|
||||||
toolbar.style = [
|
toolbar.style = [
|
||||||
getFillMenu(selectedParent, selection),
|
getFillMenu(selectedParent, selectedObjects),
|
||||||
getStrokeMenu(selectedParent, selection)
|
getStrokeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar['text-style'].length === 0) {
|
if (toolbar['text-style'].length === 0) {
|
||||||
toolbar['text-style'] = [
|
toolbar['text-style'] = [
|
||||||
getTextColorMenu(selectedParent, selection),
|
getTextColorMenu(selectedParent, selectedObjects),
|
||||||
getTextSizeMenu(selectedParent, selection)
|
getTextSizeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.position.length === 0) {
|
if (toolbar.position.length === 0) {
|
||||||
toolbar.position = [
|
toolbar.position = [
|
||||||
getStackOrder(selectedParent, selectionPath),
|
getStackOrder(selectedParent, selectionPath),
|
||||||
getXInput(selectedParent, selection),
|
getXInput(selectedParent, selectedObjects),
|
||||||
getYInput(selectedParent, selection),
|
getYInput(selectedParent, selectedObjects),
|
||||||
getHeightInput(selectedParent, selection),
|
getHeightInput(selectedParent, selectedObjects),
|
||||||
getWidthInput(selectedParent, selection)
|
getWidthInput(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.text.length === 0) {
|
if (toolbar.text.length === 0) {
|
||||||
toolbar.text = [getTextButton(selectedParent, selection)];
|
toolbar.text = [getTextButton(selectedParent, selectedObjects)];
|
||||||
}
|
}
|
||||||
if (toolbar.remove.length === 0) {
|
if (toolbar.remove.length === 0) {
|
||||||
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selection)];
|
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
} else if (layoutItem.type === 'box-view') {
|
} else if (layoutItem.type === 'box-view') {
|
||||||
if (toolbar.style.length < 2) {
|
if (toolbar.style.length < 2) {
|
||||||
toolbar.style = [
|
toolbar.style = [
|
||||||
getFillMenu(selectedParent, selection),
|
getFillMenu(selectedParent, selectedObjects),
|
||||||
getStrokeMenu(selectedParent, selection)
|
getStrokeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.position.length === 0) {
|
if (toolbar.position.length === 0) {
|
||||||
toolbar.position = [
|
toolbar.position = [
|
||||||
getStackOrder(selectedParent, selectionPath),
|
getStackOrder(selectedParent, selectionPath),
|
||||||
getXInput(selectedParent, selection),
|
getXInput(selectedParent, selectedObjects),
|
||||||
getYInput(selectedParent, selection),
|
getYInput(selectedParent, selectedObjects),
|
||||||
getHeightInput(selectedParent, selection),
|
getHeightInput(selectedParent, selectedObjects),
|
||||||
getWidthInput(selectedParent, selection)
|
getWidthInput(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.remove.length === 0) {
|
if (toolbar.remove.length === 0) {
|
||||||
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selection)];
|
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
} else if (layoutItem.type === 'image-view') {
|
} else if (layoutItem.type === 'image-view') {
|
||||||
if (toolbar.style.length === 0) {
|
if (toolbar.style.length === 0) {
|
||||||
toolbar.style = [
|
toolbar.style = [
|
||||||
getStrokeMenu(selectedParent, selection)
|
getStrokeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.position.length === 0) {
|
if (toolbar.position.length === 0) {
|
||||||
toolbar.position = [
|
toolbar.position = [
|
||||||
getStackOrder(selectedParent, selectionPath),
|
getStackOrder(selectedParent, selectionPath),
|
||||||
getXInput(selectedParent, selection),
|
getXInput(selectedParent, selectedObjects),
|
||||||
getYInput(selectedParent, selection),
|
getYInput(selectedParent, selectedObjects),
|
||||||
getHeightInput(selectedParent, selection),
|
getHeightInput(selectedParent, selectedObjects),
|
||||||
getWidthInput(selectedParent, selection)
|
getWidthInput(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.url.length === 0) {
|
if (toolbar.url.length === 0) {
|
||||||
toolbar.url = [getURLButton(selectedParent, selection)];
|
toolbar.url = [getURLButton(selectedParent, selectedObjects)];
|
||||||
}
|
}
|
||||||
if (toolbar.remove.length === 0) {
|
if (toolbar.remove.length === 0) {
|
||||||
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selection)];
|
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
} else if (layoutItem.type === 'line-view') {
|
} else if (layoutItem.type === 'line-view') {
|
||||||
if (toolbar.style.length === 0) {
|
if (toolbar.style.length === 0) {
|
||||||
toolbar.style = [
|
toolbar.style = [
|
||||||
getStrokeMenu(selectedParent, selection)
|
getStrokeMenu(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.position.length === 0) {
|
if (toolbar.position.length === 0) {
|
||||||
toolbar.position = [
|
toolbar.position = [
|
||||||
getStackOrder(selectedParent, selectionPath),
|
getStackOrder(selectedParent, selectionPath),
|
||||||
getXInput(selectedParent, selection),
|
getXInput(selectedParent, selectedObjects),
|
||||||
getYInput(selectedParent, selection),
|
getYInput(selectedParent, selectedObjects),
|
||||||
getX2Input(selectedParent, selection),
|
getX2Input(selectedParent, selectedObjects),
|
||||||
getY2Input(selectedParent, selection)
|
getY2Input(selectedParent, selectedObjects)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (toolbar.remove.length === 0) {
|
if (toolbar.remove.length === 0) {
|
||||||
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selection)];
|
toolbar.remove = [getRemoveButton(selectedParent, selectionPath, selectedObjects)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
&__filter-indicator {
|
&__filter-indicator {
|
||||||
color: $colorFilter;
|
color: $colorFilter;
|
||||||
width: 1.2em; // Set width explicitly for layout reasons: will either have class icon-filter, or none.
|
width: 1.2em; // Set width explicitly for layout reasons: will either have class icon-filter, or none.
|
||||||
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -131,4 +132,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -83,7 +83,7 @@ function (
|
|||||||
mounted: self.focusOnEntry
|
mounted: self.focusOnEntry
|
||||||
};
|
};
|
||||||
|
|
||||||
var notebookVue = Vue.extend({
|
var NotebookVue = Vue.extend({
|
||||||
template: NotebookTemplate,
|
template: NotebookTemplate,
|
||||||
provide: {openmct: self.openmct, domainObject: self.domainObject},
|
provide: {openmct: self.openmct, domainObject: self.domainObject},
|
||||||
components: {
|
components: {
|
||||||
@ -114,7 +114,7 @@ function (
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.NotebookVue = new notebookVue();
|
this.NotebookVue = new NotebookVue();
|
||||||
container.appendChild(this.NotebookVue.$mount().$el);
|
container.appendChild(this.NotebookVue.$mount().$el);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,10 +63,10 @@ define([
|
|||||||
|
|
||||||
Object.keys(panels).forEach(key => {
|
Object.keys(panels).forEach(key => {
|
||||||
let panel = panels[key];
|
let panel = panels[key];
|
||||||
let domainObject = childObjects[key];
|
let childDomainObject = childObjects[key];
|
||||||
let identifier = undefined;
|
let identifier = undefined;
|
||||||
|
|
||||||
if (isTelemetry(domainObject)) {
|
if (isTelemetry(childDomainObject)) {
|
||||||
// If object is a telemetry point, convert it to a plot and
|
// If object is a telemetry point, convert it to a plot and
|
||||||
// replace the object in migratedObject composition with the plot.
|
// replace the object in migratedObject composition with the plot.
|
||||||
identifier = {
|
identifier = {
|
||||||
@ -75,19 +75,19 @@ define([
|
|||||||
};
|
};
|
||||||
let plotObject = {
|
let plotObject = {
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
location: domainObject.location,
|
location: childDomainObject.location,
|
||||||
name: domainObject.name,
|
name: childDomainObject.name,
|
||||||
type: "telemetry.plot.overlay"
|
type: "telemetry.plot.overlay"
|
||||||
};
|
};
|
||||||
let plotType = openmct.types.get('telemetry.plot.overlay');
|
let plotType = openmct.types.get('telemetry.plot.overlay');
|
||||||
plotType.definition.initialize(plotObject);
|
plotType.definition.initialize(plotObject);
|
||||||
plotObject.composition.push(domainObject.identifier);
|
plotObject.composition.push(childDomainObject.identifier);
|
||||||
openmct.objects.mutate(plotObject, 'persisted', Date.now());
|
openmct.objects.mutate(plotObject, 'persisted', Date.now());
|
||||||
|
|
||||||
let keyString = openmct.objects.makeKeyString(domainObject.identifier);
|
let keyString = openmct.objects.makeKeyString(childDomainObject.identifier);
|
||||||
let clonedComposition = Object.assign([], migratedObject.composition);
|
let clonedComposition = Object.assign([], migratedObject.composition);
|
||||||
clonedComposition.forEach((identifier, index) => {
|
clonedComposition.forEach((objIdentifier, index) => {
|
||||||
if (openmct.objects.makeKeyString(identifier) === keyString) {
|
if (openmct.objects.makeKeyString(objIdentifier) === keyString) {
|
||||||
migratedObject.composition[index] = plotObject.identifier;
|
migratedObject.composition[index] = plotObject.identifier;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -98,7 +98,7 @@ define([
|
|||||||
height: panel.dimensions[1],
|
height: panel.dimensions[1],
|
||||||
x: panel.position[0],
|
x: panel.position[0],
|
||||||
y: panel.position[1],
|
y: panel.position[1],
|
||||||
identifier: identifier || domainObject.identifier,
|
identifier: identifier || childDomainObject.identifier,
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
type: 'subobject-view',
|
type: 'subobject-view',
|
||||||
hasFrame: panel.hasFrame
|
hasFrame: panel.hasFrame
|
||||||
|
@ -29,7 +29,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- COLLAPSED PLOT LEGEND -->
|
<!-- COLLAPSED PLOT LEGEND -->
|
||||||
<div class="plot-wrapper-collapsed-legend">
|
<div class="plot-wrapper-collapsed-legend"
|
||||||
|
ng-class="{'icon-cursor-lock': !!lockHighlightPoint}">
|
||||||
<div class="plot-legend-item"
|
<div class="plot-legend-item"
|
||||||
ng-repeat="series in series track by $index">
|
ng-repeat="series in series track by $index">
|
||||||
<div class="plot-series-swatch-and-name">
|
<div class="plot-series-swatch-and-name">
|
||||||
@ -74,7 +75,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="series in series" class="plot-legend-item">
|
<tr ng-repeat="series in series" class="plot-legend-item">
|
||||||
<td class="plot-series-swatch-and-name">
|
<td class="plot-series-swatch-and-name"
|
||||||
|
ng-class="{'icon-cursor-lock': !!lockHighlightPoint}">
|
||||||
<span class="plot-series-color-swatch"
|
<span class="plot-series-color-swatch"
|
||||||
ng-style="{ 'background-color': series.get('color').asHexString() }">
|
ng-style="{ 'background-color': series.get('color').asHexString() }">
|
||||||
</span>
|
</span>
|
||||||
@ -117,7 +119,7 @@
|
|||||||
|
|
||||||
<div class="gl-plot-label gl-plot-y-label"
|
<div class="gl-plot-label gl-plot-y-label"
|
||||||
ng-class="{'icon-gear': (yKeyOptions.length > 1 && series.length === 1)}"
|
ng-class="{'icon-gear': (yKeyOptions.length > 1 && series.length === 1)}"
|
||||||
ng-bind="yAxisLabel">
|
>{{yAxis.get('label')}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<select class="gl-plot-y-label__select local-controls--hidden"
|
<select class="gl-plot-y-label__select local-controls--hidden"
|
||||||
@ -132,7 +134,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<mct-ticks axis="yAxis">
|
<mct-ticks axis="yAxis">
|
||||||
<div ng-repeat="tick in ticks track by tick.text"
|
<div ng-repeat="tick in ticks track by tick.value"
|
||||||
class="gl-plot-tick gl-plot-y-tick-label"
|
class="gl-plot-tick gl-plot-y-tick-label"
|
||||||
ng-style="{ top: (100 * (max - tick.value) / interval) + '%' }"
|
ng-style="{ top: (100 * (max - tick.value) / interval) + '%' }"
|
||||||
title="{{:: tick.fullText || tick.text }}"
|
title="{{:: tick.fullText || tick.text }}"
|
||||||
@ -145,9 +147,14 @@
|
|||||||
ng-style="{
|
ng-style="{
|
||||||
left: (tickWidth + 30) + 'px'
|
left: (tickWidth + 30) + 'px'
|
||||||
}">
|
}">
|
||||||
<span class="t-object-alert t-alert-unsynced"
|
<div class="l-state-indicators">
|
||||||
title="This plot is not currently displaying the latest data.
|
<span class="l-state-indicators__alert-no-lad t-object-alert t-alert-unsynced icon-alert-triangle"
|
||||||
Reset Pan/zoom to return to view latest data."></span>
|
title="This plot is not currently displaying the latest data. Reset pan/zoom to view latest data."></span>
|
||||||
|
<span class="l-state-indicators__alert-cursor-lock icon-cursor-lock"
|
||||||
|
title="Telemetry point selection is locked. Click anywhere in the plot to unlock."
|
||||||
|
ng-if="lockHighlightPoint"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="gl-plot-display-area has-local-controls has-cursor-guides">
|
<div class="gl-plot-display-area has-local-controls has-cursor-guides">
|
||||||
<mct-ticks axis="xAxis">
|
<mct-ticks axis="xAxis">
|
||||||
<div class="gl-plot-hash hash-v"
|
<div class="gl-plot-hash hash-v"
|
||||||
@ -213,7 +220,7 @@
|
|||||||
}">
|
}">
|
||||||
|
|
||||||
<mct-ticks axis="xAxis">
|
<mct-ticks axis="xAxis">
|
||||||
<div ng-repeat="tick in ticks track by tick.text"
|
<div ng-repeat="tick in ticks track by tick.value"
|
||||||
class="gl-plot-tick gl-plot-x-tick-label"
|
class="gl-plot-tick gl-plot-x-tick-label"
|
||||||
ng-style="{
|
ng-style="{
|
||||||
left: (100 * (tick.value - min) / interval) + '%'
|
left: (100 * (tick.value - min) / interval) + '%'
|
||||||
|
@ -140,7 +140,8 @@ define([
|
|||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
fetch: function (options) {
|
fetch: function (options) {
|
||||||
options = _.extend({}, {size: 1000, strategy: 'minmax', filters: this.filters}, options || {});
|
const strategy = options.shouldUseMinMax ? 'minMax' : undefined;
|
||||||
|
options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {});
|
||||||
if (!this.unsubscribe) {
|
if (!this.unsubscribe) {
|
||||||
this.unsubscribe = this.openmct
|
this.unsubscribe = this.openmct
|
||||||
.telemetry
|
.telemetry
|
||||||
|
@ -65,6 +65,7 @@ define([
|
|||||||
}
|
}
|
||||||
this.$canvas = this.$element.find('canvas');
|
this.$canvas = this.$element.find('canvas');
|
||||||
|
|
||||||
|
this.listenTo(this.$canvas, 'click', this.onMouseClick, this);
|
||||||
this.listenTo(this.$canvas, 'mousemove', this.trackMousePosition, this);
|
this.listenTo(this.$canvas, 'mousemove', this.trackMousePosition, this);
|
||||||
this.listenTo(this.$canvas, 'mouseleave', this.untrackMousePosition, this);
|
this.listenTo(this.$canvas, 'mouseleave', this.untrackMousePosition, this);
|
||||||
this.listenTo(this.$canvas, 'mousedown', this.onMouseDown, this);
|
this.listenTo(this.$canvas, 'mousedown', this.onMouseDown, this);
|
||||||
@ -75,6 +76,7 @@ define([
|
|||||||
MCTPlotController.prototype.initialize = function () {
|
MCTPlotController.prototype.initialize = function () {
|
||||||
this.$canvas = this.$element.find('canvas');
|
this.$canvas = this.$element.find('canvas');
|
||||||
|
|
||||||
|
this.listenTo(this.$canvas, 'click', this.onMouseClick, this);
|
||||||
this.listenTo(this.$canvas, 'mousemove', this.trackMousePosition, this);
|
this.listenTo(this.$canvas, 'mousemove', this.trackMousePosition, this);
|
||||||
this.listenTo(this.$canvas, 'mouseleave', this.untrackMousePosition, this);
|
this.listenTo(this.$canvas, 'mouseleave', this.untrackMousePosition, this);
|
||||||
this.listenTo(this.$canvas, 'mousedown', this.onMouseDown, this);
|
this.listenTo(this.$canvas, 'mousedown', this.onMouseDown, this);
|
||||||
@ -206,9 +208,30 @@ define([
|
|||||||
this.highlightValues(point);
|
this.highlightValues(point);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MCTPlotController.prototype.onMouseClick = function ($event) {
|
||||||
|
const isClick = this.isMouseClick();
|
||||||
|
if (this.pan) {
|
||||||
|
this.endPan($event);
|
||||||
|
}
|
||||||
|
if (this.marquee) {
|
||||||
|
this.endMarquee($event);
|
||||||
|
}
|
||||||
|
this.$scope.$apply();
|
||||||
|
|
||||||
|
if (!this.$scope.highlights.length || !isClick) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$scope.lockHighlightPoint = !this.$scope.lockHighlightPoint;
|
||||||
|
};
|
||||||
|
|
||||||
MCTPlotController.prototype.highlightValues = function (point) {
|
MCTPlotController.prototype.highlightValues = function (point) {
|
||||||
this.highlightPoint = point;
|
this.highlightPoint = point;
|
||||||
this.$scope.$emit('plot:highlight:update', point);
|
this.$scope.$emit('plot:highlight:update', point);
|
||||||
|
if (this.$scope.lockHighlightPoint) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!point) {
|
if (!point) {
|
||||||
this.$scope.highlights = [];
|
this.$scope.highlights = [];
|
||||||
this.$scope.series.map(function (series) {
|
this.$scope.series.map(function (series) {
|
||||||
@ -249,15 +272,18 @@ define([
|
|||||||
MCTPlotController.prototype.onMouseUp = function ($event) {
|
MCTPlotController.prototype.onMouseUp = function ($event) {
|
||||||
this.stopListening(this.$window, 'mouseup', this.onMouseUp, this);
|
this.stopListening(this.$window, 'mouseup', this.onMouseUp, this);
|
||||||
this.stopListening(this.$window, 'mousemove', this.trackMousePosition, this);
|
this.stopListening(this.$window, 'mousemove', this.trackMousePosition, this);
|
||||||
if (this.pan) {
|
|
||||||
this.endPan($event);
|
|
||||||
}
|
|
||||||
if (this.marquee) {
|
|
||||||
this.endMarquee($event);
|
|
||||||
}
|
|
||||||
this.$scope.$apply();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MCTPlotController.prototype.isMouseClick = function () {
|
||||||
|
if (!this.marquee) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { start, end } = this.marquee;
|
||||||
|
|
||||||
|
return start.x === end.x && start.y === end.y;
|
||||||
|
}
|
||||||
|
|
||||||
MCTPlotController.prototype.updateMarquee = function () {
|
MCTPlotController.prototype.updateMarquee = function () {
|
||||||
if (!this.marquee) {
|
if (!this.marquee) {
|
||||||
return;
|
return;
|
||||||
@ -526,6 +552,7 @@ define([
|
|||||||
|
|
||||||
if (yAxisObject) {
|
if (yAxisObject) {
|
||||||
series.emit('change:yKey', yAxisObject.key);
|
series.emit('change:yKey', yAxisObject.key);
|
||||||
|
this.config.yAxis.set('label', label);
|
||||||
this.$scope.yAxisLabel = label;
|
this.$scope.yAxisLabel = label;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -102,7 +102,8 @@ define([
|
|||||||
this.startLoading();
|
this.startLoading();
|
||||||
var options = {
|
var options = {
|
||||||
size: this.$element[0].offsetWidth,
|
size: this.$element[0].offsetWidth,
|
||||||
domain: this.config.xAxis.get('key')
|
domain: this.config.xAxis.get('key'),
|
||||||
|
shouldUseMinMax: this.shouldUseMinMax(series)
|
||||||
};
|
};
|
||||||
|
|
||||||
series.load(options)
|
series.load(options)
|
||||||
@ -133,6 +134,11 @@ define([
|
|||||||
this.listenTo(series, 'change:yKey', function () {
|
this.listenTo(series, 'change:yKey', function () {
|
||||||
this.loadSeriesData(series);
|
this.loadSeriesData(series);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
this.listenTo(series, 'change:interpolate', function () {
|
||||||
|
this.loadSeriesData(series);
|
||||||
|
}, this);
|
||||||
|
|
||||||
this.loadSeriesData(series);
|
this.loadSeriesData(series);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -155,6 +161,10 @@ define([
|
|||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PlotController.prototype.shouldUseMinMax = function (series) {
|
||||||
|
return series.model.interpolate !== 'none';
|
||||||
|
};
|
||||||
|
|
||||||
PlotController.prototype.onTimeSystemChange = function (timeSystem) {
|
PlotController.prototype.onTimeSystemChange = function (timeSystem) {
|
||||||
this.config.xAxis.set('key', timeSystem.key);
|
this.config.xAxis.set('key', timeSystem.key);
|
||||||
};
|
};
|
||||||
|
@ -73,7 +73,8 @@ define([
|
|||||||
) {
|
) {
|
||||||
var bundleMap = {
|
var bundleMap = {
|
||||||
LocalStorage: 'platform/persistence/local',
|
LocalStorage: 'platform/persistence/local',
|
||||||
MyItems: 'platform/features/my-items'
|
MyItems: 'platform/features/my-items',
|
||||||
|
CouchDB: 'platform/persistence/couch'
|
||||||
};
|
};
|
||||||
|
|
||||||
var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) {
|
var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) {
|
||||||
|
@ -180,7 +180,7 @@ define([
|
|||||||
|
|
||||||
inputArea.html('');
|
inputArea.html('');
|
||||||
this.valueInputs = [];
|
this.valueInputs = [];
|
||||||
this.config.values = [];
|
this.config.values = this.config.values || [];
|
||||||
|
|
||||||
if (evaluator.getInputCount(operation)) {
|
if (evaluator.getInputCount(operation)) {
|
||||||
inputCount = evaluator.getInputCount(operation);
|
inputCount = evaluator.getInputCount(operation);
|
||||||
@ -191,8 +191,10 @@ define([
|
|||||||
newInput = $('<select>' + this.generateSelectOptions() + '</select>');
|
newInput = $('<select>' + this.generateSelectOptions() + '</select>');
|
||||||
emitChange = true;
|
emitChange = true;
|
||||||
} else {
|
} else {
|
||||||
this.config.values[index] = inputType === 'number' ? 0 : '';
|
const defaultValue = inputType === 'number' ? 0 : '';
|
||||||
newInput = $('<input type = "' + inputType + '" value = "' + this.config.values[index] + '"> </input>');
|
const value = this.config.values[index] || defaultValue;
|
||||||
|
this.config.values[index] = value;
|
||||||
|
newInput = $('<input type = "' + inputType + '" value = "' + value + '"></input>');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.valueInputs.push(newInput.get(0));
|
this.valueInputs.push(newInput.get(0));
|
||||||
|
@ -215,9 +215,7 @@ define([
|
|||||||
* Update the widget's appearance from the configuration of the active rule
|
* Update the widget's appearance from the configuration of the active rule
|
||||||
*/
|
*/
|
||||||
SummaryWidget.prototype.updateWidget = function () {
|
SummaryWidget.prototype.updateWidget = function () {
|
||||||
const WIDGET_CLASS = 'c-sw js-sw',
|
const WIDGET_ICON_CLASS = 'c-sw__icon js-sw__icon';
|
||||||
WIDGET_LABEL_CLASS = 'c-sw__label js-sw__label',
|
|
||||||
WIDGET_ICON_CLASS = 'c-sw__icon js-sw__icon';
|
|
||||||
var activeRule = this.rulesById[this.activeId];
|
var activeRule = this.rulesById[this.activeId];
|
||||||
this.applyStyle($('#widget', this.domElement), activeRule.getProperty('style'));
|
this.applyStyle($('#widget', this.domElement), activeRule.getProperty('style'));
|
||||||
$('#widget', this.domElement).prop('title', activeRule.getProperty('message'));
|
$('#widget', this.domElement).prop('title', activeRule.getProperty('message'));
|
||||||
@ -252,8 +250,8 @@ define([
|
|||||||
ruleOrder.push(ruleId);
|
ruleOrder.push(ruleId);
|
||||||
this.domainObject.configuration.ruleOrder = ruleOrder;
|
this.domainObject.configuration.ruleOrder = ruleOrder;
|
||||||
|
|
||||||
this.updateDomainObject();
|
|
||||||
this.initRule(ruleId, 'Rule');
|
this.initRule(ruleId, 'Rule');
|
||||||
|
this.updateDomainObject();
|
||||||
this.refreshRules();
|
this.refreshRules();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -281,8 +279,8 @@ define([
|
|||||||
ruleOrder.splice(ruleOrder.indexOf(sourceRuleId) + 1, 0, ruleId);
|
ruleOrder.splice(ruleOrder.indexOf(sourceRuleId) + 1, 0, ruleId);
|
||||||
this.domainObject.configuration.ruleOrder = ruleOrder;
|
this.domainObject.configuration.ruleOrder = ruleOrder;
|
||||||
this.domainObject.configuration.ruleConfigById[ruleId] = sourceConfig;
|
this.domainObject.configuration.ruleConfigById[ruleId] = sourceConfig;
|
||||||
this.updateDomainObject();
|
|
||||||
this.initRule(ruleId, sourceConfig.name);
|
this.initRule(ruleId, sourceConfig.name);
|
||||||
|
this.updateDomainObject();
|
||||||
this.refreshRules();
|
this.refreshRules();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,10 +1,32 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2019, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT 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([
|
define([
|
||||||
'./SummaryWidgetTelemetryProvider'
|
'./SummaryWidgetTelemetryProvider'
|
||||||
], function (
|
], function (
|
||||||
SummaryWidgetTelemetryProvider
|
SummaryWidgetTelemetryProvider
|
||||||
) {
|
) {
|
||||||
|
|
||||||
describe('SummaryWidgetTelemetryProvider', function () {
|
xdescribe('SummaryWidgetTelemetryProvider', function () {
|
||||||
var telemObjectA;
|
var telemObjectA;
|
||||||
var telemObjectB;
|
var telemObjectB;
|
||||||
var summaryWidgetObject;
|
var summaryWidgetObject;
|
||||||
|
@ -1,5 +1,27 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2019, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT 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/ConditionManager'], function (ConditionManager) {
|
define(['../src/ConditionManager'], function (ConditionManager) {
|
||||||
describe('A Summary Widget Condition Manager', function () {
|
xdescribe('A Summary Widget Condition Manager', function () {
|
||||||
var conditionManager,
|
var conditionManager,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
mockCompObject1,
|
mockCompObject1,
|
||||||
|
@ -1,5 +1,27 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2019, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT 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/Condition', 'zepto'], function (Condition, $) {
|
define(['../src/Condition', 'zepto'], function (Condition, $) {
|
||||||
describe('A summary widget condition', function () {
|
xdescribe('A summary widget condition', function () {
|
||||||
var testCondition,
|
var testCondition,
|
||||||
mockConfig,
|
mockConfig,
|
||||||
mockConditionManager,
|
mockConditionManager,
|
||||||
|
@ -1,5 +1,27 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2019, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT 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/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
|
define(['../src/SummaryWidget', 'zepto'], function (SummaryWidget, $) {
|
||||||
describe('The Summary Widget', function () {
|
xdescribe('The Summary Widget', function () {
|
||||||
var summaryWidget,
|
var summaryWidget,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
mockOldDomainObject,
|
mockOldDomainObject,
|
||||||
|
@ -190,6 +190,7 @@ define([
|
|||||||
clearData() {
|
clearData() {
|
||||||
this.filteredRows.clear();
|
this.filteredRows.clear();
|
||||||
this.boundedRows.clear();
|
this.boundedRows.clear();
|
||||||
|
this.emit('refresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
getColumnMapForObject(objectKeyString) {
|
getColumnMapForObject(objectKeyString) {
|
||||||
|
@ -86,15 +86,18 @@ define(
|
|||||||
*/
|
*/
|
||||||
matchesFilters(row) {
|
matchesFilters(row) {
|
||||||
let doesMatchFilters = true;
|
let doesMatchFilters = true;
|
||||||
for (const key in this.columnFilters) {
|
Object.keys(this.columnFilters).forEach((key) => {
|
||||||
if (!this.rowHasColumn(row, key)) {
|
if (!doesMatchFilters || !this.rowHasColumn(row, key)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
let formattedValue = row.getFormattedValue(key).toLowerCase();
|
|
||||||
doesMatchFilters = doesMatchFilters &&
|
|
||||||
formattedValue.indexOf(this.columnFilters[key]) !== -1;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
let formattedValue = row.getFormattedValue(key);
|
||||||
|
if (formattedValue === undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
doesMatchFilters = formattedValue.toLowerCase().indexOf(this.columnFilters[key]) !== -1;
|
||||||
|
});
|
||||||
return doesMatchFilters;
|
return doesMatchFilters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ export default {
|
|||||||
rowOffset: 'calculateRowTop',
|
rowOffset: 'calculateRowTop',
|
||||||
row: {
|
row: {
|
||||||
handler: 'formatRow',
|
handler: 'formatRow',
|
||||||
deep: false
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -261,7 +261,12 @@
|
|||||||
height: 18px; // Needed when a row has empty values in its cells
|
height: 18px; // Needed when a row has empty values in its cells
|
||||||
|
|
||||||
&.is-selected {
|
&.is-selected {
|
||||||
background-color: $colorSelectedBg;
|
background-color: $colorSelectedBg !important;
|
||||||
|
color: $colorSelectedFg !important;
|
||||||
|
td {
|
||||||
|
background: none !important;
|
||||||
|
color: inherit !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ $glyph-icon-rows: '\e925';
|
|||||||
$glyph-icon-filter: '\e926';
|
$glyph-icon-filter: '\e926';
|
||||||
$glyph-icon-filter-outline: '\e927';
|
$glyph-icon-filter-outline: '\e927';
|
||||||
$glyph-icon-suitcase: '\e928';
|
$glyph-icon-suitcase: '\e928';
|
||||||
|
$glyph-icon-cursor-lock: '\e929';
|
||||||
$glyph-icon-arrows-right-left: '\ea00';
|
$glyph-icon-arrows-right-left: '\ea00';
|
||||||
$glyph-icon-arrows-up-down: '\ea01';
|
$glyph-icon-arrows-up-down: '\ea01';
|
||||||
$glyph-icon-bullet: '\ea02';
|
$glyph-icon-bullet: '\ea02';
|
||||||
|
@ -271,6 +271,15 @@ input[type=number]::-webkit-outer-spin-button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type=number].c-input-number--no-spinners {
|
||||||
|
&::-webkit-inner-spin-button,
|
||||||
|
&::-webkit-outer-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
-moz-appearance: textfield;
|
||||||
|
}
|
||||||
|
|
||||||
.c-labeled-input {
|
.c-labeled-input {
|
||||||
// An input used in the Toolbar
|
// An input used in the Toolbar
|
||||||
// Assumes label is before the input
|
// Assumes label is before the input
|
||||||
|
@ -80,6 +80,7 @@
|
|||||||
.icon-filter { @include glyphBefore($glyph-icon-filter); }
|
.icon-filter { @include glyphBefore($glyph-icon-filter); }
|
||||||
.icon-filter-outline { @include glyphBefore($glyph-icon-filter-outline); }
|
.icon-filter-outline { @include glyphBefore($glyph-icon-filter-outline); }
|
||||||
.icon-suitcase { @include glyphBefore($glyph-icon-suitcase); }
|
.icon-suitcase { @include glyphBefore($glyph-icon-suitcase); }
|
||||||
|
.icon-cursor-lock { @include glyphBefore($glyph-icon-cursor-lock); }
|
||||||
.icon-arrows-right-left { @include glyphBefore($glyph-icon-arrows-right-left); }
|
.icon-arrows-right-left { @include glyphBefore($glyph-icon-arrows-right-left); }
|
||||||
.icon-arrows-up-down { @include glyphBefore($glyph-icon-arrows-up-down); }
|
.icon-arrows-up-down { @include glyphBefore($glyph-icon-arrows-up-down); }
|
||||||
.icon-bullet { @include glyphBefore($glyph-icon-bullet); }
|
.icon-bullet { @include glyphBefore($glyph-icon-bullet); }
|
||||||
|
@ -81,13 +81,24 @@ mct-plot {
|
|||||||
margin-top: $interiorMargin; // Keep the top tick label from getting clipped
|
margin-top: $interiorMargin; // Keep the top tick label from getting clipped
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
.t-object-alert {
|
|
||||||
|
.l-state-indicators {
|
||||||
|
color: $colorPausedBg;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
|
pointer-events: none;
|
||||||
top: $interiorMarginSm;
|
top: $interiorMarginSm;
|
||||||
left: $interiorMarginSm;
|
left: $interiorMarginSm;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
|
> * + * {
|
||||||
|
margin-left: $interiorMarginSm;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-alert-unsynced {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,6 +185,10 @@ mct-plot {
|
|||||||
text-orientation: mixed;
|
text-orientation: mixed;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
writing-mode: vertical-lr;
|
writing-mode: vertical-lr;
|
||||||
|
&:before {
|
||||||
|
// Icon denoting configurability
|
||||||
|
margin-bottom: $interiorMargin; // Uses margin-bottom due to writing-mode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,6 +457,9 @@ mct-plot {
|
|||||||
&.plot-legend-collapsed .plot-wrapper-expanded-legend { display: none; }
|
&.plot-legend-collapsed .plot-wrapper-expanded-legend { display: none; }
|
||||||
&.plot-legend-expanded .plot-wrapper-collapsed-legend { display: none; }
|
&.plot-legend-expanded .plot-wrapper-collapsed-legend { display: none; }
|
||||||
|
|
||||||
|
&.plot-legend-collapsed .icon-cursor-lock::before { padding-right: 5px; }
|
||||||
|
&.plot-legend-expanded .icon-cursor-lock::before { padding-right: 5px; }
|
||||||
|
|
||||||
/***************** GENERAL STYLES, COLLAPSED */
|
/***************** GENERAL STYLES, COLLAPSED */
|
||||||
&.plot-legend-collapsed {
|
&.plot-legend-collapsed {
|
||||||
// .plot-legend-item is a span of spans.
|
// .plot-legend-item is a span of spans.
|
||||||
@ -576,8 +594,7 @@ mct-plot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.s-status-timeconductor-unsynced {
|
.s-status-timeconductor-unsynced {
|
||||||
.t-object-alert.t-alert-unsynced {
|
.t-alert-unsynced {
|
||||||
@extend .icon-alert-triangle;
|
display: inline-block !important;
|
||||||
color: $colorPausedBg;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,6 +483,7 @@ body.mobile.phone {
|
|||||||
.widget-edit-holder {
|
.widget-edit-holder {
|
||||||
display: flex; // Overrides `display: none` during Browse mode
|
display: flex; // Overrides `display: none` during Browse mode
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.flex-accordion-holder {
|
.flex-accordion-holder {
|
||||||
// Needed because otherwise accordion elements "creep" when contents expand and contract
|
// Needed because otherwise accordion elements "creep" when contents expand and contract
|
||||||
@ -630,6 +631,8 @@ body.mobile.phone {
|
|||||||
.c-sw-rule {
|
.c-sw-rule {
|
||||||
&__grippy-wrapper {
|
&__grippy-wrapper {
|
||||||
$d: 8px;
|
$d: 8px;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
cursor: move;
|
||||||
width: $d; height: $d;
|
width: $d; height: $d;
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "Open MCT Symbols 16px",
|
"name": "Open MCT Symbols 16px",
|
||||||
"lastOpened": 0,
|
"lastOpened": 0,
|
||||||
"created": 1565375402798
|
"created": 1567791159617
|
||||||
},
|
},
|
||||||
"iconSets": [
|
"iconSets": [
|
||||||
{
|
{
|
||||||
@ -335,13 +335,21 @@
|
|||||||
"code": 59688,
|
"code": 59688,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"order": 169,
|
||||||
|
"id": 145,
|
||||||
|
"name": "icon-cursor-locked",
|
||||||
|
"prevSize": 24,
|
||||||
|
"code": 59689,
|
||||||
|
"tempChar": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"order": 27,
|
"order": 27,
|
||||||
"id": 105,
|
"id": 105,
|
||||||
"name": "icon-arrows-right-left",
|
"name": "icon-arrows-right-left",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59904,
|
"code": 59904,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 26,
|
"order": 26,
|
||||||
@ -349,7 +357,7 @@
|
|||||||
"name": "icon-arrows-up-down",
|
"name": "icon-arrows-up-down",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59905,
|
"code": 59905,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 68,
|
"order": 68,
|
||||||
@ -357,7 +365,7 @@
|
|||||||
"name": "icon-bullet",
|
"name": "icon-bullet",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59906,
|
"code": 59906,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 150,
|
"order": 150,
|
||||||
@ -365,7 +373,7 @@
|
|||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59907,
|
"code": 59907,
|
||||||
"name": "icon-calendar",
|
"name": "icon-calendar",
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 45,
|
"order": 45,
|
||||||
@ -373,7 +381,7 @@
|
|||||||
"name": "icon-chain-links",
|
"name": "icon-chain-links",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59908,
|
"code": 59908,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 73,
|
"order": 73,
|
||||||
@ -381,7 +389,7 @@
|
|||||||
"name": "icon-download",
|
"name": "icon-download",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59909,
|
"code": 59909,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 39,
|
"order": 39,
|
||||||
@ -389,7 +397,7 @@
|
|||||||
"name": "icon-duplicate",
|
"name": "icon-duplicate",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59910,
|
"code": 59910,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 50,
|
"order": 50,
|
||||||
@ -397,7 +405,7 @@
|
|||||||
"name": "icon-folder-new",
|
"name": "icon-folder-new",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59911,
|
"code": 59911,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 138,
|
"order": 138,
|
||||||
@ -405,7 +413,7 @@
|
|||||||
"name": "icon-fullscreen-collapse",
|
"name": "icon-fullscreen-collapse",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59912,
|
"code": 59912,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 139,
|
"order": 139,
|
||||||
@ -413,7 +421,7 @@
|
|||||||
"name": "icon-fullscreen-expand",
|
"name": "icon-fullscreen-expand",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59913,
|
"code": 59913,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 122,
|
"order": 122,
|
||||||
@ -421,7 +429,7 @@
|
|||||||
"name": "icon-layers",
|
"name": "icon-layers",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59914,
|
"code": 59914,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 151,
|
"order": 151,
|
||||||
@ -429,7 +437,7 @@
|
|||||||
"name": "icon-line-horz",
|
"name": "icon-line-horz",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59915,
|
"code": 59915,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 100,
|
"order": 100,
|
||||||
@ -437,7 +445,7 @@
|
|||||||
"name": "icon-magnify",
|
"name": "icon-magnify",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59916,
|
"code": 59916,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 99,
|
"order": 99,
|
||||||
@ -445,7 +453,7 @@
|
|||||||
"name": "icon-magnify-in",
|
"name": "icon-magnify-in",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59917,
|
"code": 59917,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 101,
|
"order": 101,
|
||||||
@ -453,7 +461,7 @@
|
|||||||
"name": "icon-magnify-out-v2",
|
"name": "icon-magnify-out-v2",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59918,
|
"code": 59918,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 103,
|
"order": 103,
|
||||||
@ -461,7 +469,7 @@
|
|||||||
"name": "icon-menu",
|
"name": "icon-menu",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59919,
|
"code": 59919,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 124,
|
"order": 124,
|
||||||
@ -469,7 +477,7 @@
|
|||||||
"name": "icon-move",
|
"name": "icon-move",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59920,
|
"code": 59920,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 7,
|
"order": 7,
|
||||||
@ -477,7 +485,7 @@
|
|||||||
"name": "icon-new-window",
|
"name": "icon-new-window",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59921,
|
"code": 59921,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 63,
|
"order": 63,
|
||||||
@ -485,7 +493,7 @@
|
|||||||
"name": "icon-paint-bucket-v2",
|
"name": "icon-paint-bucket-v2",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59922,
|
"code": 59922,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 15,
|
"order": 15,
|
||||||
@ -493,7 +501,7 @@
|
|||||||
"name": "icon-pencil",
|
"name": "icon-pencil",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59923,
|
"code": 59923,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 54,
|
"order": 54,
|
||||||
@ -501,7 +509,7 @@
|
|||||||
"name": "icon-pencil-edit-in-place",
|
"name": "icon-pencil-edit-in-place",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59924,
|
"code": 59924,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 40,
|
"order": 40,
|
||||||
@ -509,7 +517,7 @@
|
|||||||
"name": "icon-play",
|
"name": "icon-play",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59925,
|
"code": 59925,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 125,
|
"order": 125,
|
||||||
@ -517,7 +525,7 @@
|
|||||||
"name": "icon-pause",
|
"name": "icon-pause",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59926,
|
"code": 59926,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 119,
|
"order": 119,
|
||||||
@ -525,7 +533,7 @@
|
|||||||
"name": "icon-plot-resource",
|
"name": "icon-plot-resource",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59927,
|
"code": 59927,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 48,
|
"order": 48,
|
||||||
@ -533,7 +541,7 @@
|
|||||||
"name": "icon-pointer-left",
|
"name": "icon-pointer-left",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59928,
|
"code": 59928,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 47,
|
"order": 47,
|
||||||
@ -541,7 +549,7 @@
|
|||||||
"name": "icon-pointer-right",
|
"name": "icon-pointer-right",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59929,
|
"code": 59929,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 85,
|
"order": 85,
|
||||||
@ -549,7 +557,7 @@
|
|||||||
"name": "icon-refresh",
|
"name": "icon-refresh",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59930,
|
"code": 59930,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 55,
|
"order": 55,
|
||||||
@ -557,7 +565,7 @@
|
|||||||
"name": "icon-save",
|
"name": "icon-save",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59931,
|
"code": 59931,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 56,
|
"order": 56,
|
||||||
@ -565,7 +573,7 @@
|
|||||||
"name": "icon-save-as",
|
"name": "icon-save-as",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59932,
|
"code": 59932,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 58,
|
"order": 58,
|
||||||
@ -573,7 +581,7 @@
|
|||||||
"name": "icon-sine",
|
"name": "icon-sine",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59933,
|
"code": 59933,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 113,
|
"order": 113,
|
||||||
@ -581,7 +589,7 @@
|
|||||||
"name": "icon-font",
|
"name": "icon-font",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59934,
|
"code": 59934,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 41,
|
"order": 41,
|
||||||
@ -589,7 +597,7 @@
|
|||||||
"name": "icon-thumbs-strip",
|
"name": "icon-thumbs-strip",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59935,
|
"code": 59935,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 146,
|
"order": 146,
|
||||||
@ -597,7 +605,7 @@
|
|||||||
"name": "icon-two-parts-both",
|
"name": "icon-two-parts-both",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59936,
|
"code": 59936,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 145,
|
"order": 145,
|
||||||
@ -605,7 +613,7 @@
|
|||||||
"name": "icon-two-parts-one-only",
|
"name": "icon-two-parts-one-only",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59937,
|
"code": 59937,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 82,
|
"order": 82,
|
||||||
@ -613,7 +621,7 @@
|
|||||||
"name": "icon-resync",
|
"name": "icon-resync",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59938,
|
"code": 59938,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 86,
|
"order": 86,
|
||||||
@ -621,7 +629,7 @@
|
|||||||
"name": "icon-reset",
|
"name": "icon-reset",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59939,
|
"code": 59939,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 61,
|
"order": 61,
|
||||||
@ -629,7 +637,7 @@
|
|||||||
"name": "icon-x-in-circle",
|
"name": "icon-x-in-circle",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59940,
|
"code": 59940,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 84,
|
"order": 84,
|
||||||
@ -637,7 +645,7 @@
|
|||||||
"name": "icon-brightness",
|
"name": "icon-brightness",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59941,
|
"code": 59941,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 83,
|
"order": 83,
|
||||||
@ -645,7 +653,7 @@
|
|||||||
"name": "icon-contrast",
|
"name": "icon-contrast",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59942,
|
"code": 59942,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 87,
|
"order": 87,
|
||||||
@ -653,7 +661,7 @@
|
|||||||
"name": "icon-expand",
|
"name": "icon-expand",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59943,
|
"code": 59943,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 89,
|
"order": 89,
|
||||||
@ -661,7 +669,7 @@
|
|||||||
"name": "icon-list-view",
|
"name": "icon-list-view",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59944,
|
"code": 59944,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 133,
|
"order": 133,
|
||||||
@ -669,7 +677,7 @@
|
|||||||
"name": "icon-grid-snap-to",
|
"name": "icon-grid-snap-to",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59945,
|
"code": 59945,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 132,
|
"order": 132,
|
||||||
@ -677,7 +685,7 @@
|
|||||||
"name": "icon-grid-snap-no",
|
"name": "icon-grid-snap-no",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59946,
|
"code": 59946,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 94,
|
"order": 94,
|
||||||
@ -685,7 +693,7 @@
|
|||||||
"name": "icon-frame-show",
|
"name": "icon-frame-show",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59947,
|
"code": 59947,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 95,
|
"order": 95,
|
||||||
@ -693,7 +701,7 @@
|
|||||||
"name": "icon-frame-hide",
|
"name": "icon-frame-hide",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59948,
|
"code": 59948,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 97,
|
"order": 97,
|
||||||
@ -701,7 +709,7 @@
|
|||||||
"name": "icon-import",
|
"name": "icon-import",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59949,
|
"code": 59949,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 96,
|
"order": 96,
|
||||||
@ -709,7 +717,7 @@
|
|||||||
"name": "icon-export",
|
"name": "icon-export",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59950,
|
"code": 59950,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 114,
|
"order": 114,
|
||||||
@ -717,7 +725,7 @@
|
|||||||
"name": "icon-font-size",
|
"name": "icon-font-size",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59951,
|
"code": 59951,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 163,
|
"order": 163,
|
||||||
@ -725,7 +733,7 @@
|
|||||||
"name": "icon-clear-data",
|
"name": "icon-clear-data",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 59952,
|
"code": 59952,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 144,
|
"order": 144,
|
||||||
@ -733,7 +741,7 @@
|
|||||||
"name": "icon-activity",
|
"name": "icon-activity",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60160,
|
"code": 60160,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 104,
|
"order": 104,
|
||||||
@ -741,7 +749,7 @@
|
|||||||
"name": "icon-activity-mode",
|
"name": "icon-activity-mode",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60161,
|
"code": 60161,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 137,
|
"order": 137,
|
||||||
@ -749,7 +757,7 @@
|
|||||||
"name": "icon-autoflow-tabular",
|
"name": "icon-autoflow-tabular",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60162,
|
"code": 60162,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 115,
|
"order": 115,
|
||||||
@ -757,7 +765,7 @@
|
|||||||
"name": "icon-clock",
|
"name": "icon-clock",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60163,
|
"code": 60163,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 2,
|
"order": 2,
|
||||||
@ -765,7 +773,7 @@
|
|||||||
"name": "icon-database",
|
"name": "icon-database",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60164,
|
"code": 60164,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 3,
|
"order": 3,
|
||||||
@ -773,7 +781,7 @@
|
|||||||
"name": "icon-database-query",
|
"name": "icon-database-query",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60165,
|
"code": 60165,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 67,
|
"order": 67,
|
||||||
@ -781,7 +789,7 @@
|
|||||||
"name": "icon-dataset",
|
"name": "icon-dataset",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60166,
|
"code": 60166,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 59,
|
"order": 59,
|
||||||
@ -789,7 +797,7 @@
|
|||||||
"name": "icon-datatable",
|
"name": "icon-datatable",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60167,
|
"code": 60167,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 136,
|
"order": 136,
|
||||||
@ -797,7 +805,7 @@
|
|||||||
"name": "icon-dictionary",
|
"name": "icon-dictionary",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60168,
|
"code": 60168,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 51,
|
"order": 51,
|
||||||
@ -805,7 +813,7 @@
|
|||||||
"name": "icon-folder",
|
"name": "icon-folder",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60169,
|
"code": 60169,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 147,
|
"order": 147,
|
||||||
@ -813,7 +821,7 @@
|
|||||||
"name": "icon-image",
|
"name": "icon-image",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60170,
|
"code": 60170,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 4,
|
"order": 4,
|
||||||
@ -821,7 +829,7 @@
|
|||||||
"name": "icon-layout",
|
"name": "icon-layout",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60171,
|
"code": 60171,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 24,
|
"order": 24,
|
||||||
@ -829,7 +837,7 @@
|
|||||||
"name": "icon-object",
|
"name": "icon-object",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60172,
|
"code": 60172,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 52,
|
"order": 52,
|
||||||
@ -837,7 +845,7 @@
|
|||||||
"name": "icon-object-unknown",
|
"name": "icon-object-unknown",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60173,
|
"code": 60173,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 105,
|
"order": 105,
|
||||||
@ -845,7 +853,7 @@
|
|||||||
"name": "icon-packet",
|
"name": "icon-packet",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60174,
|
"code": 60174,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 126,
|
"order": 126,
|
||||||
@ -853,7 +861,7 @@
|
|||||||
"name": "icon-page",
|
"name": "icon-page",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60175,
|
"code": 60175,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 130,
|
"order": 130,
|
||||||
@ -861,7 +869,7 @@
|
|||||||
"name": "icon-plot-overlay",
|
"name": "icon-plot-overlay",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60176,
|
"code": 60176,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 80,
|
"order": 80,
|
||||||
@ -869,7 +877,7 @@
|
|||||||
"name": "icon-plot-stacked",
|
"name": "icon-plot-stacked",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60177,
|
"code": 60177,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 134,
|
"order": 134,
|
||||||
@ -877,7 +885,7 @@
|
|||||||
"name": "icon-session",
|
"name": "icon-session",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60178,
|
"code": 60178,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 109,
|
"order": 109,
|
||||||
@ -885,7 +893,7 @@
|
|||||||
"name": "icon-tabular",
|
"name": "icon-tabular",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60179,
|
"code": 60179,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 107,
|
"order": 107,
|
||||||
@ -893,7 +901,7 @@
|
|||||||
"name": "icon-tabular-lad",
|
"name": "icon-tabular-lad",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60180,
|
"code": 60180,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 106,
|
"order": 106,
|
||||||
@ -901,7 +909,7 @@
|
|||||||
"name": "icon-tabular-lad-set",
|
"name": "icon-tabular-lad-set",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60181,
|
"code": 60181,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 70,
|
"order": 70,
|
||||||
@ -909,7 +917,7 @@
|
|||||||
"name": "icon-tabular-realtime",
|
"name": "icon-tabular-realtime",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60182,
|
"code": 60182,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 60,
|
"order": 60,
|
||||||
@ -917,7 +925,7 @@
|
|||||||
"name": "icon-tabular-scrolling",
|
"name": "icon-tabular-scrolling",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60183,
|
"code": 60183,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 131,
|
"order": 131,
|
||||||
@ -925,7 +933,7 @@
|
|||||||
"name": "icon-telemetry",
|
"name": "icon-telemetry",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60184,
|
"code": 60184,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 108,
|
"order": 108,
|
||||||
@ -933,7 +941,7 @@
|
|||||||
"name": "icon-timeline",
|
"name": "icon-timeline",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60185,
|
"code": 60185,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 81,
|
"order": 81,
|
||||||
@ -941,7 +949,7 @@
|
|||||||
"name": "icon-timer",
|
"name": "icon-timer",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60186,
|
"code": 60186,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 69,
|
"order": 69,
|
||||||
@ -949,7 +957,7 @@
|
|||||||
"name": "icon-topic",
|
"name": "icon-topic",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60187,
|
"code": 60187,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 79,
|
"order": 79,
|
||||||
@ -957,7 +965,7 @@
|
|||||||
"name": "icon-box-with-dashed-lines-v2",
|
"name": "icon-box-with-dashed-lines-v2",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60188,
|
"code": 60188,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 90,
|
"order": 90,
|
||||||
@ -965,7 +973,7 @@
|
|||||||
"name": "icon-summary-widget",
|
"name": "icon-summary-widget",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60189,
|
"code": 60189,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 92,
|
"order": 92,
|
||||||
@ -973,7 +981,7 @@
|
|||||||
"name": "icon-notebook",
|
"name": "icon-notebook",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60190,
|
"code": 60190,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 168,
|
"order": 168,
|
||||||
@ -981,7 +989,7 @@
|
|||||||
"name": "icon-tabs-view",
|
"name": "icon-tabs-view",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60191,
|
"code": 60191,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 117,
|
"order": 117,
|
||||||
@ -989,7 +997,7 @@
|
|||||||
"name": "icon-flexible-layout",
|
"name": "icon-flexible-layout",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60192,
|
"code": 60192,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 166,
|
"order": 166,
|
||||||
@ -997,7 +1005,7 @@
|
|||||||
"name": "icon-generator-sine",
|
"name": "icon-generator-sine",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60193,
|
"code": 60193,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 167,
|
"order": 167,
|
||||||
@ -1005,7 +1013,7 @@
|
|||||||
"name": "icon-generator-event",
|
"name": "icon-generator-event",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60194,
|
"code": 60194,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"order": 165,
|
"order": 165,
|
||||||
@ -1013,14 +1021,14 @@
|
|||||||
"name": "icon-gauge-v2",
|
"name": "icon-gauge-v2",
|
||||||
"prevSize": 24,
|
"prevSize": 24,
|
||||||
"code": 60195,
|
"code": 60195,
|
||||||
"tempChar": ""
|
"tempChar": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "Open MCT Symbols 16px",
|
"name": "Open MCT Symbols 16px",
|
||||||
"importSize": {
|
"importSize": {
|
||||||
"width": 512,
|
"width": 384,
|
||||||
"height": 512
|
"height": 512
|
||||||
},
|
},
|
||||||
"designer": "Charles Hacskaylo"
|
"designer": "Charles Hacskaylo"
|
||||||
@ -1557,6 +1565,22 @@
|
|||||||
"icon-suitcase"
|
"icon-suitcase"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": 145,
|
||||||
|
"paths": [
|
||||||
|
"M704 320h-64v-64c0-141.385-114.615-256-256-256s-256 114.615-256 256v0 64h-64c-35.301 0.113-63.887 28.699-64 63.989l-0 0.011v576c0.113 35.301 28.699 63.887 63.989 64l0.011 0h640c35.301-0.113 63.887-28.699 64-63.989l0-0.011v-576c-0.113-35.301-28.699-63.887-63.989-64l-0.011-0zM256 256c0-70.692 57.308-128 128-128s128 57.308 128 128v0 64h-256zM533.4 896l-128-128-43 85-170.4-383.6 383.6 170.2-85 43 128 128z"
|
||||||
|
],
|
||||||
|
"attrs": [
|
||||||
|
{}
|
||||||
|
],
|
||||||
|
"width": 768,
|
||||||
|
"isMulticolor": false,
|
||||||
|
"isMulticolor2": false,
|
||||||
|
"grid": 16,
|
||||||
|
"tags": [
|
||||||
|
"icon-cursor-locked"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": 105,
|
"id": 105,
|
||||||
"paths": [
|
"paths": [
|
||||||
@ -2661,7 +2685,7 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"fontFamily": "Open-MCT-Symbols-16px",
|
"fontFamily": "Open-MCT-Symbols-16px",
|
||||||
"majorVersion": 5,
|
"majorVersion": 5,
|
||||||
"minorVersion": 0,
|
"minorVersion": 1,
|
||||||
"designer": "Charles Hacskaylo"
|
"designer": "Charles Hacskaylo"
|
||||||
},
|
},
|
||||||
"metrics": {
|
"metrics": {
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
<glyph unicode="" glyph-name="icon-filter" d="M896 832h-768c-70.601-0.227-127.773-57.399-128-127.978v-768.022c0.227-70.601 57.399-127.773 127.978-128h256.022v512l-192 192h640l-192-192v-512h256c70.601 0.227 127.773 57.399 128 127.978v768.022c-0.227 70.601-57.399 127.773-127.978 128h-0.022z" />
|
<glyph unicode="" glyph-name="icon-filter" d="M896 832h-768c-70.601-0.227-127.773-57.399-128-127.978v-768.022c0.227-70.601 57.399-127.773 127.978-128h256.022v512l-192 192h640l-192-192v-512h256c70.601 0.227 127.773 57.399 128 127.978v768.022c-0.227 70.601-57.399 127.773-127.978 128h-0.022z" />
|
||||||
<glyph unicode="" glyph-name="icon-filter-outline" d="M896 832h-768c-70.601-0.227-127.773-57.399-128-127.978v-768.022c0.227-70.601 57.399-127.773 127.978-128h768.022c70.601 0.227 127.773 57.399 128 127.978v768.022c-0.227 70.601-57.399 127.773-127.978 128h-0.022zM896-63.8h-256v383.8l192 192h-640l192-192v-384h-256v767.8h768z" />
|
<glyph unicode="" glyph-name="icon-filter-outline" d="M896 832h-768c-70.601-0.227-127.773-57.399-128-127.978v-768.022c0.227-70.601 57.399-127.773 127.978-128h768.022c70.601 0.227 127.773 57.399 128 127.978v768.022c-0.227 70.601-57.399 127.773-127.978 128h-0.022zM896-63.8h-256v383.8l192 192h-640l192-192v-384h-256v767.8h768z" />
|
||||||
<glyph unicode="" glyph-name="icon-suitcase" d="M768 704c-0.080 70.66-57.34 127.92-127.993 128h-256.007c-70.66-0.080-127.92-57.34-128-127.993v-128.007h-64v-768h640v768h-64zM384 703.88l0.12 0.12 255.88-0.12v-127.88h-256zM0 512v-640c0.102-35.305 28.695-63.898 63.99-64h64.010v768h-64c-35.305-0.102-63.898-28.695-64-63.99v-0.010zM960 576h-64v-768h64c35.305 0.102 63.898 28.695 64 63.99v640.010c-0.102 35.305-28.695 63.898-63.99 64h-0.010z" />
|
<glyph unicode="" glyph-name="icon-suitcase" d="M768 704c-0.080 70.66-57.34 127.92-127.993 128h-256.007c-70.66-0.080-127.92-57.34-128-127.993v-128.007h-64v-768h640v768h-64zM384 703.88l0.12 0.12 255.88-0.12v-127.88h-256zM0 512v-640c0.102-35.305 28.695-63.898 63.99-64h64.010v768h-64c-35.305-0.102-63.898-28.695-64-63.99v-0.010zM960 576h-64v-768h64c35.305 0.102 63.898 28.695 64 63.99v640.010c-0.102 35.305-28.695 63.898-63.99 64h-0.010z" />
|
||||||
|
<glyph unicode="" glyph-name="icon-cursor-locked" horiz-adv-x="768" d="M704 512h-64v64c0 141.385-114.615 256-256 256s-256-114.615-256-256v0-64h-64c-35.301-0.113-63.887-28.699-64-63.989v-576.011c0.113-35.301 28.699-63.887 63.989-64h640.011c35.301 0.113 63.887 28.699 64 63.989v576.011c-0.113 35.301-28.699 63.887-63.989 64h-0.011zM256 576c0 70.692 57.308 128 128 128s128-57.308 128-128v0-64h-256zM533.4-64l-128 128-43-85-170.4 383.6 383.6-170.2-85-43 128-128z" />
|
||||||
<glyph unicode="" glyph-name="icon-arrows-right-left" d="M1024 320l-448-512v1024zM448 832l-448-512 448-512z" />
|
<glyph unicode="" glyph-name="icon-arrows-right-left" d="M1024 320l-448-512v1024zM448 832l-448-512 448-512z" />
|
||||||
<glyph unicode="" glyph-name="icon-arrows-up-down" d="M512 832l512-448h-1024zM0 256l512-448 512 448z" />
|
<glyph unicode="" glyph-name="icon-arrows-up-down" d="M512 832l512-448h-1024zM0 256l512-448 512 448z" />
|
||||||
<glyph unicode="" glyph-name="icon-bullet" d="M832 80c0-44-36-80-80-80h-480c-44 0-80 36-80 80v480c0 44 36 80 80 80h480c44 0 80-36 80-80v-480z" />
|
<glyph unicode="" glyph-name="icon-bullet" d="M832 80c0-44-36-80-80-80h-480c-44 0-80 36-80 80v480c0 44 36 80 80 80h480c44 0 80-36 80-80v-480z" />
|
||||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Binary file not shown.
Binary file not shown.
@ -127,9 +127,16 @@ const PLACEHOLDER_OBJECT = {};
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveAndFinishEditing() {
|
saveAndFinishEditing() {
|
||||||
|
let dialog = this.openmct.overlays.progressDialog({
|
||||||
|
progressPerc: 'unknown',
|
||||||
|
progressText: 'Saving...',
|
||||||
|
});
|
||||||
|
|
||||||
return this.openmct.editor.save().then(()=> {
|
return this.openmct.editor.save().then(()=> {
|
||||||
|
dialog.dismiss();
|
||||||
this.openmct.notifications.info('Save successful');
|
this.openmct.notifications.info('Save successful');
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
dialog.dismiss();
|
||||||
this.openmct.notifications.error('Error saving objects');
|
this.openmct.notifications.error('Error saving objects');
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
@ -96,10 +96,10 @@
|
|||||||
// 2. Get legacy type from legacy api
|
// 2. Get legacy type from legacy api
|
||||||
// 3. Instantiate create action with type, parent, context
|
// 3. Instantiate create action with type, parent, context
|
||||||
// 4. perform action.
|
// 4. perform action.
|
||||||
return this.openmct.objects.get(openmct.router.path[0].identifier)
|
return this.openmct.objects.get(this.openmct.router.path[0].identifier)
|
||||||
.then((currentObject) => {
|
.then((currentObject) => {
|
||||||
let legacyContextualParent = this.convertToLegacy(currentObject);
|
let legacyContextualParent = this.convertToLegacy(currentObject);
|
||||||
let legacyType = openmct.$injector.get('typeService').getType(item.key);
|
let legacyType = this.openmct.$injector.get('typeService').getType(item.key);
|
||||||
let context = {
|
let context = {
|
||||||
key: "create",
|
key: "create",
|
||||||
domainObject: legacyContextualParent // should be same as parent object.
|
domainObject: legacyContextualParent // should be same as parent object.
|
||||||
@ -116,7 +116,7 @@
|
|||||||
convertToLegacy (domainObject) {
|
convertToLegacy (domainObject) {
|
||||||
let keyString = objectUtils.makeKeyString(domainObject.identifier);
|
let keyString = objectUtils.makeKeyString(domainObject.identifier);
|
||||||
let oldModel = objectUtils.toOldFormat(domainObject);
|
let oldModel = objectUtils.toOldFormat(domainObject);
|
||||||
return openmct.$injector.get('instantiate')(oldModel, keyString);
|
return this.openmct.$injector.get('instantiate')(oldModel, keyString);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed () {
|
||||||
@ -126,7 +126,7 @@
|
|||||||
let items = [];
|
let items = [];
|
||||||
|
|
||||||
this.openmct.types.listKeys().forEach(key => {
|
this.openmct.types.listKeys().forEach(key => {
|
||||||
let menuItem = openmct.types.get(key).definition;
|
let menuItem = this.openmct.types.get(key).definition;
|
||||||
|
|
||||||
if (menuItem.creatable) {
|
if (menuItem.creatable) {
|
||||||
let menuItemTemplate = {
|
let menuItemTemplate = {
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
[class*='__head__collapse-button'] {
|
[class*='__head__collapse-button'] {
|
||||||
align-self: start;
|
align-self: start;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
margin-top: 4px;
|
margin-top: 6px;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: $glyph-icon-arrow-down;
|
content: $glyph-icon-arrow-down;
|
||||||
@ -214,9 +214,9 @@
|
|||||||
&__create-button { margin-right: $interiorMarginLg; }
|
&__create-button { margin-right: $interiorMarginLg; }
|
||||||
|
|
||||||
&__indicators {
|
&__indicators {
|
||||||
//@include test();
|
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-end;
|
||||||
[class*='indicator-clock'] { order: 90; }
|
[class*='indicator-clock'] { order: 90; }
|
||||||
|
|
||||||
.c-indicator .label {
|
.c-indicator .label {
|
||||||
|
@ -13,16 +13,31 @@
|
|||||||
v-if="isLoading"></div>
|
v-if="isLoading"></div>
|
||||||
<!-- end loading -->
|
<!-- end loading -->
|
||||||
|
|
||||||
<div class="c-tree-and-search__no-results" v-if="treeItems.length === 0">
|
<div class="c-tree-and-search__no-results"
|
||||||
|
v-if="(allTreeItems.length === 0) || (searchValue && filteredTreeItems.length === 0)">
|
||||||
No results found
|
No results found
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- main tree -->
|
||||||
<ul class="c-tree-and-search__tree c-tree"
|
<ul class="c-tree-and-search__tree c-tree"
|
||||||
v-if="!isLoading">
|
v-if="!isLoading"
|
||||||
<tree-item v-for="treeItem in treeItems"
|
v-show="!searchValue">
|
||||||
|
<tree-item v-for="treeItem in allTreeItems"
|
||||||
:key="treeItem.id"
|
:key="treeItem.id"
|
||||||
:node="treeItem">
|
:node="treeItem">
|
||||||
</tree-item>
|
</tree-item>
|
||||||
</ul>
|
</ul>
|
||||||
|
<!-- end main tree -->
|
||||||
|
|
||||||
|
<!-- search tree -->
|
||||||
|
<ul class="c-tree-and-search__tree c-tree"
|
||||||
|
v-if="searchValue">
|
||||||
|
<tree-item v-for="treeItem in filteredTreeItems"
|
||||||
|
:key="treeItem.id"
|
||||||
|
:node="treeItem">
|
||||||
|
</tree-item>
|
||||||
|
</ul>
|
||||||
|
<!-- end search tree -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -188,15 +203,6 @@
|
|||||||
isLoading: false
|
isLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
treeItems() {
|
|
||||||
if (this.searchValue === '') {
|
|
||||||
return this.allTreeItems;
|
|
||||||
} else {
|
|
||||||
return this.filteredTreeItems;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
getAllChildren() {
|
getAllChildren() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
@ -107,19 +107,19 @@
|
|||||||
.c-indicator__label {
|
.c-indicator__label {
|
||||||
box-shadow: $colorIndicatorMenuBgShdw;
|
box-shadow: $colorIndicatorMenuBgShdw;
|
||||||
transform: scale(1.0);
|
transform: scale(1.0);
|
||||||
transition: transform 100ms ease-out 100ms;
|
transition: all 100ms ease-out 100ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.c-indicator__label {
|
.c-indicator__label {
|
||||||
transition: transform 250ms ease-in 200ms;
|
transition: all 250ms ease-in 200ms;
|
||||||
background: $colorIndicatorMenuBg;
|
background: $colorIndicatorMenuBg;
|
||||||
color: $colorIndicatorMenuFg;
|
color: $colorIndicatorMenuFg;
|
||||||
border-radius: $controlCr;
|
border-radius: $controlCr;
|
||||||
left: 0;
|
right: 0;
|
||||||
top: 130%;
|
top: 130%;
|
||||||
padding: $interiorMargin $interiorMargin;
|
padding: $interiorMargin $interiorMargin;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
transform-origin: 10px 0;
|
transform-origin: 90% 0;
|
||||||
transform: scale(0.0);
|
transform: scale(0.0);
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
@ -130,6 +130,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
|
right: 8px;
|
||||||
@include triangle('up', $size: 4px, $ratio: 1, $color: $colorIndicatorMenuBg);
|
@include triangle('up', $size: 4px, $ratio: 1, $color: $colorIndicatorMenuBg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
openmct.notifications.on('notification', this.showNotification);
|
this.openmct.notifications.on('notification', this.showNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,8 +69,8 @@
|
|||||||
let removeListener = this.openmct.objects.observe(this.domainObject, '*', (newObject) => {
|
let removeListener = this.openmct.objects.observe(this.domainObject, '*', (newObject) => {
|
||||||
this.domainObject = newObject;
|
this.domainObject = newObject;
|
||||||
});
|
});
|
||||||
this.$once('hook:destroyed', removeListener);
|
|
||||||
|
|
||||||
|
this.$once('hook:destroyed', removeListener);
|
||||||
if (this.openmct.composition.get(this.node.object)) {
|
if (this.openmct.composition.get(this.node.object)) {
|
||||||
this.hasChildren = true;
|
this.hasChildren = true;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
Application router -- must
|
Application router -- must
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
/*global _,module*/
|
||||||
|
|
||||||
const LocationBar = require('location-bar');
|
const LocationBar = require('location-bar');
|
||||||
const EventEmitter = require('EventEmitter');
|
const EventEmitter = require('EventEmitter');
|
||||||
@ -117,7 +118,7 @@ class ApplicationRouter extends EventEmitter {
|
|||||||
changedParams[key] = value;
|
changedParams[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let [key, value] of Object.entries(oldParams)) {
|
for (let key of Object.keys(oldParams)) {
|
||||||
if (!newParams.hasOwnProperty(key)) {
|
if (!newParams.hasOwnProperty(key)) {
|
||||||
changedParams[key] = undefined;
|
changedParams[key] = undefined;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="c-ctrl-wrapper">
|
<div class="c-ctrl-wrapper">
|
||||||
<div class="c-icon-button"
|
<div class="c-icon-button"
|
||||||
:title="nextValue.title"
|
:title="nextValue.title"
|
||||||
:class="[nextValue.icon, {'c-click-icon--mixed': nonSpecific}]"
|
:class="[nextValue.icon, {'c-icon-button--mixed': nonSpecific}]"
|
||||||
@click="cycle">
|
@click="cycle">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user