collection is working

This commit is contained in:
Jesper Møller Jensen
2023-05-03 23:46:24 +12:00
parent 41949cf1e2
commit efe54b9e2e
2 changed files with 9 additions and 4 deletions

View File

@@ -62,10 +62,12 @@ export class UmbUserGroupCollectionViewElement extends UmbLitElement {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT_TOKEN, (instance) => {
this.#collectionContext = instance as UmbUserGroupCollectionContext;
this.#collectionContext = instance;
this.observe(this.#collectionContext.selection, (selection) => (this._selection = selection));
this.observe(this.#collectionContext.items, (items) => {
this._userGroups = items;
console.log('items', items);
this._createTableItems(items);
});
});

View File

@@ -1,5 +1,5 @@
import { UmbEntityData } from './entity.data';
import { UserGroupPresentationModel } from '@umbraco-cms/backoffice/backend-api';
import { PagedUserGroupPresentationModel, UserGroupPresentationModel } from '@umbraco-cms/backoffice/backend-api';
// Temp mocked database
class UmbUserGroupsData extends UmbEntityData<UserGroupPresentationModel> {
@@ -7,8 +7,11 @@ class UmbUserGroupsData extends UmbEntityData<UserGroupPresentationModel> {
super(data);
}
getAll() {
return this.data;
getAll(): PagedUserGroupPresentationModel {
return {
total: this.data.length,
items: this.data,
};
}
}