This commit adds HTMLTagNameElementMap entries to every web component in the front end. Activating
and associating the HTMLTagNamElementMap with its class has enabled
[LitAnalyzer](https://github.com/runem/lit-analyzer/tree/master/packages/lit-analyzer) to reveal a
*lot* of basic problems within the UI, the most popular of which is "missing import." We usually get
away with it because the object being imported was already registered with the browser elsewhere,
but it still surprises me that we haven't gotten any complaints over things like:
```
./src/flow/stages/base.ts
Missing import for <ak-form-static>
96: <ak-form-static
no-missing-import
```
Given how early and fundamental that seems to be in our code, I'd have expected to hear _something_
about it.
I have not enabled most of the possible checks because, well, there are just a ton of warnings when
I do. I'd like to get in and fix those.
Aside from this, I have also _removed_ `customElement` declarations from anything declared as an
`abstract class`. It makes no sense to try and instantiate something that cannot, by definition, be
instantiated. If the class is capable of running on its own, it's not abstract, it just needs to be
overridden in child classes. Before removing the declaration I did check to make sure no other
piece of code was even *trying* to instantiate it, and so far I have detected no failures. Those
elements were:
- elements/forms/Form.ts
- element-/wizard/WizardFormPage.ts
The one that blows my mind, though, is this:
```
src/elements/forms/ProxyForm.ts
6-@customElement("ak-proxy-form")
7:export abstract class ProxyForm extends Form<unknown> {
```
Which, despite being `abstract`, is somehow instantiable?
```
src/admin/outposts/ServiceConnectionListPage.ts: <ak-proxy-form
src/admin/providers/ProviderListPage.ts: <ak-proxy-form
src/admin/sources/SourceWizard.ts: <ak-proxy-form
src/admin/sources/SourceListPage.ts: <ak-proxy-form
src/admin/providers/ProviderWizard.ts: <ak-proxy-form type=${type.component}></ak-proxy-form>
src/admin/stages/StageListPage.ts: <ak-proxy-form
```
I've made a note to investigate.
I've started a new folder where all of my one-off tools for *how* a certain PR was run. It has a
README describing what it's for, and the first tool, `add-htmlelementtagnamemaps-to-everything`, is
its first entry. That tool is also documented internally.
``` Gilbert & Sullivan
I've got a little list,
I've got a little list,
Of all the code that would never be missed,
The duplicate code of cute-and-paste,
The weak abstractions that lead to waste,
The embedded templates-- you get the gist,
There ain't none of 'em that will ever be missed,
And that's why I've got them on my list!
```
This commit includes a monkeypatch to allow custom-element-manifest (CEM) to work correctly again
despite our rich collection of mixins, reactive controllers, symbol-oriented event handlers, and the
like. With that monkeypatch in place, we can now create the CEM manifest file and then exploit it so
that IDEs and the Typescript compilation pass can tell when a component is being used incorrectly;
when the wrong types are being passed to it, or when a required attribute is not initialized.
* main:
website/docs: update 2024.6 release notes with latest changes (#10174)
core: fix error when raising SkipObject in mapping (#10153)
website/docs: 2024.6 release notes: add note about group names (#10170)
website/docs: update 2024.6 release notes with latest changes (#10167)
core: bump twilio from 9.1.1 to 9.2.0 (#10162)
web: bump chromedriver from 126.0.1 to 126.0.2 in /tests/wdio (#10161)
web: bump the wdio group in /tests/wdio with 4 updates (#10160)
website/integrations: jellyfin: add OIDC configuration (#9538)
website/docs: Describe where to apply the auto setup env vars (#9863)
website/integrations: gitlab: better service description (#9923)
web: fix docker build for non-release versions (#10154)
root: makefile: add codespell to make-website (#10116)
Update automated-install.md
Took me a good half an hour to find out why my env setup vars are not working: Set the on the server, not the worker container!
Signed-off-by: m1212e <14091540+m1212e@users.noreply.github.com>
* main: (27 commits)
root: use custom model serializer that saves m2m without bulk (#10139)
core: bump urllib3 from 2.2.1 to 2.2.2 (#10143)
ci: bump docker/build-push-action from 5 to 6 (#10144)
web: bump the storybook group in /web with 7 updates (#10147)
web: bump ws from 8.16.0 to 8.17.1 in /web (#10149)
web: fix needed because recent upgrade to task breaks spinner button (#10142)
core: include version in built JS files (#9558)
website/integations/services: Slack integration docs (#9933)
web: fix early modal stack depletion (#10068)
website: bump react-tooltip from 5.26.4 to 5.27.0 in /website (#10129)
web: bump @patternfly/elements from 3.0.1 to 3.0.2 in /web (#10132)
core: bump github.com/gorilla/sessions from 1.2.2 to 1.3.0 (#10135)
web: bump chromedriver from 126.0.0 to 126.0.1 in /tests/wdio (#10136)
core: bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#10133)
core, web: update translations (#10127)
core: bump ruff from 0.4.8 to 0.4.9 (#10128)
core: bump goauthentik.io/api/v3 from 3.2024042.11 to 3.2024042.13 (#10134)
core, web: update translations (#10118)
translate: Updates for file web/xliff/en.xlf in zh-Hans (#10121)
translate: Updates for file web/xliff/en.xlf in zh_CN (#10120)
...
* 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.
* core: include version in built JS files
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* add fallback
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* include build hash
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* format
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* fix stuff
why does this even work locally
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* idk man node
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* just not use import assertions
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* web: add no-console, use proper dirname path
* web: retarget to use the base package.json file.
* web: encode path to root package.json using git
This is the most authoritative way of finding the root of the git project.
* use full version to match frontend
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* add fallback for missing .git folder
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Ken Sternberg <ken@goauthentik.io>
* 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 early modal stack depletion
While working on something else, I discovered this mutation inside
the modal stack handler; I've changed it to make a copy of the
original stack, modify that copy, and then write the changed stack
back to the original. While unlikely, it is possible that the stack
could get out-of-sync and be depleted before all stacked modals
have been closed. This fixes that issue.
* make eslint shut up
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
* main:
website/docs: release notes for 2024.6 (#9812)
policies/reputation: save to database directly (#10059)
providers/enterprise: import user/group data when manually linking objects (#10089)
core, web: update translations (#10108)
web: Add enterprise / FIPS notification to the AdminOverviewPage (#10090)
core: bump github.com/getsentry/sentry-go from 0.28.0 to 0.28.1 (#10095)
web: bump API Client version (#10107)
admin: system api: do not show FIPS status if no valid license (#10091)
root: add configuration option to enable fips (#10088)
web: bump the sentry group across 1 directory with 2 updates (#10101)
web: bump ts-pattern from 5.1.2 to 5.2.0 in /web (#10098)
web: bump the storybook group across 1 directory with 7 updates (#10102)
core: bump github.com/gorilla/websocket from 1.5.2 to 1.5.3 (#10103)
core: bump pydantic from 2.7.3 to 2.7.4 (#10093)
core: bump bandit from 1.7.8 to 1.7.9 (#10094)