Skip to content

Commit

Permalink
fix(admin-ui): Fix errors caused by lists greater than 1000 items
Browse files Browse the repository at this point in the history
Fixes #807
  • Loading branch information
michaelbromley committed Apr 2, 2021
1 parent ec59bda commit 5844715
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CollectionListComponent implements OnInit, OnDestroy {
) {}

ngOnInit() {
this.queryResult = this.dataService.collection.getCollections(99999, 0).refetchOnChannelChange();
this.queryResult = this.dataService.collection.getCollections(1000, 0).refetchOnChannelChange();
this.items$ = this.queryResult.mapStream(data => data.collections.items).pipe(shareReplay(1));
this.activeCollectionId$ = this.route.paramMap.pipe(
map(pm => pm.get('contents')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class VariantPriceDetailComponent implements OnInit, OnChanges {

ngOnInit() {
const taxRates$ = this.dataService.settings
.getTaxRates(99999, 0, 'cache-first')
.getTaxRates(999, 0, 'cache-first')
.mapStream(data => data.taxRates.items);
const activeChannel$ = this.dataService.settings
.getActiveChannel('cache-first')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class AddCountryToZoneDialogComponent implements Dialog<string[]>, OnInit
ngOnInit(): void {
const currentMemberIds = this.currentMembers.map(m => m.id);
this.availableCountries$ = this.dataService.settings
.getCountries(99999)
.getCountries(999)
.mapStream(data => data.countries.items)
.pipe(map(countries => countries.filter(c => !currentMemberIds.includes(c.id))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class AdminDetailComponent
ngOnInit() {
this.init();
this.administrator$ = this.entity$;
this.allRoles$ = this.dataService.administrator.getRoles(99999).mapStream(item => item.roles.items);
this.allRoles$ = this.dataService.administrator.getRoles(999).mapStream(item => item.roles.items);
this.dataService.client.userStatus().single$.subscribe(({ userStatus }) => {
if (!userStatus.permissions.includes(Permission.UpdateAdministrator)) {
const rolesSelect = this.detailForm.get('roles');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class CountryListComponent implements OnInit, OnDestroy {
ngOnInit() {
const countries$ = this.searchTerm.valueChanges.pipe(
startWith(null),
switchMap(term => this.dataService.settings.getCountries(9999, 0, term).stream$),
switchMap(term => this.dataService.settings.getCountries(999, 0, term).stream$),
tap(data => (this.countries = data.countries.items)),
map(data => data.countries.items),
);
Expand Down Expand Up @@ -76,7 +76,7 @@ export class CountryListComponent implements OnInit, OnDestroy {
this.notificationService.success(_('common.notify-delete-success'), {
entity: 'Country',
});
this.dataService.settings.getCountries(9999, 0).single$.subscribe();
this.dataService.settings.getCountries(999, 0).single$.subscribe();
} else {
this.notificationService.error(response.deleteCountry.message || '');
}
Expand Down

0 comments on commit 5844715

Please sign in to comment.