Skip to content

Commit

Permalink
Merge branch 'master' into dummy-skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-webkul committed Sep 26, 2023
2 parents c6c1027 + 20cd1ce commit 3996a59
Show file tree
Hide file tree
Showing 123 changed files with 1,996 additions and 2,018 deletions.
Empty file added .rr.yaml
Empty file.
10 changes: 10 additions & 0 deletions packages/Webkul/Admin/src/Config/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@
'name' => 'admin::app.acl.create',
'route' => 'admin.sales.refunds.create',
'sort' => 2,
], [
'key' => 'sales.transactions',
'name' => 'admin::app.acl.transactions',
'route' => 'admin.sales.transactions.index',
'sort' => 5,
],[
'key' => 'sales.transactions.view',
'name' => 'admin::app.acl.view',
'route' => 'admin.sales.transactions.view',
'sort' => 1,
],

/*
Expand Down
38 changes: 21 additions & 17 deletions packages/Webkul/Admin/src/DataGrids/Customers/AddressDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,27 @@ public function prepareColumns()
*/
public function prepareActions()
{
$this->addAction([
'icon' => 'icon-edit',
'title' => trans('admin::app.customers.addresses.datagrid.edit'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.customers.customers.addresses.edit', $row->address_id);
},
]);

$this->addAction([
'icon' => 'icon-delete',
'title' => trans('admin::app.customers.addresses.datagrid.delete'),
'method' => 'POST',
'url' => function ($row) {
return route('admin.customers.customers.addresses.delete', $row->address_id);
},
]);
if (bouncer()->hasPermission('customers.addresses.edit')) {
$this->addAction([
'icon' => 'icon-edit',
'title' => trans('admin::app.customers.addresses.datagrid.edit'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.customers.customers.addresses.edit', $row->address_id);
},
]);
}

if (bouncer()->hasPermission('customers.addresses.delete')) {
$this->addAction([
'icon' => 'icon-delete',
'title' => trans('admin::app.customers.addresses.datagrid.delete'),
'method' => 'POST',
'url' => function ($row) {
return route('admin.customers.customers.addresses.delete', $row->address_id);
},
]);
}
}

