mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 09:52:04 +00:00
[Search] Don't index objects being edited
https://github.com/nasa/openmctweb/pull/727#issuecomment-195570183
This commit is contained in:
parent
2d305415b3
commit
107ecfe687
@ -121,9 +121,13 @@ define([
|
|||||||
provider = this;
|
provider = this;
|
||||||
|
|
||||||
mutationTopic.listen(function (mutatedObject) {
|
mutationTopic.listen(function (mutatedObject) {
|
||||||
var id = mutatedObject.getId(),
|
var status = mutatedObject.getCapability('status');
|
||||||
model = mutatedObject.getModel();
|
if (!status || !status.get('editing')) {
|
||||||
provider.index(id, model);
|
provider.index(
|
||||||
|
mutatedObject.getId(),
|
||||||
|
mutatedObject.getModel()
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,7 +101,11 @@ define([
|
|||||||
|
|
||||||
it('re-indexes when mutation occurs', function () {
|
it('re-indexes when mutation occurs', function () {
|
||||||
var mockDomainObject =
|
var mockDomainObject =
|
||||||
jasmine.createSpyObj('domainObj', ['getId', 'getModel']),
|
jasmine.createSpyObj('domainObj', [
|
||||||
|
'getId',
|
||||||
|
'getModel',
|
||||||
|
'getCapability'
|
||||||
|
]),
|
||||||
testModel = { some: 'model' };
|
testModel = { some: 'model' };
|
||||||
mockDomainObject.getId.andReturn("some-id");
|
mockDomainObject.getId.andReturn("some-id");
|
||||||
mockDomainObject.getModel.andReturn(testModel);
|
mockDomainObject.getModel.andReturn(testModel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user