From 82be503f4fd1cbab788151b5c8a8d92380a77c27 Mon Sep 17 00:00:00 2001 From: Joshi Date: Fri, 17 Jan 2020 13:00:41 -0800 Subject: [PATCH] Fix broken rendering --- .../condition/components/ConditionEdit.vue | 26 ++++++++++++------- .../condition/components/ConditionSet.vue | 14 ++++------ .../condition/components/CurrentOutput.vue | 8 +++--- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/plugins/condition/components/ConditionEdit.vue b/src/plugins/condition/components/ConditionEdit.vue index b1e0928a71..85a796d63e 100644 --- a/src/plugins/condition/components/ConditionEdit.vue +++ b/src/plugins/condition/components/ConditionEdit.vue @@ -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') { diff --git a/src/plugins/condition/components/ConditionSet.vue b/src/plugins/condition/components/ConditionSet.vue index 756aad6058..9f6758f52b 100644 --- a/src/plugins/condition/components/ConditionSet.vue +++ b/src/plugins/condition/components/ConditionSet.vue @@ -1,14 +1,10 @@