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:
Shefali Joshi 2022-06-03 09:46:27 -07:00 committed by GitHub
parent 04ee6f49d6
commit 40a7451064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 8 deletions

View File

@ -31,7 +31,7 @@ commands:
type: string
steps:
- when:
condition:
condition:
equal: [false, << pipeline.parameters.BUST_CACHE >> ]
steps:
- restore_cache:
@ -41,7 +41,7 @@ commands:
parameters:
node-version:
type: string
steps:
steps:
- save_cache:
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
@ -61,7 +61,7 @@ commands:
upload_code_covio:
description: "Command to upload code coverage reports to codecov.io"
steps:
- run: curl -Os https://uploader.codecov.io/latest/linux/codecov;chmod +x codecov;./codecov
- run: curl -Os https://uploader.codecov.io/latest/linux/codecov;chmod +x codecov;./codecov
orbs:
node: circleci/node@4.9.0
browser-tools: circleci/browser-tools@1.3.0
@ -101,7 +101,7 @@ jobs:
equal: [ "FirefoxESR", <<parameters.browser>> ]
steps:
- browser-tools/install-firefox:
version: "91.7.1esr" #https://archive.mozilla.org/pub/firefox/releases/
version: "91.7.1esr" #https://archive.mozilla.org/pub/firefox/releases/
- when:
condition:
equal: [ "FirefoxHeadless", <<parameters.browser>> ]
@ -158,7 +158,7 @@ workflows:
- lint:
name: node16-lint
node-version: lts/gallium
- unit-test:
- unit-test:
name: node14-chrome
node-version: lts/fermium
browser: ChromeHeadless

View File

@ -78,11 +78,13 @@ export default class StyleRuleManager extends EventEmitter {
this.openmct.objects.get(this.conditionSetIdentifier).then((conditionSetDomainObject) => {
this.openmct.telemetry.request(conditionSetDomainObject)
.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.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));
}
});
}

View File

@ -76,6 +76,13 @@ export default class EditPropertiesAction extends PropertiesAction {
}
}
/**
* @private
*/
_onCancel() {
//noop
}
/**
* @private
*/
@ -87,6 +94,7 @@ export default class EditPropertiesAction extends PropertiesAction {
formStructure.title = 'Edit ' + this.domainObject.name;
return this.openmct.forms.showForm(formStructure)
.then(this._onSave.bind(this));
.then(this._onSave.bind(this))
.catch(this._onCancel.bind(this));
}
}

View File

@ -123,6 +123,9 @@ describe('EditPropertiesAction plugin', () => {
}
editPropertiesAction.invoke([domainObject])
.then(() => {
done();
})
.catch(() => {
done();
});
@ -208,6 +211,10 @@ describe('EditPropertiesAction plugin', () => {
};
editPropertiesAction.invoke([domainObject])
.then(() => {
expect(domainObject.name).toEqual(name);
done();
})
.catch(() => {
expect(domainObject.name).toEqual(name);