Allow component groups to be collapsed by default. Closes #1398

This commit is contained in:
James Brooks
2016-01-29 16:02:14 +00:00
parent d907d1eecc
commit da7af1fca0
16 changed files with 141 additions and 34 deletions

View File

@@ -32,8 +32,9 @@ $factory->define(Component::class, function ($faker) {
$factory->define(ComponentGroup::class, function ($faker) {
return [
'name' => $faker->words(2, true),
'order' => 0,
'name' => $faker->words(2, true),
'order' => 0,
'collapsed' => false,
];
});

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 AlterTableComponentGroupsAddCollapsedColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('component_groups', function (Blueprint $table) {
$table->boolean('collapsed')->after('order')->default(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('component_groups', function (Blueprint $table) {
$table->dropColumn('collapsed');
});
}
}