Added toggle to show failed tests on graph

re #285
This commit is contained in:
Henry Whitaker
2020-08-28 20:31:32 +01:00
parent dd56a667cd
commit ec56337b99
5 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
<?php
use App\Helpers\SettingsHelper;
use App\Setting;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddShowFailedTestsSetting extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!SettingsHelper::get('show_failed_tests_on_graph')) {
Setting::create([
'name' => 'show_failed_tests_on_graph',
'value' => true,
'description' => 'If enabled, failed tests will appear on the graphs as 0.'
]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Setting::whereIn('name', [
'show_failed_tests_on_graph',
])->delete();
}
}