mirror of
https://github.com/nasa/openmct.git
synced 2025-04-08 11:54:25 +00:00
addressed review comments
This commit is contained in:
parent
1a86204637
commit
90b475e17b
@ -23,7 +23,6 @@
|
||||
import Condition from "./Condition";
|
||||
import uuid from "uuid";
|
||||
import EventEmitter from 'EventEmitter';
|
||||
import _ from "lodash";
|
||||
|
||||
export default class ConditionManager extends EventEmitter {
|
||||
constructor(conditionSetDomainObject, openmct) {
|
||||
@ -104,12 +103,16 @@ export default class ConditionManager extends EventEmitter {
|
||||
|
||||
createCondition(conditionConfiguration) {
|
||||
let conditionObj;
|
||||
let newConfiguration;
|
||||
if (conditionConfiguration) {
|
||||
newConfiguration = JSON.parse(JSON.stringify(conditionConfiguration));
|
||||
}
|
||||
if (conditionConfiguration) {
|
||||
conditionObj = {
|
||||
...conditionConfiguration,
|
||||
...newConfiguration,
|
||||
id: uuid(),
|
||||
configuration: {
|
||||
...conditionConfiguration.configuration,
|
||||
...newConfiguration.configuration,
|
||||
name: `Copy of ${conditionConfiguration.configuration.name}`
|
||||
}
|
||||
};
|
||||
@ -143,7 +146,7 @@ export default class ConditionManager extends EventEmitter {
|
||||
}
|
||||
|
||||
createAndSaveCondition(index, conditionConfiguration) {
|
||||
const newCondition = _.cloneDeep(this.createCondition(conditionConfiguration));
|
||||
const newCondition = this.createCondition(conditionConfiguration);
|
||||
if (index !== undefined) {
|
||||
this.conditionSetDomainObject.configuration.conditionCollection.splice(index + 1, 0, newCondition);
|
||||
} else {
|
||||
|
@ -181,7 +181,6 @@
|
||||
<script>
|
||||
import Criterion from './Criterion.vue';
|
||||
import ConditionDescription from "./ConditionDescription.vue";
|
||||
import _ from "lodash";
|
||||
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
@ -295,7 +294,7 @@ export default {
|
||||
this.persist();
|
||||
},
|
||||
cloneCriterion(index) {
|
||||
const clonedCriterion = _.cloneDeep(this.condition.configuration.criteria[index]);
|
||||
const clonedCriterion = JSON.parse(JSON.stringify(this.condition.configuration.criteria[index]));
|
||||
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||
this.persist();
|
||||
},
|
||||
|
@ -118,14 +118,6 @@ export default {
|
||||
inputTypes: INPUT_TYPES
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
telemetry: {
|
||||
handler(newTelemetry, oldTelemetry) {
|
||||
this.checkTelemetry();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
setRowLabel: function () {
|
||||
let operator = this.trigger === 'all' ? 'and ': 'or ';
|
||||
@ -149,6 +141,14 @@ export default {
|
||||
return type;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
telemetry: {
|
||||
handler(newTelemetry, oldTelemetry) {
|
||||
this.checkTelemetry();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.updateMetadataOptions();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user