Skip to content

Commit

Permalink
Merge pull request #1290 from shivendra-webkul/krayin-update
Browse files Browse the repository at this point in the history
Fix settings route and datagrid namespacing and fix groups and role pages
  • Loading branch information
jitendra-webkul authored Jul 24, 2024
2 parents db87a27 + e900102 commit 3491f26
Show file tree
Hide file tree
Showing 42 changed files with 794 additions and 441 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function prepareColumns(): void
public function prepareActions(): void
{
$this->addAction([
'index' => 'view',
'icon' => 'icon-dark',
'title' => trans('admin::app.products.index.datagrid.view'),
'method' => 'GET',
Expand All @@ -104,6 +105,7 @@ public function prepareActions(): void
]);

$this->addAction([
'index' => 'edit',
'icon' => 'icon-edit',
'title' => trans('admin::app.products.index.datagrid.edit'),
'method' => 'GET',
Expand All @@ -113,6 +115,7 @@ public function prepareActions(): void
]);

$this->addAction([
'index' => 'delete',
'icon' => 'icon-delete',
'title' => trans('admin::app.products.index.datagrid.delete'),
'method' => 'DELETE',
Expand Down
72 changes: 0 additions & 72 deletions packages/Webkul/Admin/src/DataGrids/Setting/SourceDataGrid.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Support\Facades\DB;
use Webkul\Admin\Traits\ProvideDropdownOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Support\Facades\DB;
use Webkul\DataGrid\DataGrid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Support\Facades\DB;
use Webkul\Admin\Traits\ProvideDropdownOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
Expand Down
72 changes: 72 additions & 0 deletions packages/Webkul/Admin/src/DataGrids/Settings/SourceDataGrid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
use Webkul\DataGrid\DataGrid;

class SourceDataGrid extends DataGrid
{
/**
* Prepare query builder.
*/
public function prepareQueryBuilder(): Builder
{
$queryBuilder = DB::table('lead_sources')
->addSelect(
'lead_sources.id',
'lead_sources.name'
);

$this->addFilter('id', 'lead_sources.id');

return $queryBuilder;
}

/**
* Add columns.
*/
public function prepareColumns(): void
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.settings.sources.index.datagrid.id'),
'type' => 'string',
'sortable' => true,
]);

$this->addColumn([
'index' => 'name',
'label' => trans('admin::app.settings.sources.index.datagrid.name'),
'type' => 'string',
'sortable' => true,
]);
}

/**
* Prepare actions.
*/
public function prepareActions(): void
{
$this->addAction([
'index' => 'edit',
'icon' => 'icon-edit',
'title' => trans('admin::app.settings.sources.index.datagrid.edit'),
'method' => 'GET',
'url' => function ($row) {
return route('admin.settings.sources.edit', $row->id);
},
]);

$this->addAction([
'index' => 'delete',
'icon' => 'icon-delete',
'title' => trans('admin::app.settings.sources.index.datagrid.delete'),
'method' => 'DELETE',
'url' => function ($row) {
return route('admin.settings.sources.delete', $row->id);
},
]);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Support\Facades\DB;
use Webkul\Admin\Traits\ProvideDropdownOptions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -31,7 +31,7 @@ public function prepareColumns(): void
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.datagrid.id'),
'label' => trans('admin::app.settings.types.index.datagrid.id'),
'type' => 'string',
'filterable' => true,
'sortable' => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Support\Facades\DB;
use Webkul\UI\DataGrid\DataGrid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\DataGrids\Setting;
namespace Webkul\Admin\DataGrids\Settings;

use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\DB;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Webkul\Admin\Http\Controllers\Setting;
namespace Webkul\Admin\Http\Controllers\Settings;

use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Storage;
Expand All @@ -25,7 +25,7 @@ public function __construct(protected AttributeRepository $attributeRepository)
public function index()
{
if (request()->ajax()) {
return app(\Webkul\Admin\DataGrids\Setting\AttributeDataGrid::class)->toJson();
return app(\Webkul\Admin\DataGrids\Settings\AttributeDataGrid::class)->toJson();
}

return view('admin::settings.attributes.index');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Webkul\Admin\Http\Controllers\Setting;
namespace Webkul\Admin\Http\Controllers\Settings;

use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Event;
use Illuminate\View\View;
use Webkul\Admin\DataGrids\Setting\EmailTemplateDataGrid;
use Webkul\Admin\DataGrids\Settings\EmailTemplateDataGrid;
use Webkul\Admin\Http\Controllers\Controller;
use Webkul\EmailTemplate\Repositories\EmailTemplateRepository;
use Webkul\Workflow\Helpers\Entity;
Expand Down
Loading

0 comments on commit 3491f26

Please sign in to comment.