Skip to content

Commit

Permalink
Fixed Conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-webkul committed Dec 16, 2024
2 parents a31355f + ce5baea commit 1d73d4b
Show file tree
Hide file tree
Showing 152 changed files with 1,178 additions and 787 deletions.
1 change: 1 addition & 0 deletions config/repository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
|--------------------------------------------------------------------------
| Prettus Repository Config
Expand Down
2 changes: 1 addition & 1 deletion packages/Webkul/Admin/src/Config/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
[
'key' => 'catalog',
'name' => 'admin::app.acl.catalog',
'route' => 'admin.catalog.index',
'route' => 'admin.catalog.products.index',
'sort' => 3,
], [
'key' => 'catalog.products',
Expand Down
28 changes: 28 additions & 0 deletions packages/Webkul/Admin/src/DataGrids/Catalog/AttributeDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ public function prepareColumns()
'searchable' => true,
'filterable' => true,
'sortable' => true,
'closure' => function ($row) {
if ($row->is_required) {
return trans('admin::app.catalog.attributes.index.datagrid.true');
}

return trans('admin::app.catalog.attributes.index.datagrid.false');
},
]);

$this->addColumn([
Expand All @@ -134,6 +141,13 @@ public function prepareColumns()
'searchable' => true,
'filterable' => true,
'sortable' => true,
'closure' => function ($row) {
if ($row->is_unique) {
return trans('admin::app.catalog.attributes.index.datagrid.true');
}

return trans('admin::app.catalog.attributes.index.datagrid.false');
},
]);

$this->addColumn([
Expand All @@ -143,6 +157,13 @@ public function prepareColumns()
'searchable' => true,
'filterable' => true,
'sortable' => true,
'closure' => function ($row) {
if ($row->value_per_locale) {
return trans('admin::app.catalog.attributes.index.datagrid.true');
}

return trans('admin::app.catalog.attributes.index.datagrid.false');
},
]);

$this->addColumn([
Expand All @@ -152,6 +173,13 @@ public function prepareColumns()
'searchable' => true,
'filterable' => true,
'sortable' => true,
'closure' => function ($row) {
if ($row->value_per_channel) {
return trans('admin::app.catalog.attributes.index.datagrid.true');
}

return trans('admin::app.catalog.attributes.index.datagrid.false');
},
]);

$this->addColumn([
Expand Down
18 changes: 14 additions & 4 deletions packages/Webkul/Admin/src/DataGrids/Catalog/CategoryDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,20 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.catalog.categories.index.datagrid.status'),
'type' => 'boolean',
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.catalog.categories.index.datagrid.status'),
'type' => 'boolean',
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.catalog.categories.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.catalog.categories.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status) {
Expand Down
18 changes: 14 additions & 4 deletions packages/Webkul/Admin/src/DataGrids/Catalog/ProductDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,20 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.catalog.products.index.datagrid.status'),
'type' => 'boolean',
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.catalog.products.index.datagrid.status'),
'type' => 'boolean',
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.catalog.products.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.catalog.products.index.datagrid.disable'),
'value' => 0,
],
],
'sortable' => true,
]);

Expand Down
18 changes: 14 additions & 4 deletions packages/Webkul/Admin/src/DataGrids/Customers/CustomerDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,20 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.customers.customers.index.datagrid.status'),
'type' => 'boolean',
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.customers.customers.index.datagrid.status'),
'type' => 'boolean',
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.customers.customers.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.customers.customers.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,22 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.marketing.communications.campaigns.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'sortable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.marketing.communications.campaigns.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'sortable' => true,
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.marketing.communications.campaigns.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.marketing.communications.campaigns.index.datagrid.inactive'),
'value' => 0,
],
],
'closure' => function ($value) {
if ($value->status) {
return trans('admin::app.marketing.communications.campaigns.index.datagrid.active');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,26 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.marketing.communications.templates.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.marketing.communications.templates.index.datagrid.status'),
'type' => 'string',
'searchable' => true,
'filterable' => true,
'filterable_type' => 'dropdown',
'filterable_options' => [
[
'label' => trans('admin::app.marketing.communications.templates.index.datagrid.active'),
'value' => 'active',
],
[
'label' => trans('admin::app.marketing.communications.templates.index.datagrid.inactive'),
'value' => 'inactive',
],
[
'label' => trans('admin::app.marketing.communications.templates.index.datagrid.draft'),
'value' => 'draft',
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status == 'active') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,28 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.marketing.promotions.cart-rules.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.marketing.promotions.cart-rules.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.marketing.promotions.cart-rules.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.marketing.promotions.cart-rules.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status == 1) {
return trans('admin::app.marketing.promotions.cart-rules.index.datagrid.active');
} elseif ($value->status == 0) {
return trans('admin::app.marketing.promotions.cart-rules.index.datagrid.inactive');
}

return trans('admin::app.marketing.promotions.cart-rules.index.datagrid.draft');
return trans('admin::app.marketing.promotions.cart-rules.index.datagrid.inactive');
},
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,21 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.marketing.promotions.catalog-rules.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.marketing.promotions.catalog-rules.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.marketing.promotions.catalog-rules.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.marketing.promotions.catalog-rules.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,21 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.settings.inventory-sources.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.settings.inventory-sources.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.settings.inventory-sources.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.settings.inventory-sources.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status) {
Expand Down
20 changes: 15 additions & 5 deletions packages/Webkul/Admin/src/DataGrids/Settings/UserDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,21 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.settings.users.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.settings.users.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.settings.users.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.settings.users.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status) {
Expand Down
20 changes: 15 additions & 5 deletions packages/Webkul/Admin/src/DataGrids/Theme/ThemeDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,21 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.settings.themes.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'index' => 'status',
'label' => trans('admin::app.settings.themes.index.datagrid.status'),
'type' => 'boolean',
'searchable' => true,
'filterable' => true,
'filterable_options' => [
[
'label' => trans('admin::app.settings.themes.index.datagrid.active'),
'value' => 1,
],
[
'label' => trans('admin::app.settings.themes.index.datagrid.inactive'),
'value' => 0,
],
],
'sortable' => true,
'closure' => function ($value) {
if ($value->status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,23 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest): JsonRespons
}
}

foreach ($indices as $index) {
Event::dispatch('catalog.attribute.delete.before', $index);
try {
foreach ($indices as $index) {
Event::dispatch('catalog.attribute.delete.before', $index);

$this->attributeRepository->delete($index);
$this->attributeRepository->delete($index);

Event::dispatch('catalog.attribute.delete.after', $index);
}
Event::dispatch('catalog.attribute.delete.after', $index);
}

return new JsonResponse([
'message' => trans('admin::app.catalog.attributes.index.datagrid.mass-delete-success'),
]);
return new JsonResponse([
'message' => trans('admin::app.catalog.attributes.index.datagrid.mass-delete-success'),
]);
} catch (\Exception $exception) {
return new JsonResponse([
'message' => trans('admin::app.catalog.attributes.delete-failed'),
], 500);
}
}

/**
Expand Down
Loading

0 comments on commit 1d73d4b

Please sign in to comment.