Skip to content

Issue #2285 has been fixed. #2325

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

Open
wants to merge 1 commit into
base: 2.1
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions packages/Webkul/Admin/src/DataGrids/Lead/LeadDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ public function prepareActions(): void
]);
}

if (bouncer()->hasPermission('leads.edit')) {
$this->addAction([
'icon' => 'icon-edit',
'title' => trans('admin::app.leads.index.datagrid.edit'),
'method' => 'GET',
'url' => fn ($row) => route('admin.leads.edit', $row->id),
]);
}

if (bouncer()->hasPermission('leads.delete')) {
$this->addAction([
'icon' => 'icon-delete',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ public function search(): JsonResource
{
$products = $this->productRepository
->pushCriteria(app(RequestCriteria::class))
->orderBy('created_at', 'desc')
->take(5)
->get();
->all();

return ProductResource::collection($products);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/ar/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,8 @@
'created-at' => 'تم الإنشاء في',
'no' => 'لا',
'yes' => 'نعم',
'view' => 'عرض',
'edit' => 'تعديل',
'delete' => 'حذف',
'mass-delete' => 'حذف جماعي',
'mass-update' => 'تحديث جماعي',
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,8 @@
'created-at' => 'Created At',
'no' => 'No',
'yes' => 'Yes',
'view' => 'View',
'edit' => 'Edit',
'delete' => 'Delete',
'mass-delete' => 'Mass Delete',
'mass-update' => 'Mass Update',
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/es/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,8 @@
'created-at' => 'Creado En',
'no' => 'No',
'yes' => 'Sí',
'view' => 'Ver',
'edit' => 'Editar',
'delete' => 'Eliminar',
'mass-delete' => 'Eliminar en Masa',
'mass-update' => 'Actualizar en Masa',
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/fa/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,8 @@
'created-at' => 'تاریخ ایجاد',
'no' => 'خیر',
'yes' => 'بله',
'view' => 'مشاهده',
'edit' => 'ویرایش',
'delete' => 'حذف',
'mass-delete' => 'حذف گروهی',
'mass-update' => 'به‌روزرسانی گروهی',
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,8 @@
'created-at' => 'Criado em',
'no' => 'Não',
'yes' => 'Sim',
'view' => 'Visualizar',
'edit' => 'Editar',
'delete' => 'Excluir',
'mass-delete' => 'Excluir em Massa',
'mass-update' => 'Atualizar em Massa',
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/tr/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,8 @@
'created-at' => 'Oluşturulma Tarihi',
'no' => 'Hayır',
'yes' => 'Evet',
'view' => 'Görüntüle',
'edit' => 'Düzenle',
'delete' => 'Sil',
'mass-delete' => 'Toplu Sil',
'mass-update' => 'Toplu Güncelle',
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Admin/src/Resources/lang/vi/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,8 @@
'stage' => 'Giai Đoạn',
'subject' => 'Chủ Đề',
'tag-name' => 'Tên Thẻ',
'view' => 'Xem',
'edit' => 'Chỉnh sửa',
'yes' => 'Có',
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class="relative inline-block w-full"
>
<!-- Input Container -->
<div
class="relative flex items-center justify-between rounded border border-gray-200 p-2 hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:text-gray-300"
class="relative flex items-center justify-between rounded border border-gray-200 p-2 hover:border-gray-400 focus:border-gray-400 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300"
:class="{
'bg-gray-50': isDisabled,
}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@
}
});
</script>
@endPushOnce
@endPushOnce
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="flex flex-col gap-4">
{!! view_render_event('admin.leads.create.products.form_controls.table.before') !!}

