Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only add Display Search Facets to the Homepage #2275

Merged
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5a9269e
Update homepage-config.interface.ts
GauravD2t Oct 10, 2022
7336188
Merge branch 'DSpace:main' into main
GauravD2t May 2, 2023
fed9244
advance Search add
GauravD2t May 2, 2023
f2c6f3f
slove error while unti test
GauravD2t May 4, 2023
9910589
write unit test
GauravD2t May 5, 2023
675c354
Ensures select element has an accessible name
GauravD2t May 5, 2023
13f6d4e
resolve conflict
GauravD2t May 15, 2023
5d3af64
Merge branch 'main' into main
GauravD2t May 16, 2023
326777a
change data pass into url
GauravD2t May 16, 2023
22f1844
Merge branch 'main' of https://github.com/GauravD2t/Advanced-search
GauravD2t May 16, 2023
0e28e56
error resolve
GauravD2t May 16, 2023
f6ba079
Merge branch 'main' into main
GauravD2t May 17, 2023
e7f8882
Merge branch 'DSpace:main' into main
GauravD2t May 18, 2023
e0d8566
Merge branch 'DSpace:main' into main
GauravD2t May 19, 2023
8b97c19
Merge branch 'main' into main
GauravD2t May 20, 2023
d6d0d40
Merge branch 'main' into main
GauravD2t May 23, 2023
e6253da
Merge branch 'DSpace:main' into main
GauravD2t May 24, 2023
5ad3f97
Merge branch 'DSpace:main' into main
GauravD2t May 26, 2023
c1acb11
Search.Filters.Applied.F.Title given name as Title
GauravD2t May 26, 2023
79d961f
Advanced filters configurable in the User interface (in config.*.yml)
GauravD2t May 26, 2023
6d14a6d
Search Facets on all Home, Community, Collection
GauravD2t May 30, 2023
e0b757c
should pass accessibility tests error resolve
GauravD2t May 30, 2023
f2ae1a8
change label name
GauravD2t May 31, 2023
cb3a191
unique role or role/label/title
GauravD2t May 31, 2023
1c25266
remove same role name
GauravD2t May 31, 2023
6678a17
order of headings is semantically correct
GauravD2t Jun 1, 2023
7b027b5
semantically correct advance search and global css
GauravD2t Jun 1, 2023
ac4748e
Merge branch 'main' into Search-Facets-home-community-collection
GauravD2t Jun 1, 2023
b3db2f2
Merge branch 'main' into Search-Facets-home-community-collection
GauravD2t Jun 2, 2023
832f3cd
Merge branch 'main' into Search-Facets-home-community-collection
GauravD2t Jun 3, 2023
c365507
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Jun 15, 2023
74dca8c
change URL pattern
GauravD2t Jun 23, 2023
e6d62c4
URL pattern
GauravD2t Jun 23, 2023
4091528
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Jun 23, 2023
09712bf
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Jun 24, 2023
92a3720
Merge branch 'main' into Search-Facets-home-community-collection
GauravD2t Jul 3, 2023
3e30310
headings is semantically correct
GauravD2t Jul 3, 2023
ecee746
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Jul 7, 2023
84641b3
Merge branch 'main' into Search-Facets-home-community-collection
GauravD2t Jul 12, 2023
8b4752a
Merge branch 'main' into Search-Facets-home-community-collection
GauravD2t Jul 31, 2023
6612bd9
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Nov 8, 2023
73464d6
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Nov 9, 2023
0bb8fe0
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Dec 8, 2023
860a0d5
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Dec 15, 2023
644df3f
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Dec 27, 2023
314742d
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Jan 5, 2024
70d35f9
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Jan 5, 2024
e59a33a
change update
GauravD2t Jan 5, 2024
430d8dc
change update
GauravD2t Jan 5, 2024
206bb2f
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Jan 11, 2024
0c4497a
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Jan 11, 2024
951c4ee
remove advance search code from here
GauravD2t Jan 11, 2024
a56291f
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Jan 29, 2024
f044c5c
removing all code relating to Community/Collection pages
GauravD2t Jan 30, 2024
e26ab14
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Feb 1, 2024
7fd4a9c
resolve code conflict
GauravD2t Feb 1, 2024
3fd2453
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Feb 3, 2024
989d0e5
remove the space
GauravD2t Feb 3, 2024
0d85522
remove commented code
GauravD2t Feb 3, 2024
730b812
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Feb 12, 2024
5094b47
add 'merge'
GauravD2t Feb 12, 2024
19b689c
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Feb 14, 2024
3461aaa
resolve confilt
GauravD2t Feb 14, 2024
52a2807
remove back file
GauravD2t Feb 14, 2024
9bfc103
add lable dynamic
GauravD2t Feb 14, 2024
155f812
Merge branch 'Search-Facets-home-community-collection' of https://git…
GauravD2t Feb 16, 2024
55209b0
Update search-navbar.component.spec.ts
GauravD2t Feb 17, 2024
4907d5c
Update search-filter.component.html
GauravD2t Feb 17, 2024
3da9493
showDiscoverFilters config in yml file
GauravD2t Feb 17, 2024
6576739
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Feb 22, 2024
a8eb9fc
Ensures the order of headings is semantically correct
GauravD2t Feb 22, 2024
a0d5a5a
showDiscoverFilters change default to false
GauravD2t Feb 23, 2024
dade463
Merge branch 'DSpace:main' into Search-Facets-home-community-collection
GauravD2t Feb 23, 2024
b6f31b6
Update homepage-config.interface.ts to use boolean instead of false
tdonohue Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 55 additions & 75 deletions src/app/collection-page/collection-page.component.html
Original file line number Diff line number Diff line change
@@ -1,78 +1,58 @@
<div class="container">
<div class="collection-page"
*ngVar="(collectionRD$ | async) as collectionRD">
<div *ngIf="collectionRD?.hasSucceeded" @fadeInOut>
<div *ngIf="collectionRD?.payload as collection">
<ds-view-tracker [object]="collection"></ds-view-tracker>
<div class="d-flex flex-row border-bottom mb-4 pb-4">
<header class="comcol-header mr-auto">
<!-- Collection Name -->
<ds-comcol-page-header
[name]="dsoNameService.getName(collection)">
</ds-comcol-page-header>
<!-- Collection logo -->
<ds-comcol-page-logo *ngIf="logoRD$"
[logo]="(logoRD$ | async)?.payload"
[alternateText]="'collection.logo' | translate">
</ds-comcol-page-logo>
<div class="collection-page" *ngVar="(collectionRD$ | async) as collectionRD">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to undo all the changes to this file? It appears that you may have just realigned the HTML, but it'd be best to revert all changes, otherwise you may cause code conflicts with other PRs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GauravD2t : The changes to the collection-page.component.html are still not undone. They still are visible in the files changed tab in GitHub: https://github.com/DSpace/dspace-angular/pull/2275/files

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GauravD2t : It appears that you still haven't removed the changes to this collection-page.component.html. Please look in GitHub at the "Files changed" tab and you'll see there are still 130 lines of this file which are shown as modified. https://github.com/DSpace/dspace-angular/pull/2275/files

