web/admin: more cleanup and consistency (#12657)

* web/admin: migrate user interface and stop impersonation to nav bar

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* move version diff to banner

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* make click on backdrop close about modal

just for you @rissson

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L.
2025-01-13 20:25:34 +01:00
committed by GitHub
parent 94eff50306
commit 2893a54ffb
8 changed files with 58 additions and 43 deletions

View File

@ -3,6 +3,7 @@ import {
EVENT_WS_MESSAGE,
TITLE_DEFAULT,
} from "@goauthentik/common/constants";
import { globalAK } from "@goauthentik/common/global";
import { currentInterface } from "@goauthentik/common/sentry";
import { UIConfig, UserDisplay, uiConfig } from "@goauthentik/common/ui/config";
import { me } from "@goauthentik/common/users";
@ -182,7 +183,15 @@ export class PageHeader extends WithBrandConfig(AKElement) {
</section>
<div class="pf-c-page__header-tools">
<div class="pf-c-page__header-tools-group">
<ak-nav-buttons .uiConfig=${this.uiConfig} .me=${this.me}></ak-nav-buttons>
<ak-nav-buttons .uiConfig=${this.uiConfig} .me=${this.me}>
<a
class="pf-c-button pf-m-secondary pf-m-small pf-u-display-none pf-u-display-block-on-md"
href="${globalAK().api.base}if/user/"
slot="extra"
>
${msg("User interface")}
</a>
</ak-nav-buttons>
</div>
</div>
</div>`;

View File

@ -0,0 +1,34 @@
import { VERSION } from "@goauthentik/common/constants";
import { AKElement } from "@goauthentik/elements/Base";
import { WithVersion } from "@goauthentik/elements/Interface/versionProvider";
import { msg, str } from "@lit/localize";
import { html, nothing } from "lit";
import { customElement } from "lit/decorators.js";
import PFBanner from "@patternfly/patternfly/components/Banner/banner.css";
@customElement("ak-version-banner")
export class VersionBanner extends WithVersion(AKElement) {
static get styles() {
return [PFBanner];
}
render() {
return this.version && this.version.versionCurrent !== VERSION
? html`
<div class="pf-c-banner pf-m-sticky pf-m-gold">
${msg(
str`A newer version (${this.version.versionCurrent}) of the UI is available.`,
)}
</div>
`
: nothing;
}
}
declare global {
interface HTMLElementTagNameMap {
"ak-version-banner": VersionBanner;
}
}