Datagrid UI and Configuration fixes
This commit is contained in:
parent
f195b335b6
commit
ddc57abdfa
|
|
@ -60,7 +60,6 @@ class AttributeDataGrid
|
|||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'attributeId',
|
||||
|
|
@ -87,37 +86,60 @@ class AttributeDataGrid
|
|||
'alias' => 'attributeType',
|
||||
'type' => 'string',
|
||||
'label' => 'Type',
|
||||
'sortable' => true,
|
||||
'sortable' => false,
|
||||
],
|
||||
[
|
||||
'name' => 'is_required',
|
||||
'alias' => 'attributeIsRequired',
|
||||
'type' => 'string',
|
||||
'label' => 'Required',
|
||||
'sortable' => true,
|
||||
'sortable' => false,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
'name' => 'is_unique',
|
||||
'alias' => 'attributeIsUnique',
|
||||
'type' => 'string',
|
||||
'label' => 'Unique',
|
||||
'sortable' => true,
|
||||
'sortable' => false,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
'name' => 'value_per_locale',
|
||||
'alias' => 'attributeValuePerLocale',
|
||||
'type' => 'string',
|
||||
'label' => 'ValuePerLocale',
|
||||
'sortable' => true,
|
||||
'sortable' => false,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
'name' => 'value_per_channel',
|
||||
'alias' => 'attributeValuePerChannel',
|
||||
'type' => 'string',
|
||||
'label' => 'ValuePerChannel',
|
||||
'sortable' => true,
|
||||
'sortable' => false,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'filterable' => [
|
||||
|
|
@ -148,7 +170,6 @@ class AttributeDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'code',
|
||||
|
|
|
|||
|
|
@ -104,6 +104,12 @@ class CategoryDataGrid
|
|||
'type' => 'string',
|
||||
'label' => 'Visible in Menu',
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -103,13 +103,13 @@ class CustomerDataGrid
|
|||
'filterable' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'column' => 'id',
|
||||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
'label' => 'Customer ID',
|
||||
],
|
||||
[
|
||||
'name' => 'first_name',
|
||||
'column' => 'first_name',
|
||||
'alias' => 'FirstName',
|
||||
'type' => 'string',
|
||||
'label' => 'Customer First Name',
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class CustomerReviewDataGrid
|
|||
* The CustomerReviewDataGrid
|
||||
* implementation.
|
||||
*
|
||||
* @var ReviewsDataGrid
|
||||
* @var CustomerReviewsDataGrid
|
||||
* for Reviews
|
||||
*/
|
||||
|
||||
|
|
@ -57,13 +57,6 @@ class CustomerReviewDataGrid
|
|||
],
|
||||
|
||||
'join' => [
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'roles as r',
|
||||
// 'primaryKey' => 'u.role_id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'r.id',
|
||||
// ]
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
|
@ -76,67 +69,51 @@ class CustomerReviewDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'title',
|
||||
'alias' => 'titleName',
|
||||
'type' => 'string',
|
||||
'label' => 'Title',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'rating',
|
||||
'alias' => 'productRating',
|
||||
'type' => 'number',
|
||||
'label' => 'Rating',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'comment',
|
||||
'alias' => 'productComment',
|
||||
'type' => 'string',
|
||||
'label' => 'Comment',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'status',
|
||||
'alias' => 'reviewStatus',
|
||||
'type' => 'number',
|
||||
'label' => 'Status',
|
||||
'sortable' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
|
||||
'filterable' => [
|
||||
[
|
||||
'name' => 'id',
|
||||
'column' => 'id',
|
||||
'alias' => 'reviewId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'name' => 'title',
|
||||
], [
|
||||
'column' => 'title',
|
||||
'alias' => 'titleName',
|
||||
'type' => 'string',
|
||||
'label' => 'Title',
|
||||
],
|
||||
[
|
||||
'name' => 'rating',
|
||||
], [
|
||||
'column' => 'rating',
|
||||
'alias' => 'productRating',
|
||||
'type' => 'number',
|
||||
'label' => 'Rating',
|
||||
],
|
||||
[
|
||||
'name' => 'comment',
|
||||
], [
|
||||
'column' => 'comment',
|
||||
'alias' => 'productComment',
|
||||
'type' => 'string',
|
||||
'label' => 'Comment',
|
||||
],
|
||||
[
|
||||
'name' => 'status',
|
||||
], [
|
||||
'column' => 'status',
|
||||
'alias' => 'reviewStatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Status',
|
||||
|
|
@ -144,14 +121,12 @@ class CustomerReviewDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'title',
|
||||
'type' => 'string',
|
||||
'label' => 'Title',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'rating',
|
||||
'type' => 'number',
|
||||
'label' => 'Rating',
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ class InventorySourcesDataGrid
|
|||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
|
|
@ -73,34 +72,36 @@ class InventorySourcesDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'inventoryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'sortable' => false,
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'inventoryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'sortable' => false,
|
||||
], [
|
||||
'name' => 'priority',
|
||||
'alias' => 'inventoryPriority',
|
||||
'type' => 'string',
|
||||
'label' => 'Priority',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'status',
|
||||
'alias' => 'inventoryStatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Status',
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "In Active";
|
||||
else
|
||||
return "Active";
|
||||
},
|
||||
],
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -129,25 +129,25 @@ class ProductDataGrid
|
|||
'filterable' => [
|
||||
//column, type, and label
|
||||
[
|
||||
'name' => 'prods.id',
|
||||
'column' => 'prods.id',
|
||||
'alias' => 'productID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'name' => 'prods.sku',
|
||||
'column' => 'prods.sku',
|
||||
'alias' => 'productCode',
|
||||
'type' => 'string',
|
||||
'label' => 'SKU',
|
||||
],
|
||||
[
|
||||
'name' => 'attfam.name',
|
||||
'column' => 'attfam.name',
|
||||
'alias' => 'FamilyName',
|
||||
'type' => 'string',
|
||||
'label' => 'Family Name',
|
||||
],
|
||||
[
|
||||
'name' => 'pi.qty',
|
||||
'column' => 'pi.qty',
|
||||
'alias' => 'ProductQuantity',
|
||||
'type' => 'number',
|
||||
'label' => 'Product Quatity',
|
||||
|
|
|
|||
|
|
@ -67,28 +67,25 @@ class SliderDataGrid
|
|||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 's.id',
|
||||
'alias' => 'sliderId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 's.title',
|
||||
'alias' => 'sliderTitle',
|
||||
'type' => 'string',
|
||||
'label' => 'title',
|
||||
],
|
||||
[
|
||||
'sortable' => false
|
||||
], [
|
||||
'name' => 's.channel_id',
|
||||
'alias' => 'channelId',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
'sortable' => false,
|
||||
], [
|
||||
'name' => 'c.name',
|
||||
'alias' => 'channelName',
|
||||
'type' => 'string',
|
||||
|
|
@ -98,41 +95,31 @@ class SliderDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'locale_id',
|
||||
'column' => 's.id',
|
||||
'alias' => 'sliderId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'code',
|
||||
'alias' => 'locale_code',
|
||||
'label' => 'ID'
|
||||
], [
|
||||
'column' => 's.title',
|
||||
'alias' => 'SliderTitle',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
'column' => 'name',
|
||||
'alias' => 'locale_name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'label' => 'Slider Title'
|
||||
],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
// [
|
||||
// 'column' => 'name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Name',
|
||||
// ],
|
||||
// [
|
||||
// 'column' => 'code',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Code',
|
||||
// ],
|
||||
[
|
||||
'column' => 's.id',
|
||||
'type' => 'number',
|
||||
'label' => 'ID'
|
||||
], [
|
||||
'column' => 's.title',
|
||||
'type' => 'string',
|
||||
'label' => 'Slider Title'
|
||||
]
|
||||
],
|
||||
|
||||
//list of viable operators that will be used
|
||||
|
|
@ -148,9 +135,7 @@ class SliderDataGrid
|
|||
'nlike' => "not like",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ class TaxRateDataGrid
|
|||
{
|
||||
|
||||
return DataGrid::make([
|
||||
|
||||
'name' => 'Tax Rates',
|
||||
'table' => 'tax_rates as tr',
|
||||
'select' => 'tr.id',
|
||||
|
|
@ -64,21 +63,13 @@ class TaxRateDataGrid
|
|||
'icon' => 'icon trash-icon',
|
||||
],
|
||||
],
|
||||
'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' => 'tr.id',
|
||||
'alias' => 'ID',
|
||||
'alias' => 'id',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
|
|
@ -90,7 +81,7 @@ class TaxRateDataGrid
|
|||
'label' => 'Identifier',
|
||||
'sortable' => true,
|
||||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a class="color-red">' . $object->Name . '</a>';
|
||||
// return '<a class="color-red">' . $object->identifier . '</a>';
|
||||
// },
|
||||
],
|
||||
[
|
||||
|
|
@ -119,32 +110,27 @@ class TaxRateDataGrid
|
|||
//don't use aliasing in case of filters
|
||||
'filterable' => [
|
||||
[
|
||||
'name' => 'tr.id',
|
||||
'column' => 'tr.id',
|
||||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'name' => 'tr.identifier',
|
||||
], [
|
||||
'column' => 'tr.identifier',
|
||||
'alias' => 'identifier',
|
||||
'type' => 'string',
|
||||
'label' => 'Identifier',
|
||||
],
|
||||
[
|
||||
'name' => 'tr.state',
|
||||
], [
|
||||
'column' => 'tr.state',
|
||||
'alias' => 'state',
|
||||
'type' => 'string',
|
||||
'label' => 'State',
|
||||
],
|
||||
[
|
||||
'name' => 'tr.country',
|
||||
], [
|
||||
'column' => 'tr.country',
|
||||
'alias' => 'country',
|
||||
'type' => 'string',
|
||||
'label' => 'Country',
|
||||
],
|
||||
|
||||
[
|
||||
'name' => 'tr.tax_rate',
|
||||
], [
|
||||
'column' => 'tr.tax_rate',
|
||||
'alias' => 'tax_rate',
|
||||
'type' => 'number',
|
||||
'label' => 'Tax Rate',
|
||||
|
|
@ -157,22 +143,6 @@ class TaxRateDataGrid
|
|||
'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' => [
|
||||
'eq' => "=",
|
||||
|
|
|
|||
|
|
@ -42,14 +42,21 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
window.flashMessages = [];
|
||||
|
||||
@if($success = session('success'))
|
||||
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
|
||||
@elseif($warning = session('warning'))
|
||||
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
|
||||
@elseif($warning = session('info'))
|
||||
window.flashMessages = [{'type': 'alert-info', 'message': "{{ $info }}" }
|
||||
];
|
||||
@elseif($error = session('error'))
|
||||
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
|
||||
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }
|
||||
];
|
||||
@endif
|
||||
|
||||
window.serverErrors = [];
|
||||
|
||||
@if (count($errors))
|
||||
window.serverErrors = @json($errors->getMessages());
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -254,5 +254,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* DataGrid css ends in here */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
.color-red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.color-default {
|
||||
color: $font-color;
|
||||
}
|
||||
|
||||
.color-brand {
|
||||
color: $brand-color;
|
||||
}
|
||||
|
|
@ -23,7 +23,8 @@
|
|||
<div class="more-filters">
|
||||
<div class="dropdown-toggle">
|
||||
<div class="dropdown-header">
|
||||
<span class="name">Filter</span> {{-- <span class="role">Filter</span> --}}
|
||||
<span class="name">Filter</span>
|
||||
{{-- <span class="role">Filter</span> --}}
|
||||
<i class="icon arrow-down-icon active"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue