1
0
forked from test/crm

fix: removed hardcoded delete action since it can be added through custom actions

This commit is contained in:
Shariq Ansari 2023-12-28 17:23:54 +05:30
parent 949b72ed60
commit 7d5df9dfa1
2 changed files with 2 additions and 56 deletions

View File

@ -8,33 +8,6 @@
v-if="deal.data._customActions"
:actions="deal.data._customActions"
/>
<Dropdown
:options="[
{
icon: 'trash-2',
label: 'Delete',
onClick: () =>
$dialog({
title: 'Delete Deal',
message: 'Are you sure you want to delete this deal?',
actions: [
{
label: 'Delete',
theme: 'red',
variant: 'solid',
onClick(close) {
deleteDeal(deal.data.name)
close()
},
},
],
}),
},
]"
@click.stop
>
<Button icon="more-horizontal" />
</Dropdown>
<component :is="deal.data._assignedTo?.length == 1 ? 'Button' : 'div'">
<MultipleAvatar
:avatars="deal.data._assignedTo"
@ -357,7 +330,7 @@ const deal = createResource({
auto: true,
onSuccess: (data) => {
setupAssignees(data)
setupCustomActions(data, { doc: data, updateField })
setupCustomActions(data, { doc: data, $dialog, updateField, deleteDoc: deleteDeal })
},
})

View File

@ -8,33 +8,6 @@
v-if="lead.data._customActions"
:actions="lead.data._customActions"
/>
<Dropdown
:options="[
{
icon: 'trash-2',
label: 'Delete',
onClick: () =>
$dialog({
title: 'Delete Lead',
message: 'Are you sure you want to delete this lead?',
actions: [
{
label: 'Delete',
theme: 'red',
variant: 'solid',
onClick(close) {
deleteLead(lead.data.name)
close()
},
},
],
}),
},
]"
@click.stop
>
<Button icon="more-horizontal" />
</Dropdown>
<component :is="lead.data._assignedTo?.length == 1 ? 'Button' : 'div'">
<MultipleAvatar
:avatars="lead.data._assignedTo"
@ -264,7 +237,7 @@ const lead = createResource({
auto: true,
onSuccess: (data) => {
setupAssignees(data)
setupCustomActions(data, { doc: data, updateField })
setupCustomActions(data, { doc: data, $dialog, updateField, deleteDoc: deleteLead })
},
})