From 60babb693db874c4580b079b925b2edd9c86dfb8 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Mon, 10 Dec 2018 09:58:45 +0530 Subject: [PATCH] Previous datagrid columns for date and booleans were of type string but they have been changed according to the new filters for the respective --- .../Admin/src/DataGrids/AttributeDataGrid.php | 25 +++++++++++++++---- .../Admin/src/DataGrids/CategoryDataGrid.php | 4 +-- .../DataGrids/InventorySourcesDataGrid.php | 7 +++++- .../src/DataGrids/OrderInvoicesDataGrid.php | 9 +++++-- .../src/DataGrids/OrderShipmentsDataGrid.php | 9 +++++-- .../Admin/src/DataGrids/ProductDataGrid.php | 7 +++++- 6 files changed, 48 insertions(+), 13 deletions(-) diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index 4610d1e6d..0e8382e5d 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -92,7 +92,7 @@ class AttributeDataGrid ], [ 'name' => 'is_unique', 'alias' => 'attributeIsUnique', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Unique', 'sortable' => true, 'wrapper' => function ($value) { @@ -104,7 +104,7 @@ class AttributeDataGrid ], [ 'name' => 'value_per_locale', 'alias' => 'attributeValuePerLocale', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Locale based', 'sortable' => true, 'wrapper' => function ($value) { @@ -116,7 +116,7 @@ class AttributeDataGrid ], [ 'name' => 'value_per_channel', 'alias' => 'attributeValuePerChannel', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Channel based', 'sortable' => true, 'wrapper' => function ($value) { @@ -125,7 +125,7 @@ class AttributeDataGrid else return "True"; }, - ], + ] ], 'filterable' => [ @@ -154,7 +154,22 @@ class AttributeDataGrid 'alias' => 'attributeIsRequired', 'type' => 'boolean', 'label' => 'Required', - ], + ], [ + 'name' => 'is_unique', + 'alias' => 'attributeIsUnique', + 'type' => 'boolean', + 'label' => 'Unique', + ], [ + 'name' => 'value_per_locale', + 'alias' => 'attributeValuePerLocale', + 'type' => 'boolean', + 'label' => 'Locale based', + ], [ + 'name' => 'value_per_channel', + 'alias' => 'attributeValuePerChannel', + 'type' => 'boolean', + 'label' => 'Channel based', + ] ], //don't use aliasing in case of searchables diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 42b5cc039..313cec54d 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -85,7 +85,7 @@ class CategoryDataGrid ], [ 'name' => 'cat.status', 'alias' => 'catstatus', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Visible in Menu', 'sortable' => true, 'wrapper' => function ($value) { @@ -121,7 +121,7 @@ class CategoryDataGrid ], [ 'column' => 'cat.status', 'alias' => 'catstatus', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Visible in Menu', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index 1013a2626..65c3f3858 100644 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -89,7 +89,7 @@ class InventorySourcesDataGrid ], [ 'name' => 'status', 'alias' => 'inventoryStatus', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Status', 'sortable' => true, 'wrapper' => function ($value) { @@ -120,6 +120,11 @@ class InventorySourcesDataGrid 'alias' => 'inventoryName', 'type' => 'string', 'label' => 'Name', + ], [ + 'name' => 'status', + 'alias' => 'inventoryStatus', + 'type' => 'boolean', + 'label' => 'Status', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php index 8807d9fda..387cc6444 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php @@ -76,7 +76,7 @@ class OrderInvoicesDataGrid 'alias' => 'invstate', 'type' => 'string', 'label' => 'State', - 'sortable' => false + 'sortable' => true ], [ 'name' => 'inv.grand_total', 'alias' => 'invgrandtotal', @@ -89,7 +89,7 @@ class OrderInvoicesDataGrid ], [ 'name' => 'inv.created_at', 'alias' => 'invcreated_at', - 'type' => 'date', + 'type' => 'datetime', 'label' => 'Invoice Date', 'sortable' => true ] @@ -101,6 +101,11 @@ class OrderInvoicesDataGrid 'alias' => 'invid', 'type' => 'number', 'label' => 'ID', + ], [ + 'column' => 'inv.created_at', + 'alias' => 'invcreated_at', + 'type' => 'datetime', + 'label' => 'Invoice Date', ] ], //don't use aliasing in case of searchables diff --git a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php index 37ed7a34a..9c2feae0a 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php @@ -91,9 +91,9 @@ class OrderShipmentsDataGrid ], [ 'name' => 'ship.created_at', 'alias' => 'shipdate', - 'type' => 'string', + 'type' => 'datetime', 'label' => 'Shipment Date', - 'sortable' => false + 'sortable' => true ] ], @@ -103,6 +103,11 @@ class OrderShipmentsDataGrid 'alias' => 'shipID', 'type' => 'number', 'label' => 'ID', + ], [ + 'column' => 'ship.created_at', + 'alias' => 'shipdate', + 'type' => 'datetime', + 'label' => 'Shipment Date', ] ], //don't use aliasing in case of searchables diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 808a3dd45..c6faf091b 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -93,7 +93,7 @@ class ProductDataGrid ], [ 'name' => 'prods.status', 'alias' => 'ProductStatus', - 'type' => 'string', + 'type' => 'boolean', 'label' => 'Status', 'sortable' => true, 'wrapper' => function ($value) { @@ -148,6 +148,11 @@ class ProductDataGrid 'alias' => 'ProductType', 'type' => 'string', 'label' => 'Product Type', + ], [ + 'name' => 'prods.status', + 'alias' => 'ProductStatus', + 'type' => 'boolean', + 'label' => 'Status' ] ], //don't use aliasing in case of searchables