/**
Expand Down
44 changes: 24 additions & 20 deletions packages/Webkul/Admin/src/DataGrids/Customers/CustomerDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,26 +212,30 @@ public function prepareActions()
*/
public function prepareMassActions()
{
$this->addMassAction([
'title' => trans('admin::app.customers.customers.index.datagrid.delete'),
'method' => 'POST',
'url' => route('admin.customers.customers.mass_delete'),
]);

$this->addMassAction([
'title' => trans('admin::app.customers.customers.index.datagrid.update-status'),
'method' => 'POST',
'url' => route('admin.customers.customers.mass_update'),
'options' => [
[
'name' => trans('admin::app.customers.customers.index.datagrid.active'),
'value' => 1,
if (bouncer()->hasPermission('customers.customers.mass-delete')) {
$this->addMassAction([
'title' => trans('admin::app.customers.customers.index.datagrid.delete'),
'method' => 'POST',
'url' => route('admin.customers.customers.mass_delete'),
]);
}

if (bouncer()->hasPermission('customers.customers.mass-update')) {
$this->addMassAction([
'title' => trans('admin::app.customers.customers.index.datagrid.update-status'),
'method' => 'POST',
'url' => route('admin.customers.customers.mass_update'),
'options' => [
[
'name' => trans('admin::app.customers.customers.index.datagrid.active'),
'value' => 1,
],
[
'name' => trans('admin::app.customers.customers.index.datagrid.inactive'),
'value' => 0,
],
],
[
'name' => trans('admin::app.customers.customers.index.datagrid.inactive'),
'value' => 0,
],
],
]);
]);
}
}
}
50 changes: 27 additions & 23 deletions packages/Webkul/Admin/src/DataGrids/Customers/ReviewDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,30 +172,34 @@ public function prepareActions()
*/
public function prepareMassActions()
{
$this->addMassAction([
'title' => trans('admin::app.customers.reviews.index.datagrid.delete'),
'url' => route('admin.customers.customers.review.mass_delete'),
'method' => 'POST',
]);
if (bouncer()->hasPermission('customers.reviews.mass-delete')) {
$this->addMassAction([
'title' => trans('admin::app.customers.reviews.index.datagrid.delete'),
'url' => route('admin.customers.customers.review.mass_delete'),
'method' => 'POST',
]);
}

$this->addMassAction([
'title' => trans('admin::app.customers.reviews.index.datagrid.update-status'),
'method' => 'POST',
'url' => route('admin.customers.customers.review.mass_update'),
'options' => [
[
'name' => trans('admin::app.customers.reviews.index.datagrid.pending'),
'value' => 'pending',
],
[
'name' => trans('admin::app.customers.reviews.index.datagrid.approved'),
'value' => 'approved',
if (bouncer()->hasPermission('customers.reviews.mass-update')) {
$this->addMassAction([
'title' => trans('admin::app.customers.reviews.index.datagrid.update-status'),
'method' => 'POST',
'url' => route('admin.customers.customers.review.mass_update'),
'options' => [
[
'name' => trans('admin::app.customers.reviews.index.datagrid.pending'),
'value' => 'pending',
],
[
'name' => trans('admin::app.customers.reviews.index.datagrid.approved'),
'value' => 'approved',
],
[
'name' => trans('admin::app.customers.reviews.index.datagrid.disapproved'),
'value' => 'disapproved',
],
],
[
'name' => trans('admin::app.customers.reviews.index.datagrid.disapproved'),
'value' => 'disapproved',
],
],
]);
]);
}
}
}
18 changes: 10 additions & 8 deletions packages/Webkul/Admin/src/DataGrids/Sales/OrderDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@ public function prepareColumns()
*/
public function prepareActions()
{
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.orders.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.orders.view', $row->id);
},
]);
if (bouncer()->hasPermission('sales.orders.view')) {
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.orders.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.orders.view', $row->id);
},
]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ public function prepareColumns()
*/
public function prepareActions()
{
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.invoices.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.invoices.view', $row->id);
},
]);
if (bouncer()->hasPermission('sales.invoices.view')) {
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.invoices.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.invoices.view', $row->id);
},
]);
}
}
}
18 changes: 10 additions & 8 deletions packages/Webkul/Admin/src/DataGrids/Sales/OrderRefundDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ public function prepareColumns()
*/
public function prepareActions()
{
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.refunds.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.refunds.view', $row->id);
},
]);
if (bouncer()->hasPermission('sales.refunds.view')) {
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.refunds.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.refunds.view', $row->id);
},
]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ public function prepareColumns()
*/
public function prepareActions()
{
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.shipments.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.shipments.view', $row->shipment_id);
},
]);
if (bouncer()->hasPermission('sales.shipments.view')) {
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.shipments.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.shipments.view', $row->shipment_id);
},
]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ public function prepareColumns()
*/
public function prepareActions()
{
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.transactions.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.transactions.view', $row->id);
},
]);
if (bouncer()->hasPermission('sales.shipments.view')) {
$this->addAction([
'icon' => 'icon-view',
'title' => trans('admin::app.sales.transactions.index.datagrid.view'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.sales.transactions.view', $row->id);
},
]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,14 @@ public function search()
$results = [];

request()->query->add([
'name' => request('query'),
'sort' => 'created_at',
'order' => 'desc',
'status' => null,
'visible_individually' => null,
'name' => request('query'),
'sort' => 'created_at',
'order' => 'desc',
]);

$products = $this->productRepository->getAll();
$products = $this->productRepository->searchFromDatabase();

foreach ($products as $product) {
$results[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function toArray($request)
'id' => $this->id,
'code' => $this->code,
'type' => $this->type,
'name' => $this->name ?? $this->admin_name,
'name' => $this->admin_name,
'options' => AttributeOptionResource::collection($this->options),
];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/Webkul/Admin/src/Resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { createApp } from "vue/dist/vue.esm-bundler";
import { configure, defineRule } from "vee-validate";
import { localize } from "@vee-validate/i18n";
import en from "@vee-validate/i18n/dist/locale/en.json";
import AllRules from "@vee-validate/rules";
import * as AllRules from '@vee-validate/rules';

/**
* Registration of all global validators.
*/
Object.keys(AllRules).forEach((rule) => {
Object.keys(AllRules).forEach(rule => {
defineRule(rule, AllRules[rule]);
});

Expand Down
Loading

0 comments on commit 3996a59

Please sign in to comment.