Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 fix: email issues #1987

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading