mirror of https://github.com/realodix/urlhub.git
Remove Datatables (#798)
parent
aeea8667c8
commit
0cd0178771
@ -1,116 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
/*
|
|
||||||
* DataTables search options.
|
|
||||||
*/
|
|
||||||
'search' => [
|
|
||||||
/*
|
|
||||||
* Smart search will enclose search keyword with wildcard string "%keyword%".
|
|
||||||
* SQL: column LIKE "%keyword%"
|
|
||||||
*/
|
|
||||||
'smart' => true,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Multi-term search will explode search keyword using spaces resulting into multiple term search.
|
|
||||||
*/
|
|
||||||
'multi_term' => true,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Case insensitive will search the keyword in lower case format.
|
|
||||||
* SQL: LOWER(column) LIKE LOWER(keyword)
|
|
||||||
*/
|
|
||||||
'case_insensitive' => true,
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Wild card will add "%" in between every characters of the keyword.
|
|
||||||
* SQL: column LIKE "%k%e%y%w%o%r%d%"
|
|
||||||
*/
|
|
||||||
'use_wildcards' => false,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* DataTables internal index id response column name.
|
|
||||||
*/
|
|
||||||
'index_column' => 'DT_RowIndex',
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of available builders for DataTables.
|
|
||||||
* This is where you can register your custom dataTables builder.
|
|
||||||
*/
|
|
||||||
'engines' => [
|
|
||||||
'eloquent' => \Yajra\DataTables\EloquentDataTable::class,
|
|
||||||
'query' => \Yajra\DataTables\QueryDataTable::class,
|
|
||||||
'collection' => \Yajra\DataTables\CollectionDataTable::class,
|
|
||||||
'resource' => \Yajra\DataTables\ApiResourceDataTable::class,
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* DataTables accepted builder to engine mapping.
|
|
||||||
* This is where you can override which engine a builder should use
|
|
||||||
* Note, only change this if you know what you are doing!
|
|
||||||
*/
|
|
||||||
'builders' => [
|
|
||||||
//Illuminate\Database\Eloquent\Relations\Relation::class => 'eloquent',
|
|
||||||
//Illuminate\Database\Eloquent\Builder::class => 'eloquent',
|
|
||||||
//Illuminate\Database\Query\Builder::class => 'query',
|
|
||||||
//Illuminate\Support\Collection::class => 'collection',
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Nulls last sql pattern for Posgresql & Oracle.
|
|
||||||
* For MySQL, use '-%s %s'
|
|
||||||
*/
|
|
||||||
'nulls_last_sql' => '%s %s NULLS LAST',
|
|
||||||
|
|
||||||
/*
|
|
||||||
* User friendly message to be displayed on user if error occurs.
|
|
||||||
* Possible values:
|
|
||||||
* null - The exception message will be used on error response.
|
|
||||||
* 'throw' - Throws a \Yajra\DataTables\Exceptions\Exception. Use your custom error handler if needed.
|
|
||||||
* 'custom message' - Any friendly message to be displayed to the user. You can also use translation key.
|
|
||||||
*/
|
|
||||||
'error' => env('DATATABLES_ERROR', null),
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default columns definition of dataTable utility functions.
|
|
||||||
*/
|
|
||||||
'columns' => [
|
|
||||||
/*
|
|
||||||
* List of columns hidden/removed on json response.
|
|
||||||
*/
|
|
||||||
'excess' => ['rn', 'row_num'],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of columns to be escaped. If set to *, all columns are escape.
|
|
||||||
* Note: You can set the value to empty array to disable XSS protection.
|
|
||||||
*/
|
|
||||||
'escape' => '*',
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of columns that are allowed to display html content.
|
|
||||||
* Note: Adding columns to list will make us available to XSS attacks.
|
|
||||||
*/
|
|
||||||
'raw' => ['action'],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of columns are are forbidden from being searched/sorted.
|
|
||||||
*/
|
|
||||||
'blacklist' => ['password', 'remember_token'],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* List of columns that are only allowed fo search/sort.
|
|
||||||
* If set to *, all columns are allowed.
|
|
||||||
*/
|
|
||||||
'whitelist' => '*',
|
|
||||||
],
|
|
||||||
|
|
||||||
/*
|
|
||||||
* JsonResponse header and options config.
|
|
||||||
*/
|
|
||||||
'json' => [
|
|
||||||
'header' => [],
|
|
||||||
'options' => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
Before Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 148 B |
@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Browser\Components;
|
|
||||||
|
|
||||||
use App\Models\Url;
|
|
||||||
use App\Models\User;
|
|
||||||
use Laravel\Dusk\Browser;
|
|
||||||
use Tests\DuskTestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sometimes while changing some javascript files, the datatables fail to
|
|
||||||
* render the table. This test is written to make sure the datatables run
|
|
||||||
* as expected.
|
|
||||||
*/
|
|
||||||
class DataTablesTest extends DuskTestCase
|
|
||||||
{
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
$this->browse(function (Browser $browser) {
|
|
||||||
$browser->loginAs(User::find(1));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testDashboard()
|
|
||||||
{
|
|
||||||
$text = 'dashboard';
|
|
||||||
$user = User::find(1);
|
|
||||||
|
|
||||||
Url::factory()->create([
|
|
||||||
'user_id' => $user->id,
|
|
||||||
'meta_title' => $text,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->browse(function (Browser $browser) use ($text) {
|
|
||||||
$browser->visitRoute('dashboard.allurl')
|
|
||||||
->waitForText($text)
|
|
||||||
->assertSee($text);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testAllUrls()
|
|
||||||
{
|
|
||||||
$this->browse(function (Browser $browser) {
|
|
||||||
$browser->visitRoute('dashboard.allurl')
|
|
||||||
->waitUntilMissingText('Processing')
|
|
||||||
->assertSee('dashboard');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testAllUsers()
|
|
||||||
{
|
|
||||||
$user = User::factory()->create([
|
|
||||||
'email' => 'laravel@example.com',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->browse(function (Browser $browser) use ($user) {
|
|
||||||
$browser->visitRoute('user.index')
|
|
||||||
->waitUntilMissingText('Processing')
|
|
||||||
->assertSee($user->email);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Browser\Pages;
|
|
||||||
|
|
||||||
use Laravel\Dusk\Browser;
|
|
||||||
|
|
||||||
class HomePage extends Page
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Get the URL for the page.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function url()
|
|
||||||
{
|
|
||||||
return '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Assert that the browser is on the page.
|
|
||||||
*
|
|
||||||
* @param \Laravel\Dusk\Browser $browser
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function assert(Browser $browser)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the element shortcuts for the page.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function elements()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'@element' => '#selector',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Browser\Pages;
|
|
||||||
|
|
||||||
use Laravel\Dusk\Page as BasePage;
|
|
||||||
|
|
||||||
abstract class Page extends BasePage
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Get the global element shortcuts for the site.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function siteElements()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'@element' => '#selector',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
Loading…
Reference in new issue