web: Clean up browser-only module imports that crash WebDriverIO. (#14330)
* web: Clean up browser-only module imports that crash WebDriverIO. * web: Clarify slug format output.
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
import { first } from "@goauthentik/common/utils";
|
||||
|
||||
import { TemplateResult, html, nothing } from "lit";
|
||||
import { classMap } from "lit/directives/class-map.js";
|
||||
import { map } from "lit/directives/map.js";
|
||||
@ -80,10 +78,10 @@ export function renderDescriptionList(
|
||||
) {
|
||||
const checkedTerms = alignTermType(terms);
|
||||
const classes = classMap({
|
||||
"pf-m-horizontal": first(config.horizontal, false),
|
||||
"pf-m-compact": first(config.compact, false),
|
||||
"pf-m-2-col-on-lg": first(config.twocolumn, false),
|
||||
"pf-m-3-col-on-lg": first(config.threecolumn, false),
|
||||
"pf-m-horizontal": config.horizontal ?? false,
|
||||
"pf-m-compact": config.compact ?? false,
|
||||
"pf-m-2-col-on-lg": config.twocolumn ?? false,
|
||||
"pf-m-3-col-on-lg": config.threecolumn ?? false,
|
||||
});
|
||||
|
||||
return html`
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { convertToSlug } from "@goauthentik/common/utils";
|
||||
import { formatSlug } from "@goauthentik/elements/router/utils.js";
|
||||
|
||||
import { html } from "lit";
|
||||
import { customElement, property, query } from "lit/decorators.js";
|
||||
@ -34,7 +34,7 @@ export class AkSlugInput extends HorizontalLightComponent<string> {
|
||||
// Do not stop propagation of this event; it must be sent up the tree so that a parent
|
||||
// component, such as a custom forms manager, may receive it.
|
||||
handleTouch(ev: Event) {
|
||||
this.input.value = convertToSlug(this.input.value);
|
||||
this.input.value = formatSlug(this.input.value);
|
||||
this.value = this.input.value;
|
||||
|
||||
if (this.origin && this.origin.value === "" && this.input.value === "") {
|
||||
@ -67,7 +67,7 @@ export class AkSlugInput extends HorizontalLightComponent<string> {
|
||||
// "any event which adds or removes a character but leaves the rest of the slug looking like
|
||||
// the previous iteration, set it to the current iteration."
|
||||
|
||||
const newSlug = convertToSlug(ev.target.value);
|
||||
const newSlug = formatSlug(ev.target.value);
|
||||
const oldSlug = this.input.value;
|
||||
const [shorter, longer] =
|
||||
newSlug.length < oldSlug.length ? [newSlug, oldSlug] : [oldSlug, newSlug];
|
||||
|
||||
Reference in New Issue
Block a user