mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 22:17:49 +00:00
add default condition only when none present
This commit is contained in:
parent
ea6f8c9a50
commit
c8abc45e25
@ -23,7 +23,10 @@
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
props: {
|
||||
condition: Object
|
||||
condition: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -39,7 +39,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<Condition :condition="condition" />
|
||||
<Condition :condition="condition"
|
||||
@persist="persist"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -74,9 +76,7 @@ export default {
|
||||
mounted() {
|
||||
this.instantiate = this.openmct.$injector.get('instantiate');
|
||||
this.conditionCollection = this.domainObject.configuration.conditionCollection || this.conditionCollection;
|
||||
this.addDefaultCondition();
|
||||
console.log(this.conditionCollection);
|
||||
|
||||
if (!this.conditionCollection.length) {this.addDefaultCondition()}
|
||||
},
|
||||
methods: {
|
||||
added(conditionDO) {
|
||||
@ -105,10 +105,6 @@ export default {
|
||||
|
||||
this.conditionCollection.unshift(conditionDO);
|
||||
|
||||
this.$set(this.conditionCollection, 0, conditionDO);
|
||||
|
||||
console.log(this.conditionCollection);
|
||||
|
||||
this.persist();
|
||||
},
|
||||
addDefaultCondition() {
|
||||
@ -116,7 +112,7 @@ export default {
|
||||
|
||||
let conditionObjId = uuid();
|
||||
this.conditionCollection.push({
|
||||
description: 'when all fails',
|
||||
description: 'When all else fails',
|
||||
isDefault: true,
|
||||
composition: [],
|
||||
name: "Default",
|
||||
|
@ -65,10 +65,12 @@
|
||||
export default {
|
||||
inject: ['openmct', 'domainObject'],
|
||||
props: {
|
||||
condition: Object
|
||||
condition: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
return {
|
||||
expanded: true,
|
||||
name: this.condition.name,
|
||||
@ -76,9 +78,6 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log(`this.condition.name: ${this.condition.name}`);
|
||||
// console.log(`currentObjectPath: ${this.currentObjectPath.name}`);
|
||||
// console.log(this.domainObject);
|
||||
},
|
||||
methods: {
|
||||
removeCondition(ev) {
|
||||
|
Loading…
Reference in New Issue
Block a user