web/user: update form to update mfa devices
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		@ -2,6 +2,7 @@ import { t } from "@lingui/macro";
 | 
			
		||||
 | 
			
		||||
import { TemplateResult, html } from "lit";
 | 
			
		||||
import { customElement, property } from "lit/decorators";
 | 
			
		||||
import { ifDefined } from "lit/directives/if-defined";
 | 
			
		||||
import { until } from "lit/directives/until";
 | 
			
		||||
 | 
			
		||||
import { AuthenticatorsApi, Device, UserSetting } from "@goauthentik/api";
 | 
			
		||||
@ -14,6 +15,7 @@ import "../../../elements/buttons/TokenCopyButton";
 | 
			
		||||
import "../../../elements/forms/DeleteBulkForm";
 | 
			
		||||
import "../../../elements/forms/ModalForm";
 | 
			
		||||
import { Table, TableColumn } from "../../../elements/table/Table";
 | 
			
		||||
import "./MFADeviceForm";
 | 
			
		||||
 | 
			
		||||
export function stageToAuthenticatorName(stage: UserSetting): string {
 | 
			
		||||
    switch (stage.component) {
 | 
			
		||||
@ -76,7 +78,7 @@ export class MFADevicesPage extends Table<Device> {
 | 
			
		||||
                                .map((stage) => {
 | 
			
		||||
                                    return html`<li>
 | 
			
		||||
                                        <a
 | 
			
		||||
                                            href="${stage.configureUrl}"
 | 
			
		||||
                                            href="${ifDefined(stage.configureUrl)}"
 | 
			
		||||
                                            class="pf-c-dropdown__menu-item"
 | 
			
		||||
                                        >
 | 
			
		||||
                                            ${stageToAuthenticatorName(stage)}
 | 
			
		||||
@ -144,7 +146,7 @@ export class MFADevicesPage extends Table<Device> {
 | 
			
		||||
                <ak-forms-modal>
 | 
			
		||||
                    <span slot="submit">${t`Update`}</span>
 | 
			
		||||
                    <span slot="header">${t`Update Device`}</span>
 | 
			
		||||
                    <ak-user-token-form slot="form" .instancePk=${item.pk}> </ak-user-token-form>
 | 
			
		||||
                    <ak-user-mfa-form slot="form" .instancePk=${item.pk}> </ak-user-mfa-form>
 | 
			
		||||
                    <button slot="trigger" class="pf-c-button pf-m-plain">
 | 
			
		||||
                        <i class="fas fa-edit"></i>
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user