From 4a3bdbe9e067abf170bc42abadf89621a9e2aa7a Mon Sep 17 00:00:00 2001 From: Isabella Siu Date: Mon, 22 Jul 2024 11:31:17 -0400 Subject: [PATCH] Remove ANY option for interpolated property quality (#342) --- pkg/sitewise/api/property_interpolated.go | 2 +- src/components/query/QualityAndOrderRow.tsx | 8 ++++++-- src/components/query/QueryEditor.test.tsx | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkg/sitewise/api/property_interpolated.go b/pkg/sitewise/api/property_interpolated.go index 84d8514e..d9d1caec 100644 --- a/pkg/sitewise/api/property_interpolated.go +++ b/pkg/sitewise/api/property_interpolated.go @@ -37,7 +37,7 @@ func interpolatedQueryToInputs(query models.AssetPropertyValueQuery) []*iotsitew endTimeInSeconds := to.Unix() quality := query.Quality - if quality == "" { + if quality == "" || query.Quality == "ANY" { quality = "GOOD" } diff --git a/src/components/query/QualityAndOrderRow.tsx b/src/components/query/QualityAndOrderRow.tsx index 4e3ee2f7..5f33726c 100644 --- a/src/components/query/QualityAndOrderRow.tsx +++ b/src/components/query/QualityAndOrderRow.tsx @@ -43,6 +43,8 @@ const qualities: Array> = [ { value: SiteWiseQuality.UNCERTAIN, label: 'UNCERTAIN' }, ]; +const interpolatedPropertyQualities: Array> = qualities.slice(1); + const ordering: Array> = [ { value: SiteWiseTimeOrder.ASCENDING, label: 'ASCENDING' }, { value: SiteWiseTimeOrder.DESCENDING, label: 'DESCENDING' }, @@ -104,14 +106,16 @@ export class QualityAndOrderRow extends PureComponent { render() { const { query } = this.props; + const currQualities = + query.queryType === QueryType.PropertyInterpolated ? interpolatedPropertyQualities : qualities; return ( <>