A free open source IT asset/license management system
adding a test variable for test methods
Godfrey M1d3124f89f68
diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.phpindex 865bd10b26..092df38511 100644--- a/app/Http/Livewire/SlackSettingsForm.php+++ b/app/Http/Livewire/SlackSettingsForm.php@@ -15,6 +15,7 @@ class SlackSettingsForm extends Componentpublic $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 Componentreturn 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.phpindex 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<!-- Webhook botname -->- <div class="form-group{{ $errors->has('webhook_botname') ? ' error' : '' }}">- <div class="col-md-2">- {{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_name ])) }}+ @if($webhook_selected != 'microsoft' && $webhook_selected != 'google')+ <div class="form-group{{ $errors->has('webhook_botname') ? ' error' : '' }}">+ <div class="col-md-2">+ {{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_name ])) }}+ </div>+ <div class="col-md-9">+ <input type="text" wire:model.lazy="webhook_botname" class='form-control' placeholder="Snipe-Bot" {{ old('webhook_botname', $webhook_botname)}}{{ Helper::isDemoMode() ? ' disabled' : ''}}>+ {!! $errors->first('webhook_botname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}+ </div><!--col-md-10--></div>- <div class="col-md-9">- <input type="text" wire:model.lazy="webhook_botname" class='form-control' placeholder="Snipe-Bot" {{ old('webhook_botname', $webhook_botname)}}{{ Helper::isDemoMode() ? ' disabled' : ''}}>- {!! $errors->first('webhook_botname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}- </div><!--col-md-10-->- </div>+ @endif@if (!Helper::isDemoMode())@include('partials.forms.demo-mode')