Skip to content

Commit

Permalink
Rename var && fix form
Browse files Browse the repository at this point in the history
  • Loading branch information
sapk committed Sep 5, 2016
1 parent 5a9fcba commit 20121b8
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 106 deletions.
10 changes: 5 additions & 5 deletions app/Bus/Commands/Incident/ReportIncidentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final class ReportIncidentCommand
*
* @var bool
*/
public $sticked;
public $stickied;

/**
* The date at which the incident occurred.
Expand Down Expand Up @@ -103,7 +103,7 @@ final class ReportIncidentCommand
'component_id' => 'int|required_with:component_status',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'notify' => 'bool',
'sticked' => 'bool',
'stickied' => 'bool',
'incident_date' => 'string',
'template' => 'string',
];
Expand All @@ -118,14 +118,14 @@ final class ReportIncidentCommand
* @param int $component_id
* @param int $component_status
* @param bool $notify
* @param bool $sticked
* @param bool $stickied
* @param string|null $incident_date
* @param string|null $template
* @param array|null $template_vars
*
* @return void
*/
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $sticked, $incident_date, $template, array $template_vars = null)
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $stickied, $incident_date, $template, array $template_vars = null)
{
$this->name = $name;
$this->status = $status;
Expand All @@ -134,7 +134,7 @@ public function __construct($name, $status, $message, $visible, $component_id, $
$this->component_id = $component_id;
$this->component_status = $component_status;
$this->notify = $notify;
$this->sticked = $sticked;
$this->stickied = $stickied;
$this->incident_date = $incident_date;
$this->template = $template;
$this->template_vars = $template_vars;
Expand Down
10 changes: 5 additions & 5 deletions app/Bus/Commands/Incident/UpdateIncidentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ final class UpdateIncidentCommand
*
* @var bool
*/
public $sticked;
public $stickied;

/**
* The date that the incident occurred on.
Expand Down Expand Up @@ -112,7 +112,7 @@ final class UpdateIncidentCommand
'component_id' => 'int',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'notify' => 'bool',
'sticked' => 'bool',
'stickied' => 'bool',
'template' => 'string',
];

Expand All @@ -127,14 +127,14 @@ final class UpdateIncidentCommand
* @param int $component_id
* @param int $component_status
* @param bool $notify
* @param bool $sticked
* @param bool $stickied
* @param string|null $incident_date
* @param string|null $template
* @param array|null $template_vars
*
* @return void
*/
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $sticked, $incident_date, $template, array $template_vars = null)
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $stickied, $incident_date, $template, array $template_vars = null)
{
$this->incident = $incident;
$this->name = $name;
Expand All @@ -144,7 +144,7 @@ public function __construct(Incident $incident, $name, $status, $message, $visib
$this->component_id = $component_id;
$this->component_status = $component_status;
$this->notify = $notify;
$this->sticked = $sticked;
$this->stickied = $stickied;
$this->incident_date = $incident_date;
$this->template = $template;
$this->template_vars = $template_vars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function handle(ReportIncidentCommand $command)
'name' => $command->name,
'status' => $command->status,
'visible' => $command->visible,
'sticked' => $command->sticked,
'stickied' => $command->stickied,
];

if ($command->template) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function handle(ReportMaintenanceCommand $command)
'scheduled_at' => $scheduledAt,
'status' => 0,
'visible' => 1,
'sticked' => false,
'stickied' => false,
]);

$maintenanceEvent->notify = (bool) $command->notify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function filter(UpdateIncidentCommand $command)
'status' => $command->status,
'message' => $command->message,
'visible' => $command->visible,
'sticked' => $command->sticked,
'stickied' => $command->stickied,
'component_id' => $command->component_id,
'component_status' => $command->component_status,
'notify' => $command->notify,
Expand Down
41 changes: 0 additions & 41 deletions app/Composers/Modules/StickedComposer.php

This file was deleted.

16 changes: 8 additions & 8 deletions app/Console/Commands/DemoSeederCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ protected function seedIncidents()
'component_id' => 0,
'scheduled_at' => null,
'visible' => 1,
'sticked' => false,
'stickied' => false,
],
[
'name' => 'Awesome',
Expand All @@ -214,7 +214,7 @@ protected function seedIncidents()
'component_id' => 0,
'scheduled_at' => null,
'visible' => 1,
'sticked' => false,
'stickied' => false,
],
[
'name' => 'Monitoring the fix',
Expand All @@ -223,7 +223,7 @@ protected function seedIncidents()
'component_id' => 0,
'scheduled_at' => null,
'visible' => 1,
'sticked' => false,
'stickied' => false,
],
[
'name' => 'Update',
Expand All @@ -232,7 +232,7 @@ protected function seedIncidents()
'component_id' => 0,
'scheduled_at' => null,
'visible' => 1,
'sticked' => false,
'stickied' => false,
],
[
'name' => 'Test Incident',
Expand All @@ -241,7 +241,7 @@ protected function seedIncidents()
'component_id' => 0,
'scheduled_at' => null,
'visible' => 1,
'sticked' => false,
'stickied' => false,
],
[
'name' => 'Investigating the API',
Expand All @@ -250,16 +250,16 @@ protected function seedIncidents()
'component_id' => 1,
'scheduled_at' => null,
'visible' => 1,
'sticked' => false,
'stickied' => false,
],
[
'name' => 'Sticked to the top',
'name' => 'Stickied to the top',
'message' => 'Will be forever hanged here.',
'status' => 1,
'component_id' => 1,
'scheduled_at' => null,
'visible' => 1,
'sticked' => true,
'stickied' => true,
],
];

