Small anal-retentive spacing/indenting tweaks

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-03-21 21:00:43 -07:00
parent 2d3ddd1c7a
commit e40762cf7f
3 changed files with 12 additions and 7 deletions

View file

@ -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 {

View file

@ -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'));
}
/**

View file

@ -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