Skip to content

Commit

Permalink
Add clear changelog filter button
Browse files Browse the repository at this point in the history
  • Loading branch information
teodor-ritense committed Nov 14, 2024
1 parent 49f073a commit 72ad8bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<valtimo-carbon-list
hideToolbar="true"
[items]="caseChangeLogs$ | async"
[fields]="CASE_CHANGE_LOGS_FIELDS"
[loading]="(caseChangeLogs$ | async) === null"
></valtimo-carbon-list>
>
<button carbonToolbarContent cdsButton="ghost" (click)="onClearFilterClick()">
Clear filter
</button>
</valtimo-carbon-list>
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import {CarbonListModule, ColumnConfig, ViewType} from '@valtimo/components';
import {CaseChangeLogsService} from '../../services';
import {Observable, combineLatest, map} from 'rxjs';
import {CaseChangeLog} from '../../models';
import {ButtonModule} from 'carbon-components-angular';

@Component({
selector: 'valtimo-dossier-management-change-logs',
templateUrl: './dossier-management-change-logs.component.html',
styleUrl: './dossier-management-change-logs.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [CommonModule, CarbonListModule],
imports: [CommonModule, CarbonListModule, ButtonModule],
})
export class DossierManagementChangeLogsComponent implements OnDestroy {
public readonly caseChangeLogs$: Observable<(CaseChangeLog & {fullName: string})[] | null> =
Expand Down Expand Up @@ -50,6 +51,10 @@ export class DossierManagementChangeLogsComponent implements OnDestroy {
constructor(private readonly caseChangeLogsService: CaseChangeLogsService) {}

public ngOnDestroy(): void {
this.onClearFilterClick();
}

public onClearFilterClick(): void {
this.caseChangeLogsService.activeLogSearch$.next(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ export class DossierManagementCollaboratorsListComponent implements AfterViewIni
public ngAfterViewInit(): void {
this.collaboratorsFields$.next([
{
key: 'email',
label: 'User email',
key: 'fullName',
label: 'User name',
viewType: ViewType.TEXT,
},
{
key: 'fullName',
label: 'User name',
key: 'email',
label: 'User email',
viewType: ViewType.TEXT,
},
{
Expand Down

0 comments on commit 72ad8bb

Please sign in to comment.