Don't allow edit or delete actions for row actions
This commit is contained in:
parent
9428172482
commit
d601400871
|
@ -35,47 +35,53 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const getContextMenuItems = () => {
|
const getContextMenuItems = () => {
|
||||||
return [
|
const isRowAction = automation.definition.trigger.name === "Row Action"
|
||||||
{
|
const result = []
|
||||||
icon: "Delete",
|
if (!isRowAction) {
|
||||||
name: "Delete",
|
result.push(
|
||||||
keyBind: null,
|
...[
|
||||||
visible: true,
|
{
|
||||||
disabled: false,
|
icon: "Delete",
|
||||||
callback: confirmDeleteDialog.show,
|
name: "Delete",
|
||||||
|
keyBind: null,
|
||||||
|
visible: true,
|
||||||
|
disabled: false,
|
||||||
|
callback: confirmDeleteDialog.show,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "Edit",
|
||||||
|
name: "Edit",
|
||||||
|
keyBind: null,
|
||||||
|
visible: true,
|
||||||
|
disabled: false,
|
||||||
|
callback: updateAutomationDialog.show,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "Duplicate",
|
||||||
|
name: "Duplicate",
|
||||||
|
keyBind: null,
|
||||||
|
visible: true,
|
||||||
|
disabled: automation.definition.trigger.name === "Webhook",
|
||||||
|
callback: duplicateAutomation,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
result.push({
|
||||||
|
icon: automation.disabled ? "CheckmarkCircle" : "Cancel",
|
||||||
|
name: automation.disabled ? "Activate" : "Pause",
|
||||||
|
keyBind: null,
|
||||||
|
visible: true,
|
||||||
|
disabled: false,
|
||||||
|
callback: () => {
|
||||||
|
automationStore.actions.toggleDisabled(
|
||||||
|
automation._id,
|
||||||
|
automation.disabled
|
||||||
|
)
|
||||||
},
|
},
|
||||||
{
|
})
|
||||||
icon: "Edit",
|
return result
|
||||||
name: "Edit",
|
|
||||||
keyBind: null,
|
|
||||||
visible: true,
|
|
||||||
disabled: false,
|
|
||||||
callback: updateAutomationDialog.show,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: "Duplicate",
|
|
||||||
name: "Duplicate",
|
|
||||||
keyBind: null,
|
|
||||||
visible: true,
|
|
||||||
disabled:
|
|
||||||
automation.definition.trigger.name === "Webhook" ||
|
|
||||||
automation.definition.trigger.name === "Row Action",
|
|
||||||
callback: duplicateAutomation,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: automation.disabled ? "CheckmarkCircle" : "Cancel",
|
|
||||||
name: automation.disabled ? "Activate" : "Pause",
|
|
||||||
keyBind: null,
|
|
||||||
visible: true,
|
|
||||||
disabled: false,
|
|
||||||
callback: () => {
|
|
||||||
automationStore.actions.toggleDisabled(
|
|
||||||
automation._id,
|
|
||||||
automation.disabled
|
|
||||||
)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const openContextMenu = e => {
|
const openContextMenu = e => {
|
||||||
|
|
Loading…
Reference in New Issue