Skip to content

Commit 2124eef

Browse files
authored
Merge pull request #27 from mailcarrierapp/feat/enhance-log-details
[2.x] Enhance log details
2 parents 5cb221a + e9a0bc5 commit 2124eef

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

resources/views/modals/details.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ class="text-sm"
1717
@endif
1818
</div>
1919

20+
<div class="mt-4">
21+
<p class="font-bold mb-1">Recipient</p>
22+
<p>{{ $log->recipient }}</p>
23+
</div>
24+
25+
<div class="mt-4">
26+
<p class="font-bold mb-1">Subject</p>
27+
<p>{{ $log->subject }}</p>
28+
</div>
29+
2030
<div class="mt-4">
2131
<p class="font-bold mb-1">Cc</p>
2232
@forelse (($log->cc ?: []) as $cc)

src/Resources/LogResource.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ public static function table(Tables\Table $table): Tables\Table
6060

6161
Tables\Columns\TextColumn::make('subject')
6262
->searchable()
63+
->limit(60)
64+
->tooltip(function (Tables\Columns\TextColumn $column): ?string {
65+
$state = $column->getState();
66+
67+
if (strlen($state) <= $column->getCharacterLimit()) {
68+
return null;
69+
}
70+
71+
// Only render the tooltip if the column content exceeds the length limit.
72+
return $state;
73+
})
6374
->icon(fn (Log $record) => $record->attachments->isNotEmpty() ? 'heroicon-o-paper-clip' : '')
6475
->iconColor('primary'),
6576

@@ -202,8 +213,8 @@ protected static function getTemplateValue(LogTemplateDto $templateDto, ?Templat
202213

203214
return new HtmlString(
204215
($icon ? svg($icon, 'w-5 h-5 inline-block mr-1 ' . $iconColor)->toHtml() : '') .
205-
$label .
206-
($subtitle ? '<p class="text-xs mt-1 text-slate-300">' . $subtitle . '</p>' : '')
216+
$label .
217+
($subtitle ? '<p class="text-xs mt-1 text-slate-300">' . $subtitle . '</p>' : '')
207218
);
208219
}
209220

0 commit comments

Comments
 (0)