mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
Merge pull request #3374 from nasa/object-create-fix-9152020
Use ObjectAPI.save in Display Layout and New folder action
This commit is contained in:
commit
67749dd2bb
@ -630,7 +630,7 @@ export default {
|
|||||||
object.identifier = identifier;
|
object.identifier = identifier;
|
||||||
object.location = parentKeyString;
|
object.location = parentKeyString;
|
||||||
|
|
||||||
this.openmct.objects.mutate(object, 'created', Date.now());
|
this.openmct.objects.save(object);
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
},
|
},
|
||||||
|
@ -72,7 +72,8 @@ export default class NewFolderAction {
|
|||||||
folderType.definition.initialize(objectModel);
|
folderType.definition.initialize(objectModel);
|
||||||
objectModel.name = name || 'New Folder';
|
objectModel.name = name || 'New Folder';
|
||||||
|
|
||||||
this._openmct.objects.mutate(objectModel, 'created', Date.now());
|
this._openmct.objects.save(objectModel);
|
||||||
|
|
||||||
composition.add(objectModel);
|
composition.add(objectModel);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ describe("the plugin", () => {
|
|||||||
|
|
||||||
spyOn(openmct.$injector, 'get').and.returnValue(mockDialogService);
|
spyOn(openmct.$injector, 'get').and.returnValue(mockDialogService);
|
||||||
spyOn(compositionAPI, 'get').and.returnValue(mockComposition);
|
spyOn(compositionAPI, 'get').and.returnValue(mockComposition);
|
||||||
spyOn(openmct.objects, 'mutate');
|
spyOn(openmct.objects, 'save');
|
||||||
|
|
||||||
newFolderAction.invoke(mockObjectPath);
|
newFolderAction.invoke(mockObjectPath);
|
||||||
});
|
});
|
||||||
@ -89,7 +89,7 @@ describe("the plugin", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('creates a new folder object', () => {
|
it('creates a new folder object', () => {
|
||||||
expect(openmct.objects.mutate).toHaveBeenCalled();
|
expect(openmct.objects.save).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds new folder object to parent composition', () => {
|
it('adds new folder object to parent composition', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user