mirror of
https://github.com/nasa/openmct.git
synced 2025-02-08 12:00:38 +00:00
Fix errors after converting conditionCollection to persist identifiers only
This commit is contained in:
parent
e806e5a293
commit
7feb933519
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="conditionArea"
|
<div id="conditionArea"
|
||||||
|
v-if="condition"
|
||||||
class="c-cs-ui__conditions"
|
class="c-cs-ui__conditions"
|
||||||
:class="['widget-condition', { 'widget-condition--current': condition.isCurrent }]"
|
:class="['widget-condition', { 'widget-condition--current': condition.isCurrent }]"
|
||||||
>
|
>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="c-cs-editui__conditions"
|
<div class="c-cs-editui__conditions"
|
||||||
|
v-if="condition"
|
||||||
:class="['widget-condition', { 'widget-condition--current': condition.isCurrent }]"
|
:class="['widget-condition', { 'widget-condition--current': condition.isCurrent }]"
|
||||||
>
|
>
|
||||||
<div class="title-bar">
|
<div class="title-bar">
|
||||||
@ -143,8 +144,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
condition: this.condition,
|
condition: this.condition,
|
||||||
expanded: true,
|
expanded: true,
|
||||||
name: this.condition.name,
|
|
||||||
description: this.condition.description,
|
|
||||||
conditionCollection,
|
conditionCollection,
|
||||||
telemetryObject: this.telemetryObject,
|
telemetryObject: this.telemetryObject,
|
||||||
telemetryMetadata: this.telemetryMetadata,
|
telemetryMetadata: this.telemetryMetadata,
|
||||||
@ -156,7 +155,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.condition = {};
|
|
||||||
this.openmct.objects.get(this.conditionIdentifier).then((obj => {
|
this.openmct.objects.get(this.conditionIdentifier).then((obj => {
|
||||||
console.log('ConditionEdit obj', obj);
|
console.log('ConditionEdit obj', obj);
|
||||||
this.condition = obj;
|
this.condition = obj;
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="c-object-view u-contents">
|
<div class="c-object-view u-contents">
|
||||||
<div class="c-cs-edit w-condition-set">
|
<div class="c-cs-edit w-condition-set">
|
||||||
<div class="c-sw-edit__ui holder">
|
<div v-if="currentCondition"
|
||||||
|
class="c-sw-edit__ui holder"
|
||||||
|
>
|
||||||
<CurrentOutput :condition-collection="domainObject.conditionCollection" />
|
<CurrentOutput :condition-collection="domainObject.conditionCollection" />
|
||||||
<TestData :is-editing="isEditing" />
|
<TestData :is-editing="isEditing" />
|
||||||
<ConditionCollection :is-editing="isEditing"
|
<ConditionCollection :is-editing="isEditing"
|
||||||
:condition-collection="domainObject.conditionCollection"
|
:conditionn="currentCondition"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -28,10 +30,18 @@ export default {
|
|||||||
isEditing: Boolean
|
isEditing: Boolean
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let conditionCollection = this.domainObject.configuration.conditionCollection;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
conditionCollection
|
conditionCollection: this.conditionCollection,
|
||||||
|
currentCondition: this.currentCondition
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
let conditionCollection = this.domainObject.configuration.conditionCollection;
|
||||||
|
this.currentConditionIdentifier = conditionCollection.length ? this.domainObject.configuration.conditionCollection[0] : null;
|
||||||
|
if (this.currentConditionIdentifier) {
|
||||||
|
this.openmct.objects.get(this.currentConditionIdentifier).then((obj) => {
|
||||||
|
this.currentCondition = obj;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<section id="current-output">
|
<section id="current-output">
|
||||||
<div class="c-cs__ui__header">
|
<div v-if="currentCondition"
|
||||||
|
class="c-cs__ui__header"
|
||||||
|
>
|
||||||
<span class="c-cs__ui__header-label">Current Output</span>
|
<span class="c-cs__ui__header-label">Current Output</span>
|
||||||
<span
|
<span
|
||||||
class="is-enabled flex-elem"
|
class="is-enabled flex-elem"
|
||||||
@ -8,11 +10,11 @@
|
|||||||
@click="expanded = !expanded"
|
@click="expanded = !expanded"
|
||||||
></span>
|
></span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="expanded"
|
<div v-if="expanded && currentCondition"
|
||||||
class="c-cs__ui_content"
|
class="c-cs__ui_content"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<span class="current-output">{{ conditionCollection[currentConditionIndex].output }}</span>
|
<span class="current-output">{{ currentCondition.output }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -22,31 +24,22 @@
|
|||||||
export default {
|
export default {
|
||||||
inject: ['openmct', 'domainObject'],
|
inject: ['openmct', 'domainObject'],
|
||||||
props: {
|
props: {
|
||||||
isEditing: Boolean
|
isEditing: Boolean,
|
||||||
|
currentCondition: {
|
||||||
|
default: () => {return null;},
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let conditionCollection = this.domainObject.configuration.conditionCollection;
|
|
||||||
let currentConditionIndex = 0;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
expanded: true,
|
expanded: true
|
||||||
conditionCollection,
|
|
||||||
currentConditionIndex
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.currentConditionIndex = this.getCurrentConditionIndex();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCurrentConditionIndex() {
|
|
||||||
let currentConditionIndex;
|
|
||||||
this.conditionCollection.forEach((condition, index) => {
|
|
||||||
if (condition.isCurrent) {
|
|
||||||
currentConditionIndex = index;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return currentConditionIndex;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user