<div *ngIf="collectionRD?.hasSucceeded" @fadeInOut>
<div *ngIf="collectionRD?.payload as collection">
<ds-view-tracker [object]="collection"></ds-view-tracker>
<div class="d-flex flex-row border-bottom mb-4 pb-4">
<header class="comcol-header mr-auto">
<!-- Collection Name -->
<ds-comcol-page-header [name]="dsoNameService.getName(collection)">
</ds-comcol-page-header>
<!-- Collection logo -->
<ds-comcol-page-logo *ngIf="logoRD$" [logo]="(logoRD$ | async)?.payload" [alternateText]="'Collection Logo'">
</ds-comcol-page-logo>

<!-- Handle -->
<ds-themed-comcol-page-handle
[content]="collection.handle"
[title]="'collection.page.handle'" >
</ds-themed-comcol-page-handle>
<!-- Introductory text -->
<ds-comcol-page-content
[content]="collection.introductoryText"
[hasInnerHtml]="true">
</ds-comcol-page-content>
<!-- News -->
<ds-comcol-page-content
[content]="collection.sidebarText"
[hasInnerHtml]="true"
[title]="'collection.page.news'">
</ds-comcol-page-content>
</header>
<ds-dso-edit-menu></ds-dso-edit-menu>
</div>
<section class="comcol-page-browse-section">
<!-- Browse-By Links -->
<ds-themed-comcol-page-browse-by
[id]="collection.id"
[contentType]="collection.type">
</ds-themed-comcol-page-browse-by>

