-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: missing initial value on release dropdown * fix: disable clearable select * fix: use only selected signal to bind in template * fix: initial load * fix: pagination and inital load of appServers * fix: simplify component with childstate see: https://youtu.be/aKxcIQMWSNU * fix: remove unused code * chore: improve naming * fix: tests for required signals --------- Co-authored-by: Max Burri <[email protected]>
- Loading branch information
Showing
5 changed files
with
45 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 13 additions & 10 deletions
23
AMW_angular/io/src/app/apps/apps-filter/apps-filter.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
import { ChangeDetectionStrategy, Component, computed, input, Input, signal } from '@angular/core'; | ||
import { ChangeDetectionStrategy, Component, computed, input, output, signal } from '@angular/core'; | ||
|
||
import { NgSelectModule } from '@ng-select/ng-select'; | ||
import { Release } from '../../settings/releases/release'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { Output, EventEmitter } from '@angular/core'; | ||
import { ButtonComponent } from '../../shared/button/button.component'; | ||
import { IconComponent } from '../../shared/icon/icon.component'; | ||
|
||
@Component({ | ||
selector: 'app-apps-filter', | ||
standalone: true, | ||
imports: [FormsModule, NgSelectModule, ButtonComponent, IconComponent], | ||
imports: [FormsModule, NgSelectModule, ButtonComponent], | ||
templateUrl: './apps-filter.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class AppsFilterComponent { | ||
@Input() releases: Release[]; | ||
releases = input.required<Release[]>(); | ||
upcoming = input.required<number>(); | ||
|
||
upcoming = input<number>(); | ||
selected = signal<number>(this.upcoming()); | ||
selection = computed(() => { | ||
return { | ||
releases: this.releases(), | ||
selected: signal(this.upcoming()), | ||
}; | ||
}); | ||
|
||
@Output() filterEvent = new EventEmitter<{ filter: string; releaseId: number }>(); | ||
appName = signal<string>(''); | ||
|
||
appName: string; | ||
filterEvent = output<{ filter: string; releaseId: number }>(); | ||
|
||
search() { | ||
this.filterEvent.emit({ filter: this.appName, releaseId: this.selected() }); | ||
this.filterEvent.emit({ filter: this.appName(), releaseId: this.selection().selected() }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters