Skip to content
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

marketing events. #1699

Merged
merged 27 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0455cdd
marketing events.
suraj-webkul Nov 4, 2024
5c7247a
Minor changes.
suraj-webkul Nov 4, 2024
e16223b
refactor the codebase.
suraj-webkul Nov 4, 2024
dd467c9
add migration and model for campaigns.
suraj-webkul Nov 4, 2024
d2a8611
refactor.
suraj-webkul Nov 4, 2024
bc27e13
Minor changes.
suraj-webkul Nov 4, 2024
736f781
marketing campaigns
suraj-webkul Nov 4, 2024
3a71184
fix linting test cases.
suraj-webkul Nov 4, 2024
d5802f7
Campaigns create.
suraj-webkul Nov 5, 2024
75b6ab2
Campaign crud completed.
suraj-webkul Nov 5, 2024
828bbbb
implement the acl to marketing.
suraj-webkul Nov 5, 2024
36ffbbe
Impletement the acl.
suraj-webkul Nov 5, 2024
91bd984
refactor the acl.
suraj-webkul Nov 5, 2024
fdf72c5
refactor and add delete and mass delete functionality.
suraj-webkul Nov 5, 2024
bc5c9fb
campaigns refactor.
suraj-webkul Nov 5, 2024
f2872c6
Campaigns console command added.
suraj-webkul Nov 5, 2024
7325c0f
fix failed testcases.
suraj-webkul Nov 5, 2024
87b0eee
Code Refactor.
suraj-webkul Nov 5, 2024
5002d77
add missing comment.
suraj-webkul Nov 5, 2024
9cfc673
add translation.
suraj-webkul Nov 6, 2024
9e194c9
Resolved conflicts.
amit-webkul Dec 20, 2024
c8d31dd
Merge remote-tracking branch 'origin/master' into marketing-communica…
amit-webkul Jan 13, 2025
332d672
Fixed Pint issue.
amit-webkul Jan 13, 2025
d902a6d
Fixed Pint issue.
amit-webkul Jan 13, 2025
12da445
Added Limitation on event title from front and backend.
amit-webkul Jan 15, 2025
03273d0
Merge branch 'master' into marketing-communication
devansh-webkul Jan 17, 2025
a79c554
Merge branch 'master' into marketing-communication
devansh-webkul Jan 17, 2025
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"Webkul\\DataTransfer\\": "packages/Webkul/DataTransfer/src",
"Webkul\\Email\\": "packages/Webkul/Email/src",
"Webkul\\EmailTemplate\\": "packages/Webkul/EmailTemplate/src",
"Webkul\\Marketing\\": "packages/Webkul/Marketing/src",
"Webkul\\Installer\\": "packages/Webkul/Installer/src",
"Webkul\\Lead\\": "packages/Webkul/Lead/src",
"Webkul\\Product\\": "packages/Webkul/Product/src",
Expand Down
1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
Webkul\DataTransfer\Providers\DataTransferServiceProvider::class,
Webkul\EmailTemplate\Providers\EmailTemplateServiceProvider::class,
Webkul\Email\Providers\EmailServiceProvider::class,
Webkul\Marketing\Providers\MarketingServiceProvider::class,
Webkul\Installer\Providers\InstallerServiceProvider::class,
Webkul\Lead\Providers\LeadServiceProvider::class,
Webkul\Product\Providers\ProductServiceProvider::class,
Expand Down
51 changes: 45 additions & 6 deletions packages/Webkul/Admin/src/Config/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'name' => 'admin::app.layouts.dashboard',
'route' => 'admin.dashboard.index',
'sort' => 1,
], [
], [
'key' => 'leads',
'name' => 'admin::app.acl.leads',
'route' => 'admin.leads.index',
Expand Down Expand Up @@ -56,7 +56,7 @@
'name' => 'admin::app.acl.delete',
'route' => ['admin.quotes.delete', 'admin.quotes.mass_delete'],
'sort' => 4,
], [
], [
'key' => 'mail',
'name' => 'admin::app.acl.mail',
'route' => 'admin.mail.index',
Expand Down Expand Up @@ -131,7 +131,7 @@
'name' => 'admin::app.acl.contacts',
'route' => 'admin.contacts.users.index',
'sort' => 6,
], [
], [
'key' => 'contacts.persons',
'name' => 'admin::app.acl.persons',
'route' => 'admin.contacts.persons.index',
Expand Down Expand Up @@ -176,7 +176,7 @@
'name' => 'admin::app.acl.delete',
'route' => ['admin.contacts.organizations.delete', 'admin.contacts.organizations.mass_delete'],
'sort' => 3,
], [
], [
'key' => 'products',
'name' => 'admin::app.acl.products',
'route' => 'admin.products.index',
Expand Down Expand Up @@ -401,8 +401,47 @@
'name' => 'admin::app.acl.delete',
'route' => 'admin.settings.workflows.delete',
'sort' => 3,
],
[
], [
'key' => 'settings.automation.events',
'name' => 'admin::app.acl.event',
'route' => 'admin.settings.marketing.events.index',
'sort' => 2,
], [
'key' => 'settings.automation.events.create',
'name' => 'admin::app.acl.create',
'route' => ['admin.settings.marketing.events.create', 'admin.settings.marketing.events.store'],
'sort' => 1,
], [
'key' => 'settings.automation.events.edit',
'name' => 'admin::app.acl.edit',
'route' => ['admin.settings.marketing.events.edit', 'admin.settings.marketing.events.update'],
'sort' => 2,
], [
'key' => 'settings.automation.events.delete',
'name' => 'admin::app.acl.delete',
'route' => ['admin.settings.marketing.events.delete', 'admin.settings.marketing.events.mass_delete'],
'sort' => 3,
], [
'key' => 'settings.automation.campaigns',
'name' => 'admin::app.acl.campaigns',
'route' => 'admin.settings.marketing.campaigns.index',
'sort' => 2,
], [
'key' => 'settings.automation.campaigns.create',
'name' => 'admin::app.acl.create',
'route' => ['admin.settings.marketing.campaigns.create', 'admin.settings.marketing.campaigns.store'],
'sort' => 1,
], [
'key' => 'settings.automation.campaigns.edit',
'name' => 'admin::app.acl.edit',
'route' => ['admin.settings.marketing.campaigns.edit', 'admin.settings.marketing.campaigns.update'],
'sort' => 2,
], [
'key' => 'settings.automation.campaigns.delete',
'name' => 'admin::app.acl.delete',
'route' => ['admin.settings.marketing.campaigns.delete', 'admin.settings.marketing.campaigns.mass_delete'],
'sort' => 3,
], [
'key' => 'settings.automation.webhooks',
'name' => 'admin::app.acl.webhook',
'route' => 'admin.settings.webhooks.index',
Expand Down
14 changes: 14 additions & 0 deletions packages/Webkul/Admin/src/Config/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,20 @@
'route' => 'admin.settings.email_templates.index',
'sort' => 2,
'icon-class' => 'icon-settings-mail',
], [
'key' => 'settings.automation.events',
'name' => 'admin::app.layouts.events',
'info' => 'admin::app.layouts.events-info',
'route' => 'admin.settings.marketing.events.index',
'sort' => 2,
'icon-class' => 'icon-calendar',
], [
'key' => 'settings.automation.campaigns',
'name' => 'admin::app.layouts.campaigns',
'info' => 'admin::app.layouts.campaigns-info',
'route' => 'admin.settings.marketing.campaigns.index',
'sort' => 2,
'icon-class' => 'icon-note',
], [
'key' => 'settings.automation.webhooks',
'name' => 'admin::app.layouts.webhooks',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php

namespace Webkul\Admin\DataGrids\Settings\Marketing;

use Illuminate\Support\Facades\DB;
use Webkul\DataGrid\DataGrid;

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

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

return $queryBuilder;
}

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

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

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

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

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