<ng-container *ngVar="(itemRD$ | async) as itemRD">
<div class="mt-4" *ngIf="itemRD?.hasSucceeded" @fadeIn>
<h3 class="sr-only">{{'collection.page.browse.recent.head' | translate}}</h3>
<ds-viewable-collection
[config]="paginationConfig"
[sortConfig]="sortConfig"
[objects]="itemRD"
[hideGear]="true">
</ds-viewable-collection>
</div>
<ds-error *ngIf="itemRD?.hasFailed"
message="{{'error.recent-submissions' | translate}}"></ds-error>
<ds-themed-loading *ngIf="!itemRD || itemRD.isLoading"
message="{{'loading.recent-submissions' | translate}}"></ds-themed-loading>
<div *ngIf="!itemRD?.isLoading && itemRD?.payload?.page.length === 0" class="alert alert-info w-100" role="alert">
{{'collection.page.browse.recent.empty' | translate}}
<!-- Handle -->
<ds-themed-comcol-page-handle [content]="collection.handle" [title]="'collection.page.handle'">
</ds-themed-comcol-page-handle>
<!-- Introductory text -->
<ds-comcol-page-content [content]="collection.introductoryText" [hasInnerHtml]="true">
</ds-comcol-page-content>
<!-- News -->
<ds-comcol-page-content [content]="collection.sidebarText" [hasInnerHtml]="true" [title]="'collection.page.news'">
</ds-comcol-page-content>
</header>
<ds-dso-edit-menu></ds-dso-edit-menu>
</div>
<section class="comcol-page-browse-section">
<!-- Browse-By Links -->
<ds-themed-comcol-page-browse-by [id]="collection.id" [contentType]="collection.type">
</ds-themed-comcol-page-browse-by>
<ng-container *ngVar="(itemRD$ | async) as itemRD">
<div class="mt-4" *ngIf="itemRD?.hasSucceeded" @fadeIn>
<h3 class="sr-only">{{'collection.page.browse.recent.head' |
translate}}</h3>
<ds-viewable-collection [config]="paginationConfig" [sortConfig]="sortConfig" [objects]="itemRD"
[hideGear]="true">
</ds-viewable-collection>
</div>
<ds-error *ngIf="itemRD?.hasFailed" message="{{'error.recent-submissions' | translate}}"></ds-error>
<ds-themed-loading *ngIf="!itemRD || itemRD.isLoading"
message="{{'loading.recent-submissions' | translate}}"></ds-themed-loading>
<div *ngIf="!itemRD?.isLoading && itemRD?.payload?.page.length === 0" class="alert alert-info w-100"
role="alert">
{{'collection.page.browse.recent.empty' | translate}}
</div>
</ng-container>
</section>
<footer *ngIf="collection.copyrightText" class="border-top my-5 pt-4">
<!-- Copyright -->
<ds-comcol-page-content [content]="collection.copyrightText" [hasInnerHtml]="true">
</ds-comcol-page-content>
</footer>
</div>
</div>
<ds-error *ngIf="collectionRD?.hasFailed" message="{{'error.collection' | translate}}"></ds-error>
<ds-themed-loading *ngIf="collectionRD?.isLoading" message="{{'loading.collection' | translate}}"></ds-themed-loading>
</div>
</ng-container>
</section>
<footer *ngIf="collection.copyrightText" class="border-top my-5 pt-4">
<!-- Copyright -->
<ds-comcol-page-content
[content]="collection.copyrightText"
[hasInnerHtml]="true">
</ds-comcol-page-content>
</footer>
</div>
</div>
<ds-error *ngIf="collectionRD?.hasFailed"
message="{{'error.collection' | translate}}"></ds-error>
<ds-themed-loading *ngIf="collectionRD?.isLoading"
message="{{'loading.collection' | translate}}"></ds-themed-loading>
</div>
</div>
</div>
10 changes: 6 additions & 4 deletions src/app/community-page/community-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
<ds-themed-comcol-page-browse-by [id]="communityPayload.id" [contentType]="communityPayload.type">
</ds-themed-comcol-page-browse-by>

