silenced Discord option and validation, more translations

This commit is contained in:
Godfrey M 2023-03-08 10:35:45 -08:00
parent 69944853f9
commit 15c19a7ab7
4 changed files with 15 additions and 13 deletions

View file

@ -32,12 +32,12 @@ class SlackSettingsForm extends Component
"placeholder" => "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX",
"link" => 'https://api.slack.com/messaging/webhooks',
),
"Discord" => 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',
),
// "Discord" => 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',
// ),
"General"=> array(
"name" => "General",
"icon" => "fab fa-hashtag",
@ -108,7 +108,7 @@ class SlackSettingsForm extends Component
} catch (\Exception $e) {
$this->isDisabled= 'disabled';
return session()->flash('error' , trans('admin/settings/message.webhook.error', ['error_message' => $e->getMessage()]));
return session()->flash('error' , trans('admin/settings/message.webhook.error', ['error_message' => $e->getMessage(), 'app' => $this->webhook_name]));
}
//}

View file

@ -14,7 +14,7 @@ class AddsWebhookOptionToSettingsTable extends Migration
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->string('webhook_selected')->after('slack_botname')->default('Slack');nullable();
$table->string('webhook_selected')->after('slack_botname')->default('Slack')->nullable();
$table->renameColumn('slack_botname', 'webhook_botname');
$table->renameColumn('slack_endpoint', 'webhook_endpoint');
$table->renameColumn('slack_channel', 'webhook_channel');

View file

@ -34,11 +34,11 @@ return [
'authentication_success' => 'User authenticated against LDAP successfully!'
],
'webhook' => [
'sending' => 'Sending Slack test message...',
'sending' => 'Sending :app test message...',
'success_pt1' => 'Success! Check the ',
'success_pt2' => ' channel for your test message, and be sure to click SAVE below to store your settings.',
'500' => '500 Server Error.',
'error' => 'Something went wrong. Slack responded with: :error_message',
'error' => 'Something went wrong. :app responded with: :error_message',
'error_misc' => 'Something went wrong. :( ',
]
];

View file

@ -63,7 +63,7 @@
class="form-control "
>
<option value="Slack">Slack</option>
<option value="Discord">Discord</option>
{{-- <option value="Discord">Discord</option>--}}
<option value="General">General Webhook</option>
</select>
</div>
@ -83,10 +83,12 @@
<p class="text-warning"><i
class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
<input type="text" wire:model="webhook_endpoint" class='form-control'
placeholder={{$webhook_placeholder}} {{old('webhook_endpoint', $webhook_endpoint)}}>
placeholder="{{$webhook_placeholder}}"
value="{{old('webhook_endpoint', $webhook_endpoint)}}">
@else
<input type="text" wire:model="webhook_endpoint" class='form-control'
placeholder={{$webhook_placeholder}} {{old('webhook_endpoint', $webhook_endpoint)}}>
placeholder="{{$webhook_placeholder}}"
value="{{old('webhook_endpoint', $webhook_endpoint)}}">
@endif
{!! $errors->first('webhook_endpoint', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>