mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Added select2 to slack settings
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
647f47cdfe
commit
637438ccf6
|
@ -5,6 +5,7 @@ namespace App\Http\Livewire;
|
|||
use GuzzleHttp\Client;
|
||||
use Livewire\Component;
|
||||
use App\Models\Setting;
|
||||
use App\Helpers\Helper;
|
||||
|
||||
class SlackSettingsForm extends Component
|
||||
{
|
||||
|
@ -125,7 +126,6 @@ class SlackSettingsForm extends Component
|
|||
return session()->flash('error' , trans('admin/settings/message.webhook.error', ['error_message' => $e->getMessage(), 'app' => $this->webhook_name]));
|
||||
}
|
||||
|
||||
//}
|
||||
return session()->flash('error' , trans('admin/settings/message.webhook.error_misc'));
|
||||
|
||||
}
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
{{ trans('general.integration_option') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9 required">
|
||||
<select wire:model="webhook_selected" aria-label="webhook_selected" class="form-control"{{ Helper::isDemoMode() ? ' disabled' : ''}}>
|
||||
<div class="col-md-9 required" wire:ignore>
|
||||
<select aria-label="webhook_selected" id="select2" class="select2 form-control"{{ Helper::isDemoMode() ? ' disabled' : ''}}>
|
||||
<option value="slack">{{ trans('admin/settings/general.slack') }}</option>
|
||||
<option value="general">{{ trans('admin/settings/general.general_webhook') }}</option>
|
||||
</select>
|
||||
|
@ -159,3 +159,25 @@
|
|||
</div> <!-- /livewire div -->
|
||||
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#select2').select2();
|
||||
$('#select2').on('change', function (e) {
|
||||
var data = $('#select2').select2("val");
|
||||
@this.set('webhook_selected', data);
|
||||
});
|
||||
|
||||
// Re-render select2
|
||||
window.livewire.hook('message.processed', function (el, component) {
|
||||
$('.select2').select2();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue