Skip to content

Commit fbcaaf5

Browse files
committed
Merge branch 'main' into collection-thumbnail-embed
2 parents 76416ff + c76bae7 commit fbcaaf5

12 files changed

Lines changed: 78 additions & 27 deletions

config/config.example.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ browseBy:
176176
defaultLowerLimit: 1900
177177
# If true, thumbnail images for items will be added to BOTH search and browse result lists.
178178
showThumbnails: true
179+
# The number of entries in a paginated browse results list.
180+
# Rounded to the nearest size in the list of selectable sizes on the
181+
# settings menu.
182+
pageSize: 20
179183

180184
communityList:
181185
# No. of communities to list per expansion (show more)

src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { map } from 'rxjs/operators';
1717
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
1818
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
1919
import { isValidDate } from '../../shared/date.util';
20-
import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface';
20+
import { AppConfig, APP_CONFIG } from '../../../config/app-config.interface';
2121

2222
@Component({
2323
selector: 'ds-browse-by-date-page',
@@ -43,7 +43,7 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent {
4343
protected router: Router,
4444
protected paginationService: PaginationService,
4545
protected cdRef: ChangeDetectorRef,
46-
@Inject(APP_CONFIG) protected appConfig: AppConfig) {
46+
@Inject(APP_CONFIG) public appConfig: AppConfig) {
4747
super(route, browseService, dsoService, paginationService, router, appConfig);
4848
}
4949

src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ describe('BrowseByMetadataPageComponent', () => {
4848
]
4949
});
5050

51-
const environmentUseThumbs = {
51+
const environmentMock = {
5252
browseBy: {
53-
showThumbnails: true
53+
showThumbnails: true,
54+
pageSize: 10
5455
}
5556
};
5657

@@ -109,7 +110,7 @@ describe('BrowseByMetadataPageComponent', () => {
109110
{ provide: DSpaceObjectDataService, useValue: mockDsoService },
110111
{ provide: PaginationService, useValue: paginationService },
111112
{ provide: Router, useValue: new RouterMock() },
112-
{ provide: APP_CONFIG, useValue: environmentUseThumbs }
113+
{ provide: APP_CONFIG, useValue: environmentMock }
113114
],
114115
schemas: [NO_ERRORS_SCHEMA]
115116
}).compileComponents();
@@ -161,7 +162,7 @@ describe('BrowseByMetadataPageComponent', () => {
161162
};
162163
const paginationOptions = Object.assign(new PaginationComponentOptions(), {
163164
currentPage: 5,
164-
pageSize: 10,
165+
pageSize: comp.appConfig.browseBy.pageSize,
165166
});
166167
const sortOptions = {
167168
direction: SortDirection.ASC,
@@ -192,7 +193,7 @@ describe('BrowseByMetadataPageComponent', () => {
192193
};
193194
const paginationOptions = Object.assign(new PaginationComponentOptions(), {
194195
currentPage: 5,
195-
pageSize: 10,
196+
pageSize: comp.appConfig.browseBy.pageSize,
196197
});
197198
const sortOptions = {
198199
direction: SortDirection.ASC,

src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export const BBM_PAGINATION_ID = 'bbm';
2727
templateUrl: './browse-by-metadata-page.component.html'
2828
})
2929
/**
30-
* Component for browsing (items) by metadata definition
31-
* A metadata definition (a.k.a. browse id) is a short term used to describe one or multiple metadata fields.
32-
* An example would be 'author' for 'dc.contributor.*'
30+
* Component for browsing (items) by metadata definition.
31+
* A metadata definition (a.k.a. browse id) is a short term used to describe one
32+
* or multiple metadata fields. An example would be 'author' for
33+
* 'dc.contributor.*'
3334
*/
3435
@rendersBrowseBy(BrowseByDataType.Metadata)
3536
export class BrowseByMetadataPageComponent implements OnInit {
@@ -52,11 +53,7 @@ export class BrowseByMetadataPageComponent implements OnInit {
5253
/**
5354
* The pagination config used to display the values
5455
*/
55-
paginationConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
56-
id: BBM_PAGINATION_ID,
57-
currentPage: 1,
58-
pageSize: 20
59-
});
56+
paginationConfig: PaginationComponentOptions;
6057

6158
/**
6259
* The pagination observable
@@ -122,9 +119,16 @@ export class BrowseByMetadataPageComponent implements OnInit {
122119
protected dsoService: DSpaceObjectDataService,
123120
protected paginationService: PaginationService,
124121
protected router: Router,
125-
@Inject(APP_CONFIG) protected appConfig: AppConfig) {
122+
@Inject(APP_CONFIG) public appConfig: AppConfig) {
123+
126124
this.fetchThumbnails = this.appConfig.browseBy.showThumbnails;
127-
}
125+
this.paginationConfig = Object.assign(new PaginationComponentOptions(), {
126+
id: BBM_PAGINATION_ID,
127+
currentPage: 1,
128+
pageSize: this.appConfig.browseBy.pageSize,
129+
});
130+
}
131+
128132

129133
ngOnInit(): void {
130134

src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { PaginationServiceStub } from '../../shared/testing/pagination-service.s
2323
import { APP_CONFIG } from '../../../config/app-config.interface';
2424
import { environment } from '../../../environments/environment';
2525

26+
2627
describe('BrowseByTitlePageComponent', () => {
2728
let comp: BrowseByTitlePageComponent;
2829
let fixture: ComponentFixture<BrowseByTitlePageComponent>;

src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { BrowseByDataType, rendersBrowseBy } from '../browse-by-switcher/browse-
1313
import { PaginationService } from '../../core/pagination/pagination.service';
1414
import { map } from 'rxjs/operators';
1515
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
16-
import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface';
16+
import { AppConfig, APP_CONFIG } from '../../../config/app-config.interface';
1717

1818
@Component({
1919
selector: 'ds-browse-by-title-page',
@@ -31,7 +31,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent {
3131
protected dsoService: DSpaceObjectDataService,
3232
protected paginationService: PaginationService,
3333
protected router: Router,
34-
@Inject(APP_CONFIG) protected appConfig: AppConfig) {
34+
@Inject(APP_CONFIG) public appConfig: AppConfig) {
3535
super(route, browseService, dsoService, paginationService, router, appConfig);
3636
}
3737

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* The contents of this file are subject to the license and copyright
3+
* detailed in the LICENSE and NOTICE files at the root of the source
4+
* tree and available online at
5+
*
6+
* http://www.dspace.org/license/
7+
*/
8+
import { SubmissionCcLicenseDataService } from './submission-cc-license-data.service';
9+
import { testFindAllDataImplementation } from '../data/base/find-all-data.spec';
10+
11+
describe('SubmissionCcLicenseDataService', () => {
12+
13+
describe('composition', () => {
14+
const initService = () => new SubmissionCcLicenseDataService(null, null, null, null);
15+
testFindAllDataImplementation(initService);
16+
});
17+
});

src/app/core/submission/submission-cc-license-data.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RequestService } from '../data/request.service';
66
import { SUBMISSION_CC_LICENSE } from './models/submission-cc-licence.resource-type';
77
import { SubmissionCcLicence } from './models/submission-cc-license.model';
88
import { BaseDataService } from '../data/base/base-data.service';
9-
import { FindAllData } from '../data/base/find-all-data';
9+
import {FindAllData, FindAllDataImpl} from '../data/base/find-all-data';
1010
import { FindListOptions } from '../data/find-list-options.model';
1111
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
1212
import { Observable } from 'rxjs';
@@ -19,6 +19,7 @@ import { dataService } from '../data/base/data-service.decorator';
1919
export class SubmissionCcLicenseDataService extends BaseDataService<SubmissionCcLicence> implements FindAllData<SubmissionCcLicence> {
2020

2121
protected linkPath = 'submissioncclicenses';
22+
private findAllData: FindAllData<SubmissionCcLicence>;
2223

2324
constructor(
2425
protected requestService: RequestService,
@@ -27,6 +28,8 @@ export class SubmissionCcLicenseDataService extends BaseDataService<SubmissionCc
2728
protected halService: HALEndpointService,
2829
) {
2930
super('submissioncclicenses', requestService, rdbService, objectCache, halService);
31+
32+
this.findAllData = new FindAllDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive);
3033
}
3134

3235
/**
@@ -44,6 +47,6 @@ export class SubmissionCcLicenseDataService extends BaseDataService<SubmissionCc
4447
* Return an observable that emits object list
4548
*/
4649
public findAll(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<SubmissionCcLicence>[]): Observable<RemoteData<PaginatedList<SubmissionCcLicence>>> {
47-
return undefined;
50+
return this.findAllData.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
4851
}
4952
}

src/assets/i18n/en.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,7 @@
12661266

12671267
"cookies.consent.purpose.statistical": "Statistical",
12681268

1269+
"curation-task.task.citationpage.label": "Generate Citation Page",
12691270

12701271
"curation-task.task.checklinks.label": "Check Links in Metadata",
12711272

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,38 @@
11
import { Config } from './config.interface';
22

33
/**
4-
* Config that determines how the dropdown list of years are created for browse-by-date components
4+
* Config that determines how the dropdown list of years are created for
5+
* browse-by-date components.
56
*/
67
export interface BrowseByConfig extends Config {
78
/**
8-
* The max amount of years to display using jumps of one year (current year - oneYearLimit)
9+
* The max amount of years to display using jumps of one year
10+
* (current year - oneYearLimit)
911
*/
1012
oneYearLimit: number;
1113

1214
/**
13-
* Limit for years to display using jumps of five years (current year - fiveYearLimit)
15+
* Limit for years to display using jumps of five years
16+
* (current year - fiveYearLimit)
1417
*/
1518
fiveYearLimit: number;
1619

1720
/**
18-
* The absolute lowest year to display in the dropdown when no lowest date can be found for all items
21+
* The absolute lowest year to display in the dropdown when no lowest date can
22+
* be found for all items.
1923
*/
2024
defaultLowerLimit: number;
2125

2226
/**
2327
* If true, thumbnail images for items will be added to BOTH search and browse result lists.
2428
*/
2529
showThumbnails: boolean;
30+
31+
/**
32+
* Number of entries in the viewport of a paginated browse-by list.
33+
* Rounded to the nearest size in the list of selectable sizes on the settings
34+
* menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
35+
*/
36+
pageSize: number;
37+
2638
}

0 commit comments

Comments
 (0)