mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 23:04:36 -04:00
Logging for self updater (#3725)
* fixes for tests * Fixes for tests: * Fixes for tests * Add logging to self updater
This commit is contained in:
parent
5bb7f70bdf
commit
d5ae025df0
2
.github/workflows/phpunit.yml
vendored
2
.github/workflows/phpunit.yml
vendored
@ -82,7 +82,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Migrate Database
|
- name: Migrate Database
|
||||||
run: |
|
run: |
|
||||||
php artisan migrate:fresh --seed --force && php artisan db:seed --class=RandomDataSeeder --force
|
php artisan migrate:fresh --seed --force && php artisan db:seed --force
|
||||||
|
|
||||||
- name: Prepare JS/CSS assets
|
- name: Prepare JS/CSS assets
|
||||||
run: |
|
run: |
|
||||||
|
@ -85,12 +85,14 @@ class PostUpdate extends Command
|
|||||||
$output = $factory->createOutput();
|
$output = $factory->createOutput();
|
||||||
|
|
||||||
$input = new \Symfony\Component\Console\Input\ArrayInput(array(
|
$input = new \Symfony\Component\Console\Input\ArrayInput(array(
|
||||||
'command' => 'update',
|
'command' => 'update --no-dev',
|
||||||
));
|
));
|
||||||
$input->setInteractive(false);
|
$input->setInteractive(false);
|
||||||
echo "<pre>";
|
echo "<pre>";
|
||||||
$cmdret = $app->doRun($input,$output);
|
$cmdret = $app->doRun($input,$output);
|
||||||
echo "end!";
|
echo "end!";
|
||||||
|
|
||||||
|
\Log::error(print_r($cmdret,1));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace App\Http\Controllers;
|
|||||||
use App\Helpers\Email\InvoiceEmail;
|
use App\Helpers\Email\InvoiceEmail;
|
||||||
use App\Http\Requests\Email\SendEmailRequest;
|
use App\Http\Requests\Email\SendEmailRequest;
|
||||||
use App\Jobs\Invoice\EmailInvoice;
|
use App\Jobs\Invoice\EmailInvoice;
|
||||||
use App\Jobs\Mail\EntitySentEmail;
|
use App\Jobs\Mail\EntityMailer;
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Quote;
|
use App\Models\Quote;
|
||||||
@ -122,7 +122,7 @@ class EmailController extends BaseController
|
|||||||
|
|
||||||
$invitation->contact->notify((new SendGenericNotification($invitation, $entity_string, $subject, $body))->delay($when));
|
$invitation->contact->notify((new SendGenericNotification($invitation, $entity_string, $subject, $body))->delay($when));
|
||||||
|
|
||||||
EntitySentEmail::dispatch($invitation, $entity_string, $entity_obj->user, $invitation->company);
|
EntityMailer::dispatch($invitation, $entity_string, $entity_obj->user, $invitation->company);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
use Illuminate\Support\Facades\Config;
|
use Illuminate\Support\Facades\Config;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
|
||||||
class EntitySentEmail extends BaseMailerJob implements ShouldQueue
|
class EntityMailer extends BaseMailerJob implements ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
@ -57,7 +57,7 @@ class InvoiceEmailedNotification implements ShouldQueue
|
|||||||
//This allows us better control of how we
|
//This allows us better control of how we
|
||||||
//handle the mailer
|
//handle the mailer
|
||||||
|
|
||||||
EntitySentEmail::dispatch($invitation, 'invoice', $user, $invitation->company);
|
EntityMailer::dispatch($invitation, 'invoice', $user, $invitation->company);
|
||||||
}
|
}
|
||||||
|
|
||||||
$notification->method = $methods;
|
$notification->method = $methods;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Listeners\Misc;
|
namespace App\Listeners\Misc;
|
||||||
|
|
||||||
|
use App\Jobs\Mail\EntityMailer;
|
||||||
use App\Notifications\Admin\EntityViewedNotification;
|
use App\Notifications\Admin\EntityViewedNotification;
|
||||||
use App\Utils\Traits\Notifications\UserNotifies;
|
use App\Utils\Traits\Notifications\UserNotifies;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
@ -44,11 +45,25 @@ class InvitationViewedListener implements ShouldQueue
|
|||||||
$notification = new EntityViewedNotification($invitation, $entity_name);
|
$notification = new EntityViewedNotification($invitation, $entity_name);
|
||||||
|
|
||||||
foreach ($invitation->company->company_users as $company_user) {
|
foreach ($invitation->company->company_users as $company_user) {
|
||||||
|
|
||||||
$entity_viewed = "{$entity_name}_viewed";
|
$entity_viewed = "{$entity_name}_viewed";
|
||||||
|
|
||||||
$notification->method = $this->findUserNotificationTypes($invitation, $company_user, $entity_name, ['all_notifications', $entity_viewed]);
|
$methods = $this->findUserNotificationTypes($invitation, $company_user, $entity_name, ['all_notifications', $entity_viewed]);
|
||||||
|
|
||||||
|
if (($key = array_search('mail', $methods)) !== false) {
|
||||||
|
unset($methods[$key]);
|
||||||
|
|
||||||
|
//Fire mail notification here!!!
|
||||||
|
//This allows us better control of how we
|
||||||
|
//handle the mailer
|
||||||
|
|
||||||
|
EntityMailer::dispatch($invitation, 'invoice', $user, $invitation->company);
|
||||||
|
}
|
||||||
|
|
||||||
|
$notification->method = $methods;
|
||||||
|
|
||||||
$company_user->user->notify($notification);
|
$company_user->user->notify($notification);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($invitation->company->slack_webhook_url)) {
|
if (isset($invitation->company->slack_webhook_url)) {
|
||||||
@ -57,14 +72,9 @@ class InvitationViewedListener implements ShouldQueue
|
|||||||
Notification::route('slack', $invitation->company->slack_webhook_url)
|
Notification::route('slack', $invitation->company->slack_webhook_url)
|
||||||
->notify($notification);
|
->notify($notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function userNotificationArray($notifications)
|
|
||||||
{
|
|
||||||
$via_array = [];
|
|
||||||
|
|
||||||
if (stripos($this->company_user->permissions, ) !== false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
2
public/css/app.css
vendored
2
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"/js/app.js": "/js/app.js?id=49b0ee243139f6e72bd9",
|
"/js/app.js": "/js/app.js?id=49b0ee243139f6e72bd9",
|
||||||
"/css/app.css": "/css/app.css?id=c5a1e62f4e6c9fc24232",
|
"/css/app.css": "/css/app.css?id=1eeeaa187be823b49020",
|
||||||
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=3e58537817b968346c9f",
|
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=3e58537817b968346c9f",
|
||||||
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=af49e24958be5fc00c92",
|
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=af49e24958be5fc00c92",
|
||||||
"/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=f4c45f0da9868d840799",
|
"/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=f4c45f0da9868d840799",
|
||||||
|
@ -29,6 +29,9 @@ class GoogleAnalyticsTest extends TestCase
|
|||||||
|
|
||||||
public function testGoogleAnalyticsLogic()
|
public function testGoogleAnalyticsLogic()
|
||||||
{
|
{
|
||||||
|
$this->withoutEvents();
|
||||||
|
|
||||||
|
|
||||||
$analytics_id = "analytics_id";
|
$analytics_id = "analytics_id";
|
||||||
$invoice = $this->invoice;
|
$invoice = $this->invoice;
|
||||||
$client = $this->client;
|
$client = $this->client;
|
||||||
|
@ -34,6 +34,8 @@ class InvoiceActionsTest extends TestCase
|
|||||||
|
|
||||||
public function testInvoiceIsReversable()
|
public function testInvoiceIsReversable()
|
||||||
{
|
{
|
||||||
|
$this->withoutEvents();
|
||||||
|
|
||||||
$this->invoice->service()->markPaid()->save();
|
$this->invoice->service()->markPaid()->save();
|
||||||
|
|
||||||
$this->assertFalse($this->invoiceDeletable($this->invoice));
|
$this->assertFalse($this->invoiceDeletable($this->invoice));
|
||||||
@ -43,6 +45,8 @@ class InvoiceActionsTest extends TestCase
|
|||||||
|
|
||||||
public function testInvoiceIsCancellable()
|
public function testInvoiceIsCancellable()
|
||||||
{
|
{
|
||||||
|
$this->withoutEvents();
|
||||||
|
|
||||||
$payment = PaymentFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
$payment = PaymentFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
||||||
$payment->amount = 40;
|
$payment->amount = 40;
|
||||||
$payment->client_id = $this->invoice->client_id;
|
$payment->client_id = $this->invoice->client_id;
|
||||||
@ -60,6 +64,8 @@ class InvoiceActionsTest extends TestCase
|
|||||||
|
|
||||||
public function testInvoiceUnactionable()
|
public function testInvoiceUnactionable()
|
||||||
{
|
{
|
||||||
|
$this->withoutEvents();
|
||||||
|
|
||||||
$this->invoice->delete();
|
$this->invoice->delete();
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user