<div class="block w-full overflow-x-auto">
<div class="block w-full">
<!-- Table -->
<x-admin::table>
{!! view_render_event('admin.leads.create.products.form_controls.table.head.before') !!}
Expand Down Expand Up @@ -93,6 +93,7 @@ class="flex max-w-max items-center gap-2 text-brandColor"
::src="src"
::name="`${inputName}[name]`"
::params="params"
:preload="false"
:placeholder="trans('admin::app.leads.common.products.product-name')"
@on-selected="(product) => addProduct(product)"
::value="{ id: product.product_id, name: product.name }"
Expand Down Expand Up @@ -250,7 +251,7 @@ class="icon-delete cursor-pointer text-2xl"

this.product.name = result.name;

this.product.price = result.price;
this.product.price = result.price ?? 0;

this.product.quantity = result.quantity ?? 1;
},
Expand All @@ -266,4 +267,4 @@ class="icon-delete cursor-pointer text-2xl"
}
});
</script>
@endPushOnce
@endPushOnce
38 changes: 19 additions & 19 deletions packages/Webkul/Admin/src/Resources/views/leads/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
{!! view_render_event('admin.leads.edit.form_controls.before', ['lead' => $lead]) !!}

<!-- Edit Lead Form -->
<x-admin::form
<x-admin::form
:action="route('admin.leads.update', $lead->id)"
method="PUT"
>
<div class="flex flex-col gap-4">
<div class="flex items-center justify-between rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">
<div class="flex flex-col gap-2">
<x-admin::breadcrumbs
name="leads.edit"
<x-admin::breadcrumbs
name="leads.edit"
:entity="$lead"
/>

Expand Down Expand Up @@ -57,7 +57,7 @@ class="primary-button"
{!! view_render_event('admin.leads.edit.form_controls.after', ['lead' => $lead]) !!}

@pushOnce('scripts')
<script
<script
type="text/x-template"
id="v-lead-edit-template"
>
Expand Down Expand Up @@ -87,8 +87,8 @@ class="primary-button"
{!! view_render_event('admin.leads.edit.lead_details.before', ['lead' => $lead]) !!}

<!-- Details section -->
<div
class="flex flex-col gap-4"
<div
class="flex flex-col gap-4"
id="lead-details"
>
<div class="flex flex-col gap-1">
Expand Down Expand Up @@ -138,7 +138,7 @@ class="flex flex-col gap-4"
:entity="$lead"
/>
</div>

<div class="w-full">
<x-admin::attributes
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
Expand Down Expand Up @@ -166,8 +166,8 @@ class="flex flex-col gap-4"
{!! view_render_event('admin.leads.edit.contact_person.before', ['lead' => $lead]) !!}

<!-- Contact Person -->
<div
class="flex flex-col gap-4"
<div
class="flex flex-col gap-4"
id="contact-person"
>
<div class="flex flex-col gap-1">
Expand All @@ -191,8 +191,8 @@ class="flex flex-col gap-4"
{!! view_render_event('admin.leads.edit.contact_person.products.before', ['lead' => $lead]) !!}

<!-- Product Section -->
<div
class="flex flex-col gap-4"
<div
class="flex flex-col gap-4"
id="products"
>
<div class="flex flex-col gap-1">
Expand All @@ -213,7 +213,7 @@ class="flex flex-col gap-4"

{!! view_render_event('admin.leads.edit.contact_person.products.after', ['lead' => $lead]) !!}
</div>

{!! view_render_event('admin.leads.form_controls.after') !!}
</div>
</script>
Expand All @@ -225,10 +225,10 @@ class="flex flex-col gap-4"
data() {
return {
activeTab: 'lead-details',

lead: @json($lead),

person: @json($lead->person),
lead: @json($lead),

person: @json($lead->person),

products: @json($lead->products),

Expand All @@ -243,9 +243,9 @@ class="flex flex-col gap-4"
methods: {
/**
* Scroll to the section.
*
*
* @param {String} tabId
*
*
* @returns {void}
*/
scrollToSection(tabId) {
Expand All @@ -266,5 +266,5 @@ class="flex flex-col gap-4"
scroll-behavior: smooth;
}
</style>
@endPushOnce
</x-admin::layouts>
@endPushOnce
</x-admin::layouts>
Loading