import { gettext } from "django"; import { customElement, html, property, TemplateResult } from "lit-element"; import { Flow } from "../../api/Flows"; import { AKResponse } from "../../api/Client"; import { TablePage } from "../../elements/table/TablePage"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import { TableColumn } from "../../elements/table/Table"; @customElement("ak-flow-list") export class FlowListPage extends TablePage { searchEnabled(): boolean { return true; } pageTitle(): string { return gettext("Flows"); } pageDescription(): string { return gettext("Flows describe a chain of Stages to authenticate, enroll or recover a user. Stages are chosen based on policies applied to them."); } pageIcon(): string { return gettext("pf-icon pf-icon-process-automation"); } @property() order = "slug"; apiEndpoint(page: number): Promise> { return Flow.list({ ordering: this.order, page: page, search: this.search || "", }); } columns(): TableColumn[] { return [ new TableColumn("Identifier", "slug"), new TableColumn("Name", "name"), new TableColumn("Designation", "designation"), new TableColumn("Stages"), new TableColumn("Policies"), new TableColumn(""), ]; } row(item: Flow): TemplateResult[] { return [ html` ${item.slug} `, html`${item.name}`, html`${item.designation}`, html`${item.stages.length}`, html`${item.policies.length}`, html` ${gettext("Edit")}
${gettext("Delete")}
${gettext("Execute")} ${gettext("Export")} `, ]; } renderToolbar(): TemplateResult { return html` ${gettext("Create")}
${gettext("Import")}
${super.renderToolbar()} `; } }