Skip to content

Commit

Permalink
[Gauge plugin] Addresses identified issues (nasa#6593)
Browse files Browse the repository at this point in the history
fix: valid indicators not updating properly for Gauge plugin limits

refactor: enforce limitLow to be less than or equal to limitHigh
  • Loading branch information
TheFuturist32 committed Apr 12, 2024
1 parent b18aa48 commit 82ac311
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
17 changes: 3 additions & 14 deletions src/plugins/gauge/GaugePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function () {
required: false,
hideFromInspector: true,
property: ['configuration', 'gaugeController'],
validate: ({ value }, callback) => {
validate: (value, callback) => {
if (value.isUseTelemetryLimits) {
return true;
}
Expand All @@ -139,22 +139,11 @@ export default function () {
}

if (limitLow !== '') {
valid.limitLow = min <= limitLow && limitLow < max;
valid.limitLow = min <= limitLow && limitLow <= limitHigh;
}

if (limitHigh !== '') {
valid.limitHigh = min < limitHigh && limitHigh <= max;
}

if (
valid.limitLow &&
valid.limitHigh &&
limitLow !== '' &&
limitHigh !== '' &&
limitLow > limitHigh
) {
valid.limitLow = false;
valid.limitHigh = false;
valid.limitHigh = max >= limitHigh && limitHigh >= limitLow;
}

if (callback) {
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/gauge/components/GaugeFormController.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ export default {
methods: {
onChange(event) {
let data = {
model: {}
model: {},
isUseTelemetryLimits: this.isUseTelemetryLimits,
min: this.min,
max: this.max,
limitLow: this.limitLow,
limitHigh: this.limitHigh
};
if (event) {
Expand Down

0 comments on commit 82ac311

Please sign in to comment.