From 053c1b2ce2e6441c4fbd8cd2b8fe7cd7af6bf8ff Mon Sep 17 00:00:00 2001 From: James Brooks Date: Wed, 17 Jun 2026 18:22:44 +0100 Subject: [PATCH 1/5] Show affected components on the incident page Render the incident's affected components in a separate box at the top of the incident status page, reusing the existing component Blade component so each row matches the main status page. The box is only shown when the incident has components attached. Co-Authored-By: Claude Opus 4.8 (1M context) --- resources/lang/en/incident.php | 1 + .../views/status-page/incident.blade.php | 16 ++++++++++++ tests/Feature/StatusPage/IncidentPageTest.php | 26 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 tests/Feature/StatusPage/IncidentPageTest.php diff --git a/resources/lang/en/incident.php b/resources/lang/en/incident.php index 91a51c10..e62ad5e2 100644 --- a/resources/lang/en/incident.php +++ b/resources/lang/en/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Edit Incident', 'new_button' => 'New Incident', 'no_incidents_reported' => 'No incidents reported.', + 'affected_components_header' => 'Affected Components', 'timeline' => [ 'past_incidents_header' => 'Past Incidents', 'recent_incidents_header' => 'Recent Incidents', diff --git a/resources/views/status-page/incident.blade.php b/resources/views/status-page/incident.blade.php index 9af8608b..91c29abc 100644 --- a/resources/views/status-page/incident.blade.php +++ b/resources/views/status-page/incident.blade.php @@ -4,6 +4,22 @@
+ @if ($incident->components->isNotEmpty()) +
+ + +

+ {{ __('cachet::incident.affected_components_header') }} +

+ +
    + @foreach ($incident->components as $component) + + @endforeach +
+
+ @endif +
diff --git a/tests/Feature/StatusPage/IncidentPageTest.php b/tests/Feature/StatusPage/IncidentPageTest.php new file mode 100644 index 00000000..ed726ee4 --- /dev/null +++ b/tests/Feature/StatusPage/IncidentPageTest.php @@ -0,0 +1,26 @@ +create(['name' => 'API']); + $incident = Incident::factory()->create(); + $incident->components()->attach($component, [ + 'component_status' => ComponentStatusEnum::performance_issues->value, + ]); + + $this->get(route('cachet.status-page.incident', $incident)) + ->assertOk() + ->assertSee(__('cachet::incident.affected_components_header')) + ->assertSee('API'); +}); + +it('does not show the affected components box when none are attached', function () { + $incident = Incident::factory()->create(); + + $this->get(route('cachet.status-page.incident', $incident)) + ->assertOk() + ->assertDontSee(__('cachet::incident.affected_components_header')); +}); From fdd4108c65d2cb20314fc84ea2dba45ab69b1c8b Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 22 Jun 2026 16:39:03 +0100 Subject: [PATCH 2/5] Attach affected component to seeded incident Seed the demo incident with an affected component so the affected components box renders out of the box. Co-Authored-By: Claude Opus 4.8 (1M context) --- database/seeders/DatabaseSeeder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index e6aca69c..bd5aefa4 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -90,7 +90,7 @@ public function run(): void ]); /** @phpstan-ignore-next-line argument.type Larastan bug */ - $componentGroup->components()->createMany([ + [$website, $documentation, $blog] = $componentGroup->components()->createMany([ [ 'name' => 'Cachet Website', 'description' => 'The Cachet website.', @@ -182,6 +182,8 @@ public function run(): void 'occurred_at' => $timestamp, ]); + $incident->components()->attach($documentation); + $update = new Update([ 'status' => IncidentStatusEnum::identified, 'message' => 'We\'ve identified the issue and are working on a fix.', From 59d4fac6515aab736544be4f9521fc7a5026893a Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 22 Jun 2026 16:42:35 +0100 Subject: [PATCH 3/5] Hide status badge for affected components on the incident page Add an optional hideStatus prop to the component Blade component and set it when rendering the incident's affected components, so that box lists the components without repeating each one's status. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../views/components/component.blade.php | 46 ++++++++++--------- .../views/status-page/incident.blade.php | 2 +- src/View/Components/Component.php | 6 ++- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/resources/views/components/component.blade.php b/resources/views/components/component.blade.php index 14e6685f..e4a35b28 100644 --- a/resources/views/components/component.blade.php +++ b/resources/views/components/component.blade.php @@ -23,30 +23,32 @@ @endif
-
-
- @if ($component->incidents_count > 0) - - - - @else - - @endif -
+ @unless ($hideStatus ?? false) +
+
+ @if ($component->incidents_count > 0) + + + + @else + + @endif +
-
- {{ __('cachet::component.last_updated', ['timestamp' => $component->updated_at]) }} +
+ {{ __('cachet::component.last_updated', ['timestamp' => $component->updated_at]) }} +
-
+ @endunless
{{ \Cachet\Facades\CachetView::renderHook(\Cachet\View\RenderHook::STATUS_PAGE_BODY_AFTER) }} diff --git a/resources/views/status-page/incident.blade.php b/resources/views/status-page/incident.blade.php index 91c29abc..24996730 100644 --- a/resources/views/status-page/incident.blade.php +++ b/resources/views/status-page/incident.blade.php @@ -14,7 +14,7 @@
    @foreach ($incident->components as $component) - + @endforeach
diff --git a/src/View/Components/Component.php b/src/View/Components/Component.php index a627474d..b1329de4 100644 --- a/src/View/Components/Component.php +++ b/src/View/Components/Component.php @@ -11,8 +11,10 @@ class Component extends ViewComponent /** * Create a new component instance. */ - public function __construct(public \Cachet\Models\Component $component) - { + public function __construct( + public \Cachet\Models\Component $component, + public bool $hideStatus = false, + ) { // } From 87d6c7067c513e561a18b54a655ab4d89820dba7 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 22 Jun 2026 16:42:35 +0100 Subject: [PATCH 4/5] Add affected_components_header translations Co-Authored-By: Claude Opus 4.8 (1M context) --- resources/lang/de/incident.php | 1 + resources/lang/de_AT/incident.php | 1 + resources/lang/de_CH/incident.php | 1 + resources/lang/es_ES/incident.php | 1 + resources/lang/fr/incident.php | 1 + resources/lang/ko/incident.php | 1 + resources/lang/nl/incident.php | 1 + resources/lang/ph/incident.php | 1 + resources/lang/pt_BR/incident.php | 1 + resources/lang/zh_CN/incident.php | 1 + resources/lang/zh_TW/incident.php | 1 + 11 files changed, 11 insertions(+) diff --git a/resources/lang/de/incident.php b/resources/lang/de/incident.php index d445918c..29a308b5 100644 --- a/resources/lang/de/incident.php +++ b/resources/lang/de/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Vorfall bearbeiten', 'new_button' => 'Vorfall hinzufügen', 'no_incidents_reported' => 'Keine Vorfälle gemeldet.', + 'affected_components_header' => 'Betroffene Komponenten', 'timeline' => [ 'past_incidents_header' => 'Vergangene Vorfälle', 'recent_incidents_header' => 'Jüngste Vorfälle', diff --git a/resources/lang/de_AT/incident.php b/resources/lang/de_AT/incident.php index d445918c..29a308b5 100644 --- a/resources/lang/de_AT/incident.php +++ b/resources/lang/de_AT/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Vorfall bearbeiten', 'new_button' => 'Vorfall hinzufügen', 'no_incidents_reported' => 'Keine Vorfälle gemeldet.', + 'affected_components_header' => 'Betroffene Komponenten', 'timeline' => [ 'past_incidents_header' => 'Vergangene Vorfälle', 'recent_incidents_header' => 'Jüngste Vorfälle', diff --git a/resources/lang/de_CH/incident.php b/resources/lang/de_CH/incident.php index d445918c..29a308b5 100644 --- a/resources/lang/de_CH/incident.php +++ b/resources/lang/de_CH/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Vorfall bearbeiten', 'new_button' => 'Vorfall hinzufügen', 'no_incidents_reported' => 'Keine Vorfälle gemeldet.', + 'affected_components_header' => 'Betroffene Komponenten', 'timeline' => [ 'past_incidents_header' => 'Vergangene Vorfälle', 'recent_incidents_header' => 'Jüngste Vorfälle', diff --git a/resources/lang/es_ES/incident.php b/resources/lang/es_ES/incident.php index 7f2a2a46..38eb1a7b 100644 --- a/resources/lang/es_ES/incident.php +++ b/resources/lang/es_ES/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Editar Incidente', 'new_button' => 'Nuevo Incidente', 'no_incidents_reported' => 'No se han reportado incidentes.', + 'affected_components_header' => 'Componentes Afectados', 'timeline' => [ 'past_incidents_header' => 'Incidentes Pasados', 'recent_incidents_header' => 'Incidentes Recientes', diff --git a/resources/lang/fr/incident.php b/resources/lang/fr/incident.php index 497f953e..411cf6d2 100644 --- a/resources/lang/fr/incident.php +++ b/resources/lang/fr/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Modifier l’incident', 'new_button' => 'Nouvel incident', 'no_incidents_reported' => 'Aucun incident signalé.', + 'affected_components_header' => 'Composants affectés', 'timeline' => [ 'past_incidents_header' => 'Incidents passés', 'recent_incidents_header' => 'Incidents récents', diff --git a/resources/lang/ko/incident.php b/resources/lang/ko/incident.php index bb811d8f..e6e2c367 100644 --- a/resources/lang/ko/incident.php +++ b/resources/lang/ko/incident.php @@ -13,6 +13,7 @@ 'edit_button' => '사고 수정', 'new_button' => '새 사고', 'no_incidents_reported' => '보고된 사고가 없습니다.', + 'affected_components_header' => '영향받는 구성 요소', 'timeline' => [ 'past_incidents_header' => '과거 사고', 'recent_incidents_header' => '최근 사고', diff --git a/resources/lang/nl/incident.php b/resources/lang/nl/incident.php index 35db6c5d..aac7344e 100644 --- a/resources/lang/nl/incident.php +++ b/resources/lang/nl/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Incident bewerken', 'new_button' => 'Incident toevoegen', 'no_incidents_reported' => 'Er zijn geen incidenten gemeld.', + 'affected_components_header' => 'Getroffen componenten', 'timeline' => [ 'past_incidents_header' => 'Eerdere incidenten', 'recent_incidents_header' => 'Recente incidenten', diff --git a/resources/lang/ph/incident.php b/resources/lang/ph/incident.php index c0ae536c..d4f3bb51 100644 --- a/resources/lang/ph/incident.php +++ b/resources/lang/ph/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'I-edit ang Insidente', 'new_button' => 'Bagong Insidente', 'no_incidents_reported' => 'Walang naiulat na insidente.', + 'affected_components_header' => 'Mga Apektadong Komponente', 'timeline' => [ 'past_incidents_header' => 'Mga Nakaraang Insidente', 'recent_incidents_header' => 'Mga Kamakailang Insidente', diff --git a/resources/lang/pt_BR/incident.php b/resources/lang/pt_BR/incident.php index 9dbb0a00..59df2ef8 100644 --- a/resources/lang/pt_BR/incident.php +++ b/resources/lang/pt_BR/incident.php @@ -13,6 +13,7 @@ 'edit_button' => 'Editar Incidente', 'new_button' => 'Novo Incidente', 'no_incidents_reported' => 'Nenhum incidente reportado.', + 'affected_components_header' => 'Componentes Afetados', 'timeline' => [ 'past_incidents_header' => 'Incidentes Anteriores', 'recent_incidents_header' => 'Incidentes Recentes', diff --git a/resources/lang/zh_CN/incident.php b/resources/lang/zh_CN/incident.php index 5972c7e9..9d631a96 100644 --- a/resources/lang/zh_CN/incident.php +++ b/resources/lang/zh_CN/incident.php @@ -13,6 +13,7 @@ 'edit_button' => '编辑事件', 'new_button' => '新建事件', 'no_incidents_reported' => '没有事件被报告。', + 'affected_components_header' => '受影响的组件', 'timeline' => [ 'past_incidents_header' => '过去的事件', 'recent_incidents_header' => '最近的事件', diff --git a/resources/lang/zh_TW/incident.php b/resources/lang/zh_TW/incident.php index f586db4c..9035d019 100644 --- a/resources/lang/zh_TW/incident.php +++ b/resources/lang/zh_TW/incident.php @@ -13,6 +13,7 @@ 'edit_button' => '編輯事件', 'new_button' => '新建事件', 'no_incidents_reported' => '沒有事件被報告。', + 'affected_components_header' => '受影響的元件', 'timeline' => [ 'past_incidents_header' => '過去的事件', 'recent_incidents_header' => '最近的事件', From d1e0e502f1879d123e2af553d57f4e5a19c01fc8 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 22 Jun 2026 16:42:35 +0100 Subject: [PATCH 5/5] Suppress Testbench PDO::MYSQL_ATTR_SSL_CA deprecation on PHP 8.5 Co-Authored-By: Claude Opus 4.8 (1M context) --- composer.json | 5 +++- workbench/bootstrap/suppress-deprecations.php | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 workbench/bootstrap/suppress-deprecations.php diff --git a/composer.json b/composer.json index 347c842b..49659774 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,10 @@ "Workbench\\App\\": "workbench/app/", "Workbench\\Database\\Factories\\": "workbench/database/factories/", "Workbench\\Database\\Seeders\\": "workbench/database/seeders/" - } + }, + "files": [ + "workbench/bootstrap/suppress-deprecations.php" + ] }, "config": { "allow-plugins": { diff --git a/workbench/bootstrap/suppress-deprecations.php b/workbench/bootstrap/suppress-deprecations.php new file mode 100644 index 00000000..a9b32998 --- /dev/null +++ b/workbench/bootstrap/suppress-deprecations.php @@ -0,0 +1,24 @@ +