Skip to content

Commit 5c1d47c

Browse files
Merge pull request #2100 from amit-webkul/translation
Fixing email tags validation issue.
2 parents 1e4a068 + 1235cc5 commit 5c1d47c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

packages/Webkul/Admin/src/Resources/views/components/form/control-group/controls/tags.blade.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ class="flex flex-wrap items-center gap-1"
1818
v-bind="$attrs"
1919
>
2020
<li
21-
class="flex items-center gap-1 rounded-md bg-gray-100 dark:bg-gray-950 ltr:pl-2 rtl:pr-2"
2221
v-for="(tag, index) in tags"
22+
:key="index"
23+
class="flex items-center gap-1 rounded-md bg-gray-100 dark:bg-gray-950 ltr:pl-2 rtl:pr-2"
2324
>
2425
<x-admin::form.control-group.control
2526
type="hidden"
@@ -40,7 +41,7 @@ class="icon-cross-large cursor-pointer p-0.5 text-xl"
4041
v-slot="{ field, errors }"
4142
:name="'temp-' + name"
4243
v-model="input"
43-
:rules="inputRules"
44+
:rules="tags.length ? inputRules : [inputRules, rules].filter(Boolean).join('|')"
4445
:label="label"
4546
>
4647
<input
@@ -61,7 +62,7 @@ class="w-full dark:!bg-gray-900"
6162
v-slot="{ field, errors }"
6263
:name="name + '[' + 0 +']'"
6364
:value="input"
64-
:rules="rules"
65+
:rules="inputRules"
6566
:label="label"
6667
>
6768
<input
@@ -101,7 +102,7 @@ class="mt-1 text-xs italic text-red-600"
101102
'errors',
102103
],
103104
104-
data: function () {
105+
data() {
105106
return {
106107
tags: this.data ? this.data : [],
107108
@@ -110,7 +111,7 @@ class="mt-1 text-xs italic text-red-600"
110111
},
111112
112113
methods: {
113-
addTag: function() {
114+
addTag() {
114115
if (this.errors['temp-' + this.name]) {
115116
return;
116117
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ class="!font-normal"
279279
<x-admin::form.control-group.controls.tags
280280
name="reply_to"
281281
class="w-[calc(100%-62px)]"
282-
input-rules="email|required"
282+
input-rules="email"
283+
rules="required"
283284
::data="draft.reply_to"
284285
:label="trans('admin::app.mail.index.mail.to')"
285286
:placeholder="trans('admin::app.mail.index.mail.enter-emails')"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ class="flex cursor-pointer items-center gap-2 text-brandColor"
357357
<div class="relative">
358358
<x-admin::form.control-group.controls.tags
359359
name="reply_to"
360-
rules="required"
361360
input-rules="email"
361+
rules="required"
362362
::data="reply_to"
363363
:label="trans('admin::app.mail.view.to')"
364364
:placeholder="trans('admin::app.mail.view.enter-mails')"

0 commit comments

Comments
 (0)