Skip to content

Update name field validation logic in NewClientPolicy component#46307

Open
calebd-anderson wants to merge 1 commit intokeycloak:mainfrom
calebd-anderson:issue-45948
Open

Update name field validation logic in NewClientPolicy component#46307
calebd-anderson wants to merge 1 commit intokeycloak:mainfrom
calebd-anderson:issue-45948

Conversation

@calebd-anderson
Copy link

@calebd-anderson calebd-anderson commented Feb 13, 2026

The NewClientPolicy component is reused for creating a client policy and editing an existing client policy. If the form is not valid the save button is disabled. This PR updates the name field form validation. Given the policyName constant is only defined when editing an existing client policy, short-circuit the validation logic to only verify the new policy name has not been taken if policyName does not match the new name.

With this form validation logic, the expected behavior of the form is enabled:

Fixes:

  • The Save-button does not become active when I add a client profile
  • The Save-button does not become inactive when I save the client profile
  • When I change the name, and then change the name back to the original name, I get the error message "The name must be unique within the realm"
  • When I save a client policy, the conditions and client profiles should be visible
    • this may have been fixed somewhere else, I was not able to reproduce invisible conditions or policies after rebase on main

Closes #45948

@calebd-anderson calebd-anderson requested review from a team as code owners February 13, 2026 03:37
@calebd-anderson calebd-anderson changed the title update name field validation logic in NewClientPolicy component Update name field validation logic in NewClientPolicy component Feb 13, 2026
with the policyName constant only defined when editing, short-circuit the logic to only verify a new policy name has not been taken if policyName does not match the new name

Closes keycloak#45948

Signed-off-by: Caleb Anderson <2682726+calebd-anderson@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When saving a client policy, the conditions and the client profiles disappear

1 participant