web/admin: fix ak-toggle-group for policy and blueprint uses (#6687)

* web/admin: fix ak-toggle-group for policy and blueprint uses

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix and re-enable lit-analyse

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-08-30 12:46:58 +02:00 committed by GitHub
parent b6a57ffd4f
commit bfd0fb66b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View file

@ -148,8 +148,7 @@ web-lint-fix:
web-lint: web-lint:
cd web && npm run lint cd web && npm run lint
# TODO: The analyzer hasn't run correctly in awhile. cd web && npm run lit-analyse
# cd web && npm run lit-analyse
web-check-compile: web-check-compile:
cd web && npm run tsc cd web && npm run tsc

View file

@ -1,6 +1,7 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { docLink } from "@goauthentik/common/global"; import { docLink } from "@goauthentik/common/global";
import { first } from "@goauthentik/common/utils"; import { first } from "@goauthentik/common/utils";
import "@goauthentik/components/ak-toggle-group";
import "@goauthentik/elements/CodeMirror"; import "@goauthentik/elements/CodeMirror";
import "@goauthentik/elements/forms/FormGroup"; import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement"; import "@goauthentik/elements/forms/HorizontalFormElement";
@ -18,9 +19,9 @@ import PFContent from "@patternfly/patternfly/components/Content/content.css";
import { BlueprintFile, BlueprintInstance, ManagedApi } from "@goauthentik/api"; import { BlueprintFile, BlueprintInstance, ManagedApi } from "@goauthentik/api";
enum blueprintSource { enum blueprintSource {
file, file = "file",
oci, oci = "oci",
internal, internal = "internal",
} }
@customElement("ak-blueprint-form") @customElement("ak-blueprint-form")

View file

@ -1,5 +1,6 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { first, groupBy } from "@goauthentik/common/utils"; import { first, groupBy } from "@goauthentik/common/utils";
import "@goauthentik/components/ak-toggle-group";
import "@goauthentik/elements/forms/HorizontalFormElement"; import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModelForm } from "@goauthentik/elements/forms/ModelForm"; import { ModelForm } from "@goauthentik/elements/forms/ModelForm";
import "@goauthentik/elements/forms/SearchSelect"; import "@goauthentik/elements/forms/SearchSelect";
@ -24,9 +25,9 @@ import {
} from "@goauthentik/api"; } from "@goauthentik/api";
enum target { enum target {
policy, policy = "policy",
group, group = "group",
user, user = "user",
} }
@customElement("ak-policy-binding-form") @customElement("ak-policy-binding-form")
@ -51,7 +52,7 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
@property() @property()
targetPk?: string; targetPk?: string;
@property({ type: Number }) @state()
policyGroupUser: target = target.policy; policyGroupUser: target = target.policy;
@property({ type: Boolean }) @property({ type: Boolean })

View file

@ -6,6 +6,7 @@ import { customElement, property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js"; import { classMap } from "lit/directives/class-map.js";
import PFToggleGroup from "@patternfly/patternfly/components/ToggleGroup/toggle-group.css"; import PFToggleGroup from "@patternfly/patternfly/components/ToggleGroup/toggle-group.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
type Pair = [string, string]; type Pair = [string, string];
@ -26,6 +27,7 @@ type Pair = [string, string];
export class AkToggleGroup extends CustomEmitterElement(AKElement) { export class AkToggleGroup extends CustomEmitterElement(AKElement) {
static get styles() { static get styles() {
return [ return [
PFBase,
PFToggleGroup, PFToggleGroup,
css` css`
.pf-c-toggle-group { .pf-c-toggle-group {