From 4b39ea232a215f20c8a99eb2b065d66daff6e159 Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Mon, 30 Sep 2024 18:53:08 -0500 Subject: [PATCH 1/3] Addressing feedback --- src/plugins/condition/ConditionManager.js | 2 +- .../condition/components/ConditionItem.vue | 16 +++++----------- src/plugins/condition/components/TestData.vue | 6 +----- .../condition/historicalTelemetryProvider.js | 8 -------- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/plugins/condition/ConditionManager.js b/src/plugins/condition/ConditionManager.js index 44818ed349..41bba5c4e9 100644 --- a/src/plugins/condition/ConditionManager.js +++ b/src/plugins/condition/ConditionManager.js @@ -24,7 +24,7 @@ import { EventEmitter } from 'eventemitter3'; import { v4 as uuid } from 'uuid'; import Condition from './Condition.js'; -import HistoricalTelemetryProvider from './historicalTelemetryProvider.js'; +import HistoricalTelemetryProvider from './HistoricalTelemetryProvider.js'; import { getLatestTimestamp } from './utils/time.js'; export default class ConditionManager extends EventEmitter { diff --git a/src/plugins/condition/components/ConditionItem.vue b/src/plugins/condition/components/ConditionItem.vue index 250c517154..f33495bd08 100644 --- a/src/plugins/condition/components/ConditionItem.vue +++ b/src/plugins/condition/components/ConditionItem.vue @@ -352,18 +352,12 @@ export default { methods: { setOutputSelection() { let conditionOutput = this.condition.configuration.output; - if (conditionOutput) { - if ( - conditionOutput !== 'false' && - conditionOutput !== 'true' && - conditionOutput !== 'telemetry value' - ) { - this.selectedOutputSelection = 'string'; - } else { - this.selectedOutputSelection = conditionOutput; - } - } else if (conditionOutput === undefined) { + if (conditionOutput === undefined) { this.selectedOutputSelection = 'none'; + } else if (['false', 'true', 'telemetry value'].includes(conditionOutput)) { + this.selectedOutputSelection = conditionOutput; + } else { + this.selectedOutputSelection = 'string'; } }, setOutputValue() { diff --git a/src/plugins/condition/components/TestData.vue b/src/plugins/condition/components/TestData.vue index 1e6f695cf0..d087d948e7 100644 --- a/src/plugins/condition/components/TestData.vue +++ b/src/plugins/condition/components/TestData.vue @@ -63,7 +63,7 @@ :key="index" :value="telemetryOption.identifier" > - {{ telemetryPaths[index] || telemetryOption.name }} + {{ telemetryOption.path || telemetryOption.name }} @@ -201,10 +201,6 @@ export default { this.telemetryMetadataOptions[id] = []; } }); - this.telemetry.forEach(async (telemetryOption, index) => { - const telemetryPath = await this.getFullTelemetryPath(telemetryOption); - this.telemetryPaths[index] = telemetryPath; - }); }, addTestInput(testInput) { this.testInputs.push( diff --git a/src/plugins/condition/historicalTelemetryProvider.js b/src/plugins/condition/historicalTelemetryProvider.js index a2a1abb058..78cb79fce0 100644 --- a/src/plugins/condition/historicalTelemetryProvider.js +++ b/src/plugins/condition/historicalTelemetryProvider.js @@ -15,14 +15,6 @@ export default class HistoricalTelemetryProvider { this.bounds = bounds; } - refreshAllHistoricalTelemetries() { - const refreshPromises = []; - for (const [, value] of Object.entries(this.telemetryObjects)) { - refreshPromises.push(this.refreshHistoricalTelemetry(value)); - } - return Promise.all(refreshPromises); - } - async refreshHistoricalTelemetry(domainObject, identifier) { console.log('refreshHistoricalTelemetry'); if (!domainObject && identifier) { From b97555445e8ceedeaa94e3064200f2133aea8a20 Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Mon, 30 Sep 2024 19:10:24 -0500 Subject: [PATCH 2/3] Creating a const for telemetry value --- src/plugins/condition/ConditionManager.js | 3 ++- src/plugins/condition/components/ConditionItem.vue | 9 +++++---- src/plugins/condition/utils/constants.js | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plugins/condition/ConditionManager.js b/src/plugins/condition/ConditionManager.js index 41bba5c4e9..97969be777 100644 --- a/src/plugins/condition/ConditionManager.js +++ b/src/plugins/condition/ConditionManager.js @@ -25,6 +25,7 @@ import { v4 as uuid } from 'uuid'; import Condition from './Condition.js'; import HistoricalTelemetryProvider from './HistoricalTelemetryProvider.js'; +import { TELEMETRY_VALUE } from './utils/constants.js'; import { getLatestTimestamp } from './utils/time.js'; export default class ConditionManager extends EventEmitter { @@ -392,7 +393,7 @@ export default class ConditionManager extends EventEmitter { const currentCondition = this.getCurrentConditionLAD(conditionResults); let output = currentCondition?.configuration?.output; - if (output === 'telemetry value') { + if (output === TELEMETRY_VALUE) { const { outputTelemetry, outputMetadata } = currentCondition.configuration; const outputTelemetryObject = await this.openmct.objects.get(outputTelemetry); const telemetryOptions = { diff --git a/src/plugins/condition/components/ConditionItem.vue b/src/plugins/condition/components/ConditionItem.vue index f33495bd08..a7481a10fc 100644 --- a/src/plugins/condition/components/ConditionItem.vue +++ b/src/plugins/condition/components/ConditionItem.vue @@ -113,7 +113,7 @@ @change="persist" /> - +