Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
shivendra-webkul committed Aug 14, 2024
2 parents 831f589 + 48da2b1 commit a487600
Show file tree
Hide file tree
Showing 17 changed files with 1,424 additions and 101 deletions.
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/Webkul/Activity/src/Traits/LogsActivity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Webkul\Activity\Traits;

trait LogsActivity
{
/**
* The "booted" method of the model.
*/
protected static function booted(): void
{
static::updated(function ($model) {
dd($model);
});
}
}
108 changes: 106 additions & 2 deletions packages/Webkul/Admin/src/Http/Controllers/Lead/LeadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
use Webkul\Admin\Http\Resources\StageResource;
use Webkul\Lead\Repositories\LeadRepository;
use Webkul\Lead\Repositories\PipelineRepository;
use Webkul\Lead\Repositories\SourceRepository;
use Webkul\Lead\Repositories\StageRepository;
use Webkul\Lead\Repositories\TypeRepository;
use Webkul\User\Repositories\UserRepository;

class LeadController extends Controller
{
Expand All @@ -23,6 +26,9 @@ class LeadController extends Controller
* @return void
*/
public function __construct(
protected UserRepository $userRepository,
protected SourceRepository $sourceRepository,
protected TypeRepository $typeRepository,
protected LeadRepository $leadRepository,
protected PipelineRepository $pipelineRepository,
protected StageRepository $stageRepository
Expand All @@ -41,13 +47,107 @@ public function index()
return datagrid(LeadDataGrid::class)->process();
}

$columns = [
[
'index' => 'id',
'label' => trans('admin::app.leads.index.kanban.columns.id'),
'type' => 'integer',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => null,
'filterable_options' => [],
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
[
'index' => 'lead_value',
'label' => trans('admin::app.leads.index.kanban.columns.lead-value'),
'type' => 'string',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => null,
'filterable_options' => [],
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
[
'index' => 'user_id',
'label' => trans('admin::app.leads.index.kanban.columns.sales-person'),
'type' => 'string',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => 'dropdown',
'filterable_options' => $this->userRepository->all(['name as label', 'id as value'])->toArray(),
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
[
'index' => 'person.name',
'label' => trans('admin::app.leads.index.kanban.columns.contact-person'),
'type' => 'string',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => null,
'filterable_options' => [],
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
[
'index' => 'lead_type_id',
'label' => trans('admin::app.leads.index.kanban.columns.lead-type'),
'type' => 'string',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => 'dropdown',
'filterable_options' => $this->typeRepository->all(['name as label', 'id as value'])->toArray(),
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
[
'index' => 'lead_source_id',
'label' => trans('admin::app.leads.index.kanban.columns.source'),
'type' => 'string',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => 'dropdown',
'filterable_options' => $this->sourceRepository->all(['name as label', 'id as value'])->toArray(),
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
[
'index' => 'tags.name',
'label' => trans('admin::app.leads.index.kanban.columns.tags'),
'type' => 'string',
'searchable' => false,
'search_field' => 'in',
'filterable' => true,
'filterable_type' => null,
'filterable_options' => [],
'allow_multiple_values' => true,
'sortable' => true,
'visibility' => true,
],
];

if (request('pipeline_id')) {
$pipeline = $this->pipelineRepository->find(request('pipeline_id'));
} else {
$pipeline = $this->pipelineRepository->getDefaultPipeline();
}

return view('admin::leads.index', compact('pipeline'));
return view('admin::leads.index', compact('columns', 'pipeline'));
}

/**
Expand All @@ -70,7 +170,11 @@ public function get()
}

foreach ($stages as $stage) {
$query = $this->leadRepository
/**
* We have to create a new instance of the lead repository every time, which is
* why we're not using the injected one.
*/
$query = app(LeadRepository::class)
->pushCriteria(app(RequestCriteria::class))
->where([
'lead_pipeline_id' => $pipeline->id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function registerFacades(): void
$loader->alias('Bouncer', \Webkul\Admin\Facades\Bouncer::class);

$this->app->singleton('bouncer', function () {
return new \Webkul\Admin\Bouncer();
return new \Webkul\Admin\Bouncer;
});
}

Expand Down
25 changes: 23 additions & 2 deletions packages/Webkul/Admin/src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@
'sku' => 'SKU',
'all' => 'All',
'notes' => 'Notes',
'files' => 'Files',
'inventories' => 'Inventory',

'attributes' => [
Expand Down Expand Up @@ -1543,9 +1544,29 @@
],

'kanban' => [
'columns' => [
'contact-person' => 'Contact Person',
'id' => 'ID',
'lead-type' => 'Lead Type',
'lead-value' => 'Lead Value',
'sales-person' => 'Sales Person',
'source' => 'Source',
'title' => 'Title',
'tags' => 'Tags',
],

'toolbar' => [
'filter' => 'Filter',
'filters' => 'Filters',
'search' => [
'title' => 'Search',
],

'filters' => [
'apply-filters' => 'Apply Filters',
'clear-all' => 'Clear All',
'filter' => 'Filter',
'filters' => 'Filters',
'select' => 'Select',
],
],
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
<i class="icon-menu hidden cursor-pointer rounded-md p-1.5 text-2xl hover:bg-gray-100 dark:hover:bg-gray-950 max-lg:block"></i>

<a href="{{ route('admin.dashboard.index') }}">
{{-- <img
src="{{ admin_vite()->asset('images/logo.svg') }}"
alt="{{ config('app.name') }}"
/> --}}

{{-- <img
class="h-10"
src="{{ Storage::url($logo) }}"
alt="{{ config('app.name') }}"
/> --}}

<img
class="h-10"
src="{{ request()->cookie('dark_mode') ? admin_vite()->asset('images/dark-logo.svg') : admin_vite()->asset('images/logo.svg') }}"
Expand Down
Loading

0 comments on commit a487600

Please sign in to comment.