web/admin: default to users path in sidebar link

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-07-02 22:53:16 +02:00
parent 5f4812e1d0
commit 2a2ae4bc4f
2 changed files with 7 additions and 2 deletions

View File

@ -123,7 +123,8 @@ export class SidebarItem extends LitElement {
return false; return false;
} }
if (this.path) { if (this.path) {
if (new RegExp(`^${this.path}$`).exec(path)) { const ourPath = this.path.split(";")[0];
if (new RegExp(`^${ourPath}$`).exec(path)) {
return true; return true;
} }
} }

View File

@ -267,7 +267,11 @@ export class AdminInterface extends LitElement {
<ak-sidebar-item> <ak-sidebar-item>
<span slot="label">${t`Directory`}</span> <span slot="label">${t`Directory`}</span>
<ak-sidebar-item <ak-sidebar-item
path="/identity/users" path=${`/identity/users;${encodeURIComponent(
JSON.stringify({
path: "users",
}),
)}`}
.activeWhen=${[`^/identity/users/(?<id>${ID_REGEX})$`]} .activeWhen=${[`^/identity/users/(?<id>${ID_REGEX})$`]}
> >
<span slot="label">${t`Users`}</span> <span slot="label">${t`Users`}</span>