@@ -16,29 +16,34 @@ import { Title } from '@angular/platform-browser';
16
16
import { RouterModule } from '@angular/router' ;
17
17
import { ToastrService } from 'ngx-toastr' ;
18
18
import { BehaviorSubject , combineLatest , map , shareReplay , switchMap , tap } from 'rxjs' ;
19
+ import { HostsService } from '../../../api/hosts/hosts.service' ;
19
20
import { ProjectsService } from '../../../api/projects/projects.service' ;
20
21
import { TagsService } from '../../../api/tags/tags.service' ;
21
22
import { ProjectCellComponent } from '../../../shared/components/project-cell/project-cell.component' ;
23
+ import { SharedModule } from '../../../shared/shared.module' ;
24
+ import { Host } from '../../../shared/types/host/host.interface' ;
25
+ import { HttpStatus } from '../../../shared/types/http-status.type' ;
22
26
import { Page } from '../../../shared/types/page.type' ;
23
27
import { ProjectSummary } from '../../../shared/types/project/project.summary' ;
28
+ import { Tag } from '../../../shared/types/tag.type' ;
24
29
import {
25
30
ElementMenuItems ,
26
31
FilteredPaginatedTableComponent ,
27
32
} from '../../../shared/widget/filtered-paginated-table/filtered-paginated-table.component' ;
28
- import { BlockedPillTagComponent } from '../../../shared/widget/pill-tag/blocked-pill-tag.component' ;
29
- import { HostsService } from '../../../api/hosts/hosts.service' ;
30
- import { SharedModule } from '../../../shared/shared.module' ;
31
- import { Host } from '../../../shared/types/host/host.interface' ;
32
- import { HttpStatus } from '../../../shared/types/http-status.type' ;
33
- import { Tag } from '../../../shared/types/tag.type' ;
34
33
import {
35
34
TABLE_FILTERS_SOURCE_INITAL_FILTERS ,
36
35
TableFilters ,
37
36
TableFiltersSource ,
38
37
TableFiltersSourceBase ,
39
38
} from '../../../shared/widget/filtered-paginated-table/table-filters-source' ;
40
39
import { TableFormatComponent } from '../../../shared/widget/filtered-paginated-table/table-format/table-format.component' ;
40
+ import { BlockedPillTagComponent } from '../../../shared/widget/pill-tag/blocked-pill-tag.component' ;
41
41
import { defaultNewTimeMs } from '../../../shared/widget/pill-tag/new-pill-tag.component' ;
42
+ import {
43
+ getGlobalProjectFilter ,
44
+ globalProjectFilter$ ,
45
+ hasGlobalProjectFilter ,
46
+ } from '../../../utils/global-project-filter' ;
42
47
import { HostsInteractionsService } from '../hosts-interactions.service' ;
43
48
44
49
@Component ( {
@@ -90,7 +95,12 @@ export class ListHostsComponent {
90
95
tags$ = this . tagsService . getAllTags ( ) . pipe ( shareReplay ( 1 ) ) ;
91
96
92
97
private refresh$ = new BehaviorSubject ( null ) ;
93
- dataSource$ = combineLatest ( [ this . filtersSource . debouncedFilters$ , this . tags$ , this . refresh$ ] ) . pipe (
98
+ dataSource$ = combineLatest ( [
99
+ this . filtersSource . debouncedFilters$ ,
100
+ this . tags$ ,
101
+ this . refresh$ ,
102
+ globalProjectFilter$ ,
103
+ ] ) . pipe (
94
104
switchMap ( ( [ { dateRange, filters, pagination } , tags ] ) => {
95
105
return this . hostsService . getPage (
96
106
pagination ?. page || 0 ,
@@ -199,6 +209,9 @@ export class ListHostsComponent {
199
209
break ;
200
210
}
201
211
}
212
+
213
+ if ( hasGlobalProjectFilter ( ) ) projects . push ( getGlobalProjectFilter ( ) ?. id ) ;
214
+
202
215
if ( includedTags ?. length ) filterObject [ 'tags' ] = includedTags ;
203
216
if ( domains ?. length ) filterObject [ 'domains' ] = domains ;
204
217
if ( hosts ?. length ) filterObject [ 'hosts' ] = hosts ;
0 commit comments