diff --git a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php
index 27f42a27a..e9678445c 100644
--- a/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php
+++ b/packages/Webkul/Admin/src/Http/ViewComposers/DataGrids/UserComposer.php
@@ -37,10 +37,10 @@ class UserComposer
public function compose(View $view)
{
$datagrid = DataGrid::make([
- 'name' => 'Users',
+ 'name' => 'Admins',
'table' => 'admins as u',
'select' => 'u.id',
- 'aliased' => true , //boolean to validate aliasing on the basis of this.
+ 'aliased' => true, //boolean to validate aliasing on the basis of this.
'filterable' => [
[
'column' => 'u.email',
@@ -50,6 +50,10 @@ class UserComposer
'column' => 'u.name',
'type' => 'string',
'label' => 'Admin Name'
+ ], [
+ 'column' => 'u.id',
+ 'type' => 'number',
+ 'label' => 'Admin ID'
]
],
'searchable' => [
@@ -83,13 +87,13 @@ class UserComposer
// ],
],
'join' => [
- [
- 'join' => 'leftjoin',
- 'table' => 'roles as r',
- 'primaryKey' => 'u.role_id',
- 'condition' => '=',
- 'secondaryKey' => 'r.id',
- ]
+ // [
+ // 'join' => 'leftjoin',
+ // 'table' => 'roles as r',
+ // 'primaryKey' => 'u.role_id',
+ // 'condition' => '=',
+ // 'secondaryKey' => 'r.id',
+ // ]
],
'columns' => [
[
@@ -110,12 +114,12 @@ class UserComposer
'label' => 'Admin E-Mail',
'sortable' => true,
],
- [
- 'name' => 'r.name as rolename',
- 'type' => 'string',
- 'label' => 'Role Name',
- 'sortable' => true,
- ],
+ // [
+ // 'name' => 'r.name as rolename',
+ // 'type' => 'string',
+ // 'label' => 'Role Name',
+ // 'sortable' => true,
+ // ],
// [
// 'name' => 'a.first_name',
// 'type' => 'string',
@@ -147,6 +151,7 @@ class UserComposer
'neqs' => "<>",
'neqn' => "!=",
'like' => "like",
+ 'nlike' => "not like",
],
// 'css' => []
diff --git a/packages/Webkul/Customer/src/Resources/assets/sass/app.scss b/packages/Webkul/Customer/src/Resources/assets/sass/app.scss
index 8d1c0a15d..65e16dae5 100644
--- a/packages/Webkul/Customer/src/Resources/assets/sass/app.scss
+++ b/packages/Webkul/Customer/src/Resources/assets/sass/app.scss
@@ -67,6 +67,9 @@
.dashboard-content {
width: 100%;
+ display: flex;
+ flex-direction: row;
+ border: 1px solid red;
margin-top: 5.5%;
margin-bottom: 5.5%;
@@ -80,6 +83,8 @@
background: #ffffff;
width: 25%;
text-transform: capitalize;
+ font-size: 16px;
+ color: #5e5e5e;
li {
font-size: 16px;
@@ -104,4 +109,21 @@
border-bottom: none;
}
}
+
+ .profile {
+ margin-left: 5.5%;
+
+ .section-heading {
+ height: 50px;
+ font-size: 28px;
+ color: #242424;
+ text-transform: capitalize;
+ text-align: left;
+ }
+ }
+
+ .profile-content {
+ font-size: 16px;
+ color: #5e5e5e;
+ }
}
diff --git a/packages/Webkul/Customer/src/Resources/views/dashboard/index.blade.php b/packages/Webkul/Customer/src/Resources/views/dashboard/index.blade.php
index 96debeb75..c7175f4fc 100644
--- a/packages/Webkul/Customer/src/Resources/views/dashboard/index.blade.php
+++ b/packages/Webkul/Customer/src/Resources/views/dashboard/index.blade.php
@@ -8,5 +8,40 @@
Reviews
Wishlist
+
+
+ Profile
+
+
+
+
+
+ | First Name |
+ Prashant |
+
+
+ | Last Name |
+ Singh |
+
+
+ | Gender Name |
+ Male |
+
+
+ | Date of Birth |
+ 1/1/1993 |
+
+
+ | Email Address |
+ Prashant@webkul.com |
+
+
+ | Mobile |
+ +91-9988887744 |
+
+
+
+
+
@endsection
diff --git a/packages/Webkul/Ui/src/DataGrid/DataGrid.php b/packages/Webkul/Ui/src/DataGrid/DataGrid.php
index 48e673b77..842448aca 100644
--- a/packages/Webkul/Ui/src/DataGrid/DataGrid.php
+++ b/packages/Webkul/Ui/src/DataGrid/DataGrid.php
@@ -391,19 +391,30 @@ class DataGrid
* to be used.
*/
+ // private function parse()
+ // {
+ // //parse the url here
+ // if (isset($_SERVER['QUERY_STRING'])) {
+ // $qr = $_SERVER['QUERY_STRING'];
+ // parse_str($qr, $parsed);
+ // foreach ($parsed as $k=>$v) {
+ // parse_str($v, $parsed[$k]);
+ // }
+ // return $parsed;
+ // } else {
+ // return $parsed = [];
+ // }
+ // }
+
private function parse()
{
- //parse the url here
- if (isset($_SERVER['QUERY_STRING'])) {
- $qr = $_SERVER['QUERY_STRING'];
- parse_str($qr, $parsed);
-
- foreach ($parsed as $k=>$v) {
- parse_str($v, $parsed[$k]);
- }
+ $parsed = [];
+ $unparsed = $_SERVER['QUERY_STRING'];
+ if (isset($unparsed)) {
+ parse_str($unparsed, $parsed);
return $parsed;
} else {
- return $parsed = [];
+ return $parsed;
}
}
@@ -470,77 +481,138 @@ class DataGrid
* and processed manually
*/
+ // private function getQueryWithFilters()
+ // {
+ // // the only use case remaining is making and testing the full validation and testing of
+ // // aliased case with alias used in column names also.
+ // if ($this->aliased) {
+ // //n of joins can lead to n number of aliases for columns and neglect the as for columns
+ // $parsed = $this->parse();
+ // // dump($parsed);
+ // foreach ($parsed as $key => $value) {
+ // foreach ($value as $column => $filter) {
+ // if (array_keys($filter)[0]=="like") {
+ // $this->query->where(
+ // str_replace('_', '.', $column), //replace the logic of making the column name and consider the case for _ in column name already
+ // $this->operators[array_keys($filter)[0]],
+ // '%'.array_values($filter)[0].'%'
+ // );
+ // } elseif (array_keys($filter)[0]=="sort") {
+ // $this->query->orderBy(
+ // str_replace('_', '.', $column), //replace the logic of making the column name and consider the case for _
+ // array_values($filter)[0]
+ // );
+ // } elseif ($column == "search") {
+ // $this->query->where(function ($query) use ($filter) {
+ // foreach ($this->searchable as $search) {
+ // $query->orWhere($search['column'], 'like', '%'.array_values($filter)[0].'%');
+ // }
+ // });
+ // } else {
+ // $this->query->where(
+ // str_replace('_', '.', $column),
+ // $this->operators[array_keys($filter)[0]],
+ // array_values($filter)[0]
+ // );
+ // }
+ // }
+ // }
+ // } else {
+ // $parsed = $this->parse();
+ // foreach ($parsed as $key => $value) {
+ // foreach ($value as $column => $filter) {
+ // if (array_keys($filter)[0]=="like") {
+ // $this->query->where(
+ // $column,
+ // $this->operators[array_keys($filter)[0]],
+ // '%'.array_values($filter)[0].'%'
+ // );
+ // } elseif ($column == "search") {
+ // $this->query->where(function ($query) use ($filter) {
+ // foreach ($this->searchable as $search) {
+ // $query->orWhere($search['column'], 'like', '%'.array_values($filter)[0].'%');
+ // }
+ // });
+ // } else {
+ // $this->query->where(
+ // $column,
+ // $this->operators[array_keys($filter)[0]],
+ // array_values($filter)[0]
+ // );
+ // }
+ // }
+ // }
+ // }
+ // }
private function getQueryWithFilters()
{
- // the only use case remaining is making and testing the full validation and testing of
- // aliased case with alias used in column names also.
+ $parsed = $this->parse();
+ // dd($parsed);
if ($this->aliased) {
- //n of joins can lead to n number of aliases for columns and neglect the as for columns
- $parsed = $this->parse();
- // dump($parsed);
- foreach ($parsed as $key => $value) {
- foreach ($value as $column => $filter) {
- if (array_keys($filter)[0]=="like") {
- $this->query->where(
- str_replace('_', '.', $column), //replace the logic of making the column name and consider the case for _ in column name already
- $this->operators[array_keys($filter)[0]],
- '%'.array_values($filter)[0].'%'
- );
- } elseif (array_keys($filter)[0]=="sort") {
- $this->query->orderBy(
- str_replace('_', '.', $column), //replace the logic of making the column name and consider the case for _
- array_values($filter)[0]
- );
- } elseif ($column == "search") {
- $this->query->where(function ($query) use ($filter) {
- foreach ($this->searchable as $search) {
- $query->orWhere($search['column'], 'like', '%'.array_values($filter)[0].'%');
- }
- });
+ foreach ($parsed as $key=>$value) {
+ if ($key=="sort") {
+
+ //resolve the case with the column helper class
+ if (strpos($key, ' as ') !== false) {
+ dd('This column cannot be sorted');
} else {
- $this->query->where(
- str_replace('_', '.', $column),
- $this->operators[array_keys($filter)[0]],
- array_values($filter)[0]
- );
+ $column_name = str_replace('_', '.', $key);
+ }
+
+ //case that don't need any resolving
+ $count_keys = count(array_keys($value));
+ if ($count_keys==1) {
+ $this->query->orderBy(
+ str_replace('_', '.', array_keys($value)[0]),
+ array_values($value)[0]
+ );
+ } else {
+ dump('Sort on two columns cannot exist in backend');
+ }
+ } elseif ($key=="search") {
+ if (strpos($key, ' as ') !== false) {
+ dd('This column cannot be searched');
+ } else {
+ $column_name = str_replace('_', '.', $key);
+ }
+ $this->query->where(function ($query) use ($parsed) {
+ foreach ($this->searchable as $search) {
+ $query->orWhere($search['column'], 'like', '%'.$parsed['search']['all'].'%');
+ }
+ });
+ } else {
+ if (strpos($key, ' as ') !== false) {
+ dd('This column cannot be filtered');
+ } else {
+ $column_name = str_replace('_', '.', $key);
+ }
+
+ if (array_keys($value)[0]=="like" || array_keys($value)[0]=="nlike") {
+ foreach ($value as $condition => $filter_value) {
+ $this->query->where(
+ $column_name,
+ $this->operators[$condition],
+ '%'.$filter_value.'%'
+ );
+ }
+ } else {
+ foreach ($value as $condition => $filter_value) {
+ $this->query->where(
+ $column_name,
+ $this->operators[$condition],
+ $filter_value
+ );
+ }
}
}
}
} else {
- $parsed = $this->parse();
- foreach ($parsed as $key => $value) {
- foreach ($value as $column => $filter) {
- if (array_keys($filter)[0]=="like") {
- $this->query->where(
- $column,
- $this->operators[array_keys($filter)[0]],
- '%'.array_values($filter)[0].'%'
- );
- } elseif ($column == "search") {
- $this->query->where(function ($query) use ($filter) {
- foreach ($this->searchable as $search) {
- $query->orWhere($search['column'], 'like', '%'.array_values($filter)[0].'%');
- }
- });
- } else {
- $this->query->where(
- $column,
- $this->operators[array_keys($filter)[0]],
- array_values($filter)[0]
- );
- }
- }
- }
+ dd('left to be run plainly');
}
}
private function getDbQueryResults()
{
- // if (isset($_SERVER['QUERY_STRING'])) {
- // $qr = $_SERVER['QUERY_STRING'];
- // $parsed;
- // parse_str($qr, $parsed);
- // }
$parsed = $this->parse();
@@ -659,12 +731,9 @@ class DataGrid
if (!empty($this->select)) {
$this->getSelect();
}
+
$this->getQueryWithColumnFilters();
- // if (isset($_SERVER['QUERY_STRING'])) {
- // $qr = $_SERVER['QUERY_STRING'];
- // $parsed;
- // parse_str($qr, $parsed);
- // }
+
$parsed = $this->parse();
if (!empty($parsed)) {
$this->getQueryWithFilters();
diff --git a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss
index c66e36cbe..d502f22b8 100644
--- a/packages/Webkul/Ui/src/Resources/assets/sass/app.scss
+++ b/packages/Webkul/Ui/src/Resources/assets/sass/app.scss
@@ -631,6 +631,7 @@ h2 {
ul {
li.filter-column-dropdown {
.filter-column-select {
+ width: 100%;
background: #fff;
border: 2px solid #c7c7c7;
border-radius: 3px;
@@ -740,6 +741,7 @@ h2 {
margin: 5px;
height: 18px !important;
width: 18px !important;
+ cursor: pointer;
}
}
}
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 818c512c6..266d68641 100644
--- a/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php
+++ b/packages/Webkul/Ui/src/Resources/views/datagrid/index.blade.php
@@ -26,7 +26,6 @@
$(document).ready(function(){
params = (new URL(document.location)).search;
-
if(params.length>0){
if(allFilters1.length == 0) {
//call reverse url function
@@ -35,25 +34,19 @@
}
$('.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() {
+ //controls for header when sorting is done
+ $('.grid_head').on('click', function() {
var column = $(this).data('column-name');
var currentSort = $(this).data('column-sort');
- console.log(column, currentSort);
- // return false;
- if(currentSort == "asc") {
- $(this).data('column-name','desc');
- formURL(column,'sort','desc',params);
- }else{
- $(this).data('column-name','asc');
- formURL(column,'sort','asc',params);
- }
+ if(currentSort == "asc")
+ formURL("sort",column,"desc",params);
+ else if(currentSort == "desc")
+ formURL("sort",column,"asc",params);
});
+
$('select.filter-column-select').change(function() {
typeValue = $('select.filter-column-select').find(':selected').data('type');
selectedColumn = $('select.filter-column-select').find(':selected').val();
@@ -131,12 +124,10 @@
});
});
+
//remove the filter and from clicking on cross icon on tag
$('.remove-filter').on('click', function(){
- // console.log('removing');
var id = $(this).parents('.filter-one').attr('id');
- // console.log(allFilters1.length);
-
if(allFilters1.length == 1){
allFilters1.pop();
var uri = window.location.href.toString();
@@ -218,203 +209,206 @@
}
});
- //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','');
- // });
-
- // $('.b-res').css('visibility','hidden');
- // $('.t-res').css('visibility','hidden');
- // $('.ma-action').css('visibility','hidden');
- // var ma_selected_col;
- // var ma_selected_type;
- // var ma_selected_action;
- // $('select.ma-col').change(function() {
- // ma_selected_col = $('select.ma-col').find(':selected').val();
- // ma_selected_type = $('select.ma-col').find(':selected').data('type');
- // $('.ma-action').css('visibility','visible');
- // console.log(ma_selected_col,ma_selected_type);
- // });
- // $('.ma-action').change(function(){
- // ma_selected_action = $('select.ma-action').find(':selected').val();
- // });
- // if(ma_selected_action == "update") {
- // if(ma_selected_type="boolean") {
- // $('.b-res').css('visibility','visible');
- // }
- // } else if(ma_selected_action == "delete"){
- // $('.b-res').css('visibility','visible');
- // }
-
});
- //this function is only to barrayFromUrle used when there is search param and the allFilter is empty in order to repopulate
- // and make the filter or sort tags again
- function arrayFromUrl(x){
- // console.log(allFilters1);
- // console.log(x);
- t = x.slice(1,x.length);
+
+ //make the url from the array and redirect
+ function makeURL() {
+ if(allFilters1.length>0)
+ {
+ for(i=0;i'+ label +''+allFilters1[i][j][k] +'';
- $('.filter-row-two').append(filter_card);
- }
- }
- }
- }
-
- function makeTagsTest(column, condition, response, urlparams) {
-
- var tmp = {};
- tmp[column] = {
- [condition]:response
- };
-
- var filterRepeat = 0;
- //make sure the filter or sort param is not duplicate before pushing it into the all filters array
- if(allFilters1.length!=0)
- for(var i = 0;i'+ response +'';
+ var filter_card = ''+ allFilters1[i].column +''+ allFilters1[i].val +'';
$('.filter-row-two').append(filter_card);
- makeURL(allFilters1);
- count_filters++;
}
- else
- alert("This filter is already applied");
}
- //prepare URL from the all filters array
- function makeURL(x) {
- var y,k,z,c,d;
+ //obselete or can be used for mediation control if necessary
+ function formURL(column, condition, response, urlparams) {
+ /*validate the conditions here and do the replacements and
+ push here in the all filters array*/
+ var obj1 = {};
+ /*
+ 1. do check for repeated filter and just return false
+ 2. do check for repeated sorting and toggle rempve it.
+ 3. do check for search and replace the search value with
+ the new one
+ */
- var filt_url = '';
-
- for(y in x) {
- k = x[y];
- for(z in k) {
- c = k[z];
- for(d in c){
- // console.log(y); //first element of per which will make the url filter or sort
- // console.log(z); //name of the column which is needed to be filtered or sorted
- // console.log(d); //any condition or just sort
- // console.log(c[d]); //filter value or response
+ if(allFilters1.length>0) {
+ //case for repeated filter
+ if(column != "sort" && column != "search") {
+ filter_repeated = 0;
+ for(j=0;j0) {
+ // for(i=0;i0 && pos!=-1 && pos1!=-1){
- // filt = filt + '&' + parseInt(count_filters+1) + '=' + column + array_start + condition + array_end + '=' + response;
- // makeTagsTest(column, condition, response, urlparams,parseInt(count_filters));
- // // document.location = myURL + filt;
- // }
- // else{
- // filt = '?' + parseInt(count_filters) + '=' + column + array_start + condition + array_end + '=' + response;
- // makeTagsTest(column, condition, response, urlparams,parseInt(count_filters));
- // // document.location = myURL + filt;
+ // else {
+
+ // obj1.column=column;
+ // obj1.cond=condition;
+ // obj1.val=response;
+ // allFilters1.push(obj1);
+ // console.log("1111111111111");
+ // obj1={ };
+ // makeURL();
+
// }
}
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 5e1c5690c..b51bcf0ee 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
@@ -43,7 +43,7 @@
@foreach ($columns as $column)
@if($column->sortable == "true")
- {!! $column->sorting() !!}
+ | {!! $column->sorting() !!}
|
@else
{!! $column->sorting() !!} |
diff --git a/public/vendor/webkul/customer/assets/css/customer.css b/public/vendor/webkul/customer/assets/css/customer.css
index acbb94bb2..fa1b0ebfb 100644
--- a/public/vendor/webkul/customer/assets/css/customer.css
+++ b/public/vendor/webkul/customer/assets/css/customer.css
@@ -72,6 +72,14 @@
.dashboard-content {
width: 100%;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-orient: horizontal;
+ -webkit-box-direction: normal;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ border: 1px solid red;
margin-top: 5.5%;
margin-bottom: 5.5%;
}
@@ -94,6 +102,8 @@
background: #ffffff;
width: 25%;
text-transform: capitalize;
+ font-size: 16px;
+ color: #5e5e5e;
}
.dashboard-content .dashboard-side-menu li {
@@ -129,3 +139,20 @@
.dashboard-content .dashboard-side-menu li:last-child {
border-bottom: none;
}
+
+.dashboard-content .profile {
+ margin-left: 5.5%;
+}
+
+.dashboard-content .profile .section-heading {
+ height: 50px;
+ font-size: 28px;
+ color: #242424;
+ text-transform: capitalize;
+ text-align: left;
+}
+
+.dashboard-content .profile-content {
+ font-size: 16px;
+ color: #5e5e5e;
+}
diff --git a/public/vendor/webkul/ui/assets/css/ui.css b/public/vendor/webkul/ui/assets/css/ui.css
index 77d2871c6..fd4366dae 100644
--- a/public/vendor/webkul/ui/assets/css/ui.css
+++ b/public/vendor/webkul/ui/assets/css/ui.css
@@ -900,6 +900,7 @@ h2 {
}
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li.filter-column-dropdown .filter-column-select {
+ width: 100%;
background: #fff;
border: 2px solid #c7c7c7;
border-radius: 3px;
@@ -1014,6 +1015,7 @@ h2 {
margin: 5px;
height: 18px !important;
width: 18px !important;
+ cursor: pointer;
}
.grid-container .table thead .xyz {