<ds-themed-community-page-sub-community-list [community]="communityPayload"></ds-themed-community-page-sub-community-list>
<ds-themed-community-page-sub-collection-list [community]="communityPayload"></ds-themed-community-page-sub-collection-list>
<ds-themed-community-page-sub-community-list
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, could you undo the changes to this file too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GauravD2t : The changes to the community-page.component.html are still not undone. They still are visible in the files changed tab in GitHub: https://github.com/DSpace/dspace-angular/pull/2275/files

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GauravD2t : Same as above, this community-page.component.html is still showing that there are 10 lines of changes when you look in GitHub at https://github.com/DSpace/dspace-angular/pull/2275/files
Please remove them.

[community]="communityPayload"></ds-themed-community-page-sub-community-list>
<ds-themed-community-page-sub-collection-list
[community]="communityPayload"></ds-themed-community-page-sub-collection-list>
</section>
<footer *ngIf="communityPayload.copyrightText" class="border-top my-5 pt-4">
<footer *ngIf="communityPayload.copyrightText" class="border-top my-5 pt-4">
<!-- Copyright -->
<ds-comcol-page-content [content]="communityPayload.copyrightText" [hasInnerHtml]="true">
</ds-comcol-page-content>
Expand All @@ -41,4 +43,4 @@

<ds-error *ngIf="communityRD?.hasFailed" message="{{'error.community' | translate}}"></ds-error>
<ds-themed-loading *ngIf="communityRD?.isLoading" message="{{'loading.community' | translate}}"></ds-themed-loading>
</div>
</div>
2 changes: 1 addition & 1 deletion src/app/community-page/community-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { MetadataService } from '../core/metadata/metadata.service';

