diff --git a/src/app/annuaire/annuaire.component.html b/src/app/annuaire/annuaire.component.html index aeb7c003bc855caa04cbc4264b6eff7623562440..ffd9a8553dc7e4741c4e9b42792346c161420167 100644 --- a/src/app/annuaire/annuaire.component.html +++ b/src/app/annuaire/annuaire.component.html @@ -10,6 +10,7 @@ [userList]="userList" [totalUserResult]="totalUserResult" [isLogged]="true" + [filterActive]="filterActive" (resetEvent)="shouldResetFilters()" (showMoreEvent)="showMore($event)" ></app-result-list> diff --git a/src/app/annuaire/annuaire.component.ts b/src/app/annuaire/annuaire.component.ts index 50902bda2103a19f267c76786d0976f26c458f73..c8c1a50713d28d44506d036082dcff79f9a820b0 100644 --- a/src/app/annuaire/annuaire.component.ts +++ b/src/app/annuaire/annuaire.component.ts @@ -16,12 +16,18 @@ export class AnnuaireComponent implements OnInit { public totalUserResult: number; public resetFilters: number = 0; public nextPage: number = 1; + public filterActive: boolean = false; ngOnInit(): void { this.getUsers({ queryParam: '', page: 1, jobFilters: [], employerFilter: [] }); } public getUsers(params: SearchQuery): void { if (this.userIsLoggedIn()) { + if (params.employerFilter?.length || params.jobFilters.length) { + this.filterActive = true; + } else { + this.filterActive = false; + } this.searchService .searchUserRegistry(params.queryParam, params.page, params.jobFilters, params.employerFilter) .subscribe((res: SearchResults) => { diff --git a/src/app/annuaire/result-list/result-list.component.html b/src/app/annuaire/result-list/result-list.component.html index 8560eed97971d4b3d1567ec53e0962f9dc5ce754..434d97ac2fcca074b3202395ea36a958dd345640 100644 --- a/src/app/annuaire/result-list/result-list.component.html +++ b/src/app/annuaire/result-list/result-list.component.html @@ -1,4 +1,4 @@ -<div class="results notEmpty" *ngIf="isLogged && userList.length"> +<div class="results notEmpty" *ngIf="isLogged && userList.length" [ngClass]="{ filterActive: filterActive }"> <div class="userNumber"> {{ userList.length }} <span *ngIf="showPagination"> sur {{ totalUserResult }} </span> utilisateurs trouvés </div> diff --git a/src/app/annuaire/result-list/result-list.component.scss b/src/app/annuaire/result-list/result-list.component.scss index ffa95bc69c880aa0720991d9ce0a3d1ae1246f6b..63d3022b6b865fe0fb5c5148cae76dfd0d1c2492 100644 --- a/src/app/annuaire/result-list/result-list.component.scss +++ b/src/app/annuaire/result-list/result-list.component.scss @@ -34,7 +34,10 @@ } &.notEmpty { //make sure it fits the correct height no matter the content lengtj and screen height - max-height: calc(100vh - $footer-height - $header-height - $header-height - 5rem); + max-height: calc(100vh - $footer-height - $header-height - $header-height - 2rem); + &.filterActive { + max-height: calc(100vh - $footer-height - $header-height - $header-height - 5rem); + } @media #{$large-phone} { height: 100%; } diff --git a/src/app/annuaire/result-list/result-list.component.ts b/src/app/annuaire/result-list/result-list.component.ts index 6cfcc547c3d8777c4f37a8614814b5a0b07de900..ed45d197e9f7eb45122415207327bd4cd6647cad 100644 --- a/src/app/annuaire/result-list/result-list.component.ts +++ b/src/app/annuaire/result-list/result-list.component.ts @@ -13,6 +13,7 @@ export class ResultListComponent implements OnInit, OnChanges { @Input() userList: UserAnnuary[]; @Input() totalUserResult: number; @Input() isLogged: boolean; + @Input() filterActive: boolean; @Output() resetEvent = new EventEmitter<any>(); @Output() showMoreEvent = new EventEmitter<any>(); public maxPerPage: number = 20; diff --git a/src/app/annuaire/search-bar/search-bar.component.ts b/src/app/annuaire/search-bar/search-bar.component.ts index e6d8ace012a47cd13b23be11b0a5a47c28c4619d..57607b60231c73f7ef3b628c98411118b88ebb2c 100644 --- a/src/app/annuaire/search-bar/search-bar.component.ts +++ b/src/app/annuaire/search-bar/search-bar.component.ts @@ -171,7 +171,7 @@ export class SearchBarComponent implements OnInit, OnChanges { this.splitFilters(this.checkedFilterList); this.countCheckedFilters(); this.searchEvent.emit({ - queryParam: inputTerm, + queryParam: inputTerm || '', jobFilters: this.checkedFilterList.length ? this.jobFilterChecked : [], employerFilter: this.checkedFilterList.length ? this.employerFilterChecked : [], });