openmct/platform/import-export/bundle.js
Andrew Henry 4414161faf Fixes to enable testing by third party applications (#2523)
* Initial commit of telemetry table spec

* Fix errors found by running Open MCT app headless

* Do not double install import-export plugin

* Changes to allow Open MCT to be initialized more than once without binding to window.document

* Remove table spec accidentally added
2019-10-21 10:24:46 -07:00

78 lines
3.2 KiB
JavaScript

/*****************************************************************************
* 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 define*/
define([
"./src/actions/ExportAsJSONAction",
"./src/actions/ImportAsJSONAction"
], function (
ExportAsJSONAction,
ImportAsJSONAction
) {
return function ImportExportPlugin() {
return function (openmct) {
ExportAsJSONAction.appliesTo = function (context) {
return openmct.$injector.get('policyService')
.allow("creation", context.domainObject.getCapability("type")
);
};
openmct.legacyRegistry.register("platform/import-export", {
"name": "Import-export plugin",
"description": "Allows importing / exporting of domain objects as JSON.",
"extensions": {
"actions": [
{
"key": "export.JSON",
"name": "Export as JSON",
"implementation": ExportAsJSONAction,
"category": "contextual",
"cssClass": "icon-export",
"depends": [
"openmct",
"exportService",
"policyService",
"identifierService",
"typeService"
]
},
{
"key": "import.JSON",
"name": "Import from JSON",
"implementation": ImportAsJSONAction,
"category": "contextual",
"cssClass": "icon-import",
"depends": [
"exportService",
"identifierService",
"dialogService",
"openmct"
]
}
]
}
});
};
};
});