UI: Fixed card widget display only numeric value

This commit is contained in:
Vladyslav_Prykhodko 2023-11-21 15:12:05 +02:00
parent 1d1e8decd4
commit 06d2a2abc1

View File

@ -27,7 +27,7 @@ import {
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
import { WidgetContext } from '@home/models/widget-component.models'; import { WidgetContext } from '@home/models/widget-component.models';
import { formatValue, isDefinedAndNotNull, isNumeric } from '@core/utils'; import { formatValue, isDefinedAndNotNull } from '@core/utils';
import { import {
backgroundStyle, backgroundStyle,
ColorProcessor, ColorProcessor,
@ -179,7 +179,7 @@ export class ValueCardWidgetComponent implements OnInit, AfterViewInit, OnDestro
const tsValue = getSingleTsValue(this.ctx.data); const tsValue = getSingleTsValue(this.ctx.data);
let ts; let ts;
let value; let value;
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(tsValue[1])) { if (tsValue && isDefinedAndNotNull(tsValue[1])) {
ts = tsValue[0]; ts = tsValue[0];
value = tsValue[1]; value = tsValue[1];
this.valueText = formatValue(value, this.decimals, this.units, false); this.valueText = formatValue(value, this.decimals, this.units, false);