8000 Fix policy delete dialog to separate removed and surviving dependents by edewit · Pull Request #55810 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Fix policy delete dialog to separate removed and surviving dependents - #55810

Open
edewit wants to merge 1 commit into
keycloak:mainfrom
edewit:fix/kc-55695
Open

edewit wants to merge 1 commit into
keycloak:mainfrom
edewit:fix/kc-55695

Conversation

@edewit
@edewit edewit commented Dec 4, 2026
Copy link
Copy Markdown
Contributor

Closes #55695

The Authorization → Policies delete confirmation listed every dependent under a “will be removed” warning even when some keep other associated policies. The dialog now partitions dependents the same way the server does and corrects the English copy.

Decisions and assumptions:

  • Fetch associated policies for each dependent before opening the dialog and split with partitionDependentPolicies into will-be-deleted vs will-remain.
  • Keep English-only message updates; community locales can follow via Weblate.
  • Policy details page delete path left unchanged; this issue is about the list dialog.

AI agents assisted with implementing this change from the issue description.

Show which permissions and aggregated policies will be deleted versus
those that keep other associated policies, and correct the warning copy.

Closes keycloak#55695

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
@edewit
edewit marked this pull request as ready for review December 4, 2026 12:45
@edewit
edewit requested review from a team as code owners December 4, 2026 12:45
Copilot AI balanced review requested due to automatic review settings December 4, 2026 12:45
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The helper misclassifies transitively deleted policies as survivors because it excludes only the selected policy rather than computing the full cascading deletion set.

1 open issue
What changed in this PR

Updates the Authorization → P 8000 olicies list delete dialog to distinguish dependents expected to be removed from those retaining other policy associations, addressing #55695.

Changes:

  • Fetches associated policies and partitions dependents into separate warnings.
  • Corrects English warning text.
  • Adds unit and browser regression coverage.
File Description
js/​apps/​admin-ui/​test/​clients/​authorization.ts Adds dialog and assertion helpers.
js/​apps/​admin-ui/​test/​clients/​authorization.spec.ts Tests dependent warnings and deletion outcomes.
js/​apps/​admin-ui/​src/​clients/​authorization/​Policies.tsx Fetches associations and renders separate warnings.
js/​apps/​admin-ui/​src/​clients/​authorization/​partitionDependentPolicies.ts Adds dependent classification logic.
js/​apps/​admin-ui/​src/​clients/​authorization/​partitionDependentPolicies.test.ts Tests classification scenarios.
js/​apps/​admin-ui/​maven-resources/​theme/​keycloak.v2/​admin/​messages/​messages_en.properties Updates English deletion warnings.

Review effort: Balanced

Comment on lines +17 to +19
const remaining = (dependent.associatedPolicies ?? []).filter(
(policy) => policy.id !== deletedPolicyId,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin Console policy deletion dialog says surviving dependents will be deleted

2 participants

0