From 0c665d52042ad949eca55dc4ff12be577a6fcb40 Mon Sep 17 00:00:00 2001 From: "nikita.hohlov" Date: Sat, 5 Sep 2026 08:24:37 -0300 Subject: [PATCH] fix: webhook channel card shows both deliver and presence URLs Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw --- core/resources/views/inbox.blade.php | 9 +++++++- core/tests/Feature/InboxChannelsTest.php | 28 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 core/tests/Feature/InboxChannelsTest.php diff --git a/core/resources/views/inbox.blade.php b/core/resources/views/inbox.blade.php index cbbae6b..e01f0ba 100644 --- a/core/resources/views/inbox.blade.php +++ b/core/resources/views/inbox.blade.php @@ -163,7 +163,14 @@ footer{position:relative;z-index:1;max-width:880px;width:100%;margin:0 auto;padd @foreach($channels as $ch)
{{ ['web' => 'Веб', 'telegram' => 'Telegram', 'webhook' => 'Webhook'][$ch['type']] }} - {{ $ch['type'] === 'web' ? 'этот инбокс' : ($ch['type'] === 'telegram' ? 'чат '.($ch['config']['chat_id'] ?? '—') : ($ch['config']['deliver_url'] ?? '—')) }} + @if($ch['type'] === 'webhook') +
+
доставка → {{ $ch['config']['deliver_url'] ?? '—' }}
+
присутствие → {{ $ch['config']['presence_url'] ?? '—' }}
+
+ @else + {{ $ch['type'] === 'web' ? 'этот инбокс' : 'чат '.($ch['config']['chat_id'] ?? '—') }} + @endif @if($ch['type'] !== 'web')@endif
@endforeach diff --git a/core/tests/Feature/InboxChannelsTest.php b/core/tests/Feature/InboxChannelsTest.php new file mode 100644 index 0000000..5636c1e --- /dev/null +++ b/core/tests/Feature/InboxChannelsTest.php @@ -0,0 +1,28 @@ +get('/', ['X-Remote-User' => 'luci']); + User::sole()->channels()->create([ + 'type' => ChannelType::Webhook, + 'config' => ['deliver_url' => 'https://ha.test/api/webhook/hado', 'presence_url' => 'https://ha.test/api/presence'], + 'enabled' => true, + ]); + + $this->get('/', ['X-Remote-User' => 'luci'])->assertOk() + ->assertSee('https://ha.test/api/webhook/hado') + ->assertSee('https://ha.test/api/presence') + ->assertSeeInOrder(['доставка', 'https://ha.test/api/webhook/hado', 'присутствие', 'https://ha.test/api/presence']); + } +}