Fixes for download export button

This commit is contained in:
David Bomba 2021-05-14 13:32:37 +10:00
parent 105e1af813
commit 97b49f8df6
5 changed files with 15 additions and 8 deletions

View File

@ -24,12 +24,12 @@ class ContactHashLoginController extends Controller
*/ */
public function login(string $contact_key) public function login(string $contact_key)
{ {
return redirect('/client/login'); return redirect('/client/invoices');
} }
public function magicLink(string $magic_link) public function magicLink(string $magic_link)
{ {
return redirect('/client/login'); return redirect('/client/invoices');
} }
public function errorPage() public function errorPage()

View File

@ -42,7 +42,7 @@ class ContactKeyLogin
if (MultiDB::findAndSetDbByContactKey($request->segment(3))) { if (MultiDB::findAndSetDbByContactKey($request->segment(3))) {
if($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()){ if($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()){
auth()->guard('contact')->login($client_contact, true); Auth::guard('contact')->login($client_contact, true);
return redirect()->to('client/dashboard'); return redirect()->to('client/dashboard');
} }

View File

@ -66,7 +66,7 @@ class CompanyExport implements ShouldQueue
* *
* @return CompanyToken|null * @return CompanyToken|null
*/ */
public function handle() : void public function handle()
{ {
MultiDB::setDb($this->company->db); MultiDB::setDb($this->company->db);
@ -405,7 +405,9 @@ class CompanyExport implements ShouldQueue
//write to tmp and email to owner(); //write to tmp and email to owner();
$this->zipAndSend(); $this->zipAndSend();
return true;
} }
private function transformBasicEntities($model) private function transformBasicEntities($model)

View File

@ -1,7 +1,7 @@
@component('email.template.master', ['design' => 'light', 'settings' =>$settings]) @component('email.template.master', ['design' => 'light', 'settings' =>$settings])
@slot('header') @slot('header')
@component('email.components.header', ['p' => '', 'logo' => $url]) @component('email.components.header', ['p' => '', 'logo' => $logo])
@lang('texts.download') @lang('texts.download')
@endcomponent @endcomponent
@ -12,6 +12,11 @@
@lang('texts.download_timeframe') @lang('texts.download_timeframe')
@component('email.components.button', ['url' => $url])
@lang('texts.download')
@endcomponent
@slot('signature') @slot('signature')
InvoiceNinja (contact@invoiceninja.com) InvoiceNinja (contact@invoiceninja.com)
@endslot @endslot

View File

@ -44,8 +44,8 @@ class ExportCompanyTest extends TestCase
public function testCompanyExport() public function testCompanyExport()
{ {
CompanyExport::dispatchNow($this->company, $this->company->users->first()); $res = CompanyExport::dispatchNow($this->company, $this->company->users->first());
$this->assertTrue(true); $this->assertTrue($res);
} }
} }