From bcf05fcb3bc8704a6bf99b8e1b282dd6f8a00ece Mon Sep 17 00:00:00 2001 From: suraj kashyap Date: Wed, 13 Sep 2023 11:31:42 +0530 Subject: [PATCH] Issue #8228 fixed. --- .../assets/js/directives/slugify-target.js | 6 +++ .../views/catalog/categories/create.blade.php | 2 +- .../views/catalog/categories/edit.blade.php | 47 +++++++++++++------ .../catalog/products/edit/controls.blade.php | 2 +- .../views/components/form/index.blade.php | 2 +- 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/packages/Webkul/Admin/src/Resources/assets/js/directives/slugify-target.js b/packages/Webkul/Admin/src/Resources/assets/js/directives/slugify-target.js index 13d337ea189..0880a44c4fb 100755 --- a/packages/Webkul/Admin/src/Resources/assets/js/directives/slugify-target.js +++ b/packages/Webkul/Admin/src/Resources/assets/js/directives/slugify-target.js @@ -16,6 +16,12 @@ export default { // avoid having multiple dashes (---- translates into -) .replace('![-\s]+!u', '-') .trim(); + + if (binding.value) { + binding.value({ + [binding.arg]: target.value + }); + } }, 100); }; diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php index e3714b28ecf..69ee05bbc3a 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php @@ -73,7 +73,7 @@ class="primary-button" :class="[errors['{{ 'name' }}'] ? 'border border-red-600 hover:border-red-600' : '']" class="flex w-full min-h-[39px] py-2 px-3 border rounded-[6px] text-[14px] text-gray-600 transition-all hover:border-gray-400 focus:border-gray-400" placeholder="{{ trans('admin::app.catalog.categories.create.company-name') }}" - v-slugify-target:slug + v-slugify-target:slug="setValues" > diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php index 02864aeda5d..3631560c9cb 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php @@ -93,19 +93,28 @@ class="flex gap-[10px] px-5 py-2 text-[16px] cursor-pointer hover:bg-gray-100 {{ @lang('admin::app.catalog.categories.edit.company-name') - - + code . '[slug]'}}="setValues" + > + @@ -240,21 +249,31 @@ class="description" {{-- Slug --}} - @lang('admin::app.catalog.categories.create.slug') + @lang('admin::app.catalog.categories.edit.slug') - - + + diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit/controls.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit/controls.blade.php index a25deb520c3..fae99d01de8 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/products/edit/controls.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/edit/controls.blade.php @@ -16,7 +16,7 @@ :class="[errors['{{ $attribute->code }}'] ? 'border border-red-600 hover:border-red-600' : '']" class="flex w-full min-h-[39px] py-2 px-3 border rounded-[6px] text-[14px] text-gray-600 transition-all hover:border-gray-400 focus:border-gray-400" @if ($attribute->code == 'url_key') v-slugify @endif - @if ($attribute->code == 'name') v-slugify-target:url_key @endif + @if ($attribute->code == 'name') v-slugify-target:url_key="setValues" @endif > diff --git a/packages/Webkul/Admin/src/Resources/views/components/form/index.blade.php b/packages/Webkul/Admin/src/Resources/views/components/form/index.blade.php index 198e87dba3e..d278c42c0c5 100644 --- a/packages/Webkul/Admin/src/Resources/views/components/form/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/components/form/index.blade.php @@ -23,7 +23,7 @@ @unless(in_array($method, ['HEAD', 'GET', 'OPTIONS']))