Skip to content

Commit

Permalink
Enhancements for Derived Telemetry object
Browse files Browse the repository at this point in the history
- Closes #7823
- Code cleanup and tweaks.
  • Loading branch information
charlesh88 committed Sep 5, 2024
1 parent f8ceaa5 commit e1f50fe
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/plugins/comps/components/CompsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@

<div :class="['c-comps__refs-controls c-cdef__controls', { disabled: !parameters?.length }]">
<label v-if="isEditing" class="c-toggle-switch">
<input type="checkbox" :checked="testDataApplied" @change="toggleTestData"/>
<input type="checkbox" :checked="testDataApplied" @change="toggleTestData" />
<span class="c-toggle-switch__slider" aria-label="Apply Test Data"></span>
<span class="c-toggle-switch__label">Apply Test Values</span>
</label>
</div>
<div class="c-comps__refs">
<div
v-for="parameter in parameters"
:key="parameter.keyString"
class="c-comps__ref"
>
<div v-for="parameter in parameters" :key="parameter.keyString" class="c-comps__ref">
<span class="c-test-datum__string">Reference</span>
<input
v-if="isEditing"
Expand All @@ -69,7 +65,7 @@
<div v-else class="--em">{{ parameter.name }}</div>
<span class="c-test-datum__string">=</span>
<span class="c-comps__path-and-field">
<ObjectPath
<ObjectPathString
:domain-object="compsManager.getTelemetryObjectForParameter(parameter.keyString)"
:show-object-itself="true"
class="--em"
Expand Down Expand Up @@ -139,10 +135,10 @@
</template>

<script setup>
import {evaluate} from 'mathjs';
import {inject, onBeforeMount, onBeforeUnmount, ref} from 'vue';
import { evaluate } from 'mathjs';
import { inject, onBeforeMount, onBeforeUnmount, ref } from 'vue';

import ObjectPath from '../../../ui/components/ObjectPathString.vue';
import ObjectPathString from '../../../ui/components/ObjectPathString.vue';
import CompsManager from '../CompsManager';

const openmct = inject('openmct');
Expand Down Expand Up @@ -199,10 +195,6 @@ function updateParameters() {
applyTestData();

Check warning on line 195 in src/plugins/comps/components/CompsView.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/comps/components/CompsView.vue#L192-L195

Added lines #L192 - L195 were not covered by tests
}

// function getIconForType(telemetryObject) {
// return openmct.types.get(telemetryObject.type).definition.cssClass;
// }

function toggleTestData() {
testDataApplied.value = !testDataApplied.value;

Check warning on line 199 in src/plugins/comps/components/CompsView.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/comps/components/CompsView.vue#L199

Added line #L199 was not covered by tests
if (testDataApplied.value) {
Expand Down

0 comments on commit e1f50fe

Please sign in to comment.