mirror of
https://github.com/nasa/openmct.git
synced 2025-01-20 11:38:56 +00:00
Fixes clone condition bug
This commit is contained in:
parent
81caa27cba
commit
8f05c57d1a
@ -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) {
|
||||
|
@ -29,7 +29,6 @@ describe('ConditionManager', () => {
|
||||
let openmct = {};
|
||||
let mockCondition = {
|
||||
isDefault: true,
|
||||
type: 'condition',
|
||||
id: '1234-5678',
|
||||
configuration: {
|
||||
criteria: []
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ export default function ConditionPlugin() {
|
||||
domainObject.configuration = {
|
||||
conditionCollection: [{
|
||||
isDefault: true,
|
||||
type: 'condition',
|
||||
id: uuid(),
|
||||
configuration: {
|
||||
name: 'Default',
|
||||
|
Loading…
Reference in New Issue
Block a user