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

initial commit for v2.2.2 #312

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ It packs with lots of demanding features that allows your business to scale in n

### 2. Requirements:

* **Bagisto**: v2.1.2
* **Bagisto**: v2.2.2
* **Bagisto Rest API**: v2.1

### 3. Installation:
* Note: Make sure Bagisto Rest API v2.1 installed and configured. If not then install and confiure using the following link.
* Note: Make sure Bagisto Rest API v2.1 installed and configured. If not then install and configure using the following link.

```
https://github.com/bagisto/rest-api
Expand Down
8 changes: 4 additions & 4 deletions src/Config/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

return [
[
'key' => 'ViewPushNotification',
'name' => 'pwa::app.admin.system.pushnotification',
'route' => 'admin.pwa.pushnotification.index',
'key' => 'viewPushNotification',
'name' => 'pwa::app.admin.layouts.push-notification',
'route' => 'admin.pwa.push-notification.index',
'sort' => 3,
],
];
];
16 changes: 9 additions & 7 deletions src/Config/admin-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

return [
[
'key' => 'PWA',
'key' => 'pwa',
'name' => 'pwa::app.admin.system.pwa_full_name',
'route' => 'admin.pwa.pushnotification.index',
'route' => 'admin.pwa.push-notification.index',
'sort' => 8,
'icon' => 'pwa-icon',
], [
'key' => 'PWA.index',
'route' => 'admin.pwa.pushnotification.index',
'key' => 'pwa.index',
'name' => 'pwa::app.admin.layouts.push-notification',
'route' => 'admin.pwa.push-notification.index',
'icon' => '',
'sort' => 1,
], [
'key' => 'PWA.layout',
'route' => 'admin.pwa.layout',
'key' => 'pwa.layout',
'name' => 'pwa::app.admin.layouts.title',
'sort' => 1,
'route' => 'admin.pwa.layout',
'icon' => '',
'sort' => 2,
],
];
15 changes: 11 additions & 4 deletions src/Config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
[
'key' => 'pwa',
'name' => 'pwa::app.admin.system.pwa',
'info' => 'pwa::app.admin.system.sytem-info',
'info' => 'pwa::app.admin.system.system-info',
'sort' => 1,
], [
'key' => 'pwa.settings',
'name' => 'pwa::app.admin.system.settings',
'info' => 'pwa::app.admin.system.settings',
'icon' => 'settings/settings.svg',
'sort' => 1,
], [
Expand All @@ -23,7 +24,8 @@
'type' => '',
],
],
], [
],
[
'key' => 'pwa.settings.general',
'name' => 'pwa::app.admin.system.general',
'info' => 'pwa::app.admin.system.pwa',
Expand All @@ -33,7 +35,9 @@
'name' => 'status',
'title' => 'pwa::app.admin.system.status',
'type' => 'boolean',
], [
'channel_based' => true,
'locale_based' => false,
], [
'name' => 'name',
'title' => 'pwa::app.admin.system.name',
'type' => 'text',
Expand Down Expand Up @@ -98,6 +102,7 @@
], [
'key' => 'pwa.settings.seo',
'name' => 'pwa::app.admin.system.seo.title',
'info' => 'pwa::app.admin.system.seo.title',
'sort' => 1,
'fields' => [
[
Expand Down Expand Up @@ -129,6 +134,7 @@
], [
'key' => 'pwa.settings.media',
'name' => 'pwa::app.admin.system.media',
'info' => 'pwa::app.admin.system.media',
'sort' => 1,
'fields' => [
[
Expand Down Expand Up @@ -164,6 +170,7 @@
], [
'key' => 'pwa.settings.push-notification',
'name' => 'pwa::app.admin.system.push-notification',
'info' => 'pwa::app.admin.system.push-notification',
'sort' => 1,
'fields' => [
[
Expand Down Expand Up @@ -226,4 +233,4 @@
],
],
],
];
];
3 changes: 1 addition & 2 deletions src/Contracts/PWALayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
namespace Webkul\PWA\Contracts;

interface PWALayout
{
}
{}
3 changes: 1 addition & 2 deletions src/Contracts/PushNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
namespace Webkul\PWA\Contracts;

interface PushNotification
{
}
{}
33 changes: 12 additions & 21 deletions src/DataGrids/PushNotificationDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,9 @@

/**
* Push notification datagrid.
*
* @author Webkul Software Pvt. Ltd. <support@webkul.com>
*/
class PushNotificationDataGrid extends DataGrid
{
/**
* Index.
*
* @var string
*/
protected $primaryColumn = 'id';

/**
* Prepare query builder.
*
Expand All @@ -33,7 +24,7 @@ public function prepareQueryBuilder()
'title',
'description',
'targeturl',
'imageurl'
'imageurl',
);

return $queryBuilder;
Expand All @@ -49,7 +40,7 @@ public function prepareColumns()
$this->addColumn([
'index' => 'id',
'label' => trans('pwa::app.admin.datagrid.id'),
'type' => 'number',
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
Expand All @@ -65,13 +56,13 @@ public function prepareColumns()
]);

$this->addColumn([
'index' => 'imageurl',
'label' => trans('pwa::app.admin.datagrid.icon'),
'type' => 'string',
'searchable' => false,
'sortable' => false,
'filterable' => false,
'closure' => function ($row) {
'index' => 'imageurl',
'label' => trans('pwa::app.admin.datagrid.icon'),
'type' => 'string',
'searchable' => false,
'sortable' => false,
'filterable' => false,
'closure' => function ($row) {
if ($row->imageurl) {
return '<img src=' . Storage::url($row->imageurl) . ' class="img-thumbnail" width="50px" height="70px" />';
}
Expand Down Expand Up @@ -100,7 +91,7 @@ public function prepareActions()
'icon' => 'icon-edit',
'method' => 'GET',
'url' => function ($row) {
return route('admin.pwa.pushnotification.edit', $row->id);
return route('admin.pwa.push-notification.edit', $row->id);
},
]);

Expand All @@ -109,7 +100,7 @@ public function prepareActions()
'icon' => 'icon-delete',
'method' => 'GET',
'url' => function ($row) {
return route('admin.pwa.pushnotification.delete', $row->id);
return route('admin.pwa.push-notification.delete', $row->id);
},
]);

Expand All @@ -118,7 +109,7 @@ public function prepareActions()
'icon' => 'icon-notification',
'method' => 'GET',
'url' => function ($row) {
return route('pwa.pushnotification.pushtofirebase', $row->id);
return route('pwa.push-notification.push-to-firebase', $row->id);
},
]);
}
Expand Down
13 changes: 2 additions & 11 deletions src/Helpers/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,18 @@

class AdminHelper
{
/**
* CategoryRepository object
*
* @var \Webkul\Category\Repositories\CategoryRepository
*/
protected $categoryRepository;

/**
* Create a new helper instance.
*
* @return void
*/
public function __construct(
CategoryRepository $categoryRepository
protected CategoryRepository $categoryRepository,
) {
$this->categoryRepository = $categoryRepository;
}

/**
* @param \Webkul\Category\Contracts\Category $category
* @return \Webkul\Category\Contracts\Category
* Create a new helper instance
*/
public function storePwaStatusInCategory($category)
{
Expand Down
24 changes: 3 additions & 21 deletions src/Helpers/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,16 @@

class Price
{
/**
* CustomerGroupRepository object
*/
protected $customerGroupRepository;

/**
* CatalogRuleProductPrice object
*/
protected $catalogRuleProductPriceHelper;

/**
* Create a new helper instance.
*
* @param Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
* @param Webkul\CatalogRule\Repositories\CatalogRuleProductPriceRepository $catalogRuleProductPriceRepository
* @param Webkul\CatalogRule\Repositories\CatalogRuleProductPrice $catalogRuleProductPriceHelper
* @return void
*/
public function __construct(
CustomerGroupRepository $customerGroupRepository,
CatalogRuleProductPriceRepository $catalogRuleProductPriceRepository,
CatalogRuleProductPrice $catalogRuleProductPriceHelper
protected CatalogRuleProductPrice $catalogRuleProductPriceHelper,
protected CatalogRuleProductPriceRepository $catalogRuleProductPriceRepository,
protected CustomerGroupRepository $customerGroupRepository,
) {
$this->customerGroupRepository = $customerGroupRepository;

$this->catalogRuleProductPriceRepository = $catalogRuleProductPriceRepository;

$this->catalogRuleProductPriceHelper = $catalogRuleProductPriceHelper;
}

/**
Expand Down
39 changes: 3 additions & 36 deletions src/Helpers/PwaConfigurableOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,19 @@

namespace Webkul\PWA\Helpers;

use Webkul\Attribute\Repositories\AttributeOptionRepository as AttributeOption;
use Webkul\Product\Helpers\ConfigurableOption;
use Webkul\Product\Models\Product;
use Webkul\Product\Models\ProductImage;

class PwaConfigurableOption extends ConfigurableOption
{
/**
* AttributeOptionRepository object
*
* @var array
*/
protected $attributeOption;

/**
* ProductImage object
*
* @var array
*/
protected $productImage;

/**
* Price object
*
* @var array
*/
protected $price;

/**
* Create a new controller instance.
*
* @param Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOption
* @param Webkul\Product\Models $productImage
* @param Webkul\Product\Helpers\Price $price
* @return void
*/
public function __construct(
AttributeOption $attributeOption,
ProductImage $productImage,
Price $price
protected Price $price,
) {
$this->attributeOption = $attributeOption;

$this->productImage = $productImage;

$this->price = $price;
}

/**
Expand All @@ -58,7 +25,7 @@ public function __construct(
*/
public function getConfigurationConfig($product)
{
$options = $this->getOptions($product, $this->getAllowedProducts($product));
$options = $this->getOptions($product, $this->getAllowedVariants($product));

$config = [
'attributes' => $this->getAttributesData($product, $options),
Expand All @@ -85,7 +52,7 @@ protected function getVariantPrices($product)
{
$prices = [];

foreach ($this->getAllowedProducts($product) as $variant) {
foreach ($this->getAllowedVariants($product) as $variant) {
if ($variant instanceof \Webkul\Product\Models\ProductFlat) {
$variantId = $variant->product_id;
} else {
Expand Down
4 changes: 0 additions & 4 deletions src/Http/Controllers/Admin/LayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ public function index()
*/
public function store()
{
// $this->validate(request(), [
// 'home_page_content' => 'required',
// ]);

$existing = $this->pwaLayoutRepository->first();

if ($existing) {
Expand Down
Loading