From 11334cf6384510e34c6e94c3cf35ea96bbf3eebb Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 6 Sep 2022 19:02:40 +0200 Subject: [PATCH] web: re-cleanup imports not being absolute Signed-off-by: Jens Langhammer --- web/src/api/Sentry.ts | 5 +-- web/src/api/Users.ts | 3 +- web/src/elements/EmptyState.ts | 4 +- web/src/elements/Tabs.ts | 3 +- web/src/elements/TreeView.ts | 3 +- web/src/elements/buttons/ActionButton.ts | 3 +- web/src/elements/buttons/TokenCopyButton.ts | 3 +- .../elements/cards/AggregatePromiseCard.ts | 3 +- web/src/elements/charts/AdminLoginsChart.ts | 3 +- web/src/elements/charts/AdminModelPerDay.ts | 3 +- .../charts/ApplicationAuthorizeChart.ts | 3 +- web/src/elements/charts/UserChart.ts | 3 +- web/src/elements/chips/ChipGroup.ts | 4 +- web/src/elements/forms/Form.ts | 3 +- .../elements/forms/HorizontalFormElement.ts | 3 +- web/src/elements/forms/ModalForm.ts | 3 +- web/src/elements/forms/ModelForm.ts | 3 +- web/src/elements/forms/ProxyForm.ts | 4 +- web/src/elements/router/RouterOutlet.ts | 5 +-- web/src/elements/table/TableModal.ts | 3 +- web/src/elements/table/TablePage.ts | 3 +- web/src/elements/wizard/ActionWizardPage.ts | 10 ++--- web/src/elements/wizard/FormWizardPage.ts | 3 +- web/src/elements/wizard/WizardFormPage.ts | 8 ++-- web/src/elements/wizard/WizardPage.ts | 6 +-- web/src/flows/FlowExecutor.ts | 3 +- web/src/flows/stages/RedirectStage.ts | 4 +- .../AuthenticatorValidateStageCode.ts | 3 +- .../AuthenticatorValidateStageDuo.ts | 3 +- .../AuthenticatorValidateStageWebAuthn.ts | 3 +- .../WebAuthnAuthenticatorRegisterStage.ts | 11 +++--- web/src/interfaces/locale.ts | 20 +++++----- .../admin-overview/cards/SystemStatusCard.ts | 6 ++- .../admin-overview/cards/VersionStatusCard.ts | 6 ++- .../admin-overview/cards/WorkerStatusCard.ts | 6 ++- .../applications/wizard/ApplicationWizard.ts | 30 +++++++------- .../wizard/InitialApplicationWizardPage.ts | 14 +++---- .../wizard/TypeApplicationWizardPage.ts | 6 +-- .../ldap/TypeLDAPApplicationWizardPage.ts | 10 ++--- .../link/TypeLinkApplicationWizardPage.ts | 8 ++-- .../TypeOAuthAPIApplicationWizardPage.ts | 8 ++-- .../oauth/TypeOAuthApplicationWizardPage.ts | 8 ++-- .../TypeOAuthCodeApplicationWizardPage.ts | 12 +++--- .../TypeOAuthImplicitApplicationWizardPage.ts | 6 +-- .../proxy/TypeProxyApplicationWizardPage.ts | 10 ++--- .../saml/TypeSAMLApplicationWizardPage.ts | 8 ++-- .../TypeSAMLConfigApplicationWizardPage.ts | 10 ++--- .../TypeSAMLImportApplicationWizardPage.ts | 10 ++--- web/src/pages/flows/FlowForm.ts | 3 +- web/src/pages/flows/FlowListPage.ts | 3 +- web/src/pages/stages/StageWizard.ts | 39 +++++++++---------- web/src/pages/users/UserForm.ts | 3 +- web/src/routesAdmin.ts | 3 +- web/src/routesUser.ts | 6 +-- web/src/user/LibraryPage.ts | 3 +- .../user/user-settings/UserSettingsPage.ts | 17 ++++---- .../user/user-settings/mfa/MFADevicesPage.ts | 3 +- web/src/utils.ts | 3 +- 58 files changed, 179 insertions(+), 206 deletions(-) diff --git a/web/src/api/Sentry.ts b/web/src/api/Sentry.ts index 420164da2..27dc924c8 100644 --- a/web/src/api/Sentry.ts +++ b/web/src/api/Sentry.ts @@ -1,3 +1,5 @@ +import { config } from "@goauthentik/web/api/Config"; +import { me } from "@goauthentik/web/api/Users"; import { SentryIgnoredError } from "@goauthentik/web/common/errors"; import { VERSION } from "@goauthentik/web/constants"; import * as Sentry from "@sentry/browser"; @@ -5,9 +7,6 @@ import { Integrations } from "@sentry/tracing"; import { Config, ResponseError } from "@goauthentik/api"; -import { config } from "./Config"; -import { me } from "./Users"; - export const TAG_SENTRY_COMPONENT = "authentik.component"; export const TAG_SENTRY_CAPABILITIES = "authentik.capabilities"; diff --git a/web/src/api/Users.ts b/web/src/api/Users.ts index add8cec97..bde307563 100644 --- a/web/src/api/Users.ts +++ b/web/src/api/Users.ts @@ -1,9 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { activateLocale } from "@goauthentik/web/interfaces/locale"; import { CoreApi, ResponseError, SessionUser } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "./Config"; - let globalMePromise: Promise | undefined; export function refreshMe(): Promise { diff --git a/web/src/elements/EmptyState.ts b/web/src/elements/EmptyState.ts index e385e06e1..4e3d32a21 100644 --- a/web/src/elements/EmptyState.ts +++ b/web/src/elements/EmptyState.ts @@ -1,3 +1,5 @@ +import { PFSize } from "@goauthentik/web/elements/Spinner"; + import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; @@ -6,8 +8,6 @@ import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-sta import PFTitle from "@patternfly/patternfly/components/Title/title.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { PFSize } from "./Spinner"; - @customElement("ak-empty-state") export class EmptyState extends LitElement { @property({ type: String }) diff --git a/web/src/elements/Tabs.ts b/web/src/elements/Tabs.ts index 36e790fb0..8d5602507 100644 --- a/web/src/elements/Tabs.ts +++ b/web/src/elements/Tabs.ts @@ -1,4 +1,5 @@ import { CURRENT_CLASS, EVENT_REFRESH, ROUTE_SEPARATOR } from "@goauthentik/web/constants"; +import { getURLParams, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; import { t } from "@lingui/macro"; @@ -10,8 +11,6 @@ import AKGlobal from "@goauthentik/web/authentik.css"; import PFTabs from "@patternfly/patternfly/components/Tabs/tabs.css"; import PFGlobal from "@patternfly/patternfly/patternfly-base.css"; -import { getURLParams, updateURLParams } from "./router/RouteMatch"; - @customElement("ak-tabs") export class Tabs extends LitElement { @property() diff --git a/web/src/elements/TreeView.ts b/web/src/elements/TreeView.ts index 27a1c9ab0..f1fadb586 100644 --- a/web/src/elements/TreeView.ts +++ b/web/src/elements/TreeView.ts @@ -1,4 +1,5 @@ import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { setURLParams } from "@goauthentik/web/elements/router/RouteMatch"; import { t } from "@lingui/macro"; @@ -9,8 +10,6 @@ import AKGlobal from "@goauthentik/web/authentik.css"; import PFTreeView from "@patternfly/patternfly/components/TreeView/tree-view.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { setURLParams } from "./router/RouteMatch"; - export interface TreeViewItem { id?: string; label: string; diff --git a/web/src/elements/buttons/ActionButton.ts b/web/src/elements/buttons/ActionButton.ts index 10807c583..aa21e50b2 100644 --- a/web/src/elements/buttons/ActionButton.ts +++ b/web/src/elements/buttons/ActionButton.ts @@ -1,10 +1,9 @@ +import { SpinnerButton } from "@goauthentik/web/elements/buttons/SpinnerButton"; import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; import { customElement, property } from "lit/decorators.js"; -import { SpinnerButton } from "./SpinnerButton"; - @customElement("ak-action-button") export class ActionButton extends SpinnerButton { @property({ attribute: false }) diff --git a/web/src/elements/buttons/TokenCopyButton.ts b/web/src/elements/buttons/TokenCopyButton.ts index 2f3a1b32e..08a1eb056 100644 --- a/web/src/elements/buttons/TokenCopyButton.ts +++ b/web/src/elements/buttons/TokenCopyButton.ts @@ -1,6 +1,7 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { ERROR_CLASS, SECONDARY_CLASS, SUCCESS_CLASS } from "@goauthentik/web/constants"; import { PFSize } from "@goauthentik/web/elements/Spinner"; +import { ActionButton } from "@goauthentik/web/elements/buttons/ActionButton"; import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; @@ -9,8 +10,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, ResponseError } from "@goauthentik/api"; -import { ActionButton } from "./ActionButton"; - @customElement("ak-token-copy-button") export class TokenCopyButton extends ActionButton { @property() diff --git a/web/src/elements/cards/AggregatePromiseCard.ts b/web/src/elements/cards/AggregatePromiseCard.ts index 98d8d1cdd..f70b61a03 100644 --- a/web/src/elements/cards/AggregatePromiseCard.ts +++ b/web/src/elements/cards/AggregatePromiseCard.ts @@ -1,12 +1,11 @@ import { PFSize } from "@goauthentik/web/elements/Spinner"; import "@goauthentik/web/elements/Spinner"; +import { AggregateCard } from "@goauthentik/web/elements/cards/AggregateCard"; import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import { AggregateCard } from "./AggregateCard"; - @customElement("ak-aggregate-card-promise") export class AggregatePromiseCard extends AggregateCard { @property({ attribute: false }) diff --git a/web/src/elements/charts/AdminLoginsChart.ts b/web/src/elements/charts/AdminLoginsChart.ts index 82912af17..258d27ff5 100644 --- a/web/src/elements/charts/AdminLoginsChart.ts +++ b/web/src/elements/charts/AdminLoginsChart.ts @@ -1,4 +1,5 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; import { ChartData } from "chart.js"; import { t } from "@lingui/macro"; @@ -7,8 +8,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi, LoginMetrics } from "@goauthentik/api"; -import { AKChart } from "./Chart"; - @customElement("ak-charts-admin-login") export class AdminLoginsChart extends AKChart { apiRequest(): Promise { diff --git a/web/src/elements/charts/AdminModelPerDay.ts b/web/src/elements/charts/AdminModelPerDay.ts index bfbcce6a3..7db6e8c71 100644 --- a/web/src/elements/charts/AdminModelPerDay.ts +++ b/web/src/elements/charts/AdminModelPerDay.ts @@ -1,4 +1,5 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; import { ChartData, Tick } from "chart.js"; import { t } from "@lingui/macro"; @@ -7,8 +8,6 @@ import { customElement, property } from "lit/decorators.js"; import { Coordinate, EventActions, EventsApi } from "@goauthentik/api"; -import { AKChart } from "./Chart"; - @customElement("ak-charts-admin-model-per-day") export class AdminModelPerDay extends AKChart { @property() diff --git a/web/src/elements/charts/ApplicationAuthorizeChart.ts b/web/src/elements/charts/ApplicationAuthorizeChart.ts index a907f908c..3870b7ecb 100644 --- a/web/src/elements/charts/ApplicationAuthorizeChart.ts +++ b/web/src/elements/charts/ApplicationAuthorizeChart.ts @@ -1,4 +1,5 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; import { ChartData } from "chart.js"; import { t } from "@lingui/macro"; @@ -7,8 +8,6 @@ import { customElement, property } from "lit/decorators.js"; import { Coordinate, CoreApi } from "@goauthentik/api"; -import { AKChart } from "./Chart"; - @customElement("ak-charts-application-authorize") export class ApplicationAuthorizeChart extends AKChart { @property() diff --git a/web/src/elements/charts/UserChart.ts b/web/src/elements/charts/UserChart.ts index 04889fd47..aa3762b24 100644 --- a/web/src/elements/charts/UserChart.ts +++ b/web/src/elements/charts/UserChart.ts @@ -1,4 +1,5 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; import { ChartData } from "chart.js"; import { t } from "@lingui/macro"; @@ -7,8 +8,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, UserMetrics } from "@goauthentik/api"; -import { AKChart } from "./Chart"; - @customElement("ak-charts-user") export class UserChart extends AKChart { @property({ type: Number }) diff --git a/web/src/elements/chips/ChipGroup.ts b/web/src/elements/chips/ChipGroup.ts index 8811deddb..f30435358 100644 --- a/web/src/elements/chips/ChipGroup.ts +++ b/web/src/elements/chips/ChipGroup.ts @@ -1,3 +1,5 @@ +import { Chip } from "@goauthentik/web/elements/chips/Chip"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; @@ -7,8 +9,6 @@ import PFChip from "@patternfly/patternfly/components/Chip/chip.css"; import PFChipGroup from "@patternfly/patternfly/components/ChipGroup/chip-group.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { Chip } from "./Chip"; - @customElement("ak-chip-group") export class ChipGroup extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/elements/forms/Form.ts b/web/src/elements/forms/Form.ts index 5ec5e168b..d4b9b7990 100644 --- a/web/src/elements/forms/Form.ts +++ b/web/src/elements/forms/Form.ts @@ -1,5 +1,6 @@ import { SearchSelect } from "@goauthentik/web/SearchSelect"; import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { HorizontalFormElement } from "@goauthentik/web/elements/forms/HorizontalFormElement"; import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; import { camelToSnake, convertToSlug } from "@goauthentik/web/utils"; @@ -21,8 +22,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { ResponseError, ValidationError } from "@goauthentik/api"; -import { HorizontalFormElement } from "./HorizontalFormElement"; - export class APIError extends Error { constructor(public response: ValidationError) { super(); diff --git a/web/src/elements/forms/HorizontalFormElement.ts b/web/src/elements/forms/HorizontalFormElement.ts index 01a02bec7..78de590ce 100644 --- a/web/src/elements/forms/HorizontalFormElement.ts +++ b/web/src/elements/forms/HorizontalFormElement.ts @@ -1,3 +1,4 @@ +import { FormGroup } from "@goauthentik/web/elements/forms/FormGroup"; import { convertToSlug } from "@goauthentik/web/utils"; import { t } from "@lingui/macro"; @@ -11,8 +12,6 @@ import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { FormGroup } from "./FormGroup"; - @customElement("ak-form-element-horizontal") export class HorizontalFormElement extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/elements/forms/ModalForm.ts b/web/src/elements/forms/ModalForm.ts index cca7c1486..6d5017a7a 100644 --- a/web/src/elements/forms/ModalForm.ts +++ b/web/src/elements/forms/ModalForm.ts @@ -2,14 +2,13 @@ import { EVENT_REFRESH } from "@goauthentik/web/constants"; import "@goauthentik/web/elements/LoadingOverlay"; import { ModalButton } from "@goauthentik/web/elements/buttons/ModalButton"; import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { Form } from "@goauthentik/web/elements/forms/Form"; import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import { Form } from "./Form"; - @customElement("ak-forms-modal") export class ModalForm extends ModalButton { @property({ type: Boolean }) diff --git a/web/src/elements/forms/ModelForm.ts b/web/src/elements/forms/ModelForm.ts index ca74503b8..7ba51ac1c 100644 --- a/web/src/elements/forms/ModelForm.ts +++ b/web/src/elements/forms/ModelForm.ts @@ -1,10 +1,9 @@ import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { Form } from "@goauthentik/web/elements/forms/Form"; import { TemplateResult } from "lit"; import { property } from "lit/decorators.js"; -import { Form } from "./Form"; - export abstract class ModelForm extends Form { abstract loadInstance(pk: PKT): Promise; diff --git a/web/src/elements/forms/ProxyForm.ts b/web/src/elements/forms/ProxyForm.ts index d12a0be21..5930e6b4e 100644 --- a/web/src/elements/forms/ProxyForm.ts +++ b/web/src/elements/forms/ProxyForm.ts @@ -1,8 +1,8 @@ +import { Form } from "@goauthentik/web/elements/forms/Form"; + import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import { Form } from "./Form"; - @customElement("ak-proxy-form") export class ProxyForm extends Form { @property() diff --git a/web/src/elements/router/RouterOutlet.ts b/web/src/elements/router/RouterOutlet.ts index aa1d1faa8..7e4d915b1 100644 --- a/web/src/elements/router/RouterOutlet.ts +++ b/web/src/elements/router/RouterOutlet.ts @@ -1,4 +1,6 @@ import { ROUTE_SEPARATOR } from "@goauthentik/web/constants"; +import { Route } from "@goauthentik/web/elements/router/Route"; +import { RouteMatch } from "@goauthentik/web/elements/router/RouteMatch"; import "@goauthentik/web/elements/router/Router404"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; @@ -6,9 +8,6 @@ import { customElement, property } from "lit/decorators.js"; import AKGlobal from "@goauthentik/web/authentik.css"; -import { Route } from "./Route"; -import { RouteMatch } from "./RouteMatch"; - // Poliyfill for hashchange.newURL, // https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange window.addEventListener("load", () => { diff --git a/web/src/elements/table/TableModal.ts b/web/src/elements/table/TableModal.ts index a776577c1..4625e2396 100644 --- a/web/src/elements/table/TableModal.ts +++ b/web/src/elements/table/TableModal.ts @@ -1,5 +1,6 @@ import { PFSize } from "@goauthentik/web/elements/Spinner"; import { MODAL_BUTTON_STYLES } from "@goauthentik/web/elements/buttons/ModalButton"; +import { Table } from "@goauthentik/web/elements/table/Table"; import { CSSResult, LitElement } from "lit"; import { TemplateResult, html } from "lit"; @@ -13,8 +14,6 @@ import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFBullseye from "@patternfly/patternfly/layouts/Bullseye/bullseye.css"; import PFStack from "@patternfly/patternfly/layouts/Stack/stack.css"; -import { Table } from "./Table"; - export abstract class TableModal extends Table { @property() size: PFSize = PFSize.Large; diff --git a/web/src/elements/table/TablePage.ts b/web/src/elements/table/TablePage.ts index c5e48b393..104241506 100644 --- a/web/src/elements/table/TablePage.ts +++ b/web/src/elements/table/TablePage.ts @@ -1,5 +1,6 @@ import "@goauthentik/web/elements/../elements/PageHeader"; import { updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import { Table } from "@goauthentik/web/elements/table/Table"; import { t } from "@lingui/macro"; @@ -11,8 +12,6 @@ import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFSidebar from "@patternfly/patternfly/components/Sidebar/sidebar.css"; -import { Table } from "./Table"; - export abstract class TablePage extends Table { abstract pageTitle(): string; abstract pageDescription(): string | undefined; diff --git a/web/src/elements/wizard/ActionWizardPage.ts b/web/src/elements/wizard/ActionWizardPage.ts index dfeeae051..9e4538b83 100644 --- a/web/src/elements/wizard/ActionWizardPage.ts +++ b/web/src/elements/wizard/ActionWizardPage.ts @@ -1,9 +1,13 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { WizardAction } from "@goauthentik/web/elements/wizard/Wizard"; +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css"; import PFProgressStepper from "@patternfly/patternfly/components/ProgressStepper/progress-stepper.css"; import PFTitle from "@patternfly/patternfly/components/Title/title.css"; @@ -12,10 +16,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { ResponseError } from "@goauthentik/api"; -import { EVENT_REFRESH } from "../../constants"; -import { WizardAction } from "./Wizard"; -import { WizardPage } from "./WizardPage"; - export enum ActionState { pending = "pending", running = "running", diff --git a/web/src/elements/wizard/FormWizardPage.ts b/web/src/elements/wizard/FormWizardPage.ts index a694f0610..8b65eace1 100644 --- a/web/src/elements/wizard/FormWizardPage.ts +++ b/web/src/elements/wizard/FormWizardPage.ts @@ -1,11 +1,10 @@ import { Form } from "@goauthentik/web/elements/forms/Form"; +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; import { t } from "@lingui/macro"; import { customElement } from "lit/decorators.js"; -import { WizardPage } from "./WizardPage"; - /** * This Wizard page is used for proxy forms with the older-style * wizards diff --git a/web/src/elements/wizard/WizardFormPage.ts b/web/src/elements/wizard/WizardFormPage.ts index 5da35439d..bdf76b1b0 100644 --- a/web/src/elements/wizard/WizardFormPage.ts +++ b/web/src/elements/wizard/WizardFormPage.ts @@ -1,7 +1,10 @@ +import { Form, KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; + import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFAlert from "@patternfly/patternfly/components/Alert/alert.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -10,9 +13,6 @@ import PFFormControl from "@patternfly/patternfly/components/FormControl/form-co import PFInputGroup from "@patternfly/patternfly/components/InputGroup/input-group.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { Form, KeyUnknown } from "../forms/Form"; -import { WizardPage } from "./WizardPage"; - @customElement("ak-wizard-form") export class WizardForm extends Form { viewportCheck = false; diff --git a/web/src/elements/wizard/WizardPage.ts b/web/src/elements/wizard/WizardPage.ts index ef437517e..c71039fc2 100644 --- a/web/src/elements/wizard/WizardPage.ts +++ b/web/src/elements/wizard/WizardPage.ts @@ -1,11 +1,11 @@ +import { Wizard } from "@goauthentik/web/elements/wizard/Wizard"; + import { CSSResult, LitElement, PropertyDeclaration, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { Wizard } from "./Wizard"; - @customElement("ak-wizard-page") export class WizardPage extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/flows/FlowExecutor.ts b/web/src/flows/FlowExecutor.ts index 009bd7052..ea11ab8bf 100644 --- a/web/src/flows/FlowExecutor.ts +++ b/web/src/flows/FlowExecutor.ts @@ -12,6 +12,7 @@ import "@goauthentik/web/flows/stages/access_denied/AccessDeniedStage"; import "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStage"; import "@goauthentik/web/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage"; import "@goauthentik/web/flows/stages/autosubmit/AutosubmitStage"; +import { StageHost } from "@goauthentik/web/flows/stages/base"; import "@goauthentik/web/flows/stages/captcha/CaptchaStage"; import "@goauthentik/web/flows/stages/identification/IdentificationStage"; import "@goauthentik/web/flows/stages/password/PasswordStage"; @@ -45,8 +46,6 @@ import { ShellChallenge, } from "@goauthentik/api"; -import { StageHost } from "./stages/base"; - @customElement("ak-flow-executor") export class FlowExecutor extends LitElement implements StageHost { flowSlug?: string; diff --git a/web/src/flows/stages/RedirectStage.ts b/web/src/flows/stages/RedirectStage.ts index 600244699..dd5c483f6 100644 --- a/web/src/flows/stages/RedirectStage.ts +++ b/web/src/flows/stages/RedirectStage.ts @@ -1,3 +1,5 @@ +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -13,8 +15,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { FlowChallengeResponseRequest, RedirectChallenge } from "@goauthentik/api"; -import { BaseStage } from "./base"; - @customElement("ak-stage-redirect") export class RedirectStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts index 0cdf724ca..612691146 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts @@ -1,6 +1,7 @@ import "@goauthentik/web/elements/EmptyState"; import "@goauthentik/web/elements/forms/FormElement"; import "@goauthentik/web/flows/FormStatic"; +import { AuthenticatorValidateStage } from "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStage"; import { BaseStage } from "@goauthentik/web/flows/stages/base"; import { PasswordManagerPrefill } from "@goauthentik/web/flows/stages/identification/IdentificationStage"; @@ -25,8 +26,6 @@ import { DeviceClassesEnum, } from "@goauthentik/api"; -import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage"; - @customElement("ak-stage-authenticator-validate-code") export class AuthenticatorValidateStageWebCode extends BaseStage< AuthenticatorValidationChallenge, diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts index 024aeafdf..a457b5ac0 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts @@ -1,6 +1,7 @@ import "@goauthentik/web/elements/EmptyState"; import "@goauthentik/web/elements/forms/FormElement"; import "@goauthentik/web/flows/FormStatic"; +import { AuthenticatorValidateStage } from "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStage"; import { BaseStage } from "@goauthentik/web/flows/stages/base"; import { t } from "@lingui/macro"; @@ -23,8 +24,6 @@ import { DeviceChallenge, } from "@goauthentik/api"; -import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage"; - @customElement("ak-stage-authenticator-validate-duo") export class AuthenticatorValidateStageWebDuo extends BaseStage< AuthenticatorValidationChallenge, diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts index 4dd996274..55c9727d5 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts @@ -1,3 +1,4 @@ +import { AuthenticatorValidateStage } from "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStage"; import { transformAssertionForServer, transformCredentialRequestOptions, @@ -25,8 +26,6 @@ import { DeviceChallenge, } from "@goauthentik/api"; -import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage"; - @customElement("ak-stage-authenticator-validate-webauthn") export class AuthenticatorValidateStageWebAuthn extends BaseStage< AuthenticatorValidationChallenge, diff --git a/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts b/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts index 5f8b107a3..a19766d9a 100644 --- a/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts +++ b/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts @@ -1,4 +1,9 @@ import { PFSize } from "@goauthentik/web/elements/Spinner"; +import { + Assertion, + transformCredentialCreateOptions, + transformNewAssertionForServer, +} from "@goauthentik/web/flows/stages/authenticator_webauthn/utils"; import { BaseStage } from "@goauthentik/web/flows/stages/base"; import { t } from "@lingui/macro"; @@ -19,12 +24,6 @@ import { AuthenticatorWebAuthnChallengeResponseRequest, } from "@goauthentik/api"; -import { - Assertion, - transformCredentialCreateOptions, - transformNewAssertionForServer, -} from "./utils"; - export interface WebAuthnAuthenticatorRegisterChallengeResponse { response: Assertion; } diff --git a/web/src/interfaces/locale.ts b/web/src/interfaces/locale.ts index f9cb83ea3..07c597f5f 100644 --- a/web/src/interfaces/locale.ts +++ b/web/src/interfaces/locale.ts @@ -22,7 +22,7 @@ export const LOCALES: { label: t`English`, locale: async () => { return { - locale: (await import("../locales/en")).messages, + locale: (await import("@goauthentik/web/locales/en")).messages, plurals: (await import("make-plural/plurals")).en, }; }, @@ -32,7 +32,7 @@ export const LOCALES: { label: t`Debug`, locale: async () => { return { - locale: (await import("../locales/pseudo-LOCALE")).messages, + locale: (await import("@goauthentik/web/locales/pseudo-LOCALE")).messages, plurals: (await import("make-plural/plurals")).en, }; }, @@ -42,7 +42,7 @@ export const LOCALES: { label: t`French`, locale: async () => { return { - locale: (await import("../locales/fr_FR")).messages, + locale: (await import("@goauthentik/web/locales/fr_FR")).messages, plurals: (await import("make-plural/plurals")).fr, }; }, @@ -52,7 +52,7 @@ export const LOCALES: { label: t`Turkish`, locale: async () => { return { - locale: (await import("../locales/tr")).messages, + locale: (await import("@goauthentik/web/locales/tr")).messages, plurals: (await import("make-plural/plurals")).tr, }; }, @@ -62,7 +62,7 @@ export const LOCALES: { label: t`Spanish`, locale: async () => { return { - locale: (await import("../locales/es")).messages, + locale: (await import("@goauthentik/web/locales/es")).messages, plurals: (await import("make-plural/plurals")).es, }; }, @@ -72,7 +72,7 @@ export const LOCALES: { label: t`Polish`, locale: async () => { return { - locale: (await import("../locales/pl")).messages, + locale: (await import("@goauthentik/web/locales/pl")).messages, plurals: (await import("make-plural/plurals")).pl, }; }, @@ -82,7 +82,7 @@ export const LOCALES: { label: t`Taiwanese Mandarin`, locale: async () => { return { - locale: (await import("../locales/zh_TW")).messages, + locale: (await import("@goauthentik/web/locales/zh_TW")).messages, plurals: (await import("make-plural/plurals")).zh, }; }, @@ -92,7 +92,7 @@ export const LOCALES: { label: t`Chinese (simplified)`, locale: async () => { return { - locale: (await import("../locales/zh-Hans")).messages, + locale: (await import("@goauthentik/web/locales/zh-Hans")).messages, plurals: (await import("make-plural/plurals")).zh, }; }, @@ -102,7 +102,7 @@ export const LOCALES: { label: t`Chinese (traditional)`, locale: async () => { return { - locale: (await import("../locales/zh-Hant")).messages, + locale: (await import("@goauthentik/web/locales/zh-Hant")).messages, plurals: (await import("make-plural/plurals")).zh, }; }, @@ -112,7 +112,7 @@ export const LOCALES: { label: t`German`, locale: async () => { return { - locale: (await import("../locales/de")).messages, + locale: (await import("@goauthentik/web/locales/de")).messages, plurals: (await import("make-plural/plurals")).de, }; }, diff --git a/web/src/pages/admin-overview/cards/SystemStatusCard.ts b/web/src/pages/admin-overview/cards/SystemStatusCard.ts index 47b4300b1..dfbc6141a 100644 --- a/web/src/pages/admin-overview/cards/SystemStatusCard.ts +++ b/web/src/pages/admin-overview/cards/SystemStatusCard.ts @@ -1,4 +1,8 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { + AdminStatus, + AdminStatusCard, +} from "@goauthentik/web/pages/admin-overview/cards/AdminStatusCard"; import { t } from "@lingui/macro"; @@ -7,8 +11,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi, OutpostsApi, System } from "@goauthentik/api"; -import { AdminStatus, AdminStatusCard } from "./AdminStatusCard"; - @customElement("ak-admin-status-system") export class SystemStatusCard extends AdminStatusCard { now?: Date; diff --git a/web/src/pages/admin-overview/cards/VersionStatusCard.ts b/web/src/pages/admin-overview/cards/VersionStatusCard.ts index 59b83e31b..3bbb1e835 100644 --- a/web/src/pages/admin-overview/cards/VersionStatusCard.ts +++ b/web/src/pages/admin-overview/cards/VersionStatusCard.ts @@ -1,4 +1,8 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { + AdminStatus, + AdminStatusCard, +} from "@goauthentik/web/pages/admin-overview/cards/AdminStatusCard"; import { t } from "@lingui/macro"; @@ -7,8 +11,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi, Version } from "@goauthentik/api"; -import { AdminStatus, AdminStatusCard } from "./AdminStatusCard"; - @customElement("ak-admin-status-version") export class VersionStatusCard extends AdminStatusCard { getPrimaryValue(): Promise { diff --git a/web/src/pages/admin-overview/cards/WorkerStatusCard.ts b/web/src/pages/admin-overview/cards/WorkerStatusCard.ts index 54b0822ba..0bd676bf0 100644 --- a/web/src/pages/admin-overview/cards/WorkerStatusCard.ts +++ b/web/src/pages/admin-overview/cards/WorkerStatusCard.ts @@ -1,4 +1,8 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { + AdminStatus, + AdminStatusCard, +} from "@goauthentik/web/pages/admin-overview/cards/AdminStatusCard"; import { t } from "@lingui/macro"; @@ -7,8 +11,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi } from "@goauthentik/api"; -import { AdminStatus, AdminStatusCard } from "./AdminStatusCard"; - @customElement("ak-admin-status-card-workers") export class WorkersStatusCard extends AdminStatusCard { getPrimaryValue(): Promise { diff --git a/web/src/pages/applications/wizard/ApplicationWizard.ts b/web/src/pages/applications/wizard/ApplicationWizard.ts index 02d3c3226..d8b225d5d 100644 --- a/web/src/pages/applications/wizard/ApplicationWizard.ts +++ b/web/src/pages/applications/wizard/ApplicationWizard.ts @@ -1,28 +1,28 @@ +import "@goauthentik/web/elements/wizard/Wizard"; +import "@goauthentik/web/pages/applications/wizard/InitialApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/TypeApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/ldap/TypeLDAPApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/link/TypeLinkApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/oauth/TypeOAuthAPIApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/oauth/TypeOAuthApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/oauth/TypeOAuthImplicitApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/proxy/TypeProxyApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/saml/TypeSAMLApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/saml/TypeSAMLConfigApplicationWizardPage"; +import "@goauthentik/web/pages/applications/wizard/saml/TypeSAMLImportApplicationWizardPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { property } from "lit/decorators.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import "../../../elements/wizard/Wizard"; -import "./InitialApplicationWizardPage"; -import "./TypeApplicationWizardPage"; -import "./ldap/TypeLDAPApplicationWizardPage"; -import "./link/TypeLinkApplicationWizardPage"; -import "./oauth/TypeOAuthAPIApplicationWizardPage"; -import "./oauth/TypeOAuthApplicationWizardPage"; -import "./oauth/TypeOAuthCodeApplicationWizardPage"; -import "./oauth/TypeOAuthImplicitApplicationWizardPage"; -import "./proxy/TypeProxyApplicationWizardPage"; -import "./saml/TypeSAMLApplicationWizardPage"; -import "./saml/TypeSAMLConfigApplicationWizardPage"; -import "./saml/TypeSAMLImportApplicationWizardPage"; - @customElement("ak-application-wizard") export class ApplicationWizard extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/pages/applications/wizard/InitialApplicationWizardPage.ts b/web/src/pages/applications/wizard/InitialApplicationWizardPage.ts index 84cc16b8c..b916f8ef5 100644 --- a/web/src/pages/applications/wizard/InitialApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/InitialApplicationWizardPage.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; +import { convertToSlug } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -5,13 +12,6 @@ import { TemplateResult, html } from "lit"; import { ApplicationRequest, CoreApi, Provider } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { KeyUnknown } from "../../../elements/forms/Form"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../elements/wizard/WizardFormPage"; -import { convertToSlug } from "../../../utils"; - @customElement("ak-application-wizard-initial") export class InitialApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`Application details`; diff --git a/web/src/pages/applications/wizard/TypeApplicationWizardPage.ts b/web/src/pages/applications/wizard/TypeApplicationWizardPage.ts index 650fc960b..d0d789932 100644 --- a/web/src/pages/applications/wizard/TypeApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/TypeApplicationWizardPage.ts @@ -1,9 +1,11 @@ +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { CSSResult, TemplateResult, html } from "lit"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -11,8 +13,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { TypeCreate } from "@goauthentik/api"; -import { WizardPage } from "../../../elements/wizard/WizardPage"; - @customElement("ak-application-wizard-type") export class TypeApplicationWizardPage extends WizardPage { applicationTypes: TypeCreate[] = [ diff --git a/web/src/pages/applications/wizard/ldap/TypeLDAPApplicationWizardPage.ts b/web/src/pages/applications/wizard/ldap/TypeLDAPApplicationWizardPage.ts index 86e5174cd..f95c5a4ee 100644 --- a/web/src/pages/applications/wizard/ldap/TypeLDAPApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/ldap/TypeLDAPApplicationWizardPage.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -12,11 +17,6 @@ import { UserServiceAccountResponse, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../../api/Config"; -import { KeyUnknown } from "../../../../elements/forms/Form"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-ldap") export class TypeLDAPApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`LDAP details`; diff --git a/web/src/pages/applications/wizard/link/TypeLinkApplicationWizardPage.ts b/web/src/pages/applications/wizard/link/TypeLinkApplicationWizardPage.ts index 63daa7b0d..ba6f30e67 100644 --- a/web/src/pages/applications/wizard/link/TypeLinkApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/link/TypeLinkApplicationWizardPage.ts @@ -1,12 +1,12 @@ +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { TemplateResult, html } from "lit"; -import { KeyUnknown } from "../../../../elements/forms/Form"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-link") export class TypeLinkApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`Application Link`; diff --git a/web/src/pages/applications/wizard/oauth/TypeOAuthAPIApplicationWizardPage.ts b/web/src/pages/applications/wizard/oauth/TypeOAuthAPIApplicationWizardPage.ts index 5228b857f..3224f3ebc 100644 --- a/web/src/pages/applications/wizard/oauth/TypeOAuthAPIApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/oauth/TypeOAuthAPIApplicationWizardPage.ts @@ -1,17 +1,17 @@ +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { CSSResult, TemplateResult, html } from "lit"; -import AKGlobal from "../../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardPage } from "../../../../elements/wizard/WizardPage"; - @customElement("ak-application-wizard-type-oauth-api") export class TypeOAuthAPIApplicationWizardPage extends WizardPage { static get styles(): CSSResult[] { diff --git a/web/src/pages/applications/wizard/oauth/TypeOAuthApplicationWizardPage.ts b/web/src/pages/applications/wizard/oauth/TypeOAuthApplicationWizardPage.ts index fd3f9d088..9963c446c 100644 --- a/web/src/pages/applications/wizard/oauth/TypeOAuthApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/oauth/TypeOAuthApplicationWizardPage.ts @@ -1,9 +1,12 @@ +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { CSSResult, TemplateResult, html } from "lit"; -import AKGlobal from "../../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -11,9 +14,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { TypeCreate } from "@goauthentik/api"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardPage } from "../../../../elements/wizard/WizardPage"; - @customElement("ak-application-wizard-type-oauth") export class TypeOAuthApplicationWizardPage extends WizardPage { applicationTypes: TypeCreate[] = [ diff --git a/web/src/pages/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts b/web/src/pages/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts index 0655295bb..6902d1530 100644 --- a/web/src/pages/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; +import "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -13,12 +19,6 @@ import { ProvidersApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../../api/Config"; -import { KeyUnknown } from "../../../../elements/forms/Form"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; -import "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-oauth-code") export class TypeOAuthCodeApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`Method details`; diff --git a/web/src/pages/applications/wizard/oauth/TypeOAuthImplicitApplicationWizardPage.ts b/web/src/pages/applications/wizard/oauth/TypeOAuthImplicitApplicationWizardPage.ts index e8bca45ee..60361f473 100644 --- a/web/src/pages/applications/wizard/oauth/TypeOAuthImplicitApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/oauth/TypeOAuthImplicitApplicationWizardPage.ts @@ -1,11 +1,11 @@ +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { TemplateResult, html } from "lit"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-oauth-implicit") export class TypeOAuthImplicitApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`Method details`; diff --git a/web/src/pages/applications/wizard/proxy/TypeProxyApplicationWizardPage.ts b/web/src/pages/applications/wizard/proxy/TypeProxyApplicationWizardPage.ts index 47a0fc165..18539d3b8 100644 --- a/web/src/pages/applications/wizard/proxy/TypeProxyApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/proxy/TypeProxyApplicationWizardPage.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -10,11 +15,6 @@ import { ProxyProviderRequest, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../../api/Config"; -import { KeyUnknown } from "../../../../elements/forms/Form"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-proxy") export class TypeProxyApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`Proxy details`; diff --git a/web/src/pages/applications/wizard/saml/TypeSAMLApplicationWizardPage.ts b/web/src/pages/applications/wizard/saml/TypeSAMLApplicationWizardPage.ts index b2565ab31..a20a178ce 100644 --- a/web/src/pages/applications/wizard/saml/TypeSAMLApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/saml/TypeSAMLApplicationWizardPage.ts @@ -1,9 +1,12 @@ +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { CSSResult, TemplateResult, html } from "lit"; -import AKGlobal from "../../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -11,9 +14,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { TypeCreate } from "@goauthentik/api"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardPage } from "../../../../elements/wizard/WizardPage"; - @customElement("ak-application-wizard-type-saml") export class TypeOAuthApplicationWizardPage extends WizardPage { applicationTypes: TypeCreate[] = [ diff --git a/web/src/pages/applications/wizard/saml/TypeSAMLConfigApplicationWizardPage.ts b/web/src/pages/applications/wizard/saml/TypeSAMLConfigApplicationWizardPage.ts index 0d0c03ead..e506952da 100644 --- a/web/src/pages/applications/wizard/saml/TypeSAMLConfigApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/saml/TypeSAMLConfigApplicationWizardPage.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -5,11 +10,6 @@ import { TemplateResult, html } from "lit"; import { FlowDesignationEnum, FlowsApi, ProvidersApi, SAMLProviderRequest } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../../api/Config"; -import { KeyUnknown } from "../../../../elements/forms/Form"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-saml-config") export class TypeSAMLApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`SAML details`; diff --git a/web/src/pages/applications/wizard/saml/TypeSAMLImportApplicationWizardPage.ts b/web/src/pages/applications/wizard/saml/TypeSAMLImportApplicationWizardPage.ts index 634234174..21586ad11 100644 --- a/web/src/pages/applications/wizard/saml/TypeSAMLImportApplicationWizardPage.ts +++ b/web/src/pages/applications/wizard/saml/TypeSAMLImportApplicationWizardPage.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { KeyUnknown } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { WizardFormPage } from "@goauthentik/web/elements/wizard/WizardFormPage"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -10,11 +15,6 @@ import { ProvidersSamlImportMetadataCreateRequest, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../../api/Config"; -import { KeyUnknown } from "../../../../elements/forms/Form"; -import "../../../../elements/forms/HorizontalFormElement"; -import { WizardFormPage } from "../../../../elements/wizard/WizardFormPage"; - @customElement("ak-application-wizard-type-saml-import") export class TypeSAMLImportApplicationWizardPage extends WizardFormPage { sidebarLabel = () => t`Import SAML metadata`; diff --git a/web/src/pages/flows/FlowForm.ts b/web/src/pages/flows/FlowForm.ts index 9a3b952fc..c619ca056 100644 --- a/web/src/pages/flows/FlowForm.ts +++ b/web/src/pages/flows/FlowForm.ts @@ -2,6 +2,7 @@ import { DeniedActionEnum } from "@goauthentik/api/dist/models/DeniedActionEnum. import { DEFAULT_CONFIG, config } from "@goauthentik/web/api/Config"; import "@goauthentik/web/elements/forms/HorizontalFormElement"; import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { DesignationToLabel, LayoutToLabel } from "@goauthentik/web/pages/flows/utils"; import { first } from "@goauthentik/web/utils"; import { t } from "@lingui/macro"; @@ -20,8 +21,6 @@ import { PolicyEngineMode, } from "@goauthentik/api"; -import { DesignationToLabel, LayoutToLabel } from "./utils"; - @customElement("ak-flow-form") export class FlowForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/flows/FlowListPage.ts b/web/src/pages/flows/FlowListPage.ts index 0081a6f3f..a0fff333f 100644 --- a/web/src/pages/flows/FlowListPage.ts +++ b/web/src/pages/flows/FlowListPage.ts @@ -9,6 +9,7 @@ import { TableColumn } from "@goauthentik/web/elements/table/Table"; import { TablePage } from "@goauthentik/web/elements/table/TablePage"; import "@goauthentik/web/pages/flows/FlowForm"; import "@goauthentik/web/pages/flows/FlowImportForm"; +import { DesignationToLabel } from "@goauthentik/web/pages/flows/utils"; import { groupBy } from "@goauthentik/web/utils"; import { t } from "@lingui/macro"; @@ -18,8 +19,6 @@ import { customElement, property } from "lit/decorators.js"; import { Flow, FlowsApi } from "@goauthentik/api"; -import { DesignationToLabel } from "./utils"; - @customElement("ak-flow-list") export class FlowListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/stages/StageWizard.ts b/web/src/pages/stages/StageWizard.ts index 6864c3f1f..7750e1746 100644 --- a/web/src/pages/stages/StageWizard.ts +++ b/web/src/pages/stages/StageWizard.ts @@ -3,6 +3,25 @@ import "@goauthentik/web/elements/forms/ProxyForm"; import "@goauthentik/web/elements/wizard/FormWizardPage"; import "@goauthentik/web/elements/wizard/Wizard"; import { WizardPage } from "@goauthentik/web/elements/wizard/WizardPage"; +import "@goauthentik/web/pages/stages/authenticator_duo/AuthenticatorDuoStageForm.ts"; +import "@goauthentik/web/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts"; +import "@goauthentik/web/pages/stages/authenticator_static/AuthenticatorStaticStageForm.ts"; +import "@goauthentik/web/pages/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts"; +import "@goauthentik/web/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts"; +import "@goauthentik/web/pages/stages/authenticator_webauthn/AuthenticateWebAuthnStageForm.ts"; +import "@goauthentik/web/pages/stages/captcha/CaptchaStageForm.ts"; +import "@goauthentik/web/pages/stages/consent/ConsentStageForm.ts"; +import "@goauthentik/web/pages/stages/deny/DenyStageForm.ts"; +import "@goauthentik/web/pages/stages/dummy/DummyStageForm.ts"; +import "@goauthentik/web/pages/stages/email/EmailStageForm.ts"; +import "@goauthentik/web/pages/stages/identification/IdentificationStageForm.ts"; +import "@goauthentik/web/pages/stages/invitation/InvitationStageForm.ts"; +import "@goauthentik/web/pages/stages/password/PasswordStageForm.ts"; +import "@goauthentik/web/pages/stages/prompt/PromptStageForm.ts"; +import "@goauthentik/web/pages/stages/user_delete/UserDeleteStageForm.ts"; +import "@goauthentik/web/pages/stages/user_login/UserLoginStageForm.ts"; +import "@goauthentik/web/pages/stages/user_logout/UserLogoutStageForm.ts"; +import "@goauthentik/web/pages/stages/user_write/UserWriteStageForm.ts"; import { t } from "@lingui/macro"; @@ -18,26 +37,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { StagesApi, TypeCreate } from "@goauthentik/api"; -import "./authenticator_duo/AuthenticatorDuoStageForm.ts"; -import "./authenticator_sms/AuthenticatorSMSStageForm.ts"; -import "./authenticator_static/AuthenticatorStaticStageForm.ts"; -import "./authenticator_totp/AuthenticatorTOTPStageForm.ts"; -import "./authenticator_validate/AuthenticatorValidateStageForm.ts"; -import "./authenticator_webauthn/AuthenticateWebAuthnStageForm.ts"; -import "./captcha/CaptchaStageForm.ts"; -import "./consent/ConsentStageForm.ts"; -import "./deny/DenyStageForm.ts"; -import "./dummy/DummyStageForm.ts"; -import "./email/EmailStageForm.ts"; -import "./identification/IdentificationStageForm.ts"; -import "./invitation/InvitationStageForm.ts"; -import "./password/PasswordStageForm.ts"; -import "./prompt/PromptStageForm.ts"; -import "./user_delete/UserDeleteStageForm.ts"; -import "./user_login/UserLoginStageForm.ts"; -import "./user_logout/UserLogoutStageForm.ts"; -import "./user_write/UserWriteStageForm.ts"; - @customElement("ak-stage-wizard-initial") export class InitialStageWizardPage extends WizardPage { @property({ attribute: false }) diff --git a/web/src/pages/users/UserForm.ts b/web/src/pages/users/UserForm.ts index 1cd886d44..655fa74b5 100644 --- a/web/src/pages/users/UserForm.ts +++ b/web/src/pages/users/UserForm.ts @@ -2,6 +2,7 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import "@goauthentik/web/elements/CodeMirror"; import "@goauthentik/web/elements/forms/HorizontalFormElement"; import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/pages/users/GroupSelectModal"; import { first } from "@goauthentik/web/utils"; import YAML from "yaml"; @@ -14,8 +15,6 @@ import { until } from "lit/directives/until.js"; import { CoreApi, Group, User } from "@goauthentik/api"; -import "./GroupSelectModal"; - @customElement("ak-user-form") export class UserForm extends ModelForm { static get styles(): CSSResult[] { diff --git a/web/src/routesAdmin.ts b/web/src/routesAdmin.ts index c33944314..bd34927bc 100644 --- a/web/src/routesAdmin.ts +++ b/web/src/routesAdmin.ts @@ -1,9 +1,8 @@ +import { ID_REGEX, Route, SLUG_REGEX, UUID_REGEX } from "@goauthentik/web/elements/router/Route"; import "@goauthentik/web/pages/admin-overview/AdminOverviewPage"; import { html } from "lit"; -import { ID_REGEX, Route, SLUG_REGEX, UUID_REGEX } from "./elements/router/Route"; - export const ROUTES: Route[] = [ // Prevent infinite Shell loops new Route(new RegExp("^/$")).redirect("/administration/overview"), diff --git a/web/src/routesUser.ts b/web/src/routesUser.ts index ee74ca9b6..b67971d38 100644 --- a/web/src/routesUser.ts +++ b/web/src/routesUser.ts @@ -1,7 +1,7 @@ -import { html } from "lit"; +import { Route } from "@goauthentik/web/elements/router/Route"; +import "@goauthentik/web/user/LibraryPage"; -import { Route } from "./elements/router/Route"; -import "./user/LibraryPage"; +import { html } from "lit"; export const ROUTES: Route[] = [ // Prevent infinite Shell loops diff --git a/web/src/user/LibraryPage.ts b/web/src/user/LibraryPage.ts index 07039b676..478e80826 100644 --- a/web/src/user/LibraryPage.ts +++ b/web/src/user/LibraryPage.ts @@ -2,6 +2,7 @@ import { AKResponse } from "@goauthentik/web/api/Client"; import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { LayoutType, UIConfig, uiConfig } from "@goauthentik/web/common/config"; import { getURLParam, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import "@goauthentik/web/user/LibraryApplication"; import { groupBy, loading } from "@goauthentik/web/utils"; import Fuse from "fuse.js"; @@ -22,8 +23,6 @@ import PFDisplay from "@patternfly/patternfly/utilities/Display/display.css"; import { Application, CoreApi } from "@goauthentik/api"; -import "./LibraryApplication"; - @customElement("ak-library") export class LibraryPage extends LitElement { @property({ attribute: false }) diff --git a/web/src/user/user-settings/UserSettingsPage.ts b/web/src/user/user-settings/UserSettingsPage.ts index ddc4577d1..0042820da 100644 --- a/web/src/user/user-settings/UserSettingsPage.ts +++ b/web/src/user/user-settings/UserSettingsPage.ts @@ -1,6 +1,14 @@ import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { me } from "@goauthentik/web/api/Users"; import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/user/SessionList"; +import "@goauthentik/web/elements/user/UserConsentList"; +import "@goauthentik/web/user/user-settings/details/UserPassword"; +import "@goauthentik/web/user/user-settings/details/UserSettingsFlowExecutor"; +import "@goauthentik/web/user/user-settings/mfa/MFADevicesPage"; +import "@goauthentik/web/user/user-settings/sources/SourceSettings"; +import "@goauthentik/web/user/user-settings/tokens/UserTokenList"; import { t } from "@lingui/macro"; @@ -25,15 +33,6 @@ import PFSizing from "@patternfly/patternfly/utilities/Sizing/sizing.css"; import { StagesApi, UserSetting } from "@goauthentik/api"; -import "../../elements/Tabs"; -import "../../elements/user/SessionList"; -import "../../elements/user/UserConsentList"; -import "./details/UserPassword"; -import "./details/UserSettingsFlowExecutor"; -import "./mfa/MFADevicesPage"; -import "./sources/SourceSettings"; -import "./tokens/UserTokenList"; - @customElement("ak-user-settings") export class UserSettingsPage extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/user/user-settings/mfa/MFADevicesPage.ts b/web/src/user/user-settings/mfa/MFADevicesPage.ts index 05de852ea..a9020c351 100644 --- a/web/src/user/user-settings/mfa/MFADevicesPage.ts +++ b/web/src/user/user-settings/mfa/MFADevicesPage.ts @@ -6,6 +6,7 @@ import "@goauthentik/web/elements/buttons/TokenCopyButton"; import "@goauthentik/web/elements/forms/DeleteBulkForm"; import "@goauthentik/web/elements/forms/ModalForm"; import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; +import "@goauthentik/web/user/user-settings/mfa/MFADeviceForm"; import { t } from "@lingui/macro"; @@ -16,8 +17,6 @@ import { until } from "lit/directives/until.js"; import { AuthenticatorsApi, Device, UserSetting } from "@goauthentik/api"; -import "./MFADeviceForm"; - export function stageToAuthenticatorName(stage: UserSetting): string { switch (stage.component) { case "ak-user-settings-authenticator-duo": diff --git a/web/src/utils.ts b/web/src/utils.ts index 5f1914ed8..2880adae5 100644 --- a/web/src/utils.ts +++ b/web/src/utils.ts @@ -1,11 +1,10 @@ +import { SentryIgnoredError } from "@goauthentik/web/common/errors"; import "@goauthentik/web/elements/EmptyState"; import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; -import { SentryIgnoredError } from "./common/errors"; - export function getCookie(name: string): string { let cookieValue = ""; if (document.cookie && document.cookie !== "") {