import { gettext } from "django"; import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import AKGlobal from "../../authentik.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import { CoreApi, User } from "authentik-api"; import { me } from "../../api/Users"; import "../../elements/forms/FormElement"; import "../../elements/EmptyState"; import { FlowURLManager } from "../../api/legacy"; import "@polymer/paper-input/paper-input"; import "@polymer/iron-form/iron-form"; import { DEFAULT_CONFIG } from "../../api/Config"; import "../../elements/forms/Form"; @customElement("ak-user-details") export class UserDetailsPage extends LitElement { static get styles(): CSSResult[] { return [PFBase, PFCard, PFForm, PFFormControl, PFButton, AKGlobal]; } @property({attribute: false}) user?: User; firstUpdated(): void { me().then((user) => { this.user = user.user; }); } render(): TemplateResult { if (!this.user) { return html` `; } return html`
${gettext("Update details")}
{ return new CoreApi(DEFAULT_CONFIG).coreUsersUpdate({ id: this.user?.pk || 0, data: data as User }); }}>

${gettext("Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.")}

${gettext("User's display name.")}

${gettext("Delete account")}
`; } }