mirror of
https://github.com/nasa/openmct.git
synced 2025-04-12 05:40:17 +00:00
used lodash cloneDeep for criteria, conditions
This commit is contained in:
parent
bf947a8835
commit
1a86204637
@ -23,6 +23,7 @@
|
||||
import Condition from "./Condition";
|
||||
import uuid from "uuid";
|
||||
import EventEmitter from 'EventEmitter';
|
||||
import _ from "lodash";
|
||||
|
||||
export default class ConditionManager extends EventEmitter {
|
||||
constructor(conditionSetDomainObject, openmct) {
|
||||
@ -142,7 +143,7 @@ export default class ConditionManager extends EventEmitter {
|
||||
}
|
||||
|
||||
createAndSaveCondition(index, conditionConfiguration) {
|
||||
let newCondition = this.createCondition(conditionConfiguration);
|
||||
const newCondition = _.cloneDeep(this.createCondition(conditionConfiguration));
|
||||
if (index !== undefined) {
|
||||
this.conditionSetDomainObject.configuration.conditionCollection.splice(index + 1, 0, newCondition);
|
||||
} else {
|
||||
|
@ -181,6 +181,7 @@
|
||||
<script>
|
||||
import Criterion from './Criterion.vue';
|
||||
import ConditionDescription from "./ConditionDescription.vue";
|
||||
import _ from "lodash";
|
||||
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
@ -291,12 +292,12 @@ export default {
|
||||
},
|
||||
removeCriterion(index) {
|
||||
this.condition.configuration.criteria.splice(index, 1);
|
||||
this.persist()
|
||||
this.persist();
|
||||
},
|
||||
cloneCriterion(index) {
|
||||
const clonedCriterion = {...this.condition.configuration.criteria[index]};
|
||||
const clonedCriterion = _.cloneDeep(this.condition.configuration.criteria[index]);
|
||||
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||
this.persist()
|
||||
this.persist();
|
||||
},
|
||||
persist() {
|
||||
this.$emit('updateCondition', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user