From c4cb0fdf8395ad7233b5b73dba7e258570214c04 Mon Sep 17 00:00:00 2001 From: fsociety Date: Mon, 28 Oct 2024 14:56:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20feat(table):=20add=20new=20expor?= =?UTF-8?q?t=20columns=20for=20email,=20status,=20npub,=20and=20payment=20?= =?UTF-8?q?details=20in=20PlebTable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/EinundzwanzigPlebTable.php | 29 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/app/Livewire/EinundzwanzigPlebTable.php b/app/Livewire/EinundzwanzigPlebTable.php index 2e43304..92dc123 100644 --- a/app/Livewire/EinundzwanzigPlebTable.php +++ b/app/Livewire/EinundzwanzigPlebTable.php @@ -27,7 +27,6 @@ final class EinundzwanzigPlebTable extends PowerGridComponent public string $sortDirection = 'desc'; - public function setUp(): array { return [ @@ -90,6 +89,7 @@ final class EinundzwanzigPlebTable extends PowerGridComponent '.', ) . '' : 'keine Zahlung vorhanden', ) + ->add('npub_export', fn(EinundzwanzigPleb $model) => $model->npub) ->add( 'npub', fn(EinundzwanzigPleb $model) @@ -98,6 +98,8 @@ final class EinundzwanzigPlebTable extends PowerGridComponent ) . '">Nostr Profile', ) ->add('association_status') + ->add('association_status_name', fn(EinundzwanzigPleb $model) => $model->association_status->name) + ->add('paid_export', fn(EinundzwanzigPleb $model) => $model->paymentEvents->first()?->amount) ->add( 'association_status_formatted', function (EinundzwanzigPleb $model) { @@ -126,19 +128,36 @@ final class EinundzwanzigPlebTable extends PowerGridComponent Column::make('Avatar', 'avatar') ->visibleInExport(visible: false), + Column::make('Email', 'email') + ->hidden() + ->visibleInExport(visible: true), + + Column::make('Status', 'association_status_name') + ->hidden() + ->visibleInExport(visible: true), + + Column::make('Npub', 'npub_export') + ->hidden() + ->visibleInExport(visible: true), + + Column::make('Bezahlt', 'paid_export') + ->hidden() + ->visibleInExport(visible: true), + Column::make('Npub', 'npub') ->visibleInExport(visible: false) ->sortable(), Column::make('Name', 'name_lower') - ->sortable(), - - Column::make('Aktueller Status', 'association_status_formatted', 'association_status') ->visibleInExport(visible: true) ->sortable(), + Column::make('Aktueller Status', 'association_status_formatted', 'association_status') + ->visibleInExport(visible: false) + ->sortable(), + Column::make('Beitrag ' . date('Y'), 'payment') - ->visibleInExport(visible: true), + ->visibleInExport(visible: false), Column::make('Bewirbt sich für', 'for', 'application_for') ->visibleInExport(visible: false)