* main:
web: package up horizontal elements into their own components (#7053)
core: bump django from 4.2.5 to 4.2.6 (#7066)
translate: Updates for file locale/en/LC_MESSAGES/django.po in fr on branch main (#7065)
web: bump postcss from 8.4.29 to 8.4.31 in /web (#7064)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh-Hans on branch main (#7057)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh_CN on branch main (#7056)
web: bump pyright from 1.1.329 to 1.1.330 in /web (#7060)
web: bump the storybook group in /web with 5 updates (#7059)
web: bump the wdio group in /tests/wdio with 2 updates (#7063)
core: bump duo-client from 5.0.1 to 5.1.0 (#7062)
core: bump goauthentik.io/api/v3 from 3.2023083.3 to 3.2023083.4 (#7061)
Add meta description to black box blog post (#7049)
web/flows: fix plex login not opening new tab on mobile safari (#7050)
web: bump API Client version (#7052)
web/flows: bottom-align about text on flows page (#7051)
core: bump codespell from 2.2.5 to 2.2.6 (#7046)
core: bump coverage from 7.3.1 to 7.3.2 (#7047)
web: laying the groundwork for future expansion (#7045)
* web: laying the groundwork for future expansion
This commit is a hodge-podge of updates and changes to the web. Functional changes:
- Makefile: Fixed a bug in the `help` section that prevented the WIDTH from being accurately
calculated if `help` was included rather than in-lined.
- ESLint: Modified the "unused vars" rule so that variables starting with an underline are not
considered by the rule. This allows for elided variables in event handlers. It's not a perfect
solution-- a better one would be to use Typescript's function-specialization typing, but there are
too many places where we elide or ignore some variables in a function's usage that switching over
to specialization would be a huge lift.
- locale: It turns out, lit-locale does its own context management. We don't need to have a context
at all in this space, and that's one less listener we need to attach t othe DOM.
- ModalButton: A small thing, but using `nothing` instead of "html``" allows lit better control over
rendering and reduces the number of actual renders of the page.
- FormGroup: Provided a means to modify the aria-label, rather than stick with the just the word
"Details." Specializing this field will both help users of screen readers in the future, and will
allow test suites to find specific form groups now.
- RadioButton: provide a more consistent interface to the RadioButton. First, we dispatch the
events to the outside world, and we set the value locally so that the current `Form.ts` continues
to behave as expected. We also prevent the "button lost value" event from propagating; this
presents a unified select-like interface to users of the RadioButtonGroup. The current value
semantics are preserved; other clients of the RadioButton do not see a change in behavior.
- EventEmitter: If the custom event detail is *not* an object, do not use the object-like semantics
for forwarding it; just send it as-is.
- Comments: In the course of laying the groundwork for the application wizard, I throw a LOT of
comments into the code, describing APIs, interfaces, class and function signatures, to better
document the behavior inside and as signposts for future work.
* web: permit arrays to be sent in custom events without interpolation.
* actually use assignValue or rather serializeFieldRecursive
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* web: package up horizontal elements into their own components.
This commit introduces a number of "components." Jens has this idiom:
```
<ak-form-element-horizontal label=${msg("Name")} name="name" ?required=${true}>
<input
type="text"
value="${ifDefined(this.instance?.name)}"
class="pf-c-form-control"
required
/>
</ak-form-element-horizontal>
```
It's a very web-oriented idiom in that it's built out of two building blocks, the "element-horizontal" descriptor,
and the input object itself. This idiom is repeated a lot throughout the code. As an alternative, let's wrap
everything into an inheritable interface:
```
<ak-text-input
name="name"
label=${msg("Name")}
value="${ifDefined(this.instance?.name)}
required
>
</ak-text-input>
```
This preserves all the information of the above, makes it much clearer what kind of interaction we're having
(sometimes the `type=` information in an input is lost or easily missed), and while it does require you know
that there are provided components rather than the pair of layout-behavior as in the original it also gives
the developer more precision over the look and feel of the components.
*Right now* these components are placed into the LightDOM, as they are in the existing source code, because
the Form handler has a need to be able to "peer into" the "element-horizontal" component to find the values
of the input objects. In a future revision I hope to place the burden of type/value processing onto the
input objects themselves such that the form handler will need only look for the `.value` of the associated
input control.
Other fixes:
- update the FlowSearch() such that it actually emits an input event when its value changes.
- Disable the storybook shortcuts; on Chrome, at least, they get confused with simple inputs
- Fix an issue with precommit to not scan any Python with ESLint! :-)
* web: provide storybook stories for the components
This commit provides storybook stories for the ak-horizontal-element wrappers. A few
bugs were found along the way, including one rather nasty one from Radio where we
were still getting the "set/unset" pair in the wrong order, so I had to knuckle down
and fix the event handler properly.
* web: test oauth2 provider "guinea pig" for new components
I used the Oauth2 provider page as my experiment in seeing if the
horizontal-element wrappers could be used instead of the raw wrappers
themselves, and I wanted to make sure a test existed that asserts
that filling out THAT form in the ProvidersList and ProvidersForm
didn't break anything.
This commit updates the WDIO tests to do just that; the test is
simple, but it does exercise the `name` field of the Provider,
something not needed in the Wizard because it's set automatically
based on the Application name, and it even asserts that the new
Provider exists in the list of available Providers when it's done.
* web: making sure ESlint and Prettier are happy
* "fix" lint
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
* web: laying the groundwork for future expansion
This commit is a hodge-podge of updates and changes to the web. Functional changes:
- Makefile: Fixed a bug in the `help` section that prevented the WIDTH from being accurately
calculated if `help` was included rather than in-lined.
- ESLint: Modified the "unused vars" rule so that variables starting with an underline are not
considered by the rule. This allows for elided variables in event handlers. It's not a perfect
solution-- a better one would be to use Typescript's function-specialization typing, but there are
too many places where we elide or ignore some variables in a function's usage that switching over
to specialization would be a huge lift.
- locale: It turns out, lit-locale does its own context management. We don't need to have a context
at all in this space, and that's one less listener we need to attach t othe DOM.
- ModalButton: A small thing, but using `nothing` instead of "html``" allows lit better control over
rendering and reduces the number of actual renders of the page.
- FormGroup: Provided a means to modify the aria-label, rather than stick with the just the word
"Details." Specializing this field will both help users of screen readers in the future, and will
allow test suites to find specific form groups now.
- RadioButton: provide a more consistent interface to the RadioButton. First, we dispatch the
events to the outside world, and we set the value locally so that the current `Form.ts` continues
to behave as expected. We also prevent the "button lost value" event from propagating; this
presents a unified select-like interface to users of the RadioButtonGroup. The current value
semantics are preserved; other clients of the RadioButton do not see a change in behavior.
- EventEmitter: If the custom event detail is *not* an object, do not use the object-like semantics
for forwarding it; just send it as-is.
- Comments: In the course of laying the groundwork for the application wizard, I throw a LOT of
comments into the code, describing APIs, interfaces, class and function signatures, to better
document the behavior inside and as signposts for future work.
* web: permit arrays to be sent in custom events without interpolation.
* actually use assignValue or rather serializeFieldRecursive
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
* web/appwizard-1-revisions-and-comments:
actually use assignValue or rather serializeFieldRecursive
web: permit arrays to be sent in custom events without interpolation.
web: laying the groundwork for future expansion
* main:
core: bump urllib3 from 2.0.5 to 2.0.6 (#7042)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh_CN on branch main (#7043)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh-Hans on branch main (#7044)
web: bump the eslint group in /web with 1 update (#7039)
web: bump the eslint group in /tests/wdio with 1 update (#7037)
web: bump @typescript-eslint/parser from 6.7.3 to 6.7.4 in /web (#7041)
core: bump ruff from 0.0.291 to 0.0.292 (#7040)
web: bump @typescript-eslint/parser from 6.7.3 to 6.7.4 in /tests/wdio (#7038)
web: bump @wdio/mocha-framework from 8.16.12 to 8.16.17 in /tests/wdio (#7032)
web: bump @wdio/cli from 8.16.12 to 8.16.18 in /tests/wdio (#7033)
web: bump @wdio/spec-reporter from 8.16.12 to 8.16.17 in /tests/wdio (#7034)
web: bump @wdio/local-runner from 8.16.12 to 8.16.18 in /tests/wdio (#7036)
web: bump the sentry group in /web with 2 updates (#7035)
* main:
core: bump urllib3 from 2.0.5 to 2.0.6 (#7042)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh_CN on branch main (#7043)
translate: Updates for file locale/en/LC_MESSAGES/django.po in zh-Hans on branch main (#7044)
web: bump the eslint group in /web with 1 update (#7039)
web: bump the eslint group in /tests/wdio with 1 update (#7037)
web: bump @typescript-eslint/parser from 6.7.3 to 6.7.4 in /web (#7041)
core: bump ruff from 0.0.291 to 0.0.292 (#7040)
web: bump @typescript-eslint/parser from 6.7.3 to 6.7.4 in /tests/wdio (#7038)
web: bump @wdio/mocha-framework from 8.16.12 to 8.16.17 in /tests/wdio (#7032)
web: bump @wdio/cli from 8.16.12 to 8.16.18 in /tests/wdio (#7033)
web: bump @wdio/spec-reporter from 8.16.12 to 8.16.17 in /tests/wdio (#7034)
web: bump @wdio/local-runner from 8.16.12 to 8.16.18 in /tests/wdio (#7036)
web: bump the sentry group in /web with 2 updates (#7035)
This commit is a hodge-podge of updates and changes to the web. Functional changes:
- Makefile: Fixed a bug in the `help` section that prevented the WIDTH from being accurately
calculated if `help` was included rather than in-lined.
- ESLint: Modified the "unused vars" rule so that variables starting with an underline are not
considered by the rule. This allows for elided variables in event handlers. It's not a perfect
solution-- a better one would be to use Typescript's function-specialization typing, but there are
too many places where we elide or ignore some variables in a function's usage that switching over
to specialization would be a huge lift.
- locale: It turns out, lit-locale does its own context management. We don't need to have a context
at all in this space, and that's one less listener we need to attach t othe DOM.
- ModalButton: A small thing, but using `nothing` instead of "html``" allows lit better control over
rendering and reduces the number of actual renders of the page.
- FormGroup: Provided a means to modify the aria-label, rather than stick with the just the word
"Details." Specializing this field will both help users of screen readers in the future, and will
allow test suites to find specific form groups now.
- RadioButton: provide a more consistent interface to the RadioButton. First, we dispatch the
events to the outside world, and we set the value locally so that the current `Form.ts` continues
to behave as expected. We also prevent the "button lost value" event from propagating; this
presents a unified select-like interface to users of the RadioButtonGroup. The current value
semantics are preserved; other clients of the RadioButton do not see a change in behavior.
- EventEmitter: If the custom event detail is *not* an object, do not use the object-like semantics
for forwarding it; just send it as-is.
- Comments: In the course of laying the groundwork for the application wizard, I throw a LOT of
comments into the code, describing APIs, interfaces, class and function signatures, to better
document the behavior inside and as signposts for future work.
* web/wdio-2:
remove hooks
add basic CI
prettier run
add dependabot
update package name
fix blueprints
web: improve testing by adding test admin user via blueprint
* main: (23 commits)
web/admin: use <pre> for order field on bound elements (#7031)
blueprints: fix mismatched user-login stage order (#7030)
stages/email: rework email templates (#7029)
website/docs: add notice for nginx ingress configuration requirement (#7027)
translate: Updates for web/xliff/en.xlf in fr
web: locales: rename fr_FR to fr to match transifex
events: fix error when storing events with date/time/datetime/etc (#7028)
stages/invitation: fix mis-matched serializer class for invitation (#7018)
web: bump mermaid from 10.4.0 to 10.5.0 in /web (#7026)
web: bump core-js from 3.32.2 to 3.33.0 in /web (#7020)
core: bump webauthn from 1.10.1 to 1.11.0 (#7021)
core: bump pylint from 2.17.6 to 2.17.7 (#7022)
core: bump django-redis from 5.3.0 to 5.4.0 (#7023)
core: bump packaging from 23.1 to 23.2 (#7024)
web/admin: invitation stage: default "continue without invitation" to false
core: bump pydantic from 2.4.1 to 2.4.2 (#7014)
website: bump postcss from 8.4.30 to 8.4.31 in /website (#7015)
internal: fix redis session store (#7011)
web: bump rollup from 3.29.3 to 3.29.4 in /web (#7009)
core: bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0 (#7007)
...
This commit refactors the various components of the Wizard and ApplicationWizard, creating a much
more maintainable and satisfying Wizard experience for both developers (i.e, *me* and *Jens* so
far), and for the customer.
The Wizard base has been refactored into three components:
**AkWizardController**
The `AkWizardController` provides the event listenters for the wizard; it hooks them up, recevies the
events, and forwards them to the wizard. It unwraps the event objects and forwards the relevant
messages contained in the events. It knows of three event categories:
- Navigation requests (move to a different step)
- Update requests (the current step has updated the business content)
- Close requests (close or cancel the wizard).
**ak-wizard-frame**
The `ak-wizard-frame` is the ModalButton interface. It provides the Header, Breadcrumbs (nee`
"navigation block"), Buttons, and a DIV into which the main content is rendered.
**AkWizard**
`AkWizard` is an *incomplete* implementation of the wizard. It's meant to be inherited by a child
class, which will implement the rest. It extends `AKElement`. It provides the basic content needed,
such as steps, currentStep (as an index), an accessor for the step itself, an accessor for the
frame, and the interface to the `AkWizardController`.
**ApplicationWizard**
The `ApplicationWizard` itself has been refactored to accommodate these changes. It inherits from
`AkWizard` and provides the business logic for what to do when a form updates, some custom logic for
preventing moving through the wizard when the forms are incomplete, and a persistence layer for
filling out different providers in the same session. It's simplified a *lot*.
The types specified for `AkWizard` are pretty nifty, I think. I could wish the types being passed
via the custom events were more robust, but [strongly typed custom
events](https://github.com/lit/lit-element/issues/808) turn out to be quite the pain in the, er,
neck. As it is, the `precommit` pass did very good at preventing the worst disasters.
The steps themselves were re-written as objects so that they could take advantage of their `valid`
and `disabled` states and provide more meaningful buttons and labels. I think it's a solid
compromise, and it moved a lot of display logic out of the core `handleUpdate()` business method.
The tests, such as they are, are passing.
* main: (41 commits)
root: fix missing /lifecycle in path
website/blog: add info-block to blog about m2m (#7002)
root: handle SIGHUP and SIGUSR2, healthcheck gunicorn (#6630)
flows: stage_invalid() makes flow restart depending on invalid_response_action setting (#6780)
core: bump psycopg from 3.1.11 to 3.1.12 (#6997)
core: bump pydantic from 2.4.0 to 2.4.1 (#6998)
web: bump the sentry group in /web with 2 updates (#6999)
web: bump pyright from 1.1.328 to 1.1.329 in /web (#7000)
website/blog: improved sentence (#6995)
website/blog: fix missing link in m2m post (#6994)
web/user: fix incorrect link to admin interface (#6993)
root: disable APPEND_SLASH (#6928)
root: replace boj/redistore with vendored version of rbcervilla/redisstore (#6988)
sources/ldap: add default property mapping to mirror directory structure (#6990)
website/blogs: Blog about m2m (#6974)
root: make Celery worker concurrency configurable (#6837)
root: make postgres connection in makefile customizable (#6977)
core: prevent self-impersonation (#6885)
web: bump @typescript-eslint/parser from 6.7.2 to 6.7.3 in /web (#6984)
core: bump pydantic from 2.3.0 to 2.4.0 (#6979)
...
This commit continues the application wizard buildout. In this commit are the following changes:
- Fixed a width-setting bug in the Makefile `make help` feature (i.e "automate that stuff!")
- Added Radius to the list of providers we can offer via the wizard
- Added `launchUrl` and `UI Settings` to features of the application page the wizard can find
- Changed 'SAML Manual Configuration' to just say "SAML Configuration"
- Modified `ak-form-group` to take and honor the `aria-label` property (which in turn makes it
easier to target specific forms with unit testing)
- Reduced the log level for wdio to 'warn'; 'info' was super-spammy and not helpful. It can be put
back with `--logLevel info` from the command line.
- Added SCIM to the list of available providers
- Fixed ForwardProxy so that its mode is set correctly. (This is a special case in the committer;
I'm unhappy with that.)
- Fixed the commit messages so that:
- icons are set correctly (Success, Danger, Working)
- icons are colored correctly according to state
- commit message includes a `data-commit-state` field so tests can find it!
- Merged the application wizard tests into a single test pass
- Isolated common parts of the application wizard tests to reduce unnecessary repetition. All
application tests are the same until you reach the provider section anyway.
- Fixed the unit tests so they're finding the right error messages and are enabled to display them
correctly.
- Moved the test Form handlers into their own folder so they're not cluttering up the Pages folder.
* main: (21 commits)
website/integrations: fix typo
web: improve testability (#6952)
core: bump cryptography from 41.0.3 to 41.0.4 (#6951)
root: don't exclude enterprise from container image (#6956)
core: bump twilio from 8.8.0 to 8.9.0 (#6953)
root: Add setting to adjust database config for pgpool (#6949)
website: bump the docusaurus group in /website with 3 updates (#6943)
web: bump the sentry group in /web with 2 updates (#6944)
web: bump the eslint group in /web with 1 update (#6946)
web: bump the storybook group in /web with 6 updates (#6945)
web: bump @types/grecaptcha from 3.0.4 to 3.0.5 in /web (#6947)
core: bump urllib3 from 2.0.4 to 2.0.5 (#6948)
core: bump node from 20.5 to 20.6 (#6784)
web: bump pyright from 1.1.327 to 1.1.328 in /web (#6940)
web: bump the storybook group in /web with 1 update (#6939)
web: bump the eslint group in /web with 1 update (#6933)
website: bump postcss from 8.4.29 to 8.4.30 in /website (#6932)
web: bump @typescript-eslint/parser from 6.7.0 to 6.7.2 in /web (#6934)
web: bump turnstile-types from 1.1.2 to 1.1.3 in /web (#6935)
website/docs: add info about our docs (#6936)
...