diff --git a/web/src/elements/forms/Form.ts b/web/src/elements/forms/Form.ts index c3f3f4b7a..3685084ae 100644 --- a/web/src/elements/forms/Form.ts +++ b/web/src/elements/forms/Form.ts @@ -1,4 +1,5 @@ import { FlowSearch } from "@goauthentik/admin/common/ak-flow-search/FlowSearch"; +import { PreventFormSubmit } from "@goauthentik/app/elements/forms/helpers"; import { EVENT_REFRESH } from "@goauthentik/common/constants"; import { MessageLevel } from "@goauthentik/common/messages"; import { camelToSnake, convertToSlug } from "@goauthentik/common/utils"; @@ -21,14 +22,6 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { ResponseError, ValidationError, ValidationErrorFromJSON } from "@goauthentik/api"; -export class PreventFormSubmit { - // Stub class which can be returned by form elements to prevent the form from submitting - constructor( - public message: string, - public element?: HorizontalFormElement, - ) {} -} - export class APIError extends Error { constructor(public response: ValidationError) { super(); diff --git a/web/src/elements/forms/SearchSelect.ts b/web/src/elements/forms/SearchSelect.ts index 0aba008ee..6305c8521 100644 --- a/web/src/elements/forms/SearchSelect.ts +++ b/web/src/elements/forms/SearchSelect.ts @@ -1,8 +1,8 @@ +import { PreventFormSubmit } from "@goauthentik/app/elements/forms/helpers"; import { EVENT_REFRESH } from "@goauthentik/common/constants"; import { ascii_letters, digits, groupBy, randomString } from "@goauthentik/common/utils"; import { adaptCSS } from "@goauthentik/common/utils"; import { AKElement } from "@goauthentik/elements/Base"; -import { PreventFormSubmit } from "@goauthentik/elements/forms/Form"; import { CustomEmitterElement } from "@goauthentik/elements/utils/eventEmitter"; import { msg } from "@lit/localize"; diff --git a/web/src/elements/forms/helpers.ts b/web/src/elements/forms/helpers.ts new file mode 100644 index 000000000..50a4c3002 --- /dev/null +++ b/web/src/elements/forms/helpers.ts @@ -0,0 +1,9 @@ +import { HorizontalFormElement } from "@goauthentik/app/elements/forms/HorizontalFormElement"; + +export class PreventFormSubmit { + // Stub class which can be returned by form elements to prevent the form from submitting + constructor( + public message: string, + public element?: HorizontalFormElement, + ) {} +}