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 66 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
2 changes: 1 addition & 1 deletion src/app/collection-page/collection-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
<ds-themed-loading *ngIf="collectionRD?.isLoading"
message="{{'loading.collection' | translate}}"></ds-themed-loading>
</div>
</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 @@ -7,7 +7,7 @@ import { Bitstream } from '../core/shared/bitstream.model';
import { Community } from '../core/shared/community.model';
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,10 +1,19 @@
<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>
<ds-suggestions-popup></ds-suggestions-popup>
3 changes: 2 additions & 1 deletion 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,6 +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';
import { NotificationsModule } from '../notifications/notifications.module';

const DECLARATIONS = [
Expand All @@ -29,6 +29,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
@@ -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 @@ -157,11 +157,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,4 +1,4 @@
<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 [scope]="currentScope" [filter]="filter" [inPlaceSearch]="inPlaceSearch" [refreshFilters]="refreshFilters"></ds-search-filter>
Expand Down
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
13 changes: 7 additions & 6 deletions src/app/shared/search/search.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<ng-template *ngTemplateOutlet="searchContent"></ng-template>
</div>

<ds-page-with-sidebar *ngIf="showSidebar && (initialized$ | async)" [id]="'search-page'" [sidebarContent]="sidebarContent">
<ng-template *ngTemplateOutlet="searchContent"></ng-template>
<ds-page-with-sidebar *ngIf="showSidebar && (initialized$ | async)" [id]="'search-page'" [sideBarWidth]="sideBarWidth"
[sidebarContent]="sidebarContent">
<ng-template *ngTemplateOutlet="searchContent"></ng-template>
</ds-page-with-sidebar>

<ng-template #searchContent>
Expand All @@ -22,15 +23,15 @@
</div>
<div id="search-content" class="col-12">
<div class="d-block d-md-none search-controls clearfix">
<ds-view-mode-switch [viewModeList]="viewModeList" [inPlaceSearch]="inPlaceSearch"></ds-view-mode-switch>
<button [attr.aria-label]="'search.sidebar.open' | translate" (click)="openSidebar()"
aria-controls="search-sidebar-content"
<ds-view-mode-switch *ngIf="inPlaceSearch" [viewModeList]="viewModeList"
[inPlaceSearch]="inPlaceSearch"></ds-view-mode-switch>
<button (click)="openSidebar()" aria-controls="#search-body"
class="btn btn-outline-primary float-right open-sidebar"><i
class="fas fa-sliders"></i> {{"search.sidebar.open"
| translate}}
</button>
</div>
<ds-themed-search-results [searchResults]="resultsRD$ | async"
<ds-themed-search-results *ngIf="inPlaceSearch" [searchResults]="resultsRD$ | async"
[searchConfig]="searchOptions$ | async"
[configuration]="(currentConfiguration$ | async)"
[disableHeader]="!searchEnabled"
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/search/search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { ThemedSearchSettingsComponent } from './search-settings/themed-search-s
import { NouisliderModule } from 'ng2-nouislider';
import { ThemedSearchFiltersComponent } from './search-filters/themed-search-filters.component';
import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component';

const COMPONENTS = [
SearchComponent,
ThemedSearchComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/sidebar/sidebar-dropdown.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ <h4><label for="{{id}}">{{label | translate}}</label></h4>
<select id="{{id}}" class="form-control" (change)="change.emit($event)">
<ng-content></ng-content>
</select>
</div>
</div>
3 changes: 3 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5572,6 +5572,8 @@

"admin.system-wide-alert.title": "System-wide Alerts",

"discover.filters.head": "Discover",

"item-access-control-title": "This form allows you to perform changes to the access conditions of the item's metadata or its bitstreams.",

"collection-access-control-title": "This form allows you to perform changes to the access conditions of all the items owned by this collection. Changes may be performed to either all Item metadata or all content (bitstreams).",
Expand Down Expand Up @@ -5640,3 +5642,4 @@

"admin.notifications.publicationclaim.page.title": "Publication Claim",
}

2 changes: 1 addition & 1 deletion src/config/homepage-config.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Config } from './config.interface';

/**
* Config that determines how the dropdown list of years are created for browse-by-date components
* Config that determines how the recentSubmissions list showing at home page
*/
export interface HomeConfig extends Config {
recentSubmissions: {
Expand Down
Loading