mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'version-110' into 'master'
fix installation issue & add ver update listener See merge request mohit.panjvani/crater-web!68
This commit is contained in:
@ -25,11 +25,11 @@ class DatabaseEnvironmentRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'app_url' => 'required|url',
|
||||
'database_connection' => 'required|string|max:50',
|
||||
'database_hostname' => 'required|string|max:50',
|
||||
'database_connection' => 'required|string',
|
||||
'database_hostname' => 'required|string',
|
||||
'database_port' => 'required|numeric',
|
||||
'database_name' => 'required|string|max:50',
|
||||
'database_username' => 'required|string|max:50',
|
||||
'database_name' => 'required|string',
|
||||
'database_username' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,55 +26,55 @@ class MailEnvironmentRequest extends FormRequest
|
||||
switch ($this->get('mail_driver')) {
|
||||
case 'smtp':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_driver' => 'required|string',
|
||||
'mail_host' => 'required|string',
|
||||
'mail_port' => 'required',
|
||||
'mail_username' => 'required|string',
|
||||
'mail_password' => 'required|string',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string',
|
||||
'from_name' => 'required|string',
|
||||
'from_mail' => 'required|string',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'mailgun':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_driver' => 'required|string',
|
||||
'mail_host' => 'required|string',
|
||||
'mail_port' => 'required',
|
||||
'mail_mailgun_domain' => 'required|string',
|
||||
'mail_mailgun_secret' => 'required|string',
|
||||
'mail_mailgun_endpoint' => 'required|string',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string',
|
||||
'from_name' => 'required|string',
|
||||
'from_mail' => 'required|string',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'ses':
|
||||
return [
|
||||
'mail_driver' => 'required|string|max:50',
|
||||
'mail_host' => 'required|string|max:50',
|
||||
'mail_port' => 'required|max:50',
|
||||
'mail_driver' => 'required|string',
|
||||
'mail_host' => 'required|string',
|
||||
'mail_port' => 'required',
|
||||
'mail_ses_key' => 'required|string',
|
||||
'mail_ses_secret' => 'required|string',
|
||||
'mail_encryption' => 'required|string|max:50',
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
'mail_encryption' => 'required|string',
|
||||
'from_name' => 'required|string',
|
||||
'from_mail' => 'required|string',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'mail':
|
||||
return [
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
'from_name' => 'required|string',
|
||||
'from_mail' => 'required|string',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'sendmail':
|
||||
return [
|
||||
'from_name' => 'required|string|max:50',
|
||||
'from_mail' => 'required|string|max:50',
|
||||
'from_name' => 'required|string',
|
||||
'from_mail' => 'required|string',
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
39
app/Listeners/Updates/v1/Version110.php
Normal file
39
app/Listeners/Updates/v1/Version110.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Listeners\Updates\v1;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Crater\Events\UpdateFinished;
|
||||
use Crater\Setting;
|
||||
|
||||
class Version110
|
||||
{
|
||||
const VERSION = '1.1.0';
|
||||
|
||||
/**
|
||||
* Create the event listener.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param object $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UpdateFinished $event)
|
||||
{
|
||||
if (!$this->check($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update Crater app version
|
||||
Setting::setSetting('version', static::VERSION);
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Crater\Events\UpdateFinished;
|
||||
use Crater\Listeners\Updates\v1\Version110;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
@ -15,6 +16,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected $listen = [
|
||||
UpdateFinished::class=> [
|
||||
Version110::class,
|
||||
],
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
|
||||
@ -54,7 +54,7 @@ class EnvironmentManager
|
||||
'error' => 'connection_failed'
|
||||
];
|
||||
} else {
|
||||
if(count(DB::connection()->select('SHOW TABLES'))) {
|
||||
if(\Schema::hasTable('users') ) {
|
||||
return [
|
||||
'error' => 'database_should_be_empty'
|
||||
];
|
||||
|
||||
@ -9,6 +9,6 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'version' => '1.0.0',
|
||||
'version' => '1.1.0',
|
||||
|
||||
];
|
||||
|
||||
@ -353,7 +353,7 @@ export default {
|
||||
this.item.name = val
|
||||
},
|
||||
deselectItem () {
|
||||
this.item = {...EstimateStub, id: this.item.id}
|
||||
this.item = {...EstimateStub, id: this.item.id, taxes: [{...TaxStub, id: Guid.raw()}]}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.itemSelect.$refs.baseSelect.$refs.search.focus()
|
||||
})
|
||||
|
||||
@ -354,7 +354,7 @@ export default {
|
||||
this.item.name = val
|
||||
},
|
||||
deselectItem () {
|
||||
this.item = {...InvoiceStub, id: this.item.id}
|
||||
this.item = {...InvoiceStub, id: this.item.id, taxes: [{...TaxStub, id: Guid.raw()}]}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.itemSelect.$refs.baseSelect.$refs.search.focus()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user