import { Flow, FlowsApi } from "authentik-api"; import { gettext } from "django"; import { customElement } from "lit-element"; import { html, TemplateResult } from "lit-html"; import { DEFAULT_CONFIG } from "../../api/Config"; import { Form } from "../../elements/forms/Form"; import "../../elements/forms/HorizontalFormElement"; @customElement("ak-flow-import-form") export class FlowImportForm extends Form { getSuccessMessage(): string { return gettext("Successfully imported flow."); } // eslint-disable-next-line send = (data: Flow): Promise => { const file = this.getFormFile(); if (!file) { throw new Error("No form data"); } return new FlowsApi(DEFAULT_CONFIG).flowsInstancesImportFlow({ file: file }); }; renderForm(): TemplateResult { return html`

${gettext("Background shown during execution.")}

`; } }