Browse Source
Merge pull request #9677 from vvlladd28/bug/value-card/check-is-numeric
Fixed card widget display only numeric value
pull/9782/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/cards/value-card-widget.component.ts
|
|
|
@ -27,7 +27,7 @@ import { |
|
|
|
ViewChild |
|
|
|
} from '@angular/core'; |
|
|
|
import { WidgetContext } from '@home/models/widget-component.models'; |
|
|
|
import { formatValue, isDefinedAndNotNull, isNumeric } from '@core/utils'; |
|
|
|
import { formatValue, isDefinedAndNotNull } from '@core/utils'; |
|
|
|
import { |
|
|
|
backgroundStyle, |
|
|
|
ColorProcessor, |
|
|
|
@ -183,7 +183,7 @@ export class ValueCardWidgetComponent implements OnInit, AfterViewInit, OnDestro |
|
|
|
const tsValue = getSingleTsValue(this.ctx.data); |
|
|
|
let ts; |
|
|
|
let value; |
|
|
|
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(tsValue[1])) { |
|
|
|
if (tsValue && isDefinedAndNotNull(tsValue[1])) { |
|
|
|
ts = tsValue[0]; |
|
|
|
value = tsValue[1]; |
|
|
|
this.valueText = formatValue(value, this.decimals, this.units, false); |
|
|
|
|