From bbc47e0fce415ce0096f8ecf3beb74f93844adcd Mon Sep 17 00:00:00 2001 From: Ken Sternberg Date: Mon, 31 Jul 2023 11:04:26 -0700 Subject: [PATCH] web: Marking down the start of the 'components' library. --- web/src/admin/applications/ApplicationForm.ts | 14 +++++++------- .../ak-backchannel-input.ts | 0 .../ak-provider-search-input.ts | 0 .../renderers => components}/ak-file-input.ts | 0 .../renderers => components}/ak-radio-input.ts | 0 .../renderers => components}/ak-switch-input.ts | 0 .../renderers => components}/ak-text-input.ts | 0 .../renderers => components}/ak-textarea-input.ts | 0 web/src/elements/wizard/WizardFormPage.ts | 5 +++-- web/tsconfig.json | 1 + 10 files changed, 11 insertions(+), 9 deletions(-) rename web/src/admin/applications/{renderers => components}/ak-backchannel-input.ts (100%) rename web/src/admin/applications/{renderers => components}/ak-provider-search-input.ts (100%) rename web/src/{admin/applications/renderers => components}/ak-file-input.ts (100%) rename web/src/{admin/applications/renderers => components}/ak-radio-input.ts (100%) rename web/src/{admin/applications/renderers => components}/ak-switch-input.ts (100%) rename web/src/{admin/applications/renderers => components}/ak-text-input.ts (100%) rename web/src/{admin/applications/renderers => components}/ak-textarea-input.ts (100%) diff --git a/web/src/admin/applications/ApplicationForm.ts b/web/src/admin/applications/ApplicationForm.ts index 2bbb03f30..f987f7080 100644 --- a/web/src/admin/applications/ApplicationForm.ts +++ b/web/src/admin/applications/ApplicationForm.ts @@ -2,6 +2,11 @@ import "@goauthentik/admin/applications/ProviderSelectModal"; import { iconHelperText } from "@goauthentik/admin/helperText"; import { DEFAULT_CONFIG, config } from "@goauthentik/common/api/config"; import { first } from "@goauthentik/common/utils"; +import "@goauthentik/components/ak-file-input"; +import "@goauthentik/components/ak-radio-input"; +import "@goauthentik/components/ak-switch-input"; +import "@goauthentik/components/ak-text-input"; +import "@goauthentik/components/ak-textarea-input"; import { rootInterface } from "@goauthentik/elements/Base"; import "@goauthentik/elements/forms/FormGroup"; import "@goauthentik/elements/forms/HorizontalFormElement"; @@ -24,13 +29,8 @@ import { Provider, } from "@goauthentik/api"; -import "./renderers/ak-backchannel-input"; -import "./renderers/ak-file-input"; -import "./renderers/ak-provider-search-input"; -import "./renderers/ak-radio-input"; -import "./renderers/ak-switch-input"; -import "./renderers/ak-text-input"; -import "./renderers/ak-textarea-input"; +import "./components/ak-backchannel-input"; +import "./components/ak-provider-search-input"; const policyOptions = [ { diff --git a/web/src/admin/applications/renderers/ak-backchannel-input.ts b/web/src/admin/applications/components/ak-backchannel-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-backchannel-input.ts rename to web/src/admin/applications/components/ak-backchannel-input.ts diff --git a/web/src/admin/applications/renderers/ak-provider-search-input.ts b/web/src/admin/applications/components/ak-provider-search-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-provider-search-input.ts rename to web/src/admin/applications/components/ak-provider-search-input.ts diff --git a/web/src/admin/applications/renderers/ak-file-input.ts b/web/src/components/ak-file-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-file-input.ts rename to web/src/components/ak-file-input.ts diff --git a/web/src/admin/applications/renderers/ak-radio-input.ts b/web/src/components/ak-radio-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-radio-input.ts rename to web/src/components/ak-radio-input.ts diff --git a/web/src/admin/applications/renderers/ak-switch-input.ts b/web/src/components/ak-switch-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-switch-input.ts rename to web/src/components/ak-switch-input.ts diff --git a/web/src/admin/applications/renderers/ak-text-input.ts b/web/src/components/ak-text-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-text-input.ts rename to web/src/components/ak-text-input.ts diff --git a/web/src/admin/applications/renderers/ak-textarea-input.ts b/web/src/components/ak-textarea-input.ts similarity index 100% rename from web/src/admin/applications/renderers/ak-textarea-input.ts rename to web/src/components/ak-textarea-input.ts diff --git a/web/src/elements/wizard/WizardFormPage.ts b/web/src/elements/wizard/WizardFormPage.ts index 514b45fee..60b386545 100644 --- a/web/src/elements/wizard/WizardFormPage.ts +++ b/web/src/elements/wizard/WizardFormPage.ts @@ -12,8 +12,6 @@ import PFFormControl from "@patternfly/patternfly/components/FormControl/form-co import PFInputGroup from "@patternfly/patternfly/components/InputGroup/input-group.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -/* NOT USED */ - @customElement("ak-wizard-form") export abstract class WizardForm extends Form { viewportCheck = false; @@ -21,6 +19,9 @@ export abstract class WizardForm extends Form { @property({ attribute: false }) nextDataCallback!: (data: KeyUnknown) => Promise; + /* Override the traditional behavior of the form and instead simply serialize the form and push + * it's contents to the next page. + */ async submit(): Promise { const data = this.serializeForm(); if (!data) { diff --git a/web/tsconfig.json b/web/tsconfig.json index cd85334f8..7e9327c55 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -5,6 +5,7 @@ "@goauthentik/app/*": ["src/*"], "@goauthentik/admin/*": ["src/admin/*"], "@goauthentik/common/*": ["src/common/*"], + "@goauthentik/components/*": ["src/components/*"], "@goauthentik/docs/*": ["../website/docs/*"], "@goauthentik/elements/*": ["src/elements/*"], "@goauthentik/flow/*": ["src/flow/*"],