From 1d3124f89f681fb4ab4050ed0abb57bfc06073bd Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 24 Jan 2024 14:38:45 -0800 Subject: [PATCH] adding a test variable for test methods --- app/Http/Livewire/SlackSettingsForm.php | 11 +++++++++-- .../livewire/slack-settings-form.blade.php | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 865bd10b26..092df38511 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -15,6 +15,7 @@ class SlackSettingsForm extends Component public $isDisabled ='disabled' ; public $webhook_name; public $webhook_link; + public $webhook_test; public $webhook_placeholder; public $webhook_icon; public $webhook_selected; @@ -41,18 +42,21 @@ class SlackSettingsForm extends Component "icon" => 'fab fa-slack', "placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX", "link" => 'https://api.slack.com/messaging/webhooks', + "test" => 'testWebhook' ), "general" => array( "name" => trans('admin/settings/general.general_webhook'), "icon" => "fab fa-hashtag", "placeholder" => "", "link" => "", + "test" => 'testWebhook' ), "google" => array( "name" => trans('admin/settings/general.google_workspaces'), "icon" => "fa-brands fa-google", - "placeholder" => "", - "link" => "", + "placeholder" => "https://chat.googleapis.com/v1/spaces/xxxxxxxx/messages?key=xxxxxx", + "link" => "https://developers.google.com/chat/how-tos/webhooks#register_the_incoming_webhook", + "test" => 'googleWebhookTest' ), ]; @@ -145,6 +149,9 @@ class SlackSettingsForm extends Component return session()->flash('error' , trans('admin/settings/message.webhook.error_misc')); + } + public function googleWebhookTest(){ + } public function clearSettings(){ diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index a33aad6abd..fd8696c6a7 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -106,15 +106,17 @@ @endif -
-
- {{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_name ])) }} + @if($webhook_selected != 'microsoft' && $webhook_selected != 'google') +
+
+ {{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_name ])) }} +
+
+ + {!! $errors->first('webhook_botname', '') !!} +
-
- - {!! $errors->first('webhook_botname', '') !!} -
-
+ @endif @if (!Helper::isDemoMode()) @include('partials.forms.demo-mode')