mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 19:36:41 +00:00
added uuid to addCriteria, cloneCriteria, changed key of v-for to criteria.id
This commit is contained in:
parent
169cc6617a
commit
c33314a4bf
@ -121,7 +121,7 @@
|
||||
|
||||
<template v-if="telemetry.length || condition.configuration.criteria.length">
|
||||
<div v-for="(criterion, index) in condition.configuration.criteria"
|
||||
:key="criterion.telemetry.key"
|
||||
:key="criterion.id"
|
||||
class="c-cdef__criteria"
|
||||
>
|
||||
<Criterion :telemetry="telemetry"
|
||||
@ -182,6 +182,7 @@
|
||||
import Criterion from './Criterion.vue';
|
||||
import ConditionDescription from "./ConditionDescription.vue";
|
||||
import { TRIGGER, TRIGGER_LABEL } from "@/plugins/condition/utils/constants";
|
||||
import uuid from 'uuid';
|
||||
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
@ -274,6 +275,7 @@ export default {
|
||||
},
|
||||
addCriteria() {
|
||||
const criteriaObject = {
|
||||
id: uuid(),
|
||||
telemetry: '',
|
||||
operation: '',
|
||||
input: '',
|
||||
@ -307,6 +309,7 @@ export default {
|
||||
},
|
||||
cloneCriterion(index) {
|
||||
const clonedCriterion = JSON.parse(JSON.stringify(this.condition.configuration.criteria[index]));
|
||||
clonedCriterion.id = uuid();
|
||||
this.condition.configuration.criteria.splice(index + 1, 0, clonedCriterion);
|
||||
this.persist();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user