Skip to content

Commit

Permalink
fixes slideovers
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed Dec 23, 2024
1 parent 11cca95 commit f025911
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Resources/EventResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class EventResource extends Resource

protected static bool $shouldRegisterNavigation = true;

public function getTitle(): string
{
return __('Events');
}

public static function getNavigationParentItem(): ?string
{
return __('Mails');
Expand All @@ -41,7 +46,7 @@ public static function getNavigationLabel(): string

public static function getLabel(): ?string
{
return __('Events');
return __('Event');
}

public static function getPluralModelLabel(): string
Expand All @@ -54,11 +59,6 @@ public static function getNavigationIcon(): string
return 'heroicon-o-calendar';
}

public function getTitle(): string
{
return __('Events');
}

public static function infolist(Infolist $infolist): Infolist
{
return $infolist
Expand Down Expand Up @@ -214,10 +214,6 @@ 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', [
'record' => $record->mail,
'tenant' => filament()->getTenant()?->id,
]))
->label(__('Subject'))
->searchable(['subject', 'payload']),
Tables\Columns\TextColumn::make('occurred_at')
Expand All @@ -233,6 +229,8 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\ViewAction::make()
->url(null)
->modal()
->slideOver()
->label(__('View'))
->hiddenLabel()
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/EventResource/Pages/ListEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public function getTabs(): array
->badge(MailEvent::where('type', EventType::OPENED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::OPENED)),

'soft_bounce' => Tab::make()
->label(__('Soft Bounce'))
->icon('heroicon-o-x-circle')
->badge(MailEvent::where('type', EventType::SOFT_BOUNCED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::SOFT_BOUNCED)),

'bounced' => Tab::make()
->label(__('Bounced'))
->badgeColor('danger')
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/MailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\ViewAction::make()
->url(null)
->modal()
->slideOver()
->label(__('View'))
->hiddenLabel()
Expand Down

0 comments on commit f025911

Please sign in to comment.