From f96dfcc9429418045fbf686c1eb6527e2a2186af Mon Sep 17 00:00:00 2001 From: Joshi Date: Thu, 2 Apr 2020 10:45:37 -0700 Subject: [PATCH] Reassign ids for criteria when we clone conditions --- src/plugins/condition/ConditionManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/condition/ConditionManager.js b/src/plugins/condition/ConditionManager.js index d98ddcd3c6..2adf6f439b 100644 --- a/src/plugins/condition/ConditionManager.js +++ b/src/plugins/condition/ConditionManager.js @@ -141,7 +141,9 @@ export default class ConditionManager extends EventEmitter { } cloneCondition(conditionConfiguration, index) { - this.createAndSaveCondition(index, JSON.parse(JSON.stringify(conditionConfiguration))); + let clonedConfig = JSON.parse(JSON.stringify(conditionConfiguration)); + clonedConfig.configuration.criteria.forEach((criterion) => criterion.id = uuid()); + this.createAndSaveCondition(index, clonedConfig); } createAndSaveCondition(index, conditionConfiguration) {