Expand Down
4 changes: 2 additions & 2 deletions app/Foundation/Providers/ComposerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use CachetHQ\Cachet\Composers\Modules\MetricsComposer as MetricsModuleComposer;
use CachetHQ\Cachet\Composers\Modules\ScheduledComposer as ScheduledModuleComposer;
use CachetHQ\Cachet\Composers\Modules\StatusComposer as StatusModuleComposer;
use CachetHQ\Cachet\Composers\Modules\StickedComposer as StickedModuleComposer;
use CachetHQ\Cachet\Composers\Modules\StickiedComposer as StickiedModuleComposer;
use CachetHQ\Cachet\Composers\Modules\TimelineComposer as TimelineModuleComposer;
use CachetHQ\Cachet\Composers\ThemeComposer;
use CachetHQ\Cachet\Composers\TimezoneLocaleComposer;
Expand All @@ -44,7 +44,7 @@ public function boot(Factory $factory)
$factory->composer('*', ModuleComposer::class);
$factory->composer('partials.modules.components', ComponentsModuleComposer::class);
$factory->composer('partials.modules.metrics', MetricsModuleComposer::class);
$factory->composer('partials.modules.sticked', StickedModuleComposer::class);
$factory->composer('partials.modules.stickied', StickiedModuleComposer::class);
$factory->composer('partials.modules.scheduled', ScheduledModuleComposer::class);
$factory->composer('partials.modules.status', StatusModuleComposer::class);
$factory->composer('partials.modules.timeline', TimelineModuleComposer::class);
Expand Down
2 changes: 1 addition & 1 deletion app/Foundation/Providers/ModuleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ModuleServiceProvider extends ServiceProvider
['group' => 'status', 'partial' => 'partials.modules.status'],
['group' => 'components', 'partial' => 'partials.modules.components'],
['group' => 'metrics', 'partial' => 'partials.modules.metrics'],
['group' => 'sticked', 'partial' => 'partials.modules.sticked'],
['group' => 'stickied', 'partial' => 'partials.modules.stickied'],
['group' => 'scheduled', 'partial' => 'partials.modules.scheduled'],
['group' => 'timeline', 'partial' => 'partials.modules.timeline'],
],
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/IncidentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function postIncidents()
Binput::get('component_id'),
Binput::get('component_status'),
Binput::get('notify', true),
Binput::get('sticked', false),
Binput::get('stickied', false),
Binput::get('created_at'),
Binput::get('template'),
Binput::get('vars')
Expand Down Expand Up @@ -106,7 +106,7 @@ public function putIncident(Incident $incident)
Binput::get('component_id'),
Binput::get('component_status'),
Binput::get('notify', true),
Binput::get('sticked', false),
Binput::get('stickied', false),
Binput::get('created_at'),
Binput::get('template'),
Binput::get('vars')
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Dashboard/IncidentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function createIncidentAction()
Binput::get('component_id'),
Binput::get('component_status'),
Binput::get('notify', false),
Binput::get('sticked', false),
Binput::get('stickied', false),
Binput::get('created_at'),
null,
null
Expand Down Expand Up @@ -241,7 +241,7 @@ public function editIncidentAction(Incident $incident)
Binput::get('component_id'),
Binput::get('component_status'),
Binput::get('notify', true),
Binput::get('sticked', false),
Binput::get('stickied', false),
Binput::get('created_at'),
null,
null
Expand Down
16 changes: 8 additions & 8 deletions app/Models/Incident.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Incident extends Model implements HasPresenter
*/
protected $casts = [
'visible' => 'int',
'sticked' => 'int',
'stickied' => 'int',
'scheduled_at' => 'date',
'deleted_at' => 'date',
];
Expand All @@ -47,7 +47,7 @@ class Incident extends Model implements HasPresenter
'name',
'status',
'visible',
'sticked',
'stickied',
'message',
'scheduled_at',
'created_at',
Expand All @@ -64,7 +64,7 @@ class Incident extends Model implements HasPresenter
'name' => 'required',
'status' => 'required|int',
'visible' => 'required|bool',
'sticked' => 'bool',
'stickied' => 'bool',
'message' => 'required',
];

Expand All @@ -79,7 +79,7 @@ class Incident extends Model implements HasPresenter
'name',
'status',
'visible',
'sticked',
'stickied',
];

/**
Expand All @@ -92,7 +92,7 @@ class Incident extends Model implements HasPresenter
'name',
'status',
'visible',
'sticked',
'stickied',
'message',
];

Expand All @@ -119,15 +119,15 @@ public function scopeVisible(Builder $query)
}

/**
* Finds all sticked incidents.
* Finds all stickied incidents.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeSticked(Builder $query)
public function scopeStickied(Builder $query)
{
return $query->where('sticked', true);
return $query->where('stickied', true);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'message' => $faker->paragraph(),
'status' => random_int(1, 4),
'visible' => 1,
'sticked' => false,
'stickied' => false,
];
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterTableIncidentsAddStickedColumn extends Migration
class AlterTableIncidentsAddStickiedColumn extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::table('incidents', function (Blueprint $table) {
$table->boolean('sticked')->after('visible')->default(false);
$table->boolean('stickied')->after('visible')->default(false);

$table->index('sticked');
$table->index('stickied');
});
}

Expand All @@ -33,7 +33,7 @@ public function up()
public function down()
{
Schema::table('incidents', function (Blueprint $table) {
$table->dropColumn('sticked');
$table->dropColumn('stickied');
});
}
}
2 changes: 1 addition & 1 deletion resources/lang/en/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'incidents' => [
'none' => 'No incidents reported',
'past' => 'Past Incidents',
'sticked' => 'Sticked Incidents',
'stickied' => 'Stickied Incidents',
'previous_week' => 'Previous Week',
'next_week' => 'Next Week',
'scheduled' => 'Scheduled Maintenance',
Expand Down
Loading

0 comments on commit 20121b8

Please sign in to comment.