import { fadeInOut } from '../shared/animations/fade';
import { hasValue } from '../shared/empty.util';
import { getAllSucceededRemoteDataPayload} from '../core/shared/operators';
import { getAllSucceededRemoteDataPayload } from '../core/shared/operators';
tdonohue marked this conversation as resolved.
Show resolved Hide resolved
import { AuthService } from '../core/auth/auth.service';
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
import { FeatureID } from '../core/data/feature-authorization/feature-id';
Expand Down
23 changes: 16 additions & 7 deletions src/app/home-page/home-page.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<ds-themed-home-news></ds-themed-home-news>
<div class="container">
<ng-container *ngIf="(site$ | async) as site">
<ds-view-tracker [object]="site"></ds-view-tracker>
</ng-container>
<ds-themed-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-themed-search-form>
<ds-themed-top-level-community-list></ds-themed-top-level-community-list>
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
<div class="container-fluid">
<div class="row m-5">
<div class="col-sm-3">
<ds-configuration-search-page [sideBarWidth]="12" [showViewModes]="false" [searchEnabled]="false"
[inPlaceSearch]="false" [showScopeSelector]="false"></ds-configuration-search-page>
</div>
<div class="col-sm-9">
<ng-container *ngIf="(site$ | async) as site">
<ds-view-tracker [object]="site"></ds-view-tracker>
</ng-container>
<ds-themed-search-form [inPlaceSearch]="false"
[searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-themed-search-form>
<ds-themed-top-level-community-list></ds-themed-top-level-community-list>
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/app/home-page/home-page.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { HomeNewsComponent } from './home-news/home-news.component';
import { HomePageRoutingModule } from './home-page-routing.module';

import { HomePageComponent } from './home-page.component';
import { TopLevelCommunityListComponent } from './top-level-community-list/top-level-community-list.component';
import { StatisticsModule } from '../statistics/statistics.module';
Expand All @@ -13,7 +12,7 @@ import { RecentItemListComponent } from './recent-item-list/recent-item-list.com
import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module';
import { ResearchEntitiesModule } from '../entity-groups/research-entities/research-entities.module';
import { ThemedTopLevelCommunityListComponent } from './top-level-community-list/themed-top-level-community-list.component';

import { SearchModule } from '../shared/search/search.module';
const DECLARATIONS = [
HomePageComponent,
ThemedHomePageComponent,
Expand All @@ -28,6 +27,7 @@ const DECLARATIONS = [
imports: [
CommonModule,
SharedModule.withEntryComponents(),
SearchModule,
JournalEntitiesModule.withEntryComponents(),
ResearchEntitiesModule.withEntryComponents(),
HomePageRoutingModule,
Expand Down
4 changes: 2 additions & 2 deletions src/app/search-navbar/search-navbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('SearchNavbarComponent', () => {
fixture.detectChanges();
}));
it('to search page with empty query', () => {
const extras: NavigationExtras = { queryParams: { query: '' }, queryParamsHandling: 'merge' };
const extras: NavigationExtras = { queryParams: { query: '' }, queryParamsHandling: '' };
GauravD2t marked this conversation as resolved.
Show resolved Hide resolved
expect(component.onSubmit).toHaveBeenCalledWith({ query: '' });
expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
});
Expand All @@ -113,7 +113,7 @@ describe('SearchNavbarComponent', () => {
fixture.detectChanges();
}));
it('to search page with query', async () => {
const extras: NavigationExtras = { queryParams: { query: 'test' }, queryParamsHandling: 'merge' };
const extras: NavigationExtras = { queryParams: { query: 'test' }, queryParamsHandling: '' };
GauravD2t marked this conversation as resolved.
Show resolved Hide resolved
expect(component.onSubmit).toHaveBeenCalledWith({ query: 'test' });

expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ <h2 class="comcol-browse-label h5">{{'browse.comcol.head' | translate}}</h2>
<div class="d-none d-sm-block">

<div class="list-group list-group-horizontal">
<a *ngFor="let option of allOptions"
class="list-group-item"
[routerLink]="option.routerLink"
[queryParams]="option.params"
routerLinkActive="active">{{ option.label | translate }}</a>
<a *ngFor="let option of allOptions" class="list-group-item" [routerLink]="option.routerLink"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the changes to this file can also be undone. These are specific to Community/Collection pages again

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GauravD2t : The changes to the comcol-page-browse-by.component.html are still not undone. They still are visible in the files changed tab in GitHub: https://github.com/DSpace/dspace-angular/pull/2275/files

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GauravD2t : Same again here. I believe this comcol-page-browse-by.component.html should no longer be modified. GitHub is showing that 19 lines in this file are still being changed. https://github.com/DSpace/dspace-angular/pull/2275/files

[queryParams]="option.params" routerLinkActive="active">{{ option.label | translate }}</a>
</div>
</div>

<div class="d-block d-sm-none">
<select name="browse-type"
class="form-control"
aria-label="Browse Community or Collection"
(ngModelChange)="onSelectChange($event)" [ngModel]="currentOptionId$ | async">
<option *ngFor="let option of allOptions"
[ngValue]="option.id"
[attr.selected]="(currentOptionId$ | async) === option.id ? 'selected' : null">{{ option.label | translate }}</option>
<select name="browse-type" class="form-control" aria-label="Browse Community or Collection"
(ngModelChange)="onSelectChange($event)" [ngModel]="currentOptionId$ | async">
<option *ngFor="let option of allOptions" [ngValue]="option.id"
[attr.selected]="(currentOptionId$ | async) === option.id ? 'selected' : null">{{ option.label | translate }}
</option>
</select>
</div>
</nav>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="facet-filter d-block mb-3 p-3" *ngIf="active$ | async"
[id]="regionId" [attr.aria-labelledby]="toggleId" [ngClass]="{ 'focus': focusBox }" role="region">
GauravD2t marked this conversation as resolved.
Show resolved Hide resolved
[id]="regionId" [attr.aria-labelledby]="toggleId" [ngClass]="{ 'focus': focusBox }" role="region">
tdonohue marked this conversation as resolved.
Show resolved Hide resolved
<button (click)="toggle()" (focusin)="focusBox = true" (focusout)="focusBox = false"
class="filter-name d-flex" [attr.aria-controls]="regionId" [id]="toggleId"
[attr.aria-expanded]="!(collapsed$ | async)"
Expand All @@ -9,6 +9,7 @@
<span class="h4 d-inline-block text-left mt-auto mb-auto">
{{'search.filters.filter.' + filter.name + '.head'| translate}}
</span>

<i class="filter-toggle flex-grow-1 fas p-auto"
aria-hidden="true"
[ngClass]="(collapsed$ | async) ? 'fa-plus' : 'fa-minus'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,20 @@ export class SearchFilterComponent implements OnInit {
}

get regionId(): string {
return `search-filter-region-${this.sequenceId}`;
if (this.inPlaceSearch) {
return `search-filter-region-${this.sequenceId}`;
} else {
return `search-filter-region-home-${this.sequenceId}`;
}

}

get toggleId(): string {
return `search-filter-toggle-${this.sequenceId}`;
if (this.inPlaceSearch) {
return `search-filter-toggle-${this.sequenceId}`;
} else {
return `search-filter-toggle-home-${this.sequenceId}`;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<h3>{{"search.filters.head" | translate}}</h3>
<h3>{{filterLabel+'.filters.head' | translate}}</h3>
<div *ngIf="(filters | async)?.hasSucceeded">
GauravD2t marked this conversation as resolved.
Show resolved Hide resolved
<div *ngFor="let filter of (filters | async)?.payload; trackBy: trackUpdate">
<ds-search-filter [filter]="filter" [inPlaceSearch]="inPlaceSearch" [refreshFilters]="refreshFilters"></ds-search-filter>
</div>
</div>
<a class="btn btn-primary" [routerLink]="[searchLink]" [queryParams]="clearParams | async" queryParamsHandling="merge" role="button"><i class="fas fa-undo"></i> {{"search.filters.reset" | translate}}</a>
<a class="btn btn-primary" *ngIf="inPlaceSearch" [routerLink]="[searchLink]" [queryParams]="clearParams | async"
queryParamsHandling="merge" role="button"><i class="fas fa-undo"></i> {{"search.filters.reset" | translate}}</a>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ describe('SearchFiltersComponent', () => {
getClearFiltersQueryParams: () => {
},
getSearchLink: () => {
}
},
getConfigurationSearchConfig: () => { },
/* eslint-enable no-empty, @typescript-eslint/no-empty-function */
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class SearchFiltersComponent implements OnInit, OnDestroy {
searchLink: string;

subs = [];
filterLabel = 'search';

/**
* Initialize instance variables
Expand All @@ -77,6 +78,9 @@ export class SearchFiltersComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
if (!this.inPlaceSearch) {
this.filterLabel = 'discover';
}
this.clearParams = this.searchConfigService.getCurrentFrontendFilters().pipe(map((filters) => {
Object.keys(filters).forEach((f) => filters[f] = null);
return filters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[filters]="filters"
[refreshFilters]="refreshFilters"
[inPlaceSearch]="inPlaceSearch"></ds-themed-search-filters>
<ds-themed-search-settings [currentSortOption]="currentSortOption"
<ds-themed-search-settings *ngIf="inPlaceSearch" [currentSortOption]="currentSortOption"
[sortOptionsList]="sortOptionsList"></ds-themed-search-settings>
</div>
</div>
Expand Down
Loading
Loading