From ba5cd6e719a8bb6ec470adda9314da5a62dd5813 Mon Sep 17 00:00:00 2001
From: Jens L
Date: Mon, 2 Jan 2023 14:51:44 +0100
Subject: [PATCH] web/admin: add Radio control, search-select fixes (#4333)
* move search select to forms folder
Signed-off-by: Jens Langhammer
* add radio, migrate smaller lists
Signed-off-by: Jens Langhammer
* move dropdown when scrolling, hide when container out of frame
Signed-off-by: Jens Langhammer
Signed-off-by: Jens Langhammer
---
.../ApplicationCheckAccessForm.ts | 2 +-
web/src/admin/applications/ApplicationForm.ts | 34 +-
.../TypeOAuthCodeApplicationWizardPage.ts | 2 +-
web/src/admin/blueprints/BlueprintForm.ts | 2 +-
web/src/admin/events/RuleForm.ts | 54 +-
web/src/admin/events/TransportForm.ts | 2 +-
web/src/admin/flows/FlowForm.ts | 479 +++++++++---------
web/src/admin/flows/StageBindingForm.ts | 83 +--
web/src/admin/groups/GroupForm.ts | 2 +-
web/src/admin/outposts/OutpostForm.ts | 2 +-
.../outposts/ServiceConnectionDockerForm.ts | 2 +-
web/src/admin/policies/PolicyBindingForm.ts | 2 +-
web/src/admin/policies/PolicyTestForm.ts | 2 +-
.../event_matcher/EventMatcherPolicyForm.ts | 2 +-
.../PropertyMappingTestForm.ts | 2 +-
.../admin/providers/ldap/LDAPProviderForm.ts | 66 +--
.../providers/oauth2/OAuth2ProviderForm.ts | 33 +-
.../providers/proxy/ProxyProviderForm.ts | 2 +-
.../admin/providers/saml/SAMLProviderForm.ts | 151 +++---
.../providers/saml/SAMLProviderImportForm.ts | 2 +-
web/src/admin/sources/ldap/LDAPSourceForm.ts | 2 +-
.../admin/sources/oauth/OAuthSourceForm.ts | 2 +-
web/src/admin/sources/plex/PlexSourceForm.ts | 2 +-
web/src/admin/sources/saml/SAMLSourceForm.ts | 160 +++---
.../AuthenticatorDuoStageForm.ts | 2 +-
.../authenticator_duo/DuoDeviceImportForm.ts | 2 +-
.../AuthenticatorSMSStageForm.ts | 32 +-
.../AuthenticatorStaticStageForm.ts | 2 +-
.../AuthenticatorTOTPStageForm.ts | 2 +-
.../AuthenticateWebAuthnStageForm.ts | 2 +-
.../identification/IdentificationStageForm.ts | 2 +-
.../admin/stages/invitation/InvitationForm.ts | 2 +-
.../stages/password/PasswordStageForm.ts | 2 +-
.../stages/user_write/UserWriteStageForm.ts | 2 +-
web/src/admin/tenants/TenantForm.ts | 2 +-
web/src/admin/tokens/TokenForm.ts | 34 +-
web/src/admin/users/UserResetEmailForm.ts | 2 +-
web/src/elements/forms/Form.ts | 2 +-
.../elements/forms/HorizontalFormElement.ts | 1 +
web/src/elements/forms/ModalForm.ts | 11 +-
web/src/elements/forms/Radio.ts | 81 +++
web/src/elements/{ => forms}/SearchSelect.ts | 24 +-
42 files changed, 697 insertions(+), 602 deletions(-)
create mode 100644 web/src/elements/forms/Radio.ts
rename web/src/elements/{ => forms}/SearchSelect.ts (92%)
diff --git a/web/src/admin/applications/ApplicationCheckAccessForm.ts b/web/src/admin/applications/ApplicationCheckAccessForm.ts
index 9bd5bac2f..b2c7e8ab9 100644
--- a/web/src/admin/applications/ApplicationCheckAccessForm.ts
+++ b/web/src/admin/applications/ApplicationCheckAccessForm.ts
@@ -1,8 +1,8 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { PFColor } from "@goauthentik/elements/Label";
-import "@goauthentik/elements/SearchSelect";
import { Form } from "@goauthentik/elements/forms/Form";
import "@goauthentik/elements/forms/HorizontalFormElement";
+import "@goauthentik/elements/forms/SearchSelect";
import { t } from "@lingui/macro";
diff --git a/web/src/admin/applications/ApplicationForm.ts b/web/src/admin/applications/ApplicationForm.ts
index b3064e27b..44b735ee2 100644
--- a/web/src/admin/applications/ApplicationForm.ts
+++ b/web/src/admin/applications/ApplicationForm.ts
@@ -1,12 +1,13 @@
import "@goauthentik/admin/providers/ProviderWizard";
import { DEFAULT_CONFIG, config } from "@goauthentik/common/api/config";
import { first, groupBy } from "@goauthentik/common/utils";
-import "@goauthentik/elements/SearchSelect";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
import "@goauthentik/elements/forms/ModalForm";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
import "@goauthentik/elements/forms/ProxyForm";
+import "@goauthentik/elements/forms/Radio";
+import "@goauthentik/elements/forms/SearchSelect";
import { t } from "@lingui/macro";
@@ -153,20 +154,23 @@ export class ApplicationForm extends ModelForm {
?required=${true}
name="policyEngineMode"
>
-
+
+
${t`UI settings`}
diff --git a/web/src/admin/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts b/web/src/admin/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts
index 0d40be61e..54adfd5f1 100644
--- a/web/src/admin/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts
+++ b/web/src/admin/applications/wizard/oauth/TypeOAuthCodeApplicationWizardPage.ts
@@ -1,7 +1,7 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
-import "@goauthentik/elements/SearchSelect";
import { KeyUnknown } from "@goauthentik/elements/forms/Form";
import "@goauthentik/elements/forms/HorizontalFormElement";
+import "@goauthentik/elements/forms/SearchSelect";
import { WizardFormPage } from "@goauthentik/elements/wizard/WizardFormPage";
import "@goauthentik/elements/wizard/WizardFormPage";
diff --git a/web/src/admin/blueprints/BlueprintForm.ts b/web/src/admin/blueprints/BlueprintForm.ts
index 867458631..8aa8ae793 100644
--- a/web/src/admin/blueprints/BlueprintForm.ts
+++ b/web/src/admin/blueprints/BlueprintForm.ts
@@ -2,10 +2,10 @@ import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { docLink } from "@goauthentik/common/global";
import { first } from "@goauthentik/common/utils";
import "@goauthentik/elements/CodeMirror";
-import "@goauthentik/elements/SearchSelect";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
+import "@goauthentik/elements/forms/SearchSelect";
import YAML from "yaml";
import { t } from "@lingui/macro";
diff --git a/web/src/admin/events/RuleForm.ts b/web/src/admin/events/RuleForm.ts
index c7e2e6e2e..763358ee2 100644
--- a/web/src/admin/events/RuleForm.ts
+++ b/web/src/admin/events/RuleForm.ts
@@ -1,7 +1,8 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
-import "@goauthentik/elements/SearchSelect";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
+import "@goauthentik/elements/forms/Radio";
+import "@goauthentik/elements/forms/SearchSelect";
import { t } from "@lingui/macro";
@@ -48,29 +49,6 @@ export class RuleForm extends ModelForm {
}
};
- renderSeverity(): TemplateResult {
- return html`
-
-
-
- `;
- }
-
renderForm(): TemplateResult {
return html`
-
+
+
`;
}
diff --git a/web/src/admin/events/TransportForm.ts b/web/src/admin/events/TransportForm.ts
index bfc0fcb76..60a925974 100644
--- a/web/src/admin/events/TransportForm.ts
+++ b/web/src/admin/events/TransportForm.ts
@@ -1,8 +1,8 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { first } from "@goauthentik/common/utils";
-import "@goauthentik/elements/SearchSelect";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
+import "@goauthentik/elements/forms/SearchSelect";
import { t } from "@lingui/macro";
diff --git a/web/src/admin/flows/FlowForm.ts b/web/src/admin/flows/FlowForm.ts
index 3db763b8f..59ac8619f 100644
--- a/web/src/admin/flows/FlowForm.ts
+++ b/web/src/admin/flows/FlowForm.ts
@@ -2,8 +2,10 @@ import { DesignationToLabel, LayoutToLabel } from "@goauthentik/admin/flows/util
import { AuthenticationEnum } from "@goauthentik/api/dist/models/AuthenticationEnum";
import { DEFAULT_CONFIG, config } from "@goauthentik/common/api/config";
import { first } from "@goauthentik/common/utils";
+import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
+import "@goauthentik/elements/forms/Radio";
import { t } from "@lingui/macro";
@@ -74,140 +76,6 @@ export class FlowForm extends ModelForm {
return flow;
};
- renderDesignations(): TemplateResult {
- return html`
-
-
-
-
-
-
-
- `;
- }
-
- renderDeniedAction(): TemplateResult {
- return html`
-
- `;
- }
-
- renderAuthentication(): TemplateResult {
- return html`
-
-
-
-
- `;
- }
-
- renderLayout(): TemplateResult {
- return html`
-
-
-
-
-
- `;
- }
-
renderForm(): TemplateResult {
return html`