Skip to content

Commit

Permalink
fix some issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-webkul committed Nov 8, 2024
1 parent 321e0fc commit dede424
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 80 deletions.
11 changes: 10 additions & 1 deletion packages/Webkul/Admin/src/DataGrids/Mail/EmailDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Carbon\Carbon;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Webkul\Admin\Http\Resources\EmailResource;
use Webkul\DataGrid\DataGrid;
use Webkul\Email\Repositories\EmailRepository;
use Webkul\Tag\Repositories\TagRepository;
Expand Down Expand Up @@ -63,7 +64,15 @@ public function prepareColumns(): void
'searchable' => false,
'filterable' => false,
'sortable' => true,
'closure' => fn ($row) => $row->attachments ? '<i class="icon-attachment text-2xl"></i>' : '',
'closure' => function ($row) {
$email = app(EmailRepository::class)->find($row->id);

$hasAttachments = collect($email->emails)->contains(function($email) {
return $email->attachments()->exists();
});

return $hasAttachments ? '<i class="icon-attachment text-2xl"></i>' : '';
},
]);

$this->addColumn([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class="icon-checkbox-outline peer-checked:icon-checkbox-select cursor-pointer ro
<p class="flex items-center gap-2 overflow-hidden text-ellipsis whitespace-nowrap leading-none">
<x-admin::avatar ::name="record.name" />
@{{ record.name }}
</p>
</div>
Expand All @@ -204,12 +205,11 @@ class="icon-checkbox-outline peer-checked:icon-checkbox-select cursor-pointer ro
<p
v-if="record.attachments"
v-html="record.attachments"
class="w-10 flex-shrink-0"
></p>
<!-- Tags -->
<span
class="flex items-center gap-1 rounded-md bg-rose-100 p-1"
class="flex items-center gap-1 rounded-2xl bg-rose-100 px-2 py-1"
:style="{
'background-color': tag.color,
'color': backgroundColors.find(color => color.background === tag.color)?.text
Expand Down
71 changes: 71 additions & 0 deletions public/admin/build/assets/app-2032dc2b.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/admin/build/assets/app-616e1646.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/admin/build/assets/app-ccdeae95.css

This file was deleted.

74 changes: 0 additions & 74 deletions public/admin/build/assets/app-e63448d1.js

This file was deleted.

4 changes: 2 additions & 2 deletions public/admin/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"src": "node_modules/vue-cal/dist/i18n/zh-hk.es.js"
},
"src/Resources/assets/css/app.css": {
"file": "assets/app-ccdeae95.css",
"file": "assets/app-616e1646.css",
"isEntry": true,
"src": "src/Resources/assets/css/app.css"
},
Expand Down Expand Up @@ -370,7 +370,7 @@
"node_modules/vue-cal/dist/i18n/zh-hk.es.js",
"node_modules/vue-cal/dist/drag-and-drop.es.js"
],
"file": "assets/app-e63448d1.js",
"file": "assets/app-2032dc2b.js",
"isEntry": true,
"src": "src/Resources/assets/js/app.js"
},
Expand Down

0 comments on commit dede424

Please sign in to comment.