From e1f7b4deff4ca4c9e0437124f0382ff8b3982de2 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Thu, 29 Nov 2018 15:40:23 +0530 Subject: [PATCH] datagrid issue fixes, some column aliases were using underscores due to a bug in symfony it was getting converted into dot, all the aliases are now underscore free --- .../Admin/src/DataGrids/AttributeDataGrid.php | 31 ++++------ .../src/DataGrids/AttributeFamilyDataGrid.php | 16 ++--- .../Admin/src/DataGrids/CategoryDataGrid.php | 58 +++++++------------ .../Admin/src/DataGrids/ChannelDataGrid.php | 48 ++++++++------- .../Admin/src/DataGrids/CountryDataGrid.php | 33 +++++------ .../Admin/src/DataGrids/CurrencyDataGrid.php | 19 +++--- .../Admin/src/DataGrids/CustomerDataGrid.php | 27 ++++----- .../src/DataGrids/CustomerGroupDataGrid.php | 10 ++-- .../src/DataGrids/ExchangeRatesDataGrid.php | 10 ++++ .../DataGrids/InventorySourcesDataGrid.php | 17 +++--- .../Admin/src/DataGrids/LocalesDataGrid.php | 21 ++----- .../Admin/src/DataGrids/OrderDataGrid.php | 12 ++-- .../src/DataGrids/OrderInvoicesDataGrid.php | 34 ++++++----- .../src/DataGrids/OrderShipmentsDataGrid.php | 15 +++-- .../Admin/src/DataGrids/ProductDataGrid.php | 12 ++-- .../src/DataGrids/ProductReviewDataGrid.php | 13 +++-- .../Admin/src/DataGrids/SliderDataGrid.php | 19 +++--- .../src/DataGrids/TaxCategoryDataGrid.php | 20 +++---- .../Admin/src/DataGrids/TaxRateDataGrid.php | 29 ++++++---- .../Admin/src/DataGrids/UserDataGrid.php | 44 +++++++++----- 20 files changed, 236 insertions(+), 252 deletions(-) diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index c0f13c043..0a02a2c4d 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -65,73 +65,66 @@ class AttributeDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'attributeCode', 'type' => 'string', 'label' => 'Code', 'sortable' => true, - ], - [ + ], [ 'name' => 'admin_name', 'alias' => 'attributeAdminName', 'type' => 'string', 'label' => 'Name', 'sortable' => true, - ], - [ + ], [ 'name' => 'type', 'alias' => 'attributeType', 'type' => 'string', 'label' => 'Type', - 'sortable' => false, - ], - [ + 'sortable' => true, + ], [ 'name' => 'is_required', 'alias' => 'attributeIsRequired', 'type' => 'string', 'label' => 'Required', - 'sortable' => false, + 'sortable' => true, 'wrapper' => function ($value) { if($value == 0) return "False"; else return "True"; }, - ], - [ + ], [ 'name' => 'is_unique', 'alias' => 'attributeIsUnique', 'type' => 'string', 'label' => 'Unique', - 'sortable' => false, + 'sortable' => true, 'wrapper' => function ($value) { if($value == 0) return "False"; else return "True"; }, - ], - [ + ], [ 'name' => 'value_per_locale', 'alias' => 'attributeValuePerLocale', 'type' => 'string', 'label' => 'ValuePerLocale', - 'sortable' => false, + 'sortable' => true, 'wrapper' => function ($value) { if($value == 0) return "False"; else return "True"; }, - ], - [ + ], [ 'name' => 'value_per_channel', 'alias' => 'attributeValuePerChannel', 'type' => 'string', 'label' => 'ValuePerChannel', - 'sortable' => false, + 'sortable' => true, 'wrapper' => function ($value) { if($value == 0) return "False"; diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php index aaa941446..2bf1bae1c 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php @@ -68,22 +68,19 @@ class AttributeFamilyDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 'id', 'alias' => 'attributeFamilyId', 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'attributeFamilyCode', 'type' => 'string', 'label' => 'Code', 'sortable' => true, - ], - [ + ], [ 'name' => 'name', 'alias' => 'attributeFamilyName', 'type' => 'string', @@ -98,14 +95,12 @@ class AttributeFamilyDataGrid 'alias' => 'attributeFamilyId', 'type' => 'number', 'label' => 'ID', - ], - [ + ], [ 'column' => 'code', 'alias' => 'attributeFamilyCode', 'type' => 'string', 'label' => 'Code', - ], - [ + ], [ 'column' => 'name', 'alias' => 'attributeFamilyName', 'type' => 'string', @@ -120,8 +115,7 @@ class AttributeFamilyDataGrid 'column' => 'name', 'type' => 'string', 'label' => 'Name', - ], - [ + ], [ 'column' => 'code', 'type' => 'string', 'label' => 'Code', diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 3a2ff7f5f..7cc12f244 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -70,33 +70,25 @@ class CategoryDataGrid 'columns' => [ [ 'name' => 'cat.id', - 'alias' => 'cat_id', + 'alias' => 'catid', 'type' => 'number', - 'label' => 'Category ID', + 'label' => 'ID', 'sortable' => true, ], [ 'name' => 'ct.name', - 'alias' => 'cat_name', + 'alias' => 'catname', 'type' => 'string', - 'label' => 'Category Name', - 'sortable' => false, + 'label' => 'Name', + 'sortable' => true, ], [ 'name' => 'cat.position', - 'alias' => 'cat_position', + 'alias' => 'catposition', 'type' => 'string', - 'label' => 'Category Position', - 'sortable' => false, - ], - // [ - // 'name' => 'cta.name', - // 'alias' => 'parent_name', - // 'type' => 'string', - // 'label' => 'Parent Name', - // 'sortable' => true, - // ], - [ + 'label' => 'Position', + 'sortable' => true, + ], [ 'name' => 'cat.status', - 'alias' => 'cat_status', + 'alias' => 'catstatus', 'type' => 'string', 'label' => 'Visible in Menu', 'sortable' => true, @@ -106,13 +98,12 @@ class CategoryDataGrid else return "True"; }, - ], - [ + ], [ 'name' => 'ct.locale', - 'alias' => 'cat_locale', + 'alias' => 'catlocale', 'type' => 'string', 'label' => 'Locale', - 'sortable' => false, + 'sortable' => true, 'filter' => [ 'function' => 'orWhere', 'condition' => ['ct.locale', app()->getLocale()] @@ -123,24 +114,17 @@ class CategoryDataGrid 'filterable' => [ [ 'column' => 'cat.id', - 'alias' => 'cat_id', + 'alias' => 'catid', 'type' => 'number', - 'label' => 'Category ID', + 'label' => 'ID', ], [ 'column' => 'ct.name', - 'alias' => 'cat_name', + 'alias' => 'catname', 'type' => 'string', - 'label' => 'Category Name', - ], - // [ - // 'column' => 'cta.name', - // 'alias' => 'parentName', - // 'type' => 'string', - // 'label' => 'Parent Name', - // ], - [ + 'label' => 'Name', + ], [ 'column' => 'cat.status', - 'alias' => 'cat_status', + 'alias' => 'catstatus', 'type' => 'string', 'label' => 'Visible in Menu', ], @@ -152,11 +136,11 @@ class CategoryDataGrid [ 'column' => 'cat.id', 'type' => 'number', - 'label' => 'Category ID', + 'label' => 'ID', ], [ 'column' => 'ct.name', 'type' => 'string', - 'label' => 'Category Name', + 'label' => 'Name', ], [ 'column' => 'cat.status', 'type' => 'string', diff --git a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php index ac8f322dd..7c6c03280 100644 --- a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php @@ -68,51 +68,50 @@ class ChannelDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 'id', 'alias' => 'channelID', 'type' => 'number', - 'label' => 'Channel ID', + 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'channelCode', 'type' => 'string', - 'label' => 'Channel Code', + 'label' => 'Code', 'sortable' => true, - ], - [ + ], [ 'name' => 'name', 'alias' => 'channelName', 'type' => 'string', - 'label' => 'Channel Name', + 'label' => 'Name', + 'sortable' => true, + ], [ + 'name' => 'hostname', + 'alias' => 'channelHostName', + 'type' => 'string', + 'label' => 'Host Name', 'sortable' => true, ], - ], //don't use aliasing in case of filters - 'filterable' => [ [ 'column' => 'id', 'alias' => 'channelID', 'type' => 'number', - 'label' => 'Channel ID', - ], - [ + 'label' => 'ID', + ], [ 'column' => 'code', 'alias' => 'channelCode', 'type' => 'string', - 'label' => 'Channel Code', - ], - [ + 'label' => 'Code', + ], [ 'column' => 'name', 'alias' => 'channelName', 'type' => 'string', - 'label' => 'Channel Name', + 'label' => 'Name', ], ], @@ -122,12 +121,19 @@ class ChannelDataGrid [ 'column' => 'name', 'type' => 'string', - 'label' => 'Channel Name', - ], - [ + 'label' => 'Name', + ], [ 'column' => 'code', 'type' => 'string', - 'label' => 'Channel Code', + 'label' => 'Code', + ], [ + 'column' => 'hostname', + 'type' => 'string', + 'label' => 'Host Name', + ], [ + 'column' => 'name', + 'type' => 'string', + 'label' => 'Name', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php index 4ca12c7dd..c4eeee72a 100644 --- a/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php @@ -68,29 +68,25 @@ class CountryDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 'id', 'alias' => 'countryId', 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'countryCode', 'type' => 'string', 'label' => 'Code', 'sortable' => true, - ], - [ + ], [ 'name' => 'name', 'alias' => 'countryName', 'type' => 'string', 'label' => 'Name', 'sortable' => true, - ], - [ + ], [ 'name' => 'status', 'alias' => 'countryStatus', 'type' => 'number', @@ -101,27 +97,23 @@ class CountryDataGrid ], //don't use aliasing in case of filters - 'filterable' => [ [ 'column' => 'id', 'alias' => 'countryId', 'type' => 'number', 'label' => 'ID', - ], - [ + ], [ 'column' => 'code', 'alias' => 'countryCode', 'type' => 'string', 'label' => 'Code', - ], - [ + ], [ 'column' => 'name', 'alias' => 'countryName', 'type' => 'string', 'label' => 'Name', - ], - [ + ], [ 'column' => 'status', 'alias' => 'countryStatus', 'type' => 'number', @@ -136,12 +128,19 @@ class CountryDataGrid 'column' => 'name', 'type' => 'string', 'label' => 'Name', - ], - [ + ], [ 'column' => 'code', 'type' => 'string', 'label' => 'Code', - ], + ], [ + 'column' => 'name', + 'type' => 'string', + 'label' => 'Name', + ], [ + 'column' => 'status', + 'type' => 'number', + 'label' => 'Code', + ] ], //list of viable operators that will be used diff --git a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php index 339765f54..8d08c4f15 100644 --- a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php @@ -74,15 +74,13 @@ class CurrencyDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'currencyCode', 'type' => 'string', 'label' => 'Code', 'sortable' => true, - ], - [ + ], [ 'name' => 'name', 'alias' => 'currencyName', 'type' => 'string', @@ -100,14 +98,12 @@ class CurrencyDataGrid 'alias' => 'currencyId', 'type' => 'number', 'label' => 'ID', - ], - [ + ], [ 'column' => 'code', 'alias' => 'currencyCode', 'type' => 'string', 'label' => 'Code', - ], - [ + ], [ 'column' => 'name', 'alias' => 'currencyName', 'type' => 'string', @@ -119,11 +115,14 @@ class CurrencyDataGrid 'searchable' => [ [ + 'column' => 'id', + 'alias' => 'currencyId', + 'type' => 'number', + ], [ 'column' => 'name', 'type' => 'string', 'label' => 'Name', - ], - [ + ], [ 'column' => 'code', 'type' => 'string', 'label' => 'Code', diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index b58ed695a..16e9ad51f 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -65,22 +65,19 @@ class CustomerDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'CONCAT(first_name, " ", last_name)', 'alias' => 'Name', 'type' => 'string', 'label' => 'Name', 'sortable' => true, - ], - [ + ], [ 'name' => 'email', 'alias' => 'Email', 'type' => 'string', 'label' => 'Email', 'sortable' => false, - ], - [ + ], [ 'name' => 'customer_group_id', 'alias' => 'CustomerGroupId', 'type' => 'number', @@ -90,21 +87,18 @@ class CustomerDataGrid ], //don't use aliasing in case of filters - 'filterable' => [ - [ 'column' => 'id', 'alias' => 'ID', 'type' => 'number', 'label' => 'ID', - ], - [ - 'column' => 'first_name', - 'alias' => 'FirstName', + ], [ + 'column' => 'email', + 'alias' => 'Email', 'type' => 'string', - 'label' => 'First Name', - ] + 'label' => 'Email', + ], ], //don't use aliasing in case of searchables @@ -114,11 +108,10 @@ class CustomerDataGrid 'column' => 'FirstName', 'type' => 'string', 'label' => 'First Name', - ], - [ + ], [ 'column' => 'email', + 'alias' => 'Email', 'type' => 'string', - 'label' => 'Email', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php index bcd8bf2da..6ce3070ff 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php @@ -82,8 +82,7 @@ class CustomerGroupDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'cg.name', 'alias' => 'Name', 'type' => 'string', @@ -91,6 +90,7 @@ class CustomerGroupDataGrid 'sortable' => true, ], ], + //don't use aliasing in case of filters 'filterable' => [ [ @@ -98,8 +98,7 @@ class CustomerGroupDataGrid 'alias' => 'Name', 'type' => 'string', 'label' => 'Name' - ], - [ + ], [ 'column' => 'cg.id', 'alias' => 'ID', 'type' => 'number', @@ -112,8 +111,7 @@ class CustomerGroupDataGrid 'column' => 'cg.id', 'type' => 'number', 'label' => 'Id' - ], - [ + ], [ 'column' => 'cg.name', 'type' => 'string', 'label' => 'Name' diff --git a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php index 93ea66e1c..5f2db32b8 100644 --- a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php @@ -85,6 +85,7 @@ class ExchangeRatesDataGrid 'alias' => 'exchrate', 'type' => 'string', 'label' => 'Exchange Rate', + 'sortable' => true ], ], @@ -100,6 +101,11 @@ class ExchangeRatesDataGrid 'alias' => 'exchcurrname', 'type' => 'string', 'label' => 'Currency Name', + ], [ + 'column' => 'cer.rate', + 'alias' => 'exchrate', + 'type' => 'string', + 'label' => 'Exchange Rate', ], ], @@ -109,6 +115,10 @@ class ExchangeRatesDataGrid 'column' => 'exchcurrname', 'type' => 'string', 'label' => 'Currency Name', + ], [ + 'column' => 'cer.rate', + 'type' => 'string', + 'label' => 'Exchange Rate', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index dc8e8edae..ca40fe7b6 100644 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -77,13 +77,13 @@ class InventorySourcesDataGrid 'alias' => 'inventoryCode', 'type' => 'string', 'label' => 'Code', - 'sortable' => false, + 'sortable' => true, ], [ 'name' => 'name', 'alias' => 'inventoryName', 'type' => 'string', 'label' => 'Name', - 'sortable' => false, + 'sortable' => true, ], [ 'name' => 'priority', 'alias' => 'inventoryPriority', @@ -114,14 +114,12 @@ class InventorySourcesDataGrid 'alias' => 'inventoryID', 'type' => 'number', 'label' => 'ID', - ], - [ + ], [ 'column' => 'code', 'alias' => 'inventoryCode', 'type' => 'string', 'label' => 'Code', - ], - [ + ], [ 'column' => 'name', 'alias' => 'inventoryName', 'type' => 'string', @@ -136,11 +134,14 @@ class InventorySourcesDataGrid 'column' => 'name', 'type' => 'string', 'label' => 'Name', - ], - [ + ], [ 'column' => 'code', 'type' => 'string', 'label' => 'Code', + ], [ + 'column' => 'name', + 'type' => 'string', + 'label' => 'Name', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php index e16906952..60dc9444a 100644 --- a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php @@ -64,25 +64,21 @@ class LocalesDataGrid // ] ], - //use aliasing on secodary columns if join is performed - + //use aliasing as attribute 'columns' => [ - [ 'name' => 'id', 'alias' => 'localeId', 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'localeCode', 'type' => 'string', 'label' => 'Code', 'sortable' => true, - ], - [ + ], [ 'name' => 'name', 'alias' => 'localeName', 'type' => 'string', @@ -93,21 +89,18 @@ class LocalesDataGrid ], //don't use aliasing in case of filters - 'filterable' => [ [ 'column' => 'id', 'alias' => 'localeId', 'type' => 'number', 'label' => 'ID', - ], - [ + ], [ 'column' => 'code', 'alias' => 'localeCode', 'type' => 'string', 'label' => 'Code', - ], - [ + ], [ 'column' => 'name', 'alias' => 'localeName', 'type' => 'string', @@ -116,14 +109,12 @@ class LocalesDataGrid ], //don't use aliasing in case of searchables - 'searchable' => [ [ 'column' => 'name', 'type' => 'string', 'label' => 'Name', - ], - [ + ], [ 'column' => 'code', 'type' => 'string', 'label' => 'Code', diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php index f8fd17b5d..155ecdfcf 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -92,10 +92,10 @@ class OrderDataGrid } ], [ 'name' => 'or.created_at', - 'alias' => 'created_at', + 'alias' => 'createdat', 'type' => 'string', 'label' => 'Order Date', - 'sortable' => false, + 'sortable' => true, ], [ 'name' => 'or.status', 'alias' => 'orstatus', @@ -129,11 +129,11 @@ class OrderDataGrid 'type' => 'number', 'label' => 'ID', ], [ - 'name' => 'or.status', + 'column' => 'or.status', 'alias' => 'orstatus', 'type' => 'string', 'label' => 'Status' - ] + ], ], //don't use aliasing in case of searchables @@ -142,12 +142,10 @@ class OrderDataGrid 'column' => 'or.id', 'alias' => 'orderid', 'type' => 'number', - 'label' => 'ID', ], [ - 'name' => 'or.status', + 'column' => 'or.status', 'alias' => 'orstatus', 'type' => 'string', - 'label' => 'Status' ] ], diff --git a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php index 739ea31fe..25aaf8853 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php @@ -55,13 +55,13 @@ class OrderInvoicesDataGrid ], 'join' => [ - [ - 'join' => 'leftjoin', - 'table' => 'orders as ors', - 'primaryKey' => 'inv.order_id', - 'condition' => '=', - 'secondaryKey' => 'ors.id', - ] + // [ + // 'join' => 'leftjoin', + // 'table' => 'orders as ors', + // 'primaryKey' => 'inv.order_id', + // 'condition' => '=', + // 'secondaryKey' => 'ors.id', + // ] ], //use aliasing on secodary columns if join is performed @@ -79,24 +79,26 @@ class OrderInvoicesDataGrid 'type' => 'number', 'label' => 'Order ID', 'sortable' => true - ], [ - 'name' => 'inv.state', - 'alias' => 'invstate', - 'type' => 'string', - 'label' => 'State', - 'sortable' => false - ], [ + ], + // [ + // 'name' => 'inv.state', + // 'alias' => 'invstate', + // 'type' => 'string', + // 'label' => 'State', + // 'sortable' => false + // ], + [ 'name' => 'inv.grand_total', 'alias' => 'invgrandtotal', 'type' => 'number', 'label' => 'Amount', - 'sortable' => false + 'sortable' => true ], [ 'name' => 'inv.created_at', 'alias' => 'invcreated_at', 'type' => 'date', 'label' => 'Invoice Date', - 'sortable' => false + 'sortable' => true ] ], diff --git a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php index 508db54bb..51b3b0c70 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php @@ -68,19 +68,19 @@ class OrderShipmentsDataGrid 'sortable' => true ], [ 'name' => 'ship.order_id', - 'alias' => 'order_id', + 'alias' => 'orderid', 'type' => 'number', 'label' => 'Order ID', 'sortable' => true ], [ 'name' => 'ship.total_qty', - 'alias' => 'total_qty', + 'alias' => 'shiptotalqty', 'type' => 'number', 'label' => 'Total Quantity', 'sortable' => true ], [ 'name' => 'CONCAT(ors.customer_first_name, " ", ors.customer_last_name)', - 'alias' => 'order_customer_first_name', + 'alias' => 'ordercustomerfirstname', 'type' => 'string', 'label' => 'Customer Name', 'sortable' => false, @@ -92,7 +92,7 @@ class OrderShipmentsDataGrid 'sortable' => true ], [ 'name' => 'ship.created_at', - 'alias' => 'ship_date', + 'alias' => 'shipdate', 'type' => 'string', 'label' => 'Shipment Date', 'sortable' => false @@ -111,10 +111,9 @@ class OrderShipmentsDataGrid 'searchable' => [ // [ - // 'column' => 'or.id', - // 'alias' => 'orderid', - // 'type' => 'number', - // 'label' => 'ID', + // 'column' => 'ors.customer_first_name', + // 'alias' => 'ordercustomerfirstname', + // 'type' => 'string', // ] ], diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 475fb0339..28b3f86fd 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -71,19 +71,19 @@ class ProductDataGrid 'alias' => 'ProductName', 'type' => 'string', 'label' => 'Name', - 'sortable' => false, + 'sortable' => true, ], [ 'name' => 'prods.type', 'alias' => 'ProductType', 'type' => 'string', 'label' => 'Type', - 'sortable' => false, + 'sortable' => true, ], [ 'name' => 'prods.status', 'alias' => 'ProductStatus', 'type' => 'string', 'label' => 'Status', - 'sortable' => false, + 'sortable' => true, 'wrapper' => function ($value) { if($value == 1) return 'Active'; @@ -95,13 +95,13 @@ class ProductDataGrid 'alias' => 'ProductPrice', 'type' => 'string', 'label' => 'Price', - 'sortable' => false, + 'sortable' => true, 'wrapper' => function ($value) { return core()->formatBasePrice($value); }, ], [ 'name' => 'prods.attribute_family_name', - 'alias' => 'product_attribute_family_name', + 'alias' => 'productattributefamilyname', 'type' => 'string', 'label' => 'Attribute Family', 'sortable' => true, @@ -110,7 +110,7 @@ class ProductDataGrid 'alias' => 'ProductQuantity', 'type' => 'string', 'label' => 'Product Quantity', - 'sortable' => false, + 'sortable' => true, ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php index e409bed3e..0e7bfb76b 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductReviewDataGrid.php @@ -69,7 +69,6 @@ class ProductReviewDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 'pr.id', 'alias' => 'reviewId', @@ -88,15 +87,13 @@ class ProductReviewDataGrid 'type' => 'string', 'label' => 'Comment', 'sortable' => true, - ], - [ + ], [ 'name' => 'pt.name', 'alias' => 'productName', 'type' => 'string', 'label' => 'Product Name', 'sortable' => true, - ], - [ + ], [ 'name' => 'pr.status', 'alias' => 'reviewStatus', 'type' => 'number', @@ -134,7 +131,7 @@ class ProductReviewDataGrid 'alias' => 'productName', 'type' => 'string', 'label' => 'Product Name', - ],[ + ], [ 'column' => 'pr.status', 'alias' => 'reviewStatus', 'type' => 'string', @@ -152,6 +149,10 @@ class ProductReviewDataGrid 'column' => 'rating', 'type' => 'number', 'label' => 'Rating', + ], [ + 'column' => 'pt.name', + 'alias' => 'productName', + 'type' => 'string', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php index 1a08c1bf1..0a4b9cfd2 100644 --- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php @@ -78,13 +78,7 @@ class SliderDataGrid 'alias' => 'sliderTitle', 'type' => 'string', 'label' => 'title', - 'sortable' => false - ], [ - 'name' => 's.channel_id', - 'alias' => 'channelId', - 'type' => 'string', - 'label' => 'Channel ID', - 'sortable' => false, + 'sortable' => true ], [ 'name' => 'c.name', 'alias' => 'channelName', @@ -106,7 +100,12 @@ class SliderDataGrid 'alias' => 'sliderTitle', 'type' => 'string', 'label' => 'title' - ], + ], [ + 'column' => 'c.name', + 'alias' => 'channelName', + 'type' => 'string', + 'label' => 'Channel Name', + ] ], //don't use aliasing in case of searchables @@ -119,6 +118,10 @@ class SliderDataGrid 'column' => 's.title', 'type' => 'string', 'label' => 'Slider Title' + ], [ + 'column' => 'c.name', + 'type' => 'string', + 'label' => 'Channel Name', ] ], diff --git a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php index 0b45d3835..f4eef1910 100644 --- a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php @@ -82,18 +82,13 @@ class TaxCategoryDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'tr.name', 'alias' => 'Name', 'type' => 'string', 'label' => 'Name', 'sortable' => true, - // 'wrapper' => function ($value, $object) { - // return '' . $object->Name . ''; - // }, - ], - [ + ], [ 'name' => 'tr.code', 'alias' => 'code', 'type' => 'string', @@ -101,6 +96,7 @@ class TaxCategoryDataGrid 'sortable' => true, ], ], + //don't use aliasing in case of filters 'filterable' => [ [ @@ -108,28 +104,26 @@ class TaxCategoryDataGrid 'alias' => 'ID', 'type' => 'number', 'label' => 'ID' - ], - [ + ], [ 'column' => 'tr.name', 'alias' => 'Name', 'type' => 'string', 'label' => 'Name' - ], - [ + ], [ 'column' => 'tr.code', 'alias' => 'code', 'type' => 'string', 'label' => 'Code' ] ], + //don't use aliasing in case of searchables 'searchable' => [ [ 'column' => 'tr.code', 'type' => 'string', 'label' => 'Code' - ], - [ + ], [ 'column' => 'tr.name', 'type' => 'string', 'label' => 'Name' diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index 22b9f0d98..d6f8eb1c7 100644 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -73,8 +73,7 @@ class TaxRateDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'tr.identifier', 'alias' => 'identifier', 'type' => 'string', @@ -83,25 +82,21 @@ class TaxRateDataGrid // 'wrapper' => function ($value, $object) { // return '' . $object->identifier . ''; // }, - ], - [ + ], [ 'name' => 'tr.state', 'alias' => 'state', 'type' => 'string', 'label' => 'State', 'sortable' => true, - ], - [ + ], [ 'name' => 'tr.country', 'alias' => 'country', 'type' => 'string', 'label' => 'Country', 'sortable' => true, - ], - - [ + ], [ 'name' => 'tr.tax_rate', - 'alias' => 'tax_rate', + 'alias' => 'taxrate', 'type' => 'number', 'label' => 'Tax Rate', 'sortable' => true, @@ -131,7 +126,7 @@ class TaxRateDataGrid 'label' => 'Country', ], [ 'column' => 'tr.tax_rate', - 'alias' => 'tax_rate', + 'alias' => 'taxrate', 'type' => 'number', 'label' => 'Tax Rate', ], @@ -142,6 +137,18 @@ class TaxRateDataGrid 'column' => 'tr.identifier', 'type' => 'string', 'label' => 'Identifier', + ], [ + 'column' => 'tr.state', + 'type' => 'string', + 'label' => 'State', + ], [ + 'column' => 'tr.country', + 'type' => 'string', + 'label' => 'Country', + ], [ + 'column' => 'tr.tax_rate', + 'type' => 'number', + 'label' => 'Tax Rate', ], ], 'operators' => [ diff --git a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php index ea0dd2f82..d8cfe0b45 100644 --- a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php @@ -87,8 +87,7 @@ class UserDataGrid // 'wrapper' => function ($value, $object) { // return '' . $object->ID . ''; // }, - ], - [ + ], [ 'name' => 'u.name', 'alias' => 'Name', 'type' => 'string', @@ -97,38 +96,43 @@ class UserDataGrid // 'wrapper' => function ($value, $object) { // return '' . $object->Name . ''; // }, - ], - [ + ], [ 'name' => 'u.email', 'alias' => 'Email', 'type' => 'string', 'label' => 'Email', 'sortable' => true, - ], - [ + ], [ 'name' => 'r.name', - 'alias' => 'xa', + 'alias' => 'rolename', 'type' => 'string', 'label' => 'Role Name', 'sortable' => true, ], - ], //don't use aliasing in case of filters 'filterable' => [ - [ - 'column' => 'u.name', - 'alias' => 'Name', - 'type' => 'string', - 'label' => 'Name' - ], [ 'column' => 'u.id', 'alias' => 'ID', 'type' => 'number', 'label' => 'Admin ID' - ], - + ], [ + 'column' => 'u.name', + 'alias' => 'Name', + 'type' => 'string', + 'label' => 'Name' + ], [ + 'column' => 'u.email', + 'alias' => 'Email', + 'type' => 'string', + 'label' => 'Email', + ], [ + 'column' => 'r.name', + 'alias' => 'rolename', + 'type' => 'string', + 'label' => 'Role Name', + ] ], //don't use aliasing in case of searchables 'searchable' => [ @@ -140,6 +144,14 @@ class UserDataGrid 'column' => 'u.name', 'type' => 'string', 'label' => 'Name' + ], [ + 'column' => 'u.email', + 'type' => 'string', + 'label' => 'Email', + ], [ + 'column' => 'r.name', + 'type' => 'string', + 'label' => 'Role Name', ] ], 'operators' => [