From e8fc895e51584839e06b87fd5949954170d67688 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 27 Feb 2023 09:19:59 -0800 Subject: [PATCH 1/9] "adds variables, but still not working" --- app/Http/Livewire/SlackSettingsForm.php | 9 +++ resources/lang/en/admin/settings/general.php | 20 ++--- .../livewire/slack-settings-form.blade.php | 81 +++++++++++++++++-- resources/views/settings/slack.blade.php | 36 ++------- 4 files changed, 100 insertions(+), 46 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index cd34b450a..6df4bdeea 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -12,6 +12,12 @@ class SlackSettingsForm extends Component public $slack_channel; public $slack_botname; public $isDisabled ='disabled' ; + public $integration_app= 'WORKING'; + public $webhook_link; + public $webhook_selected; + public $webhook_options= ['Slack'=>'fab fa-slack', 'Discord'=>'fab fa-discord', 'Rocket.Chat'=>'fab fa-rocketchat']; + public $webhook; + public $icon; public Setting $setting; @@ -24,6 +30,8 @@ class SlackSettingsForm extends Component public function mount(){ $this->setting = Setting::getSettings(); + $this->icon =''; + $this->webhook = $this->webhook_selected; $this->slack_endpoint = $this->setting->slack_endpoint; $this->slack_channel = $this->setting->slack_channel; $this->slack_botname = $this->setting->slack_botname; @@ -31,6 +39,7 @@ class SlackSettingsForm extends Component } public function updated($field){ + $this->webhook = $this->webhook_selected; $this->validateOnly($field ,$this->rules); } diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php index 70c4932fd..d48714d7d 100644 --- a/resources/lang/en/admin/settings/general.php +++ b/resources/lang/en/admin/settings/general.php @@ -198,16 +198,16 @@ return [ 'show_images_in_email' => 'Show images in emails', 'show_images_in_email_help' => 'Uncheck this box if your Snipe-IT installation is behind a VPN or closed network and users outside the network will not be able to load images served from this installation in their emails.', 'site_name' => 'Site Name', - 'slack' => 'Slack', - 'slack_title' => 'Update Slack Settings', - 'slack_help' => 'Slack settings', - 'slack_botname' => 'Slack Botname', - 'slack_channel' => 'Slack Channel', - 'slack_endpoint' => 'Slack Endpoint', - 'slack_integration' => 'Slack Settings', - 'slack_integration_help' => 'Slack integration is optional, however the endpoint and channel are required if you wish to use it. To configure Slack integration, you must first create an incoming webhook on your Slack account. Click on the Test Slack Integration button to confirm your settings are correct before saving. ', - 'slack_integration_help_button' => 'Once you have saved your Slack information, a test button will appear.', - 'slack_test_help' => 'Test whether your Slack integration is configured correctly. YOU MUST SAVE YOUR UPDATED SLACK SETTINGS FIRST.', + 'slack' => ':app', + 'slack_title' => 'Update :app Settings', + 'slack_help' => ':app settings', + 'slack_botname' => ':app Botname', + 'slack_channel' => ':app Channel', + 'slack_endpoint' => ':app Endpoint', + 'slack_integration' => ':app Settings', + 'slack_integration_help' => ':app integration is optional, however the endpoint and channel are required if you wish to use it. To configure :app integration, you must first create an incoming webhook on your :app account. Click on the Test :app Integration button to confirm your settings are correct before saving. ', + 'slack_integration_help_button' => 'Once you have saved your :app information, a test button will appear.', + 'slack_test_help' => 'Test whether your :app integration is configured correctly. YOU MUST SAVE YOUR UPDATED :app SETTINGS FIRST.', 'snipe_version' => 'Snipe-IT version', 'support_footer' => 'Support Footer Links ', 'support_footer_help' => 'Specify who sees the links to the Snipe-IT Support info and Users Manual', diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index 6d48220ca..4878998ec 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -1,4 +1,32 @@ +{{-- Page title --}} +@section('title') + {{ trans('admin/settings/general.slack_title', ['app' => $integration_app ]) }} + @parent +@stop +@section('header_right') + {{ trans('general.back') }} +@stop + + +{{-- Page content --}} +@section('content') + +
+
+
+
+

+ {{ trans('admin/settings/general.slack',['app' => $integration_app ]) }} +

+
+
+
+

+ {!! trans('admin/settings/general.slack_integration_help',array('slack_link' => $webhook_link, 'app' => $integration_app )) !!} +

+
+
@if (session()->has('save')) @@ -22,14 +50,32 @@ {{session('message')}}
@endif - +
+
+ +
+
+ + {{var_dump($webhook_selected)}} +



+
{{csrf_field()}}
- {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint')) }} + {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint',['app' => $integration_app ])) }}
@if (config('app.lock_passwords')===true) @@ -45,7 +91,7 @@
- {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel')) }} + {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel',['app' => $integration_app ])) }}
@if (config('app.lock_passwords')===true) @@ -62,7 +108,7 @@
- {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname')) }} + {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname',['app' => $integration_app ])) }}
@if (config('app.lock_passwords')===true) @@ -80,7 +126,7 @@ @if($slack_endpoint != null && $slack_channel != null) @@ -95,5 +141,30 @@
+
+
+ +@stop + +@push('scripts') + +@endpush diff --git a/resources/views/settings/slack.blade.php b/resources/views/settings/slack.blade.php index a5cbd8d0b..fac07c7cc 100644 --- a/resources/views/settings/slack.blade.php +++ b/resources/views/settings/slack.blade.php @@ -1,44 +1,18 @@ @extends('layouts/default') -{{-- Page title --}} -@section('title') - {{ trans('admin/settings/general.slack_title') }} - @parent -@stop - -@section('header_right') - {{ trans('general.back') }} -@stop -{{-- Page content --}} -@section('content') -
-
-
-
-

