Fixed a bug where filter IsEmpty wasn't hiding the value input.
This commit is contained in:
parent
e535e216df
commit
efe27ccab5
2 changed files with 13 additions and 3 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4 col-10 mb-2">
|
<div class="col-md-4 col-10 mb-2">
|
||||||
@if (formGroup.get('comparison')?.value !== FilterComparison.IsEmpty) {
|
@if (IsEmptySelected) {
|
||||||
@if (predicateType$ | async; as predicateType) {
|
@if (predicateType$ | async; as predicateType) {
|
||||||
@switch (predicateType) {
|
@switch (predicateType) {
|
||||||
@case (PredicateType.Text) {
|
@case (PredicateType.Text) {
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,10 @@ export class MetadataFilterRowComponent implements OnInit {
|
||||||
private readonly mangaFormatPipe = new MangaFormatPipe(this.translocoService);
|
private readonly mangaFormatPipe = new MangaFormatPipe(this.translocoService);
|
||||||
private readonly ageRatingPipe = new AgeRatingPipe();
|
private readonly ageRatingPipe = new AgeRatingPipe();
|
||||||
|
|
||||||
|
get IsEmptySelected() {
|
||||||
|
return parseInt(this.formGroup.get('comparison')?.value + '', 10) !== FilterComparison.IsEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
get UiLabel(): FilterRowUi | null {
|
get UiLabel(): FilterRowUi | null {
|
||||||
const field = parseInt(this.formGroup.get('input')!.value, 10) as FilterField;
|
const field = parseInt(this.formGroup.get('input')!.value, 10) as FilterField;
|
||||||
|
|
@ -348,6 +352,7 @@ export class MetadataFilterRowComponent implements OnInit {
|
||||||
this.formGroup.get('filterValue')?.patchValue('');
|
this.formGroup.get('filterValue')?.patchValue('');
|
||||||
this.formGroup.get('comparison')?.patchValue(StringComparisons[0]);
|
this.formGroup.get('comparison')?.patchValue(StringComparisons[0]);
|
||||||
}
|
}
|
||||||
|
this.cdRef.markForCheck();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -363,10 +368,13 @@ export class MetadataFilterRowComponent implements OnInit {
|
||||||
|
|
||||||
this.validComparisons$.next([...new Set(comps)]);
|
this.validComparisons$.next([...new Set(comps)]);
|
||||||
this.predicateType$.next(PredicateType.Number);
|
this.predicateType$.next(PredicateType.Number);
|
||||||
|
|
||||||
if (this.loaded) {
|
if (this.loaded) {
|
||||||
this.formGroup.get('filterValue')?.patchValue(0);
|
this.formGroup.get('filterValue')?.patchValue(0);
|
||||||
this.formGroup.get('comparison')?.patchValue(NumberComparisons[0]);
|
this.formGroup.get('comparison')?.patchValue(NumberComparisons[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.cdRef.markForCheck();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -383,6 +391,7 @@ export class MetadataFilterRowComponent implements OnInit {
|
||||||
this.formGroup.get('filterValue')?.patchValue(false);
|
this.formGroup.get('filterValue')?.patchValue(false);
|
||||||
this.formGroup.get('comparison')?.patchValue(DateComparisons[0]);
|
this.formGroup.get('comparison')?.patchValue(DateComparisons[0]);
|
||||||
}
|
}
|
||||||
|
this.cdRef.markForCheck();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -400,6 +409,7 @@ export class MetadataFilterRowComponent implements OnInit {
|
||||||
this.formGroup.get('filterValue')?.patchValue(false);
|
this.formGroup.get('filterValue')?.patchValue(false);
|
||||||
this.formGroup.get('comparison')?.patchValue(BooleanComparisons[0]);
|
this.formGroup.get('comparison')?.patchValue(BooleanComparisons[0]);
|
||||||
}
|
}
|
||||||
|
this.cdRef.markForCheck();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -421,15 +431,15 @@ export class MetadataFilterRowComponent implements OnInit {
|
||||||
this.formGroup.get('filterValue')?.patchValue(0);
|
this.formGroup.get('filterValue')?.patchValue(0);
|
||||||
this.formGroup.get('comparison')?.patchValue(comps[0]);
|
this.formGroup.get('comparison')?.patchValue(comps[0]);
|
||||||
}
|
}
|
||||||
|
this.cdRef.markForCheck();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onDateSelect(_: NgbDate) {
|
onDateSelect(_: NgbDate) {
|
||||||
this.propagateFilterUpdate();
|
this.propagateFilterUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateIfDateFilled() {
|
updateIfDateFilled() {
|
||||||
this.propagateFilterUpdate();
|
this.propagateFilterUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue