This commit is contained in:
JesmoDev
2024-05-07 11:36:35 +02:00
parent 51f7b6bee9
commit 8bbb95c4df

View File

@@ -16,12 +16,8 @@ export class UmbMemberWorkspaceViewMemberInfoElement extends UmbLitElement imple
@state()
private _memberTypeIcon = '';
private _workspaceContext?: typeof UMB_MEMBER_WORKSPACE_CONTEXT.TYPE;
private _memberTypeItemRepository: UmbMemberTypeItemRepository = new UmbMemberTypeItemRepository(this);
@state()
private _editMemberTypePath = '';
@state()
private _createDate = 'Unknown';
@state()
@@ -30,6 +26,9 @@ export class UmbMemberWorkspaceViewMemberInfoElement extends UmbLitElement imple
@state()
private _unique = '';
#workspaceContext?: typeof UMB_MEMBER_WORKSPACE_CONTEXT.TYPE;
#memberTypeItemRepository: UmbMemberTypeItemRepository = new UmbMemberTypeItemRepository(this);
constructor() {
super();
@@ -43,13 +42,13 @@ export class UmbMemberWorkspaceViewMemberInfoElement extends UmbLitElement imple
});
this.consumeContext(UMB_MEMBER_WORKSPACE_CONTEXT, async (context) => {
this._workspaceContext = context;
this.observe(this._workspaceContext.contentTypeUnique, (unique) => (this._memberTypeUnique = unique || ''));
this.observe(this._workspaceContext.createDate, (date) => (this._createDate = date || 'Unknown'));
this.observe(this._workspaceContext.updateDate, (date) => (this._updateDate = date || 'Unknown'));
this.observe(this._workspaceContext.unique, (unique) => (this._unique = unique || ''));
this.#workspaceContext = context;
this.observe(this.#workspaceContext.contentTypeUnique, (unique) => (this._memberTypeUnique = unique || ''));
this.observe(this.#workspaceContext.createDate, (date) => (this._createDate = date || 'Unknown'));
this.observe(this.#workspaceContext.updateDate, (date) => (this._updateDate = date || 'Unknown'));
this.observe(this.#workspaceContext.unique, (unique) => (this._unique = unique || ''));
const memberType = (await this._memberTypeItemRepository.requestItems([this._memberTypeUnique])).data?.[0];
const memberType = (await this.#memberTypeItemRepository.requestItems([this._memberTypeUnique])).data?.[0];
if (!memberType) return;
this._memberTypeName = memberType.name;
this._memberTypeIcon = memberType.icon;