Merge pull request #12755 from Budibase/fix/disable-component-tree-eject-per-config
Disable eject option for blocks in the component tree when ejectable set to false in manifest
This commit is contained in:
commit
64c3cd4aa0
|
@ -7,6 +7,7 @@
|
|||
$: definition = store.actions.components.getDefinition(component?._component)
|
||||
$: noPaste = !$store.componentToPaste
|
||||
$: isBlock = definition?.block === true
|
||||
$: canEject = !(definition?.ejectable === false)
|
||||
|
||||
const keyboardEvent = (key, ctrlKey = false) => {
|
||||
document.dispatchEvent(
|
||||
|
@ -32,7 +33,7 @@
|
|||
>
|
||||
Delete
|
||||
</MenuItem>
|
||||
{#if isBlock}
|
||||
{#if isBlock && canEject}
|
||||
<MenuItem
|
||||
icon="Export"
|
||||
keyBind="Ctrl+E"
|
||||
|
|
|
@ -32,8 +32,15 @@
|
|||
await store.actions.components.paste(component, "below")
|
||||
},
|
||||
["Ctrl+e"]: component => {
|
||||
componentToEject = component
|
||||
confirmEjectDialog.show()
|
||||
const definition = store.actions.components.getDefinition(
|
||||
component._component
|
||||
)
|
||||
const isBlock = definition?.block === true
|
||||
const canEject = !(definition?.ejectable === false)
|
||||
if (isBlock && canEject) {
|
||||
componentToEject = component
|
||||
confirmEjectDialog.show()
|
||||
}
|
||||
},
|
||||
["Ctrl+Enter"]: () => {
|
||||
$goto(`./:componentId/new`)
|
||||
|
|
Loading…
Reference in New Issue