Skip to content

Extension point: custom delete behavior #334

Description

@hpehl

Parent: #320

Summary

Allow resources to customize the delete confirmation dialog and pre/post-delete actions. Currently, DeleteResourceDialog shows a simple confirmation with no way to warn about dependencies, show impact, or perform cleanup.

Motivation

  • Pre-delete validation — warn about dependent resources or active connections before confirming (e.g., "This datasource is referenced by 3 persistence units")
  • Custom confirmation content — show what will be affected (e.g., "This credential store contains 5 aliases that will also be removed")
  • Post-delete actions — cleanup operations after deletion (e.g., removing orphaned child resources, refreshing related views)
  • Delete prevention — some resources shouldn't be deletable via the generic UI (e.g., the default datasource, the management security realm)

Capabilities

  • Pre-delete check — a function that returns a warning message or blocks deletion entirely
  • Custom confirmation dialog — replace the default confirmation with resource-specific content
  • Post-delete handler — execute additional operations after successful deletion
  • Delete guard — prevent deletion for specific resources based on runtime state

Registration

A registry keyed by Environment + AddressTemplate. When DialogBricks.deleteResourceModal() is called for a matching template, the registry provides the customizations.

Affected Call Sites

  • ModelBrowser.delete() — model browser delete action
  • FinderBricks — finder column delete action
  • ResourceList — resource list remove button

Open Questions

  • Should pre-delete checks be async (e.g., query the server for dependent resources)?
  • How should the delete guard interact with RBAC — should it be a separate concern or combined?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions