fix(donations): Don't show enter payment for anon donations

This commit is contained in:
Nicolai Ort 2025-04-28 19:40:57 +02:00
parent 724e84441e
commit 32f72df105
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 12 additions and 5 deletions

View File

@ -9,10 +9,15 @@
export let paymentAction;
</script>
{#if paymentAction}
<button
on:click={paymentAction}
class="text-[#025a21] hover:text-green-900 mr-4">{$_("enter-payment")}</button
>
{:else}
<span class="inline-block opacity-0 cursor-default mr-4" style="">{$_("enter-payment")}</span>
{/if}
<TableActions
bind:detailsAction
bind:detailsLink

View File

@ -113,8 +113,14 @@
header: () => $_("action"),
cell: (info) => {
let detailsLink
let paymentAction
if (info.row.original.donor != undefined){
detailsLink = `./${info.row.original.id}`
paymentAction = () => {
active_edits = current_donations.filter(
(r) => r.id == info.row.original.id
);
}
}
return renderComponent(DonationTableAction, {
@ -124,11 +130,7 @@
(r) => r.id == info.row.original.id
);
},
paymentAction: () => {
active_edits = current_donations.filter(
(r) => r.id == info.row.original.id
);
},
paymentAction: paymentAction,
deleteEnabled:
store.state.jwtinfo.userdetails.permissions.includes(
"DONATION:DELETE"