if (bouncer()->hasPermission('settings.automation.campaigns.delete')) {
$this->addAction([
'index' => 'delete',
'icon' => 'icon-delete',
'title' => trans('admin::app.settings.marketing.campaigns.index.datagrid.delete'),
'method' => 'DELETE',
'url' => fn ($row) => route('admin.settings.marketing.campaigns.delete', $row->id),
]);
}
}

/**
* Prepare mass actions.
*/
public function prepareMassActions(): void
{
if (bouncer()->hasPermission('settings.automation.campaigns.mass_delete')) {
$this->addMassAction([
'icon' => 'icon-delete',
'title' => trans('admin::app.settings.marketing.campaigns.index.datagrid.delete'),
'method' => 'POST',
'url' => route('admin.settings.marketing.campaigns.mass_delete'),
]);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php

namespace Webkul\Admin\DataGrids\Settings\Marketing;

use Illuminate\Support\Facades\DB;
use Webkul\DataGrid\DataGrid;

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

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

return $queryBuilder;
}

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

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

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

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

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

if (bouncer()->hasPermission('settings.automation.events.delete')) {
$this->addAction([
'index' => 'delete',
'icon' => 'icon-delete',
'title' => trans('admin::app.settings.marketing.events.index.datagrid.delete'),
'method' => 'DELETE',
'url' => fn ($row) => route('admin.settings.marketing.events.delete', $row->id),
]);
}
}

/**
* Prepare mass actions.
*/
public function prepareMassActions(): void
{
if (bouncer()->hasPermission('settings.automation.events.delete')) {
$this->addMassAction([
'icon' => 'icon-delete',
'title' => trans('admin::app.settings.marketing.events.index.datagrid.delete'),
'method' => 'POST',
'url' => route('admin.settings.marketing.events.mass_delete'),
]);
}
}
}
Loading
Loading