Skip to content

Commit

Permalink
Highlight list filters & fix cf events list clear filter (#4749)
Browse files Browse the repository at this point in the history
* Highlight list filters & fix cf events list clear filter
- In list header highlight values that effect the list
  - multi filters
  - text filters
  - sort
  - chips
- This includes custom filters that live outside of the list component
  - cf events list
  - helm charts list
- Also fix an issue in the cf events list where the actee filter's `x` button was not visible on click of actee

* Don't highlight sort field selector
  • Loading branch information
richard-cox authored Nov 5, 2020
1 parent efcfb10 commit 6172a2e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,12 @@ export class CloudFoundryEventsListComponent implements OnInit, OnDestroy {
this.config.getEventFilters().pipe(
distinctUntilChanged()
).subscribe(params => {

if (!this.initialSet) {
this.filtersFormGroup.controls.type.setValue(params.type);
this.filtersFormGroup.controls.actee.setValue(params.actee);
this.updateType(params.type);
this.updateActee(params.actee);
this.initialSet = true;
} else if (this.filtersFormGroup.controls.actee.value !== params.actee) {
this.filtersFormGroup.controls.actee.setValue(params.actee);
this.updateActee(params.actee);
}
})
);
Expand Down Expand Up @@ -161,7 +160,18 @@ export class CloudFoundryEventsListComponent implements OnInit, OnDestroy {
}

public clearActeeFilter() {
this.filtersFormGroup.patchValue({actee: ''});
this.filtersFormGroup.patchValue({ actee: '' });
}

private updateType(type: string[]) {
this.filtersFormGroup.controls.type.setValue(type);
this.filtersFormGroup.controls.type.markAsDirty();
}

private updateActee(actee: string) {
this.filtersFormGroup.controls.actee.setValue(actee);
this.filtersFormGroup.controls.actee.markAsDirty();
this.hasActeeFilter = !!actee;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$foreground-colors: map-get($theme, foreground);
$background-colors: map-get($theme, background);
$is-dark: map-get($theme, is-dark);
$accent: map-get($theme, accent);

$header-selected-color: #fff;
@if $is-dark == true {
Expand All @@ -24,6 +25,19 @@
flex-wrap: wrap;
}
}

@include accent(mat-color($accent));
.sort {
@include accent(unset)
}
}
}
}

@mixin accent($colour) {
.mat-select-value-text,
.mat-input-element.ng-dirty,
.mat-chip {
color: $colour;
}
}

0 comments on commit 6172a2e

Please sign in to comment.