Skip to content

Commit 49bc843

Browse files
Merge pull request #1380 from suraj-webkul/fix-mail-datagrid
fix mail datagrid.
2 parents ac7a3a2 + f098a59 commit 49bc843

File tree

4 files changed

+83
-9
lines changed

4 files changed

+83
-9
lines changed

packages/Webkul/Admin/src/Resources/assets/css/app.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,12 @@
622622
/*--------------------------------- New UI CSS --------------------------------------------------------------- */
623623

624624
.sidebar-rounded::after {
625-
@apply w-[30px] h-[30px] top-[5px] right-[-30px] absolute rounded-tl-[58%] shadow-[-8px_-5px_0px_1px_rgba(255,255,255,1)] ;
626-
content: "";
627-
pointer-events: none;
625+
@apply w-[30px] h-[30px] top-[5px] right-[-30px] absolute rounded-tl-[58%] shadow-[-8px_-5px_0px_1px_rgba(255,255,255,1)] dark:shadow-[-8px_-5px_0px_1px_rgba(17,24,39,1)] ;
626+
content: "";
627+
pointer-events: none;
628628
}
629629

630+
630631
.tox.tox-silver-sink.tox-tinymce-aux {
631632
z-index: 99999;
632633
}

packages/Webkul/Admin/src/Resources/views/components/layouts/header/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class="block w-full rounded-3xl border bg-white px-10 py-1.5 leading-6 text-gray
8080
<!-- Link to send new Mail-->
8181
@if (bouncer()->hasPermission('mail.create'))
8282
<div class="rounded-lg bg-white p-2 hover:bg-gray-100">
83-
<a href="{{ route('admin.mail.index', ['route' => 'compose']) }}">
83+
<a href="{{ route('admin.mail.index', ['route' => 'inbox']) }}">
8484
<div class="flex flex-col gap-1">
8585
<i class="icon-mail text-2xl text-gray-600"></i>
8686

@@ -158,7 +158,7 @@ class="block w-full rounded-3xl border bg-white px-10 py-1.5 leading-6 text-gray
158158
<!-- Link to create new User-->
159159
@if (bouncer()->hasPermission('settings.user.users.create'))
160160
<div class="rounded-lg bg-white p-2 hover:bg-gray-100">
161-
<a href="{{ route('admin.settings.users.create') }}">
161+
<a href="{{ route('admin.settings.users.index') }}">
162162
<div class="flex flex-col gap-1">
163163
<i class="icon-user text-2xl text-gray-600"></i>
164164

packages/Webkul/Admin/src/Resources/views/mail/index.blade.php

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,69 @@ class="primary-button"
4949
{!! view_render_event('krayin.admin.mail.'.request('route').'.datagrid.before') !!}
5050
5151
<!-- DataGrid -->
52-
<x-admin::datagrid
52+
<!-- DataGrid -->
53+
<x-admin::datagrid
5354
ref="datagrid"
5455
src="{{ route('admin.mail.index', request('route')) }}"
55-
/>
56+
>
57+
<template #body="{
58+
isLoading,
59+
available,
60+
applied,
61+
selectAll,
62+
sort,
63+
performAction
64+
}">
65+
<template v-if="isLoading">
66+
<x-admin::shimmer.datagrid.table.body />
67+
</template>
68+
69+
<template v-else>
70+
<div
71+
v-for="record in available.records"
72+
class="row grid items-center gap-2.5 border-b px-4 py-4 text-gray-600 transition-all hover:bg-gray-50 dark:border-gray-800 dark:text-gray-300 dark:hover:bg-gray-950"
73+
:style="`grid-template-columns: repeat(${gridsCount}, minmax(0, 1fr))`"
74+
>
75+
<!-- Group ID -->
76+
<p>@{{ record.id }}</p>
77+
78+
<!-- Attachments -->
79+
<p
80+
:class="record.attachments ? 'icon-attachmetent' : ''"
81+
v-html="record.attachments"
82+
></p>
83+
84+
<!-- Name -->
85+
<p>@{{ record.name }}</p>
86+
87+
<!-- Subject -->
88+
<p v-html="record.subject"></p>
89+
90+
<!-- Created At -->
91+
<p v-html="record.created_at"></p>
92+
93+
<!-- Actions -->
94+
<div class="flex justify-end">
95+
<a @click="selectedMail=true; editModal(record.actions.find(action => action.index === 'edit'))">
96+
<span
97+
:class="record.actions.find(action => action.index === 'edit')?.icon"
98+
class="cursor-pointer rounded-md p-1.5 text-2xl transition-all hover:bg-gray-200 dark:hover:bg-gray-800 max-sm:place-self-center"
99+
>
100+
</span>
101+
</a>
102+
103+
<a @click="performAction(record.actions.find(action => action.index === 'delete'))">
104+
<span
105+
:class="record.actions.find(action => action.index === 'delete')?.icon"
106+
class="cursor-pointer rounded-md p-1.5 text-2xl transition-all hover:bg-gray-200 dark:hover:bg-gray-800 max-sm:place-self-center"
107+
>
108+
</span>
109+
</a>
110+
</div>
111+
</div>
112+
</template>
113+
</template>
114+
</x-admin::datagrid>
56115
57116
{!! view_render_event('krayin.admin.mail.'.request('route').'.datagrid.after') !!}
58117
@@ -268,6 +327,22 @@ class="primary-button"
268327
};
269328
},
270329
330+
computed: {
331+
gridsCount() {
332+
let count = this.$refs.datagrid.available.columns.length;
333+
334+
if (this.$refs.datagrid.available.actions.length) {
335+
++count;
336+
}
337+
338+
if (this.$refs.datagrid.available.massActions.length) {
339+
++count;
340+
}
341+
342+
return count;
343+
},
344+
},
345+
271346
methods: {
272347
toggleModal() {
273348
this.$refs.toggleComposeModal.toggle();

packages/Webkul/Admin/src/Routes/settings-routes.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@
148148
Route::controller(UserController::class)->prefix('users')->group(function () {
149149
Route::get('', 'index')->name('admin.settings.users.index');
150150

151-
Route::get('create', 'create')->name('admin.settings.users.create');
152-
153151
Route::post('create', 'store')->name('admin.settings.users.store');
154152

155153
Route::get('edit/{id?}', 'edit')->name('admin.settings.users.edit');

0 commit comments

Comments
 (0)