mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -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',
|
'webhook_botname' => 'string|nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function mount(){
|
public function mount() {
|
||||||
$this->webhook_text= [
|
$this->webhook_text= [
|
||||||
"slack" => array(
|
"slack" => array(
|
||||||
"name" => trans('admin/settings/general.slack') ,
|
"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') {
|
if($this->webhook_selected != 'general') {
|
||||||
$this->validateOnly($field, $this->rules);
|
$this->validateOnly($field, $this->rules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function updatedWebhookSelected(){
|
|
||||||
|
public function updatedWebhookSelected() {
|
||||||
$this->webhook_name = $this->webhook_text[$this->webhook_selected]['name'];
|
$this->webhook_name = $this->webhook_text[$this->webhook_selected]['name'];
|
||||||
$this->webhook_icon = $this->webhook_text[$this->webhook_selected]["icon"]; ;
|
$this->webhook_icon = $this->webhook_text[$this->webhook_selected]["icon"]; ;
|
||||||
$this->webhook_placeholder = $this->webhook_text[$this->webhook_selected]["placeholder"];
|
$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($this->webhook_selected == 'slack') {
|
||||||
if (empty($this->webhook_endpoint)) {
|
if (empty($this->webhook_endpoint)) {
|
||||||
$this->isDisabled = 'disabled';
|
$this->isDisabled = 'disabled';
|
||||||
|
@ -92,6 +94,7 @@ class SlackSettingsForm extends Component
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$this->isButtonDisabled();
|
$this->isButtonDisabled();
|
||||||
|
@ -116,12 +119,14 @@ class SlackSettingsForm extends Component
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$webhook->post($this->webhook_endpoint, ['body' => $payload]);
|
$webhook->post($this->webhook_endpoint, ['body' => $payload]);
|
||||||
$this->isDisabled='';
|
$this->isDisabled='';
|
||||||
$this->save_button = trans('general.save');
|
$this->save_button = trans('general.save');
|
||||||
return session()->flash('success' , 'Your '.$this->webhook_name.' Integration works!');
|
return session()->flash('success' , 'Your '.$this->webhook_name.' Integration works!');
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
$this->isDisabled= 'disabled';
|
$this->isDisabled= 'disabled';
|
||||||
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', ['error_message' => $e->getMessage(), 'app' => $this->webhook_name]));
|
||||||
}
|
}
|
||||||
|
@ -131,6 +136,7 @@ class SlackSettingsForm extends Component
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clearSettings(){
|
public function clearSettings(){
|
||||||
|
|
||||||
if (Helper::isDemoMode()) {
|
if (Helper::isDemoMode()) {
|
||||||
session()->flash('error',trans('general.feature_disabled'));
|
session()->flash('error',trans('general.feature_disabled'));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -151,7 +151,6 @@ class SettingsServiceProvider extends ServiceProvider
|
||||||
setlocale(LC_MONETARY, config('app.locale'));
|
setlocale(LC_MONETARY, config('app.locale'));
|
||||||
setlocale(LC_NUMERIC, config('app.locale'));
|
setlocale(LC_NUMERIC, config('app.locale'));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue