diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index 592b0f5b4..6703c3544 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -37,7 +37,7 @@ class CustomerDataGrid 'route' => route('admin.datagrid.delete'), 'method' => 'DELETE', 'label' => 'Delete', - 'type' => 'button', + 'type' => 'button', //select || button only ], ], @@ -55,20 +55,10 @@ class CustomerDataGrid ], ], - 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] - ], + 'join' => [], //use aliasing on secodary columns if join is performed - 'columns' => [ - [ 'name' => 'id', 'alias' => 'customerId', @@ -81,14 +71,14 @@ class CustomerDataGrid 'alias' => 'customerFirstName', 'type' => 'string', 'label' => 'Name', - 'sortable' => true, + 'sortable' => false, ], [ 'name' => 'email', 'alias' => 'customerEmail', 'type' => 'string', 'label' => 'Email', - 'sortable' => true, + 'sortable' => false, ], [ 'name' => 'phone', @@ -102,7 +92,7 @@ class CustomerDataGrid 'alias' => 'customerGroupId', 'type' => 'number', 'label' => 'Customer Group', - 'sortable' => true, + 'sortable' => false, ], ], diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index ffdd15983..5445c09db 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -1,6 +1,7 @@ ['web']], function () { + Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [ 'view' => 'shop::home.index' ])->name('shop.home.index'); @@ -167,7 +168,6 @@ Route::group(['middleware' => ['web']], function () { Route::post('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [ 'redirect' => 'customer.address.index' ])->name('customer.address.edit'); - /* Routes for Addresses ends here */ /* Wishlist route */ @@ -188,5 +188,4 @@ Route::group(['middleware' => ['web']], function () { }); }); //customer routes end here - }); diff --git a/packages/Webkul/Shop/src/Resources/views/error.blade.php b/packages/Webkul/Shop/src/Resources/views/error.blade.php new file mode 100644 index 000000000..d78938fdb --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/error.blade.php @@ -0,0 +1,19 @@ +@extends('shop::layouts.master') +@section('content-wrapper') +
+
+
+
404
+
Page Not Found
+
+ GO TO HOME + {{-- pass the content dynamically --}} + Show the exception here or error message here. +
+ +
+
+
+
+@endsection \ No newline at end of file diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php index bd212bdf2..c61c7c5aa 100644 --- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php +++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php @@ -596,7 +596,7 @@ class DataGrid array_values($value)[0] ); } else { - throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually.'); + throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually'); } } elseif ($key=="search") { diff --git a/packages/Webkul/Ui/src/Providers/UiServiceProvider.php b/packages/Webkul/Ui/src/Providers/UiServiceProvider.php index 6229e49c5..5f6c0256a 100644 --- a/packages/Webkul/Ui/src/Providers/UiServiceProvider.php +++ b/packages/Webkul/Ui/src/Providers/UiServiceProvider.php @@ -20,6 +20,8 @@ class UiServiceProvider extends ServiceProvider __DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/ui/assets'), ], 'public'); + $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'ui'); + $this->loadViewsFrom(__DIR__ . '/../Resources/views', 'ui'); Paginator::defaultView('ui::partials.pagination'); diff --git a/packages/Webkul/Ui/src/Resources/assets/images/Icon-Sort-Up.svg b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Sort-Up.svg new file mode 100644 index 000000000..1c9462c2b --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/images/Icon-Sort-Up.svg @@ -0,0 +1,23 @@ + + + + Icon-Sort-Down + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/assets/images/sort-up-icon.png b/packages/Webkul/Ui/src/Resources/assets/images/sort-up-icon.png new file mode 100644 index 000000000..2578e18db Binary files /dev/null and b/packages/Webkul/Ui/src/Resources/assets/images/sort-up-icon.png differ diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss index 58e16a504..648b2b01a 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss @@ -1,6 +1,7 @@ // Icon scss @import "icons"; @import "variables"; +@import "components"; @import "mixins"; @import "animations"; @@ -671,263 +672,6 @@ h2 { } } -/* Data grid css starts here */ -.grid-container { - user-select: none; - - .filter-wrapper { - display: block; - box-sizing: border-box; - - .filter-row-one, - .filter-row-two { - display: flex; - flex-direction: row; - } - .filter-row-one { - height: 40px; - align-items: center; - justify-content: space-between; - - .search-filter { - .control { - font-family: "montserrat", sans-serif; - padding-left: 5px; - width: 380px; - height: 36px; - border: 2px solid $control-border-color; - border-radius: 3px; - border-right: 0px; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; - font-size: 14px; - } - .ic-wrapper { - display: block; - height: 36px; - width: 36px; - border: 2px solid $control-border-color; - border-left: none; - border-radius: 2px; - - .search-icon { - margin-left: 4px; - margin-top: 4px; - height: 24px; - width: 24px; - } - } - } - - .dropdown-filters { - display: inline-flex; - - .more-filters { - margin-right: 5px; - - .dropdown-toggle { - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - font-family: "montserrat", sans-serif; - padding-left: 5px; - height: 36px; - width: 150px; - border: 2px solid $control-border-color; - border-radius: 2px; - background-color: $color-white; - color: $filter-toggle-color; - font-size: 14px; - - .dropdown-header { - width: 100%; - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - - .arrow-down-icon { - margin-right: 5px; - } - } - } - .dropdown-list { - .dropdown-container { - ul { - li.filter-column-dropdown { - .filter-column-select { - width: 100%; - background: $color-white; - border: 2px solid $control-border-color; - border-radius: 3px; - height: 36px; - display: inline-block; - vertical-align: middle; - -webkit-transition: 0.2s - cubic-bezier(0.4, 0, 0.2, 1); - transition: 0.2s - cubic-bezier(0.4, 0, 0.2, 1); - padding: 0px 5px; - font-family: "montserrat", sans-serif; - margin-top: 10px; - margin-bottom: 5px; - } - } - li { - select { - background: $color-white; - border: 2px solid $control-border-color; - border-radius: 3px; - height: 36px; - max-width: 100%; - display: inline-block; - vertical-align: middle; - -webkit-transition: 0.2s - cubic-bezier(0.4, 0, 0.2, 1); - transition: 0.2s - cubic-bezier(0.4, 0, 0.2, 1); - padding: 0px 5px; - font-family: "montserrat", sans-serif; - margin-top: 10px; - margin-bottom: 5px; - } - input { - background: #fff; - border: 2px solid #c7c7c7; - border-radius: 3px; - height: 36px; - max-width: 100%; - display: inline-block; - vertical-align: middle; - -webkit-transition: 0.2s - cubic-bezier(0.4, 0, 0.2, 1); - transition: 0.2s - cubic-bezier(0.4, 0, 0.2, 1); - padding: 0px 5px; - font-family: "montserrat", sans-serif; - margin-top: 10px; - margin-bottom: 5px; - } - } - .filter-condition-dropdown-string { - display: none; - } - .filter-condition-dropdown-number { - display: none; - } - .filter-condition-dropdown-datetime { - display: none; - } - - .filter-response-string { - display: none; - } - .filter-response-boolean { - display: none; - } - .filter-response-datetime { - display: none; - } - .filter-response-number { - display: none; - } - } - } - } - } - } - } - .filter-row-two { - display: flex; - flex-direction: row; - flex-wrap: wrap; - margin-top: 6px; - margin-bottom: 6px; - - .filter-one { - margin-right: 10px; - - .filter-name { - margin-right: 5px; - } - - .filter-value { - display: inline-flex; - background: #e7e7e7; - padding-left: 5px; - color: $color-black-shade; - vertical-align: middle; - - .f-value { - margin: auto; - } - - .cross-icon { - margin: 5px; - height: 18px !important; - width: 18px !important; - cursor: pointer; - } - } - } - } - } - .table { - thead { - .mass-action-wrapper { - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - - .massaction-remove { - margin-top: 10px; - margin-right: 10px; - } - - form { - margin-top: 8px; - } - - .selected-items { - margin-right: 15px; - } - } - tr { - th.grid_head { - cursor:pointer; - - .sort-down-icon { - margin-left: 5px; - margin-top: -3px; - vertical-align: middle; - cursor: pointer; - } - } - - th { - text-transform: capitalize; - } - } - } - - tbody { - td.action { - a:first-child { - margin-right: 10px; - } - } - } - - .pagination { - margin-top:20px; - } - } -} - -/* DataGrid css ends in here */ - .modal-open { overflow: hidden; } diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/components.scss b/packages/Webkul/Ui/src/Resources/assets/sass/components.scss new file mode 100644 index 000000000..caf0c47aa --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/assets/sass/components.scss @@ -0,0 +1,258 @@ +/* Data grid css starts here */ +.grid-container { + user-select: none; + + .filter-wrapper { + display: block; + box-sizing: border-box; + + .filter-row-one, + .filter-row-two { + display: flex; + flex-direction: row; + } + .filter-row-one { + height: 40px; + align-items: center; + justify-content: space-between; + + .search-filter { + .control { + font-family: "montserrat", sans-serif; + padding-left: 5px; + width: 380px; + height: 36px; + border: 2px solid $control-border-color; + border-radius: 3px; + border-right: 0px; + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; + font-size: 14px; + } + .ic-wrapper { + display: block; + height: 36px; + width: 36px; + border: 2px solid $control-border-color; + border-left: none; + border-radius: 2px; + + .search-icon { + margin-left: 4px; + margin-top: 4px; + height: 24px; + width: 24px; + } + } + } + + .dropdown-filters { + display: inline-flex; + + .more-filters { + margin-right: 5px; + + .dropdown-toggle { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + font-family: "montserrat", sans-serif; + padding-left: 5px; + height: 36px; + width: 150px; + border: 2px solid $control-border-color; + border-radius: 2px; + background-color: $color-white; + color: $filter-toggle-color; + font-size: 14px; + + .dropdown-header { + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + + .arrow-down-icon { + margin-right: 5px; + } + } + } + .dropdown-list { + .dropdown-container { + ul { + li.filter-column-dropdown { + .filter-column-select { + width: 100%; + background: $color-white; + border: 2px solid $control-border-color; + border-radius: 3px; + height: 36px; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s + cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s + cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 5px; + font-family: "montserrat", sans-serif; + margin-top: 10px; + margin-bottom: 5px; + } + } + li { + select { + background: $color-white; + border: 2px solid $control-border-color; + border-radius: 3px; + height: 36px; + max-width: 100%; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s + cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s + cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 5px; + font-family: "montserrat", sans-serif; + margin-top: 10px; + margin-bottom: 5px; + } + input { + background: #fff; + border: 2px solid #c7c7c7; + border-radius: 3px; + height: 36px; + max-width: 100%; + display: inline-block; + vertical-align: middle; + -webkit-transition: 0.2s + cubic-bezier(0.4, 0, 0.2, 1); + transition: 0.2s + cubic-bezier(0.4, 0, 0.2, 1); + padding: 0px 5px; + font-family: "montserrat", sans-serif; + margin-top: 10px; + margin-bottom: 5px; + } + } + .filter-condition-dropdown-string { + display: none; + } + .filter-condition-dropdown-number { + display: none; + } + .filter-condition-dropdown-datetime { + display: none; + } + + .filter-response-string { + display: none; + } + .filter-response-boolean { + display: none; + } + .filter-response-datetime { + display: none; + } + .filter-response-number { + display: none; + } + } + } + } + } + } + } + .filter-row-two { + display: flex; + flex-direction: row; + flex-wrap: wrap; + margin-top: 6px; + margin-bottom: 6px; + + .filter-one { + margin-right: 10px; + + .filter-name { + margin-right: 5px; + } + + .filter-value { + display: inline-flex; + background: #e7e7e7; + padding-left: 5px; + color: $color-black-shade; + vertical-align: middle; + + .f-value { + margin: auto; + } + + .cross-icon { + margin: 5px; + height: 18px !important; + width: 18px !important; + cursor: pointer; + } + } + } + } + } + .table { + thead { + .mass-action-wrapper { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + + .massaction-remove { + margin-top: 10px; + margin-right: 10px; + } + + form { + margin-top: 8px; + } + + .selected-items { + margin-right: 15px; + } + } + tr { + th.grid_head { + + .sort-down-icon, .sort-up-icon { + margin-left: 5px; + margin-top: -3px; + vertical-align: middle; + } + } + + th.grid_head.sortable { + cursor: pointer; + } + + th { + text-transform: capitalize; + } + } + } + + tbody { + td.action { + a:first-child { + margin-right: 10px; + } + } + } + + .pagination { + margin-top:20px; + } + } +} + +/* DataGrid css ends in here */ diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss b/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss index 4b9536212..33d589816 100644 --- a/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss +++ b/packages/Webkul/Ui/src/Resources/assets/sass/icons.scss @@ -117,6 +117,16 @@ height: 18px; } +.sort-up-icon { + // background-image: url("../images/Icon-Sort-Up.svg"); + // width: 18px; + // height: 18px; + background-image: url("../images/Icon-Sort-Down.svg"); + width: 18px; + height: 18px; + transform: rotate(180deg); +} + .primary-back-icon { background-image: url("../images/Icon-Back-Primary.svg"); width: 24px; diff --git a/packages/Webkul/Ui/src/Resources/lang/en/app.php b/packages/Webkul/Ui/src/Resources/lang/en/app.php new file mode 100644 index 000000000..ab0c53687 --- /dev/null +++ b/packages/Webkul/Ui/src/Resources/lang/en/app.php @@ -0,0 +1,6 @@ + [ + 'actions' => 'Actions' + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/filters/default.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/filters.blade.php similarity index 99% rename from packages/Webkul/Ui/src/Resources/views/datagrid/filters/default.blade.php rename to packages/Webkul/Ui/src/Resources/views/datagrid/filters.blade.php index 868c5906e..f555a009c 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/filters/default.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/filters.blade.php @@ -1,5 +1,4 @@
- {{-- for loading the filters from another file --}}
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 3675dbc66..34cf664f3 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php @@ -1,73 +1,53 @@ -
- +
{{-- For loading the filters from includes directory file --}} - @include('ui::datagrid.filters.default') + @include('ui::datagrid.filters') {{-- for generating the table and its content --}} - @include('ui::datagrid.table.default') + @include('ui::datagrid.table') {{-- Section for datagrid javascript --}} @push('scripts')