Fixes clone condition bug

This commit is contained in:
Joshi 2020-03-13 09:09:50 -07:00
parent 81caa27cba
commit 8f05c57d1a
4 changed files with 8 additions and 8 deletions

View File

@ -79,12 +79,14 @@ export default class ConditionManager extends EventEmitter {
if (conditionConfiguration) {
conditionObj = {
...conditionConfiguration,
name: `Copy of ${conditionConfiguration.name}`,
id: uuid()
id: uuid(),
configuration: {
...conditionConfiguration.configuration,
name: `Copy of ${conditionConfiguration.configuration.name}`
}
};
} else {
conditionObj = {
type: 'condition',
id: uuid(),
configuration: {
name: 'Unnamed Condition',
@ -109,7 +111,7 @@ export default class ConditionManager extends EventEmitter {
}
cloneCondition(conditionConfiguration, index) {
this.createAndSaveCondition(false, index, conditionConfiguration);
this.createAndSaveCondition(index, conditionConfiguration);
}
createAndSaveCondition(index, conditionConfiguration) {

View File

@ -29,7 +29,6 @@ describe('ConditionManager', () => {
let openmct = {};
let mockCondition = {
isDefault: true,
type: 'condition',
id: '1234-5678',
configuration: {
criteria: []

View File

@ -285,8 +285,8 @@ export default {
index: this.conditionIndex
});
},
initCap: function (sentence) {
return sentence.charAt(0).toUpperCase() + sentence.slice(1)
initCap: function (value) {
return value.charAt(0).toUpperCase() + value.slice(1)
}
}
}

View File

@ -39,7 +39,6 @@ export default function ConditionPlugin() {
domainObject.configuration = {
conditionCollection: [{
isDefault: true,
type: 'condition',
id: uuid(),
configuration: {
name: 'Default',