Skip to content

Commit

Permalink
fix: other values now show source (#4744)
Browse files Browse the repository at this point in the history
Co-authored-by: Cole Blanchard <[email protected]>
  • Loading branch information
blanchco and Cole Blanchard authored Sep 11, 2024
1 parent 04487e3 commit 863d221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
<template v-if="col.field === 'name'">
{{ data.name }}
</template>
<template v-if="col.field === 'target'">
{{ data.target }}
<template v-if="col.field === 'source'">
{{ data.source }}
</template>
<template v-if="col.field === 'expression'">
<section class="inline-flex gap-1">
<span class="value-label">Constants</span>
<span class="value">{{ numberToNist(data.expression) }}</span>
<span class="value">{{ numberToNist(data.expression) || data.expression }}</span>
</section>
</template>
</template>
Expand Down Expand Up @@ -114,7 +114,7 @@ const props = defineProps<{
const otherValueList = ref(props.otherValueList);
const columns = ref([
{ field: 'name', header: 'Configuration name' },
{ field: 'target', header: 'Source' },
{ field: 'source', header: 'Source' },
{ field: 'expression', header: 'Value' }
]);
Expand All @@ -131,21 +131,21 @@ const customSelection = ref(false);
const selection = ref<null | { id?: string; source?: string; constant?: number }>(null);
const onCustomSelectionChange = (val) => {
if (!val?.name) {
if (customSelection.value && !val?.name) {
selection.value =
numberType.value === numberOptions[0]
? { constant: customConstant.value, source: customSource.value }
: { constant: 0, source: '' };
} else {
selection.value = { constant: val.expression, source: customSource.value };
selection.value = { constant: val.expression, source: val.source };
}
};
function getColumnWidth(columnField: string) {
switch (columnField) {
case 'name':
return 40;
case 'target':
case 'source':
return 20;
case 'expression':
return 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{{ data.name }}
</template>
<template v-if="col.field === 'source'">
{{ data.referenceId }}
{{ data.source }}
</template>
<tera-line-graphic
v-if="col.field === 'range'"
Expand Down

0 comments on commit 863d221

Please sign in to comment.