import "@goauthentik/admin/common/ak-flow-search/ak-flow-search-no-default"; import "@goauthentik/components/ak-file-input"; import { AkFileInput } from "@goauthentik/components/ak-file-input"; import "@goauthentik/components/ak-text-input"; import "@goauthentik/elements/forms/HorizontalFormElement"; import { msg } from "@lit/localize"; import { customElement } from "@lit/reactive-element/decorators/custom-element.js"; import { html } from "lit"; import { query } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { FlowsInstancesListDesignationEnum, ProvidersSamlImportMetadataCreateRequest, } from "@goauthentik/api"; import BaseProviderPanel from "../BaseProviderPanel"; @customElement("ak-application-wizard-authentication-by-saml-import") export class ApplicationWizardProviderSamlImport extends BaseProviderPanel { @query('ak-file-input[name="metadata"]') fileInput!: AkFileInput; handleChange(ev: InputEvent) { if (!ev.target) { console.warn(`Received event with no target: ${ev}`); return; } const target = ev.target as HTMLInputElement; if (target.type === "file") { const file = this.fileInput.files?.[0] ?? null; if (file) { this.dispatchWizardUpdate({ update: { provider: { file, }, }, status: this.form.checkValidity() ? "valid" : "invalid", }); } return; } super.handleChange(ev); } render() { const provider = this.wizard.provider as | ProvidersSamlImportMetadataCreateRequest | undefined; return html`
`; } } export default ApplicationWizardProviderSamlImport;