Skip to content

Commit ceebde4

Browse files
Issue #208 fixed
1 parent 140a854 commit ceebde4

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

packages/Webkul/Admin/src/Config/datagrid_filters.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
]
2828
], [
2929
'type' => 'group',
30-
'key' => 'duration',
30+
'key' => 'scheduled',
3131
'condition' => 'eq',
3232
'values' => [
3333
[
@@ -68,6 +68,4 @@
6868
"repositoryClass" => "\Webkul\Lead\Repositories\StageRepository",
6969
]
7070
]
71-
];
72-
73-
?>
71+
];

packages/Webkul/Admin/src/DataGrids/Activity/ActivityDataGrid.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
class ActivityDataGrid extends DataGrid
1010
{
1111
protected $users = [];
12+
1213
protected $persons = [];
14+
1315
protected $tabFilters = [];
1416

1517
protected $redirectRow = [
@@ -108,10 +110,10 @@ public function addColumns()
108110
]);
109111

110112
$this->addColumn([
111-
'index' => 'type',
112-
'head_style' => 'width: 70px',
113-
'label' => trans('admin::app.datagrid.type'),
114-
'type' => 'boolean',
113+
'index' => 'type',
114+
'head_style' => 'width: 70px',
115+
'label' => trans('admin::app.datagrid.type'),
116+
'type' => 'boolean',
115117
]);
116118

117119
$this->addColumn([

packages/Webkul/UI/src/DataGrid/DataGrid.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public function sortOrFilterCollection($collection, $parseInfo)
120120

121121
case 'type':
122122
case 'duration':
123+
case 'scheduled':
123124
$collection = $this->prepareTabFilter($collection, $key, $info);
124125
break;
125126

packages/Webkul/UI/src/DataGrid/Traits/DatagridCollection.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,14 @@ public function prepareTabFilter($collection, $key, $info)
179179
}
180180

181181
$value = array_values($info)[0];
182-
$column = ($key === "duration") ? $this->filterMap["created_at"] ?? "created_at" : $key;
182+
183+
if ($key === "duration") {
184+
$column = $this->filterMap["created_at"] ?? "created_at";
185+
} else if ($key === "scheduled") {
186+
$column = "schedule_from";
187+
} else {
188+
$column = $key;
189+
}
183190

184191
$endDate = Carbon::now()->format('Y-m-d');
185192

packages/Webkul/UI/src/DataGrid/Traits/DatagridHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function prepareTabFilters($key)
140140
}
141141
}
142142
}
143-
143+
144144
return $tabFilters;
145145
}
146146
}

0 commit comments

Comments
 (0)