Option to auto-expand groups when components are down. Closes #1602

This commit is contained in:
James Brooks
2016-03-10 14:59:13 +00:00
parent d4d31efeb7
commit a0477b03e3
14 changed files with 116 additions and 32 deletions

View File

@@ -34,7 +34,7 @@ $factory->define(ComponentGroup::class, function ($faker) {
return [
'name' => $faker->words(2, true),
'order' => 0,
'collapsed' => $faker->boolean(),
'collapsed' => random_int(0, 3),
];
});

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableComponentGroupsMakeColumnInteger extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('component_groups', function (Blueprint $table) {
$table->integer('collapsed')->unsigned()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('component_groups', function (Blueprint $table) {
$table->boolean('collapsed')->change();
});
}
}