Fix broken rendering

This commit is contained in:
Joshi 2020-01-17 13:00:41 -08:00
parent 7feb933519
commit 82be503f4f
3 changed files with 25 additions and 23 deletions

View File

@ -140,11 +140,10 @@ export default {
}
},
data() {
let conditionCollection = this.domainObject.configuration.conditionCollection;
return {
condition: this.condition,
expanded: true,
conditionCollection,
conditionCollection: this.conditionCollection,
telemetryObject: this.telemetryObject,
telemetryMetadata: this.telemetryMetadata,
operations: OPERATIONS,
@ -155,6 +154,7 @@ export default {
};
},
mounted() {
this.conditionCollection = this.domainObject.configuration.conditionCollection;
this.openmct.objects.get(this.conditionIdentifier).then((obj => {
console.log('ConditionEdit obj', obj);
this.condition = obj;
@ -200,14 +200,20 @@ export default {
}
},
updateCurrentCondition() {
// TODO: replace based on telemetry
if (this.conditionCollection.length > 1) {
this.conditionCollection.forEach((condition, index) => {
index === 0 ? condition.isCurrent = true : condition.isCurrent = false
});
} else {
this.conditionCollection[0].isCurrent = true;
}
//mutate / persist the condition domainObject
//persist the condition DO so that we can do an openmct.objects.get on it and only persist the identifier in the conditionCollection of conditionSet
this.openmct.objects.mutate(this.condition, 'created', new Date());
//
// // TODO: replace based on telemetry
// if (this.conditionCollection.length > 1) {
// this.conditionCollection.forEach((condition, index) => {
// index === 0 ? condition.isCurrent = true : condition.isCurrent = false
// });
// } else {
// this.conditionCollection[0].isCurrent = true;
// }
// console.log(this.condition);
// console.log(this.conditionCollection);
},
getOutputBinary(ev) {
if (ev.target.value !== 'string') {

View File

@ -1,14 +1,10 @@
<template>
<div class="c-object-view u-contents">
<div class="c-cs-edit w-condition-set">
<div v-if="currentCondition"
class="c-sw-edit__ui holder"
>
<CurrentOutput :condition-collection="domainObject.conditionCollection" />
<div class="c-sw-edit__ui holder">
<CurrentOutput :condition="currentCondition" />
<TestData :is-editing="isEditing" />
<ConditionCollection :is-editing="isEditing"
:conditionn="currentCondition"
/>
<ConditionCollection :is-editing="isEditing"/>
</div>
</div>
</div>
@ -31,13 +27,13 @@ export default {
},
data() {
return {
conditionCollection: this.conditionCollection,
// conditionCollection: this.conditionCollection,
currentCondition: this.currentCondition
}
},
mounted() {
let conditionCollection = this.domainObject.configuration.conditionCollection;
this.currentConditionIdentifier = conditionCollection.length ? this.domainObject.configuration.conditionCollection[0] : null;
this.currentConditionIdentifier = conditionCollection.length ? conditionCollection[0] : null;
if (this.currentConditionIdentifier) {
this.openmct.objects.get(this.currentConditionIdentifier).then((obj) => {
this.currentCondition = obj;

View File

@ -1,6 +1,6 @@
<template>
<section id="current-output">
<div v-if="currentCondition"
<div v-if="condition"
class="c-cs__ui__header"
>
<span class="c-cs__ui__header-label">Current Output</span>
@ -10,11 +10,11 @@
@click="expanded = !expanded"
></span>
</div>
<div v-if="expanded && currentCondition"
<div v-if="expanded && condition"
class="c-cs__ui_content"
>
<div>
<span class="current-output">{{ currentCondition.output }}</span>
<span class="current-output">{{ condition.output }}</span>
</div>
</div>
</section>
@ -25,7 +25,7 @@ export default {
inject: ['openmct', 'domainObject'],
props: {
isEditing: Boolean,
currentCondition: {
condition: {
default: () => {return null;},
type: Object
}