some real ugly code

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2024-08-12 23:18:03 +02:00
parent 917c90374f
commit 2f7c258657
2 changed files with 4 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import { customElement, property } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { PoliciesApi, Policy } from "@goauthentik/api";
import { PFSize } from "@goauthentik/common/enums";
@customElement("ak-policy-list")
export class PolicyListPage extends TablePage<Policy> {
@ -71,7 +72,7 @@ export class PolicyListPage extends TablePage<Policy> {
${msg("Warning: Policy is not assigned.")}
</ak-label>`}`,
html`${item.verboseName}`,
html` <ak-forms-modal>
html` <ak-forms-modal size=${item.component === "ak-policy-expression-form" ? PFSize.XLarge : PFSize.Large}>
<span slot="submit"> ${msg("Update")} </span>
<span slot="header"> ${msg(str`Update ${item.verboseName}`)} </span>
<ak-proxy-form
@ -79,7 +80,7 @@ export class PolicyListPage extends TablePage<Policy> {
.args=${{
instancePk: item.pk,
}}
type=${ifDefined(item.component)}
type=${item.component}
>
</ak-proxy-form>
<button slot="trigger" class="pf-c-button pf-m-plain">

View File

@ -87,7 +87,7 @@ export class PolicyWizard extends AKElement {
slot=${`type-${type.component}-${type.modelName}`}
.sidebarLabel=${() => msg(str`Create ${type.name}`)}
>
<ak-proxy-form type=${type.component}></ak-proxy-form>
<ak-proxy-form ?showPreview=${false} type=${type.component}></ak-proxy-form>
</ak-wizard-page-form>
`;
})}