Document Collection code tidy-up
This commit is contained in:
@@ -706,7 +706,7 @@ export const data: Array<UmbMockDataTypeModel> = [
|
||||
hasChildren: false,
|
||||
isFolder: false,
|
||||
values: [
|
||||
{ alias: 'pageSize', value: 5 },
|
||||
{ alias: 'pageSize', value: 2 },
|
||||
{ alias: 'orderDirection', value: 'desc' },
|
||||
{
|
||||
alias: 'includeProperties',
|
||||
|
||||
@@ -8,12 +8,6 @@ export class UmbDocumentCollectionElement extends UmbCollectionDefaultElement {
|
||||
protected renderToolbar() {
|
||||
return html`<umb-document-collection-toolbar slot="header"></umb-document-collection-toolbar>`;
|
||||
}
|
||||
|
||||
// TODO: [LK] How to wire up the `bulkActionPermissions` config with the `entityBulkAction` extension type matches?
|
||||
|
||||
protected renderSelectionActions() {
|
||||
return html`<umb-collection-selection-actions slot="footer-info"></umb-collection-selection-actions>`;
|
||||
}
|
||||
}
|
||||
|
||||
export default UmbDocumentCollectionElement;
|
||||
|
||||
@@ -19,9 +19,12 @@ export class UmbDocumentCollectionServerDataSource implements UmbCollectionDataS
|
||||
const { data, error } = await tryExecuteAndNotify(this.#host, DocumentResource.getTreeDocumentRoot(filter));
|
||||
|
||||
if (data) {
|
||||
const items = data.items.map((item) => this.#mapper(item));
|
||||
const skip = Number(filter.skip) ?? 0;
|
||||
const take = Number(filter.take) ?? 100;
|
||||
|
||||
console.log('UmbDocumentCollectionServerDataSource.getCollection', [data, items]);
|
||||
const items = data.items.slice(skip, skip + take).map((item) => this.#mapper(item));
|
||||
|
||||
//console.log('UmbDocumentCollectionServerDataSource.getCollection', [data, items]);
|
||||
|
||||
return { data: { items, total: data.total } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user