web: full web components part 1 (#4964)

* migrate loading

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

* migrate api browser

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

* migrate base css

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

* move tenant fetching to base interface

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

* import pre-loaded stages in flow interface and not executor to strip down executor size

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

* fix redirect and such

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

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-03-17 23:10:19 +01:00
committed by GitHub
parent bebf18f257
commit e2d3a95c80
23 changed files with 251 additions and 211 deletions

View File

@ -1,4 +1,4 @@
import { DEFAULT_CONFIG, tenant } from "@goauthentik/common/api/config";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import {
EVENT_API_DRAWER_TOGGLE,
EVENT_NOTIFICATION_DRAWER_TOGGLE,
@ -36,7 +36,7 @@ import PFPage from "@patternfly/patternfly/components/Page/page.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFDisplay from "@patternfly/patternfly/utilities/Display/display.css";
import { CurrentTenant, EventsApi, SessionUser } from "@goauthentik/api";
import { EventsApi, SessionUser } from "@goauthentik/api";
autoDetectLanguage();
@ -50,9 +50,6 @@ export class UserInterface extends Interface {
ws: WebsocketClient;
@property({ attribute: false })
tenant: CurrentTenant = DefaultTenant;
@property({ type: Number })
notificationsCount = 0;
@ -128,7 +125,6 @@ export class UserInterface extends Interface {
}
async firstUpdated(): Promise<void> {
this.tenant = await tenant();
this.me = await me();
this.config = await uiConfig();
const notifications = await new EventsApi(DEFAULT_CONFIG).eventsNotificationsList({
@ -165,8 +161,8 @@ export class UserInterface extends Interface {
<a href="#/" class="pf-c-page__header-brand-link">
<img
class="pf-c-brand"
src="${first(this.tenant.brandingLogo, DefaultTenant.brandingLogo)}"
alt="${(this.tenant.brandingTitle, DefaultTenant.brandingTitle)}"
src="${first(this.tenant?.brandingLogo, DefaultTenant.brandingLogo)}"
alt="${(this.tenant?.brandingTitle, DefaultTenant.brandingTitle)}"
/>
</a>
</div>