adding a test variable for test methods

This commit is contained in:
Godfrey M 2024-01-24 14:38:45 -08:00
parent ada1a593a4
commit 1d3124f89f
2 changed files with 19 additions and 10 deletions

View file

@ -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(){

View file

@ -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')