From 985d4910731a7c68d22bece0a09095be3c37685a Mon Sep 17 00:00:00 2001 From: Ken Sternberg <133134217+kensternberg-authentik@users.noreply.github.com> Date: Mon, 10 Mar 2025 08:34:28 -0700 Subject: [PATCH] web/admin: fix display bug for assigned users in application bindings in the wizard (#13435) * 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 dddde09be571a639ecd041569dd3a282aab3f9be. * web/admin: fix display bug for assigned users in application bindings in the wizard ## What Modifies the type-of-binding detection algorithm to check if there's a user field and that it's a number. ## Why The original type-of-binding detector checked if the field was set and asserted that it was a string of at least one character. Unfortunately, this doesn't work for `user`, where the primary key is an integer. Changing the algorithm to "It's really a string with something in it, *or* it's a number," works. ## Testing - Ensure you have at least one user you can use, and that user has a username. - Navigate through the Application Wizard until you reach the binding page. - Create a user binding - See that the user shows up in the table. --- .../wizard/steps/ak-application-wizard-bindings-step.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/admin/applications/wizard/steps/ak-application-wizard-bindings-step.ts b/web/src/admin/applications/wizard/steps/ak-application-wizard-bindings-step.ts index ee2ffce7ad..65b954f441 100644 --- a/web/src/admin/applications/wizard/steps/ak-application-wizard-bindings-step.ts +++ b/web/src/admin/applications/wizard/steps/ak-application-wizard-bindings-step.ts @@ -58,7 +58,7 @@ export class ApplicationWizardBindingsStep extends ApplicationWizardStep { get bindingsAsColumns() { return this.wizard.bindings.map((binding, index) => { const { order, enabled, timeout } = binding; - const isSet = P.string.minLength(1); + const isSet = P.union(P.string.minLength(1), P.number); const policy = match(binding) .with({ policy: isSet }, (v) => msg(str`Policy ${v.policyObj?.name}`)) .with({ group: isSet }, (v) => msg(str`Group ${v.groupObj?.name}`))