Use real component name in deletion confirmation modal

This commit is contained in:
Andrew Kingston 2021-02-09 10:49:22 +00:00
parent 8eea3af800
commit 592348a5a0
1 changed files with 3 additions and 4 deletions

View File

@ -13,9 +13,8 @@
let dropdown let dropdown
let anchor let anchor
$: noChildrenAllowed = $: definition = store.actions.components.getDefinition(component?._component)
!component || $: noChildrenAllowed = !component || !definition?.hasChildren
!store.actions.components.getDefinition(component._component)?.hasChildren
$: noPaste = !$store.componentToPaste $: noPaste = !$store.componentToPaste
const lastPartOfName = c => (c ? last(c._component.split("/")) : "") const lastPartOfName = c => (c ? last(c._component.split("/")) : "")
@ -130,7 +129,7 @@
<ConfirmDialog <ConfirmDialog
bind:this={confirmDeleteDialog} bind:this={confirmDeleteDialog}
title="Confirm Deletion" title="Confirm Deletion"
body={`Are you sure you wish to delete this '${lastPartOfName(component)}' component?`} body={`Are you sure you wish to delete this '${definition?.name}' component?`}
okText="Delete Component" okText="Delete Component"
onOk={deleteComponent} /> onOk={deleteComponent} />