12 Commits

Author SHA1 Message Date
Teffen Ellis
388f4262b5 web: Captcha Refinements, Part 2 (#19757)
* Move inline styles into separate file.

* Fix preferred order of captcha vendor discovery.

* Clean up mutation and resize observer lifecycle.

* Flesh out controllers.

* Tidy refresh.

* Fix incompatibilities with Storybook.

* Flesh out captcha stories.

* Bump package.

* Flesh out stories.

* Move inline styles into separate file.

* Fix preferred order of captcha vendor discovery.

* Clean up mutation and resize observer lifecycle.

* Flesh out controllers.

* Tidy refresh.

* Remove unused.

* Bump package.
2026-01-30 16:18:24 +01:00
Ken Sternberg
08b07979ad web/elements: remove pfbase everywhere (#19623)
* web: Add InvalidationFlow to Radius Provider dialogues

## What

- Bugfix: adds the InvalidationFlow to the Radius Provider dialogues
  - Repairs: `{"invalidation_flow":["This field is required."]}` message, which was *not* propagated
    to the Notification.
- Nitpick: Pretties `?foo=${true}` expressions: `s/\?([^=]+)=\$\{true\}/\1/`

## Note

Yes, I know I'm going to have to do more magic when we harmonize the forms, and no, I didn't add the
Property Mappings to the wizard, and yes, I know I'm going to have pain with the *new* version of
the wizard. But this is a serious bug; you can't make Radius servers with *either* of the current
dialogues at the moment.

* This (temporary) change is needed to prevent the unit tests from failing.

\# What

\# Why

\# How

\# Designs

\# Test Steps

\# Other Notes

* Revert "This (temporary) change is needed to prevent the unit tests from failing."

This reverts commit dddde09be5.

* website: fix bad escaping of URLs in release notes

## What

Fixes bad escaping of URLs in the release notes that resulted in mangled output.

v2024.6.4 had entries that looked like this:

```
##### `GET` /providers/google_workspace/{#123;id}#125;/
```

v2025.4.md had entries that looked like this:

```
##### `GET` /policies/unique_password/{#125;#123;policy_uuid}/
```

A couple of straightforward search-and-replaces has fixed the issue.

## Notes

Two of the release notes had bad escaping of URLs. I'm not sure how the error was made or got past,
but it was obvious when visiting the page.

@Beryju suggested that the bug is due to our using `{...}` to symbolize parameters in a URL while
Docusaurus wants to interpret `{...}` as an internal template instruction, resulting in odd
behavior. In either case, docusarus interpreted the hashtagged entries as links to unrelated issues
in Github (the same two issues, which were "bump version of pylint" and "bump version of sentry"),
which could be very confusing.

The inconsistencies between the two releases, and the working releases, suggests that the error was
introduced manually.

* web: Remove PFBase.

* Remove stub.

* Just keeping this around.

* web/maintenance: deprecate PFBase in favor of an adopted stylesheet

# What !?!?!?

Removes `PFBase` from all components.

# Why !?!?!?

In `AkElement`, there was this code:

        protected static override finalizeStyles(styles?: CSSResultGroup): CSSResultOrNative[] {
            if (!styles) return [$PFBase, $AKBase];

            if (!Array.isArray(styles)) return [$PFBase, createCSSResult(styles), $PFBase, $AKBase];

            return [
                $PFBase,
                // ---
                ...(styles.flat() as CSSResultOrNative[]).map(createCSSResult),
                $AKBase,
            ];
        }

I’ve refined this:

        protected static override finalizeStyles(styles: CSSResultGroup = []): CSSResultOrNative[] {
            const elementStyles = [
                $PFBase,
                // Route around TSC`s known-to-fail typechecking of `.flat(Infinity)`. Removes types.
                ...([styles] as Array<unknown>).flat(Infinity),
                $AKBase,
                // Restore types. Safe: we control AKBase and PFBase in this file, and `styles` are
                // typed on function signature.
            ] as CSSResultOrNative[];

            // Remove duplicates in reverse order to preserve last-insert-wins semantics of CSS.
            const elementSet = new Set(elementStyles.reverse());
            // Reverse again because the return type is an array, and process as a CSSResult
            return Array.from(elementSet).reverse().map(createCSSResult);
        }

… with the duplication removal documented in Lit 3.0. `styles` defaults to an array, is cast to an array, then automatically flattented before the deduplication is run.

With this, both PFBase and AKBase are automatically included with each and every component that inherits from `AKElement`. At that point, the inclusion of `PFBase` interface-wide made no sense.

So they had to be removed:

    $ for i in $(rg -t typescript -l PFBase | rg -v 'elements/Base\.ts') ; do \
        perl -pi.bak -e 's{import PFBase from ".patternfly/patternfly/patternfly-base.css";}{}' "$i" ; \
        done
    $ for i in $(rg -t typescript -l PFBase | rg -v 'elements/Base\.ts') ; do \
        perl -pi.bak -e 's/PFBase,//' "$i" ; \
        done

This commit removes 131 `import` statements from the source code. As a result, the bundle is about 27K smaller… which admittedly is about 0.2% smaller than before. Ah, well. “Every little bit helps,” right?

* Update comment to point to semantic rules for `finalizeStyles` in Lit reactive-element

* Yeah, didn't need the analysis files lying around.

* Merge confirmed

---------

Co-authored-by: Teffen Ellis <teffen@goauthentik.io>
2026-01-21 12:54:09 -08:00
Teffen Ellis
90d9b2daf9 web: Fix ESBuild hanging process (#18162) 2025-11-15 02:13:28 +01:00
Teffen Ellis
e426f88401 web: Fix application of global styles in style roots. (#17444)
* web: Separate global styles from element roots.

* web: Flesh out style strategy plugin, fixes for imported styles.

* web: Clean up applying of dark theme.

web: unminify.

* web: Fix alignment, rendering on high contrast.

web: Apply footer resize.

web: Fix application of global styles in style roots.

web: Fix missing layout attribute.

web: Normalize background alignment.

web: Fix layout issues, color overrides.

web: Fix alignment, colors, jank.

web: Separate method into function.

web: Clean up alignment, reflow.

web: Fix colors, compatibility mode.

web: Add content left/right support.

web: Fix colors, compatibility mode overrides.

* Fix issue where missing config throws runtime error.

* web: Refactor.

* Update tests.

* web: Fix Storybook imports.

* Fix order of theme application.

* web: Fix storybook asset paths.

* web: Flesh out tests surrounding source buttons, fix alignment,
contrast.

* Update tests, clarify errors.

* Update test selectors, assertions.

* Clarify redirect handling.

* Adjust user check.

* Update logs.

* web: Fix selector timing.

* Fix alignment.

* Fix selectors, timing.

* Log current URL content.

* Refine shadow selector, add delay.

* Replace IDs with named elements.

* Fix overlay color.

* Fix footer padding.

* Fix contrast.

* Add selectable name to button.

* Fix alignment, mobile layout.

* web: Spread exported parts to stages.

* Fix z-index order.

* Tidy colors, behaviors, layout.

* Fix overflow scroll.

* Clean up duplicate color styles.

* Clarify selector order. Fix overrides, color contrast.

* Attempt to read JSON multiple times.

* Clarify error.

* web: Fix timeouts, URL changes.

* web: Fix disabled styles.

* Fix color flip.

* Fix selector.

* Fix issue where hidden tables will alter test URLs.

* Use DOM to look for connection, rather than API. Update selectors.

* Immediately navigate to tab.

* Upgrade Dex.

* Ensure Dex redirects.

* Use same host during tests.

* web: Update package-lock.json

* Add delay.
2025-11-11 15:49:00 -05:00
Teffen Ellis
17da90df6c web: Fix docs links, a11y input descriptors (#16671)
* web: Clarify required marker when using screen reader.

* web: Mark helper text as input descriptor.

* web: Use next domain when in development.

* web: Clean up constants. Fix attribute mapping.

* web: use previous function name.

* web: Fix sort.

* web: Use constant.

* web: Use prefix.

* web: keep using current release for notes.
2025-09-18 00:34:15 +00:00
Jens L.
c0e62d14cb revert: web: Font fixes (#15581) (#15789)
Revert "web: Font fixes (#15581)"

This reverts commit f00772faf1.
2025-07-25 13:54:15 +02:00
Teffen Ellis
4a933b814f web: Update dependencies. Fix categories. (#15748)
* web: Update deps. Avoid devDependencies.

* web: Replace deprecated package with our own.

* web: Clean up dev deps.

* web: Clean up root packages.

* web: Dedupe plugin.
2025-07-24 18:11:32 +02:00
Teffen Ellis
f00772faf1 web: Font fixes (#15581)
* add base element

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

* web: Rewrite relative CSS asset paths. Update fonts.

Update web/bundler/css-assets-plugin/node.js

Signed-off-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
2025-07-24 15:40:38 +00:00
Teffen Ellis
e280159946 website: Docusaurus 3.8 (#15097)
website: Upgrade Docusaurus. Split API build.
2025-07-23 16:42:01 +02:00
Teffen Ellis
4335498ac5 web: Import organization (#14696)
* web: Clean up locale.

* web: Clean ambiguous imports.

* web: Clean up entrypoint imports.

* web: Format imports.

* web: Normalize extensions.

* web: Tidy order.

* web: Remove TS aliases.
2025-07-10 20:36:56 +00:00
Teffen Ellis
c28b65a3f2 Web: Controllers cleanup (#14616)
* web: Fix issues surrounding availability of controllers during init.

web: Fix edgecase where flow does not have brand.

* web: Fix import path.

* web: Clean up mixin/controller paths.

* web: Prepare for consistent import styling.

- Prep for Storybook fixes.

* web: Update MDX types.

* web: Fix issues surrounding async imports, MDX typing, relative paths.

* web: Format. Clarify.

* web: Group module types.
2025-05-26 07:06:14 -04:00
Teffen Ellis
1c5e906a3e web/NPM Workspaces: ESbuild version cleanup (#14541)
* web: Check JS files. Add types.

* web: Fix issues surrounding Vite/ESBuild types.

* web: Clean up version constants. Tidy types

* web: Clean up docs, types.

* web: Clean up package paths.

* web: (ESLint) no-lonely-if

* web: Render slot before navbar.

* web: Fix line-height alignment.

* web: Truncate long headers.

* web: Clean up page header declarations. Add story. Update paths.

* web: Ignore out directory.

* web: Lint Lit.

* web: Use private alias.

* web: Fix implicit CJS mode.

* web: Update deps.

* web: await all imports.
2025-05-20 02:11:18 +02:00