@@ -3,29 +3,22 @@ import { HeaderComponent } from '../../../../shared/components/header/header.com
3
3
import { AhbTableComponent } from '../../components/ahb-table/ahb-table.component' ;
4
4
import { Ahb , AhbService } from '../../../../core/api' ;
5
5
import { CommonModule } from '@angular/common' ;
6
- import {
7
- FormControl ,
8
- FormGroup ,
9
- FormsModule ,
10
- ReactiveFormsModule ,
11
- Validators ,
12
- } from '@angular/forms' ;
6
+ import { FormControl , FormsModule , ReactiveFormsModule } from '@angular/forms' ;
13
7
import { Observable , map , shareReplay } from 'rxjs' ;
14
- import { Router } from '@angular/router' ;
15
- import { FormatVersionSelectComponent } from '../../components/format-version-select/format-version-select.component' ;
16
- import { PruefiInputComponent } from '../../components/pruefi-input/pruefi-input.component' ;
8
+ import { AhbSearchFormHeaderComponent } from '../../components/ahb-search-form-header/ahb-search-form-header.component' ;
9
+ import { InputSearchEnhancedComponent } from '../../../../shared/components/input-search-enhanced/input-search-enhanced.component' ;
17
10
18
11
@Component ( {
19
12
selector : 'app-ahb-page' ,
20
13
standalone : true ,
21
14
imports : [
15
+ FormsModule ,
16
+ ReactiveFormsModule ,
22
17
HeaderComponent ,
23
18
AhbTableComponent ,
24
19
CommonModule ,
25
- FormsModule ,
26
- ReactiveFormsModule ,
27
- FormatVersionSelectComponent ,
28
- PruefiInputComponent ,
20
+ AhbSearchFormHeaderComponent ,
21
+ InputSearchEnhancedComponent ,
29
22
] ,
30
23
templateUrl : './ahb-page.component.html' ,
31
24
} )
@@ -38,15 +31,7 @@ export class AhbPageComponent {
38
31
ahb$ ?: Observable < Ahb > ;
39
32
lines$ ?: Observable < Ahb [ 'lines' ] > ;
40
33
41
- headerSearchForm = new FormGroup ( {
42
- formatVersion : new FormControl ( '' , Validators . required ) ,
43
- pruefi : new FormControl ( '' , Validators . required ) ,
44
- } ) ;
45
-
46
- constructor (
47
- private readonly ahbService : AhbService ,
48
- private readonly router : Router ,
49
- ) {
34
+ constructor ( private readonly ahbService : AhbService ) {
50
35
effect ( ( ) => {
51
36
this . ahb$ = this . ahbService
52
37
. getAhb ( {
@@ -55,34 +40,22 @@ export class AhbPageComponent {
55
40
} )
56
41
. pipe ( shareReplay ( ) ) ;
57
42
this . lines$ = this . ahb$ . pipe ( map ( ( ahb ) => ahb . lines ) ) ;
58
- this . headerSearchForm . setValue ( {
59
- formatVersion : this . formatVersion ( ) ,
60
- pruefi : this . pruefi ( ) ,
61
- } ) ;
62
43
} ) ;
63
44
}
64
45
65
- onSearchQueryChange ( ) {
46
+ onSearchQueryChange ( searchQuery : string | undefined ) {
66
47
this . lines$ = this . ahb$ ?. pipe (
67
48
map ( ( ahb ) => ahb . lines ) ,
68
49
map (
69
50
( lines ) =>
70
51
lines . filter ( ( line ) =>
71
- JSON . stringify ( line ) . includes ( this . searchQuery . value ?? '' ) ,
52
+ JSON . stringify ( line ) . includes ( searchQuery ?? '' ) ,
72
53
) ?? [ ] ,
73
54
) ,
74
55
) ;
75
56
}
76
57
77
- onClickHeaderSearchSubmit ( ) {
78
- if ( ! this . headerSearchForm . valid ) {
79
- this . headerSearchForm . markAllAsTouched ( ) ;
80
- return ;
81
- }
82
- this . router . navigate ( [
83
- '/ahb' ,
84
- this . headerSearchForm . value . formatVersion ,
85
- this . headerSearchForm . value . pruefi ,
86
- ] ) ;
58
+ onClickExport ( ) {
59
+ alert ( 'not implemented' ) ;
87
60
}
88
61
}
0 commit comments