Document Collection code tidy-up

This commit is contained in:
leekelleher
2024-02-14 12:39:35 +00:00
parent 2f81263593
commit e3656d8cac
3 changed files with 6 additions and 9 deletions

View File

@@ -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',

View File

@@ -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;

View File

@@ -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 } };
}