Merged PR 1964: feat(shared-filter): add canApply input to filter input menu components

feat(shared-filter): add canApply input to filter input menu components

Add canApply input parameter to FilterInputMenuButtonComponent and FilterInputMenuComponent to control when filter actions can be applied. Update RemissionListDepartmentElementsComponent to use canApply flag and implement rollback functionality when filter menu is closed without applying changes.

- Add canApply input to FilterInputMenuButtonComponent with default false
- Pass canApply parameter through to FilterInputMenuComponent
- Update remission department filter to use canApply=true
- Implement rollbackFilterInput method for filter state management
- Change selectedDepartments to selectedDepartment for single selection
- Update capacity resource to work with single department selection

Ref: #5320
This commit is contained in:
Nino Righi
2025-10-06 08:41:22 +00:00
committed by Lorenz Hilpert
parent d430f544f0
commit 40592b4477
6 changed files with 41 additions and 14 deletions

View File

@@ -42,5 +42,6 @@
[filterInput]="input"
(applied)="applied.emit()"
(reseted)="reseted.emit()"
[canApply]="canApply()"
></filter-input-menu>
</ng-template>

View File

@@ -68,6 +68,13 @@ export class FilterInputMenuButtonComponent {
*/
reseted = output<void>();
/**
* Indicates whether the filter can be applied.
* Defaults to false.
* @default false
*/
canApply = input<boolean>(false);
/**
* Emits an event when the input menu is applied.
*/

View File

@@ -4,6 +4,6 @@
></filter-input-renderer>
<filter-actions
[inputKey]="filterInput().key"
[canApply]="false"
[canApply]="canApply()"
(reseted)="reseted.emit()"
></filter-actions>

View File

@@ -1,4 +1,9 @@
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
input,
output,
} from '@angular/core';
import { FilterInput } from '../../core';
import { FilterActionsComponent } from '../../actions';
import { InputRendererComponent } from '../../inputs/input-renderer';
@@ -30,4 +35,11 @@ export class FilterInputMenuComponent {
* Emits an event when the filter input is applied.
*/
applied = output<void>();
/**
* Indicates whether the filter can be applied.
* Defaults to false.
* @default false
*/
canApply = input<boolean>(false);
}