added user linking to table

This commit is contained in:
Jesper Møller Jensen
2022-09-21 15:40:26 +02:00
parent f6654595e5
commit 7e563880e9
3 changed files with 31 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ export class UmbEditorViewUsersGridElement extends UmbContextConsumerMixin(LitEl
//TODO How should we handle url stuff?
private _handleOpenCard(key: string) {
history.pushState(null, '', window.location.pathname + '/' + key);
history.pushState(null, '', location.pathname + '/' + key);
}
private _selectRowHandler(user: UserItem) {

View File

@@ -134,12 +134,13 @@ export class UmbEditorViewUsersListElement extends UmbContextConsumerMixin(LitEl
<div id="sticky-top">
<div id="user-list-top-bar">
<uui-button label="Invite user" look="outline"></uui-button>
<uui-input id="input-search"></uui-input>
<uui-input label="search" id="input-search"></uui-input>
<div>
<uui-button> Status: <b>All</b> </uui-button>
<uui-button> Groups: <b>All</b> </uui-button>
<uui-button> Order by: <b>Name (A-Z)</b> </uui-button>
<uui-button label="status"> Status: <b>All</b> </uui-button>
<uui-button label="groups"> Groups: <b>All</b> </uui-button>
<uui-button label="order by"> Order by: <b>Name (A-Z)</b> </uui-button>
<uui-button
label="view toggle"
@click=${this._toggleViewType}
look="${this._viewType === 'grid' ? 'outline' : 'primary'}"
compact>

View File

@@ -46,6 +46,14 @@ export class UmbEditorViewUsersTableElement extends UmbContextConsumerMixin(LitE
justify-content: space-between;
width: 100%;
}
.link-button {
font-weight: bold;
color: var(--uui-color-interactive);
}
.link-button:hover {
text-decoration: underline;
color: var(--uui-color-interactive-emphasis);
}
`,
];
@@ -138,6 +146,12 @@ export class UmbEditorViewUsersTableElement extends UmbContextConsumerMixin(LitE
console.log('SELECT ALL NOT IMPLEMENTED');
}
//TODO How should we handle url stuff?
private _handleOpenUser(event: Event, key: string) {
event.stopImmediatePropagation();
history.pushState(null, '', location.pathname + '/' + key);
}
private _selectRowHandler(user: UserItem) {
this._usersContext?.select(user.key);
}
@@ -186,7 +200,17 @@ export class UmbEditorViewUsersTableElement extends UmbContextConsumerMixin(LitE
</uui-table-cell>
<uui-table-cell>
<div style="display: flex; align-items: center;">
<a style="font-weight: bold;" href="http://">${user.name}</a>
<div
class="link-button"
@keydown=${(e: KeyboardEvent) => {
if (e.key === 'Enter') {
this._handleOpenUser(e, user.key);
}
}}
@click=${(e: Event) => this._handleOpenUser(e, user.key)}
href=${location.pathname + '/' + user.key}>
${user.name}
</div>
</div>
</uui-table-cell>
<uui-table-cell> ${user.userGroup} </uui-table-cell>