UI: Fixed typo; change logics clear units in panel
This commit is contained in:
		
							parent
							
								
									c2923c0f66
								
							
						
					
					
						commit
						53c41707bf
					
				@ -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() {
 | 
			
		||||
 | 
			
		||||
@ -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 ?? '';
 | 
			
		||||
 | 
			
		||||
@ -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"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user