diff --git a/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php b/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php index 403131a25563..92ec22cc71ed 100644 --- a/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php +++ b/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php @@ -92,7 +92,7 @@ protected function filter(CreateScheduleCommand $command) ]; $availableParams = array_filter($params, function ($val) { - return $val !== null; + return $val !== null && $val !== ''; }); return $availableParams; diff --git a/app/Http/Controllers/Dashboard/IncidentController.php b/app/Http/Controllers/Dashboard/IncidentController.php index c1aa9a05f5f2..9d3be7bcbbda 100644 --- a/app/Http/Controllers/Dashboard/IncidentController.php +++ b/app/Http/Controllers/Dashboard/IncidentController.php @@ -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'))); } } diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 47b6d56a4862..3154c4e9d0cf 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -19,6 +19,11 @@ use Illuminate\Database\Eloquent\Model; use McCool\LaravelAutoPresenter\HasPresenter; +/** + * This is the schedule class. + * + * @author James Brooks + */ class Schedule extends Model implements HasPresenter { use SearchableTrait, SortableTrait, ValidatingTrait; @@ -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. * diff --git a/app/Presenters/SchedulePresenter.php b/app/Presenters/SchedulePresenter.php index d1c7549c52cd..efff4d2b6083 100644 --- a/app/Presenters/SchedulePresenter.php +++ b/app/Presenters/SchedulePresenter.php @@ -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'); + } } /** diff --git a/composer.json b/composer.json index ae5d2718414a..dc6f1ee35c41 100644 --- a/composer.json +++ b/composer.json @@ -105,7 +105,8 @@ ] }, "config": { - "preferred-install": "dist" + "preferred-install": "dist", + "sort-packages": true }, "extra": { "branch-alias": { diff --git a/composer.lock b/composer.lock index dc8597f5d29d..4630ec17b039 100644 --- a/composer.lock +++ b/composer.lock @@ -449,16 +449,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.26.2", + "version": "3.27.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "05df1887d7b8cea9fba9ad59e1513c3815e883ae" + "reference": "23fd97c5bc4aaa923b994f8876c86574ed84f27d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/05df1887d7b8cea9fba9ad59e1513c3815e883ae", - "reference": "05df1887d7b8cea9fba9ad59e1513c3815e883ae", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/23fd97c5bc4aaa923b994f8876c86574ed84f27d", + "reference": "23fd97c5bc4aaa923b994f8876c86574ed84f27d", "shasum": "" }, "require": { @@ -480,7 +480,7 @@ "ext-simplexml": "*", "ext-spl": "*", "nette/neon": "^2.3", - "phpunit/phpunit": "~4.0|~5.0", + "phpunit/phpunit": "^4.8.35|^5.4.0", "psr/cache": "^1.0" }, "suggest": { @@ -525,7 +525,7 @@ "s3", "sdk" ], - "time": "2017-04-21T20:25:16+00:00" + "time": "2017-05-04T22:43:46+00:00" }, { "name": "backup-manager/backup-manager", @@ -2354,16 +2354,16 @@ }, { "name": "league/flysystem", - "version": "1.0.38", + "version": "1.0.40", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "4ba6e13f5116204b21c3afdf400ecf2b9eb1c482" + "reference": "3828f0b24e2c1918bb362d57a53205d6dc8fde61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4ba6e13f5116204b21c3afdf400ecf2b9eb1c482", - "reference": "4ba6e13f5116204b21c3afdf400ecf2b9eb1c482", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3828f0b24e2c1918bb362d57a53205d6dc8fde61", + "reference": "3828f0b24e2c1918bb362d57a53205d6dc8fde61", "shasum": "" }, "require": { @@ -2433,7 +2433,7 @@ "sftp", "storage" ], - "time": "2017-04-22T18:59:19+00:00" + "time": "2017-04-28T10:15:08+00:00" }, { "name": "mccool/laravel-auto-presenter", @@ -3671,16 +3671,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca" + "reference": "b8a401f733b43251e1d088c589368b2a94155e40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/154bb1ef7b0e42ccc792bd53edbce18ed73440ca", - "reference": "154bb1ef7b0e42ccc792bd53edbce18ed73440ca", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8a401f733b43251e1d088c589368b2a94155e40", + "reference": "b8a401f733b43251e1d088c589368b2a94155e40", "shasum": "" }, "require": { @@ -3727,7 +3727,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-04-04T07:26:27+00:00" + "time": "2017-05-01T14:58:48+00:00" }, { "name": "symfony/finder", @@ -4833,12 +4833,12 @@ "version": "0.9.5", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", + "url": "https://github.com/mockery/mockery.git", "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", + "url": "https://api.github.com/repos/mockery/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", "shasum": "" }, @@ -6049,16 +6049,16 @@ }, { "name": "symfony/css-selector", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c" + "reference": "02983c144038e697c959e6b06ef6666de759ccbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/a48f13dc83c168f1253a5d2a5a4fb46c36244c4c", - "reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc", + "reference": "02983c144038e697c959e6b06ef6666de759ccbc", "shasum": "" }, "require": { @@ -6098,20 +6098,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-05-01T14:55:58+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee" + "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/403944e294cf4ceb3b8447f54cbad88ea7b99cee", - "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f1ad34e8af09ed17570e027cf0c58a12eddec286", + "reference": "f1ad34e8af09ed17570e027cf0c58a12eddec286", "shasum": "" }, "require": { @@ -6154,20 +6154,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-02-21T09:12:04+00:00" + "time": "2017-04-12T14:13:17+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621" + "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621", - "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621", + "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", + "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", "shasum": "" }, "require": { @@ -6209,7 +6209,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-20T09:45:15+00:00" + "time": "2017-05-01T14:55:58+00:00" }, { "name": "tightenco/mailthief", diff --git a/resources/lang/en/dashboard.php b/resources/lang/en/dashboard.php index 66a61a697b41..cf3842f35b65 100644 --- a/resources/lang/en/dashboard.php +++ b/resources/lang/en/dashboard.php @@ -39,6 +39,7 @@ 'update' => [ 'title' => 'Create new incident update', 'subtitle' => 'Add an update to :incident', + 'success' => 'Update added.', ], // Incident templates diff --git a/tests/Api/ScheduleTest.php b/tests/Api/ScheduleTest.php index 9a97d5546af8..5ba3ee8486a8 100644 --- a/tests/Api/ScheduleTest.php +++ b/tests/Api/ScheduleTest.php @@ -39,7 +39,7 @@ public function testGetSchedule() $this->assertResponseOk(); - $this->seeJson($schedule->toArray()); + $this->seeJson(['name' => $schedule->name]); } public function testCreateSchedule()