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
|
enablePrivacyStatement: true
|
||||||
# Home Page
|
# Home Page
|
||||||
homePage:
|
homePage:
|
||||||
|
recentSubmissions:
|
||||||
# The number of item showing in recent submission components
|
# The number of item showing in recent submission components
|
||||||
recentSubmissionsRpp: 5
|
pageSize: 5
|
||||||
# Sort record of recent submission
|
# Sort record of recent submission
|
||||||
recentSubmissionsSortField: 'dc.date.accessioned'
|
sortField: 'dc.date.accessioned'
|
||||||
|
@@ -5,5 +5,5 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
<ds-search-form [inPlaceSearch]="false" [searchPlaceholder]="'home.search-form.placeholder' | translate"></ds-search-form>
|
<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-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>
|
</div>
|
||||||
|
@@ -3,7 +3,7 @@ import { map } from 'rxjs/operators';
|
|||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Site } from '../core/shared/site.model';
|
import { Site } from '../core/shared/site.model';
|
||||||
|
import { environment } from '../../environments/environment';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-home-page',
|
selector: 'ds-home-page',
|
||||||
styleUrls: ['./home-page.component.scss'],
|
styleUrls: ['./home-page.component.scss'],
|
||||||
@@ -12,10 +12,11 @@ import { Site } from '../core/shared/site.model';
|
|||||||
export class HomePageComponent implements OnInit {
|
export class HomePageComponent implements OnInit {
|
||||||
|
|
||||||
site$: Observable<Site>;
|
site$: Observable<Site>;
|
||||||
|
recentSubmissionspageSize: number;
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
) {
|
) {
|
||||||
|
this.recentSubmissionspageSize = environment.homePage.recentSubmissions.pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@@ -43,11 +43,11 @@ export class RecentItemListComponent implements OnInit {
|
|||||||
|
|
||||||
this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
|
this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'hp',
|
id: 'hp',
|
||||||
pageSize: environment.homePage.recentSubmissionsRpp,
|
pageSize: environment.homePage.recentSubmissions.pageSize,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
maxSize: 1
|
maxSize: 1
|
||||||
});
|
});
|
||||||
this.sortConfig = new SortOptions(environment.homePage.recentSubmissionsSortField, SortDirection.DESC);
|
this.sortConfig = new SortOptions(environment.homePage.recentSubmissions.sortField, SortDirection.DESC);
|
||||||
}
|
}
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.itemRD$ = this.searchService.search(
|
this.itemRD$ = this.searchService.search(
|
||||||
@@ -62,7 +62,7 @@ export class RecentItemListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
onLoadMore(): void {
|
onLoadMore(): void {
|
||||||
this.paginationService.updateRouteWithUrl(this.searchConfigurationService.paginationID, ['search'], {
|
this.paginationService.updateRouteWithUrl(this.searchConfigurationService.paginationID, ['search'], {
|
||||||
sortField: environment.homePage.recentSubmissionsSortField,
|
sortField: environment.homePage.recentSubmissions.sortField,
|
||||||
sortDirection: 'DESC' as SortDirection,
|
sortDirection: 'DESC' as SortDirection,
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
|
@@ -340,9 +340,11 @@ export class DefaultAppConfig implements AppConfig {
|
|||||||
};
|
};
|
||||||
// Home Pages
|
// Home Pages
|
||||||
homePage: HomeConfig = {
|
homePage: HomeConfig = {
|
||||||
//The number of item showing in recent submission components
|
recentSubmissions: {
|
||||||
recentSubmissionsRpp: 5,
|
//The number of item showing in recent submission components
|
||||||
//sort record of recent submission
|
pageSize: 5,
|
||||||
recentSubmissionsSortField: 'dc.date.accessioned',
|
//sort record of recent submission
|
||||||
|
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
|
* Config that determines how the dropdown list of years are created for browse-by-date components
|
||||||
*/
|
*/
|
||||||
export interface HomeConfig extends Config {
|
export interface HomeConfig extends Config {
|
||||||
/**
|
recentSubmissions: {
|
||||||
|
/**
|
||||||
* The number of item showing in recent submission components
|
* The number of item showing in recent submission components
|
||||||
*/
|
*/
|
||||||
recentSubmissionsRpp: number;
|
pageSize: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sort record of recent submission
|
||||||
|
*/
|
||||||
|
sortField: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* sort record of recent submission
|
|
||||||
*/
|
|
||||||
recentSubmissionsSortField: string;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -250,9 +250,10 @@ export const environment: BuildConfig = {
|
|||||||
},
|
},
|
||||||
//Home Page
|
//Home Page
|
||||||
homePage: {
|
homePage: {
|
||||||
//The number of item showing in recent submission components
|
recentSubmissions: {
|
||||||
recentSubmissionsRpp: 5,
|
pageSize: 5,
|
||||||
//sort record of recent submission
|
//sort record of recent submission
|
||||||
recentSubmissionsSortField: 'dc.date.accessioned',
|
sortField: 'dc.date.accessioned',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user