diff --git a/ui-ngx/src/app/shared/components/unit-settings-panel.component.ts b/ui-ngx/src/app/shared/components/unit-settings-panel.component.ts index f378ec59f0..9d32abd46e 100644 --- a/ui-ngx/src/app/shared/components/unit-settings-panel.component.ts +++ b/ui-ngx/src/app/shared/components/unit-settings-panel.component.ts @@ -139,7 +139,13 @@ export class UnitSettingsPanelComponent implements OnInit { } clearUnit() { - this.unitSettingsApplied.emit(null); + this.unitSettingForm.reset({ + convertUnit: false + }); + if (this.required) { + this.unitSettingForm.markAllAsTouched(); + } + this.unitSettingForm.markAsDirty(); } cancel() { diff --git a/ui-ngx/src/app/shared/models/widget-settings.models.ts b/ui-ngx/src/app/shared/models/widget-settings.models.ts index 193a18cf89..a9f3cd2ed8 100644 --- a/ui-ngx/src/app/shared/models/widget-settings.models.ts +++ b/ui-ngx/src/app/shared/models/widget-settings.models.ts @@ -907,8 +907,6 @@ export abstract class ValueFormatProcessor { export class SimpleValueFormatProcessor extends ValueFormatProcessor { - private readonly isDefinedUnit: boolean; - constructor(protected settings: ValueFormatSettings) { super(settings); this.unitSymbol = !settings.ignoreUnitSymbol && isNotEmptyStr(settings.units) ? (settings.units as string) : null; @@ -917,7 +915,7 @@ export class SimpleValueFormatProcessor extends ValueFormatProcessor { } format(value: any): string { - if (isDefinedAndNotNull(value) && isNumeric(value) && (this.isDefinedDecimals || this.isDefinedUnit || Number(value).toString() === value)) { + if (isDefinedAndNotNull(value) && isNumeric(value) && (this.isDefinedDecimals || this.unitSymbol || Number(value).toString() === value)) { return this.formatValue(Number(value)); } return value ?? ''; diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index e3f67fe8f7..369706b578 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -5924,7 +5924,7 @@ "energy-density": "Energy density", "force": "Force", "frequency": "Frequency", - "fuel-efficiency": "fuel efficiency", + "fuel-efficiency": "Fuel efficiency", "heat-capacity": "Heat capacity", "illuminance": "Illuminance", "inductance": "Inductance", @@ -6180,8 +6180,8 @@ "volt": "Volt", "kilovolt": "Kilovolt", "megavolt": "Megavolt", - "dbmV": "dBmV", - "dbm": "dBm", + "dbmV": "Decibel volt", + "dbm": "Decibel-milliwatts", "volt-meter": "Volt-Meter", "kilovolt-meter": "Kilovolt-Meter", "megavolt-meter": "Megavolt-Meter", @@ -6216,7 +6216,7 @@ "millimole": "Millimole", "kilomole": "Kilomole", "mole-per-cubic-meter": "Mole per Cubic Meter", - "rssi": "RSSI", + "rssi": "Received signal strength indicator", "ppm": "Parts Per Million", "ppb": "Parts Per Billion", "micrograms-per-cubic-meter": "Micrograms per Cubic Meter", @@ -6398,9 +6398,9 @@ "radian-per-second": "Radian per second", "radian-per-second-squared": "Radian per second squared", "revolutions-per-minute-per-second": "Angular acceleration", - "deg-per-second": "deg/s", + "deg-per-second": "Degrees per second", "rotation-per-minute": "Rotation per minute", - "degrees-brix": "Degrees Brix", + "degrees-brix": "Degrees brix", "katal": "Katal", "katal-per-cubic-metre": "Katal per Cubic Metre", "paris-inch": "Paris inch"