Fixed memory leak in import-export plugin (#4061)

This commit is contained in:
Andrew Henry 2021-09-02 15:45:11 -07:00 committed by GitHub
parent 6506077f4d
commit 48c22369a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -30,8 +30,8 @@ define([
return function ImportExportPlugin() {
return function (openmct) {
ExportAsJSONAction.appliesTo = function (context) {
return openmct.$injector.get('policyService')
ExportAsJSONAction.prototype.appliesTo = function (context) {
return this.openmct.$injector.get('policyService')
.allow("creation", context.domainObject.getCapability("type")
);
};

View File

@ -29,7 +29,7 @@ define(
],
function (ExportAsJSONAction, domainObjectFactory, MCT, AdapterCapability) {
xdescribe("The export JSON action", function () {
describe("The export JSON action", function () {
var context,
action,
@ -102,7 +102,7 @@ define(
expect(action).toBeDefined();
});
it("doesn't export non-creatable objects in tree", function () {
xit("doesn't export non-creatable objects in tree", function () {
var nonCreatableType = {
hasFeature:
function (feature) {
@ -149,7 +149,7 @@ define(
});
});
it("can export self-containing objects", function () {
xit("can export self-containing objects", function () {
var parent = domainObjectFactory({
name: 'parent',
model: {
@ -191,7 +191,7 @@ define(
});
});
it("exports links to external objects as new objects", function () {
xit("exports links to external objects as new objects", function () {
var parent = domainObjectFactory({
name: 'parent',
model: {

View File

@ -27,7 +27,7 @@ define(
],
function (ImportAsJSONAction, domainObjectFactory) {
xdescribe("The import JSON action", function () {
describe("The import JSON action", function () {
var context = {};
var action,
@ -146,7 +146,7 @@ define(
});
});
it("can import self-containing objects", function () {
xit("can import self-containing objects", function () {
var compDomainObject = domainObjectFactory({
name: 'compObject',
model: { name: 'compObject'},
@ -198,7 +198,7 @@ define(
});
});
it("assigns new ids to each imported object", function () {
xit("assigns new ids to each imported object", function () {
dialogService.getUserInput.and.returnValue(Promise.resolve(
{
selectFile: {