Skip to content

Conversation

@engijlr
Copy link
Contributor

@engijlr engijlr commented Dec 11, 2025

Summary

  • Added support for isDeletable check in delete modals to prevent deletion of system items
  • Created a dedicated delete modal (entity-delete-modal) for the base delete action
  • Updated deleteWithRelation modal to also respect isDeletable flag
  • When isDeletable === false, users see an informative message and can only close the modal

Changes

Core Package

  • New: entity-delete-modal.element.ts - Base delete modal with isDeletable support
  • New: entity-delete-modal.token.ts - Modal token and data interface
  • New: modal/manifests.ts - Modal manifest registration
  • New: modal/constants.ts - Exports
  • Updated: delete.action.ts - Now uses the new dedicated modal instead of generic confirm modal

Relations Package

  • Updated: delete-with-relation-modal.element.ts - Added isDeletable check, hides relations info when item cannot be deleted

Data Type Package

  • Updated: data-type-item.server.data-source.ts - Maps isDeletable from API response
  • Updated: types.ts - Added isDeletable to item type

Localization

  • Updated: en.ts, es.ts - Added cannotDeleteSystemItem message

Test plan

  • Navigate to Settings > Data Types
  • Try to delete a system data type (e.g., "List View - Content")
  • Verify modal shows "This item is used by the system and cannot be deleted."
  • Verify only "Close" button is shown (no Delete button)
  • Try to delete a custom (user-created) data type
  • Verify normal delete confirmation is shown with Cancel/Delete buttons

🤖 Generated with Claude Code

@madsrasmussen madsrasmussen marked this pull request as draft December 12, 2025 07:50
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.

3 participants