Skip to content

Commit

Permalink
Merge pull request #1987 from krayin/email-issue
Browse files Browse the repository at this point in the history
🔧 fix: email issues
  • Loading branch information
devansh-webkul authored Jan 20, 2025
2 parents 9e8c7ca + 53537f3 commit aac65f0
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 122 deletions.
2 changes: 1 addition & 1 deletion packages/Webkul/Admin/src/Config/core_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
[
'name' => 'password',
'title' => 'admin::app.configuration.index.email.imap.account.password',
'type' => 'text',
'type' => 'password',
'default' => config('imap.accounts.default.password'),
],
],
Expand Down
15 changes: 6 additions & 9 deletions packages/Webkul/Admin/src/DataGrids/Mail/EmailDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function prepareQueryBuilder(): Builder
->select(
'emails.id',
'emails.name',
'emails.from',
'emails.subject',
'emails.reply',
'emails.is_read',
Expand Down Expand Up @@ -54,15 +55,6 @@ public function prepareQueryBuilder(): Builder
*/
public function prepareColumns(): void
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.mail.index.datagrid.id'),
'type' => 'string',
'sortable' => true,
'searchable' => true,
'filterable' => true,
]);

$this->addColumn([
'index' => 'attachments',
'label' => trans('admin::app.mail.index.datagrid.attachments'),
Expand All @@ -80,6 +72,11 @@ public function prepareColumns(): void
'sortable' => true,
'searchable' => true,
'filterable' => true,
'closure' => function ($row) {
return $row->name
? trim($row->name, '"')
: trim($row->from, '"');
},
]);

$this->addColumn([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
></v-control-tags>

@pushOnce('scripts')
<script
type="text/x-template"
<script
type="text/x-template"
id="v-control-tags-template"
>
<div class="flex min-h-[38px] w-full items-center rounded border border-gray-200 px-2.5 py-1.5 text-sm font-normal text-gray-800 transition-all hover:border-gray-400 dark:border-gray-800 dark:text-white dark:hover:border-gray-400">
Expand Down Expand Up @@ -88,15 +88,47 @@ class="mt-1 text-xs italic text-red-600"
app.component('v-control-tags', {
template: '#v-control-tags-template',
props: [
'name',
'label',
'placeholder',
'rules',
'inputRules',
'data',
'errors',
],
props: {
name: {
type: String,
required: true,
},
label: {
type: String,
default: '',
},
placeholder: {
type: String,
default: '',
},
rules: {
type: String,
default: '',
},
inputRules: {
type: String,
default: '',
},
data: {
type: Array,
default: () => [],
},
errors: {
type: Object,
default: () => {},
},
allowDuplicates: {
type: Boolean,
default: true,
},
},
data: function () {
return {
Expand All @@ -118,6 +150,15 @@ class="mt-1 text-xs italic text-red-600"
return;
}
if (
! this.allowDuplicates
&& this.tags.includes(tag)
) {
this.input = '';
return;
}
this.tags.push(tag);
this.$emit('tags-updated', this.tags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class="icon-checkbox-outline peer-checked:icon-checkbox-select cursor-pointer ro
</div>
<p class="flex items-center gap-2 overflow-hidden text-ellipsis whitespace-nowrap leading-none">
<x-admin::avatar ::name="record.name" />
<x-admin::avatar ::name="record.name ?? record.from" />
@{{ record.name }}
</p>
Expand Down Expand Up @@ -288,6 +288,7 @@ class="w-[calc(100%-62px)]"
::data="draft.reply_to"
:label="trans('admin::app.mail.index.mail.to')"
:placeholder="trans('admin::app.mail.index.mail.enter-emails')"
::allow-duplicates="false"
/>
<div class="absolute top-[9px] flex items-center gap-2 ltr:right-2 rtl:left-2">
Expand Down
Loading

0 comments on commit aac65f0

Please sign in to comment.