From a8c04f96d213f35674abc8291f696df9be6913fa Mon Sep 17 00:00:00 2001 From: Jens L Date: Sat, 25 Jun 2022 17:44:17 +0200 Subject: [PATCH] web: use absolute imports with path rewrite instead of relative imports (#3149) --- .github/workflows/ci-web.yml | 7 ++- .vscode/settings.json | 6 +- web/.babelrc | 1 + web/package-lock.json | 15 +++++ web/package.json | 1 + web/src/api/Config.ts | 8 +-- web/src/api/Plex.ts | 4 +- web/src/api/Sentry.ts | 4 +- web/src/api/Users.ts | 2 +- web/src/common/config.ts | 4 +- web/src/common/ws.ts | 8 +-- web/src/elements/Divider.ts | 2 +- web/src/elements/EmptyState.ts | 2 +- web/src/elements/Label.ts | 2 +- web/src/elements/LoadingOverlay.ts | 4 +- web/src/elements/Markdown.ts | 2 +- web/src/elements/PageHeader.ts | 34 +++++------ web/src/elements/SearchSelect.ts | 2 +- web/src/elements/Tabs.ts | 5 +- web/src/elements/Tooltip.ts | 2 +- web/src/elements/TreeView.ts | 5 +- web/src/elements/buttons/ActionButton.ts | 5 +- web/src/elements/buttons/Dropdown.ts | 4 +- web/src/elements/buttons/ModalButton.ts | 6 +- web/src/elements/buttons/SpinnerButton.ts | 8 +-- web/src/elements/buttons/TokenCopyButton.ts | 11 ++-- web/src/elements/cards/AggregateCard.ts | 2 +- .../elements/cards/AggregatePromiseCard.ts | 5 +- web/src/elements/charts/AdminLoginsChart.ts | 2 +- web/src/elements/charts/AdminModelPerDay.ts | 2 +- .../charts/ApplicationAuthorizeChart.ts | 2 +- web/src/elements/charts/Chart.ts | 8 ++- web/src/elements/charts/UserChart.ts | 2 +- web/src/elements/chips/Chip.ts | 2 +- web/src/elements/chips/ChipGroup.ts | 2 +- web/src/elements/events/ObjectChangelog.ts | 22 +++---- web/src/elements/events/UserEvents.ts | 22 +++---- web/src/elements/forms/ConfirmationForm.ts | 12 ++-- web/src/elements/forms/DeleteBulkForm.ts | 18 +++--- web/src/elements/forms/DeleteForm.ts | 12 ++-- web/src/elements/forms/Form.ts | 12 ++-- web/src/elements/forms/FormGroup.ts | 2 +- .../elements/forms/HorizontalFormElement.ts | 5 +- web/src/elements/forms/ModalForm.ts | 9 +-- web/src/elements/forms/ModelForm.ts | 3 +- web/src/elements/messages/MessageContainer.ts | 12 ++-- web/src/elements/messages/Middleware.ts | 6 +- web/src/elements/notifications/APIDrawer.ts | 6 +- .../notifications/NotificationDrawer.ts | 18 +++--- web/src/elements/oauth/UserRefreshList.ts | 14 ++--- web/src/elements/router/Route.ts | 4 +- web/src/elements/router/RouteMatch.ts | 6 +- web/src/elements/router/RouterOutlet.ts | 7 ++- web/src/elements/sidebar/Sidebar.ts | 8 +-- web/src/elements/sidebar/SidebarBrand.ts | 12 ++-- web/src/elements/sidebar/SidebarItem.ts | 6 +- web/src/elements/sidebar/SidebarUser.ts | 4 +- web/src/elements/table/Table.ts | 24 ++++---- web/src/elements/table/TableModal.ts | 7 ++- web/src/elements/table/TablePage.ts | 5 +- web/src/elements/table/TablePagination.ts | 6 +- web/src/elements/table/TableSearch.ts | 2 +- web/src/elements/user/SessionList.ts | 12 ++-- web/src/elements/user/UserConsentList.ts | 12 ++-- web/src/elements/utils/TimeDeltaHelp.ts | 6 +- web/src/elements/wizard/FormWizardPage.ts | 3 +- web/src/elements/wizard/Wizard.ts | 3 +- web/src/flows/FlowExecutor.ts | 37 ++++++------ web/src/flows/FlowInspector.ts | 10 ++-- web/src/flows/sources/apple/AppleLoginInit.ts | 8 +-- web/src/flows/sources/plex/PlexLoginInit.ts | 14 ++--- web/src/flows/stages/RedirectStage.ts | 2 +- .../stages/access_denied/AccessDeniedStage.ts | 10 ++-- .../AuthenticatorDuoStage.ts | 14 ++--- .../AuthenticatorSMSStage.ts | 12 ++-- .../AuthenticatorStaticStage.ts | 12 ++-- .../AuthenticatorTOTPStage.ts | 15 +++-- .../AuthenticatorValidateStage.ts | 16 ++--- .../AuthenticatorValidateStageCode.ts | 13 ++-- .../AuthenticatorValidateStageDuo.ts | 11 ++-- .../AuthenticatorValidateStageWebAuthn.ts | 13 ++-- .../WebAuthnAuthenticatorRegisterStage.ts | 7 ++- .../stages/autosubmit/AutosubmitStage.ts | 8 +-- web/src/flows/stages/captcha/CaptchaStage.ts | 14 ++--- web/src/flows/stages/consent/ConsentStage.ts | 10 ++-- web/src/flows/stages/dummy/DummyStage.ts | 10 ++-- web/src/flows/stages/email/EmailStage.ts | 8 +-- .../identification/IdentificationStage.ts | 12 ++-- .../flows/stages/password/PasswordStage.ts | 14 ++--- web/src/flows/stages/prompt/PromptStage.ts | 14 ++--- web/src/interfaces/AdminInterface.ts | 42 ++++++------- web/src/interfaces/FlowInterface.ts | 6 +- web/src/interfaces/UserInterface.ts | 46 +++++++------- .../pages/admin-overview/AdminOverviewPage.ts | 36 +++++------ .../pages/admin-overview/DashboardUserPage.ts | 10 ++-- .../admin-overview/TopApplicationsTable.ts | 8 +-- .../admin-overview/cards/AdminStatusCard.ts | 8 +-- .../admin-overview/cards/SystemStatusCard.ts | 3 +- .../admin-overview/cards/VersionStatusCard.ts | 3 +- .../admin-overview/cards/WorkerStatusCard.ts | 3 +- .../admin-overview/charts/FlowStatusChart.ts | 7 +-- .../charts/GroupCountStatusChart.ts | 5 +- .../charts/LDAPSyncStatusChart.ts | 7 +-- .../charts/OutpostStatusChart.ts | 7 +-- .../charts/PolicyStatusChart.ts | 7 +-- .../charts/UserCountStatusChart.ts | 5 +- .../ApplicationCheckAccessForm.ts | 12 ++-- web/src/pages/applications/ApplicationForm.ts | 18 +++--- .../pages/applications/ApplicationListPage.ts | 28 ++++----- .../pages/applications/ApplicationViewPage.ts | 24 ++++---- .../pages/crypto/CertificateGenerateForm.ts | 8 +-- .../pages/crypto/CertificateKeyPairForm.ts | 10 ++-- .../crypto/CertificateKeyPairListPage.ts | 24 ++++---- web/src/pages/events/EventInfo.ts | 16 ++--- web/src/pages/events/EventInfoPage.ts | 12 ++-- web/src/pages/events/EventListPage.ts | 18 +++--- web/src/pages/events/RuleForm.ts | 8 +-- web/src/pages/events/RuleListPage.ts | 22 +++---- web/src/pages/events/TransportForm.ts | 12 ++-- web/src/pages/events/TransportListPage.ts | 22 +++---- web/src/pages/flows/BoundStagesList.ts | 24 ++++---- web/src/pages/flows/FlowDiagram.ts | 7 +-- web/src/pages/flows/FlowForm.ts | 9 +-- web/src/pages/flows/FlowImportForm.ts | 10 ++-- web/src/pages/flows/FlowListPage.ts | 25 ++++---- web/src/pages/flows/FlowViewPage.ts | 22 +++---- web/src/pages/flows/StageBindingForm.ts | 10 ++-- web/src/pages/groups/GroupForm.ts | 19 +++--- web/src/pages/groups/GroupListPage.ts | 22 +++---- web/src/pages/groups/GroupViewPage.ts | 28 ++++----- web/src/pages/groups/MemberSelectModal.ts | 18 +++--- web/src/pages/groups/RelatedGroupList.ts | 20 +++---- .../pages/outposts/OutpostDeploymentModal.ts | 6 +- web/src/pages/outposts/OutpostForm.ts | 9 ++- web/src/pages/outposts/OutpostHealth.ts | 8 +-- web/src/pages/outposts/OutpostHealthSimple.ts | 12 ++-- web/src/pages/outposts/OutpostListPage.ts | 28 ++++----- .../outposts/ServiceConnectionDockerForm.ts | 10 ++-- .../ServiceConnectionKubernetesForm.ts | 11 ++-- .../outposts/ServiceConnectionListPage.ts | 30 +++++----- .../pages/outposts/ServiceConnectionWizard.ts | 18 +++--- web/src/pages/policies/BoundPoliciesList.ts | 30 +++++----- web/src/pages/policies/PolicyBindingForm.ts | 14 ++--- web/src/pages/policies/PolicyListPage.ts | 40 ++++++------- web/src/pages/policies/PolicyTestForm.ts | 15 +++-- web/src/pages/policies/PolicyWizard.ts | 28 ++++----- .../pages/policies/dummy/DummyPolicyForm.ts | 12 ++-- .../event_matcher/EventMatcherPolicyForm.ts | 12 ++-- .../pages/policies/expiry/ExpiryPolicyForm.ts | 12 ++-- .../expression/ExpressionPolicyForm.ts | 14 ++--- .../policies/hibp/HaveIBeenPwnedPolicyForm.ts | 12 ++-- .../policies/password/PasswordPolicyForm.ts | 12 ++-- .../policies/reputation/ReputationListPage.ts | 19 +++--- .../reputation/ReputationPolicyForm.ts | 12 ++-- .../PropertyMappingLDAPForm.ts | 10 ++-- .../PropertyMappingListPage.ts | 34 +++++------ .../PropertyMappingNotification.ts | 10 ++-- .../PropertyMappingSAMLForm.ts | 10 ++-- .../PropertyMappingScopeForm.ts | 10 ++-- .../PropertyMappingTestForm.ts | 13 ++-- .../PropertyMappingWizard.ts | 24 ++++---- web/src/pages/providers/ProviderListPage.ts | 30 +++++----- web/src/pages/providers/ProviderViewPage.ts | 20 +++---- web/src/pages/providers/ProviderWizard.ts | 24 ++++---- .../providers/RelatedApplicationButton.ts | 8 +-- .../pages/providers/ldap/LDAPProviderForm.ts | 12 ++-- .../providers/ldap/LDAPProviderViewPage.ts | 24 ++++---- .../providers/oauth2/OAuth2ProviderForm.ts | 14 ++--- .../oauth2/OAuth2ProviderViewPage.ts | 24 ++++---- .../providers/proxy/ProxyProviderForm.ts | 14 ++--- .../providers/proxy/ProxyProviderViewPage.ts | 40 ++++++------- .../pages/providers/saml/SAMLProviderForm.ts | 12 ++-- .../providers/saml/SAMLProviderImportForm.ts | 10 ++-- .../providers/saml/SAMLProviderViewPage.ts | 24 ++++---- web/src/pages/sources/SourceListPage.ts | 28 ++++----- web/src/pages/sources/SourceViewPage.ts | 18 +++--- web/src/pages/sources/SourceWizard.ts | 22 +++---- web/src/pages/sources/ldap/LDAPSourceForm.ts | 14 ++--- .../pages/sources/ldap/LDAPSourceViewPage.ts | 22 +++---- .../pages/sources/oauth/OAuthSourceForm.ts | 14 ++--- .../sources/oauth/OAuthSourceViewPage.ts | 24 ++++---- web/src/pages/sources/plex/PlexSourceForm.ts | 14 ++--- .../pages/sources/plex/PlexSourceViewPage.ts | 22 +++---- web/src/pages/sources/saml/SAMLSourceForm.ts | 14 ++--- .../pages/sources/saml/SAMLSourceViewPage.ts | 22 +++---- web/src/pages/stages/StageListPage.ts | 60 +++++++++---------- web/src/pages/stages/StageWizard.ts | 13 ++-- .../AuthenticatorDuoStageForm.ts | 12 ++-- .../AuthenticatorSMSStageForm.ts | 12 ++-- .../AuthenticatorStaticStageForm.ts | 12 ++-- .../AuthenticatorTOTPStageForm.ts | 10 ++-- .../AuthenticatorValidateStageForm.ts | 12 ++-- .../AuthenticateWebAuthnStageForm.ts | 8 +-- .../pages/stages/captcha/CaptchaStageForm.ts | 10 ++-- .../pages/stages/consent/ConsentStageForm.ts | 12 ++-- web/src/pages/stages/deny/DenyStageForm.ts | 8 +-- web/src/pages/stages/dummy/DummyStageForm.ts | 8 +-- web/src/pages/stages/email/EmailStageForm.ts | 12 ++-- .../identification/IdentificationStageForm.ts | 12 ++-- .../pages/stages/invitation/InvitationForm.ts | 11 ++-- .../stages/invitation/InvitationListLink.ts | 6 +- .../stages/invitation/InvitationListPage.ts | 24 ++++---- .../stages/invitation/InvitationStageForm.ts | 12 ++-- .../stages/password/PasswordStageForm.ts | 12 ++-- web/src/pages/stages/prompt/PromptForm.ts | 12 ++-- web/src/pages/stages/prompt/PromptListPage.ts | 24 ++++---- .../pages/stages/prompt/PromptStageForm.ts | 14 ++--- .../stages/user_delete/UserDeleteStageForm.ts | 8 +-- .../stages/user_login/UserLoginStageForm.ts | 14 ++--- .../stages/user_logout/UserLogoutStageForm.ts | 8 +-- .../stages/user_write/UserWriteStageForm.ts | 14 ++--- .../pages/system-tasks/SystemTaskListPage.ts | 18 +++--- web/src/pages/tenants/TenantForm.ts | 15 +++-- web/src/pages/tenants/TenantListPage.ts | 22 +++---- web/src/pages/tokens/TokenForm.ts | 14 ++--- web/src/pages/tokens/TokenListPage.ts | 24 ++++---- web/src/pages/users/GroupSelectModal.ts | 16 ++--- web/src/pages/users/RelatedUserList.ts | 38 ++++++------ web/src/pages/users/ServiceAccountForm.ts | 10 ++-- web/src/pages/users/UserActiveForm.ts | 10 ++-- web/src/pages/users/UserForm.ts | 10 ++-- web/src/pages/users/UserListPage.ts | 46 +++++++------- web/src/pages/users/UserPasswordForm.ts | 10 ++-- web/src/pages/users/UserResetEmailForm.ts | 8 +-- web/src/pages/users/UserViewPage.ts | 48 +++++++-------- web/src/routesAdmin.ts | 3 +- web/src/user/LibraryApplication.ts | 10 ++-- web/src/user/LibraryPage.ts | 12 ++-- .../user/user-settings/BaseUserSettings.ts | 2 +- .../user/user-settings/UserSettingsPage.ts | 9 +-- .../user-settings/details/UserPassword.ts | 6 +- .../details/UserSettingsFlowExecutor.ts | 18 +++--- .../details/stages/prompt/PromptStage.ts | 6 +- .../user/user-settings/mfa/MFADeviceForm.ts | 8 +-- .../user/user-settings/mfa/MFADevicesPage.ts | 17 +++--- .../user-settings/sources/SourceSettings.ts | 14 ++--- .../sources/SourceSettingsOAuth.ts | 10 ++-- .../sources/SourceSettingsPlex.ts | 14 ++--- .../user-settings/tokens/UserTokenForm.ts | 8 +-- .../user-settings/tokens/UserTokenList.ts | 26 ++++---- web/src/utils.ts | 3 +- web/tsconfig.json | 5 ++ 242 files changed, 1614 insertions(+), 1567 deletions(-) diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index d67d4e332..22484385d 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -53,7 +53,12 @@ jobs: cache: 'npm' cache-dependency-path: web/package-lock.json - working-directory: web/ - run: npm ci + run: | + npm ci + # lit-analyse doesn't understand path rewrites, so make it + # belive it's an actual module + cd node_modules/@goauthentik + ln -s ../../src/ web - name: Generate API run: make gen-client-web - name: lit-analyse diff --git a/.vscode/settings.json b/.vscode/settings.json index 42475380d..74e012342 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,9 @@ "python.formatting.provider": "black", "files.associations": { "*.akflow": "json" - } + }, + "typescript.preferences.importModuleSpecifier": "non-relative", + "typescript.preferences.importModuleSpecifierEnding": "js", + "typescript.tsdk": "./web/node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true } diff --git a/web/.babelrc b/web/.babelrc index fb2039996..04ebad676 100644 --- a/web/.babelrc +++ b/web/.babelrc @@ -2,6 +2,7 @@ "presets": ["@babel/env", "@babel/typescript"], "plugins": [ ["@babel/plugin-proposal-private-methods", { "loose": true }], + ["babel-plugin-tsconfig-paths", {}], [ "@babel/plugin-proposal-decorators", { diff --git a/web/package-lock.json b/web/package-lock.json index b3c854043..1543b9b2a 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -41,6 +41,7 @@ "@typescript-eslint/parser": "^5.29.0", "@webcomponents/webcomponentsjs": "^2.6.0", "babel-plugin-macros": "^3.1.0", + "babel-plugin-tsconfig-paths": "^1.0.3", "base64-js": "^1.5.1", "chart.js": "^3.8.0", "chartjs-adapter-moment": "^1.0.0", @@ -3322,6 +3323,14 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/babel-plugin-tsconfig-paths": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-tsconfig-paths/-/babel-plugin-tsconfig-paths-1.0.3.tgz", + "integrity": "sha512-eBTjzXpx0CXO2gooYPyIU1joS/eK1Vk2+oLhJDwRwIgh2+2kD/j649eYNtHjFKuXr36/4Y0ytPORLyiey7MLRA==", + "peerDependencies": { + "@babel/core": "^7.9.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -11271,6 +11280,12 @@ "@babel/helper-define-polyfill-provider": "^0.3.0" } }, + "babel-plugin-tsconfig-paths": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-tsconfig-paths/-/babel-plugin-tsconfig-paths-1.0.3.tgz", + "integrity": "sha512-eBTjzXpx0CXO2gooYPyIU1joS/eK1Vk2+oLhJDwRwIgh2+2kD/j649eYNtHjFKuXr36/4Y0ytPORLyiey7MLRA==", + "requires": {} + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", diff --git a/web/package.json b/web/package.json index 452c9d907..2eee5574a 100644 --- a/web/package.json +++ b/web/package.json @@ -84,6 +84,7 @@ "@typescript-eslint/parser": "^5.29.0", "@webcomponents/webcomponentsjs": "^2.6.0", "babel-plugin-macros": "^3.1.0", + "babel-plugin-tsconfig-paths": "^1.0.3", "base64-js": "^1.5.1", "chart.js": "^3.8.0", "chartjs-adapter-moment": "^1.0.0", diff --git a/web/src/api/Config.ts b/web/src/api/Config.ts index 7b5415609..06ef8f6fb 100644 --- a/web/src/api/Config.ts +++ b/web/src/api/Config.ts @@ -1,8 +1,8 @@ import { Config, Configuration, CoreApi, CurrentTenant, FetchParams, Middleware, RequestContext, ResponseContext, RootApi } from "@goauthentik/api"; -import { getCookie } from "../utils"; -import { APIMiddleware } from "../elements/notifications/APIDrawer"; -import { MessageMiddleware } from "../elements/messages/Middleware"; -import { VERSION } from "../constants"; +import { getCookie } from "@goauthentik/web/utils"; +import { APIMiddleware } from "@goauthentik/web/elements/notifications/APIDrawer"; +import { MessageMiddleware } from "@goauthentik/web/elements/messages/Middleware"; +import { VERSION } from "@goauthentik/web/constants"; export class LoggingMiddleware implements Middleware { diff --git a/web/src/api/Plex.ts b/web/src/api/Plex.ts index 35e1d0b3d..7185a94d2 100644 --- a/web/src/api/Plex.ts +++ b/web/src/api/Plex.ts @@ -1,5 +1,5 @@ -import { SentryIgnoredError } from "../common/errors"; -import { VERSION } from "../constants"; +import { SentryIgnoredError } from "@goauthentik/web/common/errors"; +import { VERSION } from "@goauthentik/web/constants"; export interface PlexPinResponse { // Only has the fields we care about diff --git a/web/src/api/Sentry.ts b/web/src/api/Sentry.ts index db6dddd46..815a94af9 100644 --- a/web/src/api/Sentry.ts +++ b/web/src/api/Sentry.ts @@ -1,7 +1,7 @@ import * as Sentry from "@sentry/browser"; import { Integrations } from "@sentry/tracing"; -import { VERSION } from "../constants"; -import { SentryIgnoredError } from "../common/errors"; +import { VERSION } from "@goauthentik/web/constants"; +import { SentryIgnoredError } from "@goauthentik/web/common/errors"; import { me } from "./Users"; import { config } from "./Config"; import { Config } from "@goauthentik/api"; diff --git a/web/src/api/Users.ts b/web/src/api/Users.ts index 127a93f54..bfff41a0e 100644 --- a/web/src/api/Users.ts +++ b/web/src/api/Users.ts @@ -1,5 +1,5 @@ import { CoreApi, ResponseError, SessionUser } from "@goauthentik/api"; -import { activateLocale } from "../interfaces/locale"; +import { activateLocale } from "@goauthentik/web/interfaces/locale"; import { DEFAULT_CONFIG } from "./Config"; let globalMePromise: Promise | undefined; diff --git a/web/src/common/config.ts b/web/src/common/config.ts index 36521aad0..e913cee16 100644 --- a/web/src/common/config.ts +++ b/web/src/common/config.ts @@ -1,6 +1,6 @@ -import { UserSelf } from "@goauthentik/api"; +import { me } from "@goauthentik/web/api/Users"; -import { me } from "../api/Users"; +import { UserSelf } from "@goauthentik/api"; export enum UserDisplay { username = "username", diff --git a/web/src/common/ws.ts b/web/src/common/ws.ts index bbcb978a3..98e011ce4 100644 --- a/web/src/common/ws.ts +++ b/web/src/common/ws.ts @@ -1,8 +1,8 @@ -import { t } from "@lingui/macro"; +import { EVENT_WS_MESSAGE } from "@goauthentik/web/constants"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; -import { EVENT_WS_MESSAGE } from "../constants"; -import { MessageLevel } from "../elements/messages/Message"; -import { showMessage } from "../elements/messages/MessageContainer"; +import { t } from "@lingui/macro"; export interface WSMessage { message_type: string; diff --git a/web/src/elements/Divider.ts b/web/src/elements/Divider.ts index 3fae9a2f2..f318be964 100644 --- a/web/src/elements/Divider.ts +++ b/web/src/elements/Divider.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; @customElement("ak-divider") diff --git a/web/src/elements/EmptyState.ts b/web/src/elements/EmptyState.ts index 1b35db4c4..e385e06e1 100644 --- a/web/src/elements/EmptyState.ts +++ b/web/src/elements/EmptyState.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, 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 PFTitle from "@patternfly/patternfly/components/Title/title.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; diff --git a/web/src/elements/Label.ts b/web/src/elements/Label.ts index 36c756ac6..790c52147 100644 --- a/web/src/elements/Label.ts +++ b/web/src/elements/Label.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFLabel from "@patternfly/patternfly/components/Label/label.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; diff --git a/web/src/elements/LoadingOverlay.ts b/web/src/elements/LoadingOverlay.ts index cd8fc4754..a463e968f 100644 --- a/web/src/elements/LoadingOverlay.ts +++ b/web/src/elements/LoadingOverlay.ts @@ -1,10 +1,10 @@ +import { PFSize } from "@goauthentik/web/elements/Spinner"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { PFSize } from "./Spinner"; - @customElement("ak-loading-overlay") export class LoadingOverlay extends LitElement { @property({ type: Boolean }) diff --git a/web/src/elements/Markdown.ts b/web/src/elements/Markdown.ts index d0ff3279a..b52b7541f 100644 --- a/web/src/elements/Markdown.ts +++ b/web/src/elements/Markdown.ts @@ -2,7 +2,7 @@ import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { unsafeHTML } from "lit/directives/unsafe-html.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFList from "@patternfly/patternfly/components/List/list.css"; diff --git a/web/src/elements/PageHeader.ts b/web/src/elements/PageHeader.ts index 02411c852..e5fcffd46 100644 --- a/web/src/elements/PageHeader.ts +++ b/web/src/elements/PageHeader.ts @@ -1,26 +1,26 @@ -import { t } from "@lingui/macro"; - -import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; -import { customElement, property } from "lit/decorators.js"; - -import AKGlobal from "../authentik.css"; -import PFButton from "@patternfly/patternfly/components/Button/button.css"; -import PFContent from "@patternfly/patternfly/components/Content/content.css"; -import PFPage from "@patternfly/patternfly/components/Page/page.css"; -import PFBase from "@patternfly/patternfly/patternfly-base.css"; - -import { EventsApi } from "@goauthentik/api"; - -import { DEFAULT_CONFIG, tenant } from "../api/Config"; -import { currentInterface } from "../api/Sentry"; -import { me } from "../api/Users"; +import { DEFAULT_CONFIG, tenant } from "@goauthentik/web/api/Config"; +import { currentInterface } from "@goauthentik/web/api/Sentry"; +import { me } from "@goauthentik/web/api/Users"; import { EVENT_API_DRAWER_TOGGLE, EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_SIDEBAR_TOGGLE, EVENT_WS_MESSAGE, TITLE_DEFAULT, -} from "../constants"; +} from "@goauthentik/web/constants"; + +import { t } from "@lingui/macro"; + +import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; +import { customElement, property } from "lit/decorators.js"; + +import AKGlobal from "@goauthentik/web/authentik.css"; +import PFButton from "@patternfly/patternfly/components/Button/button.css"; +import PFContent from "@patternfly/patternfly/components/Content/content.css"; +import PFPage from "@patternfly/patternfly/components/Page/page.css"; +import PFBase from "@patternfly/patternfly/patternfly-base.css"; + +import { EventsApi } from "@goauthentik/api"; @customElement("ak-page-header") export class PageHeader extends LitElement { diff --git a/web/src/elements/SearchSelect.ts b/web/src/elements/SearchSelect.ts index bf9953ba7..9eda7fc64 100644 --- a/web/src/elements/SearchSelect.ts +++ b/web/src/elements/SearchSelect.ts @@ -3,7 +3,7 @@ import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import PFSelect from "@patternfly/patternfly/components/Select/select.css"; diff --git a/web/src/elements/Tabs.ts b/web/src/elements/Tabs.ts index 475646228..36e790fb0 100644 --- a/web/src/elements/Tabs.ts +++ b/web/src/elements/Tabs.ts @@ -1,14 +1,15 @@ +import { CURRENT_CLASS, EVENT_REFRESH, ROUTE_SEPARATOR } from "@goauthentik/web/constants"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../authentik.css"; +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 { CURRENT_CLASS, EVENT_REFRESH, ROUTE_SEPARATOR } from "../constants"; import { getURLParams, updateURLParams } from "./router/RouteMatch"; @customElement("ak-tabs") diff --git a/web/src/elements/Tooltip.ts b/web/src/elements/Tooltip.ts index 876ece5c7..b57b359a9 100644 --- a/web/src/elements/Tooltip.ts +++ b/web/src/elements/Tooltip.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, state } from "lit/decorators.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFTooltip from "@patternfly/patternfly/components/Tooltip/tooltip.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; diff --git a/web/src/elements/TreeView.ts b/web/src/elements/TreeView.ts index 63d04b5ec..27a1c9ab0 100644 --- a/web/src/elements/TreeView.ts +++ b/web/src/elements/TreeView.ts @@ -1,13 +1,14 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property, state } from "lit/decorators.js"; -import AKGlobal from "../authentik.css"; +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 { EVENT_REFRESH } from "../constants"; import { setURLParams } from "./router/RouteMatch"; export interface TreeViewItem { diff --git a/web/src/elements/buttons/ActionButton.ts b/web/src/elements/buttons/ActionButton.ts index e3088a49c..10807c583 100644 --- a/web/src/elements/buttons/ActionButton.ts +++ b/web/src/elements/buttons/ActionButton.ts @@ -1,7 +1,8 @@ +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; + import { customElement, property } from "lit/decorators.js"; -import { MessageLevel } from "../messages/Message"; -import { showMessage } from "../messages/MessageContainer"; import { SpinnerButton } from "./SpinnerButton"; @customElement("ak-action-button") diff --git a/web/src/elements/buttons/Dropdown.ts b/web/src/elements/buttons/Dropdown.ts index 995327500..39cd471c3 100644 --- a/web/src/elements/buttons/Dropdown.ts +++ b/web/src/elements/buttons/Dropdown.ts @@ -1,8 +1,8 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; + import { LitElement, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; -import { EVENT_REFRESH } from "../../constants"; - @customElement("ak-dropdown") export class DropdownButton extends LitElement { menu: HTMLElement | null; diff --git a/web/src/elements/buttons/ModalButton.ts b/web/src/elements/buttons/ModalButton.ts index 44a9835e8..b5a0f7b97 100644 --- a/web/src/elements/buttons/ModalButton.ts +++ b/web/src/elements/buttons/ModalButton.ts @@ -1,7 +1,9 @@ +import { PFSize } from "@goauthentik/web/elements/Spinner"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBackdrop from "@patternfly/patternfly/components/Backdrop/backdrop.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -14,8 +16,6 @@ import PFTitle from "@patternfly/patternfly/components/Title/title.css"; import PFBullseye from "@patternfly/patternfly/layouts/Bullseye/bullseye.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { PFSize } from "../Spinner"; - export const MODAL_BUTTON_STYLES = css` :host { text-align: left; diff --git a/web/src/elements/buttons/SpinnerButton.ts b/web/src/elements/buttons/SpinnerButton.ts index c6705d8ab..9bfead5af 100644 --- a/web/src/elements/buttons/SpinnerButton.ts +++ b/web/src/elements/buttons/SpinnerButton.ts @@ -1,14 +1,14 @@ +import { ERROR_CLASS, PROGRESS_CLASS, SUCCESS_CLASS } from "@goauthentik/web/constants"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, 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 PFSpinner from "@patternfly/patternfly/components/Spinner/spinner.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { ERROR_CLASS, PROGRESS_CLASS, SUCCESS_CLASS } from "../../constants"; -import { PFSize } from "../Spinner"; - @customElement("ak-spinner-button") export class SpinnerButton extends LitElement { @property({ type: Boolean }) diff --git a/web/src/elements/buttons/TokenCopyButton.ts b/web/src/elements/buttons/TokenCopyButton.ts index f733affce..2f3a1b32e 100644 --- a/web/src/elements/buttons/TokenCopyButton.ts +++ b/web/src/elements/buttons/TokenCopyButton.ts @@ -1,13 +1,14 @@ +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 { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; + import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { CoreApi, ResponseError } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { ERROR_CLASS, SECONDARY_CLASS, SUCCESS_CLASS } from "../../constants"; -import { PFSize } from "../Spinner"; -import { MessageLevel } from "../messages/Message"; -import { showMessage } from "../messages/MessageContainer"; import { ActionButton } from "./ActionButton"; @customElement("ak-token-copy-button") diff --git a/web/src/elements/cards/AggregateCard.ts b/web/src/elements/cards/AggregateCard.ts index ef7fb942a..b619f8769 100644 --- a/web/src/elements/cards/AggregateCard.ts +++ b/web/src/elements/cards/AggregateCard.ts @@ -2,7 +2,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFFlex from "@patternfly/patternfly/layouts/Flex/flex.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; diff --git a/web/src/elements/cards/AggregatePromiseCard.ts b/web/src/elements/cards/AggregatePromiseCard.ts index 2c6522db6..98d8d1cdd 100644 --- a/web/src/elements/cards/AggregatePromiseCard.ts +++ b/web/src/elements/cards/AggregatePromiseCard.ts @@ -1,9 +1,10 @@ +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/Spinner"; + import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import "../Spinner"; -import { PFSize } from "../Spinner"; import { AggregateCard } from "./AggregateCard"; @customElement("ak-aggregate-card-promise") diff --git a/web/src/elements/charts/AdminLoginsChart.ts b/web/src/elements/charts/AdminLoginsChart.ts index 2b8eff492..82912af17 100644 --- a/web/src/elements/charts/AdminLoginsChart.ts +++ b/web/src/elements/charts/AdminLoginsChart.ts @@ -1,3 +1,4 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { ChartData } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,7 +7,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi, LoginMetrics } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; import { AKChart } from "./Chart"; @customElement("ak-charts-admin-login") diff --git a/web/src/elements/charts/AdminModelPerDay.ts b/web/src/elements/charts/AdminModelPerDay.ts index 547761e41..bfbcce6a3 100644 --- a/web/src/elements/charts/AdminModelPerDay.ts +++ b/web/src/elements/charts/AdminModelPerDay.ts @@ -1,3 +1,4 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { ChartData, Tick } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,7 +7,6 @@ import { customElement, property } from "lit/decorators.js"; import { Coordinate, EventActions, EventsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; import { AKChart } from "./Chart"; @customElement("ak-charts-admin-model-per-day") diff --git a/web/src/elements/charts/ApplicationAuthorizeChart.ts b/web/src/elements/charts/ApplicationAuthorizeChart.ts index b88c10ce1..a907f908c 100644 --- a/web/src/elements/charts/ApplicationAuthorizeChart.ts +++ b/web/src/elements/charts/ApplicationAuthorizeChart.ts @@ -1,3 +1,4 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { ChartData } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,7 +7,6 @@ import { customElement, property } from "lit/decorators.js"; import { Coordinate, CoreApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; import { AKChart } from "./Chart"; @customElement("ak-charts-application-authorize") diff --git a/web/src/elements/charts/Chart.ts b/web/src/elements/charts/Chart.ts index 348e4398d..2087fc35a 100644 --- a/web/src/elements/charts/Chart.ts +++ b/web/src/elements/charts/Chart.ts @@ -1,3 +1,8 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { + FONT_COLOUR_DARK_MODE, + FONT_COLOUR_LIGHT_MODE, +} from "@goauthentik/web/pages/flows/FlowDiagram"; import { Chart, ChartConfiguration, ChartData, ChartOptions, Plugin, Tick } from "chart.js"; import { Legend, Tooltip } from "chart.js"; import { BarController, DoughnutController, LineController } from "chart.js"; @@ -10,9 +15,6 @@ import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { property } from "lit/decorators.js"; -import { EVENT_REFRESH } from "../../constants"; -import { FONT_COLOUR_DARK_MODE, FONT_COLOUR_LIGHT_MODE } from "../../pages/flows/FlowDiagram"; - Chart.register(Legend, Tooltip); Chart.register(LineController, BarController, DoughnutController); Chart.register(ArcElement, BarElement); diff --git a/web/src/elements/charts/UserChart.ts b/web/src/elements/charts/UserChart.ts index 162731638..04889fd47 100644 --- a/web/src/elements/charts/UserChart.ts +++ b/web/src/elements/charts/UserChart.ts @@ -1,3 +1,4 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; import { ChartData } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,7 +7,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, UserMetrics } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; import { AKChart } from "./Chart"; @customElement("ak-charts-user") diff --git a/web/src/elements/chips/Chip.ts b/web/src/elements/chips/Chip.ts index de6c042bc..1c0ac8487 100644 --- a/web/src/elements/chips/Chip.ts +++ b/web/src/elements/chips/Chip.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, 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 PFChip from "@patternfly/patternfly/components/Chip/chip.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; diff --git a/web/src/elements/chips/ChipGroup.ts b/web/src/elements/chips/ChipGroup.ts index 798d6a818..8811deddb 100644 --- a/web/src/elements/chips/ChipGroup.ts +++ b/web/src/elements/chips/ChipGroup.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } 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 PFChip from "@patternfly/patternfly/components/Chip/chip.css"; import PFChipGroup from "@patternfly/patternfly/components/ChipGroup/chip-group.css"; diff --git a/web/src/elements/events/ObjectChangelog.ts b/web/src/elements/events/ObjectChangelog.ts index 98fb2e4bc..21f718adf 100644 --- a/web/src/elements/events/ObjectChangelog.ts +++ b/web/src/elements/events/ObjectChangelog.ts @@ -1,3 +1,14 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EventWithContext } from "@goauthentik/web/api/Events"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/Dropdown"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; +import "@goauthentik/web/pages/events/EventInfo"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,17 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { Event, EventsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EventWithContext } from "../../api/Events"; -import { uiConfig } from "../../common/config"; -import "../../pages/events/EventInfo"; -import "../Tabs"; -import "../buttons/Dropdown"; -import "../buttons/ModalButton"; -import "../buttons/SpinnerButton"; -import { Table, TableColumn } from "../table/Table"; - @customElement("ak-object-changelog") export class ObjectChangelog extends Table { expandable = true; diff --git a/web/src/elements/events/UserEvents.ts b/web/src/elements/events/UserEvents.ts index 3a0e72ae5..1bea3b120 100644 --- a/web/src/elements/events/UserEvents.ts +++ b/web/src/elements/events/UserEvents.ts @@ -1,3 +1,14 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EventWithContext } from "@goauthentik/web/api/Events"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/../pages/events/EventInfo"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/Dropdown"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,17 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { Event, EventsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EventWithContext } from "../../api/Events"; -import { uiConfig } from "../../common/config"; -import "../../pages/events/EventInfo"; -import "../Tabs"; -import "../buttons/Dropdown"; -import "../buttons/ModalButton"; -import "../buttons/SpinnerButton"; -import { Table, TableColumn } from "../table/Table"; - @customElement("ak-events-user") export class ObjectChangelog extends Table { expandable = true; diff --git a/web/src/elements/forms/ConfirmationForm.ts b/web/src/elements/forms/ConfirmationForm.ts index aecb87eae..72f80f496 100644 --- a/web/src/elements/forms/ConfirmationForm.ts +++ b/web/src/elements/forms/ConfirmationForm.ts @@ -1,14 +1,14 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { ModalButton } from "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import { EVENT_REFRESH } from "../../constants"; -import { ModalButton } from "../buttons/ModalButton"; -import "../buttons/SpinnerButton"; -import { MessageLevel } from "../messages/Message"; -import { showMessage } from "../messages/MessageContainer"; - @customElement("ak-forms-confirm") export class ConfirmationForm extends ModalButton { @property() diff --git a/web/src/elements/forms/DeleteBulkForm.ts b/web/src/elements/forms/DeleteBulkForm.ts index 1daa4dffd..4c5268ae9 100644 --- a/web/src/elements/forms/DeleteBulkForm.ts +++ b/web/src/elements/forms/DeleteBulkForm.ts @@ -1,3 +1,12 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import { ModalButton } from "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -8,15 +17,6 @@ import PFList from "@patternfly/patternfly/components/List/list.css"; import { UsedBy, UsedByActionEnum } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { EVENT_REFRESH } from "../../constants"; -import { PFSize } from "../Spinner"; -import { ModalButton } from "../buttons/ModalButton"; -import "../buttons/SpinnerButton"; -import { MessageLevel } from "../messages/Message"; -import { showMessage } from "../messages/MessageContainer"; -import { Table, TableColumn } from "../table/Table"; - type BulkDeleteMetadata = { key: string; value: string }[]; @customElement("ak-delete-objects-table") diff --git a/web/src/elements/forms/DeleteForm.ts b/web/src/elements/forms/DeleteForm.ts index c0f764b02..de957505c 100644 --- a/web/src/elements/forms/DeleteForm.ts +++ b/web/src/elements/forms/DeleteForm.ts @@ -1,3 +1,9 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { ModalButton } from "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -8,12 +14,6 @@ import PFList from "@patternfly/patternfly/components/List/list.css"; import { UsedBy, UsedByActionEnum } from "@goauthentik/api"; -import { EVENT_REFRESH } from "../../constants"; -import { ModalButton } from "../buttons/ModalButton"; -import "../buttons/SpinnerButton"; -import { MessageLevel } from "../messages/Message"; -import { showMessage } from "../messages/MessageContainer"; - @customElement("ak-forms-delete") export class DeleteForm extends ModalButton { static get styles(): CSSResult[] { diff --git a/web/src/elements/forms/Form.ts b/web/src/elements/forms/Form.ts index 6e0583bda..c67a72364 100644 --- a/web/src/elements/forms/Form.ts +++ b/web/src/elements/forms/Form.ts @@ -1,3 +1,8 @@ +import { SearchSelect } from "@goauthentik/web/SearchSelect"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { camelToSnake, convertToSlug } from "@goauthentik/web/utils"; import "@polymer/iron-form/iron-form"; import { IronFormElement } from "@polymer/iron-form/iron-form"; import "@polymer/paper-input/paper-input"; @@ -5,7 +10,7 @@ import "@polymer/paper-input/paper-input"; import { CSSResult, LitElement, TemplateResult, css, 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"; @@ -16,11 +21,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { ResponseError, ValidationError } from "@goauthentik/api"; -import { EVENT_REFRESH } from "../../constants"; -import { showMessage } from "../../elements/messages/MessageContainer"; -import { camelToSnake, convertToSlug } from "../../utils"; -import { SearchSelect } from "../SearchSelect"; -import { MessageLevel } from "../messages/Message"; import { HorizontalFormElement } from "./HorizontalFormElement"; export class APIError extends Error { diff --git a/web/src/elements/forms/FormGroup.ts b/web/src/elements/forms/FormGroup.ts index 0c67decec..0fb57fa2e 100644 --- a/web/src/elements/forms/FormGroup.ts +++ b/web/src/elements/forms/FormGroup.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; diff --git a/web/src/elements/forms/HorizontalFormElement.ts b/web/src/elements/forms/HorizontalFormElement.ts index ad546c726..01a02bec7 100644 --- a/web/src/elements/forms/HorizontalFormElement.ts +++ b/web/src/elements/forms/HorizontalFormElement.ts @@ -1,15 +1,16 @@ +import { convertToSlug } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, css } from "lit"; import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; 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 { convertToSlug } from "../../utils"; import { FormGroup } from "./FormGroup"; @customElement("ak-form-element-horizontal") diff --git a/web/src/elements/forms/ModalForm.ts b/web/src/elements/forms/ModalForm.ts index 10f0d74ae..cca7c1486 100644 --- a/web/src/elements/forms/ModalForm.ts +++ b/web/src/elements/forms/ModalForm.ts @@ -1,12 +1,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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import { EVENT_REFRESH } from "../../constants"; -import "../LoadingOverlay"; -import { ModalButton } from "../buttons/ModalButton"; -import "../buttons/SpinnerButton"; import { Form } from "./Form"; @customElement("ak-forms-modal") diff --git a/web/src/elements/forms/ModelForm.ts b/web/src/elements/forms/ModelForm.ts index bb6cc591e..ca74503b8 100644 --- a/web/src/elements/forms/ModelForm.ts +++ b/web/src/elements/forms/ModelForm.ts @@ -1,7 +1,8 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; + import { TemplateResult } from "lit"; import { property } from "lit/decorators.js"; -import { EVENT_REFRESH } from "../../constants"; import { Form } from "./Form"; export abstract class ModelForm extends Form { diff --git a/web/src/elements/messages/MessageContainer.ts b/web/src/elements/messages/MessageContainer.ts index c670ffbcf..ba289d98f 100644 --- a/web/src/elements/messages/MessageContainer.ts +++ b/web/src/elements/messages/MessageContainer.ts @@ -1,15 +1,15 @@ +import { SentryIgnoredError } from "@goauthentik/web/common/errors"; +import { WSMessage } from "@goauthentik/web/common/ws"; +import { EVENT_WS_MESSAGE, WS_MSG_TYPE_MESSAGE } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/messages/Message"; +import { APIMessage } from "@goauthentik/web/elements/messages/Message"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import PFAlertGroup from "@patternfly/patternfly/components/AlertGroup/alert-group.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { SentryIgnoredError } from "../../common/errors"; -import { WSMessage } from "../../common/ws"; -import { EVENT_WS_MESSAGE, WS_MSG_TYPE_MESSAGE } from "../../constants"; -import "./Message"; -import { APIMessage } from "./Message"; - export function showMessage(message: APIMessage, unique = false): void { const container = document.querySelector("ak-message-container"); if (!container) { diff --git a/web/src/elements/messages/Middleware.ts b/web/src/elements/messages/Middleware.ts index f51d3580f..228dce1bc 100644 --- a/web/src/elements/messages/Middleware.ts +++ b/web/src/elements/messages/Middleware.ts @@ -1,10 +1,10 @@ +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; + import { t } from "@lingui/macro"; import { Middleware, ResponseContext } from "@goauthentik/api"; -import { MessageLevel } from "./Message"; -import { showMessage } from "./MessageContainer"; - export class MessageMiddleware implements Middleware { post(context: ResponseContext): Promise { if (context.response.status >= 500) { diff --git a/web/src/elements/notifications/APIDrawer.ts b/web/src/elements/notifications/APIDrawer.ts index e601de427..71727e6f5 100644 --- a/web/src/elements/notifications/APIDrawer.ts +++ b/web/src/elements/notifications/APIDrawer.ts @@ -1,9 +1,11 @@ +import { EVENT_API_DRAWER_REFRESH, EVENT_API_DRAWER_TOGGLE } from "@goauthentik/web/constants"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, 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 PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css"; @@ -12,8 +14,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { Middleware, ResponseContext } from "@goauthentik/api"; -import { EVENT_API_DRAWER_REFRESH, EVENT_API_DRAWER_TOGGLE } from "../../constants"; - export interface RequestInfo { method: string; path: string; diff --git a/web/src/elements/notifications/NotificationDrawer.ts b/web/src/elements/notifications/NotificationDrawer.ts index e5be9950e..700ef9d43 100644 --- a/web/src/elements/notifications/NotificationDrawer.ts +++ b/web/src/elements/notifications/NotificationDrawer.ts @@ -1,9 +1,17 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { me } from "@goauthentik/web/api/Users"; +import { EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_REFRESH } from "@goauthentik/web/constants"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { ActionToLabel } from "@goauthentik/web/pages/events/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, 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 PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css"; @@ -12,14 +20,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { EventsApi, Notification } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { me } from "../../api/Users"; -import { EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_REFRESH } from "../../constants"; -import { ActionToLabel } from "../../pages/events/utils"; -import { MessageLevel } from "../messages/Message"; -import { showMessage } from "../messages/MessageContainer"; - @customElement("ak-notification-drawer") export class NotificationDrawer extends LitElement { @property({ attribute: false }) diff --git a/web/src/elements/oauth/UserRefreshList.ts b/web/src/elements/oauth/UserRefreshList.ts index 891bfae26..5f361a2df 100644 --- a/web/src/elements/oauth/UserRefreshList.ts +++ b/web/src/elements/oauth/UserRefreshList.ts @@ -1,3 +1,10 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -7,13 +14,6 @@ import PFFlex from "@patternfly/patternfly/layouts/Flex/flex.css"; import { ExpiringBaseGrantModel, Oauth2Api, RefreshTokenModel } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../Label"; -import "../forms/DeleteBulkForm"; -import { Table, TableColumn } from "../table/Table"; - @customElement("ak-user-oauth-refresh-list") export class UserOAuthRefreshList extends Table { expandable = true; diff --git a/web/src/elements/router/Route.ts b/web/src/elements/router/Route.ts index cfc332f64..763e13582 100644 --- a/web/src/elements/router/Route.ts +++ b/web/src/elements/router/Route.ts @@ -1,8 +1,8 @@ +import "@goauthentik/web/elements/EmptyState"; + import { TemplateResult, html } from "lit"; import { until } from "lit/directives/until.js"; -import "../EmptyState"; - export const SLUG_REGEX = "[-a-zA-Z0-9_]+"; export const ID_REGEX = "\\d+"; export const UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; diff --git a/web/src/elements/router/RouteMatch.ts b/web/src/elements/router/RouteMatch.ts index b887d58e3..2655cc087 100644 --- a/web/src/elements/router/RouteMatch.ts +++ b/web/src/elements/router/RouteMatch.ts @@ -1,7 +1,7 @@ -import { TemplateResult } from "lit"; +import { ROUTE_SEPARATOR } from "@goauthentik/web/constants"; +import { Route } from "@goauthentik/web/elements/router/Route"; -import { ROUTE_SEPARATOR } from "../../constants"; -import { Route } from "./Route"; +import { TemplateResult } from "lit"; export class RouteMatch { route: Route; diff --git a/web/src/elements/router/RouterOutlet.ts b/web/src/elements/router/RouterOutlet.ts index 1e9f61517..aa1d1faa8 100644 --- a/web/src/elements/router/RouterOutlet.ts +++ b/web/src/elements/router/RouterOutlet.ts @@ -1,12 +1,13 @@ +import { ROUTE_SEPARATOR } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/router/Router404"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; -import { ROUTE_SEPARATOR } from "../../constants"; import { Route } from "./Route"; import { RouteMatch } from "./RouteMatch"; -import "./Router404"; // Poliyfill for hashchange.newURL, // https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange diff --git a/web/src/elements/sidebar/Sidebar.ts b/web/src/elements/sidebar/Sidebar.ts index 61e91b851..9bdf182a6 100644 --- a/web/src/elements/sidebar/Sidebar.ts +++ b/web/src/elements/sidebar/Sidebar.ts @@ -1,14 +1,14 @@ +import "@goauthentik/web/elements/sidebar/SidebarBrand"; +import "@goauthentik/web/elements/sidebar/SidebarUser"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFNav from "@patternfly/patternfly/components/Nav/nav.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import "./SidebarBrand"; -import "./SidebarUser"; - @customElement("ak-sidebar") export class Sidebar extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/elements/sidebar/SidebarBrand.ts b/web/src/elements/sidebar/SidebarBrand.ts index ca6cbaa75..acee4d94d 100644 --- a/web/src/elements/sidebar/SidebarBrand.ts +++ b/web/src/elements/sidebar/SidebarBrand.ts @@ -1,7 +1,12 @@ +import { tenant } from "@goauthentik/web/api/Config"; +import { configureSentry } from "@goauthentik/web/api/Sentry"; +import { EVENT_SIDEBAR_TOGGLE } from "@goauthentik/web/constants"; +import { first } from "@goauthentik/web/utils"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, 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 PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFGlobal from "@patternfly/patternfly/patternfly-base.css"; @@ -9,11 +14,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { CurrentTenant } from "@goauthentik/api"; -import { tenant } from "../../api/Config"; -import { configureSentry } from "../../api/Sentry"; -import { EVENT_SIDEBAR_TOGGLE } from "../../constants"; -import { first } from "../../utils"; - // If the viewport is wider than MIN_WIDTH, the sidebar // is shown besides the content, and not overlaid. export const MIN_WIDTH = 1200; diff --git a/web/src/elements/sidebar/SidebarItem.ts b/web/src/elements/sidebar/SidebarItem.ts index 9355e11d0..bc98697eb 100644 --- a/web/src/elements/sidebar/SidebarItem.ts +++ b/web/src/elements/sidebar/SidebarItem.ts @@ -1,15 +1,15 @@ +import { ROUTE_SEPARATOR } from "@goauthentik/web/constants"; + import { CSSResult, LitElement, css } from "lit"; import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFNav from "@patternfly/patternfly/components/Nav/nav.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { ROUTE_SEPARATOR } from "../../constants"; - @customElement("ak-sidebar-item") export class SidebarItem extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/elements/sidebar/SidebarUser.ts b/web/src/elements/sidebar/SidebarUser.ts index e93f91543..90d5194b7 100644 --- a/web/src/elements/sidebar/SidebarUser.ts +++ b/web/src/elements/sidebar/SidebarUser.ts @@ -1,3 +1,5 @@ +import { me } from "@goauthentik/web/api/Users"; + import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; @@ -7,8 +9,6 @@ import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; import PFNav from "@patternfly/patternfly/components/Nav/nav.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { me } from "../../api/Users"; - @customElement("ak-sidebar-user") export class SidebarUser extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/elements/table/Table.ts b/web/src/elements/table/Table.ts index bed7f299d..57aae91c6 100644 --- a/web/src/elements/table/Table.ts +++ b/web/src/elements/table/Table.ts @@ -1,10 +1,21 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/chips/Chip"; +import "@goauthentik/web/elements/chips/ChipGroup"; +import { getURLParam, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import "@goauthentik/web/elements/table/TablePagination"; +import "@goauthentik/web/elements/table/TableSearch"; +import { groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { property, state } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css"; import PFPagination from "@patternfly/patternfly/components/Pagination/pagination.css"; @@ -13,17 +24,6 @@ import PFToolbar from "@patternfly/patternfly/components/Toolbar/toolbar.css"; import PFBullseye from "@patternfly/patternfly/layouts/Bullseye/bullseye.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { AKResponse } from "../../api/Client"; -import { EVENT_REFRESH } from "../../constants"; -import { groupBy } from "../../utils"; -import "../EmptyState"; -import "../buttons/SpinnerButton"; -import "../chips/Chip"; -import "../chips/ChipGroup"; -import { getURLParam, updateURLParams } from "../router/RouteMatch"; -import "./TablePagination"; -import "./TableSearch"; - export class TableColumn { title: string; orderBy?: string; diff --git a/web/src/elements/table/TableModal.ts b/web/src/elements/table/TableModal.ts index 83c0ca525..a776577c1 100644 --- a/web/src/elements/table/TableModal.ts +++ b/web/src/elements/table/TableModal.ts @@ -1,8 +1,11 @@ +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import { MODAL_BUTTON_STYLES } from "@goauthentik/web/elements/buttons/ModalButton"; + import { CSSResult, LitElement } from "lit"; import { TemplateResult, html } from "lit"; import { property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBackdrop from "@patternfly/patternfly/components/Backdrop/backdrop.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFModalBox from "@patternfly/patternfly/components/ModalBox/modal-box.css"; @@ -10,8 +13,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 { PFSize } from "../Spinner"; -import { MODAL_BUTTON_STYLES } from "../buttons/ModalButton"; import { Table } from "./Table"; export abstract class TableModal extends Table { diff --git a/web/src/elements/table/TablePage.ts b/web/src/elements/table/TablePage.ts index 8a8d02688..c5e48b393 100644 --- a/web/src/elements/table/TablePage.ts +++ b/web/src/elements/table/TablePage.ts @@ -1,3 +1,6 @@ +import "@goauthentik/web/elements/../elements/PageHeader"; +import { updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; + import { t } from "@lingui/macro"; import { CSSResult } from "lit"; @@ -8,8 +11,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 "../../elements/PageHeader"; -import { updateURLParams } from "../router/RouteMatch"; import { Table } from "./Table"; export abstract class TablePage extends Table { diff --git a/web/src/elements/table/TablePagination.ts b/web/src/elements/table/TablePagination.ts index 41326ed68..f1d50d83c 100644 --- a/web/src/elements/table/TablePagination.ts +++ b/web/src/elements/table/TablePagination.ts @@ -1,15 +1,15 @@ +import { AKPagination } from "@goauthentik/web/api/Client"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, 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 PFPagination from "@patternfly/patternfly/components/Pagination/pagination.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { AKPagination } from "../../api/Client"; - @customElement("ak-table-pagination") export class TablePagination extends LitElement { @property({ attribute: false }) diff --git a/web/src/elements/table/TableSearch.ts b/web/src/elements/table/TableSearch.ts index a75d8782a..c43e59ff4 100644 --- a/web/src/elements/table/TableSearch.ts +++ b/web/src/elements/table/TableSearch.ts @@ -4,7 +4,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import PFInputGroup from "@patternfly/patternfly/components/InputGroup/input-group.css"; diff --git a/web/src/elements/user/SessionList.ts b/web/src/elements/user/SessionList.ts index bf4a41a69..f22995d69 100644 --- a/web/src/elements/user/SessionList.ts +++ b/web/src/elements/user/SessionList.ts @@ -1,3 +1,9 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,12 +11,6 @@ import { customElement, property } from "lit/decorators.js"; import { AuthenticatedSession, CoreApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../forms/DeleteBulkForm"; -import { Table, TableColumn } from "../table/Table"; - @customElement("ak-user-session-list") export class AuthenticatedSessionList extends Table { @property() diff --git a/web/src/elements/user/UserConsentList.ts b/web/src/elements/user/UserConsentList.ts index 742a2719d..7accd8da1 100644 --- a/web/src/elements/user/UserConsentList.ts +++ b/web/src/elements/user/UserConsentList.ts @@ -1,3 +1,9 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,12 +11,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, UserConsent } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../forms/DeleteBulkForm"; -import { Table, TableColumn } from "../table/Table"; - @customElement("ak-user-consent-list") export class UserConsentList extends Table { @property({ type: Number }) diff --git a/web/src/elements/utils/TimeDeltaHelp.ts b/web/src/elements/utils/TimeDeltaHelp.ts index 0ebcd8496..033d1a5bd 100644 --- a/web/src/elements/utils/TimeDeltaHelp.ts +++ b/web/src/elements/utils/TimeDeltaHelp.ts @@ -1,15 +1,15 @@ +import "@goauthentik/web/elements/Tooltip"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFList from "@patternfly/patternfly/components/List/list.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import "../Tooltip"; - @customElement("ak-utils-time-delta-help") export class TimeDeltaHelp extends LitElement { @property({ type: Boolean }) diff --git a/web/src/elements/wizard/FormWizardPage.ts b/web/src/elements/wizard/FormWizardPage.ts index 264cbb416..b4a92468a 100644 --- a/web/src/elements/wizard/FormWizardPage.ts +++ b/web/src/elements/wizard/FormWizardPage.ts @@ -1,8 +1,9 @@ +import { Form } from "@goauthentik/web/elements/forms/Form"; + import { t } from "@lingui/macro"; import { customElement } from "lit/decorators.js"; -import { Form } from "../forms/Form"; import { WizardPage } from "./WizardPage"; @customElement("ak-wizard-page-form") diff --git a/web/src/elements/wizard/Wizard.ts b/web/src/elements/wizard/Wizard.ts index 13da9c658..d1df155c7 100644 --- a/web/src/elements/wizard/Wizard.ts +++ b/web/src/elements/wizard/Wizard.ts @@ -1,3 +1,5 @@ +import { ModalButton } from "@goauthentik/web/elements/buttons/ModalButton"; + import { t } from "@lingui/macro"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; @@ -7,7 +9,6 @@ import { state } from "lit/decorators.js"; import PFWizard from "@patternfly/patternfly/components/Wizard/wizard.css"; -import { ModalButton } from "../buttons/ModalButton"; import { WizardPage } from "./WizardPage"; @customElement("ak-wizard") diff --git a/web/src/flows/FlowExecutor.ts b/web/src/flows/FlowExecutor.ts index 48a606d80..ee7cba17d 100644 --- a/web/src/flows/FlowExecutor.ts +++ b/web/src/flows/FlowExecutor.ts @@ -1,3 +1,21 @@ +import { DEFAULT_CONFIG, tenant } from "@goauthentik/web/api/Config"; +import { configureSentry } from "@goauthentik/web/api/Sentry"; +import { WebsocketClient } from "@goauthentik/web/common/ws"; +import { EVENT_FLOW_ADVANCE, TITLE_DEFAULT } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/LoadingOverlay"; +import "@goauthentik/web/flows/stages/RedirectStage"; +import "@goauthentik/web/flows/stages/access_denied/AccessDeniedStage"; +// Import webauthn-related stages to prevent issues on safari +// Which is overly sensitive to allowing things only in the context of a +// user interaction +import "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStage"; +import "@goauthentik/web/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage"; +import "@goauthentik/web/flows/stages/autosubmit/AutosubmitStage"; +import "@goauthentik/web/flows/stages/captcha/CaptchaStage"; +import "@goauthentik/web/flows/stages/identification/IdentificationStage"; +import "@goauthentik/web/flows/stages/password/PasswordStage"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; @@ -5,7 +23,7 @@ import { customElement, property } from "lit/decorators.js"; import { unsafeHTML } from "lit/directives/unsafe-html.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBackgroundImage from "@patternfly/patternfly/components/BackgroundImage/background-image.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFDrawer from "@patternfly/patternfly/components/Drawer/drawer.css"; @@ -26,24 +44,7 @@ import { ShellChallenge, } from "@goauthentik/api"; -import { DEFAULT_CONFIG, tenant } from "../api/Config"; -import { configureSentry } from "../api/Sentry"; -import { WebsocketClient } from "../common/ws"; -import { EVENT_FLOW_ADVANCE, TITLE_DEFAULT } from "../constants"; -import "../elements/LoadingOverlay"; -import { first } from "../utils"; -import "./stages/RedirectStage"; -import "./stages/access_denied/AccessDeniedStage"; -// Import webauthn-related stages to prevent issues on safari -// Which is overly sensitive to allowing things only in the context of a -// user interaction -import "./stages/authenticator_validate/AuthenticatorValidateStage"; -import "./stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage"; -import "./stages/autosubmit/AutosubmitStage"; import { StageHost } from "./stages/base"; -import "./stages/captcha/CaptchaStage"; -import "./stages/identification/IdentificationStage"; -import "./stages/password/PasswordStage"; export interface FlowWindow extends Window { authentik: { diff --git a/web/src/flows/FlowInspector.ts b/web/src/flows/FlowInspector.ts index 33cc4a400..40a13aa3d 100644 --- a/web/src/flows/FlowInspector.ts +++ b/web/src/flows/FlowInspector.ts @@ -1,9 +1,13 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_FLOW_ADVANCE } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/Expand"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css"; import PFNotificationDrawer from "@patternfly/patternfly/components/NotificationDrawer/notification-drawer.css"; @@ -13,10 +17,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { FlowInspection, FlowsApi, Stage } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../api/Config"; -import { EVENT_FLOW_ADVANCE } from "../constants"; -import "../elements/Expand"; - @customElement("ak-flow-inspector") export class FlowInspector extends LitElement { flowSlug: string; diff --git a/web/src/flows/sources/apple/AppleLoginInit.ts b/web/src/flows/sources/apple/AppleLoginInit.ts index 3fa505caf..eb11f8bbd 100644 --- a/web/src/flows/sources/apple/AppleLoginInit.ts +++ b/web/src/flows/sources/apple/AppleLoginInit.ts @@ -1,9 +1,12 @@ +import "@goauthentik/web/elements/EmptyState"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + 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 PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -13,9 +16,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { AppleChallengeResponseRequest, AppleLoginChallenge } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import { BaseStage } from "../../stages/base"; - @customElement("ak-flow-sources-oauth-apple") export class AppleLoginInit extends BaseStage { @property({ type: Boolean }) diff --git a/web/src/flows/sources/plex/PlexLoginInit.ts b/web/src/flows/sources/plex/PlexLoginInit.ts index 3cffa9b4a..1d2ee15fe 100644 --- a/web/src/flows/sources/plex/PlexLoginInit.ts +++ b/web/src/flows/sources/plex/PlexLoginInit.ts @@ -1,10 +1,16 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { PlexAPIClient, popupCenterScreen } from "@goauthentik/web/api/Plex"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult } from "lit"; import { TemplateResult, html } from "lit"; import { customElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -19,12 +25,6 @@ import { } from "@goauthentik/api"; import { SourcesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { PlexAPIClient, popupCenterScreen } from "../../../api/Plex"; -import { MessageLevel } from "../../../elements/messages/Message"; -import { showMessage } from "../../../elements/messages/MessageContainer"; -import { BaseStage } from "../../stages/base"; - @customElement("ak-flow-sources-plex") export class PlexLoginInit extends BaseStage< PlexAuthenticationChallenge, diff --git a/web/src/flows/stages/RedirectStage.ts b/web/src/flows/stages/RedirectStage.ts index eaf0b78cd..600244699 100644 --- a/web/src/flows/stages/RedirectStage.ts +++ b/web/src/flows/stages/RedirectStage.ts @@ -3,7 +3,7 @@ import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; diff --git a/web/src/flows/stages/access_denied/AccessDeniedStage.ts b/web/src/flows/stages/access_denied/AccessDeniedStage.ts index 71206e853..366d54812 100644 --- a/web/src/flows/stages/access_denied/AccessDeniedStage.ts +++ b/web/src/flows/stages/access_denied/AccessDeniedStage.ts @@ -1,10 +1,14 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import PFList from "@patternfly/patternfly/components/List/list.css"; @@ -14,10 +18,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { AccessDeniedChallenge, FlowChallengeResponseRequest } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-access-denied") export class AccessDeniedStage extends BaseStage< AccessDeniedChallenge, diff --git a/web/src/flows/stages/authenticator_duo/AuthenticatorDuoStage.ts b/web/src/flows/stages/authenticator_duo/AuthenticatorDuoStage.ts index 9f3652f1d..5bd275253 100644 --- a/web/src/flows/stages/authenticator_duo/AuthenticatorDuoStage.ts +++ b/web/src/flows/stages/authenticator_duo/AuthenticatorDuoStage.ts @@ -1,10 +1,16 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -18,12 +24,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-authenticator-duo") export class AuthenticatorDuoStage extends BaseStage< AuthenticatorDuoChallenge, diff --git a/web/src/flows/stages/authenticator_sms/AuthenticatorSMSStage.ts b/web/src/flows/stages/authenticator_sms/AuthenticatorSMSStage.ts index 3a3368a2c..f2ec93c50 100644 --- a/web/src/flows/stages/authenticator_sms/AuthenticatorSMSStage.ts +++ b/web/src/flows/stages/authenticator_sms/AuthenticatorSMSStage.ts @@ -1,10 +1,15 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.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 PFForm from "@patternfly/patternfly/components/Form/form.css"; @@ -18,11 +23,6 @@ import { AuthenticatorSMSChallengeResponseRequest, } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-authenticator-sms") export class AuthenticatorSMSStage extends BaseStage< AuthenticatorSMSChallenge, diff --git a/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts b/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts index 430d079a1..f283d45f3 100644 --- a/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts +++ b/web/src/flows/stages/authenticator_static/AuthenticatorStaticStage.ts @@ -1,10 +1,15 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -17,11 +22,6 @@ import { AuthenticatorStaticChallengeResponseRequest, } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-authenticator-static") export class AuthenticatorStaticStage extends BaseStage< AuthenticatorStaticChallenge, diff --git a/web/src/flows/stages/authenticator_totp/AuthenticatorTOTPStage.ts b/web/src/flows/stages/authenticator_totp/AuthenticatorTOTPStage.ts index 30e5c2060..b99e72fb2 100644 --- a/web/src/flows/stages/authenticator_totp/AuthenticatorTOTPStage.ts +++ b/web/src/flows/stages/authenticator_totp/AuthenticatorTOTPStage.ts @@ -1,3 +1,9 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; import "webcomponent-qr-code"; import { t } from "@lingui/macro"; @@ -6,7 +12,7 @@ import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -19,13 +25,6 @@ import { AuthenticatorTOTPChallengeResponseRequest, } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import { MessageLevel } from "../../../elements/messages/Message"; -import { showMessage } from "../../../elements/messages/MessageContainer"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-authenticator-totp") export class AuthenticatorTOTPStage extends BaseStage< AuthenticatorTOTPChallenge, diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStage.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStage.ts index 14809b9a3..746dad5b2 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStage.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStage.ts @@ -1,10 +1,17 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStageCode"; +import "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo"; +import "@goauthentik/web/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn"; +import { BaseStage, StageHost } from "@goauthentik/web/flows/stages/base"; +import { PasswordManagerPrefill } from "@goauthentik/web/flows/stages/identification/IdentificationStage"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, css, html } from "lit"; import { customElement, state } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -21,13 +28,6 @@ import { FlowsApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { BaseStage, StageHost } from "../base"; -import { PasswordManagerPrefill } from "../identification/IdentificationStage"; -import "./AuthenticatorValidateStageCode"; -import "./AuthenticatorValidateStageDuo"; -import "./AuthenticatorValidateStageWebAuthn"; - @customElement("ak-stage-authenticator-validate") export class AuthenticatorValidateStage extends BaseStage< diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts index dc29dde63..0cdf724ca 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageCode.ts @@ -1,10 +1,16 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; +import { PasswordManagerPrefill } from "@goauthentik/web/flows/stages/identification/IdentificationStage"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -19,11 +25,6 @@ import { DeviceClassesEnum, } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; -import { PasswordManagerPrefill } from "../identification/IdentificationStage"; import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage"; @customElement("ak-stage-authenticator-validate-code") diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts index 2f6e63b1b..c9a6d6a5f 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageDuo.ts @@ -1,10 +1,15 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -18,10 +23,6 @@ import { DeviceChallenge, } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage"; @customElement("ak-stage-authenticator-validate-duo") diff --git a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts index f47cab5c7..4dd996274 100644 --- a/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts +++ b/web/src/flows/stages/authenticator_validate/AuthenticatorValidateStageWebAuthn.ts @@ -1,9 +1,15 @@ +import { + transformAssertionForServer, + transformCredentialRequestOptions, +} from "@goauthentik/web/flows/stages/authenticator_webauthn/utils"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + 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 PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; @@ -19,11 +25,6 @@ import { DeviceChallenge, } from "@goauthentik/api"; -import { - transformAssertionForServer, - transformCredentialRequestOptions, -} from "../authenticator_webauthn/utils"; -import { BaseStage } from "../base"; import { AuthenticatorValidateStage } from "./AuthenticatorValidateStage"; @customElement("ak-stage-authenticator-validate-webauthn") diff --git a/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts b/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts index 1c25998bd..5f8b107a3 100644 --- a/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts +++ b/web/src/flows/stages/authenticator_webauthn/WebAuthnAuthenticatorRegisterStage.ts @@ -1,9 +1,12 @@ +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + 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 PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -16,8 +19,6 @@ import { AuthenticatorWebAuthnChallengeResponseRequest, } from "@goauthentik/api"; -import { PFSize } from "../../../elements/Spinner"; -import { BaseStage } from "../base"; import { Assertion, transformCredentialCreateOptions, diff --git a/web/src/flows/stages/autosubmit/AutosubmitStage.ts b/web/src/flows/stages/autosubmit/AutosubmitStage.ts index aa28b8a58..612a8f177 100644 --- a/web/src/flows/stages/autosubmit/AutosubmitStage.ts +++ b/web/src/flows/stages/autosubmit/AutosubmitStage.ts @@ -1,9 +1,12 @@ +import "@goauthentik/web/elements/EmptyState"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -13,9 +16,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { AutoSubmitChallengeResponseRequest, AutosubmitChallenge } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import { BaseStage } from "../base"; - @customElement("ak-stage-autosubmit") export class AutosubmitStage extends BaseStage< AutosubmitChallenge, diff --git a/web/src/flows/stages/captcha/CaptchaStage.ts b/web/src/flows/stages/captcha/CaptchaStage.ts index 14517643a..14aa8b105 100644 --- a/web/src/flows/stages/captcha/CaptchaStage.ts +++ b/web/src/flows/stages/captcha/CaptchaStage.ts @@ -1,10 +1,16 @@ +import "@goauthentik/web/elements/EmptyState"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -14,12 +20,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { CaptchaChallenge, CaptchaChallengeResponseRequest } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import { PFSize } from "../../../elements/Spinner"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-captcha") export class CaptchaStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/flows/stages/consent/ConsentStage.ts b/web/src/flows/stages/consent/ConsentStage.ts index 01711cde6..ea53dc901 100644 --- a/web/src/flows/stages/consent/ConsentStage.ts +++ b/web/src/flows/stages/consent/ConsentStage.ts @@ -1,10 +1,14 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -16,10 +20,6 @@ import PFSpacing from "@patternfly/patternfly/utilities/Spacing/spacing.css"; import { ConsentChallenge, ConsentChallengeResponseRequest } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-consent") export class ConsentStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/flows/stages/dummy/DummyStage.ts b/web/src/flows/stages/dummy/DummyStage.ts index 8d6369dd4..cbba575ff 100644 --- a/web/src/flows/stages/dummy/DummyStage.ts +++ b/web/src/flows/stages/dummy/DummyStage.ts @@ -1,9 +1,13 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -13,10 +17,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { DummyChallenge, DummyChallengeResponseRequest } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../FormStatic"; -import { BaseStage } from "../base"; - @customElement("ak-stage-dummy") export class DummyStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/flows/stages/email/EmailStage.ts b/web/src/flows/stages/email/EmailStage.ts index ff70f86e5..80e688ef0 100644 --- a/web/src/flows/stages/email/EmailStage.ts +++ b/web/src/flows/stages/email/EmailStage.ts @@ -1,9 +1,12 @@ +import "@goauthentik/web/elements/EmptyState"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -13,9 +16,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { EmailChallenge, EmailChallengeResponseRequest } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import { BaseStage } from "../base"; - @customElement("ak-stage-email") export class EmailStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/flows/stages/identification/IdentificationStage.ts b/web/src/flows/stages/identification/IdentificationStage.ts index 6926417e9..09e0ecca2 100644 --- a/web/src/flows/stages/identification/IdentificationStage.ts +++ b/web/src/flows/stages/identification/IdentificationStage.ts @@ -1,9 +1,14 @@ +import "@goauthentik/web/elements/Divider"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, css, html } from "lit"; import { customElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; @@ -19,11 +24,6 @@ import { UserFieldsEnum, } from "@goauthentik/api"; -import "../../../elements/Divider"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import { BaseStage } from "../base"; - export const PasswordManagerPrefill: { password: string | undefined; totp: string | undefined; diff --git a/web/src/flows/stages/password/PasswordStage.ts b/web/src/flows/stages/password/PasswordStage.ts index fdd160571..e0487fbda 100644 --- a/web/src/flows/stages/password/PasswordStage.ts +++ b/web/src/flows/stages/password/PasswordStage.ts @@ -1,10 +1,16 @@ +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import "@goauthentik/web/flows/FormStatic"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; +import { PasswordManagerPrefill } from "@goauthentik/web/flows/stages/identification/IdentificationStage"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -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 PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -14,12 +20,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { PasswordChallenge, PasswordChallengeResponseRequest } from "@goauthentik/api"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import "../../FormStatic"; -import { BaseStage } from "../base"; -import { PasswordManagerPrefill } from "../identification/IdentificationStage"; - @customElement("ak-stage-password") export class PasswordStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/flows/stages/prompt/PromptStage.ts b/web/src/flows/stages/prompt/PromptStage.ts index 9cce8181b..8af9d9339 100644 --- a/web/src/flows/stages/prompt/PromptStage.ts +++ b/web/src/flows/stages/prompt/PromptStage.ts @@ -1,10 +1,16 @@ +import "@goauthentik/web/elements/Divider"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/forms/FormElement"; +import { BaseStage } from "@goauthentik/web/flows/stages/base"; +import { LOCALES } from "@goauthentik/web/interfaces/locale"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { unsafeHTML } from "lit/directives/unsafe-html.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 PFForm from "@patternfly/patternfly/components/Form/form.css"; @@ -20,12 +26,6 @@ import { StagePrompt, } from "@goauthentik/api"; -import "../../../elements/Divider"; -import "../../../elements/EmptyState"; -import "../../../elements/forms/FormElement"; -import { LOCALES } from "../../../interfaces/locale"; -import { BaseStage } from "../base"; - @customElement("ak-stage-prompt") export class PromptStage extends BaseStage { static get styles(): CSSResult[] { diff --git a/web/src/interfaces/AdminInterface.ts b/web/src/interfaces/AdminInterface.ts index 71c91cc75..62bc38180 100644 --- a/web/src/interfaces/AdminInterface.ts +++ b/web/src/interfaces/AdminInterface.ts @@ -1,10 +1,30 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { me } from "@goauthentik/web/api/Users"; +import { WebsocketClient } from "@goauthentik/web/common/ws"; +import { + EVENT_API_DRAWER_TOGGLE, + EVENT_NOTIFICATION_DRAWER_TOGGLE, + EVENT_SIDEBAR_TOGGLE, + VERSION, +} from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/elements/notifications/NotificationDrawer"; +import { ID_REGEX, SLUG_REGEX, UUID_REGEX } from "@goauthentik/web/elements/router/Route"; +import { getURLParam, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import "@goauthentik/web/elements/router/RouterOutlet"; +import "@goauthentik/web/elements/sidebar/Sidebar"; +import "@goauthentik/web/elements/sidebar/SidebarItem"; +import "@goauthentik/web/interfaces/locale"; +import { ROUTES } from "@goauthentik/web/routesAdmin"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFDrawer from "@patternfly/patternfly/components/Drawer/drawer.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; @@ -12,26 +32,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { AdminApi, Version } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../api/Config"; -import { me } from "../api/Users"; -import { WebsocketClient } from "../common/ws"; -import { - EVENT_API_DRAWER_TOGGLE, - EVENT_NOTIFICATION_DRAWER_TOGGLE, - EVENT_SIDEBAR_TOGGLE, - VERSION, -} from "../constants"; -import "../elements/messages/MessageContainer"; -import "../elements/messages/MessageContainer"; -import "../elements/notifications/NotificationDrawer"; -import { ID_REGEX, SLUG_REGEX, UUID_REGEX } from "../elements/router/Route"; -import { getURLParam, updateURLParams } from "../elements/router/RouteMatch"; -import "../elements/router/RouterOutlet"; -import "../elements/sidebar/Sidebar"; -import "../elements/sidebar/SidebarItem"; -import { ROUTES } from "../routesAdmin"; -import "./locale"; - @customElement("ak-interface-admin") export class AdminInterface extends LitElement { @property({ type: Boolean }) diff --git a/web/src/interfaces/FlowInterface.ts b/web/src/interfaces/FlowInterface.ts index a32fe968a..fcc1433c0 100644 --- a/web/src/interfaces/FlowInterface.ts +++ b/web/src/interfaces/FlowInterface.ts @@ -1,3 +1,3 @@ -import "../elements/messages/MessageContainer"; -import "../flows/FlowExecutor"; -import "./locale"; +import "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/flows/FlowExecutor"; +import "@goauthentik/web/interfaces/locale"; diff --git a/web/src/interfaces/UserInterface.ts b/web/src/interfaces/UserInterface.ts index 5f682c447..ec88c57be 100644 --- a/web/src/interfaces/UserInterface.ts +++ b/web/src/interfaces/UserInterface.ts @@ -1,10 +1,32 @@ +import { DEFAULT_CONFIG, tenant } from "@goauthentik/web/api/Config"; +import { configureSentry } from "@goauthentik/web/api/Sentry"; +import { me } from "@goauthentik/web/api/Users"; +import { UserDisplay, uiConfig } from "@goauthentik/web/common/config"; +import { WebsocketClient } from "@goauthentik/web/common/ws"; +import { + EVENT_API_DRAWER_TOGGLE, + EVENT_NOTIFICATION_DRAWER_TOGGLE, + EVENT_WS_MESSAGE, +} from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/elements/notifications/NotificationDrawer"; +import { getURLParam, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import "@goauthentik/web/elements/router/RouterOutlet"; +import "@goauthentik/web/elements/sidebar/Sidebar"; +import { DefaultTenant } from "@goauthentik/web/elements/sidebar/SidebarBrand"; +import "@goauthentik/web/elements/sidebar/SidebarItem"; +import "@goauthentik/web/interfaces/locale"; +import { ROUTES } from "@goauthentik/web/routesUser"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; import PFBrand from "@patternfly/patternfly/components/Brand/brand.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; @@ -17,28 +39,6 @@ import PFDisplay from "@patternfly/patternfly/utilities/Display/display.css"; import { CurrentTenant, EventsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG, tenant } from "../api/Config"; -import { configureSentry } from "../api/Sentry"; -import { me } from "../api/Users"; -import { UserDisplay, uiConfig } from "../common/config"; -import { WebsocketClient } from "../common/ws"; -import { - EVENT_API_DRAWER_TOGGLE, - EVENT_NOTIFICATION_DRAWER_TOGGLE, - EVENT_WS_MESSAGE, -} from "../constants"; -import "../elements/messages/MessageContainer"; -import "../elements/messages/MessageContainer"; -import "../elements/notifications/NotificationDrawer"; -import { getURLParam, updateURLParams } from "../elements/router/RouteMatch"; -import "../elements/router/RouterOutlet"; -import "../elements/sidebar/Sidebar"; -import { DefaultTenant } from "../elements/sidebar/SidebarBrand"; -import "../elements/sidebar/SidebarItem"; -import { ROUTES } from "../routesUser"; -import { first } from "../utils"; -import "./locale"; - @customElement("ak-interface-user") export class UserInterface extends LitElement { @property({ type: Boolean }) diff --git a/web/src/pages/admin-overview/AdminOverviewPage.ts b/web/src/pages/admin-overview/AdminOverviewPage.ts index e23bacbdd..51681096c 100644 --- a/web/src/pages/admin-overview/AdminOverviewPage.ts +++ b/web/src/pages/admin-overview/AdminOverviewPage.ts @@ -1,32 +1,32 @@ +import { me } from "@goauthentik/web/api/Users"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/cards/AggregatePromiseCard"; +import "@goauthentik/web/elements/charts/AdminLoginsChart"; +import { paramURL } from "@goauthentik/web/elements/router/RouterOutlet"; +import "@goauthentik/web/pages/admin-overview/TopApplicationsTable"; +import "@goauthentik/web/pages/admin-overview/cards/AdminStatusCard"; +import "@goauthentik/web/pages/admin-overview/cards/SystemStatusCard"; +import "@goauthentik/web/pages/admin-overview/cards/VersionStatusCard"; +import "@goauthentik/web/pages/admin-overview/cards/WorkerStatusCard"; +import "@goauthentik/web/pages/admin-overview/charts/FlowStatusChart"; +import "@goauthentik/web/pages/admin-overview/charts/GroupCountStatusChart"; +import "@goauthentik/web/pages/admin-overview/charts/LDAPSyncStatusChart"; +import "@goauthentik/web/pages/admin-overview/charts/OutpostStatusChart"; +import "@goauthentik/web/pages/admin-overview/charts/PolicyStatusChart"; +import "@goauthentik/web/pages/admin-overview/charts/UserCountStatusChart"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFList from "@patternfly/patternfly/components/List/list.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFGrid from "@patternfly/patternfly/layouts/Grid/grid.css"; -import { me } from "../../api/Users"; -import "../../elements/PageHeader"; -import "../../elements/cards/AggregatePromiseCard"; -import "../../elements/charts/AdminLoginsChart"; -import { paramURL } from "../../elements/router/RouterOutlet"; -import "./TopApplicationsTable"; -import "./cards/AdminStatusCard"; -import "./cards/SystemStatusCard"; -import "./cards/VersionStatusCard"; -import "./cards/WorkerStatusCard"; -import "./charts/FlowStatusChart"; -import "./charts/GroupCountStatusChart"; -import "./charts/LDAPSyncStatusChart"; -import "./charts/OutpostStatusChart"; -import "./charts/PolicyStatusChart"; -import "./charts/UserCountStatusChart"; - @customElement("ak-admin-overview") export class AdminOverviewPage extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/pages/admin-overview/DashboardUserPage.ts b/web/src/pages/admin-overview/DashboardUserPage.ts index f7d91353d..040cb191f 100644 --- a/web/src/pages/admin-overview/DashboardUserPage.ts +++ b/web/src/pages/admin-overview/DashboardUserPage.ts @@ -1,9 +1,13 @@ +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/cards/AggregatePromiseCard"; +import "@goauthentik/web/elements/charts/AdminModelPerDay"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFList from "@patternfly/patternfly/components/List/list.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; @@ -11,10 +15,6 @@ import PFGrid from "@patternfly/patternfly/layouts/Grid/grid.css"; import { EventActions } from "@goauthentik/api"; -import "../../elements/PageHeader"; -import "../../elements/cards/AggregatePromiseCard"; -import "../../elements/charts/AdminModelPerDay"; - @customElement("ak-admin-dashboard-users") export class DashboardUserPage extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/pages/admin-overview/TopApplicationsTable.ts b/web/src/pages/admin-overview/TopApplicationsTable.ts index d9549d0f2..38d356caf 100644 --- a/web/src/pages/admin-overview/TopApplicationsTable.ts +++ b/web/src/pages/admin-overview/TopApplicationsTable.ts @@ -1,16 +1,16 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/Spinner"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFTable from "@patternfly/patternfly/components/Table/table.css"; import { EventTopPerUser, EventsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/Spinner"; - @customElement("ak-top-applications-table") export class TopApplicationsTable extends LitElement { @property({ attribute: false }) diff --git a/web/src/pages/admin-overview/cards/AdminStatusCard.ts b/web/src/pages/admin-overview/cards/AdminStatusCard.ts index 1650929da..d6a4e5cc1 100644 --- a/web/src/pages/admin-overview/cards/AdminStatusCard.ts +++ b/web/src/pages/admin-overview/cards/AdminStatusCard.ts @@ -1,10 +1,10 @@ +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import { AggregateCard } from "@goauthentik/web/elements/cards/AggregateCard"; + import { TemplateResult, html } from "lit"; import { until } from "lit/directives/until.js"; -import { EVENT_REFRESH } from "../../../constants"; -import { PFSize } from "../../../elements/Spinner"; -import { AggregateCard } from "../../../elements/cards/AggregateCard"; - export interface AdminStatus { icon: string; message?: TemplateResult; diff --git a/web/src/pages/admin-overview/cards/SystemStatusCard.ts b/web/src/pages/admin-overview/cards/SystemStatusCard.ts index 7649bc8fd..47b4300b1 100644 --- a/web/src/pages/admin-overview/cards/SystemStatusCard.ts +++ b/web/src/pages/admin-overview/cards/SystemStatusCard.ts @@ -1,3 +1,5 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,7 +7,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi, OutpostsApi, System } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; import { AdminStatus, AdminStatusCard } from "./AdminStatusCard"; @customElement("ak-admin-status-system") diff --git a/web/src/pages/admin-overview/cards/VersionStatusCard.ts b/web/src/pages/admin-overview/cards/VersionStatusCard.ts index dfb31d2fd..59b83e31b 100644 --- a/web/src/pages/admin-overview/cards/VersionStatusCard.ts +++ b/web/src/pages/admin-overview/cards/VersionStatusCard.ts @@ -1,3 +1,5 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,7 +7,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi, Version } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; import { AdminStatus, AdminStatusCard } from "./AdminStatusCard"; @customElement("ak-admin-status-version") diff --git a/web/src/pages/admin-overview/cards/WorkerStatusCard.ts b/web/src/pages/admin-overview/cards/WorkerStatusCard.ts index 628b26a40..54b0822ba 100644 --- a/web/src/pages/admin-overview/cards/WorkerStatusCard.ts +++ b/web/src/pages/admin-overview/cards/WorkerStatusCard.ts @@ -1,3 +1,5 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; + import { t } from "@lingui/macro"; import { html } from "lit"; @@ -5,7 +7,6 @@ import { customElement } from "lit/decorators.js"; import { AdminApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; import { AdminStatus, AdminStatusCard } from "./AdminStatusCard"; @customElement("ak-admin-status-card-workers") diff --git a/web/src/pages/admin-overview/charts/FlowStatusChart.ts b/web/src/pages/admin-overview/charts/FlowStatusChart.ts index 39c758ea7..536256847 100644 --- a/web/src/pages/admin-overview/charts/FlowStatusChart.ts +++ b/web/src/pages/admin-overview/charts/FlowStatusChart.ts @@ -1,3 +1,6 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; +import "@goauthentik/web/elements/forms/ConfirmationForm"; import { ChartData, ChartOptions } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,10 +9,6 @@ import { customElement } from "lit/decorators.js"; import { FlowsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { AKChart } from "../../../elements/charts/Chart"; -import "../../../elements/forms/ConfirmationForm"; - interface FlowMetrics { count: number; cached: number; diff --git a/web/src/pages/admin-overview/charts/GroupCountStatusChart.ts b/web/src/pages/admin-overview/charts/GroupCountStatusChart.ts index c1957b816..dfd7dfaff 100644 --- a/web/src/pages/admin-overview/charts/GroupCountStatusChart.ts +++ b/web/src/pages/admin-overview/charts/GroupCountStatusChart.ts @@ -1,3 +1,5 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; import { ChartData, ChartOptions } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,9 +8,6 @@ import { customElement } from "lit/decorators.js"; import { CoreApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { AKChart } from "../../../elements/charts/Chart"; - interface GroupMetrics { count: number; superusers: number; diff --git a/web/src/pages/admin-overview/charts/LDAPSyncStatusChart.ts b/web/src/pages/admin-overview/charts/LDAPSyncStatusChart.ts index f8aebf80f..5749d5b9d 100644 --- a/web/src/pages/admin-overview/charts/LDAPSyncStatusChart.ts +++ b/web/src/pages/admin-overview/charts/LDAPSyncStatusChart.ts @@ -1,3 +1,6 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; +import "@goauthentik/web/elements/forms/ConfirmationForm"; import { ChartData, ChartOptions } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,10 +9,6 @@ import { customElement } from "lit/decorators.js"; import { SourcesApi, StatusEnum } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { AKChart } from "../../../elements/charts/Chart"; -import "../../../elements/forms/ConfirmationForm"; - interface LDAPSyncStats { healthy: number; failed: number; diff --git a/web/src/pages/admin-overview/charts/OutpostStatusChart.ts b/web/src/pages/admin-overview/charts/OutpostStatusChart.ts index 8da008c20..122a1e4b9 100644 --- a/web/src/pages/admin-overview/charts/OutpostStatusChart.ts +++ b/web/src/pages/admin-overview/charts/OutpostStatusChart.ts @@ -1,3 +1,6 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; +import "@goauthentik/web/elements/forms/ConfirmationForm"; import { ChartData, ChartOptions } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,10 +9,6 @@ import { customElement } from "lit/decorators.js"; import { OutpostsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { AKChart } from "../../../elements/charts/Chart"; -import "../../../elements/forms/ConfirmationForm"; - interface OutpostStats { healthy: number; outdated: number; diff --git a/web/src/pages/admin-overview/charts/PolicyStatusChart.ts b/web/src/pages/admin-overview/charts/PolicyStatusChart.ts index 7216d260a..998fd8a85 100644 --- a/web/src/pages/admin-overview/charts/PolicyStatusChart.ts +++ b/web/src/pages/admin-overview/charts/PolicyStatusChart.ts @@ -1,3 +1,6 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; +import "@goauthentik/web/elements/forms/ConfirmationForm"; import { ChartData, ChartOptions } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,10 +9,6 @@ import { customElement } from "lit/decorators.js"; import { PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { AKChart } from "../../../elements/charts/Chart"; -import "../../../elements/forms/ConfirmationForm"; - interface PolicyMetrics { count: number; cached: number; diff --git a/web/src/pages/admin-overview/charts/UserCountStatusChart.ts b/web/src/pages/admin-overview/charts/UserCountStatusChart.ts index fec18027a..5d1a4fae9 100644 --- a/web/src/pages/admin-overview/charts/UserCountStatusChart.ts +++ b/web/src/pages/admin-overview/charts/UserCountStatusChart.ts @@ -1,3 +1,5 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { AKChart } from "@goauthentik/web/elements/charts/Chart"; import { ChartData, ChartOptions } from "chart.js"; import { t } from "@lingui/macro"; @@ -6,9 +8,6 @@ import { customElement } from "lit/decorators.js"; import { CoreApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { AKChart } from "../../../elements/charts/Chart"; - interface UserMetrics { count: number; superusers: number; diff --git a/web/src/pages/applications/ApplicationCheckAccessForm.ts b/web/src/pages/applications/ApplicationCheckAccessForm.ts index cb3b58801..16c3da59f 100644 --- a/web/src/pages/applications/ApplicationCheckAccessForm.ts +++ b/web/src/pages/applications/ApplicationCheckAccessForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { UserOption } from "@goauthentik/web/elements/user/utils"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -8,12 +14,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList import { Application, CoreApi, PolicyTestResult } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { PFColor } from "../../elements/Label"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; -import { UserOption } from "../../elements/user/utils"; - @customElement("ak-application-check-access-form") export class ApplicationCheckAccessForm extends Form<{ forUser: number }> { @property({ attribute: false }) diff --git a/web/src/pages/applications/ApplicationForm.ts b/web/src/pages/applications/ApplicationForm.ts index b8c336242..11b71db53 100644 --- a/web/src/pages/applications/ApplicationForm.ts +++ b/web/src/pages/applications/ApplicationForm.ts @@ -1,3 +1,12 @@ +import { DEFAULT_CONFIG, config } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import "@goauthentik/web/pages/providers/ProviderWizard"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -14,15 +23,6 @@ import { ProvidersApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG, config } from "../../api/Config"; -import "../../elements/forms/FormGroup"; -import "../../elements/forms/HorizontalFormElement"; -import "../../elements/forms/ModalForm"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import "../../elements/forms/ProxyForm"; -import { first } from "../../utils"; -import "../providers/ProviderWizard"; - @customElement("ak-application-form") export class ApplicationForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/applications/ApplicationListPage.ts b/web/src/pages/applications/ApplicationListPage.ts index 904e9ccc0..a7c9776a3 100644 --- a/web/src/pages/applications/ApplicationListPage.ts +++ b/web/src/pages/applications/ApplicationListPage.ts @@ -1,28 +1,28 @@ +import MDApplication from "@goauthentik/docs/core/applications.md"; +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/Markdown"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { getURLParam } from "@goauthentik/web/elements/router/RouteMatch"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/applications/ApplicationForm"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import { Application, CoreApi } from "@goauthentik/api"; -import MDApplication from "../../../../website/docs/core/applications.md"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/Markdown"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { getURLParam } from "../../elements/router/RouteMatch"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./ApplicationForm"; - @customElement("ak-application-list") export class ApplicationListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/applications/ApplicationViewPage.ts b/web/src/pages/applications/ApplicationViewPage.ts index 33ea89cf1..5c7ea8c33 100644 --- a/web/src/pages/applications/ApplicationViewPage.ts +++ b/web/src/pages/applications/ApplicationViewPage.ts @@ -1,10 +1,21 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/charts/ApplicationAuthorizeChart"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/pages/applications/ApplicationCheckAccessForm"; +import "@goauthentik/web/pages/applications/ApplicationForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property, state } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBanner from "@patternfly/patternfly/components/Banner/banner.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -16,17 +27,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { Application, CoreApi, OutpostsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/EmptyState"; -import "../../elements/PageHeader"; -import "../../elements/Tabs"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/charts/ApplicationAuthorizeChart"; -import "../../elements/events/ObjectChangelog"; -import "../policies/BoundPoliciesList"; -import "./ApplicationCheckAccessForm"; -import "./ApplicationForm"; - @customElement("ak-application-view") export class ApplicationViewPage extends LitElement { @property() diff --git a/web/src/pages/crypto/CertificateGenerateForm.ts b/web/src/pages/crypto/CertificateGenerateForm.ts index d72eb5cff..a0a77f9b7 100644 --- a/web/src/pages/crypto/CertificateGenerateForm.ts +++ b/web/src/pages/crypto/CertificateGenerateForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,10 +9,6 @@ import { customElement } from "lit/decorators.js"; import { CertificateGenerationRequest, CertificateKeyPair, CryptoApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; - @customElement("ak-crypto-certificate-generate-form") export class CertificateKeyPairForm extends Form { getSuccessMessage(): string { diff --git a/web/src/pages/crypto/CertificateKeyPairForm.ts b/web/src/pages/crypto/CertificateKeyPairForm.ts index 69c7f7248..4b2f64a01 100644 --- a/web/src/pages/crypto/CertificateKeyPairForm.ts +++ b/web/src/pages/crypto/CertificateKeyPairForm.ts @@ -1,3 +1,8 @@ +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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { CertificateKeyPair, CertificateKeyPairRequest, CryptoApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-crypto-certificate-form") export class CertificateKeyPairForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/crypto/CertificateKeyPairListPage.ts b/web/src/pages/crypto/CertificateKeyPairListPage.ts index 6a2dc4101..e3c3c0484 100644 --- a/web/src/pages/crypto/CertificateKeyPairListPage.ts +++ b/web/src/pages/crypto/CertificateKeyPairListPage.ts @@ -1,3 +1,15 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/crypto/CertificateGenerateForm"; +import "@goauthentik/web/pages/crypto/CertificateKeyPairForm"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -7,18 +19,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList import { CertificateKeyPair, CryptoApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./CertificateGenerateForm"; -import "./CertificateKeyPairForm"; - @customElement("ak-crypto-certificate-list") export class CertificateKeyPairListPage extends TablePage { expandable = true; diff --git a/web/src/pages/events/EventInfo.ts b/web/src/pages/events/EventInfo.ts index 7efa6fd49..19f36ac9b 100644 --- a/web/src/pages/events/EventInfo.ts +++ b/web/src/pages/events/EventInfo.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EventContext, EventModel, EventWithContext } from "@goauthentik/web/api/Events"; +import { VERSION } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/Expand"; +import "@goauthentik/web/elements/Spinner"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; @@ -12,13 +19,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { EventActions, FlowsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EventContext, EventModel, EventWithContext } from "../../api/Events"; -import { VERSION } from "../../constants"; -import "../../elements/Expand"; -import "../../elements/Spinner"; -import { PFSize } from "../../elements/Spinner"; - @customElement("ak-event-info") export class EventInfo extends LitElement { @property({ attribute: false }) @@ -387,7 +387,7 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)} return html`

${t`Attempted to log in as ${this.event.context.username}`}

${this.defaultResponse()}`; case EventActions.Logout: - if (this.event.context === {}) { + if (Object.keys(this.event.context).length === 0) { return html`${t`No additional data available.`}`; } return this.defaultResponse(); diff --git a/web/src/pages/events/EventInfoPage.ts b/web/src/pages/events/EventInfoPage.ts index 3793bceae..87050496b 100644 --- a/web/src/pages/events/EventInfoPage.ts +++ b/web/src/pages/events/EventInfoPage.ts @@ -1,9 +1,14 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EventWithContext } from "@goauthentik/web/api/Events"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/pages/events/EventInfo"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; @@ -11,11 +16,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { EventsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EventWithContext } from "../../api/Events"; -import "../../elements/PageHeader"; -import "./EventInfo"; - @customElement("ak-event-info-page") export class EventInfoPage extends LitElement { @property() diff --git a/web/src/pages/events/EventListPage.ts b/web/src/pages/events/EventListPage.ts index 4bfc8a76e..9c27155e7 100644 --- a/web/src/pages/events/EventListPage.ts +++ b/web/src/pages/events/EventListPage.ts @@ -1,3 +1,12 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EventWithContext } from "@goauthentik/web/api/Events"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/events/EventInfo"; +import { ActionToLabel } from "@goauthentik/web/pages/events/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,15 +14,6 @@ import { customElement, property } from "lit/decorators.js"; import { Event, EventsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EventWithContext } from "../../api/Events"; -import { uiConfig } from "../../common/config"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./EventInfo"; -import { ActionToLabel } from "./utils"; - @customElement("ak-event-list") export class EventListPage extends TablePage { expandable = true; diff --git a/web/src/pages/events/RuleForm.ts b/web/src/pages/events/RuleForm.ts index a9ab3eb76..2d7e92ab8 100644 --- a/web/src/pages/events/RuleForm.ts +++ b/web/src/pages/events/RuleForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,10 +11,6 @@ import { until } from "lit/directives/until.js"; import { CoreApi, EventsApi, NotificationRule, SeverityEnum } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-event-rule-form") export class RuleForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/events/RuleListPage.ts b/web/src/pages/events/RuleListPage.ts index b514c74c6..fe0e02d3f 100644 --- a/web/src/pages/events/RuleListPage.ts +++ b/web/src/pages/events/RuleListPage.ts @@ -1,3 +1,14 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/events/RuleForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,17 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { EventsApi, NotificationRule } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "../policies/BoundPoliciesList"; -import "./RuleForm"; - @customElement("ak-event-rule-list") export class RuleListPage extends TablePage { expandable = true; diff --git a/web/src/pages/events/TransportForm.ts b/web/src/pages/events/TransportForm.ts index 144e3f16c..f6f723b98 100644 --- a/web/src/pages/events/TransportForm.ts +++ b/web/src/pages/events/TransportForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -12,11 +17,6 @@ import { PropertymappingsApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { first } from "../../utils"; - @customElement("ak-event-transport-form") export class TransportForm extends ModelForm { loadInstance(pk: string): Promise { @@ -83,7 +83,7 @@ export class TransportForm extends ModelForm { `; } - onModeChange(mode: string): void { + onModeChange(mode: string | undefined): void { if ( mode === NotificationTransportModeEnum.Webhook || mode === NotificationTransportModeEnum.WebhookSlack diff --git a/web/src/pages/events/TransportListPage.ts b/web/src/pages/events/TransportListPage.ts index 3390a06fa..6d0930963 100644 --- a/web/src/pages/events/TransportListPage.ts +++ b/web/src/pages/events/TransportListPage.ts @@ -1,3 +1,14 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/events/TransportForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,17 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { EventsApi, NotificationTransport } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/buttons/ActionButton"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./TransportForm"; - @customElement("ak-event-transport-list") export class TransportListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/flows/BoundStagesList.ts b/web/src/pages/flows/BoundStagesList.ts index b9d6696a3..793d576b8 100644 --- a/web/src/pages/flows/BoundStagesList.ts +++ b/web/src/pages/flows/BoundStagesList.ts @@ -1,3 +1,15 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; +import "@goauthentik/web/pages/flows/StageBindingForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; +import "@goauthentik/web/pages/stages/StageWizard"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,18 +18,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { FlowStageBinding, FlowsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/Tabs"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { Table, TableColumn } from "../../elements/table/Table"; -import "../policies/BoundPoliciesList"; -import "../stages/StageWizard"; -import "./StageBindingForm"; - @customElement("ak-bound-stages-list") export class BoundStagesList extends Table { expandable = true; diff --git a/web/src/pages/flows/FlowDiagram.ts b/web/src/pages/flows/FlowDiagram.ts index 1d7d4d264..61d032202 100644 --- a/web/src/pages/flows/FlowDiagram.ts +++ b/web/src/pages/flows/FlowDiagram.ts @@ -1,3 +1,6 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/EmptyState"; import FlowChart from "flowchart.js"; import { LitElement, TemplateResult, html } from "lit"; @@ -5,10 +8,6 @@ import { customElement, property } from "lit/decorators.js"; import { FlowsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EVENT_REFRESH } from "../../constants"; -import "../../elements/EmptyState"; - export const FONT_COLOUR_DARK_MODE = "#fafafa"; export const FONT_COLOUR_LIGHT_MODE = "#151515"; export const FILL_DARK_MODE = "#18191a"; diff --git a/web/src/pages/flows/FlowForm.ts b/web/src/pages/flows/FlowForm.ts index 91ccc69a6..4c439ceca 100644 --- a/web/src/pages/flows/FlowForm.ts +++ b/web/src/pages/flows/FlowForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG, config } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -14,10 +19,6 @@ import { PolicyEngineMode, } from "@goauthentik/api"; -import { DEFAULT_CONFIG, config } from "../../api/Config"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { first } from "../../utils"; import { DesignationToLabel, LayoutToLabel } from "./utils"; @customElement("ak-flow-form") diff --git a/web/src/pages/flows/FlowImportForm.ts b/web/src/pages/flows/FlowImportForm.ts index e50ecde4d..ecc8950f3 100644 --- a/web/src/pages/flows/FlowImportForm.ts +++ b/web/src/pages/flows/FlowImportForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { SentryIgnoredError } from "@goauthentik/web/common/errors"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,11 +10,6 @@ import { customElement } from "lit/decorators.js"; import { Flow, FlowsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { SentryIgnoredError } from "../../common/errors"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; - @customElement("ak-flow-import-form") export class FlowImportForm extends Form { getSuccessMessage(): string { diff --git a/web/src/pages/flows/FlowListPage.ts b/web/src/pages/flows/FlowListPage.ts index eb53bf7a1..0081a6f3f 100644 --- a/web/src/pages/flows/FlowListPage.ts +++ b/web/src/pages/flows/FlowListPage.ts @@ -1,3 +1,16 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { AndNext, DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/ConfirmationForm"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +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 { groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,18 +18,6 @@ import { customElement, property } from "lit/decorators.js"; import { Flow, FlowsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { AndNext, DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/ConfirmationForm"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import { groupBy } from "../../utils"; -import "./FlowForm"; -import "./FlowImportForm"; import { DesignationToLabel } from "./utils"; @customElement("ak-flow-list") diff --git a/web/src/pages/flows/FlowViewPage.ts b/web/src/pages/flows/FlowViewPage.ts index 450dca022..f9ad8872f 100644 --- a/web/src/pages/flows/FlowViewPage.ts +++ b/web/src/pages/flows/FlowViewPage.ts @@ -1,9 +1,19 @@ +import { AndNext, DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/pages/flows/BoundStagesList"; +import "@goauthentik/web/pages/flows/FlowDiagram"; +import "@goauthentik/web/pages/flows/FlowForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, 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 PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -14,16 +24,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { Flow, FlowsApi, ResponseError } from "@goauthentik/api"; -import { AndNext, DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/PageHeader"; -import "../../elements/Tabs"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/events/ObjectChangelog"; -import "../policies/BoundPoliciesList"; -import "./BoundStagesList"; -import "./FlowDiagram"; -import "./FlowForm"; - @customElement("ak-flow-view") export class FlowViewPage extends LitElement { @property() diff --git a/web/src/pages/flows/StageBindingForm.ts b/web/src/pages/flows/StageBindingForm.ts index b5d0131a6..3b58b2fd4 100644 --- a/web/src/pages/flows/StageBindingForm.ts +++ b/web/src/pages/flows/StageBindingForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first, groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -14,11 +19,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { first, groupBy } from "../../utils"; - @customElement("ak-stage-binding-form") export class StageBindingForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/groups/GroupForm.ts b/web/src/pages/groups/GroupForm.ts index a867b89a5..bdd2080c5 100644 --- a/web/src/pages/groups/GroupForm.ts +++ b/web/src/pages/groups/GroupForm.ts @@ -1,3 +1,12 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/chips/Chip"; +import "@goauthentik/web/elements/chips/ChipGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { UserOption } from "@goauthentik/web/elements/user/utils"; +import "@goauthentik/web/pages/groups/MemberSelectModal"; +import { first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -9,16 +18,6 @@ import { until } from "lit/directives/until.js"; import { CoreApi, Group, User } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/chips/Chip"; -import "../../elements/chips/ChipGroup"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { UserOption } from "../../elements/user/utils"; -import { first } from "../../utils"; -import "./MemberSelectModal"; - @customElement("ak-group-form") export class GroupForm extends ModelForm { static get styles(): CSSResult[] { diff --git a/web/src/pages/groups/GroupListPage.ts b/web/src/pages/groups/GroupListPage.ts index 682c8cc81..f6a2cee53 100644 --- a/web/src/pages/groups/GroupListPage.ts +++ b/web/src/pages/groups/GroupListPage.ts @@ -1,3 +1,14 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/groups/GroupForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,17 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, Group } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./GroupForm"; - @customElement("ak-group-list") export class GroupListPage extends TablePage { checkbox = true; diff --git a/web/src/pages/groups/GroupViewPage.ts b/web/src/pages/groups/GroupViewPage.ts index 37c851acc..448512a3d 100644 --- a/web/src/pages/groups/GroupViewPage.ts +++ b/web/src/pages/groups/GroupViewPage.ts @@ -1,9 +1,22 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/pages/groups/GroupForm"; +import "@goauthentik/web/pages/users/RelatedUserList"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, 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 PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -17,19 +30,6 @@ import PFSizing from "@patternfly/patternfly/utilities/Sizing/sizing.css"; import { CoreApi, Group } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EVENT_REFRESH } from "../../constants"; -import "../../elements/CodeMirror"; -import { PFColor } from "../../elements/Label"; -import "../../elements/PageHeader"; -import "../../elements/Tabs"; -import "../../elements/buttons/ActionButton"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/events/ObjectChangelog"; -import "../../elements/forms/ModalForm"; -import "../users/RelatedUserList"; -import "./GroupForm"; - @customElement("ak-group-view") export class GroupViewPage extends LitElement { @property({ type: String }) diff --git a/web/src/pages/groups/MemberSelectModal.ts b/web/src/pages/groups/MemberSelectModal.ts index addaebed2..bc103f163 100644 --- a/web/src/pages/groups/MemberSelectModal.ts +++ b/web/src/pages/groups/MemberSelectModal.ts @@ -1,3 +1,12 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TableModal } from "@goauthentik/web/elements/table/TableModal"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,15 +14,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, User } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import { TableColumn } from "../../elements/table/Table"; -import { TableModal } from "../../elements/table/TableModal"; -import { first } from "../../utils"; - @customElement("ak-group-member-select-table") export class MemberSelectTable extends TableModal { checkbox = true; diff --git a/web/src/pages/groups/RelatedGroupList.ts b/web/src/pages/groups/RelatedGroupList.ts index 8006cdc86..b852f8f0a 100644 --- a/web/src/pages/groups/RelatedGroupList.ts +++ b/web/src/pages/groups/RelatedGroupList.ts @@ -1,3 +1,13 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; +import "@goauthentik/web/pages/groups/GroupForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,16 +15,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, Group } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { Table, TableColumn } from "../../elements/table/Table"; -import "./GroupForm"; - @customElement("ak-group-related-list") export class RelatedGroupList extends Table { checkbox = true; diff --git a/web/src/pages/outposts/OutpostDeploymentModal.ts b/web/src/pages/outposts/OutpostDeploymentModal.ts index b7557e23d..e3dd1c92f 100644 --- a/web/src/pages/outposts/OutpostDeploymentModal.ts +++ b/web/src/pages/outposts/OutpostDeploymentModal.ts @@ -1,3 +1,6 @@ +import { ModalButton } from "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/TokenCopyButton"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,9 +9,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { Outpost, OutpostTypeEnum } from "@goauthentik/api"; -import { ModalButton } from "../../elements/buttons/ModalButton"; -import "../../elements/buttons/TokenCopyButton"; - @customElement("ak-outpost-deployment-modal") export class OutpostDeploymentModal extends ModalButton { @property({ attribute: false }) diff --git a/web/src/pages/outposts/OutpostForm.ts b/web/src/pages/outposts/OutpostForm.ts index fdcb5f0a6..07e3e8e8a 100644 --- a/web/src/pages/outposts/OutpostForm.ts +++ b/web/src/pages/outposts/OutpostForm.ts @@ -1,3 +1,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 YAML from "yaml"; import { t } from "@lingui/macro"; @@ -9,11 +13,6 @@ import { until } from "lit/directives/until.js"; import { Outpost, OutpostTypeEnum, OutpostsApi, ProvidersApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-outpost-form") export class OutpostForm extends ModelForm { @property() diff --git a/web/src/pages/outposts/OutpostHealth.ts b/web/src/pages/outposts/OutpostHealth.ts index 07313dc17..f92ad552c 100644 --- a/web/src/pages/outposts/OutpostHealth.ts +++ b/web/src/pages/outposts/OutpostHealth.ts @@ -1,16 +1,16 @@ +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/Spinner"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, 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 { OutpostHealth } from "@goauthentik/api"; -import { PFColor } from "../../elements/Label"; -import "../../elements/Spinner"; - @customElement("ak-outpost-health") export class OutpostHealthElement extends LitElement { @property({ attribute: false }) diff --git a/web/src/pages/outposts/OutpostHealthSimple.ts b/web/src/pages/outposts/OutpostHealthSimple.ts index 293a37811..3b34f06e1 100644 --- a/web/src/pages/outposts/OutpostHealthSimple.ts +++ b/web/src/pages/outposts/OutpostHealthSimple.ts @@ -1,18 +1,18 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/Spinner"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, 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 { OutpostHealth, OutpostsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EVENT_REFRESH } from "../../constants"; -import { PFColor } from "../../elements/Label"; -import "../../elements/Spinner"; - @customElement("ak-outpost-health-simple") export class OutpostHealthSimpleElement extends LitElement { @property() diff --git a/web/src/pages/outposts/OutpostListPage.ts b/web/src/pages/outposts/OutpostListPage.ts index fd22796f9..8eddfcf5e 100644 --- a/web/src/pages/outposts/OutpostListPage.ts +++ b/web/src/pages/outposts/OutpostListPage.ts @@ -1,3 +1,17 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/outposts/OutpostDeploymentModal"; +import "@goauthentik/web/pages/outposts/OutpostForm"; +import "@goauthentik/web/pages/outposts/OutpostHealth"; +import "@goauthentik/web/pages/outposts/OutpostHealthSimple"; + import { t } from "@lingui/macro"; import { CSSResult } from "lit"; @@ -10,20 +24,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList import { Outpost, OutpostTypeEnum, OutpostsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFSize } from "../../elements/Spinner"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./OutpostDeploymentModal"; -import "./OutpostForm"; -import "./OutpostHealth"; -import "./OutpostHealthSimple"; - export function TypeToLabel(type?: OutpostTypeEnum): string { if (!type) return ""; switch (type) { diff --git a/web/src/pages/outposts/ServiceConnectionDockerForm.ts b/web/src/pages/outposts/ServiceConnectionDockerForm.ts index f2884956a..20ee94b88 100644 --- a/web/src/pages/outposts/ServiceConnectionDockerForm.ts +++ b/web/src/pages/outposts/ServiceConnectionDockerForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,11 +12,6 @@ import { until } from "lit/directives/until.js"; import { CryptoApi, DockerServiceConnection, OutpostsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { first } from "../../utils"; - @customElement("ak-service-connection-docker-form") export class ServiceConnectionDockerForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/outposts/ServiceConnectionKubernetesForm.ts b/web/src/pages/outposts/ServiceConnectionKubernetesForm.ts index 4857e03cd..5a8e11711 100644 --- a/web/src/pages/outposts/ServiceConnectionKubernetesForm.ts +++ b/web/src/pages/outposts/ServiceConnectionKubernetesForm.ts @@ -1,3 +1,8 @@ +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 { first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -8,12 +13,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { KubernetesServiceConnection, OutpostsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { first } from "../../utils"; - @customElement("ak-service-connection-kubernetes-form") export class ServiceConnectionKubernetesForm extends ModelForm< KubernetesServiceConnection, diff --git a/web/src/pages/outposts/ServiceConnectionListPage.ts b/web/src/pages/outposts/ServiceConnectionListPage.ts index c9c1fb784..8171dfe06 100644 --- a/web/src/pages/outposts/ServiceConnectionListPage.ts +++ b/web/src/pages/outposts/ServiceConnectionListPage.ts @@ -1,3 +1,18 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/outposts/OutpostHealth"; +import "@goauthentik/web/pages/outposts/ServiceConnectionDockerForm"; +import "@goauthentik/web/pages/outposts/ServiceConnectionKubernetesForm"; +import "@goauthentik/web/pages/outposts/ServiceConnectionWizard"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,21 +22,6 @@ import { until } from "lit/directives/until.js"; import { OutpostsApi, ServiceConnection } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./OutpostHealth"; -import "./ServiceConnectionDockerForm"; -import "./ServiceConnectionKubernetesForm"; -import "./ServiceConnectionWizard"; - @customElement("ak-outpost-service-connection-list") export class OutpostServiceConnectionListPage extends TablePage { pageTitle(): string { diff --git a/web/src/pages/outposts/ServiceConnectionWizard.ts b/web/src/pages/outposts/ServiceConnectionWizard.ts index 79267d74c..0e9c7e767 100644 --- a/web/src/pages/outposts/ServiceConnectionWizard.ts +++ b/web/src/pages/outposts/ServiceConnectionWizard.ts @@ -1,10 +1,18 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +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/outposts/ServiceConnectionDockerForm"; +import "@goauthentik/web/pages/outposts/ServiceConnectionKubernetesForm"; + 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -12,14 +20,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { OutpostsApi, TypeCreate } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/ProxyForm"; -import "../../elements/wizard/FormWizardPage"; -import "../../elements/wizard/Wizard"; -import { WizardPage } from "../../elements/wizard/WizardPage"; -import "./ServiceConnectionDockerForm"; -import "./ServiceConnectionKubernetesForm"; - @customElement("ak-service-connection-wizard-initial") export class InitialServiceConnectionWizardPage extends WizardPage { @property({ attribute: false }) diff --git a/web/src/pages/policies/BoundPoliciesList.ts b/web/src/pages/policies/BoundPoliciesList.ts index ec2a03af9..a8d470734 100644 --- a/web/src/pages/policies/BoundPoliciesList.ts +++ b/web/src/pages/policies/BoundPoliciesList.ts @@ -1,3 +1,18 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; +import "@goauthentik/web/pages/groups/GroupForm"; +import "@goauthentik/web/pages/policies/PolicyBindingForm"; +import "@goauthentik/web/pages/policies/PolicyWizard"; +import "@goauthentik/web/pages/users/UserForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,21 +21,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PoliciesApi, PolicyBinding } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import { PFSize } from "../../elements/Spinner"; -import "../../elements/Tabs"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { Table, TableColumn } from "../../elements/table/Table"; -import "../groups/GroupForm"; -import "../policies/PolicyWizard"; -import "../users/UserForm"; -import "./PolicyBindingForm"; - @customElement("ak-bound-policies-list") export class BoundPoliciesList extends Table { @property() diff --git a/web/src/pages/policies/PolicyBindingForm.ts b/web/src/pages/policies/PolicyBindingForm.ts index 356202413..877fe00b6 100644 --- a/web/src/pages/policies/PolicyBindingForm.ts +++ b/web/src/pages/policies/PolicyBindingForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/SearchSelect"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { UserOption } from "@goauthentik/web/elements/user/utils"; +import { first, groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, css } from "lit"; @@ -20,13 +27,6 @@ import { User, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/SearchSelect"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { UserOption } from "../../elements/user/utils"; -import { first, groupBy } from "../../utils"; - enum target { policy, group, diff --git a/web/src/pages/policies/PolicyListPage.ts b/web/src/pages/policies/PolicyListPage.ts index cdd4dbfee..1847a39ce 100644 --- a/web/src/pages/policies/PolicyListPage.ts +++ b/web/src/pages/policies/PolicyListPage.ts @@ -1,3 +1,23 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/forms/ConfirmationForm"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/policies/PolicyTestForm"; +import "@goauthentik/web/pages/policies/PolicyWizard"; +import "@goauthentik/web/pages/policies/dummy/DummyPolicyForm"; +import "@goauthentik/web/pages/policies/event_matcher/EventMatcherPolicyForm"; +import "@goauthentik/web/pages/policies/expiry/ExpiryPolicyForm"; +import "@goauthentik/web/pages/policies/expression/ExpressionPolicyForm"; +import "@goauthentik/web/pages/policies/hibp/HaveIBeenPwnedPolicyForm"; +import "@goauthentik/web/pages/policies/password/PasswordPolicyForm"; +import "@goauthentik/web/pages/policies/reputation/ReputationPolicyForm"; +import { groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,26 +26,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PoliciesApi, Policy } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/forms/ConfirmationForm"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import { groupBy } from "../../utils"; -import "./PolicyTestForm"; -import "./PolicyWizard"; -import "./dummy/DummyPolicyForm"; -import "./event_matcher/EventMatcherPolicyForm"; -import "./expiry/ExpiryPolicyForm"; -import "./expression/ExpressionPolicyForm"; -import "./hibp/HaveIBeenPwnedPolicyForm"; -import "./password/PasswordPolicyForm"; -import "./reputation/ReputationPolicyForm"; - @customElement("ak-policy-list") export class PolicyListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/policies/PolicyTestForm.ts b/web/src/pages/policies/PolicyTestForm.ts index 6f6690f23..4771be95c 100644 --- a/web/src/pages/policies/PolicyTestForm.ts +++ b/web/src/pages/policies/PolicyTestForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/CodeMirror"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { UserOption } from "@goauthentik/web/elements/user/utils"; +import { first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -16,14 +23,6 @@ import { PolicyTestResult, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import { PFColor } from "../../elements/Label"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; -import { UserOption } from "../../elements/user/utils"; -import { first } from "../../utils"; - @customElement("ak-policy-test-form") export class PolicyTestForm extends Form { @property({ attribute: false }) diff --git a/web/src/pages/policies/PolicyWizard.ts b/web/src/pages/policies/PolicyWizard.ts index d5c2e9176..c099473a4 100644 --- a/web/src/pages/policies/PolicyWizard.ts +++ b/web/src/pages/policies/PolicyWizard.ts @@ -1,10 +1,23 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +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/policies/dummy/DummyPolicyForm"; +import "@goauthentik/web/pages/policies/event_matcher/EventMatcherPolicyForm"; +import "@goauthentik/web/pages/policies/expiry/ExpiryPolicyForm"; +import "@goauthentik/web/pages/policies/expression/ExpressionPolicyForm"; +import "@goauthentik/web/pages/policies/hibp/HaveIBeenPwnedPolicyForm"; +import "@goauthentik/web/pages/policies/password/PasswordPolicyForm"; +import "@goauthentik/web/pages/policies/reputation/ReputationPolicyForm"; + 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -12,19 +25,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { PoliciesApi, TypeCreate } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/ProxyForm"; -import "../../elements/wizard/FormWizardPage"; -import "../../elements/wizard/Wizard"; -import { WizardPage } from "../../elements/wizard/WizardPage"; -import "./dummy/DummyPolicyForm"; -import "./event_matcher/EventMatcherPolicyForm"; -import "./expiry/ExpiryPolicyForm"; -import "./expression/ExpressionPolicyForm"; -import "./hibp/HaveIBeenPwnedPolicyForm"; -import "./password/PasswordPolicyForm"; -import "./reputation/ReputationPolicyForm"; - @customElement("ak-policy-wizard-initial") export class InitialPolicyWizardPage extends WizardPage { @property({ attribute: false }) diff --git a/web/src/pages/policies/dummy/DummyPolicyForm.ts b/web/src/pages/policies/dummy/DummyPolicyForm.ts index c87c32803..95187efd8 100644 --- a/web/src/pages/policies/dummy/DummyPolicyForm.ts +++ b/web/src/pages/policies/dummy/DummyPolicyForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { DummyPolicy, PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-dummy-form") export class DummyPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/policies/event_matcher/EventMatcherPolicyForm.ts b/web/src/pages/policies/event_matcher/EventMatcherPolicyForm.ts index b1a13d9bb..eddfa41ca 100644 --- a/web/src/pages/policies/event_matcher/EventMatcherPolicyForm.ts +++ b/web/src/pages/policies/event_matcher/EventMatcherPolicyForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,12 +13,6 @@ import { until } from "lit/directives/until.js"; import { AdminApi, EventMatcherPolicy, EventsApi, PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-event-matcher-form") export class EventMatcherPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/policies/expiry/ExpiryPolicyForm.ts b/web/src/pages/policies/expiry/ExpiryPolicyForm.ts index c67693e2b..06b32e5e2 100644 --- a/web/src/pages/policies/expiry/ExpiryPolicyForm.ts +++ b/web/src/pages/policies/expiry/ExpiryPolicyForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PasswordExpiryPolicy, PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-password-expiry-form") export class PasswordExpiryPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/policies/expression/ExpressionPolicyForm.ts b/web/src/pages/policies/expression/ExpressionPolicyForm.ts index cd63cce2b..2463af900 100644 --- a/web/src/pages/policies/expression/ExpressionPolicyForm.ts +++ b/web/src/pages/policies/expression/ExpressionPolicyForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,13 +13,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { ExpressionPolicy, PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/CodeMirror"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-expression-form") export class ExpressionPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/policies/hibp/HaveIBeenPwnedPolicyForm.ts b/web/src/pages/policies/hibp/HaveIBeenPwnedPolicyForm.ts index 4e6d102a0..fd903ccb4 100644 --- a/web/src/pages/policies/hibp/HaveIBeenPwnedPolicyForm.ts +++ b/web/src/pages/policies/hibp/HaveIBeenPwnedPolicyForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { HaveIBeenPwendPolicy, PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-hibp-form") export class HaveIBeenPwnedPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/policies/password/PasswordPolicyForm.ts b/web/src/pages/policies/password/PasswordPolicyForm.ts index 62c266bcd..b3fb8ff2e 100644 --- a/web/src/pages/policies/password/PasswordPolicyForm.ts +++ b/web/src/pages/policies/password/PasswordPolicyForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PasswordPolicy, PoliciesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-password-form") export class PasswordPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/policies/reputation/ReputationListPage.ts b/web/src/pages/policies/reputation/ReputationListPage.ts index 4de9faf21..51e8000c5 100644 --- a/web/src/pages/policies/reputation/ReputationListPage.ts +++ b/web/src/pages/policies/reputation/ReputationListPage.ts @@ -1,3 +1,12 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; import getUnicodeFlagIcon from "country-flag-icons/unicode"; import { t } from "@lingui/macro"; @@ -7,16 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { PoliciesApi, Reputation } from "@goauthentik/api"; -import { AKResponse } from "../../../api/Client"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { uiConfig } from "../../../common/config"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/forms/DeleteBulkForm"; -import "../../../elements/forms/ModalForm"; -import { TableColumn } from "../../../elements/table/Table"; -import { TablePage } from "../../../elements/table/TablePage"; - @customElement("ak-policy-reputation-list") export class ReputationListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/policies/reputation/ReputationPolicyForm.ts b/web/src/pages/policies/reputation/ReputationPolicyForm.ts index a4f4fd126..d27980b58 100644 --- a/web/src/pages/policies/reputation/ReputationPolicyForm.ts +++ b/web/src/pages/policies/reputation/ReputationPolicyForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PoliciesApi, ReputationPolicy } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-policy-reputation-form") export class ReputationPolicyForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/property-mappings/PropertyMappingLDAPForm.ts b/web/src/pages/property-mappings/PropertyMappingLDAPForm.ts index 9230c976d..dbafb8c85 100644 --- a/web/src/pages/property-mappings/PropertyMappingLDAPForm.ts +++ b/web/src/pages/property-mappings/PropertyMappingLDAPForm.ts @@ -1,3 +1,8 @@ +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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { LDAPPropertyMapping, PropertymappingsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-property-mapping-ldap-form") export class PropertyMappingLDAPForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/property-mappings/PropertyMappingListPage.ts b/web/src/pages/property-mappings/PropertyMappingListPage.ts index b20415e0d..d85f5009d 100644 --- a/web/src/pages/property-mappings/PropertyMappingListPage.ts +++ b/web/src/pages/property-mappings/PropertyMappingListPage.ts @@ -1,3 +1,20 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { getURLParam, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingLDAPForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingNotification"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingSAMLForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingScopeForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingTestForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingWizard"; +import { groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,23 +23,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PropertyMapping, PropertymappingsApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { getURLParam, updateURLParams } from "../../elements/router/RouteMatch"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import { groupBy } from "../../utils"; -import "./PropertyMappingLDAPForm"; -import "./PropertyMappingNotification"; -import "./PropertyMappingSAMLForm"; -import "./PropertyMappingScopeForm"; -import "./PropertyMappingTestForm"; -import "./PropertyMappingWizard"; - @customElement("ak-property-mapping-list") export class PropertyMappingListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/property-mappings/PropertyMappingNotification.ts b/web/src/pages/property-mappings/PropertyMappingNotification.ts index dfca81b6a..cd0e29e90 100644 --- a/web/src/pages/property-mappings/PropertyMappingNotification.ts +++ b/web/src/pages/property-mappings/PropertyMappingNotification.ts @@ -1,3 +1,8 @@ +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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { NotificationWebhookMapping, PropertymappingsApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-property-mapping-notification-form") export class PropertyMappingNotification extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/property-mappings/PropertyMappingSAMLForm.ts b/web/src/pages/property-mappings/PropertyMappingSAMLForm.ts index f887d80d5..9bd2fbade 100644 --- a/web/src/pages/property-mappings/PropertyMappingSAMLForm.ts +++ b/web/src/pages/property-mappings/PropertyMappingSAMLForm.ts @@ -1,3 +1,8 @@ +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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PropertymappingsApi, SAMLPropertyMapping } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-property-mapping-saml-form") export class PropertyMappingLDAPForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/property-mappings/PropertyMappingScopeForm.ts b/web/src/pages/property-mappings/PropertyMappingScopeForm.ts index fb4717a68..95b138122 100644 --- a/web/src/pages/property-mappings/PropertyMappingScopeForm.ts +++ b/web/src/pages/property-mappings/PropertyMappingScopeForm.ts @@ -1,3 +1,8 @@ +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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { PropertymappingsApi, ScopeMapping } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; - @customElement("ak-property-mapping-scope-form") export class PropertyMappingScopeForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/property-mappings/PropertyMappingTestForm.ts b/web/src/pages/property-mappings/PropertyMappingTestForm.ts index 4f0376e6e..6872e06f8 100644 --- a/web/src/pages/property-mappings/PropertyMappingTestForm.ts +++ b/web/src/pages/property-mappings/PropertyMappingTestForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/CodeMirror"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { UserOption } from "@goauthentik/web/elements/user/utils"; +import { first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -15,13 +21,6 @@ import { PropertymappingsApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; -import { UserOption } from "../../elements/user/utils"; -import { first } from "../../utils"; - @customElement("ak-property-mapping-test-form") export class PolicyTestForm extends Form { @property({ attribute: false }) diff --git a/web/src/pages/property-mappings/PropertyMappingWizard.ts b/web/src/pages/property-mappings/PropertyMappingWizard.ts index 2c03ac14b..bb3f2fe6c 100644 --- a/web/src/pages/property-mappings/PropertyMappingWizard.ts +++ b/web/src/pages/property-mappings/PropertyMappingWizard.ts @@ -1,10 +1,21 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +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/property-mappings/PropertyMappingLDAPForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingNotification"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingSAMLForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingScopeForm"; +import "@goauthentik/web/pages/property-mappings/PropertyMappingTestForm"; + 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -12,17 +23,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { PropertymappingsApi, TypeCreate } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/ProxyForm"; -import "../../elements/wizard/FormWizardPage"; -import "../../elements/wizard/Wizard"; -import { WizardPage } from "../../elements/wizard/WizardPage"; -import "./PropertyMappingLDAPForm"; -import "./PropertyMappingNotification"; -import "./PropertyMappingSAMLForm"; -import "./PropertyMappingScopeForm"; -import "./PropertyMappingTestForm"; - @customElement("ak-property-mapping-wizard-initial") export class InitialPropertyMappingWizardPage extends WizardPage { @property({ attribute: false }) diff --git a/web/src/pages/providers/ProviderListPage.ts b/web/src/pages/providers/ProviderListPage.ts index 655a83436..40827c839 100644 --- a/web/src/pages/providers/ProviderListPage.ts +++ b/web/src/pages/providers/ProviderListPage.ts @@ -1,3 +1,18 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/providers/ProviderWizard"; +import "@goauthentik/web/pages/providers/ldap/LDAPProviderForm"; +import "@goauthentik/web/pages/providers/oauth2/OAuth2ProviderForm"; +import "@goauthentik/web/pages/providers/proxy/ProxyProviderForm"; +import "@goauthentik/web/pages/providers/saml/SAMLProviderForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,21 +20,6 @@ import { customElement, property } from "lit/decorators.js"; import { Provider, ProvidersApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./ProviderWizard"; -import "./ldap/LDAPProviderForm"; -import "./oauth2/OAuth2ProviderForm"; -import "./proxy/ProxyProviderForm"; -import "./saml/SAMLProviderForm"; - @customElement("ak-provider-list") export class ProviderListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/providers/ProviderViewPage.ts b/web/src/pages/providers/ProviderViewPage.ts index 5d332e022..bc906a927 100644 --- a/web/src/pages/providers/ProviderViewPage.ts +++ b/web/src/pages/providers/ProviderViewPage.ts @@ -1,23 +1,23 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/pages/providers/ldap/LDAPProviderViewPage"; +import "@goauthentik/web/pages/providers/oauth2/OAuth2ProviderViewPage"; +import "@goauthentik/web/pages/providers/proxy/ProxyProviderViewPage"; +import "@goauthentik/web/pages/providers/saml/SAMLProviderViewPage"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; import { Provider, ProvidersApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/EmptyState"; -import "../../elements/PageHeader"; -import "../../elements/buttons/SpinnerButton"; -import "./ldap/LDAPProviderViewPage"; -import "./oauth2/OAuth2ProviderViewPage"; -import "./proxy/ProxyProviderViewPage"; -import "./saml/SAMLProviderViewPage"; - @customElement("ak-provider-view") export class ProviderViewPage extends LitElement { @property({ type: Number }) diff --git a/web/src/pages/providers/ProviderWizard.ts b/web/src/pages/providers/ProviderWizard.ts index 24a616aa6..9df702397 100644 --- a/web/src/pages/providers/ProviderWizard.ts +++ b/web/src/pages/providers/ProviderWizard.ts @@ -1,10 +1,21 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +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/providers/ldap/LDAPProviderForm"; +import "@goauthentik/web/pages/providers/oauth2/OAuth2ProviderForm"; +import "@goauthentik/web/pages/providers/proxy/ProxyProviderForm"; +import "@goauthentik/web/pages/providers/saml/SAMLProviderForm"; +import "@goauthentik/web/pages/providers/saml/SAMLProviderImportForm"; + 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -12,17 +23,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { ProvidersApi, TypeCreate } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/ProxyForm"; -import "../../elements/wizard/FormWizardPage"; -import "../../elements/wizard/Wizard"; -import { WizardPage } from "../../elements/wizard/WizardPage"; -import "./ldap/LDAPProviderForm"; -import "./oauth2/OAuth2ProviderForm"; -import "./proxy/ProxyProviderForm"; -import "./saml/SAMLProviderForm"; -import "./saml/SAMLProviderImportForm"; - @customElement("ak-provider-wizard-initial") export class InitialProviderWizardPage extends WizardPage { @property({ attribute: false }) diff --git a/web/src/pages/providers/RelatedApplicationButton.ts b/web/src/pages/providers/RelatedApplicationButton.ts index 22b5f052b..cb2a2b5f0 100644 --- a/web/src/pages/providers/RelatedApplicationButton.ts +++ b/web/src/pages/providers/RelatedApplicationButton.ts @@ -1,3 +1,7 @@ +import "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/pages/applications/ApplicationForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; @@ -8,10 +12,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { Provider } from "@goauthentik/api"; -import "../../elements/Spinner"; -import "../../elements/forms/ModalForm"; -import "../../pages/applications/ApplicationForm"; - @customElement("ak-provider-related-application") export class RelatedApplicationButton extends LitElement { static get styles(): CSSResult[] { diff --git a/web/src/pages/providers/ldap/LDAPProviderForm.ts b/web/src/pages/providers/ldap/LDAPProviderForm.ts index f76be34c2..61e4f8d00 100644 --- a/web/src/pages/providers/ldap/LDAPProviderForm.ts +++ b/web/src/pages/providers/ldap/LDAPProviderForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG, tenant } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -15,12 +21,6 @@ import { ProvidersApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG, tenant } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-provider-ldap-form") export class LDAPProviderFormPage extends ModelForm { loadInstance(pk: number): Promise { diff --git a/web/src/pages/providers/ldap/LDAPProviderViewPage.ts b/web/src/pages/providers/ldap/LDAPProviderViewPage.ts index fee884f3a..f34a72fab 100644 --- a/web/src/pages/providers/ldap/LDAPProviderViewPage.ts +++ b/web/src/pages/providers/ldap/LDAPProviderViewPage.ts @@ -1,3 +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/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/pages/providers/RelatedApplicationButton"; +import "@goauthentik/web/pages/providers/ldap/LDAPProviderForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; @@ -5,7 +16,7 @@ import { until } from "lit-html/directives/until.js"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBanner from "@patternfly/patternfly/components/Banner/banner.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -20,17 +31,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { LDAPProvider, ProvidersApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { me } from "../../../api/Users"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../RelatedApplicationButton"; -import "./LDAPProviderForm"; - @customElement("ak-provider-ldap-view") export class LDAPProviderViewPage extends LitElement { @property() diff --git a/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts b/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts index 7572d6900..75e3215aa 100644 --- a/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts +++ b/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; +import { first, randomString } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -18,13 +25,6 @@ import { SubModeEnum, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; -import { first, randomString } from "../../../utils"; - @customElement("ak-provider-oauth2-form") export class OAuth2ProviderFormPage extends ModelForm { loadInstance(pk: number): Promise { diff --git a/web/src/pages/providers/oauth2/OAuth2ProviderViewPage.ts b/web/src/pages/providers/oauth2/OAuth2ProviderViewPage.ts index bbb6a3a2a..5f99080b0 100644 --- a/web/src/pages/providers/oauth2/OAuth2ProviderViewPage.ts +++ b/web/src/pages/providers/oauth2/OAuth2ProviderViewPage.ts @@ -1,9 +1,20 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/pages/providers/RelatedApplicationButton"; +import "@goauthentik/web/pages/providers/oauth2/OAuth2ProviderForm"; +import { convertToTitle } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBanner from "@patternfly/patternfly/components/Banner/banner.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -17,17 +28,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { OAuth2Provider, OAuth2ProviderSetupURLs, ProvidersApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import { convertToTitle } from "../../../utils"; -import "../RelatedApplicationButton"; -import "./OAuth2ProviderForm"; - @customElement("ak-provider-oauth2-view") export class OAuth2ProviderViewPage extends LitElement { @property({ type: Number }) diff --git a/web/src/pages/providers/proxy/ProxyProviderForm.ts b/web/src/pages/providers/proxy/ProxyProviderForm.ts index 0759837cf..b49b3f6ca 100644 --- a/web/src/pages/providers/proxy/ProxyProviderForm.ts +++ b/web/src/pages/providers/proxy/ProxyProviderForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, css } from "lit"; @@ -21,13 +28,6 @@ import { ProxyProvider, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; -import { first } from "../../../utils"; - @customElement("ak-provider-proxy-form") export class ProxyProviderFormPage extends ModelForm { static get styles(): CSSResult[] { diff --git a/web/src/pages/providers/proxy/ProxyProviderViewPage.ts b/web/src/pages/providers/proxy/ProxyProviderViewPage.ts index 572a4c453..275dcc579 100644 --- a/web/src/pages/providers/proxy/ProxyProviderViewPage.ts +++ b/web/src/pages/providers/proxy/ProxyProviderViewPage.ts @@ -1,9 +1,28 @@ +import MDNginxIngress from "@goauthentik/docs/providers/proxy/_nginx_ingress.md"; +import MDNginxPM from "@goauthentik/docs/providers/proxy/_nginx_proxy_manager.md"; +import MDNginxStandalone from "@goauthentik/docs/providers/proxy/_nginx_standalone.md"; +import MDTraefikCompose from "@goauthentik/docs/providers/proxy/_traefik_compose.md"; +import MDTraefikIngres from "@goauthentik/docs/providers/proxy/_traefik_ingress.md"; +import MDTraefikStandalone from "@goauthentik/docs/providers/proxy/_traefik_standalone.md"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import { MarkdownDocument } from "@goauthentik/web/elements/Markdown"; +import "@goauthentik/web/elements/Markdown"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/pages/providers/RelatedApplicationButton"; +import "@goauthentik/web/pages/providers/proxy/ProxyProviderForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBanner from "@patternfly/patternfly/components/Banner/banner.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -17,25 +36,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { ProvidersApi, ProxyMode, ProxyProvider } from "@goauthentik/api"; -import MDNginxIngress from "../../../../../website/docs/providers/proxy/_nginx_ingress.md"; -import MDNginxPM from "../../../../../website/docs/providers/proxy/_nginx_proxy_manager.md"; -import MDNginxStandalone from "../../../../../website/docs/providers/proxy/_nginx_standalone.md"; -import MDTraefikCompose from "../../../../../website/docs/providers/proxy/_traefik_compose.md"; -import MDTraefikIngres from "../../../../../website/docs/providers/proxy/_traefik_ingress.md"; -import MDTraefikStandalone from "../../../../../website/docs/providers/proxy/_traefik_standalone.md"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import { PFColor } from "../../../elements/Label"; -import "../../../elements/Markdown"; -import { MarkdownDocument } from "../../../elements/Markdown"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../RelatedApplicationButton"; -import "./ProxyProviderForm"; - export function ModeToLabel(action?: ProxyMode): string { if (!action) return ""; switch (action) { diff --git a/web/src/pages/providers/saml/SAMLProviderForm.ts b/web/src/pages/providers/saml/SAMLProviderForm.ts index 8cc11230b..77a8489d0 100644 --- a/web/src/pages/providers/saml/SAMLProviderForm.ts +++ b/web/src/pages/providers/saml/SAMLProviderForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -17,12 +23,6 @@ import { SpBindingEnum, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; - @customElement("ak-provider-saml-form") export class SAMLProviderFormPage extends ModelForm { loadInstance(pk: number): Promise { diff --git a/web/src/pages/providers/saml/SAMLProviderImportForm.ts b/web/src/pages/providers/saml/SAMLProviderImportForm.ts index 0ed2ebb0b..0a76b09f8 100644 --- a/web/src/pages/providers/saml/SAMLProviderImportForm.ts +++ b/web/src/pages/providers/saml/SAMLProviderImportForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { SentryIgnoredError } from "@goauthentik/web/common/errors"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -11,11 +16,6 @@ import { SAMLProvider, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { SentryIgnoredError } from "../../../common/errors"; -import { Form } from "../../../elements/forms/Form"; -import "../../../elements/forms/HorizontalFormElement"; - @customElement("ak-provider-saml-import-form") export class SAMLProviderImportForm extends Form { getSuccessMessage(): string { diff --git a/web/src/pages/providers/saml/SAMLProviderViewPage.ts b/web/src/pages/providers/saml/SAMLProviderViewPage.ts index b37b9e365..afcd038fb 100644 --- a/web/src/pages/providers/saml/SAMLProviderViewPage.ts +++ b/web/src/pages/providers/saml/SAMLProviderViewPage.ts @@ -1,3 +1,14 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/pages/providers/RelatedApplicationButton"; +import "@goauthentik/web/pages/providers/saml/SAMLProviderForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; @@ -5,7 +16,7 @@ import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFBanner from "@patternfly/patternfly/components/Banner/banner.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -17,17 +28,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { CryptoApi, ProvidersApi, SAMLProvider } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/ActionButton"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../RelatedApplicationButton"; -import "./SAMLProviderForm"; - @customElement("ak-provider-saml-view") export class SAMLProviderViewPage extends LitElement { @property() diff --git a/web/src/pages/sources/SourceListPage.ts b/web/src/pages/sources/SourceListPage.ts index 88bc23e3f..2e3dfc99b 100644 --- a/web/src/pages/sources/SourceListPage.ts +++ b/web/src/pages/sources/SourceListPage.ts @@ -1,3 +1,17 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/sources/SourceWizard"; +import "@goauthentik/web/pages/sources/ldap/LDAPSourceForm"; +import "@goauthentik/web/pages/sources/oauth/OAuthSourceForm"; +import "@goauthentik/web/pages/sources/plex/PlexSourceForm"; +import "@goauthentik/web/pages/sources/saml/SAMLSourceForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,20 +20,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { Source, SourcesApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./SourceWizard"; -import "./ldap/LDAPSourceForm"; -import "./oauth/OAuthSourceForm"; -import "./plex/PlexSourceForm"; -import "./saml/SAMLSourceForm"; - @customElement("ak-source-list") export class SourceListPage extends TablePage { pageTitle(): string { diff --git a/web/src/pages/sources/SourceViewPage.ts b/web/src/pages/sources/SourceViewPage.ts index 262b878a1..5534814df 100644 --- a/web/src/pages/sources/SourceViewPage.ts +++ b/web/src/pages/sources/SourceViewPage.ts @@ -1,18 +1,18 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/elements/PageHeader"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/pages/sources/ldap/LDAPSourceViewPage"; +import "@goauthentik/web/pages/sources/oauth/OAuthSourceViewPage"; +import "@goauthentik/web/pages/sources/plex/PlexSourceViewPage"; +import "@goauthentik/web/pages/sources/saml/SAMLSourceViewPage"; + import { LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { Source, SourcesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/EmptyState"; -import "../../elements/PageHeader"; -import "../../elements/buttons/SpinnerButton"; -import "./ldap/LDAPSourceViewPage"; -import "./oauth/OAuthSourceViewPage"; -import "./plex/PlexSourceViewPage"; -import "./saml/SAMLSourceViewPage"; - @customElement("ak-source-view") export class SourceViewPage extends LitElement { @property({ type: String }) diff --git a/web/src/pages/sources/SourceWizard.ts b/web/src/pages/sources/SourceWizard.ts index e56988a48..b0ab45b3f 100644 --- a/web/src/pages/sources/SourceWizard.ts +++ b/web/src/pages/sources/SourceWizard.ts @@ -1,10 +1,20 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +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/sources/ldap/LDAPSourceForm"; +import "@goauthentik/web/pages/sources/oauth/OAuthSourceForm"; +import "@goauthentik/web/pages/sources/plex/PlexSourceForm"; +import "@goauthentik/web/pages/sources/saml/SAMLSourceForm"; + 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -12,16 +22,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { SourcesApi, TypeCreate } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/ProxyForm"; -import "../../elements/wizard/FormWizardPage"; -import "../../elements/wizard/Wizard"; -import { WizardPage } from "../../elements/wizard/WizardPage"; -import "./ldap/LDAPSourceForm"; -import "./oauth/OAuthSourceForm"; -import "./plex/PlexSourceForm"; -import "./saml/SAMLSourceForm"; - @customElement("ak-source-wizard-initial") export class InitialSourceWizardPage extends WizardPage { @property({ attribute: false }) diff --git a/web/src/pages/sources/ldap/LDAPSourceForm.ts b/web/src/pages/sources/ldap/LDAPSourceForm.ts index 7a3bbef14..5353a1ff6 100644 --- a/web/src/pages/sources/ldap/LDAPSourceForm.ts +++ b/web/src/pages/sources/ldap/LDAPSourceForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/SearchSelect"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -16,13 +23,6 @@ import { SourcesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/SearchSelect"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-source-ldap-form") export class LDAPSourceForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/sources/ldap/LDAPSourceViewPage.ts b/web/src/pages/sources/ldap/LDAPSourceViewPage.ts index 581907dc3..83a7acfd1 100644 --- a/web/src/pages/sources/ldap/LDAPSourceViewPage.ts +++ b/web/src/pages/sources/ldap/LDAPSourceViewPage.ts @@ -1,10 +1,20 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/pages/sources/ldap/LDAPSourceForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -16,16 +26,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { LDAPSource, SourcesApi, StatusEnum } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/ActionButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../../../elements/forms/ModalForm"; -import "./LDAPSourceForm"; - @customElement("ak-source-ldap-view") export class LDAPSourceViewPage extends LitElement { @property({ type: String }) diff --git a/web/src/pages/sources/oauth/OAuthSourceForm.ts b/web/src/pages/sources/oauth/OAuthSourceForm.ts index f819bf2a6..a48dd958b 100644 --- a/web/src/pages/sources/oauth/OAuthSourceForm.ts +++ b/web/src/pages/sources/oauth/OAuthSourceForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -16,13 +23,6 @@ import { UserMatchingModeEnum, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/CodeMirror"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-source-oauth-form") export class OAuthSourceForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/sources/oauth/OAuthSourceViewPage.ts b/web/src/pages/sources/oauth/OAuthSourceViewPage.ts index b0cb31861..4ec4263df 100644 --- a/web/src/pages/sources/oauth/OAuthSourceViewPage.ts +++ b/web/src/pages/sources/oauth/OAuthSourceViewPage.ts @@ -1,9 +1,19 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; +import "@goauthentik/web/pages/sources/oauth/OAuthSourceForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, 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 PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -14,16 +24,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { OAuthSource, ProviderTypeEnum, SourcesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../../../elements/forms/ModalForm"; -import "../../policies/BoundPoliciesList"; -import "./OAuthSourceForm"; - export function ProviderToLabel(provider?: ProviderTypeEnum): string { if (!provider) return ""; switch (provider) { @@ -39,6 +39,8 @@ export function ProviderToLabel(provider?: ProviderTypeEnum): string { return "GitHub"; case ProviderTypeEnum.Google: return "Google"; + case ProviderTypeEnum.Mailcow: + return "Mailcow"; case ProviderTypeEnum.Openidconnect: return t`Generic OpenID Connect`; case ProviderTypeEnum.Okta: diff --git a/web/src/pages/sources/plex/PlexSourceForm.ts b/web/src/pages/sources/plex/PlexSourceForm.ts index 7b1293f8d..fe7b1503b 100644 --- a/web/src/pages/sources/plex/PlexSourceForm.ts +++ b/web/src/pages/sources/plex/PlexSourceForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { PlexAPIClient, PlexResource, popupCenterScreen } from "@goauthentik/web/api/Plex"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first, randomString } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -13,13 +20,6 @@ import { UserMatchingModeEnum, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { PlexAPIClient, PlexResource, popupCenterScreen } from "../../../api/Plex"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first, randomString } from "../../../utils"; - @customElement("ak-source-plex-form") export class PlexSourceForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/sources/plex/PlexSourceViewPage.ts b/web/src/pages/sources/plex/PlexSourceViewPage.ts index 2edbc65a5..81a69d81c 100644 --- a/web/src/pages/sources/plex/PlexSourceViewPage.ts +++ b/web/src/pages/sources/plex/PlexSourceViewPage.ts @@ -1,9 +1,19 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; +import "@goauthentik/web/pages/sources/plex/PlexSourceForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, 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 PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -14,16 +24,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { PlexSource, SourcesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../../../elements/forms/ModalForm"; -import "../../policies/BoundPoliciesList"; -import "./PlexSourceForm"; - @customElement("ak-source-plex-view") export class PlexSourceViewPage extends LitElement { @property({ type: String }) diff --git a/web/src/pages/sources/saml/SAMLSourceForm.ts b/web/src/pages/sources/saml/SAMLSourceForm.ts index e9630a971..2f528c634 100644 --- a/web/src/pages/sources/saml/SAMLSourceForm.ts +++ b/web/src/pages/sources/saml/SAMLSourceForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -17,13 +24,6 @@ import { SourcesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; -import { first } from "../../../utils"; - @customElement("ak-source-saml-form") export class SAMLSourceForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/sources/saml/SAMLSourceViewPage.ts b/web/src/pages/sources/saml/SAMLSourceViewPage.ts index 95e2fc962..a6d4a78f4 100644 --- a/web/src/pages/sources/saml/SAMLSourceViewPage.ts +++ b/web/src/pages/sources/saml/SAMLSourceViewPage.ts @@ -1,3 +1,13 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/pages/policies/BoundPoliciesList"; +import "@goauthentik/web/pages/sources/saml/SAMLSourceForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; @@ -5,7 +15,7 @@ import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -16,16 +26,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { SAMLSource, SourcesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/CodeMirror"; -import "../../../elements/Tabs"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/events/ObjectChangelog"; -import "../../../elements/forms/ModalForm"; -import "../../policies/BoundPoliciesList"; -import "./SAMLSourceForm"; - @customElement("ak-source-saml-view") export class SAMLSourceViewPage extends LitElement { @property({ type: String }) diff --git a/web/src/pages/stages/StageListPage.ts b/web/src/pages/stages/StageListPage.ts index 55b8fb437..b255a9d4f 100644 --- a/web/src/pages/stages/StageListPage.ts +++ b/web/src/pages/stages/StageListPage.ts @@ -1,3 +1,33 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import "@goauthentik/web/elements/forms/ProxyForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/stages/StageWizard"; +import "@goauthentik/web/pages/stages/authenticator_duo/AuthenticatorDuoStageForm"; +import "@goauthentik/web/pages/stages/authenticator_sms/AuthenticatorSMSStageForm"; +import "@goauthentik/web/pages/stages/authenticator_static/AuthenticatorStaticStageForm"; +import "@goauthentik/web/pages/stages/authenticator_totp/AuthenticatorTOTPStageForm"; +import "@goauthentik/web/pages/stages/authenticator_validate/AuthenticatorValidateStageForm"; +import "@goauthentik/web/pages/stages/authenticator_webauthn/AuthenticateWebAuthnStageForm"; +import "@goauthentik/web/pages/stages/captcha/CaptchaStageForm"; +import "@goauthentik/web/pages/stages/consent/ConsentStageForm"; +import "@goauthentik/web/pages/stages/deny/DenyStageForm"; +import "@goauthentik/web/pages/stages/dummy/DummyStageForm"; +import "@goauthentik/web/pages/stages/email/EmailStageForm"; +import "@goauthentik/web/pages/stages/identification/IdentificationStageForm"; +import "@goauthentik/web/pages/stages/invitation/InvitationStageForm"; +import "@goauthentik/web/pages/stages/password/PasswordStageForm"; +import "@goauthentik/web/pages/stages/prompt/PromptStageForm"; +import "@goauthentik/web/pages/stages/user_delete/UserDeleteStageForm"; +import "@goauthentik/web/pages/stages/user_login/UserLoginStageForm"; +import "@goauthentik/web/pages/stages/user_logout/UserLogoutStageForm"; +import "@goauthentik/web/pages/stages/user_write/UserWriteStageForm"; +import { groupBy } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,36 +36,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { Stage, StagesApi } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import "../../elements/forms/ProxyForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import { groupBy } from "../../utils"; -import "./StageWizard"; -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-list") export class StageListPage extends TablePage { pageTitle(): string { diff --git a/web/src/pages/stages/StageWizard.ts b/web/src/pages/stages/StageWizard.ts index fde460f8c..5dab99dc5 100644 --- a/web/src/pages/stages/StageWizard.ts +++ b/web/src/pages/stages/StageWizard.ts @@ -1,10 +1,16 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +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 { 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFRadio from "@patternfly/patternfly/components/Radio/radio.css"; @@ -12,11 +18,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { StagesApi, TypeCreate } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/ProxyForm"; -import "../../elements/wizard/FormWizardPage"; -import "../../elements/wizard/Wizard"; -import { WizardPage } from "../../elements/wizard/WizardPage"; import "./authenticator_duo/AuthenticatorDuoStageForm.ts"; import "./authenticator_sms/AuthenticatorSMSStageForm.ts"; import "./authenticator_static/AuthenticatorStaticStageForm.ts"; diff --git a/web/src/pages/stages/authenticator_duo/AuthenticatorDuoStageForm.ts b/web/src/pages/stages/authenticator_duo/AuthenticatorDuoStageForm.ts index 920d2278b..e54e56c4c 100644 --- a/web/src/pages/stages/authenticator_duo/AuthenticatorDuoStageForm.ts +++ b/web/src/pages/stages/authenticator_duo/AuthenticatorDuoStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -13,12 +19,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-authenticator-duo-form") export class AuthenticatorDuoStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts b/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts index c0f5a69a4..a629a0cc4 100644 --- a/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts +++ b/web/src/pages/stages/authenticator_sms/AuthenticatorSMSStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -14,12 +20,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-authenticator-sms-form") export class AuthenticatorSMSStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/authenticator_static/AuthenticatorStaticStageForm.ts b/web/src/pages/stages/authenticator_static/AuthenticatorStaticStageForm.ts index 9147646a9..22eeb2e1d 100644 --- a/web/src/pages/stages/authenticator_static/AuthenticatorStaticStageForm.ts +++ b/web/src/pages/stages/authenticator_static/AuthenticatorStaticStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -12,12 +18,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-authenticator-static-form") export class AuthenticatorStaticStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts b/web/src/pages/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts index 90e9dfb61..5db228051 100644 --- a/web/src/pages/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts +++ b/web/src/pages/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -13,11 +18,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-authenticator-totp-form") export class AuthenticatorTOTPStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts b/web/src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts index 860e25c08..121e656d4 100644 --- a/web/src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts +++ b/web/src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -12,12 +18,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; - @customElement("ak-stage-authenticator-validate-form") export class AuthenticatorValidateStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/authenticator_webauthn/AuthenticateWebAuthnStageForm.ts b/web/src/pages/stages/authenticator_webauthn/AuthenticateWebAuthnStageForm.ts index d78f0192b..f871d0d3f 100644 --- a/web/src/pages/stages/authenticator_webauthn/AuthenticateWebAuthnStageForm.ts +++ b/web/src/pages/stages/authenticator_webauthn/AuthenticateWebAuthnStageForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -15,10 +19,6 @@ import { UserVerificationEnum, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-authenticator-webauthn-form") export class AuthenticateWebAuthnStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/captcha/CaptchaStageForm.ts b/web/src/pages/stages/captcha/CaptchaStageForm.ts index d2b7651ee..c9ebad0a1 100644 --- a/web/src/pages/stages/captcha/CaptchaStageForm.ts +++ b/web/src/pages/stages/captcha/CaptchaStageForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { CaptchaStage, CaptchaStageRequest, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-captcha-form") export class CaptchaStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/consent/ConsentStageForm.ts b/web/src/pages/stages/consent/ConsentStageForm.ts index 62d1be348..f6ca00e43 100644 --- a/web/src/pages/stages/consent/ConsentStageForm.ts +++ b/web/src/pages/stages/consent/ConsentStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { ConsentStage, ConsentStageModeEnum, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; - @customElement("ak-stage-consent-form") export class ConsentStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/deny/DenyStageForm.ts b/web/src/pages/stages/deny/DenyStageForm.ts index ca151d547..2c2ae2729 100644 --- a/web/src/pages/stages/deny/DenyStageForm.ts +++ b/web/src/pages/stages/deny/DenyStageForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { DenyStage, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-deny-form") export class DenyStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/dummy/DummyStageForm.ts b/web/src/pages/stages/dummy/DummyStageForm.ts index f5f4aecb5..c82616164 100644 --- a/web/src/pages/stages/dummy/DummyStageForm.ts +++ b/web/src/pages/stages/dummy/DummyStageForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { DummyStage, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-dummy-form") export class DummyStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/email/EmailStageForm.ts b/web/src/pages/stages/email/EmailStageForm.ts index 0541d92c6..0623421dc 100644 --- a/web/src/pages/stages/email/EmailStageForm.ts +++ b/web/src/pages/stages/email/EmailStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,12 +13,6 @@ import { until } from "lit/directives/until.js"; import { EmailStage, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-email-form") export class EmailStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/identification/IdentificationStageForm.ts b/web/src/pages/stages/identification/IdentificationStageForm.ts index e4072c2f3..96d163967 100644 --- a/web/src/pages/stages/identification/IdentificationStageForm.ts +++ b/web/src/pages/stages/identification/IdentificationStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -14,12 +20,6 @@ import { UserFieldsEnum, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-identification-form") export class IdentificationStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/invitation/InvitationForm.ts b/web/src/pages/stages/invitation/InvitationForm.ts index ecafd1405..4090604c4 100644 --- a/web/src/pages/stages/invitation/InvitationForm.ts +++ b/web/src/pages/stages/invitation/InvitationForm.ts @@ -1,3 +1,8 @@ +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 { dateTimeLocal, first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -7,12 +12,6 @@ import { customElement } from "lit/decorators.js"; import { Invitation, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/CodeMirror"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { dateTimeLocal, first } from "../../../utils"; - @customElement("ak-invitation-form") export class InvitationForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/invitation/InvitationListLink.ts b/web/src/pages/stages/invitation/InvitationListLink.ts index 36254ddd6..3dad6a52c 100644 --- a/web/src/pages/stages/invitation/InvitationListLink.ts +++ b/web/src/pages/stages/invitation/InvitationListLink.ts @@ -1,10 +1,12 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; @@ -13,8 +15,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; - @customElement("ak-stage-invitation-list-link") export class InvitationListLink extends LitElement { @property() diff --git a/web/src/pages/stages/invitation/InvitationListPage.ts b/web/src/pages/stages/invitation/InvitationListPage.ts index 53c2d2504..475eeaa99 100644 --- a/web/src/pages/stages/invitation/InvitationListPage.ts +++ b/web/src/pages/stages/invitation/InvitationListPage.ts @@ -1,3 +1,15 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/stages/invitation/InvitationForm"; +import "@goauthentik/web/pages/stages/invitation/InvitationListLink"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -8,18 +20,6 @@ import PFBanner from "@patternfly/patternfly/components/Banner/banner.css"; import { Invitation, StagesApi } from "@goauthentik/api"; -import { AKResponse } from "../../../api/Client"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { uiConfig } from "../../../common/config"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/forms/DeleteBulkForm"; -import "../../../elements/forms/ModalForm"; -import { TableColumn } from "../../../elements/table/Table"; -import { TablePage } from "../../../elements/table/TablePage"; -import "./InvitationForm"; -import "./InvitationListLink"; - @customElement("ak-stage-invitation-list") export class InvitationListPage extends TablePage { expandable = true; diff --git a/web/src/pages/stages/invitation/InvitationStageForm.ts b/web/src/pages/stages/invitation/InvitationStageForm.ts index efc295733..68735e463 100644 --- a/web/src/pages/stages/invitation/InvitationStageForm.ts +++ b/web/src/pages/stages/invitation/InvitationStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,12 +11,6 @@ import { customElement } from "lit/decorators.js"; import { InvitationStage, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-invitation-form") export class InvitationStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/password/PasswordStageForm.ts b/web/src/pages/stages/password/PasswordStageForm.ts index 1578d2c5c..37052be3e 100644 --- a/web/src/pages/stages/password/PasswordStageForm.ts +++ b/web/src/pages/stages/password/PasswordStageForm.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -13,12 +19,6 @@ import { StagesApi, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-password-form") export class PasswordStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/prompt/PromptForm.ts b/web/src/pages/stages/prompt/PromptForm.ts index 2bddf3d84..b938c38eb 100644 --- a/web/src/pages/stages/prompt/PromptForm.ts +++ b/web/src/pages/stages/prompt/PromptForm.ts @@ -1,3 +1,9 @@ +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 { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,12 +12,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { Prompt, PromptTypeEnum, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/CodeMirror"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-prompt-form") export class PromptForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/prompt/PromptListPage.ts b/web/src/pages/stages/prompt/PromptListPage.ts index 7b2cc47d6..f96926422 100644 --- a/web/src/pages/stages/prompt/PromptListPage.ts +++ b/web/src/pages/stages/prompt/PromptListPage.ts @@ -1,3 +1,15 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import "@goauthentik/web/elements/buttons/ModalButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/stages/prompt/PromptForm"; +import { truncate } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,18 +17,6 @@ import { customElement, property } from "lit/decorators.js"; import { Prompt, StagesApi } from "@goauthentik/api"; -import { AKResponse } from "../../../api/Client"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { uiConfig } from "../../../common/config"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/SpinnerButton"; -import "../../../elements/forms/DeleteBulkForm"; -import "../../../elements/forms/ModalForm"; -import { TableColumn } from "../../../elements/table/Table"; -import { TablePage } from "../../../elements/table/TablePage"; -import { truncate } from "../../../utils"; -import "./PromptForm"; - @customElement("ak-stage-prompt-list") export class PromptListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/stages/prompt/PromptStageForm.ts b/web/src/pages/stages/prompt/PromptStageForm.ts index 1203a7b5c..a6a8ec0e8 100644 --- a/web/src/pages/stages/prompt/PromptStageForm.ts +++ b/web/src/pages/stages/prompt/PromptStageForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/pages/stages/prompt/PromptForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,13 +14,6 @@ import { until } from "lit/directives/until.js"; import { PoliciesApi, PromptStage, StagesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import "../../../elements/forms/ModalForm"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "./PromptForm"; - @customElement("ak-stage-prompt-form") export class PromptStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/user_delete/UserDeleteStageForm.ts b/web/src/pages/stages/user_delete/UserDeleteStageForm.ts index b947c8b11..efc687d48 100644 --- a/web/src/pages/stages/user_delete/UserDeleteStageForm.ts +++ b/web/src/pages/stages/user_delete/UserDeleteStageForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { StagesApi, UserDeleteStage } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-user-delete-form") export class UserDeleteStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/user_login/UserLoginStageForm.ts b/web/src/pages/stages/user_login/UserLoginStageForm.ts index 6baf0475d..23fa33f6a 100644 --- a/web/src/pages/stages/user_login/UserLoginStageForm.ts +++ b/web/src/pages/stages/user_login/UserLoginStageForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import "@goauthentik/web/elements/utils/TimeDeltaHelp"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,13 +12,6 @@ import { customElement } from "lit/decorators.js"; import { StagesApi, UserLoginStage } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import "../../../elements/utils/TimeDeltaHelp"; -import { first } from "../../../utils"; - @customElement("ak-stage-user-login-form") export class UserLoginStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/user_logout/UserLogoutStageForm.ts b/web/src/pages/stages/user_logout/UserLogoutStageForm.ts index 34305b92e..0668c7211 100644 --- a/web/src/pages/stages/user_logout/UserLogoutStageForm.ts +++ b/web/src/pages/stages/user_logout/UserLogoutStageForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { StagesApi, UserLogoutStage } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-stage-user-logout-form") export class UserLogoutStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/stages/user_write/UserWriteStageForm.ts b/web/src/pages/stages/user_write/UserWriteStageForm.ts index accf4a6e8..733140ac1 100644 --- a/web/src/pages/stages/user_write/UserWriteStageForm.ts +++ b/web/src/pages/stages/user_write/UserWriteStageForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/SearchSelect"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,13 +13,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { CoreApi, CoreGroupsListRequest, Group, StagesApi, UserWriteStage } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/SearchSelect"; -import "../../../elements/forms/FormGroup"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; -import { first } from "../../../utils"; - @customElement("ak-stage-user-write-form") export class UserWriteStageForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/system-tasks/SystemTaskListPage.ts b/web/src/pages/system-tasks/SystemTaskListPage.ts index 8940ee402..f074feb4a 100644 --- a/web/src/pages/system-tasks/SystemTaskListPage.ts +++ b/web/src/pages/system-tasks/SystemTaskListPage.ts @@ -1,3 +1,12 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -7,15 +16,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList import { AdminApi, StatusEnum, Task } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { EVENT_REFRESH } from "../../constants"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/ActionButton"; -import "../../elements/buttons/SpinnerButton"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; - @customElement("ak-system-task-list") export class SystemTaskListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/tenants/TenantForm.ts b/web/src/pages/tenants/TenantForm.ts index 2e629dac4..c37bb9e96 100644 --- a/web/src/pages/tenants/TenantForm.ts +++ b/web/src/pages/tenants/TenantForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/CodeMirror"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { DefaultTenant } from "@goauthentik/web/elements/sidebar/SidebarBrand"; +import { first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -15,14 +22,6 @@ import { Tenant, } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/FormGroup"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { DefaultTenant } from "../../elements/sidebar/SidebarBrand"; -import { first } from "../../utils"; - @customElement("ak-tenant-form") export class TenantForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/tenants/TenantListPage.ts b/web/src/pages/tenants/TenantListPage.ts index 89e4c2bdb..03c740856 100644 --- a/web/src/pages/tenants/TenantListPage.ts +++ b/web/src/pages/tenants/TenantListPage.ts @@ -1,3 +1,14 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/tenants/TenantForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,17 +16,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, Tenant } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./TenantForm"; - @customElement("ak-tenant-list") export class TenantListPage extends TablePage { searchEnabled(): boolean { diff --git a/web/src/pages/tokens/TokenForm.ts b/web/src/pages/tokens/TokenForm.ts index a0d521571..d8102953e 100644 --- a/web/src/pages/tokens/TokenForm.ts +++ b/web/src/pages/tokens/TokenForm.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/FormGroup"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; +import { UserOption } from "@goauthentik/web/elements/user/utils"; +import { dateTimeLocal, first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,13 +13,6 @@ import { until } from "lit/directives/until.js"; import { CoreApi, IntentEnum, Token } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/forms/FormGroup"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { UserOption } from "../../elements/user/utils"; -import { dateTimeLocal, first } from "../../utils"; - @customElement("ak-token-form") export class TokenForm extends ModelForm { loadInstance(pk: string): Promise { diff --git a/web/src/pages/tokens/TokenListPage.ts b/web/src/pages/tokens/TokenListPage.ts index 69cb90981..f5c6c1e3d 100644 --- a/web/src/pages/tokens/TokenListPage.ts +++ b/web/src/pages/tokens/TokenListPage.ts @@ -1,3 +1,15 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/Dropdown"; +import "@goauthentik/web/elements/buttons/TokenCopyButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/tokens/TokenForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,18 +17,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, IntentEnum, Token } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/Dropdown"; -import "../../elements/buttons/TokenCopyButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import "./TokenForm"; - export function IntentToLabel(intent: IntentEnum): string { switch (intent) { case IntentEnum.Api: diff --git a/web/src/pages/users/GroupSelectModal.ts b/web/src/pages/users/GroupSelectModal.ts index d7162a3f0..ff059ec4d 100644 --- a/web/src/pages/users/GroupSelectModal.ts +++ b/web/src/pages/users/GroupSelectModal.ts @@ -1,3 +1,11 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TableModal } from "@goauthentik/web/elements/table/TableModal"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,14 +13,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, Group } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/SpinnerButton"; -import { TableColumn } from "../../elements/table/Table"; -import { TableModal } from "../../elements/table/TableModal"; - @customElement("ak-user-group-select-table") export class GroupSelectModal extends TableModal { checkbox = true; diff --git a/web/src/pages/users/RelatedUserList.ts b/web/src/pages/users/RelatedUserList.ts index fd5bcaba6..0f67e5db4 100644 --- a/web/src/pages/users/RelatedUserList.ts +++ b/web/src/pages/users/RelatedUserList.ts @@ -1,3 +1,22 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG, config, tenant } from "@goauthentik/web/api/Config"; +import { me } from "@goauthentik/web/api/Users"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { getURLParam, updateURLParams } from "@goauthentik/web/elements/router/RouteMatch"; +import { Table, TableColumn } from "@goauthentik/web/elements/table/Table"; +import "@goauthentik/web/pages/users/ServiceAccountForm"; +import "@goauthentik/web/pages/users/UserActiveForm"; +import "@goauthentik/web/pages/users/UserForm"; +import "@goauthentik/web/pages/users/UserPasswordForm"; +import "@goauthentik/web/pages/users/UserResetEmailForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -9,25 +28,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList import { CapabilitiesEnum, CoreApi, ResponseError, User } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG, config, tenant } from "../../api/Config"; -import { me } from "../../api/Users"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import "../../elements/buttons/ActionButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { MessageLevel } from "../../elements/messages/Message"; -import { showMessage } from "../../elements/messages/MessageContainer"; -import { getURLParam, updateURLParams } from "../../elements/router/RouteMatch"; -import { Table, TableColumn } from "../../elements/table/Table"; -import { first } from "../../utils"; -import "./ServiceAccountForm"; -import "./UserActiveForm"; -import "./UserForm"; -import "./UserPasswordForm"; -import "./UserResetEmailForm"; - @customElement("ak-user-related-list") export class RelatedUserList extends Table { expandable = true; diff --git a/web/src/pages/users/ServiceAccountForm.ts b/web/src/pages/users/ServiceAccountForm.ts index eddb800ee..d3704cf5c 100644 --- a/web/src/pages/users/ServiceAccountForm.ts +++ b/web/src/pages/users/ServiceAccountForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModalForm } from "@goauthentik/web/elements/forms/ModalForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,11 +11,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { CoreApi, UserServiceAccountRequest, UserServiceAccountResponse } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; -import { ModalForm } from "../../elements/forms/ModalForm"; - @customElement("ak-user-service-account") export class ServiceAccountForm extends Form { @property({ attribute: false }) diff --git a/web/src/pages/users/UserActiveForm.ts b/web/src/pages/users/UserActiveForm.ts index 5d499618a..3e8c1890a 100644 --- a/web/src/pages/users/UserActiveForm.ts +++ b/web/src/pages/users/UserActiveForm.ts @@ -1,13 +1,13 @@ +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { DeleteForm } from "@goauthentik/web/elements/forms/DeleteForm"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; -import "../../elements/buttons/SpinnerButton"; -import { DeleteForm } from "../../elements/forms/DeleteForm"; -import { MessageLevel } from "../../elements/messages/Message"; -import { showMessage } from "../../elements/messages/MessageContainer"; - @customElement("ak-user-active-form") export class UserActiveForm extends DeleteForm { onSuccess(): void { diff --git a/web/src/pages/users/UserForm.ts b/web/src/pages/users/UserForm.ts index e364a795e..1cd886d44 100644 --- a/web/src/pages/users/UserForm.ts +++ b/web/src/pages/users/UserForm.ts @@ -1,3 +1,8 @@ +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 { first } from "@goauthentik/web/utils"; import YAML from "yaml"; import { t } from "@lingui/macro"; @@ -9,11 +14,6 @@ import { until } from "lit/directives/until.js"; import { CoreApi, Group, User } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/CodeMirror"; -import "../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../elements/forms/ModelForm"; -import { first } from "../../utils"; import "./GroupSelectModal"; @customElement("ak-user-form") diff --git a/web/src/pages/users/UserListPage.ts b/web/src/pages/users/UserListPage.ts index 98da688a0..e985254d0 100644 --- a/web/src/pages/users/UserListPage.ts +++ b/web/src/pages/users/UserListPage.ts @@ -1,38 +1,38 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG, config, tenant } from "@goauthentik/web/api/Config"; +import { me } from "@goauthentik/web/api/Users"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/TreeView"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/forms/DeleteBulkForm"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { getURLParam } from "@goauthentik/web/elements/router/RouteMatch"; +import { TableColumn } from "@goauthentik/web/elements/table/Table"; +import { TablePage } from "@goauthentik/web/elements/table/TablePage"; +import "@goauthentik/web/pages/users/ServiceAccountForm"; +import "@goauthentik/web/pages/users/UserActiveForm"; +import "@goauthentik/web/pages/users/UserForm"; +import "@goauthentik/web/pages/users/UserPasswordForm"; +import "@goauthentik/web/pages/users/UserResetEmailForm"; +import { first } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFAlert from "@patternfly/patternfly/components/Alert/alert.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css"; import { CapabilitiesEnum, CoreApi, ResponseError, User } from "@goauthentik/api"; -import { AKResponse } from "../../api/Client"; -import { DEFAULT_CONFIG, config, tenant } from "../../api/Config"; -import { me } from "../../api/Users"; -import { uiConfig } from "../../common/config"; -import { PFColor } from "../../elements/Label"; -import { PFSize } from "../../elements/Spinner"; -import "../../elements/TreeView"; -import "../../elements/buttons/ActionButton"; -import "../../elements/forms/DeleteBulkForm"; -import "../../elements/forms/ModalForm"; -import { MessageLevel } from "../../elements/messages/Message"; -import { showMessage } from "../../elements/messages/MessageContainer"; -import { getURLParam } from "../../elements/router/RouteMatch"; -import { TableColumn } from "../../elements/table/Table"; -import { TablePage } from "../../elements/table/TablePage"; -import { first } from "../../utils"; -import "./ServiceAccountForm"; -import "./UserActiveForm"; -import "./UserForm"; -import "./UserPasswordForm"; -import "./UserResetEmailForm"; - @customElement("ak-user-list") export class UserListPage extends TablePage { expandable = true; diff --git a/web/src/pages/users/UserPasswordForm.ts b/web/src/pages/users/UserPasswordForm.ts index 8066d0612..4a3cae192 100644 --- a/web/src/pages/users/UserPasswordForm.ts +++ b/web/src/pages/users/UserPasswordForm.ts @@ -1,3 +1,8 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -5,11 +10,6 @@ import { customElement, property } from "lit/decorators.js"; import { CoreApi, UserPasswordSetRequest } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import "../../elements/buttons/SpinnerButton"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; - @customElement("ak-user-password-form") export class UserPasswordForm extends Form { @property({ type: Number }) diff --git a/web/src/pages/users/UserResetEmailForm.ts b/web/src/pages/users/UserResetEmailForm.ts index 02633459e..7a68f871c 100644 --- a/web/src/pages/users/UserResetEmailForm.ts +++ b/web/src/pages/users/UserResetEmailForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { Form } from "@goauthentik/web/elements/forms/Form"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { until } from "lit/directives/until.js"; import { CoreApi, CoreUsersRecoveryEmailRetrieveRequest, StagesApi, User } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { Form } from "../../elements/forms/Form"; -import "../../elements/forms/HorizontalFormElement"; - @customElement("ak-user-reset-email-form") export class UserResetEmailForm extends Form { @property({ attribute: false }) diff --git a/web/src/pages/users/UserViewPage.ts b/web/src/pages/users/UserViewPage.ts index 7c287f583..5803a0667 100644 --- a/web/src/pages/users/UserViewPage.ts +++ b/web/src/pages/users/UserViewPage.ts @@ -1,10 +1,33 @@ +import { DEFAULT_CONFIG, config } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/CodeMirror"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/PageHeader"; +import { PFSize } from "@goauthentik/web/elements/Spinner"; +import "@goauthentik/web/elements/Tabs"; +import "@goauthentik/web/elements/buttons/ActionButton"; +import "@goauthentik/web/elements/buttons/SpinnerButton"; +import "@goauthentik/web/elements/charts/UserChart"; +import "@goauthentik/web/elements/events/ObjectChangelog"; +import "@goauthentik/web/elements/events/UserEvents"; +import "@goauthentik/web/elements/forms/ModalForm"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import "@goauthentik/web/elements/oauth/UserRefreshList"; +import "@goauthentik/web/elements/user/SessionList"; +import "@goauthentik/web/elements/user/UserConsentList"; +import "@goauthentik/web/pages/groups/RelatedGroupList"; +import "@goauthentik/web/pages/users/UserActiveForm"; +import "@goauthentik/web/pages/users/UserForm"; +import "@goauthentik/web/pages/users/UserPasswordForm"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -18,29 +41,6 @@ import PFSizing from "@patternfly/patternfly/utilities/Sizing/sizing.css"; import { CapabilitiesEnum, CoreApi, User } from "@goauthentik/api"; -import { DEFAULT_CONFIG, config } from "../../api/Config"; -import { EVENT_REFRESH } from "../../constants"; -import "../../elements/CodeMirror"; -import { PFColor } from "../../elements/Label"; -import "../../elements/PageHeader"; -import { PFSize } from "../../elements/Spinner"; -import "../../elements/Tabs"; -import "../../elements/buttons/ActionButton"; -import "../../elements/buttons/SpinnerButton"; -import "../../elements/charts/UserChart"; -import "../../elements/events/ObjectChangelog"; -import "../../elements/events/UserEvents"; -import "../../elements/forms/ModalForm"; -import { MessageLevel } from "../../elements/messages/Message"; -import { showMessage } from "../../elements/messages/MessageContainer"; -import "../../elements/oauth/UserRefreshList"; -import "../../elements/user/SessionList"; -import "../../elements/user/UserConsentList"; -import "../groups/RelatedGroupList"; -import "./UserActiveForm"; -import "./UserForm"; -import "./UserPasswordForm"; - @customElement("ak-user-view") export class UserViewPage extends LitElement { @property({ type: Number }) diff --git a/web/src/routesAdmin.ts b/web/src/routesAdmin.ts index 6461a952e..aeb227b6b 100644 --- a/web/src/routesAdmin.ts +++ b/web/src/routesAdmin.ts @@ -1,7 +1,8 @@ +import "@goauthentik/web/pages/admin-overview/AdminOverviewPage"; + import { html } from "lit"; import { ID_REGEX, Route, SLUG_REGEX, UUID_REGEX } from "./elements/router/Route"; -import "./pages/admin-overview/AdminOverviewPage"; export const ROUTES: Route[] = [ // Prevent infinite Shell loops diff --git a/web/src/user/LibraryApplication.ts b/web/src/user/LibraryApplication.ts index b812cf808..4ff36aec8 100644 --- a/web/src/user/LibraryApplication.ts +++ b/web/src/user/LibraryApplication.ts @@ -1,3 +1,7 @@ +import { me } from "@goauthentik/web/api/Users"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { truncate } from "@goauthentik/web/utils"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; @@ -5,7 +9,7 @@ import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; @@ -13,10 +17,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { Application } from "@goauthentik/api"; -import { me } from "../api/Users"; -import { uiConfig } from "../common/config"; -import { truncate } from "../utils"; - @customElement("ak-library-app") export class LibraryApplication extends LitElement { @property({ attribute: false }) diff --git a/web/src/user/LibraryPage.ts b/web/src/user/LibraryPage.ts index 0b8217ae1..07039b676 100644 --- a/web/src/user/LibraryPage.ts +++ b/web/src/user/LibraryPage.ts @@ -1,3 +1,8 @@ +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 { groupBy, loading } from "@goauthentik/web/utils"; import Fuse from "fuse.js"; import { t } from "@lingui/macro"; @@ -6,7 +11,7 @@ import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; @@ -17,11 +22,6 @@ import PFDisplay from "@patternfly/patternfly/utilities/Display/display.css"; import { Application, CoreApi } from "@goauthentik/api"; -import { AKResponse } from "../api/Client"; -import { DEFAULT_CONFIG } from "../api/Config"; -import { LayoutType, UIConfig, uiConfig } from "../common/config"; -import { getURLParam, updateURLParams } from "../elements/router/RouteMatch"; -import { groupBy, loading } from "../utils"; import "./LibraryApplication"; @customElement("ak-library") diff --git a/web/src/user/user-settings/BaseUserSettings.ts b/web/src/user/user-settings/BaseUserSettings.ts index 666563663..a3fd8c21b 100644 --- a/web/src/user/user-settings/BaseUserSettings.ts +++ b/web/src/user/user-settings/BaseUserSettings.ts @@ -1,7 +1,7 @@ import { CSSResult, LitElement } 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 PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; diff --git a/web/src/user/user-settings/UserSettingsPage.ts b/web/src/user/user-settings/UserSettingsPage.ts index 1a3c21d07..06aeceb8c 100644 --- a/web/src/user/user-settings/UserSettingsPage.ts +++ b/web/src/user/user-settings/UserSettingsPage.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { me } from "@goauthentik/web/api/Users"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; @@ -5,7 +9,7 @@ import { customElement, state } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css"; @@ -21,9 +25,6 @@ import PFSizing from "@patternfly/patternfly/utilities/Sizing/sizing.css"; import { StagesApi, UserSetting } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../api/Config"; -import { me } from "../../api/Users"; -import { EVENT_REFRESH } from "../../constants"; import "../../elements/Tabs"; import "../../elements/user/SessionList"; import "../../elements/user/UserConsentList"; diff --git a/web/src/user/user-settings/details/UserPassword.ts b/web/src/user/user-settings/details/UserPassword.ts index 4c5fec3c7..e28cf52d3 100644 --- a/web/src/user/user-settings/details/UserPassword.ts +++ b/web/src/user/user-settings/details/UserPassword.ts @@ -1,3 +1,5 @@ +import { AndNext } from "@goauthentik/web/api/Config"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,15 +8,13 @@ import { customElement } from "lit/decorators.js"; import { property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; 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 { AndNext } from "../../../api/Config"; - @customElement("ak-user-settings-password") export class UserSettingsPassword extends LitElement { @property() diff --git a/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts b/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts index 78e8cb2c0..2f0c7e621 100644 --- a/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts +++ b/web/src/user/user-settings/details/UserSettingsFlowExecutor.ts @@ -1,10 +1,18 @@ +import { DEFAULT_CONFIG, tenant } from "@goauthentik/web/api/Config"; +import { refreshMe } from "@goauthentik/web/api/Users"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { StageHost } from "@goauthentik/web/flows/stages/base"; +import "@goauthentik/web/user/user-settings/details/stages/prompt/PromptStage"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { unsafeHTML } from "lit/directives/unsafe-html.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; @@ -22,14 +30,6 @@ import { ShellChallenge, } from "@goauthentik/api"; -import { DEFAULT_CONFIG, tenant } from "../../../api/Config"; -import { refreshMe } from "../../../api/Users"; -import { EVENT_REFRESH } from "../../../constants"; -import { MessageLevel } from "../../../elements/messages/Message"; -import { showMessage } from "../../../elements/messages/MessageContainer"; -import { StageHost } from "../../../flows/stages/base"; -import "./stages/prompt/PromptStage"; - @customElement("ak-user-settings-flow-executor") export class UserSettingsFlowExecutor extends LitElement implements StageHost { @property() diff --git a/web/src/user/user-settings/details/stages/prompt/PromptStage.ts b/web/src/user/user-settings/details/stages/prompt/PromptStage.ts index ff164dd2f..9d035283b 100644 --- a/web/src/user/user-settings/details/stages/prompt/PromptStage.ts +++ b/web/src/user/user-settings/details/stages/prompt/PromptStage.ts @@ -1,3 +1,6 @@ +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { PromptStage } from "@goauthentik/web/flows/stages/prompt/PromptStage"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -8,9 +11,6 @@ import PFCheck from "@patternfly/patternfly/components/Check/check.css"; import { PromptTypeEnum, StagePrompt } from "@goauthentik/api"; -import "../../../../../elements/forms/HorizontalFormElement"; -import { PromptStage } from "../../../../../flows/stages/prompt/PromptStage"; - @customElement("ak-user-stage-prompt") export class UserSettingsPromptStage extends PromptStage { static get styles(): CSSResult[] { diff --git a/web/src/user/user-settings/mfa/MFADeviceForm.ts b/web/src/user/user-settings/mfa/MFADeviceForm.ts index 645cf09a0..099a8a71d 100644 --- a/web/src/user/user-settings/mfa/MFADeviceForm.ts +++ b/web/src/user/user-settings/mfa/MFADeviceForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { AuthenticatorsApi, Device } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-user-mfa-form") export class MFADeviceForm extends ModelForm { @property() diff --git a/web/src/user/user-settings/mfa/MFADevicesPage.ts b/web/src/user/user-settings/mfa/MFADevicesPage.ts index d074ac4fa..35a633e2c 100644 --- a/web/src/user/user-settings/mfa/MFADevicesPage.ts +++ b/web/src/user/user-settings/mfa/MFADevicesPage.ts @@ -1,3 +1,12 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { AndNext, DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/buttons/Dropdown"; +import "@goauthentik/web/elements/buttons/ModalButton"; +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 { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,14 +16,6 @@ import { until } from "lit/directives/until.js"; import { AuthenticatorsApi, Device, UserSetting } from "@goauthentik/api"; -import { AKResponse } from "../../../api/Client"; -import { AndNext, DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/buttons/Dropdown"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/TokenCopyButton"; -import "../../../elements/forms/DeleteBulkForm"; -import "../../../elements/forms/ModalForm"; -import { Table, TableColumn } from "../../../elements/table/Table"; import "./MFADeviceForm"; export function stageToAuthenticatorName(stage: UserSetting): string { diff --git a/web/src/user/user-settings/sources/SourceSettings.ts b/web/src/user/user-settings/sources/SourceSettings.ts index 83f76f5d5..1947d0fff 100644 --- a/web/src/user/user-settings/sources/SourceSettings.ts +++ b/web/src/user/user-settings/sources/SourceSettings.ts @@ -1,3 +1,9 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import "@goauthentik/web/elements/EmptyState"; +import "@goauthentik/web/user/user-settings/sources/SourceSettingsOAuth"; +import "@goauthentik/web/user/user-settings/sources/SourceSettingsPlex"; + import { t } from "@lingui/macro"; import { CSSResult, LitElement, TemplateResult, css, html } from "lit"; @@ -5,18 +11,12 @@ import { customElement, property } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { until } from "lit/directives/until.js"; -import AKGlobal from "../../../authentik.css"; +import AKGlobal from "@goauthentik/web/authentik.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFDataList from "@patternfly/patternfly/components/DataList/data-list.css"; import { SourcesApi, UserSetting } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { EVENT_REFRESH } from "../../../constants"; -import "../../../elements/EmptyState"; -import "./SourceSettingsOAuth"; -import "./SourceSettingsPlex"; - @customElement("ak-user-settings-source") export class UserSourceSettingsPage extends LitElement { @property({ attribute: false }) diff --git a/web/src/user/user-settings/sources/SourceSettingsOAuth.ts b/web/src/user/user-settings/sources/SourceSettingsOAuth.ts index 13801f64e..9624ec07a 100644 --- a/web/src/user/user-settings/sources/SourceSettingsOAuth.ts +++ b/web/src/user/user-settings/sources/SourceSettingsOAuth.ts @@ -1,3 +1,8 @@ +import { AndNext, DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { BaseUserSettings } from "@goauthentik/web/user/user-settings/BaseUserSettings"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -7,11 +12,6 @@ import { until } from "lit/directives/until.js"; import { SourcesApi } from "@goauthentik/api"; -import { AndNext, DEFAULT_CONFIG } from "../../../api/Config"; -import { MessageLevel } from "../../../elements/messages/Message"; -import { showMessage } from "../../../elements/messages/MessageContainer"; -import { BaseUserSettings } from "../BaseUserSettings"; - @customElement("ak-user-settings-source-oauth") export class SourceSettingsOAuth extends BaseUserSettings { @property() diff --git a/web/src/user/user-settings/sources/SourceSettingsPlex.ts b/web/src/user/user-settings/sources/SourceSettingsPlex.ts index f07d47081..268865f64 100644 --- a/web/src/user/user-settings/sources/SourceSettingsPlex.ts +++ b/web/src/user/user-settings/sources/SourceSettingsPlex.ts @@ -1,3 +1,10 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { PlexAPIClient, popupCenterScreen } from "@goauthentik/web/api/Plex"; +import { EVENT_REFRESH } from "@goauthentik/web/constants"; +import { MessageLevel } from "@goauthentik/web/elements/messages/Message"; +import { showMessage } from "@goauthentik/web/elements/messages/MessageContainer"; +import { BaseUserSettings } from "@goauthentik/web/user/user-settings/BaseUserSettings"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,13 +13,6 @@ import { until } from "lit/directives/until.js"; import { SourcesApi } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { PlexAPIClient, popupCenterScreen } from "../../../api/Plex"; -import { EVENT_REFRESH } from "../../../constants"; -import { MessageLevel } from "../../../elements/messages/Message"; -import { showMessage } from "../../../elements/messages/MessageContainer"; -import { BaseUserSettings } from "../BaseUserSettings"; - @customElement("ak-user-settings-source-plex") export class SourceSettingsPlex extends BaseUserSettings { @property() diff --git a/web/src/user/user-settings/tokens/UserTokenForm.ts b/web/src/user/user-settings/tokens/UserTokenForm.ts index f410c4bbc..cbbcefbfd 100644 --- a/web/src/user/user-settings/tokens/UserTokenForm.ts +++ b/web/src/user/user-settings/tokens/UserTokenForm.ts @@ -1,3 +1,7 @@ +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import "@goauthentik/web/elements/forms/HorizontalFormElement"; +import { ModelForm } from "@goauthentik/web/elements/forms/ModelForm"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; @@ -6,10 +10,6 @@ import { ifDefined } from "lit/directives/if-defined.js"; import { CoreApi, IntentEnum, Token } from "@goauthentik/api"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import "../../../elements/forms/HorizontalFormElement"; -import { ModelForm } from "../../../elements/forms/ModelForm"; - @customElement("ak-user-token-form") export class UserTokenForm extends ModelForm { @property() diff --git a/web/src/user/user-settings/tokens/UserTokenList.ts b/web/src/user/user-settings/tokens/UserTokenList.ts index 29ac58d13..e371a04d8 100644 --- a/web/src/user/user-settings/tokens/UserTokenList.ts +++ b/web/src/user/user-settings/tokens/UserTokenList.ts @@ -1,3 +1,16 @@ +import { AKResponse } from "@goauthentik/web/api/Client"; +import { DEFAULT_CONFIG } from "@goauthentik/web/api/Config"; +import { uiConfig } from "@goauthentik/web/common/config"; +import { PFColor } from "@goauthentik/web/elements/Label"; +import "@goauthentik/web/elements/buttons/Dropdown"; +import "@goauthentik/web/elements/buttons/ModalButton"; +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 { IntentToLabel } from "@goauthentik/web/pages/tokens/TokenListPage"; +import "@goauthentik/web/user/user-settings/tokens/UserTokenForm"; + import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; @@ -7,19 +20,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList import { CoreApi, IntentEnum, Token } from "@goauthentik/api"; -import { AKResponse } from "../../../api/Client"; -import { DEFAULT_CONFIG } from "../../../api/Config"; -import { uiConfig } from "../../../common/config"; -import { PFColor } from "../../../elements/Label"; -import "../../../elements/buttons/Dropdown"; -import "../../../elements/buttons/ModalButton"; -import "../../../elements/buttons/TokenCopyButton"; -import "../../../elements/forms/DeleteBulkForm"; -import "../../../elements/forms/ModalForm"; -import { Table, TableColumn } from "../../../elements/table/Table"; -import { IntentToLabel } from "../../../pages/tokens/TokenListPage"; -import "./UserTokenForm"; - @customElement("ak-user-token-list") export class UserTokenList extends Table { searchEnabled(): boolean { diff --git a/web/src/utils.ts b/web/src/utils.ts index 369c5a757..5f1914ed8 100644 --- a/web/src/utils.ts +++ b/web/src/utils.ts @@ -1,9 +1,10 @@ +import "@goauthentik/web/elements/EmptyState"; + import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { SentryIgnoredError } from "./common/errors"; -import "./elements/EmptyState"; export function getCookie(name: string): string { let cookieValue = ""; diff --git a/web/tsconfig.json b/web/tsconfig.json index 59f8ec37e..31281286f 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -1,6 +1,11 @@ { "compilerOptions": { "strict": true, + "paths": { + "@goauthentik/web/*": ["src/*"], + "@goauthentik/docs/*": ["../website/docs/*"] + }, + "baseUrl": ".", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true,