Skip to content

Commit

Permalink
Move default actions column type priority to type itself, instead of …
Browse files Browse the repository at this point in the history
…setting it explicitly in the builder (RE: #75)
  • Loading branch information
Kreyu committed Jul 13, 2024
1 parent 25cfa5b commit 8a28be1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Column/Type/ActionsColumnType.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function configureOptions(OptionsResolver $resolver): void
'export' => false,
'property_path' => false,
'actions' => [],
'priority' => -1,
])
->setNormalizer('actions', function (Options $options, mixed $value) {
($resolver = new OptionsResolver())
Expand Down
1 change: 0 additions & 1 deletion src/DataTableBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,6 @@ private function prependBatchCheckboxColumn(): void
private function appendActionsColumn(): void
{
$this->addColumn(self::ACTIONS_COLUMN_NAME, ActionsColumnType::class, [
'priority' => self::ACTIONS_COLUMN_PRIORITY,
'actions' => $this->getRowActions(),
]);
}
Expand Down
4 changes: 4 additions & 0 deletions src/DataTableBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Kreyu\Bundle\DataTableBundle\Action\ActionBuilderInterface;
use Kreyu\Bundle\DataTableBundle\Action\Type\ActionTypeInterface;
use Kreyu\Bundle\DataTableBundle\Column\ColumnBuilderInterface;
use Kreyu\Bundle\DataTableBundle\Column\Type\ActionsColumnType;
use Kreyu\Bundle\DataTableBundle\Column\Type\ColumnTypeInterface;
use Kreyu\Bundle\DataTableBundle\Exception\InvalidArgumentException;
use Kreyu\Bundle\DataTableBundle\Exporter\ExporterBuilderInterface;
Expand All @@ -23,6 +24,9 @@ interface DataTableBuilderInterface extends DataTableConfigBuilderInterface

public const ACTIONS_COLUMN_NAME = '__actions';

/**
* @deprecated since 0.19.1, the default actions column priority is now set in the type class {@see ActionsColumnType::configureOptions()}
*/
public const ACTIONS_COLUMN_PRIORITY = -1;

public const SEARCH_FILTER_NAME = '__search';
Expand Down

0 comments on commit 8a28be1

Please sign in to comment.