diff --git a/packages/data/src/lib/entry-actionbar/entry-actionbar.component.ts b/packages/data/src/lib/entry-actionbar/entry-actionbar.component.ts index ee06b9794..8b6197b84 100644 --- a/packages/data/src/lib/entry-actionbar/entry-actionbar.component.ts +++ b/packages/data/src/lib/entry-actionbar/entry-actionbar.component.ts @@ -87,9 +87,34 @@ export class EntryActionbarComponent extends ActionbarComponent implements OnIni select: false, action: () => this.loadModelActions(), }); + const nextPageAction = this.getNextPageAction(entryList); + if (nextPageAction) { + entryActions.push(nextPageAction); + } this.loadActions(entryActions); } + getNextPageAction(entryList) { + if (entryList.hasNextLink()) { + return { + id: 'load-next-page', + title: 'Load More...', + select: false, + action: async () => { + const nextPage = await entryList.followNextLink(); + const entryActions: any[] = nextPage.getAllItems().map((entry) => this.getEntryAction(entry)); + const allActions = (this.currentActions() || []).filter(a => a.id !== 'load-next-page').concat(entryActions); + const nextPageAction = this.getNextPageAction(nextPage); + if (nextPageAction) { + allActions.push(nextPageAction); + } + this.loadActions(allActions); + + } + }; + } + } + writeValue(value) { if (!value) { value = []; diff --git a/packages/ui/src/lib/actionbar/actionbar.component.ts b/packages/ui/src/lib/actionbar/actionbar.component.ts index 79bb53a20..239beae0a 100644 --- a/packages/ui/src/lib/actionbar/actionbar.component.ts +++ b/packages/ui/src/lib/actionbar/actionbar.component.ts @@ -14,7 +14,7 @@ export interface Action { action?: ActionFunction; } -export interface ActionbarConfig extends ListConfig {} +export interface ActionbarConfig extends ListConfig { } @Component({ selector: 'ec-actionbar', @@ -44,7 +44,7 @@ export class ActionbarComponent extends SelectComponent implements OnIni if (item.getBody().children) { this.loadActions(item.getBody().children); } - this.searchbar.clear(); + // this.searchbar.clear(); }); this.remove.subscribe((item) => { this.selection.remove(item); @@ -89,7 +89,10 @@ export class ActionbarComponent extends SelectComponent implements OnIni if (addToStack) { this.actionStack[this.currentID()] = actions; } - this.list = new List(resolved, this.config); + this.list = new List(resolved, { size: 1000, ...this.config }); + if (resolved.length > this.list.config) { + console.warn('actions exceed list size...'); + } if (!this.selection) { this.initSelection(); }