Skip to content

Commit

Permalink
Remove global search on events
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Oct 4, 2024
1 parent a0db639 commit 88c97be
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Resources/EventResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class EventResource extends Resource

protected static ?string $slug = 'mails/events';

protected static ?string $recordTitleAttribute = 'subject';

protected static bool $isScopedToTenant = false;

protected static bool $shouldRegisterNavigation = true;
Expand Down Expand Up @@ -75,7 +73,7 @@ public static function infolist(Infolist $infolist): Infolist
TextEntry::make('type')
->label(__('Type'))
->badge()
->color(fn (EventType $state): string => match ($state) {
->color(fn(EventType $state): string => match ($state) {
EventType::DELIVERED => 'success',
EventType::CLICKED => 'clicked',
EventType::OPENED => 'info',
Expand Down Expand Up @@ -123,7 +121,7 @@ public static function infolist(Infolist $infolist): Infolist
->default(__('Unknown'))
->label(__('User Agent'))
->limit(50)
->tooltip(fn ($state) => $state),
->tooltip(fn($state) => $state),
]),
]),
Section::make(__('Location'))
Expand Down Expand Up @@ -152,7 +150,7 @@ public static function infolist(Infolist $infolist): Infolist
->default(__('Unknown'))
->label(__('Link'))
->limit(50)
->url(fn ($state) => $state)
->url(fn($state) => $state)
->openUrlInNewTab(),
TextEntry::make('tag')
->default(__('Unknown'))
Expand Down Expand Up @@ -201,7 +199,7 @@ public static function table(Table $table): Table
->label(__('Type'))
->sortable()
->badge()
->color(fn (EventType $state): string => match ($state) {
->color(fn(EventType $state): string => match ($state) {
EventType::DELIVERED => 'success',
EventType::CLICKED => 'clicked',
EventType::OPENED => 'info',
Expand All @@ -216,7 +214,7 @@ public static function table(Table $table): Table
})
->searchable(),
Tables\Columns\TextColumn::make('mail.subject')
->url(fn (MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.view', [
->url(fn(MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.view', [
'record' => $record->mail,
'tenant' => filament()->getTenant()?->id,

Check failure on line 219 in src/Resources/EventResource.php

View workflow job for this annotation

GitHub Actions / phpstan

Access to an undefined property Illuminate\Database\Eloquent\Model::$id.
]))
Expand All @@ -226,7 +224,7 @@ public static function table(Table $table): Table
->label(__('Occurred At'))
->dateTime('d-m-Y H:i')
->since()
->tooltip(fn (MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->sortable()
->searchable(),
])
Expand Down Expand Up @@ -254,4 +252,4 @@ public static function getPages(): array
'view' => ViewEvent::route('/{record}/view'),
];
}
}
}

0 comments on commit 88c97be

Please sign in to comment.