|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Tkotosz\CommandScheduler\Ui\Component\Listing\Columns; |
|
4
|
|
|
|
|
5
|
|
|
use Magento\Framework\View\Element\UiComponent\ContextInterface; |
|
6
|
|
|
use Magento\Framework\View\Element\UiComponentFactory; |
|
7
|
|
|
use Magento\Ui\Component\Listing\Columns\Column; |
|
|
|
|
|
|
8
|
|
|
use Magento\Framework\UrlInterface; |
|
9
|
|
|
|
|
10
|
|
|
class Actions extends Column |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* @var UrlInterface |
|
14
|
|
|
*/ |
|
15
|
|
|
protected $urlBuilder; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* @param ContextInterface $context |
|
19
|
|
|
* @param UiComponentFactory $uiComponentFactory |
|
20
|
|
|
* @param UrlInterface $urlBuilder |
|
21
|
|
|
* @param array $components |
|
22
|
|
|
* @param array $data |
|
23
|
|
|
*/ |
|
24
|
|
|
public function __construct( |
|
25
|
|
|
ContextInterface $context, |
|
26
|
|
|
UiComponentFactory $uiComponentFactory, |
|
27
|
|
|
UrlInterface $urlBuilder, |
|
28
|
|
|
array $components = [], |
|
29
|
|
|
array $data = [] |
|
30
|
|
|
) { |
|
31
|
|
|
$this->urlBuilder = $urlBuilder; |
|
32
|
|
|
parent::__construct($context, $uiComponentFactory, $components, $data); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* Prepare Data Source |
|
37
|
|
|
* |
|
38
|
|
|
* @param array $dataSource |
|
39
|
|
|
* |
|
40
|
|
|
* @return array |
|
41
|
|
|
*/ |
|
42
|
|
|
public function prepareDataSource(array $dataSource) |
|
43
|
|
|
{ |
|
44
|
|
|
if (!isset($dataSource['data']['items'])) { |
|
45
|
|
|
return $dataSource; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
foreach ($dataSource['data']['items'] as &$item) { |
|
49
|
|
|
$item[$this->getData('name')]['edit'] = [ |
|
50
|
|
|
'href' => $this->urlBuilder->getUrl( |
|
51
|
|
|
'tkotosz_commandscheduler/schedule/viewresult', |
|
52
|
|
|
['id' => $item['schedule_id']] |
|
53
|
|
|
), |
|
54
|
|
|
'label' => __('View Result'), |
|
55
|
|
|
'hidden' => false |
|
56
|
|
|
]; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
return $dataSource; |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths