Skip to content

Commit

Permalink
Merge branch '2.4' into mysql_unix_socket_support
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed May 6, 2017
2 parents 565f5fc + c3b053f commit f56c205
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function filter(CreateScheduleCommand $command)
];

$availableParams = array_filter($params, function ($val) {
return $val !== null;
return $val !== null && $val !== '';
});

return $availableParams;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Dashboard/IncidentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,6 @@ public function createIncidentUpdateAction(Incident $incident)
}

return cachet_redirect('dashboard.incidents')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.update.success')));
}
}
15 changes: 15 additions & 0 deletions app/Models/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
use Illuminate\Database\Eloquent\Model;
use McCool\LaravelAutoPresenter\HasPresenter;

/**
* This is the schedule class.
*
* @author James Brooks <[email protected]>
*/
class Schedule extends Model implements HasPresenter
{
use SearchableTrait, SortableTrait, ValidatingTrait;
Expand All @@ -44,6 +49,16 @@ class Schedule extends Model implements HasPresenter
*/
const COMPLETE = 2;

/**
* The model's attributes.
*
* @var string[]
*/
protected $attributes = [
'status' => self::UPCOMING,
'completed_at' => null,
];

/**
* The attributes that should be casted to native types.
*
Expand Down
6 changes: 4 additions & 2 deletions app/Presenters/SchedulePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,13 @@ public function completed_at_iso()
/**
* Formats the completed_at time ready to be used by bootstrap-datetimepicker.
*
* @return string
* @return string|void
*/
public function completed_at_datetimepicker()
{
return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i');
if ($this->wrappedObject->completed_at) {
return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i');
}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@
]
},
"config": {
"preferred-install": "dist"
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"branch-alias": {
Expand Down
66 changes: 33 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions resources/lang/en/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'update' => [
'title' => 'Create new incident update',
'subtitle' => 'Add an update to <strong>:incident</strong>',
'success' => 'Update added.',
],

// Incident templates
Expand Down
2 changes: 1 addition & 1 deletion tests/Api/ScheduleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testGetSchedule()

$this->assertResponseOk();

$this->seeJson($schedule->toArray());
$this->seeJson(['name' => $schedule->name]);
}

public function testCreateSchedule()
Expand Down

0 comments on commit f56c205

Please sign in to comment.