Skip to content

Commit

Permalink
UI/DataTable: remove user preference 'row limit' from example
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaagen authored and klees committed Dec 9, 2024
1 parent 5430b90 commit 5f54686
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/UI/Implementation/Component/Table/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Data extends Table implements T\Data, JSBindable
protected Signal $selection_signal;
protected Signal $async_action_signal;
protected ?ServerRequestInterface $request = null;
protected int $number_of_rows = 800;
protected int $number_of_rows = 25;
/**
* @var string[]
*/
Expand Down
2 changes: 0 additions & 2 deletions src/UI/examples/Table/Data/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function base()
$current_user_date_format = $df->dateFormat()->withTime24(
$DIC['ilUser']->getDateFormat()
);
$current_user_pref_limit = (int) $DIC['ilUser']->getPref("hits_per_page");

/**
* This is what the table will look like:
Expand Down Expand Up @@ -231,7 +230,6 @@ protected function getRecords(Range $range = null, Order $order = null): array
->data('a data table', $columns, $data_retrieval)
->withId('example_base')
->withActions($actions)
->withNumberOfRows($current_user_pref_limit)
->withRequest($request);

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/UI/Component/Table/DataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testDataTableBasicConstruction(): void
$data = $this->getDataRetrieval();
$cols = ['f0' => $this->getTableFactory()->column()->text("col1")];
$table = $this->getTableFactory()->data('title', $cols, $data);
$this->assertEquals(800, $table->getNumberOfRows());
$this->assertEquals(25, $table->getNumberOfRows());
$this->assertInstanceOf(Order::class, $table->getOrder());
$this->assertInstanceOf(Range::class, $table->getRange());
$this->assertInstanceOf(I\Signal::class, $table->getAsyncActionSignal());
Expand Down

0 comments on commit 5f54686

Please sign in to comment.