|
|
@ -30,7 +30,7 @@ import { |
|
|
getTimewindowConfig, |
|
|
getTimewindowConfig, |
|
|
setTimewindowConfig |
|
|
setTimewindowConfig |
|
|
} from '@home/components/widget/config/timewindow-config-panel.component'; |
|
|
} 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 { Component } from '@angular/core'; |
|
|
import { |
|
|
import { |
|
|
convertLevelColorsSettingsToColorProcessor, |
|
|
convertLevelColorsSettingsToColorProcessor, |
|
|
@ -189,11 +189,10 @@ export class DigitalSimpleGaugeBasicConfigComponent extends BasicWidgetConfigCom |
|
|
|
|
|
|
|
|
private maxValueValidation(): ValidatorFn { |
|
|
private maxValueValidation(): ValidatorFn { |
|
|
return (control: AbstractControl): ValidationErrors | null => { |
|
|
return (control: AbstractControl): ValidationErrors | null => { |
|
|
const value: string = control.value; |
|
|
const value: number = control.value; |
|
|
if (value) { |
|
|
const minValue = control.parent?.get('minValue').value; |
|
|
if (value < control.parent?.get('minValue').value) { |
|
|
if (isNumeric(value) && isDefinedAndNotNull(minValue) && value < minValue) { |
|
|
return {maxValue: true}; |
|
|
return {maxValue: true}; |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
|
}; |
|
|
}; |
|
|
|