- {{ trans('admin/settings/general.slack') }} -

-
-
-
-

- {!! trans('admin/settings/general.slack_integration_help',array('slack_link' => 'https://my.slack.com/services/new/incoming-webhook')) !!} -

-
-
+ @livewire('slack-settings-form') -
-
- - -@stop + + + + From 354f04534e54540bf9566adf4692224940c6a66d Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 1 Mar 2023 12:30:32 -0800 Subject: [PATCH 2/9] add multi array, migration, still having issues --- app/Http/Livewire/SlackSettingsForm.php | 71 ++-- ..._adds_webhook_option_to_settings_table.php | 39 +++ resources/lang/en/admin/settings/general.php | 20 +- .../livewire/slack-settings-form.blade.php | 306 +++++++++--------- 4 files changed, 256 insertions(+), 180 deletions(-) create mode 100644 database/migrations/2023_02_28_173527_adds_webhook_option_to_settings_table.php diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 6df4bdeea..996a30e23 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -8,56 +8,74 @@ use App\Models\Setting; class SlackSettingsForm extends Component { - public $slack_endpoint; - public $slack_channel; - public $slack_botname; + public $webhook_endpoint; + public $webhook_channel; + public $webhook_botname; public $isDisabled ='disabled' ; - public $integration_app= 'WORKING'; public $webhook_link; public $webhook_selected; - public $webhook_options= ['Slack'=>'fab fa-slack', 'Discord'=>'fab fa-discord', 'Rocket.Chat'=>'fab fa-rocketchat']; - public $webhook; + public $webhook_options = array( + array( + "name" => 'Slack', + "icon" => 'fab fa-slack', + "placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX", + "link" => 'https://api.slack.com/messaging/webhooks' + ), + array( + "name" => 'Discord', + "icon" => 'fab fa-discord', + "placeholder" => "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXX", + "link" => 'https://support.discord.com/hc/en-us/articles/360045093012-Server-Integrations-Page' + ), + array( + "name" => 'Rocket Chat', + "icon" => 'fab fa-rocketchat', + "placeholder" => "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXX", + "link" => '', + ), + ); + public $keys; public $icon; public Setting $setting; protected $rules = [ - 'slack_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', - 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', - 'slack_botname' => 'string|nullable', + 'webhook_endpoint' => 'url|required_with:slack_channel|starts_with:https://hooks.slack.com/|nullable', + 'webhook_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', + 'webhook_botname' => 'string|nullable', ]; public function mount(){ $this->setting = Setting::getSettings(); - $this->icon =''; - $this->webhook = $this->webhook_selected; - $this->slack_endpoint = $this->setting->slack_endpoint; - $this->slack_channel = $this->setting->slack_channel; - $this->slack_botname = $this->setting->slack_botname; + $this->webhook_endpoint = $this->setting->webhook_endpoint; + $this->webhook_channel = $this->setting->webhook_channel; + $this->webhook_botname = $this->setting->webhook_botname; +// $this->webhook_options = $this->setting->webhook_selected;lma + $this->keys = array_column($this->webhook_options, 'name'); + } public function updated($field){ - - $this->webhook = $this->webhook_selected; + $this->webhook_selected = $this->webhook_options; $this->validateOnly($field ,$this->rules); } public function render() { - if(empty($this->slack_channel || $this->slack_endpoint)){ + if(empty($this->webhook_channel || $this->webhook_endpoint)){ $this->isDisabled= 'disabled'; } - if(empty($this->slack_endpoint && $this->slack_channel)){ + if(empty($this->webhook_endpoint && $this->webhook_channel)){ $this->isDisabled= ''; } return view('livewire.slack-settings-form'); } - public function testSlack(){ + public function testWebhook(){ $slack = new Client([ - 'base_url' => e($this->slack_endpoint), + 'base_url' => e($this->webhook_endpoint), 'defaults' => [ 'exceptions' => false, ], @@ -65,14 +83,14 @@ class SlackSettingsForm extends Component $payload = json_encode( [ - 'channel' => e($this->slack_channel), + 'channel' => e($this->webhook_channel), 'text' => trans('general.slack_test_msg'), - 'username' => e($this->slack_botname), + 'username' => e($this->webhook_botname), 'icon_emoji' => ':heart:', ]); try { - $slack->post($this->slack_endpoint, ['body' => $payload]); + $slack->post($this->webhook_endpoint, ['body' => $payload]); $this->isDisabled=''; return session()->flash('success' , 'Your Slack Integration works!'); @@ -91,9 +109,10 @@ class SlackSettingsForm extends Component { $this->validate($this->rules); - $this->setting->slack_endpoint = $this->slack_endpoint; - $this->setting->slack_channel = $this->slack_channel; - $this->setting->slack_botname = $this->slack_botname; + $this->setting->webhook_options = $this->webhook_options; + $this->setting->webhook_endpoint = $this->webhook_endpoint; + $this->setting->webhook_channel = $this->webhook_channel; + $this->setting->webhook_botname = $this->webhook_botname; $this->setting->save(); diff --git a/database/migrations/2023_02_28_173527_adds_webhook_option_to_settings_table.php b/database/migrations/2023_02_28_173527_adds_webhook_option_to_settings_table.php new file mode 100644 index 000000000..8f5928822 --- /dev/null +++ b/database/migrations/2023_02_28_173527_adds_webhook_option_to_settings_table.php @@ -0,0 +1,39 @@ +string('webhook_selected')->after('slack_botname')->nullable(); + $table->renameColumn('slack_botname', 'webhook_botname'); + $table->renameColumn('slack_endpoint', 'webhook_endpoint'); + $table->renameColumn('slack_channel', 'webhook_channel'); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function (Blueprint $table) { + $table->dropColumn('webhook_selected'); + $table->renameColumn('webhook_botname', 'slack_botname'); + $table->renameColumn('webhook_endpoint', 'slack_endpoint'); + $table->renameColumn('webhook_channel', 'slack_channel'); + }); + } +} diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php index d48714d7d..81d40792a 100644 --- a/resources/lang/en/admin/settings/general.php +++ b/resources/lang/en/admin/settings/general.php @@ -198,16 +198,16 @@ return [ 'show_images_in_email' => 'Show images in emails', 'show_images_in_email_help' => 'Uncheck this box if your Snipe-IT installation is behind a VPN or closed network and users outside the network will not be able to load images served from this installation in their emails.', 'site_name' => 'Site Name', - 'slack' => ':app', - 'slack_title' => 'Update :app Settings', - 'slack_help' => ':app settings', - 'slack_botname' => ':app Botname', - 'slack_channel' => ':app Channel', - 'slack_endpoint' => ':app Endpoint', - 'slack_integration' => ':app Settings', - 'slack_integration_help' => ':app integration is optional, however the endpoint and channel are required if you wish to use it. To configure :app integration, you must first create an incoming webhook on your :app account. Click on the Test :app Integration button to confirm your settings are correct before saving. ', - 'slack_integration_help_button' => 'Once you have saved your :app information, a test button will appear.', - 'slack_test_help' => 'Test whether your :app integration is configured correctly. YOU MUST SAVE YOUR UPDATED :app SETTINGS FIRST.', + 'webhook' => ':app', + 'webhook_title' => 'Update :app Settings', + 'webhook_help' => ':app settings', + 'webhook_botname' => ':app Botname', + 'webhook_channel' => ':app Channel', + 'webhook_endpoint' => ':app Endpoint', + 'webhook_integration' => ':app Settings', + 'webhook_integration_help' => ':app integration is optional, however the endpoint and channel are required if you wish to use it. To configure :app integration, you must first create an incoming webhook on your :app account. Click on the Test :app Integration button to confirm your settings are correct before saving. ', + 'webhook_integration_help_button' => 'Once you have saved your :app information, a test button will appear.', + 'webhook_test_help' => 'Test whether your :app integration is configured correctly. YOU MUST SAVE YOUR UPDATED :app SETTINGS FIRST.', 'snipe_version' => 'Snipe-IT version', 'support_footer' => 'Support Footer Links ', 'support_footer_help' => 'Specify who sees the links to the Snipe-IT Support info and Users Manual', diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index 4878998ec..b863a0aae 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -1,6 +1,6 @@ {{-- Page title --}} @section('title') - {{ trans('admin/settings/general.slack_title', ['app' => $integration_app ]) }} + {{ trans('admin/settings/general.webhook_title', ['app' => $webhook_selected->name ]) }} @parent @stop @@ -12,159 +12,177 @@ {{-- Page content --}} @section('content') -
-
-
-
-

- {{ trans('admin/settings/general.slack',['app' => $integration_app ]) }} -

-
-
-
-

- {!! trans('admin/settings/general.slack_integration_help',array('slack_link' => $webhook_link, 'app' => $integration_app )) !!} -

-
-
- -
- @if (session()->has('save')) -
- {{session('save')}} -
- @endif - - @if(session()->has('success')) -
- {{session('success')}} -
- @endif - @if(session()->has('error')) -
- {{session('error')}} -
- @endif - @if(session()->has('message')) -
- {{session('message')}} -
- @endif -
-
- +
+
+
+
+

+ {{ trans('admin/settings/general.webhook',['app' => $webhook_selected->name ]) }} +

-
- - {{var_dump($webhook_selected)}} -



-
-
- {{csrf_field()}} +
+
+

+ {!! trans('admin/settings/general.webhook_integration_help',array('webhook_link' => $webhook_link, 'app' => $webhook_selected )) !!} +

+
+
- -
-
- {{ Form::label('slack_endpoint', trans('admin/settings/general.slack_endpoint',['app' => $integration_app ])) }} -
-
- @if (config('app.lock_passwords')===true) -

{{ trans('general.feature_disabled') }}

- - @else - - @endif - {!! $errors->first('slack_endpoint', '') !!} -
-
+
+ @if (session()->has('save')) +
+ {{session('save')}} +
+ @endif - -
-
- {{ Form::label('slack_channel', trans('admin/settings/general.slack_channel',['app' => $integration_app ])) }} -
-
- @if (config('app.lock_passwords')===true) - -

{{ trans('general.feature_disabled') }}

+ @if(session()->has('success')) +
+ {{session('success')}} +
+ @endif + @if(session()->has('error')) +
+ {{session('error')}} +
+ @endif + @if(session()->has('message')) +
+ {{session('message')}} +
+ @endif +
+
+ +
+
+{{-- - @endif - {!! $errors->first('slack_channel', '') !!} -
-
+{{-- --}} +
+


- -
-
- {{ Form::label('slack_botname', trans('admin/settings/general.slack_botname',['app' => $integration_app ])) }} -
-
- @if (config('app.lock_passwords')===true) - -

{{ trans('general.feature_disabled') }}

+
+ + {{csrf_field()}} - @else - - @endif - {!! $errors->first('slack_botname', '') !!} -
-
+ +
+
+ {{ Form::label('webhook_endpoint', trans('admin/settings/general.webhook_endpoint',['app' => $webhook_selected ])) }} +
+
+ @if (config('app.lock_passwords')===true) +

{{ trans('general.feature_disabled') }}

+ + @else + + @endif + {!! $errors->first('webhook_endpoint', '') !!} +
+
- - @if($slack_endpoint != null && $slack_channel != null) - - @endif + +
+
+ {{ Form::label('webhook_channel', trans('admin/settings/general.webhook_channel',['app' => $webhook_selected ])) }} +
+
+ @if (config('app.lock_passwords')===true) + +

{{ trans('general.feature_disabled') }}

- - + @else + + @endif + {!! $errors->first('webhook_channel', '') !!} +
+
-
-
-
+ +
+
+ {{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_selected ])) }} +
+
+ @if (config('app.lock_passwords')===true) + +

{{ trans('general.feature_disabled') }}

-@stop + @else + + @endif + {!! $errors->first('webhook_botname', '') !!} +
+
-@push('scripts') - -@endpush + + @endpush From aae178a60652d61796cd99e277cebd7398924c8b Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 1 Mar 2023 17:10:10 -0800 Subject: [PATCH 3/9] gets select working, placeholders update dynamically --- app/Http/Livewire/SlackSettingsForm.php | 55 +++++++++--------- .../livewire/slack-settings-form.blade.php | 58 +++++-------------- resources/views/settings/slack.blade.php | 36 ++++++++++-- 3 files changed, 73 insertions(+), 76 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 996a30e23..ac9474338 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -13,29 +13,9 @@ class SlackSettingsForm extends Component public $webhook_botname; public $isDisabled ='disabled' ; public $webhook_link; + public $webhook_placeholder; + public $webhook_icon; public $webhook_selected; - public $webhook_options = array( - array( - "name" => 'Slack', - "icon" => 'fab fa-slack', - "placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX", - "link" => 'https://api.slack.com/messaging/webhooks' - ), - array( - "name" => 'Discord', - "icon" => 'fab fa-discord', - "placeholder" => "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXX", - "link" => 'https://support.discord.com/hc/en-us/articles/360045093012-Server-Integrations-Page' - ), - array( - "name" => 'Rocket Chat', - "icon" => 'fab fa-rocketchat', - "placeholder" => "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXX", - "link" => '', - ), - ); - public $keys; - public $icon; public Setting $setting; @@ -44,6 +24,23 @@ class SlackSettingsForm extends Component 'webhook_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', 'webhook_botname' => 'string|nullable', ]; + static $webhook_text= [ + "Slack" => array( + "icon" => 'fab fa-slack', + "placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX", + "link" => 'https://api.slack.com/messaging/webhooks' + ), + "Discord" => array( + "icon" => 'fab fa-discord', + "placeholder" => "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXX", + "link" => 'https://support.discord.com/hc/en-us/articles/360045093012-Server-Integrations-Page' + ), + "RocketChat"=> array( + "icon" => 'fab fa-rocketchat', + "placeholder" => "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXXX", + "link" => '', + ), + ]; public function mount(){ @@ -51,15 +48,21 @@ class SlackSettingsForm extends Component $this->webhook_endpoint = $this->setting->webhook_endpoint; $this->webhook_channel = $this->setting->webhook_channel; $this->webhook_botname = $this->setting->webhook_botname; -// $this->webhook_options = $this->setting->webhook_selected;lma - $this->keys = array_column($this->webhook_options, 'name'); + $this->webhook_options = $this->setting->webhook_selected; } public function updated($field){ - $this->webhook_selected = $this->webhook_options; +// $this->webhook_selected = $this->webhook_options; $this->validateOnly($field ,$this->rules); } + public function updatedWebhookSelected(){ + + $this->webhook_icon = self::$webhook_text[$this->webhook_selected]["icon"]; ; + $this->webhook_placeholder = self::$webhook_text[$this->webhook_selected]["placeholder"]; + $this->webhook_link = self::$webhook_text[$this->webhook_selected]["link"]; + + } public function render() { @@ -109,7 +112,7 @@ class SlackSettingsForm extends Component { $this->validate($this->rules); - $this->setting->webhook_options = $this->webhook_options; + $this->setting->webhook_selected = $this->webhwebhook_selected; $this->setting->webhook_endpoint = $this->webhook_endpoint; $this->setting->webhook_channel = $this->webhook_channel; $this->setting->webhook_botname = $this->webhook_botname; diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index b863a0aae..c435ae0c4 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -1,32 +1,4 @@ -{{-- Page title --}} -@section('title') - {{ trans('admin/settings/general.webhook_title', ['app' => $webhook_selected->name ]) }} - @parent -@stop - -@section('header_right') - {{ trans('general.back') }} -@stop - - -{{-- Page content --}} -@section('content') - -
-
-
-
-

- {{ trans('admin/settings/general.webhook',['app' => $webhook_selected->name ]) }} -

-
-
-
-

- {!! trans('admin/settings/general.webhook_integration_help',array('webhook_link' => $webhook_link, 'app' => $webhook_selected )) !!} -

-
-
+
@if (session()->has('save')) @@ -50,23 +22,21 @@ {{session('message')}}
@endif +
-{{-- --}} +



@@ -84,10 +54,10 @@

{{ trans('general.feature_disabled') }}

+ placeholder={{$webhook_placeholder}} {{old('webhook_endpoint', $webhook_endpoint)}}> @else + placeholder={{$webhook_placeholder}} {{old('webhook_endpoint', $webhook_endpoint)}}> @endif {!! $errors->first('webhook_endpoint', '') !!}
@@ -160,9 +130,7 @@
-
- @stop @push('scripts') - @endpush diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index 5b49e1c7e..678233c93 100755 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -164,7 +164,7 @@
- +

{{ trans('admin/settings/general.integrations') }}
From 542332ea0c2a78112f1bcddc27aec5f6f6e08d31 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 13 Mar 2023 10:54:18 -0700 Subject: [PATCH 8/9] removes discord from rules --- app/Http/Livewire/SlackSettingsForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index c28394140..dfbc3b17c 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -21,7 +21,7 @@ class SlackSettingsForm extends Component public Setting $setting; protected $rules = [ - 'webhook_endpoint' => 'url|required_with:webhook_channel|starts_with:https://hooks.slack.com/services,https://discord.com/api/webhooks|nullable', + 'webhook_endpoint' => 'url|required_with:webhook_channel|starts_with:https://hooks.slack.com/services|nullable', 'webhook_channel' => 'required_with:webhook_endpoint|starts_with:#|nullable', 'webhook_botname' => 'string|nullable', ]; From 11bf3f52857687ae181639b8cc5ab067d4f77eee Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 13 Mar 2023 14:06:05 -0700 Subject: [PATCH 9/9] aligned inputs --- resources/views/livewire/slack-settings-form.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/livewire/slack-settings-form.blade.php b/resources/views/livewire/slack-settings-form.blade.php index 5bf501e22..cdfd03c8c 100644 --- a/resources/views/livewire/slack-settings-form.blade.php +++ b/resources/views/livewire/slack-settings-form.blade.php @@ -55,11 +55,11 @@
@endif -
-
+
+
-
+