mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 16:10:23 +00:00
Adds missing id during create condition
This commit is contained in:
@ -122,6 +122,7 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
output: 'false',
|
output: 'false',
|
||||||
trigger: 'all',
|
trigger: 'all',
|
||||||
criteria: [{
|
criteria: [{
|
||||||
|
id: uuid(),
|
||||||
telemetry: '',
|
telemetry: '',
|
||||||
operation: '',
|
operation: '',
|
||||||
input: [],
|
input: [],
|
||||||
@ -140,7 +141,7 @@ export default class ConditionManager extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cloneCondition(conditionConfiguration, index) {
|
cloneCondition(conditionConfiguration, index) {
|
||||||
this.createAndSaveCondition(index, JSON.parse(JSON.stringify(conditionConfiguration)));
|
this.createAndSaveCondition(index, Object.assign({}, conditionConfiguration));
|
||||||
}
|
}
|
||||||
|
|
||||||
createAndSaveCondition(index, conditionConfiguration) {
|
createAndSaveCondition(index, conditionConfiguration) {
|
||||||
|
@ -308,8 +308,7 @@ export default {
|
|||||||
this.persist();
|
this.persist();
|
||||||
},
|
},
|
||||||
cloneCriterion(index) {
|
cloneCriterion(index) {
|
||||||
const clonedCriterion = JSON.parse(JSON.stringify(this.condition.configuration.criteria[index]));
|
const clonedCriterion = Object.assign({}, this.condition.configuration.criteria[index], { id: uuid() });
|
||||||
clonedCriterion.id = uuid();
|
|
||||||
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||||
this.persist();
|
this.persist();
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user