mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
no recent submissions should be displayed if pageSize is 0 and changing the configuration structure
This commit is contained in:
@@ -260,7 +260,8 @@ info:
|
||||
enablePrivacyStatement: true
|
||||
# Home Page
|
||||
homePage:
|
||||
recentSubmissions:
|
||||
# The number of item showing in recent submission components
|
||||
recentSubmissionsRpp: 5
|
||||
pageSize: 5
|
||||
# Sort record of recent submission
|
||||
recentSubmissionsSortField: 'dc.date.accessioned'
|
||||
sortField: 'dc.date.accessioned'
|
||||
|
@@ -5,5 +5,5 @@
|
||||
</ng-container>
|
||||
<ds-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-search-form>
|
||||
<ds-top-level-community-list></ds-top-level-community-list>
|
||||
<ds-recent-item-list></ds-recent-item-list>
|
||||
<ds-recent-item-list *ngIf="recentSubmissionspageSize>0"></ds-recent-item-list>
|
||||
</div>
|
||||
|
@@ -3,7 +3,7 @@ import { map } from 'rxjs/operators';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Site } from '../core/shared/site.model';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
@Component({
|
||||
selector: 'ds-home-page',
|
||||
styleUrls: ['./home-page.component.scss'],
|
||||
@@ -12,10 +12,11 @@ import { Site } from '../core/shared/site.model';
|
||||
export class HomePageComponent implements OnInit {
|
||||
|
||||
site$: Observable<Site>;
|
||||
|
||||
recentSubmissionspageSize: number;
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
this.recentSubmissionspageSize = environment.homePage.recentSubmissions.pageSize;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@@ -43,11 +43,11 @@ export class RecentItemListComponent implements OnInit {
|
||||
|
||||
this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'hp',
|
||||
pageSize: environment.homePage.recentSubmissionsRpp,
|
||||
pageSize: environment.homePage.recentSubmissions.pageSize,
|
||||
currentPage: 1,
|
||||
maxSize: 1
|
||||
});
|
||||
this.sortConfig = new SortOptions(environment.homePage.recentSubmissionsSortField, SortDirection.DESC);
|
||||
this.sortConfig = new SortOptions(environment.homePage.recentSubmissions.sortField, SortDirection.DESC);
|
||||
}
|
||||
ngOnInit(): void {
|
||||
this.itemRD$ = this.searchService.search(
|
||||
@@ -62,7 +62,7 @@ export class RecentItemListComponent implements OnInit {
|
||||
}
|
||||
onLoadMore(): void {
|
||||
this.paginationService.updateRouteWithUrl(this.searchConfigurationService.paginationID, ['search'], {
|
||||
sortField: environment.homePage.recentSubmissionsSortField,
|
||||
sortField: environment.homePage.recentSubmissions.sortField,
|
||||
sortDirection: 'DESC' as SortDirection,
|
||||
page: 1
|
||||
});
|
||||
|
@@ -340,9 +340,11 @@ export class DefaultAppConfig implements AppConfig {
|
||||
};
|
||||
// Home Pages
|
||||
homePage: HomeConfig = {
|
||||
recentSubmissions: {
|
||||
//The number of item showing in recent submission components
|
||||
recentSubmissionsRpp: 5,
|
||||
pageSize: 5,
|
||||
//sort record of recent submission
|
||||
recentSubmissionsSortField: 'dc.date.accessioned',
|
||||
sortField: 'dc.date.accessioned',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -4,14 +4,17 @@ import { Config } from './config.interface';
|
||||
* Config that determines how the dropdown list of years are created for browse-by-date components
|
||||
*/
|
||||
export interface HomeConfig extends Config {
|
||||
recentSubmissions: {
|
||||
/**
|
||||
* The number of item showing in recent submission components
|
||||
*/
|
||||
recentSubmissionsRpp: number;
|
||||
pageSize: number;
|
||||
|
||||
/**
|
||||
* sort record of recent submission
|
||||
*/
|
||||
recentSubmissionsSortField: string;
|
||||
sortField: string;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -250,9 +250,10 @@ export const environment: BuildConfig = {
|
||||
},
|
||||
//Home Page
|
||||
homePage: {
|
||||
//The number of item showing in recent submission components
|
||||
recentSubmissionsRpp: 5,
|
||||
recentSubmissions: {
|
||||
pageSize: 5,
|
||||
//sort record of recent submission
|
||||
recentSubmissionsSortField: 'dc.date.accessioned',
|
||||
sortField: 'dc.date.accessioned',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user