Merge pull request #352 from bagisto/jitendra

Jitendra
This commit is contained in:
JItendra Singh 2018-12-20 18:27:04 +05:30 committed by GitHub
commit d723ca77ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 103 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=b77265f25dc2a33a4bb3",
"/js/admin.js": "/js/admin.js?id=c70dacdf945a32e04b77",
"/css/admin.css": "/css/admin.css?id=ccb086d72702e662082e"
}
}

View File

@ -35,6 +35,8 @@ class AdminServiceProvider extends ServiceProvider
$this->composeView();
$this->registerACL();
$this->app->register(EventServiceProvider::class);
$this->app->bind(
@ -87,17 +89,44 @@ class AdminServiceProvider extends ServiceProvider
});
view()->composer(['admin::users.roles.create', 'admin::users.roles.edit'], function ($view) {
$tree = Tree::create();
foreach(config('acl') as $item) {
$tree->add($item);
}
$tree->items = core()->sortItems($tree->items);
$view->with('acl', $tree);
$view->with('acl', $this->createACL());
});
}
/**
* Registers acl to entire application
*
* @return void
*/
public function registerACL()
{
$this->app->singleton('acl', function () {
return $this->createACL();
});
}
/**
* Create acl tree
*
* @return mixed
*/
public function createACL()
{
static $tree;
if($tree)
return $tree;
$tree = Tree::create();
foreach(config('acl') as $item) {
$tree->add($item, 'acl');
}
$tree->items = core()->sortItems($tree->items);
return $tree;
}
/**
* Register package config.

View File

@ -19,6 +19,13 @@ class Tree {
*/
public $items = [];
/**
* Contains acl roles
*
* @var array
*/
public $roles = [];
/**
* Contains current item route
*
@ -74,11 +81,14 @@ class Tree {
if (strpos($this->current, $item['url']) !== false) {
$this->currentKey = $item['key'];
}
} else if ($type == 'acl') {
$this->roles[$item['route']] = $item['key'];
}
$children = str_replace('.', '.children.', $item['key']);
core()->array_set($this->items, $children, $item);
}
/**

View File

@ -61,6 +61,26 @@ return [
'type' => 'textarea',
'channel_based' => true,
'locale_based' => false
], [
'name' => 'default_rate',
'title' => 'Rate',
'type' => 'text',
'channel_based' => true,
'locale_based' => false
], [
'name' => 'type',
'title' => 'Type',
'type' => 'select',
'options' => [
[
'title' => 'Per Unit',
'value' => 'Per Order'
], [
'title' => 'Inactive',
'value' => 'per_order'
]
],
'validation' => 'required'
], [
'name' => 'active',
'title' => 'Status',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=c6ba9f43bd31f175a665",
"/css/shop.css": "/css/shop.css?id=44608a4ce1658811733f"
"/js/shop.js": "/js/shop.js?id=dc2ea56a854d779e7089",
"/css/shop.css": "/css/shop.css?id=7c64b6577e4bcb5b03ee"
}

View File

@ -17,6 +17,10 @@ $(document).ready(function () {
const app = new Vue({
el: "#app",
data: {
modalIds: {}
},
mounted: function () {
this.addServerErrors();
this.addFlashMessages();
@ -79,7 +83,11 @@ $(document).ready(function () {
}, this);
},
responsiveHeader: function () { }
responsiveHeader: function () { },
showModal(id) {
this.$set(this.modalIds, id, true);
}
}
});
});

View File

@ -334,6 +334,10 @@ input {
justify-content: center;
}
.grid-container {
margin-top: 20px;
}
//main store front layouting
.main-container-wrapper {
max-width: 1300px;

View File

@ -101,6 +101,8 @@
{!! view_render_event('bagisto.shop.layout.body.after') !!}
<div class="modal-overlay"></div>
</body>
</html>

View File

@ -1,8 +1,8 @@
const { mix } = require("laravel-mix");
require("laravel-mix-merge-manifest");
// var publicPath = 'publishable/assets';
var publicPath = "../../../public/themes/default/assets";
var publicPath = 'publishable/assets';
// var publicPath = "../../../public/themes/default/assets";
mix.setPublicPath(publicPath).mergeManifest();
mix.disableNotifications();

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=1fdce572fb02cd8c7dad",
"/css/ui.css": "/css/ui.css?id=287b4588ed3ee39d4587"
"/css/ui.css": "/css/ui.css?id=8d57ae10a97f50169f1f"
}

View File

@ -709,6 +709,11 @@ h2 {
}
}
modal {
display: none;
}
.modal-open {
overflow: hidden;
}

View File

@ -1,8 +1,8 @@
const { mix } = require("laravel-mix");
require("laravel-mix-merge-manifest");
// var publicPath = 'publishable/assets';
var publicPath = "../../../public/vendor/webkul/ui/assets";
var publicPath = 'publishable/assets';
// var publicPath = "../../../public/vendor/webkul/ui/assets";
mix.setPublicPath(publicPath).mergeManifest();
mix.disableNotifications();

View File

@ -29,10 +29,10 @@ class Bouncer
public function checkIfAuthorized($request)
{
if(!$role = auth()->guard('admin')->user()->role)
if (!$role = auth()->guard('admin')->user()->role)
abort(401, 'This action is unauthorized.');
if($role->permission_type == 'all'){
if ($role->permission_type == 'all') {
return;
} else {
$acl = app('acl');