UI: Fixed constant boolean filters creating form
This commit is contained in:
		
							parent
							
								
									4bc2eba8a2
								
							
						
					
					
						commit
						8a421e3aa0
					
				@ -109,8 +109,11 @@ export class BooleanFilterPredicateComponent implements ControlValueAccessor, Va
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private updateModel() {
 | 
			
		||||
    const predicate: BooleanFilterPredicate = this.booleanFilterPredicateFormGroup.getRawValue();
 | 
			
		||||
    predicate.type = FilterPredicateType.BOOLEAN;
 | 
			
		||||
    let predicate: BooleanFilterPredicate = null;
 | 
			
		||||
    if (this.booleanFilterPredicateFormGroup.valid) {
 | 
			
		||||
      predicate = this.booleanFilterPredicateFormGroup.getRawValue();
 | 
			
		||||
      predicate.type = FilterPredicateType.BOOLEAN;
 | 
			
		||||
    }
 | 
			
		||||
    this.propagateChange(predicate);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -134,6 +134,10 @@ export class KeyFilterDialogComponent extends
 | 
			
		||||
            }
 | 
			
		||||
          );
 | 
			
		||||
        }
 | 
			
		||||
        if (valueType === EntityKeyValueType.BOOLEAN) {
 | 
			
		||||
          this.keyFilterFormGroup.get('value').clearValidators();
 | 
			
		||||
          this.keyFilterFormGroup.get('value').updateValueAndValidity();
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      this.keyFilterFormGroup.get('key.type').valueChanges.pipe(
 | 
			
		||||
@ -148,7 +152,7 @@ export class KeyFilterDialogComponent extends
 | 
			
		||||
          this.showAutocomplete = false;
 | 
			
		||||
        }
 | 
			
		||||
        if (this.data.telemetryKeysOnly) {
 | 
			
		||||
          if (type === EntityKeyType.CONSTANT) {
 | 
			
		||||
          if (type === EntityKeyType.CONSTANT && (this.keyFilterFormGroup.get('valueType').value !== EntityKeyValueType.BOOLEAN)) {
 | 
			
		||||
            this.keyFilterFormGroup.get('value').setValidators(Validators.required);
 | 
			
		||||
            this.keyFilterFormGroup.get('value').updateValueAndValidity();
 | 
			
		||||
          } else {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user