mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 19:36:41 +00:00
added persist for remove
This commit is contained in:
parent
2d8f61172d
commit
4d263bcf32
@ -137,16 +137,22 @@ export default {
|
|||||||
this.conditions[index] = updatedCondition;
|
this.conditions[index] = updatedCondition;
|
||||||
},
|
},
|
||||||
removeCondition(identifier) {
|
removeCondition(identifier) {
|
||||||
|
console.log('this.conditions', this.conditions);
|
||||||
let index = _.findIndex(this.conditionCollection, (condition) => {
|
let index = _.findIndex(this.conditionCollection, (condition) => {
|
||||||
identifier.key === condition.key
|
identifier.key === condition.key
|
||||||
});
|
});
|
||||||
this.conditionCollection.splice(index + 1, 1);
|
this.conditionCollection.splice(index + 1, 1);
|
||||||
|
this.persist();
|
||||||
},
|
},
|
||||||
reorder(reorderPlan) {
|
reorder(reorderPlan) {
|
||||||
let oldConditions = this.conditionCollection.slice();
|
let oldConditions = this.conditionCollection.slice();
|
||||||
reorderPlan.forEach((reorderEvent) => {
|
reorderPlan.forEach((reorderEvent) => {
|
||||||
this.$set(this.conditionCollection, reorderEvent.newIndex, oldConditions[reorderEvent.oldIndex]);
|
this.$set(this.conditionCollection, reorderEvent.newIndex, oldConditions[reorderEvent.oldIndex]);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
persist() {
|
||||||
|
console.log('this.domainObject', this.domainObject);
|
||||||
|
this.openmct.objects.mutate(this.domainObject, 'configuration.conditionCollection', this.conditionCollection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,14 +176,8 @@ export default {
|
|||||||
this.persist();
|
this.persist();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
removeCondition(ev) {
|
removeCondition() {
|
||||||
this.$emit('remove-condition', this.conditionIdentifier);
|
this.$emit('remove-condition', this.conditionIdentifier);
|
||||||
// const conditionDiv = ev.target.closest('.conditionArea');
|
|
||||||
// const conditionCollectionDiv = conditionDiv.closest('.condition-collection');
|
|
||||||
// const index = Array.from(conditionCollectionDiv.children).indexOf(conditionDiv);
|
|
||||||
|
|
||||||
// this.domainObject.configuration.conditionCollection.splice(index, 1);
|
|
||||||
// this.updateCurrentCondition();
|
|
||||||
},
|
},
|
||||||
updateTelemetry() {
|
updateTelemetry() {
|
||||||
if (this.hasTelemetry()) {
|
if (this.hasTelemetry()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user