Skip to content

Commit

Permalink
update mail template, dynamic columns for tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
AzGasim committed Dec 13, 2024
1 parent bf38569 commit 66071a4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/expiry.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'expiry_job',
'field' => 'category',
'operator' => '=',
'value' => 'Documents',
],
Expand All @@ -77,7 +77,7 @@
'icon' => 'gmdi-account-circle',
'query' => [
[
'field' => 'expiry_job',
'field' => 'category',
'operator' => '=',
'value' => 'Articles',
],
Expand All @@ -91,7 +91,7 @@
'icon' => 'gmdi-no-accounts',
'query' => [
[
'field' => 'expiry_job',
'field' => 'category',
'operator' => '=',
'value' => 'Tasks',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<tr>
<th>{{ __('core::core.title') }}</th>
<th>{{ __('core::expiry.notifyUser') }}</th>
<th>{{ __('core::core.category') }}</th>
<th>{{ __('core::expiry.will_expire_at') }}</th>
<th>{{ __('core::expiry.processing_deadline') }}</th>
<th>{{ __('core::expiry.escalated_at') }}</th>
Expand All @@ -120,6 +121,7 @@
<tr>
<td class="title">{{ $entry['title'] }}</td>
<td>{{ $entry['notified_to'] }}</td>
<td>{{ $entry['category'] }}</td>
<td>{{ $entry['expired_at'] }}</td>
<td>{{ $entry['processing_deadline'] }}</td>
<td class="escalation">{{ $entry['escalated_at'] }}</td>
Expand Down
1 change: 1 addition & 0 deletions packages/expiry/src/Jobs/SendEscalatedExpiriesJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function handle()
'escalated_at' => Carbon::parse($entry->escalated_at)->format('d.m.Y'),
'notified_to' => config('expiry.user_model')::where('ID', $entry->notified_to)->first()?->display_name,
'user_email' => config('expiry.user_model')::where('ID', $entry->notified_to)->first()?->email,
'category' => $entry->category,
];
}),
];
Expand Down
10 changes: 8 additions & 2 deletions packages/expiry/src/Resources/ExpiryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,21 @@ public static function table(Table $table): Table
->toggleable()
->sortable()
->since()
->visible(fn () => Expiry::query()->whereNotNull('processing_deadline')->exists()),
->hidden(fn () => ! Expiry::query()->whereNotNull('processing_deadline')->exists())
->visible(
fn ($livewire) => isset($livewire->activeTab)
&& in_array($livewire->activeTab, ['all', 'documents', 'tasks'])),
Tables\Columns\TextColumn::make('escalated_at')
->label(__('core::expiry.escalated_at'))
->toggleable()
->sortable()
->date()
->icon('gmdi-warning')
->color('warning')
->visible(fn () => Expiry::query()->whereNotNull('escalated_at')->exists()),
->hidden(fn () => ! Expiry::query()->whereNotNull('escalated_at')->exists())
->visible(
fn ($livewire) => isset($livewire->activeTab)
&& in_array($livewire->activeTab, ['all', 'documents', 'tasks'])),
Tables\Columns\TextColumn::make('cycle')
->label(__('core::expiry.cycle'))
->toggleable()
Expand Down

0 comments on commit 66071a4

Please sign in to comment.