Skip to content

Commit a5f19fb

Browse files
committed
Use MAX_PAGE_SIZE for the license lookups too
Three CLARIN license components already asked for exactly 1000, so they never triggered the warning - but leaving the bare literal next to a newly introduced MAX_PAGE_SIZE just invites the question why one place names the limit and the other repeats it. Same value, no behaviour change; the constant now says where the number comes from.
1 parent 93038c2 commit a5f19fb

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/app/clarin-licenses/clarin-all-licenses-page/clarin-all-licenses-page.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BehaviorSubject } from 'rxjs';
33
import { ClarinLicense } from '../../core/shared/clarin/clarin-license.model';
44
import { ClarinLicenseDataService } from '../../core/data/clarin/clarin-license-data.service';
55
import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators';
6-
import { FindListOptions } from '../../core/data/find-list-options.model';
6+
import { FindListOptions, MAX_PAGE_SIZE } from '../../core/data/find-list-options.model';
77
import { ClarinLicenseRequiredInfo } from '../../core/shared/clarin/clarin-license.resource-type';
88
import { ClarinLicenseRequiredInfoSerializer } from '../../core/shared/clarin/clarin-license-required-info-serializer';
99

@@ -36,7 +36,7 @@ export class ClarinAllLicensesPageComponent implements OnInit {
3636
const options = new FindListOptions();
3737
options.currentPage = 0;
3838
// Load all licenses
39-
options.elementsPerPage = 1000;
39+
options.elementsPerPage = MAX_PAGE_SIZE;
4040
return this.clarinLicenseService.findAll(options, false)
4141
.pipe(getFirstSucceededRemoteListPayload())
4242
.subscribe(res => {

src/app/item-page/edit-item-page/item-license-mapper/item-license-mapper.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ClarinLicenseDataService } from '../../../core/data/clarin/clarin-licen
88
import { getFirstCompletedRemoteData, getFirstSucceededRemoteListPayload } from '../../../core/shared/operators';
99
import { PaginatedList } from '../../../core/data/paginated-list.model';
1010
import { ClarinLicense } from '../../../core/shared/clarin/clarin-license.model';
11-
import { FindListOptions } from '../../../core/data/find-list-options.model';
11+
import { FindListOptions, MAX_PAGE_SIZE } from '../../../core/data/find-list-options.model';
1212
import { PutRequest } from '../../../core/data/request.models';
1313
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
1414
import { RequestService } from '../../../core/data/request.service';
@@ -90,7 +90,7 @@ export class ItemLicenseMapperComponent implements OnInit {
9090
const options = new FindListOptions();
9191
options.currentPage = 0;
9292
// Load all licenses
93-
options.elementsPerPage = 1000;
93+
options.elementsPerPage = MAX_PAGE_SIZE;
9494

9595
this.clarinLicenseService.findAll(options, false)
9696
.pipe(

src/app/submission/sections/clarin-license-resource/section-license.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { TranslateService } from '@ngx-translate/core';
3535
import { FindListOptions } from 'src/app/core/data/find-list-options.model';
3636
import { hasFailed } from 'src/app/core/data/request-entry-state.model';
3737
import {RequestParam} from '../../../core/cache/models/request-param.model';
38+
import { MAX_PAGE_SIZE } from '../../../core/data/find-list-options.model';
3839

3940
/**
4041
* This component render resource license step in the submission workflow.
@@ -551,7 +552,7 @@ export class SubmissionSectionClarinLicenseComponent extends SectionModelCompone
551552
const options = new FindListOptions();
552553
options.currentPage = 0;
553554
// Load all licenses
554-
options.elementsPerPage = 1000;
555+
options.elementsPerPage = MAX_PAGE_SIZE;
555556
return this.clarinLicenseService.findAll(options, false)
556557
.pipe(getFirstSucceededRemoteListPayload())
557558
.toPromise();

0 commit comments

Comments
 (0)