diff --git a/src/plugins/condition/StyleRuleManager.js b/src/plugins/condition/StyleRuleManager.js index fb585455cb..6fe7b38c37 100644 --- a/src/plugins/condition/StyleRuleManager.js +++ b/src/plugins/condition/StyleRuleManager.js @@ -29,6 +29,7 @@ export default class StyleRuleManager extends EventEmitter { this.callback = callback; if (suppressSubscriptionOnEdit) { this.openmct.editor.on('isEditing', this.toggleSubscription.bind(this)); + this.isEditing = this.openmct.editor.editing; } if (styleConfiguration) { this.initialize(styleConfiguration); @@ -156,7 +157,6 @@ export default class StyleRuleManager extends EventEmitter { } delete this.stopProvidingTelemetry; this.conditionSetIdentifier = undefined; - this.isEditing = undefined; } } diff --git a/src/plugins/condition/components/inspector/StylesView.vue b/src/plugins/condition/components/inspector/StylesView.vue new file mode 100644 index 0000000000..dd783cda8a --- /dev/null +++ b/src/plugins/condition/components/inspector/StylesView.vue @@ -0,0 +1,601 @@ +/***************************************************************************** +* Open MCT, Copyright (c) 2014-2020, United States Government +* as represented by the Administrator of the National Aeronautics and Space +* Administration. All rights reserved. +* +* Open MCT is licensed under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* http://www.apache.org/licenses/LICENSE-2.0. +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +* License for the specific language governing permissions and limitations +* under the License. +* +* Open MCT includes source code licensed under additional open source +* licenses. See the Open Source Licenses file (LICENSES.md) included with +* this source code distribution or the Licensing information page available +* at runtime from the About dialog for additional information. +*****************************************************************************/ + + + + diff --git a/src/plugins/condition/utils/styleUtils.js b/src/plugins/condition/utils/styleUtils.js index 24bf82a1d7..03a83d9c2f 100644 --- a/src/plugins/condition/utils/styleUtils.js +++ b/src/plugins/condition/utils/styleUtils.js @@ -124,12 +124,25 @@ export const getConditionalStyleForItem = (domainObject, id) => { if (domainObjectStyles[id] && domainObjectStyles[id].conditionSetIdentifier) { return domainObjectStyles[id].styles; } - } else if (domainObjectStyles.staticStyle) { + } else if (domainObjectStyles.conditionSetIdentifier) { return domainObjectStyles.styles; } } }; +export const getConditionSetIdentifierForItem = (domainObject, id) => { + let domainObjectStyles = domainObject && domainObject.configuration && domainObject.configuration.objectStyles; + if (domainObjectStyles) { + if (id) { + if (domainObjectStyles[id] && domainObjectStyles[id].conditionSetIdentifier) { + return domainObjectStyles[id].conditionSetIdentifier; + } + } else if (domainObjectStyles.conditionSetIdentifier) { + return domainObjectStyles.conditionSetIdentifier; + } + } +}; + //Returns either existing static styles or uses SVG defaults if available export const getApplicableStylesForItem = (domainObject, item) => { const type = item && item.type; diff --git a/src/ui/inspector/StylesInspectorView.vue b/src/ui/inspector/StylesInspectorView.vue index 80aa8d8328..9bf2eba1db 100644 --- a/src/ui/inspector/StylesInspectorView.vue +++ b/src/ui/inspector/StylesInspectorView.vue @@ -25,8 +25,7 @@