import { gettext } from "django"; import { customElement, html, property, TemplateResult } from "lit-element"; import { PropertyMapping } from "../../api/PropertyMapping"; import { PBResponse } from "../../api/Client"; import { TablePage } from "../../elements/table/TablePage"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/Dropdown"; import "../../elements/buttons/SpinnerButton"; import { TableColumn } from "../../elements/table/Table"; @customElement("ak-property-mapping-list") export class PropertyMappingListPage extends TablePage { searchEnabled(): boolean { return true; } pageTitle(): string { return gettext("Property Mappings"); } pageDescription(): string { return gettext("Control how authentik exposes and interprets information."); } pageIcon(): string { return gettext("pf-icon pf-icon-blueprint"); } @property() order = "name"; @property({type: Boolean}) hideManaged = false; apiEndpoint(page: number): Promise> { return PropertyMapping.list({ ordering: this.order, page: page, search: this.search || "", managed__isnull: this.hideManaged, }); } columns(): TableColumn[] { return [ new TableColumn("Name", "name"), new TableColumn("Type", "type"), new TableColumn(""), ]; } row(item: PropertyMapping): TemplateResult[] { return [ html`${item.name}`, html`${item.verbose_name}`, html` ${gettext("Edit")}
  ${gettext("Test")}
  ${gettext("Delete")}
`, ]; } renderToolbar(): TemplateResult { return html` ${super.renderToolbar()}`; } renderToolbarAfter(): TemplateResult { return html`
{ this.hideManaged = !this.hideManaged; this.fetch(); }} />
`; } }