From fb1f042597f3277195ad39d5e4edac73013db977 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Tue, 24 Jul 2018 20:12:36 +0530 Subject: [PATCH] fixing modified changes --- app/Providers/AppServiceProvider.php | 3 +- config/auth.php | 106 ++++++------------ packages/Webkul/Admin/src/Config/auth.php | 2 +- .../Http/Controllers/DataGridController.php | 1 + .../src/Providers/AdminServiceProvider.php | 14 +-- .../Ui/src/Resources/assets/sass/app.scss | 32 +++--- .../Resources/views/datagrid/index.blade.php | 69 ++++++++---- .../views/datagrid/table/default.blade.php | 9 +- packages/Webkul/Ui/webpack.mix.js | 2 +- .../Database/Seeders/AdminsTableSeeder.php | 11 +- .../Http/Controllers/SessionController.php | 4 +- .../webkul/customer/assets/css/customer.css | 60 ++++++++++ public/vendor/webkul/ui/assets/css/ui.css | 19 ++-- 13 files changed, 197 insertions(+), 135 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 35471f6ff..706c00313 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { @@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + Schema::defaultStringLength(191); } /** diff --git a/config/auth.php b/config/auth.php index 781750102..90efd519a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -1,102 +1,60 @@ [ 'guard' => 'web', - 'passwords' => 'users', + 'passwords' => 'admins', ], - /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session", "token" - | - */ - 'guards' => [ 'web' => [ 'driver' => 'session', - 'provider' => 'users', + 'provider' => 'admins', ], 'api' => [ 'driver' => 'token', - 'provider' => 'users', + 'provider' => 'admins', ], - ], - /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ + 'customer' =>[ + 'driver' => 'session', + 'provider' => 'customers' + ], + + 'admin' => [ + 'driver' => 'session', + 'provider' => 'admins' + ], + + 'admin-api' => [ + 'driver' => 'token', + 'provider' => 'admins', + ] + ], 'providers' => [ - 'users' => [ + 'customers' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => Webkul\Customer\Models\Customer::class, ], - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], + 'admins' => [ + 'driver' => 'eloquent', + 'model' => Webkul\User\Models\Admin::class, + ] ], - /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ - 'passwords' => [ - 'users' => [ - 'provider' => 'users', - 'table' => 'password_resets', + 'admins' => [ + 'provider' => 'admins', + 'table' => 'admin_password_resets', + 'expire' => 60, + ], + 'customers' => [ + 'provider' => 'customers', + 'table' => 'customers_password_resets', 'expire' => 60, ], ], - ]; diff --git a/packages/Webkul/Admin/src/Config/auth.php b/packages/Webkul/Admin/src/Config/auth.php index 1e7bb3cdc..89b6ecc26 100644 --- a/packages/Webkul/Admin/src/Config/auth.php +++ b/packages/Webkul/Admin/src/Config/auth.php @@ -51,7 +51,7 @@ return [ 'table' => 'admin_password_resets', 'expire' => 60, ], - 'admins' => [ + 'customers' => [ 'provider' => 'customers', 'table' => 'customers_password_resets', 'expire' => 60, diff --git a/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php b/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php index 6305b4c34..be8676840 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DataGridController.php @@ -158,6 +158,7 @@ class DataGridController extends Controller 'neqn' => "!=", 'ceq' => "<=>", 'like' => "like", + 'nlike' => "not like", ], 'mass_operations' =>[ [ diff --git a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php index d1b19bebb..86d494dce 100644 --- a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php @@ -74,13 +74,13 @@ class AdminServiceProvider extends ServiceProvider * * @return void */ - public function register() - { - $this->mergeConfigFrom( - __DIR__ . '/../Config/auth.php', - 'auth' - ); - } + // public function register() + // { + // $this->mergeConfigFrom( + // __DIR__ . '/../Config/auth.php', + // 'auth' + // ); + // } /** * Merge the given configuration with the existing configuration. diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss index eb3969501..c66e36cbe 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss @@ -728,15 +728,16 @@ h2 { .filter-value { display: inline-flex; background: #e7e7e7; - height: 36px; padding-left: 5px; - padding-right: 10px; - padding-top: 8px; - padding-bottom: 5px; color: #000311; vertical-align: middle; + .f-value { + margin: auto; + } + .cross-icon { + margin: 5px; height: 18px !important; width: 18px !important; } @@ -745,16 +746,21 @@ h2 { } } .table { - .xyz { - display: flex; - flex-direction: row; - // visibility: hidden; - padding-left: 10px; - justify-content: flex-start; - align-items: center; + thead { + .xyz { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; - .selected-items { - margin-right: 15px; + .massaction-remove { + margin-top: 5px; + margin-right: 10px; + } + + .selected-items { + margin-right: 15px; + } } } } diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php index 3c03846a7..818c512c6 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php @@ -28,24 +28,25 @@ params = (new URL(document.location)).search; if(params.length>0){ - if(allFilters1.length == 0){ + if(allFilters1.length == 0) { //call reverse url function arrayFromUrl(params.slice(1,params.length)); } } - $('.search-btn').click(function(){ + $('.search-btn').click(function() { search_value = $(".search-field").val(); formURL('search','all',search_value,params); //format for search alert(search_value); }); - $('.grid_head').on('click', function(){ + $('.grid_head').on('click', function() { var column = $(this).data('column-name'); var currentSort = $(this).data('column-sort'); - - if(currentSort == "asc"){ + console.log(column, currentSort); + // return false; + if(currentSort == "asc") { $(this).data('column-name','desc'); formURL(column,'sort','desc',params); }else{ @@ -166,51 +167,65 @@ }); $('.mass-action').css('display',''); $('.table-grid-header').css('display','none'); - $('.selected-items').html(id.toString()); + // $('.selected-items').html(id.toString()); $('#indexes').val(id); - console.log(id); } - else if($("input[id=mastercheckbox]").prop('checked') == false){ + else if($("input[id=mastercheckbox]").prop('checked') == false) { $('.indexers').each(function(){ this.checked = false; }); id = []; $('.mass-action').css('display','none'); $('.table-grid-header').css('display',''); $('#indexes').val(''); - console.log(id); } }); + $('.massaction-remove').on('click', function(){ + id = []; + $('.mass-action').css('display','none'); + if($('#mastercheckbox').prop('checked')) { + $('#mastercheckbox').prop('checked',false); + } + $("input[class=indexers]").each(function(){ + if($(this).prop('checked')){ + $(this).prop('checked',false); + } + }); + $('.table-grid-header').css('display',''); + }); + $("input[class=indexers]").change(function() { if(this.checked){ y = parseInt($(this).attr('id')); id.push(y); - console.log(id); } else { y = parseInt($(this).attr('id')); var index = id.indexOf(y); id.splice(index,1); } - if(id.length>0){ + if(id.length>0) { $('.mass-action').css('display',''); $('.table-grid-header').css('display','none'); - $('.selected-items').html(id.toString()); + // $('.selected-items').html(id.toString()); $('#indexes').val(id); - }else if(id.length == 0){ + }else if(id.length == 0) { $('.mass-action').css('display','none'); $('.table-grid-header').css('display',''); $('#indexes').val(''); + if($('#mastercheckbox').prop('checked')) { + $('#mastercheckbox').prop('checked',false); + } } }); //remove the mass action by clicking on the icon - $('.mass-action-remove').on('click', function(){ - $("input[type=checkbox]").prop('checked',false); - id = []; - $('#indexes').val(''); - $('.mass-action').css('display','none'); - $('.table-grid-header').css('display',''); - }); + // $('.mass-action-remove').on('click', function() { + // $("input[type=checkbox]").prop('checked',false); + // id = []; + // $('#indexes').val(''); + // $('.mass-action').css('display','none'); + // $('.table-grid-header').css('display',''); + // }); // $('.b-res').css('visibility','hidden'); // $('.t-res').css('visibility','hidden'); @@ -264,7 +279,7 @@ // console.log('Array from URL = ',allFilters1); makeTagsTestPrior(); } - + var label; function makeTagsTestPrior() { var filterRepeat = 0; //make sure the filter or sort param is not duplicate before pushing it into the all filters array @@ -275,10 +290,16 @@ // console.log(allFilters1[i][j],j); for(k in allFilters1[i][j]) { - // console.log('column = ',j); + console.log('column = ',j); + if($("th[data-column-name='" + j +"']")) { + label = $("th[data-column-name='" + j +"']").data('column-label'); + console.log(label); + } + + // console.log('label = ',label); // console.log('condition = ',k); // console.log('value = ',allFilters1[i][j][k]); - var filter_card = ''+ j +''+allFilters1[i][j][k] +''; + var filter_card = ''+ label +''+allFilters1[i][j][k] +''; $('.filter-row-two').append(filter_card); } } @@ -309,7 +330,7 @@ if(filterRepeat == 0) { allFilters1.push(tmp); // console.log(allFilters1); - var filter_card = ''+ column +''+ response +''; + var filter_card = ''+ column +''+ response +''; $('.filter-row-two').append(filter_card); makeURL(allFilters1); count_filters++; diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php index 853d05462..5e1c5690c 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/table/default.blade.php @@ -4,7 +4,10 @@
-
+ + + + {{--
--}} @foreach($massoperations as $massoperation) {{--

{{ $massoperation['label'] }}

--}} @if($massoperation['type'] == "button")
@foreach ($columns as $column) @if($column->sortable == "true") - name }} data-column-sort="asc"> {!! $column->sorting() !!} + {!! $column->sorting() !!} @else - {!! $column->sorting() !!} + {!! $column->sorting() !!} @endif @endforeach diff --git a/packages/Webkul/Ui/webpack.mix.js b/packages/Webkul/Ui/webpack.mix.js index 4fa81616a..32804fbcc 100644 --- a/packages/Webkul/Ui/webpack.mix.js +++ b/packages/Webkul/Ui/webpack.mix.js @@ -14,7 +14,7 @@ mix.js( ], "js/ui.js" ) - .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images") + // .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images") .sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/ui.css") .options({ processCssUrls: false diff --git a/packages/Webkul/User/src/Database/Seeders/AdminsTableSeeder.php b/packages/Webkul/User/src/Database/Seeders/AdminsTableSeeder.php index 5dcd691b9..a8a5095c1 100644 --- a/packages/Webkul/User/src/Database/Seeders/AdminsTableSeeder.php +++ b/packages/Webkul/User/src/Database/Seeders/AdminsTableSeeder.php @@ -10,12 +10,19 @@ class AdminsTableSeeder extends Seeder { public function run() { + // $characters = '0123456789abcdefghijklmnopqrstuvwxyz'; + // $charactersLength = strlen($characters); + // $randomString = ''; + // for ($i = 0; $i < $length; $i++) { + // $randomString .= $characters[rand(0, $charactersLength - 1)]; + // } + $i=0; for ($i=0;$i<10;$i++) { $role = Role::first(); $admin = new Admin(); - $admin->name = random_str(8); - $admin->email = random_str(10).'@example.com'; + $admin->name = str_random(8); + $admin->email = str_random(10).'@example.com'; $admin->password = bcrypt('admin123'); $admin->status = 1; $admin->role_id = $role->id; diff --git a/packages/Webkul/User/src/Http/Controllers/SessionController.php b/packages/Webkul/User/src/Http/Controllers/SessionController.php index b9519b789..98c9068f7 100644 --- a/packages/Webkul/User/src/Http/Controllers/SessionController.php +++ b/packages/Webkul/User/src/Http/Controllers/SessionController.php @@ -55,7 +55,7 @@ class SessionController extends Controller ]); $remember = request('remember'); - if(! auth()->guard('admin')->attempt(request(['email', 'password']), $remember)) { + if (! auth()->guard('admin')->attempt(request(['email', 'password']), $remember)) { session()->flash('error', 'Please check your credentials and try again.'); return back(); @@ -76,4 +76,4 @@ class SessionController extends Controller return redirect()->route($this->_config['redirect']); } -} \ No newline at end of file +} diff --git a/public/vendor/webkul/customer/assets/css/customer.css b/public/vendor/webkul/customer/assets/css/customer.css index f56ab4820..acbb94bb2 100644 --- a/public/vendor/webkul/customer/assets/css/customer.css +++ b/public/vendor/webkul/customer/assets/css/customer.css @@ -69,3 +69,63 @@ height: 45px; margin-bottom: 4%; } + +.dashboard-content { + width: 100%; + margin-top: 5.5%; + margin-bottom: 5.5%; +} + +.dashboard-content .dashboard-side-menu { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -ms-flex-line-pack: center; + align-content: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + border: 1px solid #e8e8e8; + border-right: none; + background: #ffffff; + width: 25%; + text-transform: capitalize; +} + +.dashboard-content .dashboard-side-menu li { + font-size: 16px; + width: 95%; + height: 50px; + margin-left: 15px; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 1px solid #ffe8e8e8; + border-left: none; + border-bottom: none; + text-align: center; +} + +.dashboard-content .dashboard-side-menu li:first-child { + border-top: none; + border-left: none; + border-bottom: none; +} + +.dashboard-content .dashboard-side-menu li:last-child { + border-bottom: none; +} diff --git a/public/vendor/webkul/ui/assets/css/ui.css b/public/vendor/webkul/ui/assets/css/ui.css index 666836ea7..77d2871c6 100644 --- a/public/vendor/webkul/ui/assets/css/ui.css +++ b/public/vendor/webkul/ui/assets/css/ui.css @@ -1001,21 +1001,22 @@ h2 { display: -ms-inline-flexbox; display: inline-flex; background: #e7e7e7; - height: 36px; padding-left: 5px; - padding-right: 10px; - padding-top: 8px; - padding-bottom: 5px; color: #000311; vertical-align: middle; } +.grid-container .filter-wrapper .filter-row-two .filter-one .filter-value .f-value { + margin: auto; +} + .grid-container .filter-wrapper .filter-row-two .filter-one .filter-value .cross-icon { + margin: 5px; height: 18px !important; width: 18px !important; } -.grid-container .table .xyz { +.grid-container .table thead .xyz { display: -webkit-box; display: -ms-flexbox; display: flex; @@ -1023,7 +1024,6 @@ h2 { -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; - padding-left: 10px; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; @@ -1032,7 +1032,12 @@ h2 { align-items: center; } -.grid-container .table .xyz .selected-items { +.grid-container .table thead .xyz .massaction-remove { + margin-top: 5px; + margin-right: 10px; +} + +.grid-container .table thead .xyz .selected-items { margin-right: 15px; }