mirror of
https://github.com/nasa/openmct.git
synced 2025-06-04 08:30:48 +00:00
Fix stackplots static style (#5045)
* [4864] Fixes cancelling edit properties console error * Get the style receiver when the styleRuleManager is initialized. This prevents any ambiguity about which element should receive the style * Don't subscribe if the styleRuleManager has been destroyed Co-authored-by: John Hill <john.c.hill@nasa.gov> Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov> Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov> Co-authored-by: Andrew Henry <andrew.k.henry@nasa.gov>
This commit is contained in:
parent
04ee6f49d6
commit
40a7451064
@ -78,11 +78,13 @@ export default class StyleRuleManager extends EventEmitter {
|
|||||||
this.openmct.objects.get(this.conditionSetIdentifier).then((conditionSetDomainObject) => {
|
this.openmct.objects.get(this.conditionSetIdentifier).then((conditionSetDomainObject) => {
|
||||||
this.openmct.telemetry.request(conditionSetDomainObject)
|
this.openmct.telemetry.request(conditionSetDomainObject)
|
||||||
.then(output => {
|
.then(output => {
|
||||||
if (output && output.length) {
|
if (output && output.length && (this.conditionSetIdentifier && this.openmct.objects.areIdsEqual(conditionSetDomainObject.identifier, this.conditionSetIdentifier))) {
|
||||||
this.handleConditionSetResultUpdated(output[0]);
|
this.handleConditionSetResultUpdated(output[0]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.stopProvidingTelemetry = this.openmct.telemetry.subscribe(conditionSetDomainObject, this.handleConditionSetResultUpdated.bind(this));
|
if (this.conditionSetIdentifier && this.openmct.objects.areIdsEqual(conditionSetDomainObject.identifier, this.conditionSetIdentifier)) {
|
||||||
|
this.stopProvidingTelemetry = this.openmct.telemetry.subscribe(conditionSetDomainObject, this.handleConditionSetResultUpdated.bind(this));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +76,13 @@ export default class EditPropertiesAction extends PropertiesAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_onCancel() {
|
||||||
|
//noop
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@ -87,6 +94,7 @@ export default class EditPropertiesAction extends PropertiesAction {
|
|||||||
formStructure.title = 'Edit ' + this.domainObject.name;
|
formStructure.title = 'Edit ' + this.domainObject.name;
|
||||||
|
|
||||||
return this.openmct.forms.showForm(formStructure)
|
return this.openmct.forms.showForm(formStructure)
|
||||||
.then(this._onSave.bind(this));
|
.then(this._onSave.bind(this))
|
||||||
|
.catch(this._onCancel.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,9 @@ describe('EditPropertiesAction plugin', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editPropertiesAction.invoke([domainObject])
|
editPropertiesAction.invoke([domainObject])
|
||||||
|
.then(() => {
|
||||||
|
done();
|
||||||
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@ -208,6 +211,10 @@ describe('EditPropertiesAction plugin', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
editPropertiesAction.invoke([domainObject])
|
editPropertiesAction.invoke([domainObject])
|
||||||
|
.then(() => {
|
||||||
|
expect(domainObject.name).toEqual(name);
|
||||||
|
done();
|
||||||
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
expect(domainObject.name).toEqual(name);
|
expect(domainObject.name).toEqual(name);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user