Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Rogers
562bea0527 WIP: initial interceptor structure for summary widget 2021-12-15 09:22:13 -06:00
3 changed files with 59 additions and 4 deletions

View File

@@ -1,15 +1,18 @@
define([
'./SummaryWidgetsCompositionPolicy',
'./src/telemetry/SummaryWidgetMetadataProvider',
'./src/telemetry/SummaryWidgetTelemetryProvider',
'./src/views/SummaryWidgetViewProvider',
'./SummaryWidgetViewPolicy'
'./SummaryWidgetViewPolicy',
'./SummaryWidgetInterceptor'
], function (
SummaryWidgetsCompositionPolicy,
SummaryWidgetMetadataProvider,
SummaryWidgetTelemetryProvider,
SummaryWidgetViewProvider,
SummaryWidgetViewPolicy
SummaryWidgetViewPolicy,
SummaryWidgetInterceptor
) {
function plugin() {
@@ -85,9 +88,9 @@ define([
return function install(openmct) {
openmct.types.addType('summary-widget', widgetType);
openmct.legacyExtension('policies', {
openmct.legacyExtension('policies', {
category: 'composition',
implementation: SummaryWidgetsCompositionPolicy,
implementation: SummaryWidgetsCompositionPolicy,
depends: ['openmct']
});
openmct.legacyExtension('policies', {
@@ -95,6 +98,9 @@ define([
implementation: SummaryWidgetViewPolicy,
depends: ['openmct']
});
// migrate summary widgets to condition widgets
SummaryWidgetInterceptor(openmct);
openmct.telemetry.addProvider(new SummaryWidgetMetadataProvider(openmct));
openmct.telemetry.addProvider(new SummaryWidgetTelemetryProvider(openmct));
openmct.objectViews.addProvider(new SummaryWidgetViewProvider(openmct));

View File

@@ -0,0 +1,42 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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(
['./utils/summary-widget-migration.js'],
function (summaryWidgetMigration) {
function SummaryWidgetInterceptor(openmct) {
this.openmct = openmct;
openmct.objects.addGetInterceptor({
appliesTo: (identifier, domainObject) => {
return domainObject && domainObject.type === 'summary-widget';
},
invoke: (identifier, domainObject) => {
summaryWidgetMigration(openmct, domainObject);
return domainObject;
}
});
}
return SummaryWidgetInterceptor;
}
);

View File

@@ -0,0 +1,7 @@
define(
[],
function () {
return function summaryWidgetMigration(openmct, domainObject) {
const configuration = domainObject.configuration;
}
});