Skip to content

Commit

Permalink
Fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Feb 26, 2024
1 parent a3c61df commit a452418
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

namespace Opengento\WebapiLogger\Ui\Component\Listing\Column;

use Magento\Framework\Phrase;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\UrlInterface;

class RowAction extends Column
class Actions extends Column
{
public function __construct(
ContextInterface $context,
Expand All @@ -27,14 +28,13 @@ public function __construct(

public function prepareDataSource(array $dataSource): array
{
foreach ($dataSource['data']['items'] ?? [] as &$item) {
$item[$this->getData('name')] = [
'edit' => [
'href' =>
$this->urlBuilder->getUrl('webapi_logs/reports/detail', ['log_id' => $item['log_id']]),
'label' => __('View More')
]
];
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as &$item) {
$item[$this->getData('name')]['edit'] = [
'href' => $this->urlBuilder->getUrl('webapi_logs/reports/detail', ['log_id' => $item['log_id']]),
'label' => new Phrase('View')
];
}
}

return $dataSource;
Expand Down
19 changes: 0 additions & 19 deletions Ui/Component/Listing/Column/ResponseBody.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<label translate="true">Created At</label>
</settings>
</column>
<actionsColumn name="actions" class="Opengento\WebapiLogger\Ui\Component\Listing\Column\RowAction">
<actionsColumn name="actions" class="Opengento\WebapiLogger\Ui\Component\Listing\Column\Actions">
<settings>
<indexField>log_id</indexField>
<sortable>false</sortable>
Expand Down

0 comments on commit a452418

Please sign in to comment.