Don't allow edit or delete actions for row actions

This commit is contained in:
Adria Navarro 2024-07-23 10:21:09 +02:00
parent 9428172482
commit d601400871
1 changed files with 46 additions and 40 deletions

View File

@ -35,7 +35,11 @@
} }
const getContextMenuItems = () => { const getContextMenuItems = () => {
return [ const isRowAction = automation.definition.trigger.name === "Row Action"
const result = []
if (!isRowAction) {
result.push(
...[
{ {
icon: "Delete", icon: "Delete",
name: "Delete", name: "Delete",
@ -57,12 +61,14 @@
name: "Duplicate", name: "Duplicate",
keyBind: null, keyBind: null,
visible: true, visible: true,
disabled: disabled: automation.definition.trigger.name === "Webhook",
automation.definition.trigger.name === "Webhook" ||
automation.definition.trigger.name === "Row Action",
callback: duplicateAutomation, callback: duplicateAutomation,
}, },
{ ]
)
}
result.push({
icon: automation.disabled ? "CheckmarkCircle" : "Cancel", icon: automation.disabled ? "CheckmarkCircle" : "Cancel",
name: automation.disabled ? "Activate" : "Pause", name: automation.disabled ? "Activate" : "Pause",
keyBind: null, keyBind: null,
@ -74,8 +80,8 @@
automation.disabled automation.disabled
) )
}, },
}, })
] return result
} }
const openContextMenu = e => { const openContextMenu = e => {