mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Small anal-retentive spacing/indenting tweaks
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
2d3ddd1c7a
commit
e40762cf7f
|
@ -28,7 +28,7 @@ class SlackSettingsForm extends Component
|
|||
'webhook_botname' => 'string|nullable',
|
||||
];
|
||||
|
||||
public function mount(){
|
||||
public function mount() {
|
||||
$this->webhook_text= [
|
||||
"slack" => array(
|
||||
"name" => trans('admin/settings/general.slack') ,
|
||||
|
@ -63,12 +63,14 @@ class SlackSettingsForm extends Component
|
|||
}
|
||||
|
||||
}
|
||||
public function updated($field){
|
||||
public function updated($field) {
|
||||
|
||||
if($this->webhook_selected != 'general') {
|
||||
$this->validateOnly($field, $this->rules);
|
||||
}
|
||||
}
|
||||
public function updatedWebhookSelected(){
|
||||
|
||||
public function updatedWebhookSelected() {
|
||||
$this->webhook_name = $this->webhook_text[$this->webhook_selected]['name'];
|
||||
$this->webhook_icon = $this->webhook_text[$this->webhook_selected]["icon"]; ;
|
||||
$this->webhook_placeholder = $this->webhook_text[$this->webhook_selected]["placeholder"];
|
||||
|
@ -79,7 +81,7 @@ class SlackSettingsForm extends Component
|
|||
}
|
||||
}
|
||||
|
||||
private function isButtonDisabled(){
|
||||
private function isButtonDisabled() {
|
||||
if($this->webhook_selected == 'slack') {
|
||||
if (empty($this->webhook_endpoint)) {
|
||||
$this->isDisabled = 'disabled';
|
||||
|
@ -92,6 +94,7 @@ class SlackSettingsForm extends Component
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->isButtonDisabled();
|
||||
|
@ -116,12 +119,14 @@ class SlackSettingsForm extends Component
|
|||
]);
|
||||
|
||||
try {
|
||||
|
||||
$webhook->post($this->webhook_endpoint, ['body' => $payload]);
|
||||
$this->isDisabled='';
|
||||
$this->save_button = trans('general.save');
|
||||
return session()->flash('success' , 'Your '.$this->webhook_name.' Integration works!');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
$this->isDisabled= 'disabled';
|
||||
return session()->flash('error' , trans('admin/settings/message.webhook.error', ['error_message' => $e->getMessage(), 'app' => $this->webhook_name]));
|
||||
}
|
||||
|
@ -131,6 +136,7 @@ class SlackSettingsForm extends Component
|
|||
}
|
||||
|
||||
public function clearSettings(){
|
||||
|
||||
if (Helper::isDemoMode()) {
|
||||
session()->flash('error',trans('general.feature_disabled'));
|
||||
} else {
|
||||
|
|
|
@ -150,8 +150,7 @@ class SettingsServiceProvider extends ServiceProvider
|
|||
// Set the monetary locale to the configured locale to make helper::parseFloat work.
|
||||
setlocale(LC_MONETARY, config('app.locale'));
|
||||
setlocale(LC_NUMERIC, config('app.locale'));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
$('#select2').select2();
|
||||
$('#select2').on('change', function (e) {
|
||||
var data = $('#select2').select2("val");
|
||||
@this.set('webhook_selected', data);
|
||||
@this.set('webhook_selected', data);
|
||||
});
|
||||
|
||||
// Re-render select2
|
||||
|
|
Loading…
Reference in a new issue