Compare commits

...

4 Commits

Author SHA1 Message Date
afdf6e7067 [Selection] Allow toggling of legacy inspector
...to verify that this approach to switching inspector
contents works as expected.
2016-10-18 14:46:20 -07:00
f8be42f82d [Selection] Begin adding InspectorAdapterController 2016-10-18 14:38:34 -07:00
1ccc0780c8 [Selection] Display legacy inspector 2016-10-18 14:32:46 -07:00
830d042cea [Selection] Override object inspector
...to allow for selection inspection, which implements #1126
2016-10-18 14:10:40 -07:00
4 changed files with 85 additions and 3 deletions

View File

@ -498,7 +498,7 @@ define([
]
},
{
"key": "object-inspector",
"key": "legacy-object-inspector",
"template": objectInspectorTemplate
}
],

View File

@ -23,19 +23,23 @@
define([
'legacyRegistry',
'./actions/ActionDialogDecorator',
'./controllers/InspectorAdapterController',
'./directives/MCTView',
'./services/Instantiate',
'./capabilities/APICapabilityDecorator',
'./policies/AdapterCompositionPolicy',
'./runs/AlternateCompositionInitializer'
'./runs/AlternateCompositionInitializer',
'text!./templates/object-inspector-replacement.html'
], function (
legacyRegistry,
ActionDialogDecorator,
InspectorAdapterController,
MCTView,
Instantiate,
APICapabilityDecorator,
AdapterCompositionPolicy,
AlternateCompositionInitializer
AlternateCompositionInitializer,
objectInspectorTemplate
) {
legacyRegistry.register('src/adapter', {
"extensions": {
@ -77,6 +81,13 @@ define([
depends: ["openmct"]
}
],
controllers: [
{
"key": "InspectorAdapterController",
implementation: InspectorAdapterController,
depends: ["$scope", "openmct"]
}
],
policies: [
{
category: "composition",
@ -90,6 +101,13 @@ define([
depends: ["openmct"]
}
],
representations: [
{
key: "object-inspector",
priority: "mandatory",
template: objectInspectorTemplate
}
],
licenses: [
{
"name": "almond",

View File

@ -0,0 +1,54 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2016, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* Controller for the object-inspector used in the adapter
* layer of the new API.
* @constructor
* @private
*/
function InspectorAdapterController($scope, openmct) {
var changeCallback = this.selectionChanged.bind(this);
this.hasViewFlag = false;
openmct.selection.on('change', changeCallback);
$scope.$on('$destroy', function () {
openmct.selection.off('change', changeCallback);
});
}
InspectorAdapterController.prototype.selectionChanged = function () {
};
InspectorAdapterController.prototype.toggle = function () {
this.hasViewFlag = !this.hasViewFlag;
};
InspectorAdapterController.prototype.hasView = function () {
return this.hasViewFlag;
};
return InspectorAdapterController;
});

View File

@ -0,0 +1,10 @@
<div ng-controller="InspectorAdapterController as adapter"
ng-click="adapter.toggle()">
<span ng-if="adapter.hasView()">Legacy inspector suppressed</span>
<div ng-if="!adapter.hasView()">
<mct-representation key="'legacy-object-inspector'"
mct-object="domainObject"
ng-model="ngModel">
</mct-representation>
</div>
</div>