import { t } from "@lingui/macro"; import { html, TemplateResult } from "lit"; import { customElement } from "lit/decorators"; import { Flow, FlowsApi } from "@goauthentik/api"; 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 t`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).flowsInstancesImportFlowCreate({ file: file, }); }; renderForm(): TemplateResult { return html` ${t`Background shown during execution.`} `; } }
${t`Background shown during execution.`}