* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: fix locale prioritization scheme
The locale priority algorithm had two problems: first, the order was incorrect, allowing the global
default from globalAK() to override a lot of more precise settings; second, the algorithm would take
outside locale overrides from the event handler, which was not necessary.
This commit revises the locale prioritization scheme. It continues to watch for "change of locale"
events from all sources (URL, browser, and user/brand/site internal settings), but if the event
carries a suggested locale, that suggestion is ignored. Instead, when a change of locale event
occurs, it re-runs the algorithm in priority order.
That order is:
- The URL query parameter `locale=`
- The User's stated preference in `CurrentUser.attributes`
- The Browser's stated locale
- The Brand's stated preference in `CurrentBrand.attributes`
- The authentik instance's setting `from window.globalAK()`
- The default locale complied into the UI at build time.
Note to @tanberry: We should note this order somewhere in the documentation, so that users are not
"surprised" that their user preference (set in User Interface -> Settings -> User Details -> Locale)
is not overriden by the browser's preference. (The setting they need is "Based on your browser" to
make browser locale detection work.)
* web: fix locale prioritization scheme
The locale priority algorithm had two problems: first, the order was incorrect, allowing the global
default from globalAK() to override a lot of more precise settings; second, the algorithm would take
outside locale overrides from the event handler, which was not necessary.
This commit revises the locale prioritization scheme. It continues to watch for "change of locale"
events from all sources (URL, browser, and user/brand/site internal settings), but if the event
carries a suggested locale, that suggestion is ignored. Instead, when a change of locale event
occurs, it re-runs the algorithm in priority order.
That order is:
- The URL query parameter `locale=`
- The User's stated preference in `CurrentUser.attributes`
- The Browser's stated locale
- The Brand's stated preference in `CurrentBrand.attributes`
- The authentik instance's setting `from window.globalAK()`
- The default locale complied into the UI at build time.
Note to @tanberry: We should note this order somewhere in the documentation, so that users are not
"surprised" that their user preference (set in User Interface -> Settings -> User Details -> Locale)
is not overriden by the browser's preference. (The setting they need is "Based on your browser" to
make browser locale detection work.)
* web: locale patch for currentUser.settings
Temporarily skipping currentUser.settings.locale as a source of
truth because it's not portable between User/Admin and Flow; Flow
in a logged-out state has no access to `/me`, but we need to probe
`/me` for user settings. This conflict currently triggers a bug
in the session heartbeat handler.
* main:
stages/prompt: fix username field throwing error with existing user (#9342)
root: expose session storage configuration (#9337)
website/integrations: fix typo (#9340)
root: fix go.mod for codeql checking (#9338)
root: make redis settings more consistent (#9335)
web/admin: fix error in admin interface due to un-hydrated context (#9336)
web: bump API Client version (#9334)
stages/authenticator_webauthn: fix attestation value (#9333)
website/docs: fix SECRET_KEY length (#9328)
website/docs: fix email template formatting (#9330)
core, web: update translations (#9323)
web: bump @patternfly/elements from 3.0.0 to 3.0.1 in /web (#9324)
core: bump celery from 5.3.6 to 5.4.0 (#9325)
core: bump goauthentik.io/api/v3 from 3.2024022.12 to 3.2024023.1 (#9327)
sources/scim: service account should be internal (#9321)
web: bump the storybook group in /web with 8 updates (#9266)
sources/scim: cleanup service account when source is deleted (#9319)
fix formating issue
Fixes:
django.template.exceptions.TemplateSyntaxError: 'blocktrans' doesn't allow other block tags (seen "trans 'You recently requested to change your password for you authentik account. Use the button below to set a new password.'") inside it
Signed-off-by: Zapfmeister <zapfmeister@gmail.com>
* main: (23 commits)
web: bump API Client version (#9316)
release: 2024.2.3
website/docs: 2024.2.3 release notes (#9313)
web/admin: fix log viewer empty state (#9315)
website/docs: fix formatting for stage changes (#9314)
core: bump github.com/go-ldap/ldap/v3 from 3.4.7 to 3.4.8 (#9310)
core: bump goauthentik.io/api/v3 from 3.2024022.11 to 3.2024022.12 (#9311)
web: bump core-js from 3.36.1 to 3.37.0 in /web (#9309)
core: bump gunicorn from 21.2.0 to 22.0.0 (#9308)
core, web: update translations (#9307)
website/docs: system settings: add default token duration and length (#9306)
web/flows: update flow background (#9305)
web: fix locale loading being skipped (#9301)
translate: Updates for file web/xliff/en.xlf in fr (#9304)
translate: Updates for file locale/en/LC_MESSAGES/django.po in fr (#9303)
core: replace authentik_signals_ignored_fields with audit_ignore (#9291)
web/flow: fix form input rendering issue (#9297)
events: fix incorrect user logged when using API token authentication (#9302)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh_CN (#9293)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh-Hans (#9295)
...
* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: always build sourcemaps
* main: (34 commits)
web: bump API Client version (#9299)
core: fix api schema for users and groups (#9298)
providers/oauth2: fix refresh_token grant returning incorrect id_token (#9275)
web: bump @sentry/browser from 7.110.0 to 7.110.1 in /web in the sentry group (#9278)
core, web: update translations (#9277)
web: bump the rollup group in /web with 3 updates (#9280)
web: bump lit from 3.1.2 to 3.1.3 in /web (#9282)
web: bump @lit/context from 1.1.0 to 1.1.1 in /web (#9281)
website: bump @types/react from 18.2.78 to 18.2.79 in /website (#9286)
core: bump goauthentik.io/api/v3 from 3.2024022.10 to 3.2024022.11 (#9285)
core: bump sqlparse from 0.4.4 to 0.5.0 (#9276)
lifecycle: gunicorn: fix app preload (#9274)
events: add indexes (#9272)
web/flows: fix passwordless hidden without input (#9273)
root: fix geoipupdate arguments (#9271)
website/docs: cleanup more (#9249)
web: bump API Client version (#9270)
sources: add SCIM source (#3051)
core: delegated group member management (#9254)
web: bump API Client version (#9269)
...