diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts index 4790789080..a80eb3439f 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts @@ -132,7 +132,7 @@ export class CalculatedFieldComponent extends EntityComponent { return this.cfFormService.testScript( this.entity?.id?.id, - this.entityValue, + this.entityFormValue(), this.entitiesTableConfig.getTestScriptDialog.bind(this.entitiesTableConfig), this.destroyRef, expression diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/button/power-button-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/button/power-button-basic-config.component.html index 51ebab7a92..75e3bad0f5 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/button/power-button-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/button/power-button-basic-config.component.html @@ -88,7 +88,6 @@ subscriptSizing="dynamic" predefinedValuesButton="true" [predefinedValues]="predefinedValues" - [disabled]="!powerButtonWidgetConfigForm.get('showTitle').value" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" > diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/button/toggle-button-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/button/toggle-button-basic-config.component.html index d506fe4e8b..7bd2974678 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/button/toggle-button-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/button/toggle-button-basic-config.component.html @@ -98,7 +98,6 @@ subscriptSizing="dynamic" predefinedValuesButton="true" [predefinedValues]="predefinedValues" - [disabled]="!toggleButtonWidgetConfigForm.get('showTitle').value" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" > diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/aggregated-value-card-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/aggregated-value-card-basic-config.component.html index f0897ae55c..a7192a3c1b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/aggregated-value-card-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/aggregated-value-card-basic-config.component.html @@ -45,7 +45,6 @@ subscriptSizing="dynamic" predefinedValuesButton="true" [predefinedValues]="predefinedValues" - [disabled]="!aggregatedValueCardWidgetConfigForm.get('showTitle').value" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" > @@ -91,7 +90,6 @@ subscriptSizing="dynamic" [predefinedValuesButton]="true" [predefinedValues]="predefinedValues" - [disabled]="!aggregatedValueCardWidgetConfigForm.get('showSubtitle').value" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="subtitle" > diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/label-value-card-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/label-value-card-basic-config.component.html index 90cb150339..b2d186724b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/label-value-card-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/label-value-card-basic-config.component.html @@ -46,7 +46,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!labelValueCardWidgetConfigForm.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/progress-bar-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/progress-bar-basic-config.component.html index 120ccf6457..a6212379c6 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/progress-bar-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/progress-bar-basic-config.component.html @@ -58,7 +58,6 @@ subscriptSizing="dynamic" predefinedValuesButton="true" [predefinedValues]="predefinedValues" - [disabled]="!progressBarWidgetConfigForm.get('showTitle').value" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" > diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/timeseries-table-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/timeseries-table-basic-config.component.html index 43777d596e..fe63bb8591 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/timeseries-table-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/timeseries-table-basic-config.component.html @@ -49,7 +49,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!timeseriesTableWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-card-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-card-basic-config.component.html index 9a4a6196c8..1ab422f7ec 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-card-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-card-basic-config.component.html @@ -58,7 +58,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!valueCardWidgetConfigForm.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-chart-card-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-chart-card-basic-config.component.html index c7943ec0a7..406ae88d2e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-chart-card-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/cards/value-chart-card-basic-config.component.html @@ -56,7 +56,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!valueChartCardWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.html index 1aa4c2be3d..98c0884da4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.html @@ -54,7 +54,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!barChartWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/flot-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/flot-basic-config.component.html index 029a1a8cb3..12c538dae4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/flot-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/flot-basic-config.component.html @@ -49,7 +49,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!flotWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/latest-chart-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/latest-chart-basic-config.component.html index b0f108ba58..a1b3b97ee7 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/latest-chart-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/latest-chart-basic-config.component.html @@ -55,7 +55,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!latestChartWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.html index 7d3195e7f4..45acefab12 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.html @@ -38,7 +38,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!rangeChartWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html index 85ef776718..ac0017929b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html @@ -131,7 +131,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!timeSeriesChartWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/entity/entities-table-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/entity/entities-table-basic-config.component.html index 27ad183dfa..34579f1b3a 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/entity/entities-table-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/entity/entities-table-basic-config.component.html @@ -49,7 +49,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!entitiesTableWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/gauge/digital-simple-gauge-basic-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/basic/gauge/digital-simple-gauge-basic-config.component.ts index e0ca65cdea..6d837f476c 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/gauge/digital-simple-gauge-basic-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/gauge/digital-simple-gauge-basic-config.component.ts @@ -30,7 +30,7 @@ import { getTimewindowConfig, setTimewindowConfig } from '@home/components/widget/config/timewindow-config-panel.component'; -import { formatValue, isDefined, isUndefined } from '@core/utils'; +import { formatValue, isDefined, isDefinedAndNotNull, isNumeric, isUndefined } from '@core/utils'; import { Component } from '@angular/core'; import { convertLevelColorsSettingsToColorProcessor, @@ -189,11 +189,10 @@ export class DigitalSimpleGaugeBasicConfigComponent extends BasicWidgetConfigCom private maxValueValidation(): ValidatorFn { return (control: AbstractControl): ValidationErrors | null => { - const value: string = control.value; - if (value) { - if (value < control.parent?.get('minValue').value) { - return {maxValue: true}; - } + const value: number = control.value; + const minValue = control.parent?.get('minValue').value; + if (isNumeric(value) && isDefinedAndNotNull(minValue) && value < minValue) { + return {maxValue: true}; } return null; }; diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/battery-level-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/battery-level-basic-config.component.html index e36e315b3e..894b13788b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/battery-level-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/battery-level-basic-config.component.html @@ -58,7 +58,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!batteryLevelWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.html index 473bdb0b4b..396441ce2f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/liquid-level-card-basic-config.component.html @@ -40,7 +40,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!levelCardWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/signal-strength-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/signal-strength-basic-config.component.html index ed034aaf89..c3ac497ae5 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/signal-strength-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/indicator/signal-strength-basic-config.component.html @@ -52,7 +52,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!signalStrengthWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/map/map-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/map/map-basic-config.component.html index 3d1f05fb4b..fb1246a9cc 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/map/map-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/map/map-basic-config.component.html @@ -40,7 +40,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!mapWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/rpc/slider-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/rpc/slider-basic-config.component.html index b6566c181e..918af02557 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/rpc/slider-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/rpc/slider-basic-config.component.html @@ -81,7 +81,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!sliderWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/scada/scada-symbol-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/scada/scada-symbol-basic-config.component.html index 03cdee6b95..224e45354e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/scada/scada-symbol-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/scada/scada-symbol-basic-config.component.html @@ -40,7 +40,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!scadaSymbolWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/weather/wind-speed-direction-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/weather/wind-speed-direction-basic-config.component.html index 3727cd0952..fc673b8baa 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/weather/wind-speed-direction-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/weather/wind-speed-direction-basic-config.component.html @@ -100,7 +100,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!windSpeedDirectionWidgetConfigForm.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/cards/label-value-card-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/cards/label-value-card-widget.component.html index 289b54bb56..930fef4d42 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/cards/label-value-card-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/cards/label-value-card-widget.component.html @@ -28,7 +28,7 @@
-
{{ valueText }}
+
{{ valueText | customTranslate }}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts index d1928d75f0..d872ecaebb 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts @@ -1023,15 +1023,29 @@ export class TbTimeSeriesChart { } } + private maxTickLabelHalfHeight(): number { + const axes = this.yAxisList.filter(a => a.settings.show && a.settings.showTickLabels); + if (!axes.length) { + return 0; + } + + const defaultSize = defaultTimeSeriesChartYAxisSettings.tickLabelFont.size; + const maxFontSize = Math.max(...axes.map(a => a.settings.tickLabelFont?.size || defaultSize)); + return Math.ceil(maxFontSize / 2); + } + private minTopOffset(): number { - const showTickLabels = - !!this.yAxisList.find(yAxis => yAxis.settings.show && yAxis.settings.showTickLabels); - return (this.topPointLabels) ? 25 : - (showTickLabels ? 10 : 5); + if (this.topPointLabels) { + return 25; + } + const half = this.maxTickLabelHalfHeight(); + return half ? Math.max(10, half) : 5; } private minBottomOffset(): number { - return this.settings.dataZoom ? 45 : 5; + const half = this.maxTickLabelHalfHeight(); + const minOffset = half ? Math.max(5, half) : 5; + return this.settings.dataZoom ? Math.max(45, minOffset) : minOffset; } private _onParentScroll() { @@ -1060,6 +1074,7 @@ export class TbTimeSeriesChart { this.updateBarsAnimation(barItems, false); } this.timeSeriesChart.resize(); + this.updateAxes(); if (this.animationEnabled()) { this.updateBarsAnimation(barItems, true); } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.html index d2bda36ab2..ba54d83173 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.html @@ -33,7 +33,6 @@ brackets="curly" subscriptSizing="dynamic" [predefinedValuesButton]="true" - [disabled]="!aggregatedValueCardWidgetSettingsForm.get('showSubtitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="subtitle" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.html index b4520590b6..cd11b4f10f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.html @@ -33,7 +33,6 @@ brackets="curly" subscriptSizing="dynamic" [predefinedValuesButton]="true" - [disabled]="!labelValueCardWidgetSettingsForm.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/button/widget-button-appearance.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/button/widget-button-appearance.component.html index 26835e857a..d54cd71c00 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/button/widget-button-appearance.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/button/widget-button-appearance.component.html @@ -42,7 +42,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!appearanceFormGroup.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/count-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/count-widget-settings.component.html index 08a0246217..ee79216190 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/count-widget-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/count-widget-settings.component.html @@ -48,7 +48,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!countWidgetConfigForm.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/indicator/status-widget-state-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/indicator/status-widget-state-settings.component.html index 485f6d0af4..11b99f411a 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/indicator/status-widget-state-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/indicator/status-widget-state-settings.component.html @@ -26,7 +26,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!stateSettingsFormGroup.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.html index 330433141e..cf3a77c38d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.html @@ -91,7 +91,6 @@ brackets="curly" subscriptSizing="dynamic" predefinedValuesButton="true" - [disabled]="!singleSwitchWidgetSettingsForm.get('showLabel').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="label" diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/gauge/digital-gauge-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/gauge/digital-gauge-widget-settings.component.ts index ff22abd28a..fe7eeb7305 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/gauge/digital-gauge-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/gauge/digital-gauge-widget-settings.component.ts @@ -37,7 +37,7 @@ import { digitalGaugeLayoutTranslations, DigitalGaugeType } from '@home/components/widget/lib/digital-gauge.models'; -import { formatValue, isDefined } from '@core/utils'; +import { formatValue, isDefined, isDefinedAndNotNull, isNumeric } from '@core/utils'; import { ColorSettings, ColorType, @@ -218,11 +218,10 @@ export class DigitalGaugeWidgetSettingsComponent extends WidgetSettingsComponent private maxValueValidation(): ValidatorFn { return (control: AbstractControl): ValidationErrors | null => { - const value: string = control.value; - if (value) { - if (value < control.parent?.get('minValue').value) { - return {maxValue: true}; - } + const value: number = control.value; + const minValue = control.parent?.get('minValue').value; + if (isNumeric(value) && isDefinedAndNotNull(minValue) && value < minValue) { + return {maxValue: true}; } return null; }; diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html index 641755b810..1bf65c61a0 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html @@ -51,7 +51,6 @@ brackets="curly" subscriptSizing="dynamic" [predefinedValuesButton]="true" - [disabled]="!widgetSettings.get('showTitle').value" [predefinedValues]="predefinedValues" placeholderText="{{ 'widget-config.set' | translate }}" formControlName="title"